From caa4fe38ccbb508c71a28fcaeb2552a9ed5b7715 Mon Sep 17 00:00:00 2001 From: jfh Date: Fri, 4 Sep 2020 22:34:30 +0200 Subject: [PATCH] add minification in the build --- .eslintignore | 11 +- dist/editor/extensions/ext-arrows.js | 1999 +- dist/editor/extensions/ext-arrows.js.map | 2 +- dist/editor/extensions/ext-closepath.js | 4087 +- dist/editor/extensions/ext-closepath.js.map | 2 +- dist/editor/extensions/ext-connector.js | 2293 +- dist/editor/extensions/ext-connector.js.map | 2 +- dist/editor/extensions/ext-eyedropper.js | 1803 +- dist/editor/extensions/ext-eyedropper.js.map | 2 +- dist/editor/extensions/ext-foreignobject.js | 1964 +- .../extensions/ext-foreignobject.js.map | 2 +- dist/editor/extensions/ext-grid.js | 1823 +- dist/editor/extensions/ext-grid.js.map | 2 +- dist/editor/extensions/ext-helloworld.js | 1750 +- dist/editor/extensions/ext-helloworld.js.map | 2 +- dist/editor/extensions/ext-imagelib.js | 2168 +- dist/editor/extensions/ext-imagelib.js.map | 2 +- .../editor/extensions/ext-locale/arrows/en.js | 22 +- .../editor/extensions/ext-locale/arrows/fr.js | 22 +- .../extensions/ext-locale/arrows/zh_CN.js | 22 +- .../extensions/ext-locale/closepath/en.js | 14 +- .../extensions/ext-locale/closepath/zh_CN.js | 14 +- .../extensions/ext-locale/connector/en.js | 14 +- .../extensions/ext-locale/connector/fr.js | 14 +- .../extensions/ext-locale/connector/zh_CN.js | 14 +- .../extensions/ext-locale/eyedropper/en.js | 12 +- .../extensions/ext-locale/eyedropper/zh_CN.js | 12 +- .../extensions/ext-locale/foreignobject/en.js | 28 +- .../ext-locale/foreignobject/zh_CN.js | 28 +- dist/editor/extensions/ext-locale/grid/en.js | 11 +- .../extensions/ext-locale/grid/zh_CN.js | 11 +- .../extensions/ext-locale/helloworld/en.js | 12 +- .../extensions/ext-locale/helloworld/zh_CN.js | 12 +- .../extensions/ext-locale/imagelib/de.js | 36 +- .../extensions/ext-locale/imagelib/en.js | 41 +- .../extensions/ext-locale/imagelib/fr.js | 36 +- .../extensions/ext-locale/imagelib/pl.js | 36 +- .../extensions/ext-locale/imagelib/pt_BR.js | 36 +- .../extensions/ext-locale/imagelib/ro.js | 36 +- .../extensions/ext-locale/imagelib/sk.js | 36 +- .../extensions/ext-locale/imagelib/sl.js | 36 +- .../extensions/ext-locale/imagelib/zh_CN.js | 36 +- .../extensions/ext-locale/markers/en.js | 49 +- .../extensions/ext-locale/markers/zh_CN.js | 49 +- .../extensions/ext-locale/mathjax/en.js | 11 +- .../extensions/ext-locale/mathjax/zh_CN.js | 11 +- .../extensions/ext-locale/panning/en.js | 11 +- .../extensions/ext-locale/panning/zh_CN.js | 11 +- .../extensions/ext-locale/placemark/en.js | 43 +- .../extensions/ext-locale/polygon/en.js | 17 +- .../extensions/ext-locale/polygon/zh_CN.js | 17 +- .../ext-locale/server_moinsave/en.js | 7 +- .../ext-locale/server_moinsave/zh_CN.js | 7 +- .../ext-locale/server_opensave/en.js | 7 +- .../ext-locale/server_opensave/zh_CN.js | 7 +- .../editor/extensions/ext-locale/shapes/en.js | 27 +- .../editor/extensions/ext-locale/shapes/fr.js | 27 +- .../extensions/ext-locale/shapes/zh_CN.js | 27 +- dist/editor/extensions/ext-locale/star/en.js | 25 +- .../extensions/ext-locale/star/zh_CN.js | 25 +- .../extensions/ext-locale/storage/de.js | 17 +- .../extensions/ext-locale/storage/en.js | 17 +- .../extensions/ext-locale/storage/fr.js | 17 +- .../extensions/ext-locale/storage/zh_CN.js | 14 +- .../extensions/ext-locale/webappfind/en.js | 11 +- .../extensions/ext-locale/webappfind/zh_CN.js | 11 +- dist/editor/extensions/ext-markers.js | 2342 +- dist/editor/extensions/ext-markers.js.map | 2 +- dist/editor/extensions/ext-mathjax.js | 1907 +- dist/editor/extensions/ext-mathjax.js.map | 2 +- dist/editor/extensions/ext-overview_window.js | 141 +- .../extensions/ext-overview_window.js.map | 2 +- dist/editor/extensions/ext-panning.js | 1723 +- dist/editor/extensions/ext-panning.js.map | 2 +- dist/editor/extensions/ext-php_savefile.js | 35 +- .../editor/extensions/ext-php_savefile.js.map | 2 +- dist/editor/extensions/ext-placemark.js | 2276 +- dist/editor/extensions/ext-placemark.js.map | 2 +- dist/editor/extensions/ext-polygon.js | 1933 +- dist/editor/extensions/ext-polygon.js.map | 2 +- dist/editor/extensions/ext-server_moinsave.js | 6620 +- .../extensions/ext-server_moinsave.js.map | 2 +- dist/editor/extensions/ext-server_opensave.js | 6868 +- .../extensions/ext-server_opensave.js.map | 2 +- dist/editor/extensions/ext-shapes.js | 1986 +- dist/editor/extensions/ext-shapes.js.map | 2 +- dist/editor/extensions/ext-star.js | 1902 +- dist/editor/extensions/ext-star.js.map | 2 +- dist/editor/extensions/ext-storage.js | 1977 +- dist/editor/extensions/ext-storage.js.map | 2 +- dist/editor/extensions/ext-webappfind.js | 1780 +- dist/editor/extensions/ext-webappfind.js.map | 2 +- .../extensions/ext-xdomain-messaging.js | 1709 +- .../extensions/ext-xdomain-messaging.js.map | 2 +- dist/editor/index.js | 106463 +------------- dist/editor/index.js.map | 2 +- dist/editor/system/extensions/ext-arrows.js | 2008 +- .../editor/system/extensions/ext-closepath.js | 4094 +- .../editor/system/extensions/ext-connector.js | 2302 +- .../system/extensions/ext-eyedropper.js | 1812 +- .../system/extensions/ext-foreignobject.js | 1973 +- dist/editor/system/extensions/ext-grid.js | 1832 +- .../system/extensions/ext-helloworld.js | 1759 +- dist/editor/system/extensions/ext-imagelib.js | 2177 +- .../system/extensions/ext-locale/arrows/en.js | 29 +- .../system/extensions/ext-locale/arrows/fr.js | 29 +- .../extensions/ext-locale/arrows/zh_CN.js | 29 +- .../extensions/ext-locale/closepath/en.js | 21 +- .../extensions/ext-locale/closepath/zh_CN.js | 21 +- .../extensions/ext-locale/connector/en.js | 21 +- .../extensions/ext-locale/connector/fr.js | 21 +- .../extensions/ext-locale/connector/zh_CN.js | 21 +- .../extensions/ext-locale/eyedropper/en.js | 19 +- .../extensions/ext-locale/eyedropper/zh_CN.js | 19 +- .../extensions/ext-locale/foreignobject/en.js | 35 +- .../ext-locale/foreignobject/zh_CN.js | 35 +- .../system/extensions/ext-locale/grid/en.js | 18 +- .../extensions/ext-locale/grid/zh_CN.js | 18 +- .../extensions/ext-locale/helloworld/en.js | 19 +- .../extensions/ext-locale/helloworld/zh_CN.js | 19 +- .../extensions/ext-locale/imagelib/de.js | 43 +- .../extensions/ext-locale/imagelib/en.js | 48 +- .../extensions/ext-locale/imagelib/fr.js | 43 +- .../extensions/ext-locale/imagelib/pl.js | 43 +- .../extensions/ext-locale/imagelib/pt_BR.js | 43 +- .../extensions/ext-locale/imagelib/ro.js | 43 +- .../extensions/ext-locale/imagelib/sk.js | 43 +- .../extensions/ext-locale/imagelib/sl.js | 43 +- .../extensions/ext-locale/imagelib/zh_CN.js | 43 +- .../extensions/ext-locale/markers/en.js | 56 +- .../extensions/ext-locale/markers/zh_CN.js | 56 +- .../extensions/ext-locale/mathjax/en.js | 18 +- .../extensions/ext-locale/mathjax/zh_CN.js | 18 +- .../extensions/ext-locale/panning/en.js | 18 +- .../extensions/ext-locale/panning/zh_CN.js | 18 +- .../extensions/ext-locale/placemark/en.js | 50 +- .../extensions/ext-locale/polygon/en.js | 24 +- .../extensions/ext-locale/polygon/zh_CN.js | 24 +- .../ext-locale/server_moinsave/en.js | 14 +- .../ext-locale/server_moinsave/zh_CN.js | 14 +- .../ext-locale/server_opensave/en.js | 14 +- .../ext-locale/server_opensave/zh_CN.js | 14 +- .../system/extensions/ext-locale/shapes/en.js | 34 +- .../system/extensions/ext-locale/shapes/fr.js | 34 +- .../extensions/ext-locale/shapes/zh_CN.js | 34 +- .../system/extensions/ext-locale/star/en.js | 32 +- .../extensions/ext-locale/star/zh_CN.js | 32 +- .../extensions/ext-locale/storage/de.js | 24 +- .../extensions/ext-locale/storage/en.js | 24 +- .../extensions/ext-locale/storage/fr.js | 24 +- .../extensions/ext-locale/storage/zh_CN.js | 21 +- .../extensions/ext-locale/webappfind/en.js | 18 +- .../extensions/ext-locale/webappfind/zh_CN.js | 18 +- dist/editor/system/extensions/ext-markers.js | 2351 +- dist/editor/system/extensions/ext-mathjax.js | 1916 +- .../system/extensions/ext-overview_window.js | 151 +- dist/editor/system/extensions/ext-panning.js | 1732 +- .../system/extensions/ext-php_savefile.js | 42 +- .../editor/system/extensions/ext-placemark.js | 2283 +- dist/editor/system/extensions/ext-polygon.js | 1940 +- .../system/extensions/ext-server_moinsave.js | 6629 +- .../system/extensions/ext-server_opensave.js | 6877 +- dist/editor/system/extensions/ext-shapes.js | 1995 +- dist/editor/system/extensions/ext-star.js | 1909 +- dist/editor/system/extensions/ext-storage.js | 1986 +- .../system/extensions/ext-webappfind.js | 1789 +- .../extensions/ext-xdomain-messaging.js | 1716 +- dist/editor/system/index.js | 106538 +-------------- rollup.config.js | 9 +- .../{extensions => }/shapelib/animal.json | 0 .../{extensions => }/shapelib/arrow.json | 0 .../shapelib/dialog_balloon.json | 0 .../shapelib/electronics.json | 0 .../{extensions => }/shapelib/flowchart.json | 0 .../{extensions => }/shapelib/game.json | 0 .../shapelib/license-MIT-raphael.txt | 0 .../{extensions => }/shapelib/math.json | 0 .../{extensions => }/shapelib/misc.json | 0 .../{extensions => }/shapelib/music.json | 0 .../{extensions => }/shapelib/object.json | 0 .../{extensions => }/shapelib/raphael_1.json | 0 .../{extensions => }/shapelib/raphael_2.json | 0 .../{extensions => }/shapelib/symbol.json | 0 src/svgcanvas/svgcanvas.js | 2 +- 184 files changed, 370 insertions(+), 317513 deletions(-) rename src/editor/{extensions => }/shapelib/animal.json (100%) rename src/editor/{extensions => }/shapelib/arrow.json (100%) rename src/editor/{extensions => }/shapelib/dialog_balloon.json (100%) rename src/editor/{extensions => }/shapelib/electronics.json (100%) rename src/editor/{extensions => }/shapelib/flowchart.json (100%) rename src/editor/{extensions => }/shapelib/game.json (100%) rename src/editor/{extensions => }/shapelib/license-MIT-raphael.txt (100%) rename src/editor/{extensions => }/shapelib/math.json (100%) rename src/editor/{extensions => }/shapelib/misc.json (100%) rename src/editor/{extensions => }/shapelib/music.json (100%) rename src/editor/{extensions => }/shapelib/object.json (100%) rename src/editor/{extensions => }/shapelib/raphael_1.json (100%) rename src/editor/{extensions => }/shapelib/raphael_2.json (100%) rename src/editor/{extensions => }/shapelib/symbol.json (100%) diff --git a/.eslintignore b/.eslintignore index 7a9a7e27..61acd328 100644 --- a/.eslintignore +++ b/.eslintignore @@ -7,6 +7,12 @@ dist docs/jsdoc archive +jsconfig.json +mochawesome-report +releases +!.eslintrc.js +!.ncurc.js + es-dev-server.config.js nyc.config.js @@ -32,8 +38,3 @@ src/external/dom-polyfill/* !src/external/dom-polyfill/dom-polyfill.js !src/external/dynamic-import-polyfill -jsconfig.json -mochawesome-report -releases -!.eslintrc.js -!.ncurc.js diff --git a/dist/editor/extensions/ext-arrows.js b/dist/editor/extensions/ext-arrows.js index 2b22cb0c..1829d5fc 100644 --- a/dist/editor/extensions/ext-arrows.js +++ b/dist/editor/extensions/ext-arrows.js @@ -1,1651 +1,4 @@ -function _typeof(obj) { - "@babel/helpers - typeof"; - - if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { - _typeof = function (obj) { - return typeof obj; - }; - } else { - _typeof = function (obj) { - return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; - }; - } - - return _typeof(obj); -} - -var REACT_ELEMENT_TYPE; - -function _jsx(type, props, key, children) { - if (!REACT_ELEMENT_TYPE) { - REACT_ELEMENT_TYPE = typeof Symbol === "function" && Symbol["for"] && Symbol["for"]("react.element") || 0xeac7; - } - - var defaultProps = type && type.defaultProps; - var childrenLength = arguments.length - 3; - - if (!props && childrenLength !== 0) { - props = { - children: void 0 - }; - } - - if (childrenLength === 1) { - props.children = children; - } else if (childrenLength > 1) { - var childArray = new Array(childrenLength); - - for (var i = 0; i < childrenLength; i++) { - childArray[i] = arguments[i + 3]; - } - - props.children = childArray; - } - - if (props && defaultProps) { - for (var propName in defaultProps) { - if (props[propName] === void 0) { - props[propName] = defaultProps[propName]; - } - } - } else if (!props) { - props = defaultProps || {}; - } - - return { - $$typeof: REACT_ELEMENT_TYPE, - type: type, - key: key === undefined ? null : '' + key, - ref: null, - props: props, - _owner: null - }; -} - -function _asyncIterator(iterable) { - var method; - - if (typeof Symbol !== "undefined") { - if (Symbol.asyncIterator) { - method = iterable[Symbol.asyncIterator]; - if (method != null) return method.call(iterable); - } - - if (Symbol.iterator) { - method = iterable[Symbol.iterator]; - if (method != null) return method.call(iterable); - } - } - - throw new TypeError("Object is not async iterable"); -} - -function _AwaitValue(value) { - this.wrapped = value; -} - -function _AsyncGenerator(gen) { - var front, back; - - function send(key, arg) { - return new Promise(function (resolve, reject) { - var request = { - key: key, - arg: arg, - resolve: resolve, - reject: reject, - next: null - }; - - if (back) { - back = back.next = request; - } else { - front = back = request; - resume(key, arg); - } - }); - } - - function resume(key, arg) { - try { - var result = gen[key](arg); - var value = result.value; - var wrappedAwait = value instanceof _AwaitValue; - Promise.resolve(wrappedAwait ? value.wrapped : value).then(function (arg) { - if (wrappedAwait) { - resume(key === "return" ? "return" : "next", arg); - return; - } - - settle(result.done ? "return" : "normal", arg); - }, function (err) { - resume("throw", err); - }); - } catch (err) { - settle("throw", err); - } - } - - function settle(type, value) { - switch (type) { - case "return": - front.resolve({ - value: value, - done: true - }); - break; - - case "throw": - front.reject(value); - break; - - default: - front.resolve({ - value: value, - done: false - }); - break; - } - - front = front.next; - - if (front) { - resume(front.key, front.arg); - } else { - back = null; - } - } - - this._invoke = send; - - if (typeof gen.return !== "function") { - this.return = undefined; - } -} - -if (typeof Symbol === "function" && Symbol.asyncIterator) { - _AsyncGenerator.prototype[Symbol.asyncIterator] = function () { - return this; - }; -} - -_AsyncGenerator.prototype.next = function (arg) { - return this._invoke("next", arg); -}; - -_AsyncGenerator.prototype.throw = function (arg) { - return this._invoke("throw", arg); -}; - -_AsyncGenerator.prototype.return = function (arg) { - return this._invoke("return", arg); -}; - -function _wrapAsyncGenerator(fn) { - return function () { - return new _AsyncGenerator(fn.apply(this, arguments)); - }; -} - -function _awaitAsyncGenerator(value) { - return new _AwaitValue(value); -} - -function _asyncGeneratorDelegate(inner, awaitWrap) { - var iter = {}, - waiting = false; - - function pump(key, value) { - waiting = true; - value = new Promise(function (resolve) { - resolve(inner[key](value)); - }); - return { - done: false, - value: awaitWrap(value) - }; - } - - ; - - if (typeof Symbol === "function" && Symbol.iterator) { - iter[Symbol.iterator] = function () { - return this; - }; - } - - iter.next = function (value) { - if (waiting) { - waiting = false; - return value; - } - - return pump("next", value); - }; - - if (typeof inner.throw === "function") { - iter.throw = function (value) { - if (waiting) { - waiting = false; - throw value; - } - - return pump("throw", value); - }; - } - - if (typeof inner.return === "function") { - iter.return = function (value) { - if (waiting) { - waiting = false; - return value; - } - - return pump("return", value); - }; - } - - return iter; -} - -function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { - try { - var info = gen[key](arg); - var value = info.value; - } catch (error) { - reject(error); - return; - } - - if (info.done) { - resolve(value); - } else { - Promise.resolve(value).then(_next, _throw); - } -} - -function _asyncToGenerator(fn) { - return function () { - var self = this, - args = arguments; - return new Promise(function (resolve, reject) { - var gen = fn.apply(self, args); - - function _next(value) { - asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value); - } - - function _throw(err) { - asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err); - } - - _next(undefined); - }); - }; -} - -function _classCallCheck(instance, Constructor) { - if (!(instance instanceof Constructor)) { - throw new TypeError("Cannot call a class as a function"); - } -} - -function _defineProperties(target, props) { - for (var i = 0; i < props.length; i++) { - var descriptor = props[i]; - descriptor.enumerable = descriptor.enumerable || false; - descriptor.configurable = true; - if ("value" in descriptor) descriptor.writable = true; - Object.defineProperty(target, descriptor.key, descriptor); - } -} - -function _createClass(Constructor, protoProps, staticProps) { - if (protoProps) _defineProperties(Constructor.prototype, protoProps); - if (staticProps) _defineProperties(Constructor, staticProps); - return Constructor; -} - -function _defineEnumerableProperties(obj, descs) { - for (var key in descs) { - var desc = descs[key]; - desc.configurable = desc.enumerable = true; - if ("value" in desc) desc.writable = true; - Object.defineProperty(obj, key, desc); - } - - if (Object.getOwnPropertySymbols) { - var objectSymbols = Object.getOwnPropertySymbols(descs); - - for (var i = 0; i < objectSymbols.length; i++) { - var sym = objectSymbols[i]; - var desc = descs[sym]; - desc.configurable = desc.enumerable = true; - if ("value" in desc) desc.writable = true; - Object.defineProperty(obj, sym, desc); - } - } - - return obj; -} - -function _defaults(obj, defaults) { - var keys = Object.getOwnPropertyNames(defaults); - - for (var i = 0; i < keys.length; i++) { - var key = keys[i]; - var value = Object.getOwnPropertyDescriptor(defaults, key); - - if (value && value.configurable && obj[key] === undefined) { - Object.defineProperty(obj, key, value); - } - } - - return obj; -} - -function _defineProperty(obj, key, value) { - if (key in obj) { - Object.defineProperty(obj, key, { - value: value, - enumerable: true, - configurable: true, - writable: true - }); - } else { - obj[key] = value; - } - - return obj; -} - -function _extends() { - _extends = Object.assign || function (target) { - for (var i = 1; i < arguments.length; i++) { - var source = arguments[i]; - - for (var key in source) { - if (Object.prototype.hasOwnProperty.call(source, key)) { - target[key] = source[key]; - } - } - } - - return target; - }; - - return _extends.apply(this, arguments); -} - -function _objectSpread(target) { - for (var i = 1; i < arguments.length; i++) { - var source = arguments[i] != null ? Object(arguments[i]) : {}; - var ownKeys = Object.keys(source); - - if (typeof Object.getOwnPropertySymbols === 'function') { - ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function (sym) { - return Object.getOwnPropertyDescriptor(source, sym).enumerable; - })); - } - - ownKeys.forEach(function (key) { - _defineProperty(target, key, source[key]); - }); - } - - return target; -} - -function ownKeys(object, enumerableOnly) { - var keys = Object.keys(object); - - if (Object.getOwnPropertySymbols) { - var symbols = Object.getOwnPropertySymbols(object); - if (enumerableOnly) symbols = symbols.filter(function (sym) { - return Object.getOwnPropertyDescriptor(object, sym).enumerable; - }); - keys.push.apply(keys, symbols); - } - - return keys; -} - -function _objectSpread2(target) { - for (var i = 1; i < arguments.length; i++) { - var source = arguments[i] != null ? arguments[i] : {}; - - if (i % 2) { - ownKeys(Object(source), true).forEach(function (key) { - _defineProperty(target, key, source[key]); - }); - } else if (Object.getOwnPropertyDescriptors) { - Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); - } else { - ownKeys(Object(source)).forEach(function (key) { - Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); - }); - } - } - - return target; -} - -function _inherits(subClass, superClass) { - if (typeof superClass !== "function" && superClass !== null) { - throw new TypeError("Super expression must either be null or a function"); - } - - subClass.prototype = Object.create(superClass && superClass.prototype, { - constructor: { - value: subClass, - writable: true, - configurable: true - } - }); - if (superClass) _setPrototypeOf(subClass, superClass); -} - -function _inheritsLoose(subClass, superClass) { - subClass.prototype = Object.create(superClass.prototype); - subClass.prototype.constructor = subClass; - subClass.__proto__ = superClass; -} - -function _getPrototypeOf(o) { - _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { - return o.__proto__ || Object.getPrototypeOf(o); - }; - return _getPrototypeOf(o); -} - -function _setPrototypeOf(o, p) { - _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { - o.__proto__ = p; - return o; - }; - - 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 _construct(Parent, args, Class) { - if (_isNativeReflectConstruct()) { - _construct = Reflect.construct; - } else { - _construct = function _construct(Parent, args, Class) { - var a = [null]; - a.push.apply(a, args); - var Constructor = Function.bind.apply(Parent, a); - var instance = new Constructor(); - if (Class) _setPrototypeOf(instance, Class.prototype); - return instance; - }; - } - - return _construct.apply(null, arguments); -} - -function _isNativeFunction(fn) { - return Function.toString.call(fn).indexOf("[native code]") !== -1; -} - -function _wrapNativeSuper(Class) { - var _cache = typeof Map === "function" ? new Map() : undefined; - - _wrapNativeSuper = function _wrapNativeSuper(Class) { - if (Class === null || !_isNativeFunction(Class)) return Class; - - if (typeof Class !== "function") { - throw new TypeError("Super expression must either be null or a function"); - } - - if (typeof _cache !== "undefined") { - if (_cache.has(Class)) return _cache.get(Class); - - _cache.set(Class, Wrapper); - } - - function Wrapper() { - return _construct(Class, arguments, _getPrototypeOf(this).constructor); - } - - Wrapper.prototype = Object.create(Class.prototype, { - constructor: { - value: Wrapper, - enumerable: false, - writable: true, - configurable: true - } - }); - return _setPrototypeOf(Wrapper, Class); - }; - - return _wrapNativeSuper(Class); -} - -function _instanceof(left, right) { - if (right != null && typeof Symbol !== "undefined" && right[Symbol.hasInstance]) { - return !!right[Symbol.hasInstance](left); - } else { - return left instanceof right; - } -} - -function _interopRequireDefault(obj) { - return obj && obj.__esModule ? obj : { - default: obj - }; -} - -function _getRequireWildcardCache() { - if (typeof WeakMap !== "function") return null; - var cache = new WeakMap(); - - _getRequireWildcardCache = function () { - return cache; - }; - - return cache; -} - -function _interopRequireWildcard(obj) { - if (obj && obj.__esModule) { - return obj; - } - - if (obj === null || typeof obj !== "object" && typeof obj !== "function") { - return { - default: obj - }; - } - - var cache = _getRequireWildcardCache(); - - if (cache && cache.has(obj)) { - return cache.get(obj); - } - - var newObj = {}; - var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; - - for (var key in obj) { - if (Object.prototype.hasOwnProperty.call(obj, key)) { - var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; - - if (desc && (desc.get || desc.set)) { - Object.defineProperty(newObj, key, desc); - } else { - newObj[key] = obj[key]; - } - } - } - - newObj.default = obj; - - if (cache) { - cache.set(obj, newObj); - } - - return newObj; -} - -function _newArrowCheck(innerThis, boundThis) { - if (innerThis !== boundThis) { - throw new TypeError("Cannot instantiate an arrow function"); - } -} - -function _objectDestructuringEmpty(obj) { - if (obj == null) throw new TypeError("Cannot destructure undefined"); -} - -function _objectWithoutPropertiesLoose(source, excluded) { - if (source == null) return {}; - var target = {}; - var sourceKeys = Object.keys(source); - var key, i; - - for (i = 0; i < sourceKeys.length; i++) { - key = sourceKeys[i]; - if (excluded.indexOf(key) >= 0) continue; - target[key] = source[key]; - } - - return target; -} - -function _objectWithoutProperties(source, excluded) { - if (source == null) return {}; - - var target = _objectWithoutPropertiesLoose(source, excluded); - - var key, i; - - if (Object.getOwnPropertySymbols) { - var sourceSymbolKeys = Object.getOwnPropertySymbols(source); - - for (i = 0; i < sourceSymbolKeys.length; i++) { - key = sourceSymbolKeys[i]; - if (excluded.indexOf(key) >= 0) continue; - if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; - target[key] = source[key]; - } - } - - return target; -} - -function _assertThisInitialized(self) { - if (self === void 0) { - throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); - } - - return self; -} - -function _possibleConstructorReturn(self, call) { - if (call && (typeof call === "object" || typeof call === "function")) { - return call; - } - - return _assertThisInitialized(self); -} - -function _createSuper(Derived) { - var hasNativeReflectConstruct = _isNativeReflectConstruct(); - - return function _createSuperInternal() { - var Super = _getPrototypeOf(Derived), - result; - - if (hasNativeReflectConstruct) { - 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); - if (object === null) break; - } - - return object; -} - -function _get(target, property, receiver) { - if (typeof Reflect !== "undefined" && Reflect.get) { - _get = Reflect.get; - } else { - _get = function _get(target, property, receiver) { - var base = _superPropBase(target, property); - - if (!base) return; - var desc = Object.getOwnPropertyDescriptor(base, property); - - if (desc.get) { - return desc.get.call(receiver); - } - - return desc.value; - }; - } - - return _get(target, property, receiver || target); -} - -function set(target, property, value, receiver) { - if (typeof Reflect !== "undefined" && Reflect.set) { - set = Reflect.set; - } else { - set = function set(target, property, value, receiver) { - var base = _superPropBase(target, property); - - var desc; - - if (base) { - desc = Object.getOwnPropertyDescriptor(base, property); - - if (desc.set) { - desc.set.call(receiver, value); - return true; - } else if (!desc.writable) { - return false; - } - } - - desc = Object.getOwnPropertyDescriptor(receiver, property); - - if (desc) { - if (!desc.writable) { - return false; - } - - desc.value = value; - Object.defineProperty(receiver, property, desc); - } else { - _defineProperty(receiver, property, value); - } - - return true; - }; - } - - return set(target, property, value, receiver); -} - -function _set(target, property, value, receiver, isStrict) { - var s = set(target, property, value, receiver || target); - - if (!s && isStrict) { - throw new Error('failed to set property'); - } - - return value; -} - -function _taggedTemplateLiteral(strings, raw) { - if (!raw) { - raw = strings.slice(0); - } - - return Object.freeze(Object.defineProperties(strings, { - raw: { - value: Object.freeze(raw) - } - })); -} - -function _taggedTemplateLiteralLoose(strings, raw) { - if (!raw) { - raw = strings.slice(0); - } - - strings.raw = raw; - return strings; -} - -function _readOnlyError(name) { - throw new Error("\"" + name + "\" is read-only"); -} - -function _classNameTDZError(name) { - throw new Error("Class \"" + name + "\" cannot be referenced in computed property keys."); -} - -function _temporalUndefined() {} - -function _tdz(name) { - throw new ReferenceError(name + " is not defined - temporal dead zone"); -} - -function _temporalRef(val, name) { - return val === _temporalUndefined ? _tdz(name) : val; -} - -function _slicedToArray(arr, i) { - return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); -} - -function _slicedToArrayLoose(arr, i) { - return _arrayWithHoles(arr) || _iterableToArrayLimitLoose(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); -} - -function _toArray(arr) { - return _arrayWithHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableRest(); -} - -function _toConsumableArray(arr) { - return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); -} - -function _arrayWithoutHoles(arr) { - if (Array.isArray(arr)) return _arrayLikeToArray(arr); -} - -function _arrayWithHoles(arr) { - if (Array.isArray(arr)) return arr; -} - -function _maybeArrayLike(next, arr, i) { - if (arr && !Array.isArray(arr) && typeof arr.length === "number") { - var len = arr.length; - return _arrayLikeToArray(arr, i !== void 0 && i < len ? i : len); - } - - return next(arr, i); -} - -function _iterableToArray(iter) { - if (typeof Symbol !== "undefined" && Symbol.iterator in Object(iter)) return Array.from(iter); -} - -function _iterableToArrayLimit(arr, i) { - if (typeof Symbol === "undefined" || !(Symbol.iterator in Object(arr))) return; - var _arr = []; - var _n = true; - var _d = false; - var _e = undefined; - - try { - for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { - _arr.push(_s.value); - - if (i && _arr.length === i) break; - } - } catch (err) { - _d = true; - _e = err; - } finally { - try { - if (!_n && _i["return"] != null) _i["return"](); - } finally { - if (_d) throw _e; - } - } - - return _arr; -} - -function _iterableToArrayLimitLoose(arr, i) { - if (typeof Symbol === "undefined" || !(Symbol.iterator in Object(arr))) return; - var _arr = []; - - for (var _iterator = arr[Symbol.iterator](), _step; !(_step = _iterator.next()).done;) { - _arr.push(_step.value); - - if (i && _arr.length === i) break; - } - - 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(o); - 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.\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.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); -} - -function _createForOfIteratorHelper(o, allowArrayLike) { - var it; - - if (typeof Symbol === "undefined" || o[Symbol.iterator] == null) { - if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") { - if (it) o = it; - 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 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; - } - } - }; -} - -function _createForOfIteratorHelperLoose(o, allowArrayLike) { - var it; - - if (typeof Symbol === "undefined" || o[Symbol.iterator] == null) { - if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") { - if (it) o = it; - var i = 0; - return function () { - if (i >= o.length) return { - done: true - }; - return { - done: false, - value: o[i++] - }; - }; - } - - throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); - } - - it = o[Symbol.iterator](); - return it.next.bind(it); -} - -function _skipFirstGeneratorNext(fn) { - return function () { - var it = fn.apply(this, arguments); - it.next(); - return it; - }; -} - -function _toPrimitive(input, hint) { - if (typeof input !== "object" || input === null) return input; - var prim = input[Symbol.toPrimitive]; - - if (prim !== undefined) { - var res = prim.call(input, hint || "default"); - if (typeof res !== "object") return res; - throw new TypeError("@@toPrimitive must return a primitive value."); - } - - return (hint === "string" ? String : Number)(input); -} - -function _toPropertyKey(arg) { - var key = _toPrimitive(arg, "string"); - - return typeof key === "symbol" ? key : String(key); -} - -function _initializerWarningHelper(descriptor, context) { - throw new Error('Decorating class property failed. Please ensure that ' + 'proposal-class-properties is enabled and runs after the decorators transform.'); -} - -function _initializerDefineProperty(target, property, descriptor, context) { - if (!descriptor) return; - Object.defineProperty(target, property, { - enumerable: descriptor.enumerable, - configurable: descriptor.configurable, - writable: descriptor.writable, - value: descriptor.initializer ? descriptor.initializer.call(context) : void 0 - }); -} - -function _applyDecoratedDescriptor(target, property, decorators, descriptor, context) { - var desc = {}; - Object.keys(descriptor).forEach(function (key) { - desc[key] = descriptor[key]; - }); - desc.enumerable = !!desc.enumerable; - desc.configurable = !!desc.configurable; - - if ('value' in desc || desc.initializer) { - desc.writable = true; - } - - desc = decorators.slice().reverse().reduce(function (desc, decorator) { - return decorator(target, property, desc) || desc; - }, desc); - - if (context && desc.initializer !== void 0) { - desc.value = desc.initializer ? desc.initializer.call(context) : void 0; - desc.initializer = undefined; - } - - if (desc.initializer === void 0) { - Object.defineProperty(target, property, desc); - desc = null; - } - - return desc; -} - -var id = 0; - -function _classPrivateFieldLooseKey(name) { - return "__private_" + id++ + "_" + name; -} - -function _classPrivateFieldLooseBase(receiver, privateKey) { - if (!Object.prototype.hasOwnProperty.call(receiver, privateKey)) { - throw new TypeError("attempted to use private field on non-instance"); - } - - return receiver; -} - -function _classPrivateFieldGet(receiver, privateMap) { - var descriptor = privateMap.get(receiver); - - if (!descriptor) { - throw new TypeError("attempted to get private field on non-instance"); - } - - if (descriptor.get) { - return descriptor.get.call(receiver); - } - - return descriptor.value; -} - -function _classPrivateFieldSet(receiver, privateMap, value) { - var descriptor = privateMap.get(receiver); - - if (!descriptor) { - throw new TypeError("attempted to set private field on non-instance"); - } - - if (descriptor.set) { - descriptor.set.call(receiver, value); - } else { - if (!descriptor.writable) { - throw new TypeError("attempted to set read only private field"); - } - - descriptor.value = value; - } - - return value; -} - -function _classPrivateFieldDestructureSet(receiver, privateMap) { - if (!privateMap.has(receiver)) { - throw new TypeError("attempted to set private field on non-instance"); - } - - var descriptor = privateMap.get(receiver); - - if (descriptor.set) { - if (!("__destrObj" in descriptor)) { - descriptor.__destrObj = { - set value(v) { - descriptor.set.call(receiver, v); - } - - }; - } - - return descriptor.__destrObj; - } else { - if (!descriptor.writable) { - throw new TypeError("attempted to set read only private field"); - } - - return descriptor; - } -} - -function _classStaticPrivateFieldSpecGet(receiver, classConstructor, descriptor) { - if (receiver !== classConstructor) { - throw new TypeError("Private static access of wrong provenance"); - } - - if (descriptor.get) { - return descriptor.get.call(receiver); - } - - return descriptor.value; -} - -function _classStaticPrivateFieldSpecSet(receiver, classConstructor, descriptor, value) { - if (receiver !== classConstructor) { - throw new TypeError("Private static access of wrong provenance"); - } - - if (descriptor.set) { - descriptor.set.call(receiver, value); - } else { - if (!descriptor.writable) { - throw new TypeError("attempted to set read only private field"); - } - - descriptor.value = value; - } - - return value; -} - -function _classStaticPrivateMethodGet(receiver, classConstructor, method) { - if (receiver !== classConstructor) { - throw new TypeError("Private static access of wrong provenance"); - } - - return method; -} - -function _classStaticPrivateMethodSet() { - throw new TypeError("attempted to set read only static private field"); -} - -function _decorate(decorators, factory, superClass, mixins) { - var api = _getDecoratorsApi(); - - if (mixins) { - for (var i = 0; i < mixins.length; i++) { - api = mixins[i](api); - } - } - - var r = factory(function initialize(O) { - api.initializeInstanceElements(O, decorated.elements); - }, superClass); - var decorated = api.decorateClass(_coalesceClassElements(r.d.map(_createElementDescriptor)), decorators); - api.initializeClassElements(r.F, decorated.elements); - return api.runClassFinishers(r.F, decorated.finishers); -} - -function _getDecoratorsApi() { - _getDecoratorsApi = function () { - return api; - }; - - var api = { - elementsDefinitionOrder: [["method"], ["field"]], - initializeInstanceElements: function (O, elements) { - ["method", "field"].forEach(function (kind) { - elements.forEach(function (element) { - if (element.kind === kind && element.placement === "own") { - this.defineClassElement(O, element); - } - }, this); - }, this); - }, - initializeClassElements: function (F, elements) { - var proto = F.prototype; - ["method", "field"].forEach(function (kind) { - elements.forEach(function (element) { - var placement = element.placement; - - if (element.kind === kind && (placement === "static" || placement === "prototype")) { - var receiver = placement === "static" ? F : proto; - this.defineClassElement(receiver, element); - } - }, this); - }, this); - }, - defineClassElement: function (receiver, element) { - var descriptor = element.descriptor; - - if (element.kind === "field") { - var initializer = element.initializer; - descriptor = { - enumerable: descriptor.enumerable, - writable: descriptor.writable, - configurable: descriptor.configurable, - value: initializer === void 0 ? void 0 : initializer.call(receiver) - }; - } - - Object.defineProperty(receiver, element.key, descriptor); - }, - decorateClass: function (elements, decorators) { - var newElements = []; - var finishers = []; - var placements = { - static: [], - prototype: [], - own: [] - }; - elements.forEach(function (element) { - this.addElementPlacement(element, placements); - }, this); - elements.forEach(function (element) { - if (!_hasDecorators(element)) return newElements.push(element); - var elementFinishersExtras = this.decorateElement(element, placements); - newElements.push(elementFinishersExtras.element); - newElements.push.apply(newElements, elementFinishersExtras.extras); - finishers.push.apply(finishers, elementFinishersExtras.finishers); - }, this); - - if (!decorators) { - return { - elements: newElements, - finishers: finishers - }; - } - - var result = this.decorateConstructor(newElements, decorators); - finishers.push.apply(finishers, result.finishers); - result.finishers = finishers; - return result; - }, - addElementPlacement: function (element, placements, silent) { - var keys = placements[element.placement]; - - if (!silent && keys.indexOf(element.key) !== -1) { - throw new TypeError("Duplicated element (" + element.key + ")"); - } - - keys.push(element.key); - }, - decorateElement: function (element, placements) { - var extras = []; - var finishers = []; - - for (var decorators = element.decorators, i = decorators.length - 1; i >= 0; i--) { - var keys = placements[element.placement]; - keys.splice(keys.indexOf(element.key), 1); - var elementObject = this.fromElementDescriptor(element); - var elementFinisherExtras = this.toElementFinisherExtras((0, decorators[i])(elementObject) || elementObject); - element = elementFinisherExtras.element; - this.addElementPlacement(element, placements); - - if (elementFinisherExtras.finisher) { - finishers.push(elementFinisherExtras.finisher); - } - - var newExtras = elementFinisherExtras.extras; - - if (newExtras) { - for (var j = 0; j < newExtras.length; j++) { - this.addElementPlacement(newExtras[j], placements); - } - - extras.push.apply(extras, newExtras); - } - } - - return { - element: element, - finishers: finishers, - extras: extras - }; - }, - decorateConstructor: function (elements, decorators) { - var finishers = []; - - for (var i = decorators.length - 1; i >= 0; i--) { - var obj = this.fromClassDescriptor(elements); - var elementsAndFinisher = this.toClassDescriptor((0, decorators[i])(obj) || obj); - - if (elementsAndFinisher.finisher !== undefined) { - finishers.push(elementsAndFinisher.finisher); - } - - if (elementsAndFinisher.elements !== undefined) { - elements = elementsAndFinisher.elements; - - for (var j = 0; j < elements.length - 1; j++) { - for (var k = j + 1; k < elements.length; k++) { - if (elements[j].key === elements[k].key && elements[j].placement === elements[k].placement) { - throw new TypeError("Duplicated element (" + elements[j].key + ")"); - } - } - } - } - } - - return { - elements: elements, - finishers: finishers - }; - }, - fromElementDescriptor: function (element) { - var obj = { - kind: element.kind, - key: element.key, - placement: element.placement, - descriptor: element.descriptor - }; - var desc = { - value: "Descriptor", - configurable: true - }; - Object.defineProperty(obj, Symbol.toStringTag, desc); - if (element.kind === "field") obj.initializer = element.initializer; - return obj; - }, - toElementDescriptors: function (elementObjects) { - if (elementObjects === undefined) return; - return _toArray(elementObjects).map(function (elementObject) { - var element = this.toElementDescriptor(elementObject); - this.disallowProperty(elementObject, "finisher", "An element descriptor"); - this.disallowProperty(elementObject, "extras", "An element descriptor"); - return element; - }, this); - }, - toElementDescriptor: function (elementObject) { - var kind = String(elementObject.kind); - - if (kind !== "method" && kind !== "field") { - throw new TypeError('An element descriptor\'s .kind property must be either "method" or' + ' "field", but a decorator created an element descriptor with' + ' .kind "' + kind + '"'); - } - - var key = _toPropertyKey(elementObject.key); - - var placement = String(elementObject.placement); - - if (placement !== "static" && placement !== "prototype" && placement !== "own") { - throw new TypeError('An element descriptor\'s .placement property must be one of "static",' + ' "prototype" or "own", but a decorator created an element descriptor' + ' with .placement "' + placement + '"'); - } - - var descriptor = elementObject.descriptor; - this.disallowProperty(elementObject, "elements", "An element descriptor"); - var element = { - kind: kind, - key: key, - placement: placement, - descriptor: Object.assign({}, descriptor) - }; - - if (kind !== "field") { - this.disallowProperty(elementObject, "initializer", "A method descriptor"); - } else { - this.disallowProperty(descriptor, "get", "The property descriptor of a field descriptor"); - this.disallowProperty(descriptor, "set", "The property descriptor of a field descriptor"); - this.disallowProperty(descriptor, "value", "The property descriptor of a field descriptor"); - element.initializer = elementObject.initializer; - } - - return element; - }, - toElementFinisherExtras: function (elementObject) { - var element = this.toElementDescriptor(elementObject); - - var finisher = _optionalCallableProperty(elementObject, "finisher"); - - var extras = this.toElementDescriptors(elementObject.extras); - return { - element: element, - finisher: finisher, - extras: extras - }; - }, - fromClassDescriptor: function (elements) { - var obj = { - kind: "class", - elements: elements.map(this.fromElementDescriptor, this) - }; - var desc = { - value: "Descriptor", - configurable: true - }; - Object.defineProperty(obj, Symbol.toStringTag, desc); - return obj; - }, - toClassDescriptor: function (obj) { - var kind = String(obj.kind); - - if (kind !== "class") { - throw new TypeError('A class descriptor\'s .kind property must be "class", but a decorator' + ' created a class descriptor with .kind "' + kind + '"'); - } - - this.disallowProperty(obj, "key", "A class descriptor"); - this.disallowProperty(obj, "placement", "A class descriptor"); - this.disallowProperty(obj, "descriptor", "A class descriptor"); - this.disallowProperty(obj, "initializer", "A class descriptor"); - this.disallowProperty(obj, "extras", "A class descriptor"); - - var finisher = _optionalCallableProperty(obj, "finisher"); - - var elements = this.toElementDescriptors(obj.elements); - return { - elements: elements, - finisher: finisher - }; - }, - runClassFinishers: function (constructor, finishers) { - for (var i = 0; i < finishers.length; i++) { - var newConstructor = (0, finishers[i])(constructor); - - if (newConstructor !== undefined) { - if (typeof newConstructor !== "function") { - throw new TypeError("Finishers must return a constructor."); - } - - constructor = newConstructor; - } - } - - return constructor; - }, - disallowProperty: function (obj, name, objectType) { - if (obj[name] !== undefined) { - throw new TypeError(objectType + " can't have a ." + name + " property."); - } - } - }; - return api; -} - -function _createElementDescriptor(def) { - var key = _toPropertyKey(def.key); - - var descriptor; - - if (def.kind === "method") { - descriptor = { - value: def.value, - writable: true, - configurable: true, - enumerable: false - }; - } else if (def.kind === "get") { - descriptor = { - get: def.value, - configurable: true, - enumerable: false - }; - } else if (def.kind === "set") { - descriptor = { - set: def.value, - configurable: true, - enumerable: false - }; - } else if (def.kind === "field") { - descriptor = { - configurable: true, - writable: true, - enumerable: true - }; - } - - var element = { - kind: def.kind === "field" ? "field" : "method", - key: key, - placement: def.static ? "static" : def.kind === "field" ? "own" : "prototype", - descriptor: descriptor - }; - if (def.decorators) element.decorators = def.decorators; - if (def.kind === "field") element.initializer = def.value; - return element; -} - -function _coalesceGetterSetter(element, other) { - if (element.descriptor.get !== undefined) { - other.descriptor.get = element.descriptor.get; - } else { - other.descriptor.set = element.descriptor.set; - } -} - -function _coalesceClassElements(elements) { - var newElements = []; - - var isSameElement = function (other) { - return other.kind === "method" && other.key === element.key && other.placement === element.placement; - }; - - for (var i = 0; i < elements.length; i++) { - var element = elements[i]; - var other; - - if (element.kind === "method" && (other = newElements.find(isSameElement))) { - if (_isDataDescriptor(element.descriptor) || _isDataDescriptor(other.descriptor)) { - if (_hasDecorators(element) || _hasDecorators(other)) { - throw new ReferenceError("Duplicated methods (" + element.key + ") can't be decorated."); - } - - other.descriptor = element.descriptor; - } else { - if (_hasDecorators(element)) { - if (_hasDecorators(other)) { - throw new ReferenceError("Decorators can't be placed on different accessors with for " + "the same property (" + element.key + ")."); - } - - other.decorators = element.decorators; - } - - _coalesceGetterSetter(element, other); - } - } else { - newElements.push(element); - } - } - - return newElements; -} - -function _hasDecorators(element) { - return element.decorators && element.decorators.length; -} - -function _isDataDescriptor(desc) { - return desc !== undefined && !(desc.value === undefined && desc.writable === undefined); -} - -function _optionalCallableProperty(obj, name) { - var value = obj[name]; - - if (value !== undefined && typeof value !== "function") { - throw new TypeError("Expected '" + name + "' to be a function"); - } - - return value; -} - -function _classPrivateMethodGet(receiver, privateSet, fn) { - if (!privateSet.has(receiver)) { - throw new TypeError("attempted to get private field on non-instance"); - } - - return fn; -} - -function _classPrivateMethodSet() { - throw new TypeError("attempted to reassign private method"); -} - -function _wrapRegExp(re, groups) { - _wrapRegExp = function (re, groups) { - return new BabelRegExp(re, undefined, groups); - }; - - var _RegExp = _wrapNativeSuper(RegExp); - - var _super = RegExp.prototype; - - var _groups = new WeakMap(); - - function BabelRegExp(re, flags, groups) { - var _this = _RegExp.call(this, re, flags); - - _groups.set(_this, groups || _groups.get(re)); - - return _this; - } - - _inherits(BabelRegExp, _RegExp); - - BabelRegExp.prototype.exec = function (str) { - var result = _super.exec.call(this, str); - - if (result) result.groups = buildGroups(result, this); - return result; - }; - - BabelRegExp.prototype[Symbol.replace] = function (str, substitution) { - if (typeof substitution === "string") { - var groups = _groups.get(this); - - return _super[Symbol.replace].call(this, str, substitution.replace(/\$<([^>]+)>/g, function (_, name) { - return "$" + groups[name]; - })); - } else if (typeof substitution === "function") { - var _this = this; - - return _super[Symbol.replace].call(this, str, function () { - var args = []; - args.push.apply(args, arguments); - - if (typeof args[args.length - 1] !== "object") { - args.push(buildGroups(args, _this)); - } - - return substitution.apply(this, args); - }); - } else { - return _super[Symbol.replace].call(this, str, substitution); - } - }; - - function buildGroups(result, re) { - var g = _groups.get(re); - - return Object.keys(g).reduce(function (groups, name) { - groups[name] = result[g[name]]; - return groups; - }, Object.create(null)); - } - - return _wrapRegExp.apply(this, arguments); -} - +function _AwaitValue(e){this.wrapped=e}function _AsyncGenerator(e){var t,r;function resume(t,r){try{var n=e[t](r),a=n.value,o=a instanceof _AwaitValue;Promise.resolve(o?a.wrapped:a).then((function(e){o?resume("return"===t?"return":"next",e):settle(n.done?"return":"normal",e)}),(function(e){resume("throw",e)}))}catch(e){settle("throw",e)}}function settle(e,n){switch(e){case"return":t.resolve({value:n,done:!0});break;case"throw":t.reject(n);break;default:t.resolve({value:n,done:!1})}(t=t.next)?resume(t.key,t.arg):r=null}this._invoke=function send(e,n){return new Promise((function(a,o){var i={key:e,arg:n,resolve:a,reject:o,next:null};r?r=r.next=i:(t=r=i,resume(e,n))}))},"function"!=typeof e.return&&(this.return=void 0)}function asyncGeneratorStep(e,t,r,n,a,o,i){try{var l=e[o](i),u=l.value}catch(e){return void r(e)}l.done?t(u):Promise.resolve(u).then(n,a)}function _asyncToGenerator(e){return function(){var t=this,r=arguments;return new Promise((function(n,a){var o=e.apply(t,r);function _next(e){asyncGeneratorStep(o,n,a,_next,_throw,"next",e)}function _throw(e){asyncGeneratorStep(o,n,a,_next,_throw,"throw",e)}_next(void 0)}))}}"function"==typeof Symbol&&Symbol.asyncIterator&&(_AsyncGenerator.prototype[Symbol.asyncIterator]=function(){return this}),_AsyncGenerator.prototype.next=function(e){return this._invoke("next",e)},_AsyncGenerator.prototype.throw=function(e){return this._invoke("throw",e)},_AsyncGenerator.prototype.return=function(e){return this._invoke("return",e)}; /** * @file ext-arrows.js * @@ -1654,353 +7,5 @@ function _wrapRegExp(re, groups) { * @copyright 2010 Alexis Deveria * */ -var extArrows = { - name: 'arrows', - init: function init(S) { - var _this = this; - - return _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee2() { - var strings, svgEditor, svgCanvas, addElem, nonce, $, prefix, selElems, arrowprefix, randomizeIds, setArrowNonce, unsetArrowNonce, pathdata, getLinked, showPanel, resetMarker, addMarker, setArrow, colorChanged, contextTools; - return regeneratorRuntime.wrap(function _callee2$(_context2) { - while (1) { - switch (_context2.prev = _context2.next) { - case 0: - colorChanged = function _colorChanged(elem) { - var color = elem.getAttribute('stroke'); - var mtypes = ['start', 'mid', 'end']; - var defs = svgCanvas.findDefs(); - $.each(mtypes, function (i, type) { - var marker = getLinked(elem, 'marker-' + type); - - if (!marker) { - return; - } - - var curColor = $(marker).children().attr('fill'); - var curD = $(marker).children().attr('d'); - - if (curColor === color) { - return; - } - - var allMarkers = $(defs).find('marker'); - var newMarker = null; // Different color, check if already made - - allMarkers.each(function () { - var attrs = $(this).children().attr(['fill', 'd']); - - if (attrs.fill === color && attrs.d === curD) { - // Found another marker with this color and this path - newMarker = this; - } - }); - - if (!newMarker) { - // Create a new marker with this color - var lastId = marker.id; - var dir = lastId.includes('_fw') ? 'fw' : 'bk'; - newMarker = addMarker(dir, type, arrowprefix + dir + allMarkers.length); - $(newMarker).children().attr('fill', color); - } - - $(elem).attr('marker-' + type, 'url(#' + newMarker.id + ')'); // Check if last marker can be removed - - var remove = true; - $(S.svgcontent).find('line, polyline, path, polygon').each(function () { - var element = this; - $.each(mtypes, function (j, mtype) { - if ($(element).attr('marker-' + mtype) === 'url(#' + marker.id + ')') { - remove = false; - return remove; - } - - return undefined; - }); - - if (!remove) { - return false; - } - - return undefined; - }); // Not found, so can safely remove - - if (remove) { - $(marker).remove(); - } - }); - }; - - setArrow = function _setArrow() { - resetMarker(); - var type = this.value; - - if (type === 'none') { - return; - } // Set marker on element - - - var dir = 'fw'; - - if (type === 'mid_bk') { - type = 'mid'; - dir = 'bk'; - } else if (type === 'both') { - addMarker('bk', type); - svgCanvas.changeSelectedAttribute('marker-start', 'url(#' + pathdata.bk.id + ')'); - type = 'end'; - dir = 'fw'; - } else if (type === 'start') { - dir = 'bk'; - } - - addMarker(dir, type); - svgCanvas.changeSelectedAttribute('marker-' + type, 'url(#' + pathdata[dir].id + ')'); - svgCanvas.call('changed', selElems); - }; - - 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]; - - if (type === 'mid') { - data.refx = 5; - } - - var marker = svgCanvas.getElem(id); - - if (!marker) { - marker = addElem({ - element: 'marker', - attr: { - viewBox: '0 0 10 10', - id: id, - refY: 5, - markerUnits: 'strokeWidth', - markerWidth: 5, - markerHeight: 5, - orient: 'auto', - style: 'pointer-events:none' // Currently needed for Opera - - } - }); - var arrow = addElem({ - element: 'path', - attr: { - d: data.d, - fill: '#000000' - } - }); - marker.append(arrow); - svgCanvas.findDefs().append(marker); - } - - marker.setAttribute('refX', data.refx); - return marker; - }; - - resetMarker = function _resetMarker() { - var el = selElems[0]; - el.removeAttribute('marker-start'); - el.removeAttribute('marker-mid'); - el.removeAttribute('marker-end'); - }; - - showPanel = function _showPanel(on) { - $('#arrow_panel').toggle(on); - - if (on) { - var el = selElems[0]; - var end = el.getAttribute('marker-end'); - var start = el.getAttribute('marker-start'); - var mid = el.getAttribute('marker-mid'); - var val; - - if (end && start) { - val = 'both'; - } else if (end) { - val = 'end'; - } else if (start) { - val = 'start'; - } else if (mid) { - val = 'mid'; - - if (mid.includes('bk')) { - val = 'mid_bk'; - } - } - - if (!start && !mid && !end) { - val = 'none'; - } - - $('#arrow_list').val(val); - } - }; - - getLinked = function _getLinked(elem, attr) { - var str = elem.getAttribute(attr); - - if (!str) { - return null; - } - - var m = str.match(/\(#(.*)\)/); // const m = str.match(/\(#(?.+)\)/); - // if (!m || !m.groups.id) { - - if (!m || m.length !== 2) { - return null; - } - - return svgCanvas.getElem(m[1]); // return svgCanvas.getElem(m.groups.id); - }; - - unsetArrowNonce = function _unsetArrowNonce(win) { - randomizeIds = false; - arrowprefix = prefix; - pathdata.fw.id = arrowprefix + 'fw'; - pathdata.bk.id = arrowprefix + 'bk'; - }; - - setArrowNonce = function _setArrowNonce(win, n) { - randomizeIds = true; - arrowprefix = prefix + n + '_'; - pathdata.fw.id = arrowprefix + 'fw'; - pathdata.bk.id = arrowprefix + 'bk'; - }; - - _context2.next = 10; - return S.importLocale(); - - case 10: - strings = _context2.sent; - svgEditor = _this; - svgCanvas = svgEditor.canvas; - // {svgcontent} = S, - addElem = svgCanvas.addSVGElementFromJson, nonce = S.nonce, $ = S.$, prefix = 'se_arrow_'; - randomizeIds = S.randomize_ids; - /** - * @param {Window} win - * @param {!(string|Integer)} n - * @returns {void} - */ - - svgCanvas.bind('setnonce', setArrowNonce); - svgCanvas.bind('unsetnonce', unsetArrowNonce); - - if (randomizeIds) { - arrowprefix = prefix + nonce + '_'; - } else { - arrowprefix = prefix; - } - - pathdata = { - fw: { - d: 'm0,0l10,5l-10,5l5,-5l-5,-5z', - refx: 8, - id: arrowprefix + 'fw' - }, - bk: { - d: 'm10,0l-10,5l10,5l-5,-5l5,-5z', - refx: 2, - id: arrowprefix + 'bk' - } - }; - /** - * Gets linked element. - * @param {Element} elem - * @param {string} attr - * @returns {Element} - */ - - contextTools = [{ - type: 'select', - panel: 'arrow_panel', - id: 'arrow_list', - defval: 'none', - events: { - change: setArrow - } - }]; - return _context2.abrupt("return", { - name: strings.name, - context_tools: strings.contextTools.map(function (contextTool, i) { - return Object.assign(contextTools[i], contextTool); - }), - callback: function callback() { - $('#arrow_panel').hide(); // Set ID so it can be translated in locale file - - $('#arrow_list option')[0].id = 'connector_no_arrow'; - }, - addLangData: function addLangData(_ref) { - return _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee() { - var lang, importLocale, _yield$importLocale, langList; - - return regeneratorRuntime.wrap(function _callee$(_context) { - while (1) { - switch (_context.prev = _context.next) { - case 0: - lang = _ref.lang, importLocale = _ref.importLocale; - _context.next = 3; - return importLocale(); - - case 3: - _yield$importLocale = _context.sent; - langList = _yield$importLocale.langList; - return _context.abrupt("return", { - data: langList - }); - - case 6: - case "end": - return _context.stop(); - } - } - }, _callee); - }))(); - }, - selectedChanged: function selectedChanged(opts) { - // Use this to update the current selected elements - selElems = opts.elems; - var markerElems = ['line', 'path', 'polyline', 'polygon']; - var i = selElems.length; - - while (i--) { - var elem = selElems[i]; - - if (elem && markerElems.includes(elem.tagName)) { - if (opts.selectedElement && !opts.multiselected) { - showPanel(true); - } else { - showPanel(false); - } - } else { - showPanel(false); - } - } - }, - elementChanged: function elementChanged(opts) { - var elem = opts.elems[0]; - - if (elem && (elem.getAttribute('marker-start') || elem.getAttribute('marker-mid') || elem.getAttribute('marker-end'))) { - // const start = elem.getAttribute('marker-start'); - // const mid = elem.getAttribute('marker-mid'); - // const end = elem.getAttribute('marker-end'); - // Has marker, so see if it should match color - colorChanged(elem); - } - } - }); - - case 21: - case "end": - return _context2.stop(); - } - } - }, _callee2); - }))(); - } -}; - -export default extArrows; +var e={name:"arrows",init:function init(e){var t=this;return _asyncToGenerator(regeneratorRuntime.mark((function _callee2(){var r,n,a,o,i,l,u,c,s,d,f,m,h,v,_,k,p,w,b;return regeneratorRuntime.wrap((function _callee2$(g){for(;;)switch(g.prev=g.next){case 0:return w=function _colorChanged(t){var r=t.getAttribute("stroke"),a=["start","mid","end"],o=n.findDefs();i.each(a,(function(n,l){var u=h(t,"marker-"+l);if(u){var s=i(u).children().attr("fill"),d=i(u).children().attr("d");if(s!==r){var f=i(o).find("marker"),m=null;if(f.each((function(){var e=i(this).children().attr(["fill","d"]);e.fill===r&&e.d===d&&(m=this)})),!m){var v=u.id.includes("_fw")?"fw":"bk";m=k(v,l,c+v+f.length),i(m).children().attr("fill",r)}i(t).attr("marker-"+l,"url(#"+m.id+")");var _=!0;i(e.svgcontent).find("line, polyline, path, polygon").each((function(){var e=this;if(i.each(a,(function(t,r){if(i(e).attr("marker-"+r)==="url(#"+u.id+")")return _=!1})),!_)return!1})),_&&i(u).remove()}}}))},p=function _setArrow(){_();var e=this.value;if("none"!==e){var t="fw";"mid_bk"===e?(e="mid",t="bk"):"both"===e?(k("bk",e),n.changeSelectedAttribute("marker-start","url(#"+m.bk.id+")"),e="end",t="fw"):"start"===e&&(t="bk"),k(t,e),n.changeSelectedAttribute("marker-"+e,"url(#"+m[t].id+")"),n.call("changed",u)}},k=function _addMarker(e,t,r){r=r||c+e;var o=m[e];"mid"===t&&(o.refx=5);var i=n.getElem(r);if(!i){i=a({element:"marker",attr:{viewBox:"0 0 10 10",id:r,refY:5,markerUnits:"strokeWidth",markerWidth:5,markerHeight:5,orient:"auto",style:"pointer-events:none"}});var l=a({element:"path",attr:{d:o.d,fill:"#000000"}});i.append(l),n.findDefs().append(i)}return i.setAttribute("refX",o.refx),i},_=function _resetMarker(){var e=u[0];e.removeAttribute("marker-start"),e.removeAttribute("marker-mid"),e.removeAttribute("marker-end")},v=function _showPanel(e){if(i("#arrow_panel").toggle(e),e){var t,r=u[0],n=r.getAttribute("marker-end"),a=r.getAttribute("marker-start"),o=r.getAttribute("marker-mid");n&&a?t="both":n?t="end":a?t="start":o&&(t="mid",o.includes("bk")&&(t="mid_bk")),a||o||n||(t="none"),i("#arrow_list").val(t)}},h=function _getLinked(e,t){var r=e.getAttribute(t);if(!r)return null;var a=r.match(/\(#(.*)\)/);return a&&2===a.length?n.getElem(a[1]):null},f=function _unsetArrowNonce(e){s=!1,c=l,m.fw.id=c+"fw",m.bk.id=c+"bk"},d=function _setArrowNonce(e,t){s=!0,c=l+t+"_",m.fw.id=c+"fw",m.bk.id=c+"bk"},g.next=10,e.importLocale();case 10:return r=g.sent,n=t.canvas,a=n.addSVGElementFromJson,o=e.nonce,i=e.$,l="se_arrow_",s=e.randomize_ids,n.bind("setnonce",d),n.bind("unsetnonce",f),m={fw:{d:"m0,0l10,5l-10,5l5,-5l-5,-5z",refx:8,id:(c=s?l+o+"_":l)+"fw"},bk:{d:"m10,0l-10,5l10,5l-5,-5l5,-5z",refx:2,id:c+"bk"}},b=[{type:"select",panel:"arrow_panel",id:"arrow_list",defval:"none",events:{change:p}}],g.abrupt("return",{name:r.name,context_tools:r.contextTools.map((function(e,t){return Object.assign(b[t],e)})),callback:function callback(){i("#arrow_panel").hide(),i("#arrow_list option")[0].id="connector_no_arrow"},addLangData:function addLangData(e){return _asyncToGenerator(regeneratorRuntime.mark((function _callee(){var t,r,n;return regeneratorRuntime.wrap((function _callee$(a){for(;;)switch(a.prev=a.next){case 0:return e.lang,t=e.importLocale,a.next=3,t();case 3:return r=a.sent,n=r.langList,a.abrupt("return",{data:n});case 6:case"end":return a.stop()}}),_callee)})))()},selectedChanged:function selectedChanged(e){for(var t=["line","path","polyline","polygon"],r=(u=e.elems).length;r--;){var n=u[r];n&&t.includes(n.tagName)&&e.selectedElement&&!e.multiselected?v(!0):v(!1)}},elementChanged:function elementChanged(e){var t=e.elems[0];t&&(t.getAttribute("marker-start")||t.getAttribute("marker-mid")||t.getAttribute("marker-end"))&&w(t)}});case 21:case"end":return g.stop()}}),_callee2)})))()}};export default e; //# sourceMappingURL=ext-arrows.js.map diff --git a/dist/editor/extensions/ext-arrows.js.map b/dist/editor/extensions/ext-arrows.js.map index 66481559..d7286242 100644 --- a/dist/editor/extensions/ext-arrows.js.map +++ b/dist/editor/extensions/ext-arrows.js.map @@ -1 +1 @@ -{"version":3,"file":"ext-arrows.js","sources":["../../../src/editor/extensions/ext-arrows.js"],"sourcesContent":["/**\n * @file ext-arrows.js\n *\n * @license MIT\n *\n * @copyright 2010 Alexis Deveria\n *\n */\n\nexport default {\n name: 'arrows',\n async init (S) {\n const strings = await S.importLocale();\n const svgEditor = this;\n const svgCanvas = svgEditor.canvas;\n const // {svgcontent} = S,\n addElem = svgCanvas.addSVGElementFromJson,\n {nonce, $} = S,\n prefix = 'se_arrow_';\n\n let selElems, arrowprefix, randomizeIds = S.randomize_ids;\n\n /**\n * @param {Window} win\n * @param {!(string|Integer)} n\n * @returns {void}\n */\n function setArrowNonce (win, n) {\n randomizeIds = true;\n arrowprefix = prefix + n + '_';\n pathdata.fw.id = arrowprefix + 'fw';\n pathdata.bk.id = arrowprefix + 'bk';\n }\n\n /**\n * @param {Window} win\n * @returns {void}\n */\n function unsetArrowNonce (win) {\n randomizeIds = false;\n arrowprefix = prefix;\n pathdata.fw.id = arrowprefix + 'fw';\n pathdata.bk.id = arrowprefix + 'bk';\n }\n\n svgCanvas.bind('setnonce', setArrowNonce);\n svgCanvas.bind('unsetnonce', unsetArrowNonce);\n\n if (randomizeIds) {\n arrowprefix = prefix + nonce + '_';\n } else {\n arrowprefix = prefix;\n }\n\n const pathdata = {\n fw: {d: 'm0,0l10,5l-10,5l5,-5l-5,-5z', refx: 8, id: arrowprefix + 'fw'},\n bk: {d: 'm10,0l-10,5l10,5l-5,-5l5,-5z', refx: 2, id: arrowprefix + 'bk'}\n };\n\n /**\n * Gets linked element.\n * @param {Element} elem\n * @param {string} attr\n * @returns {Element}\n */\n function getLinked (elem, attr) {\n const str = elem.getAttribute(attr);\n if (!str) { return null; }\n const m = str.match(/\\(#(.*)\\)/);\n // const m = str.match(/\\(#(?.+)\\)/);\n // if (!m || !m.groups.id) {\n if (!m || m.length !== 2) {\n return null;\n }\n return svgCanvas.getElem(m[1]);\n // return svgCanvas.getElem(m.groups.id);\n }\n\n /**\n * @param {boolean} on\n * @returns {void}\n */\n function showPanel (on) {\n $('#arrow_panel').toggle(on);\n if (on) {\n const el = selElems[0];\n const end = el.getAttribute('marker-end');\n const start = el.getAttribute('marker-start');\n const mid = el.getAttribute('marker-mid');\n let val;\n if (end && start) {\n val = 'both';\n } else if (end) {\n val = 'end';\n } else if (start) {\n val = 'start';\n } else if (mid) {\n val = 'mid';\n if (mid.includes('bk')) {\n val = 'mid_bk';\n }\n }\n\n if (!start && !mid && !end) {\n val = 'none';\n }\n\n $('#arrow_list').val(val);\n }\n }\n\n /**\n *\n * @returns {void}\n */\n function resetMarker () {\n const el = selElems[0];\n el.removeAttribute('marker-start');\n el.removeAttribute('marker-mid');\n el.removeAttribute('marker-end');\n }\n\n /**\n * @param {\"bk\"|\"fw\"} dir\n * @param {\"both\"|\"mid\"|\"end\"|\"start\"} type\n * @param {string} id\n * @returns {Element}\n */\n function addMarker (dir, type, id) {\n // TODO: Make marker (or use?) per arrow type, since refX can be different\n id = id || arrowprefix + dir;\n\n const data = pathdata[dir];\n\n if (type === 'mid') {\n data.refx = 5;\n }\n\n let marker = svgCanvas.getElem(id);\n if (!marker) {\n marker = addElem({\n element: 'marker',\n attr: {\n viewBox: '0 0 10 10',\n id,\n refY: 5,\n markerUnits: 'strokeWidth',\n markerWidth: 5,\n markerHeight: 5,\n orient: 'auto',\n style: 'pointer-events:none' // Currently needed for Opera\n }\n });\n const arrow = addElem({\n element: 'path',\n attr: {\n d: data.d,\n fill: '#000000'\n }\n });\n marker.append(arrow);\n svgCanvas.findDefs().append(marker);\n }\n\n marker.setAttribute('refX', data.refx);\n\n return marker;\n }\n\n /**\n *\n * @returns {void}\n */\n function setArrow () {\n resetMarker();\n\n let type = this.value;\n if (type === 'none') {\n return;\n }\n\n // Set marker on element\n let dir = 'fw';\n if (type === 'mid_bk') {\n type = 'mid';\n dir = 'bk';\n } else if (type === 'both') {\n addMarker('bk', type);\n svgCanvas.changeSelectedAttribute('marker-start', 'url(#' + pathdata.bk.id + ')');\n type = 'end';\n dir = 'fw';\n } else if (type === 'start') {\n dir = 'bk';\n }\n\n addMarker(dir, type);\n svgCanvas.changeSelectedAttribute('marker-' + type, 'url(#' + pathdata[dir].id + ')');\n svgCanvas.call('changed', selElems);\n }\n\n /**\n * @param {Element} elem\n * @returns {void}\n */\n function colorChanged (elem) {\n const color = elem.getAttribute('stroke');\n const mtypes = ['start', 'mid', 'end'];\n const defs = svgCanvas.findDefs();\n\n $.each(mtypes, function (i, type) {\n const marker = getLinked(elem, 'marker-' + type);\n if (!marker) { return; }\n\n const curColor = $(marker).children().attr('fill');\n const curD = $(marker).children().attr('d');\n if (curColor === color) { return; }\n\n const allMarkers = $(defs).find('marker');\n let newMarker = null;\n // Different color, check if already made\n allMarkers.each(function () {\n const attrs = $(this).children().attr(['fill', 'd']);\n if (attrs.fill === color && attrs.d === curD) {\n // Found another marker with this color and this path\n newMarker = this;\n }\n });\n\n if (!newMarker) {\n // Create a new marker with this color\n const lastId = marker.id;\n const dir = lastId.includes('_fw') ? 'fw' : 'bk';\n\n newMarker = addMarker(dir, type, arrowprefix + dir + allMarkers.length);\n\n $(newMarker).children().attr('fill', color);\n }\n\n $(elem).attr('marker-' + type, 'url(#' + newMarker.id + ')');\n\n // Check if last marker can be removed\n let remove = true;\n $(S.svgcontent).find('line, polyline, path, polygon').each(function () {\n const element = this;\n $.each(mtypes, function (j, mtype) {\n if ($(element).attr('marker-' + mtype) === 'url(#' + marker.id + ')') {\n remove = false;\n return remove;\n }\n return undefined;\n });\n if (!remove) { return false; }\n return undefined;\n });\n\n // Not found, so can safely remove\n if (remove) {\n $(marker).remove();\n }\n });\n }\n\n const contextTools = [\n {\n type: 'select',\n panel: 'arrow_panel',\n id: 'arrow_list',\n defval: 'none',\n events: {\n change: setArrow\n }\n }\n ];\n\n return {\n name: strings.name,\n context_tools: strings.contextTools.map((contextTool, i) => {\n return Object.assign(contextTools[i], contextTool);\n }),\n callback () {\n $('#arrow_panel').hide();\n // Set ID so it can be translated in locale file\n $('#arrow_list option')[0].id = 'connector_no_arrow';\n },\n async addLangData ({lang, importLocale}) {\n const {langList} = await importLocale();\n return {\n data: langList\n };\n },\n selectedChanged (opts) {\n // Use this to update the current selected elements\n selElems = opts.elems;\n\n const markerElems = ['line', 'path', 'polyline', 'polygon'];\n let i = selElems.length;\n while (i--) {\n const elem = selElems[i];\n if (elem && markerElems.includes(elem.tagName)) {\n if (opts.selectedElement && !opts.multiselected) {\n showPanel(true);\n } else {\n showPanel(false);\n }\n } else {\n showPanel(false);\n }\n }\n },\n elementChanged (opts) {\n const elem = opts.elems[0];\n if (elem && (\n elem.getAttribute('marker-start') ||\n elem.getAttribute('marker-mid') ||\n elem.getAttribute('marker-end')\n )) {\n // const start = elem.getAttribute('marker-start');\n // const mid = elem.getAttribute('marker-mid');\n // const end = elem.getAttribute('marker-end');\n // Has marker, so see if it should match color\n colorChanged(elem);\n }\n }\n };\n }\n};\n"],"names":["name","init","S","setArrowNonce","unsetArrowNonce","getLinked","showPanel","resetMarker","addMarker","setArrow","colorChanged","elem","color","getAttribute","mtypes","defs","svgCanvas","findDefs","$","each","i","type","marker","curColor","children","attr","curD","allMarkers","find","newMarker","attrs","fill","d","lastId","id","dir","includes","arrowprefix","length","remove","svgcontent","element","j","mtype","undefined","value","changeSelectedAttribute","pathdata","bk","call","selElems","data","refx","getElem","addElem","viewBox","refY","markerUnits","markerWidth","markerHeight","orient","style","arrow","append","setAttribute","el","removeAttribute","on","toggle","end","start","mid","val","str","m","match","win","randomizeIds","prefix","fw","n","importLocale","strings","svgEditor","canvas","addSVGElementFromJson","nonce","randomize_ids","bind","contextTools","panel","defval","events","change","context_tools","map","contextTool","Object","assign","callback","hide","addLangData","lang","langList","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Z;AACD;AACF;AAhDI,eAvQM;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAyTd;AA3TY,CAAf;;;;"} \ No newline at end of file +{"version":3,"file":"ext-arrows.js","sources":["../../../src/editor/extensions/ext-arrows.js"],"sourcesContent":["/**\n * @file ext-arrows.js\n *\n * @license MIT\n *\n * @copyright 2010 Alexis Deveria\n *\n */\n\nexport default {\n name: 'arrows',\n async init (S) {\n const strings = await S.importLocale();\n const svgEditor = this;\n const svgCanvas = svgEditor.canvas;\n const // {svgcontent} = S,\n addElem = svgCanvas.addSVGElementFromJson,\n {nonce, $} = S,\n prefix = 'se_arrow_';\n\n let selElems, arrowprefix, randomizeIds = S.randomize_ids;\n\n /**\n * @param {Window} win\n * @param {!(string|Integer)} n\n * @returns {void}\n */\n function setArrowNonce (win, n) {\n randomizeIds = true;\n arrowprefix = prefix + n + '_';\n pathdata.fw.id = arrowprefix + 'fw';\n pathdata.bk.id = arrowprefix + 'bk';\n }\n\n /**\n * @param {Window} win\n * @returns {void}\n */\n function unsetArrowNonce (win) {\n randomizeIds = false;\n arrowprefix = prefix;\n pathdata.fw.id = arrowprefix + 'fw';\n pathdata.bk.id = arrowprefix + 'bk';\n }\n\n svgCanvas.bind('setnonce', setArrowNonce);\n svgCanvas.bind('unsetnonce', unsetArrowNonce);\n\n if (randomizeIds) {\n arrowprefix = prefix + nonce + '_';\n } else {\n arrowprefix = prefix;\n }\n\n const pathdata = {\n fw: {d: 'm0,0l10,5l-10,5l5,-5l-5,-5z', refx: 8, id: arrowprefix + 'fw'},\n bk: {d: 'm10,0l-10,5l10,5l-5,-5l5,-5z', refx: 2, id: arrowprefix + 'bk'}\n };\n\n /**\n * Gets linked element.\n * @param {Element} elem\n * @param {string} attr\n * @returns {Element}\n */\n function getLinked (elem, attr) {\n const str = elem.getAttribute(attr);\n if (!str) { return null; }\n const m = str.match(/\\(#(.*)\\)/);\n // const m = str.match(/\\(#(?.+)\\)/);\n // if (!m || !m.groups.id) {\n if (!m || m.length !== 2) {\n return null;\n }\n return svgCanvas.getElem(m[1]);\n // return svgCanvas.getElem(m.groups.id);\n }\n\n /**\n * @param {boolean} on\n * @returns {void}\n */\n function showPanel (on) {\n $('#arrow_panel').toggle(on);\n if (on) {\n const el = selElems[0];\n const end = el.getAttribute('marker-end');\n const start = el.getAttribute('marker-start');\n const mid = el.getAttribute('marker-mid');\n let val;\n if (end && start) {\n val = 'both';\n } else if (end) {\n val = 'end';\n } else if (start) {\n val = 'start';\n } else if (mid) {\n val = 'mid';\n if (mid.includes('bk')) {\n val = 'mid_bk';\n }\n }\n\n if (!start && !mid && !end) {\n val = 'none';\n }\n\n $('#arrow_list').val(val);\n }\n }\n\n /**\n *\n * @returns {void}\n */\n function resetMarker () {\n const el = selElems[0];\n el.removeAttribute('marker-start');\n el.removeAttribute('marker-mid');\n el.removeAttribute('marker-end');\n }\n\n /**\n * @param {\"bk\"|\"fw\"} dir\n * @param {\"both\"|\"mid\"|\"end\"|\"start\"} type\n * @param {string} id\n * @returns {Element}\n */\n function addMarker (dir, type, id) {\n // TODO: Make marker (or use?) per arrow type, since refX can be different\n id = id || arrowprefix + dir;\n\n const data = pathdata[dir];\n\n if (type === 'mid') {\n data.refx = 5;\n }\n\n let marker = svgCanvas.getElem(id);\n if (!marker) {\n marker = addElem({\n element: 'marker',\n attr: {\n viewBox: '0 0 10 10',\n id,\n refY: 5,\n markerUnits: 'strokeWidth',\n markerWidth: 5,\n markerHeight: 5,\n orient: 'auto',\n style: 'pointer-events:none' // Currently needed for Opera\n }\n });\n const arrow = addElem({\n element: 'path',\n attr: {\n d: data.d,\n fill: '#000000'\n }\n });\n marker.append(arrow);\n svgCanvas.findDefs().append(marker);\n }\n\n marker.setAttribute('refX', data.refx);\n\n return marker;\n }\n\n /**\n *\n * @returns {void}\n */\n function setArrow () {\n resetMarker();\n\n let type = this.value;\n if (type === 'none') {\n return;\n }\n\n // Set marker on element\n let dir = 'fw';\n if (type === 'mid_bk') {\n type = 'mid';\n dir = 'bk';\n } else if (type === 'both') {\n addMarker('bk', type);\n svgCanvas.changeSelectedAttribute('marker-start', 'url(#' + pathdata.bk.id + ')');\n type = 'end';\n dir = 'fw';\n } else if (type === 'start') {\n dir = 'bk';\n }\n\n addMarker(dir, type);\n svgCanvas.changeSelectedAttribute('marker-' + type, 'url(#' + pathdata[dir].id + ')');\n svgCanvas.call('changed', selElems);\n }\n\n /**\n * @param {Element} elem\n * @returns {void}\n */\n function colorChanged (elem) {\n const color = elem.getAttribute('stroke');\n const mtypes = ['start', 'mid', 'end'];\n const defs = svgCanvas.findDefs();\n\n $.each(mtypes, function (i, type) {\n const marker = getLinked(elem, 'marker-' + type);\n if (!marker) { return; }\n\n const curColor = $(marker).children().attr('fill');\n const curD = $(marker).children().attr('d');\n if (curColor === color) { return; }\n\n const allMarkers = $(defs).find('marker');\n let newMarker = null;\n // Different color, check if already made\n allMarkers.each(function () {\n const attrs = $(this).children().attr(['fill', 'd']);\n if (attrs.fill === color && attrs.d === curD) {\n // Found another marker with this color and this path\n newMarker = this;\n }\n });\n\n if (!newMarker) {\n // Create a new marker with this color\n const lastId = marker.id;\n const dir = lastId.includes('_fw') ? 'fw' : 'bk';\n\n newMarker = addMarker(dir, type, arrowprefix + dir + allMarkers.length);\n\n $(newMarker).children().attr('fill', color);\n }\n\n $(elem).attr('marker-' + type, 'url(#' + newMarker.id + ')');\n\n // Check if last marker can be removed\n let remove = true;\n $(S.svgcontent).find('line, polyline, path, polygon').each(function () {\n const element = this;\n $.each(mtypes, function (j, mtype) {\n if ($(element).attr('marker-' + mtype) === 'url(#' + marker.id + ')') {\n remove = false;\n return remove;\n }\n return undefined;\n });\n if (!remove) { return false; }\n return undefined;\n });\n\n // Not found, so can safely remove\n if (remove) {\n $(marker).remove();\n }\n });\n }\n\n const contextTools = [\n {\n type: 'select',\n panel: 'arrow_panel',\n id: 'arrow_list',\n defval: 'none',\n events: {\n change: setArrow\n }\n }\n ];\n\n return {\n name: strings.name,\n context_tools: strings.contextTools.map((contextTool, i) => {\n return Object.assign(contextTools[i], contextTool);\n }),\n callback () {\n $('#arrow_panel').hide();\n // Set ID so it can be translated in locale file\n $('#arrow_list option')[0].id = 'connector_no_arrow';\n },\n async addLangData ({lang, importLocale}) {\n const {langList} = await importLocale();\n return {\n data: langList\n };\n },\n selectedChanged (opts) {\n // Use this to update the current selected elements\n selElems = opts.elems;\n\n const markerElems = ['line', 'path', 'polyline', 'polygon'];\n let i = selElems.length;\n while (i--) {\n const elem = selElems[i];\n if (elem && markerElems.includes(elem.tagName)) {\n if (opts.selectedElement && !opts.multiselected) {\n showPanel(true);\n } else {\n showPanel(false);\n }\n } else {\n showPanel(false);\n }\n }\n },\n elementChanged (opts) {\n const elem = opts.elems[0];\n if (elem && (\n elem.getAttribute('marker-start') ||\n elem.getAttribute('marker-mid') ||\n elem.getAttribute('marker-end')\n )) {\n // const start = elem.getAttribute('marker-start');\n // const mid = elem.getAttribute('marker-mid');\n // const end = elem.getAttribute('marker-end');\n // Has marker, so see if it should match color\n colorChanged(elem);\n }\n }\n };\n }\n};\n"],"names":["name","init","S","setArrowNonce","unsetArrowNonce","getLinked","showPanel","resetMarker","addMarker","setArrow","colorChanged","elem","color","getAttribute","mtypes","defs","svgCanvas","findDefs","$","each","i","type","marker","curColor","children","attr","curD","allMarkers","find","newMarker","attrs","this","fill","d","dir","id","includes","arrowprefix","length","remove","svgcontent","element","j","mtype","value","changeSelectedAttribute","pathdata","bk","call","selElems","data","refx","getElem","addElem","viewBox","refY","markerUnits","markerWidth","markerHeight","orient","style","arrow","append","setAttribute","el","removeAttribute","on","toggle","val","end","start","mid","str","m","match","win","randomizeIds","prefix","fw","n","importLocale","strings","_this","canvas","addSVGElementFromJson","nonce","randomize_ids","bind","contextTools","panel","defval","events","change","context_tools","map","contextTool","Object","assign","callback","hide","addLangData","lang","langList","selectedChanged","opts","markerElems","elems","tagName","selectedElement","multiselected","elementChanged"],"mappings":";;;;;;;;;AASA,MAAe,CACbA,KAAM,S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AAOsC,EAAS7B,GAClBT,GAAQ8F,EAAYrE,SAASzB,EAAKgG,UAChCH,EAAKI,kBAAoBJ,EAAKK,cAChCvG,GAAU,GAKZA,GAAU,KAIhBwG,uCAAgBN,OACR7F,EAAO6F,EAAKE,MAAM,GACpB/F,IACFA,EAAKE,aAAa,iBAClBF,EAAKE,aAAa,eAClBF,EAAKE,aAAa,gBAMlBH,EAAaC"} \ No newline at end of file diff --git a/dist/editor/extensions/ext-closepath.js b/dist/editor/extensions/ext-closepath.js index c2c69962..6afe28b6 100644 --- a/dist/editor/extensions/ext-closepath.js +++ b/dist/editor/extensions/ext-closepath.js @@ -1,4087 +1,2 @@ -function _typeof(obj) { - "@babel/helpers - typeof"; - - if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { - _typeof = function (obj) { - return typeof obj; - }; - } else { - _typeof = function (obj) { - return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; - }; - } - - return _typeof(obj); -} - -var REACT_ELEMENT_TYPE; - -function _jsx(type, props, key, children) { - if (!REACT_ELEMENT_TYPE) { - REACT_ELEMENT_TYPE = typeof Symbol === "function" && Symbol["for"] && Symbol["for"]("react.element") || 0xeac7; - } - - var defaultProps = type && type.defaultProps; - var childrenLength = arguments.length - 3; - - if (!props && childrenLength !== 0) { - props = { - children: void 0 - }; - } - - if (childrenLength === 1) { - props.children = children; - } else if (childrenLength > 1) { - var childArray = new Array(childrenLength); - - for (var i = 0; i < childrenLength; i++) { - childArray[i] = arguments[i + 3]; - } - - props.children = childArray; - } - - if (props && defaultProps) { - for (var propName in defaultProps) { - if (props[propName] === void 0) { - props[propName] = defaultProps[propName]; - } - } - } else if (!props) { - props = defaultProps || {}; - } - - return { - $$typeof: REACT_ELEMENT_TYPE, - type: type, - key: key === undefined ? null : '' + key, - ref: null, - props: props, - _owner: null - }; -} - -function _asyncIterator(iterable) { - var method; - - if (typeof Symbol !== "undefined") { - if (Symbol.asyncIterator) { - method = iterable[Symbol.asyncIterator]; - if (method != null) return method.call(iterable); - } - - if (Symbol.iterator) { - method = iterable[Symbol.iterator]; - if (method != null) return method.call(iterable); - } - } - - throw new TypeError("Object is not async iterable"); -} - -function _AwaitValue(value) { - this.wrapped = value; -} - -function _AsyncGenerator(gen) { - var front, back; - - function send(key, arg) { - return new Promise(function (resolve, reject) { - var request = { - key: key, - arg: arg, - resolve: resolve, - reject: reject, - next: null - }; - - if (back) { - back = back.next = request; - } else { - front = back = request; - resume(key, arg); - } - }); - } - - function resume(key, arg) { - try { - var result = gen[key](arg); - var value = result.value; - var wrappedAwait = value instanceof _AwaitValue; - Promise.resolve(wrappedAwait ? value.wrapped : value).then(function (arg) { - if (wrappedAwait) { - resume(key === "return" ? "return" : "next", arg); - return; - } - - settle(result.done ? "return" : "normal", arg); - }, function (err) { - resume("throw", err); - }); - } catch (err) { - settle("throw", err); - } - } - - function settle(type, value) { - switch (type) { - case "return": - front.resolve({ - value: value, - done: true - }); - break; - - case "throw": - front.reject(value); - break; - - default: - front.resolve({ - value: value, - done: false - }); - break; - } - - front = front.next; - - if (front) { - resume(front.key, front.arg); - } else { - back = null; - } - } - - this._invoke = send; - - if (typeof gen.return !== "function") { - this.return = undefined; - } -} - -if (typeof Symbol === "function" && Symbol.asyncIterator) { - _AsyncGenerator.prototype[Symbol.asyncIterator] = function () { - return this; - }; -} - -_AsyncGenerator.prototype.next = function (arg) { - return this._invoke("next", arg); -}; - -_AsyncGenerator.prototype.throw = function (arg) { - return this._invoke("throw", arg); -}; - -_AsyncGenerator.prototype.return = function (arg) { - return this._invoke("return", arg); -}; - -function _wrapAsyncGenerator(fn) { - return function () { - return new _AsyncGenerator(fn.apply(this, arguments)); - }; -} - -function _awaitAsyncGenerator(value) { - return new _AwaitValue(value); -} - -function _asyncGeneratorDelegate(inner, awaitWrap) { - var iter = {}, - waiting = false; - - function pump(key, value) { - waiting = true; - value = new Promise(function (resolve) { - resolve(inner[key](value)); - }); - return { - done: false, - value: awaitWrap(value) - }; - } - - ; - - if (typeof Symbol === "function" && Symbol.iterator) { - iter[Symbol.iterator] = function () { - return this; - }; - } - - iter.next = function (value) { - if (waiting) { - waiting = false; - return value; - } - - return pump("next", value); - }; - - if (typeof inner.throw === "function") { - iter.throw = function (value) { - if (waiting) { - waiting = false; - throw value; - } - - return pump("throw", value); - }; - } - - if (typeof inner.return === "function") { - iter.return = function (value) { - if (waiting) { - waiting = false; - return value; - } - - return pump("return", value); - }; - } - - return iter; -} - -function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { - try { - var info = gen[key](arg); - var value = info.value; - } catch (error) { - reject(error); - return; - } - - if (info.done) { - resolve(value); - } else { - Promise.resolve(value).then(_next, _throw); - } -} - -function _asyncToGenerator(fn) { - return function () { - var self = this, - args = arguments; - return new Promise(function (resolve, reject) { - var gen = fn.apply(self, args); - - function _next(value) { - asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value); - } - - function _throw(err) { - asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err); - } - - _next(undefined); - }); - }; -} - -function _classCallCheck(instance, Constructor) { - if (!(instance instanceof Constructor)) { - throw new TypeError("Cannot call a class as a function"); - } -} - -function _defineProperties(target, props) { - for (var i = 0; i < props.length; i++) { - var descriptor = props[i]; - descriptor.enumerable = descriptor.enumerable || false; - descriptor.configurable = true; - if ("value" in descriptor) descriptor.writable = true; - Object.defineProperty(target, descriptor.key, descriptor); - } -} - -function _createClass(Constructor, protoProps, staticProps) { - if (protoProps) _defineProperties(Constructor.prototype, protoProps); - if (staticProps) _defineProperties(Constructor, staticProps); - return Constructor; -} - -function _defineEnumerableProperties(obj, descs) { - for (var key in descs) { - var desc = descs[key]; - desc.configurable = desc.enumerable = true; - if ("value" in desc) desc.writable = true; - Object.defineProperty(obj, key, desc); - } - - if (Object.getOwnPropertySymbols) { - var objectSymbols = Object.getOwnPropertySymbols(descs); - - for (var i = 0; i < objectSymbols.length; i++) { - var sym = objectSymbols[i]; - var desc = descs[sym]; - desc.configurable = desc.enumerable = true; - if ("value" in desc) desc.writable = true; - Object.defineProperty(obj, sym, desc); - } - } - - return obj; -} - -function _defaults(obj, defaults) { - var keys = Object.getOwnPropertyNames(defaults); - - for (var i = 0; i < keys.length; i++) { - var key = keys[i]; - var value = Object.getOwnPropertyDescriptor(defaults, key); - - if (value && value.configurable && obj[key] === undefined) { - Object.defineProperty(obj, key, value); - } - } - - return obj; -} - -function _defineProperty(obj, key, value) { - if (key in obj) { - Object.defineProperty(obj, key, { - value: value, - enumerable: true, - configurable: true, - writable: true - }); - } else { - obj[key] = value; - } - - return obj; -} - -function _extends() { - _extends = Object.assign || function (target) { - for (var i = 1; i < arguments.length; i++) { - var source = arguments[i]; - - for (var key in source) { - if (Object.prototype.hasOwnProperty.call(source, key)) { - target[key] = source[key]; - } - } - } - - return target; - }; - - return _extends.apply(this, arguments); -} - -function _objectSpread(target) { - for (var i = 1; i < arguments.length; i++) { - var source = arguments[i] != null ? Object(arguments[i]) : {}; - var ownKeys = Object.keys(source); - - if (typeof Object.getOwnPropertySymbols === 'function') { - ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function (sym) { - return Object.getOwnPropertyDescriptor(source, sym).enumerable; - })); - } - - ownKeys.forEach(function (key) { - _defineProperty(target, key, source[key]); - }); - } - - return target; -} - -function ownKeys(object, enumerableOnly) { - var keys = Object.keys(object); - - if (Object.getOwnPropertySymbols) { - var symbols = Object.getOwnPropertySymbols(object); - if (enumerableOnly) symbols = symbols.filter(function (sym) { - return Object.getOwnPropertyDescriptor(object, sym).enumerable; - }); - keys.push.apply(keys, symbols); - } - - return keys; -} - -function _objectSpread2(target) { - for (var i = 1; i < arguments.length; i++) { - var source = arguments[i] != null ? arguments[i] : {}; - - if (i % 2) { - ownKeys(Object(source), true).forEach(function (key) { - _defineProperty(target, key, source[key]); - }); - } else if (Object.getOwnPropertyDescriptors) { - Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); - } else { - ownKeys(Object(source)).forEach(function (key) { - Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); - }); - } - } - - return target; -} - -function _inherits(subClass, superClass) { - if (typeof superClass !== "function" && superClass !== null) { - throw new TypeError("Super expression must either be null or a function"); - } - - subClass.prototype = Object.create(superClass && superClass.prototype, { - constructor: { - value: subClass, - writable: true, - configurable: true - } - }); - if (superClass) _setPrototypeOf(subClass, superClass); -} - -function _inheritsLoose(subClass, superClass) { - subClass.prototype = Object.create(superClass.prototype); - subClass.prototype.constructor = subClass; - subClass.__proto__ = superClass; -} - -function _getPrototypeOf(o) { - _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { - return o.__proto__ || Object.getPrototypeOf(o); - }; - return _getPrototypeOf(o); -} - -function _setPrototypeOf(o, p) { - _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { - o.__proto__ = p; - return o; - }; - - 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 _construct(Parent, args, Class) { - if (_isNativeReflectConstruct()) { - _construct = Reflect.construct; - } else { - _construct = function _construct(Parent, args, Class) { - var a = [null]; - a.push.apply(a, args); - var Constructor = Function.bind.apply(Parent, a); - var instance = new Constructor(); - if (Class) _setPrototypeOf(instance, Class.prototype); - return instance; - }; - } - - return _construct.apply(null, arguments); -} - -function _isNativeFunction(fn) { - return Function.toString.call(fn).indexOf("[native code]") !== -1; -} - -function _wrapNativeSuper(Class) { - var _cache = typeof Map === "function" ? new Map() : undefined; - - _wrapNativeSuper = function _wrapNativeSuper(Class) { - if (Class === null || !_isNativeFunction(Class)) return Class; - - if (typeof Class !== "function") { - throw new TypeError("Super expression must either be null or a function"); - } - - if (typeof _cache !== "undefined") { - if (_cache.has(Class)) return _cache.get(Class); - - _cache.set(Class, Wrapper); - } - - function Wrapper() { - return _construct(Class, arguments, _getPrototypeOf(this).constructor); - } - - Wrapper.prototype = Object.create(Class.prototype, { - constructor: { - value: Wrapper, - enumerable: false, - writable: true, - configurable: true - } - }); - return _setPrototypeOf(Wrapper, Class); - }; - - return _wrapNativeSuper(Class); -} - -function _instanceof(left, right) { - if (right != null && typeof Symbol !== "undefined" && right[Symbol.hasInstance]) { - return !!right[Symbol.hasInstance](left); - } else { - return left instanceof right; - } -} - -function _interopRequireDefault(obj) { - return obj && obj.__esModule ? obj : { - default: obj - }; -} - -function _getRequireWildcardCache() { - if (typeof WeakMap !== "function") return null; - var cache = new WeakMap(); - - _getRequireWildcardCache = function () { - return cache; - }; - - return cache; -} - -function _interopRequireWildcard(obj) { - if (obj && obj.__esModule) { - return obj; - } - - if (obj === null || typeof obj !== "object" && typeof obj !== "function") { - return { - default: obj - }; - } - - var cache = _getRequireWildcardCache(); - - if (cache && cache.has(obj)) { - return cache.get(obj); - } - - var newObj = {}; - var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; - - for (var key in obj) { - if (Object.prototype.hasOwnProperty.call(obj, key)) { - var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; - - if (desc && (desc.get || desc.set)) { - Object.defineProperty(newObj, key, desc); - } else { - newObj[key] = obj[key]; - } - } - } - - newObj.default = obj; - - if (cache) { - cache.set(obj, newObj); - } - - return newObj; -} - -function _newArrowCheck(innerThis, boundThis) { - if (innerThis !== boundThis) { - throw new TypeError("Cannot instantiate an arrow function"); - } -} - -function _objectDestructuringEmpty(obj) { - if (obj == null) throw new TypeError("Cannot destructure undefined"); -} - -function _objectWithoutPropertiesLoose(source, excluded) { - if (source == null) return {}; - var target = {}; - var sourceKeys = Object.keys(source); - var key, i; - - for (i = 0; i < sourceKeys.length; i++) { - key = sourceKeys[i]; - if (excluded.indexOf(key) >= 0) continue; - target[key] = source[key]; - } - - return target; -} - -function _objectWithoutProperties(source, excluded) { - if (source == null) return {}; - - var target = _objectWithoutPropertiesLoose(source, excluded); - - var key, i; - - if (Object.getOwnPropertySymbols) { - var sourceSymbolKeys = Object.getOwnPropertySymbols(source); - - for (i = 0; i < sourceSymbolKeys.length; i++) { - key = sourceSymbolKeys[i]; - if (excluded.indexOf(key) >= 0) continue; - if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; - target[key] = source[key]; - } - } - - return target; -} - -function _assertThisInitialized(self) { - if (self === void 0) { - throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); - } - - return self; -} - -function _possibleConstructorReturn(self, call) { - if (call && (typeof call === "object" || typeof call === "function")) { - return call; - } - - return _assertThisInitialized(self); -} - -function _createSuper(Derived) { - var hasNativeReflectConstruct = _isNativeReflectConstruct(); - - return function _createSuperInternal() { - var Super = _getPrototypeOf(Derived), - result; - - if (hasNativeReflectConstruct) { - 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); - if (object === null) break; - } - - return object; -} - -function _get(target, property, receiver) { - if (typeof Reflect !== "undefined" && Reflect.get) { - _get = Reflect.get; - } else { - _get = function _get(target, property, receiver) { - var base = _superPropBase(target, property); - - if (!base) return; - var desc = Object.getOwnPropertyDescriptor(base, property); - - if (desc.get) { - return desc.get.call(receiver); - } - - return desc.value; - }; - } - - return _get(target, property, receiver || target); -} - -function set(target, property, value, receiver) { - if (typeof Reflect !== "undefined" && Reflect.set) { - set = Reflect.set; - } else { - set = function set(target, property, value, receiver) { - var base = _superPropBase(target, property); - - var desc; - - if (base) { - desc = Object.getOwnPropertyDescriptor(base, property); - - if (desc.set) { - desc.set.call(receiver, value); - return true; - } else if (!desc.writable) { - return false; - } - } - - desc = Object.getOwnPropertyDescriptor(receiver, property); - - if (desc) { - if (!desc.writable) { - return false; - } - - desc.value = value; - Object.defineProperty(receiver, property, desc); - } else { - _defineProperty(receiver, property, value); - } - - return true; - }; - } - - return set(target, property, value, receiver); -} - -function _set(target, property, value, receiver, isStrict) { - var s = set(target, property, value, receiver || target); - - if (!s && isStrict) { - throw new Error('failed to set property'); - } - - return value; -} - -function _taggedTemplateLiteral(strings, raw) { - if (!raw) { - raw = strings.slice(0); - } - - return Object.freeze(Object.defineProperties(strings, { - raw: { - value: Object.freeze(raw) - } - })); -} - -function _taggedTemplateLiteralLoose(strings, raw) { - if (!raw) { - raw = strings.slice(0); - } - - strings.raw = raw; - return strings; -} - -function _readOnlyError(name) { - throw new Error("\"" + name + "\" is read-only"); -} - -function _classNameTDZError(name) { - throw new Error("Class \"" + name + "\" cannot be referenced in computed property keys."); -} - -function _temporalUndefined() {} - -function _tdz(name) { - throw new ReferenceError(name + " is not defined - temporal dead zone"); -} - -function _temporalRef(val, name) { - return val === _temporalUndefined ? _tdz(name) : val; -} - -function _slicedToArray(arr, i) { - return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); -} - -function _slicedToArrayLoose(arr, i) { - return _arrayWithHoles(arr) || _iterableToArrayLimitLoose(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); -} - -function _toArray(arr) { - return _arrayWithHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableRest(); -} - -function _toConsumableArray(arr) { - return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); -} - -function _arrayWithoutHoles(arr) { - if (Array.isArray(arr)) return _arrayLikeToArray(arr); -} - -function _arrayWithHoles(arr) { - if (Array.isArray(arr)) return arr; -} - -function _maybeArrayLike(next, arr, i) { - if (arr && !Array.isArray(arr) && typeof arr.length === "number") { - var len = arr.length; - return _arrayLikeToArray(arr, i !== void 0 && i < len ? i : len); - } - - return next(arr, i); -} - -function _iterableToArray(iter) { - if (typeof Symbol !== "undefined" && Symbol.iterator in Object(iter)) return Array.from(iter); -} - -function _iterableToArrayLimit(arr, i) { - if (typeof Symbol === "undefined" || !(Symbol.iterator in Object(arr))) return; - var _arr = []; - var _n = true; - var _d = false; - var _e = undefined; - - try { - for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { - _arr.push(_s.value); - - if (i && _arr.length === i) break; - } - } catch (err) { - _d = true; - _e = err; - } finally { - try { - if (!_n && _i["return"] != null) _i["return"](); - } finally { - if (_d) throw _e; - } - } - - return _arr; -} - -function _iterableToArrayLimitLoose(arr, i) { - if (typeof Symbol === "undefined" || !(Symbol.iterator in Object(arr))) return; - var _arr = []; - - for (var _iterator = arr[Symbol.iterator](), _step; !(_step = _iterator.next()).done;) { - _arr.push(_step.value); - - if (i && _arr.length === i) break; - } - - 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(o); - 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.\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.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); -} - -function _createForOfIteratorHelper(o, allowArrayLike) { - var it; - - if (typeof Symbol === "undefined" || o[Symbol.iterator] == null) { - if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") { - if (it) o = it; - 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 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; - } - } - }; -} - -function _createForOfIteratorHelperLoose(o, allowArrayLike) { - var it; - - if (typeof Symbol === "undefined" || o[Symbol.iterator] == null) { - if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") { - if (it) o = it; - var i = 0; - return function () { - if (i >= o.length) return { - done: true - }; - return { - done: false, - value: o[i++] - }; - }; - } - - throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); - } - - it = o[Symbol.iterator](); - return it.next.bind(it); -} - -function _skipFirstGeneratorNext(fn) { - return function () { - var it = fn.apply(this, arguments); - it.next(); - return it; - }; -} - -function _toPrimitive(input, hint) { - if (typeof input !== "object" || input === null) return input; - var prim = input[Symbol.toPrimitive]; - - if (prim !== undefined) { - var res = prim.call(input, hint || "default"); - if (typeof res !== "object") return res; - throw new TypeError("@@toPrimitive must return a primitive value."); - } - - return (hint === "string" ? String : Number)(input); -} - -function _toPropertyKey(arg) { - var key = _toPrimitive(arg, "string"); - - return typeof key === "symbol" ? key : String(key); -} - -function _initializerWarningHelper(descriptor, context) { - throw new Error('Decorating class property failed. Please ensure that ' + 'proposal-class-properties is enabled and runs after the decorators transform.'); -} - -function _initializerDefineProperty(target, property, descriptor, context) { - if (!descriptor) return; - Object.defineProperty(target, property, { - enumerable: descriptor.enumerable, - configurable: descriptor.configurable, - writable: descriptor.writable, - value: descriptor.initializer ? descriptor.initializer.call(context) : void 0 - }); -} - -function _applyDecoratedDescriptor(target, property, decorators, descriptor, context) { - var desc = {}; - Object.keys(descriptor).forEach(function (key) { - desc[key] = descriptor[key]; - }); - desc.enumerable = !!desc.enumerable; - desc.configurable = !!desc.configurable; - - if ('value' in desc || desc.initializer) { - desc.writable = true; - } - - desc = decorators.slice().reverse().reduce(function (desc, decorator) { - return decorator(target, property, desc) || desc; - }, desc); - - if (context && desc.initializer !== void 0) { - desc.value = desc.initializer ? desc.initializer.call(context) : void 0; - desc.initializer = undefined; - } - - if (desc.initializer === void 0) { - Object.defineProperty(target, property, desc); - desc = null; - } - - return desc; -} - -var id = 0; - -function _classPrivateFieldLooseKey(name) { - return "__private_" + id++ + "_" + name; -} - -function _classPrivateFieldLooseBase(receiver, privateKey) { - if (!Object.prototype.hasOwnProperty.call(receiver, privateKey)) { - throw new TypeError("attempted to use private field on non-instance"); - } - - return receiver; -} - -function _classPrivateFieldGet(receiver, privateMap) { - var descriptor = privateMap.get(receiver); - - if (!descriptor) { - throw new TypeError("attempted to get private field on non-instance"); - } - - if (descriptor.get) { - return descriptor.get.call(receiver); - } - - return descriptor.value; -} - -function _classPrivateFieldSet(receiver, privateMap, value) { - var descriptor = privateMap.get(receiver); - - if (!descriptor) { - throw new TypeError("attempted to set private field on non-instance"); - } - - if (descriptor.set) { - descriptor.set.call(receiver, value); - } else { - if (!descriptor.writable) { - throw new TypeError("attempted to set read only private field"); - } - - descriptor.value = value; - } - - return value; -} - -function _classPrivateFieldDestructureSet(receiver, privateMap) { - if (!privateMap.has(receiver)) { - throw new TypeError("attempted to set private field on non-instance"); - } - - var descriptor = privateMap.get(receiver); - - if (descriptor.set) { - if (!("__destrObj" in descriptor)) { - descriptor.__destrObj = { - set value(v) { - descriptor.set.call(receiver, v); - } - - }; - } - - return descriptor.__destrObj; - } else { - if (!descriptor.writable) { - throw new TypeError("attempted to set read only private field"); - } - - return descriptor; - } -} - -function _classStaticPrivateFieldSpecGet(receiver, classConstructor, descriptor) { - if (receiver !== classConstructor) { - throw new TypeError("Private static access of wrong provenance"); - } - - if (descriptor.get) { - return descriptor.get.call(receiver); - } - - return descriptor.value; -} - -function _classStaticPrivateFieldSpecSet(receiver, classConstructor, descriptor, value) { - if (receiver !== classConstructor) { - throw new TypeError("Private static access of wrong provenance"); - } - - if (descriptor.set) { - descriptor.set.call(receiver, value); - } else { - if (!descriptor.writable) { - throw new TypeError("attempted to set read only private field"); - } - - descriptor.value = value; - } - - return value; -} - -function _classStaticPrivateMethodGet(receiver, classConstructor, method) { - if (receiver !== classConstructor) { - throw new TypeError("Private static access of wrong provenance"); - } - - return method; -} - -function _classStaticPrivateMethodSet() { - throw new TypeError("attempted to set read only static private field"); -} - -function _decorate(decorators, factory, superClass, mixins) { - var api = _getDecoratorsApi(); - - if (mixins) { - for (var i = 0; i < mixins.length; i++) { - api = mixins[i](api); - } - } - - var r = factory(function initialize(O) { - api.initializeInstanceElements(O, decorated.elements); - }, superClass); - var decorated = api.decorateClass(_coalesceClassElements(r.d.map(_createElementDescriptor)), decorators); - api.initializeClassElements(r.F, decorated.elements); - return api.runClassFinishers(r.F, decorated.finishers); -} - -function _getDecoratorsApi() { - _getDecoratorsApi = function () { - return api; - }; - - var api = { - elementsDefinitionOrder: [["method"], ["field"]], - initializeInstanceElements: function (O, elements) { - ["method", "field"].forEach(function (kind) { - elements.forEach(function (element) { - if (element.kind === kind && element.placement === "own") { - this.defineClassElement(O, element); - } - }, this); - }, this); - }, - initializeClassElements: function (F, elements) { - var proto = F.prototype; - ["method", "field"].forEach(function (kind) { - elements.forEach(function (element) { - var placement = element.placement; - - if (element.kind === kind && (placement === "static" || placement === "prototype")) { - var receiver = placement === "static" ? F : proto; - this.defineClassElement(receiver, element); - } - }, this); - }, this); - }, - defineClassElement: function (receiver, element) { - var descriptor = element.descriptor; - - if (element.kind === "field") { - var initializer = element.initializer; - descriptor = { - enumerable: descriptor.enumerable, - writable: descriptor.writable, - configurable: descriptor.configurable, - value: initializer === void 0 ? void 0 : initializer.call(receiver) - }; - } - - Object.defineProperty(receiver, element.key, descriptor); - }, - decorateClass: function (elements, decorators) { - var newElements = []; - var finishers = []; - var placements = { - static: [], - prototype: [], - own: [] - }; - elements.forEach(function (element) { - this.addElementPlacement(element, placements); - }, this); - elements.forEach(function (element) { - if (!_hasDecorators(element)) return newElements.push(element); - var elementFinishersExtras = this.decorateElement(element, placements); - newElements.push(elementFinishersExtras.element); - newElements.push.apply(newElements, elementFinishersExtras.extras); - finishers.push.apply(finishers, elementFinishersExtras.finishers); - }, this); - - if (!decorators) { - return { - elements: newElements, - finishers: finishers - }; - } - - var result = this.decorateConstructor(newElements, decorators); - finishers.push.apply(finishers, result.finishers); - result.finishers = finishers; - return result; - }, - addElementPlacement: function (element, placements, silent) { - var keys = placements[element.placement]; - - if (!silent && keys.indexOf(element.key) !== -1) { - throw new TypeError("Duplicated element (" + element.key + ")"); - } - - keys.push(element.key); - }, - decorateElement: function (element, placements) { - var extras = []; - var finishers = []; - - for (var decorators = element.decorators, i = decorators.length - 1; i >= 0; i--) { - var keys = placements[element.placement]; - keys.splice(keys.indexOf(element.key), 1); - var elementObject = this.fromElementDescriptor(element); - var elementFinisherExtras = this.toElementFinisherExtras((0, decorators[i])(elementObject) || elementObject); - element = elementFinisherExtras.element; - this.addElementPlacement(element, placements); - - if (elementFinisherExtras.finisher) { - finishers.push(elementFinisherExtras.finisher); - } - - var newExtras = elementFinisherExtras.extras; - - if (newExtras) { - for (var j = 0; j < newExtras.length; j++) { - this.addElementPlacement(newExtras[j], placements); - } - - extras.push.apply(extras, newExtras); - } - } - - return { - element: element, - finishers: finishers, - extras: extras - }; - }, - decorateConstructor: function (elements, decorators) { - var finishers = []; - - for (var i = decorators.length - 1; i >= 0; i--) { - var obj = this.fromClassDescriptor(elements); - var elementsAndFinisher = this.toClassDescriptor((0, decorators[i])(obj) || obj); - - if (elementsAndFinisher.finisher !== undefined) { - finishers.push(elementsAndFinisher.finisher); - } - - if (elementsAndFinisher.elements !== undefined) { - elements = elementsAndFinisher.elements; - - for (var j = 0; j < elements.length - 1; j++) { - for (var k = j + 1; k < elements.length; k++) { - if (elements[j].key === elements[k].key && elements[j].placement === elements[k].placement) { - throw new TypeError("Duplicated element (" + elements[j].key + ")"); - } - } - } - } - } - - return { - elements: elements, - finishers: finishers - }; - }, - fromElementDescriptor: function (element) { - var obj = { - kind: element.kind, - key: element.key, - placement: element.placement, - descriptor: element.descriptor - }; - var desc = { - value: "Descriptor", - configurable: true - }; - Object.defineProperty(obj, Symbol.toStringTag, desc); - if (element.kind === "field") obj.initializer = element.initializer; - return obj; - }, - toElementDescriptors: function (elementObjects) { - if (elementObjects === undefined) return; - return _toArray(elementObjects).map(function (elementObject) { - var element = this.toElementDescriptor(elementObject); - this.disallowProperty(elementObject, "finisher", "An element descriptor"); - this.disallowProperty(elementObject, "extras", "An element descriptor"); - return element; - }, this); - }, - toElementDescriptor: function (elementObject) { - var kind = String(elementObject.kind); - - if (kind !== "method" && kind !== "field") { - throw new TypeError('An element descriptor\'s .kind property must be either "method" or' + ' "field", but a decorator created an element descriptor with' + ' .kind "' + kind + '"'); - } - - var key = _toPropertyKey(elementObject.key); - - var placement = String(elementObject.placement); - - if (placement !== "static" && placement !== "prototype" && placement !== "own") { - throw new TypeError('An element descriptor\'s .placement property must be one of "static",' + ' "prototype" or "own", but a decorator created an element descriptor' + ' with .placement "' + placement + '"'); - } - - var descriptor = elementObject.descriptor; - this.disallowProperty(elementObject, "elements", "An element descriptor"); - var element = { - kind: kind, - key: key, - placement: placement, - descriptor: Object.assign({}, descriptor) - }; - - if (kind !== "field") { - this.disallowProperty(elementObject, "initializer", "A method descriptor"); - } else { - this.disallowProperty(descriptor, "get", "The property descriptor of a field descriptor"); - this.disallowProperty(descriptor, "set", "The property descriptor of a field descriptor"); - this.disallowProperty(descriptor, "value", "The property descriptor of a field descriptor"); - element.initializer = elementObject.initializer; - } - - return element; - }, - toElementFinisherExtras: function (elementObject) { - var element = this.toElementDescriptor(elementObject); - - var finisher = _optionalCallableProperty(elementObject, "finisher"); - - var extras = this.toElementDescriptors(elementObject.extras); - return { - element: element, - finisher: finisher, - extras: extras - }; - }, - fromClassDescriptor: function (elements) { - var obj = { - kind: "class", - elements: elements.map(this.fromElementDescriptor, this) - }; - var desc = { - value: "Descriptor", - configurable: true - }; - Object.defineProperty(obj, Symbol.toStringTag, desc); - return obj; - }, - toClassDescriptor: function (obj) { - var kind = String(obj.kind); - - if (kind !== "class") { - throw new TypeError('A class descriptor\'s .kind property must be "class", but a decorator' + ' created a class descriptor with .kind "' + kind + '"'); - } - - this.disallowProperty(obj, "key", "A class descriptor"); - this.disallowProperty(obj, "placement", "A class descriptor"); - this.disallowProperty(obj, "descriptor", "A class descriptor"); - this.disallowProperty(obj, "initializer", "A class descriptor"); - this.disallowProperty(obj, "extras", "A class descriptor"); - - var finisher = _optionalCallableProperty(obj, "finisher"); - - var elements = this.toElementDescriptors(obj.elements); - return { - elements: elements, - finisher: finisher - }; - }, - runClassFinishers: function (constructor, finishers) { - for (var i = 0; i < finishers.length; i++) { - var newConstructor = (0, finishers[i])(constructor); - - if (newConstructor !== undefined) { - if (typeof newConstructor !== "function") { - throw new TypeError("Finishers must return a constructor."); - } - - constructor = newConstructor; - } - } - - return constructor; - }, - disallowProperty: function (obj, name, objectType) { - if (obj[name] !== undefined) { - throw new TypeError(objectType + " can't have a ." + name + " property."); - } - } - }; - return api; -} - -function _createElementDescriptor(def) { - var key = _toPropertyKey(def.key); - - var descriptor; - - if (def.kind === "method") { - descriptor = { - value: def.value, - writable: true, - configurable: true, - enumerable: false - }; - } else if (def.kind === "get") { - descriptor = { - get: def.value, - configurable: true, - enumerable: false - }; - } else if (def.kind === "set") { - descriptor = { - set: def.value, - configurable: true, - enumerable: false - }; - } else if (def.kind === "field") { - descriptor = { - configurable: true, - writable: true, - enumerable: true - }; - } - - var element = { - kind: def.kind === "field" ? "field" : "method", - key: key, - placement: def.static ? "static" : def.kind === "field" ? "own" : "prototype", - descriptor: descriptor - }; - if (def.decorators) element.decorators = def.decorators; - if (def.kind === "field") element.initializer = def.value; - return element; -} - -function _coalesceGetterSetter(element, other) { - if (element.descriptor.get !== undefined) { - other.descriptor.get = element.descriptor.get; - } else { - other.descriptor.set = element.descriptor.set; - } -} - -function _coalesceClassElements(elements) { - var newElements = []; - - var isSameElement = function (other) { - return other.kind === "method" && other.key === element.key && other.placement === element.placement; - }; - - for (var i = 0; i < elements.length; i++) { - var element = elements[i]; - var other; - - if (element.kind === "method" && (other = newElements.find(isSameElement))) { - if (_isDataDescriptor(element.descriptor) || _isDataDescriptor(other.descriptor)) { - if (_hasDecorators(element) || _hasDecorators(other)) { - throw new ReferenceError("Duplicated methods (" + element.key + ") can't be decorated."); - } - - other.descriptor = element.descriptor; - } else { - if (_hasDecorators(element)) { - if (_hasDecorators(other)) { - throw new ReferenceError("Decorators can't be placed on different accessors with for " + "the same property (" + element.key + ")."); - } - - other.decorators = element.decorators; - } - - _coalesceGetterSetter(element, other); - } - } else { - newElements.push(element); - } - } - - return newElements; -} - -function _hasDecorators(element) { - return element.decorators && element.decorators.length; -} - -function _isDataDescriptor(desc) { - return desc !== undefined && !(desc.value === undefined && desc.writable === undefined); -} - -function _optionalCallableProperty(obj, name) { - var value = obj[name]; - - if (value !== undefined && typeof value !== "function") { - throw new TypeError("Expected '" + name + "' to be a function"); - } - - return value; -} - -function _classPrivateMethodGet(receiver, privateSet, fn) { - if (!privateSet.has(receiver)) { - throw new TypeError("attempted to get private field on non-instance"); - } - - return fn; -} - -function _classPrivateMethodSet() { - throw new TypeError("attempted to reassign private method"); -} - -function _wrapRegExp(re, groups) { - _wrapRegExp = function (re, groups) { - return new BabelRegExp(re, undefined, groups); - }; - - var _RegExp = _wrapNativeSuper(RegExp); - - var _super = RegExp.prototype; - - var _groups = new WeakMap(); - - function BabelRegExp(re, flags, groups) { - var _this = _RegExp.call(this, re, flags); - - _groups.set(_this, groups || _groups.get(re)); - - return _this; - } - - _inherits(BabelRegExp, _RegExp); - - BabelRegExp.prototype.exec = function (str) { - var result = _super.exec.call(this, str); - - if (result) result.groups = buildGroups(result, this); - return result; - }; - - BabelRegExp.prototype[Symbol.replace] = function (str, substitution) { - if (typeof substitution === "string") { - var groups = _groups.get(this); - - return _super[Symbol.replace].call(this, str, substitution.replace(/\$<([^>]+)>/g, function (_, name) { - return "$" + groups[name]; - })); - } else if (typeof substitution === "function") { - var _this = this; - - return _super[Symbol.replace].call(this, str, function () { - var args = []; - args.push.apply(args, arguments); - - if (typeof args[args.length - 1] !== "object") { - args.push(buildGroups(args, _this)); - } - - return substitution.apply(this, args); - }); - } else { - return _super[Symbol.replace].call(this, str, substitution); - } - }; - - function buildGroups(result, re) { - var g = _groups.get(re); - - return Object.keys(g).reduce(function (groups, name) { - groups[name] = result[g[name]]; - return groups; - }, Object.create(null)); - } - - return _wrapRegExp.apply(this, arguments); -} - -/* eslint-disable import/unambiguous, max-len */ - -/* globals SVGPathSeg, SVGPathSegMovetoRel, SVGPathSegMovetoAbs, - SVGPathSegMovetoRel, SVGPathSegLinetoRel, SVGPathSegLinetoAbs, - SVGPathSegLinetoHorizontalRel, SVGPathSegLinetoHorizontalAbs, - SVGPathSegLinetoVerticalRel, SVGPathSegLinetoVerticalAbs, - SVGPathSegClosePath, SVGPathSegCurvetoCubicRel, - SVGPathSegCurvetoCubicAbs, SVGPathSegCurvetoCubicSmoothRel, - SVGPathSegCurvetoCubicSmoothAbs, SVGPathSegCurvetoQuadraticRel, - SVGPathSegCurvetoQuadraticAbs, SVGPathSegCurvetoQuadraticSmoothRel, - SVGPathSegCurvetoQuadraticSmoothAbs, SVGPathSegArcRel, SVGPathSegArcAbs */ - -/** -* SVGPathSeg API polyfill -* https://github.com/progers/pathseg -* -* This is a drop-in replacement for the `SVGPathSeg` and `SVGPathSegList` APIs -* that were removed from SVG2 ({@link https://lists.w3.org/Archives/Public/www-svg/2015Jun/0044.html}), -* including the latest spec changes which were implemented in Firefox 43 and -* Chrome 46. -*/ - -/* eslint-disable no-shadow, class-methods-use-this, jsdoc/require-jsdoc */ -// Linting: We avoid `no-shadow` as ESLint thinks these are still available globals -// Linting: We avoid `class-methods-use-this` as this is a polyfill that must -// follow the conventions -(function () { - if (!('SVGPathSeg' in window)) { - // Spec: https://www.w3.org/TR/SVG11/single-page.html#paths-InterfaceSVGPathSeg - var _SVGPathSeg = /*#__PURE__*/function () { - function _SVGPathSeg(type, typeAsLetter, owningPathSegList) { - _classCallCheck(this, _SVGPathSeg); - - this.pathSegType = type; - this.pathSegTypeAsLetter = typeAsLetter; - this._owningPathSegList = owningPathSegList; - } // Notify owning PathSegList on any changes so they can be synchronized back to the path element. - - - _createClass(_SVGPathSeg, [{ - key: "_segmentChanged", - value: function _segmentChanged() { - if (this._owningPathSegList) { - this._owningPathSegList.segmentChanged(this); - } - } - }]); - - return _SVGPathSeg; - }(); - - _SVGPathSeg.prototype.classname = 'SVGPathSeg'; - _SVGPathSeg.PATHSEG_UNKNOWN = 0; - _SVGPathSeg.PATHSEG_CLOSEPATH = 1; - _SVGPathSeg.PATHSEG_MOVETO_ABS = 2; - _SVGPathSeg.PATHSEG_MOVETO_REL = 3; - _SVGPathSeg.PATHSEG_LINETO_ABS = 4; - _SVGPathSeg.PATHSEG_LINETO_REL = 5; - _SVGPathSeg.PATHSEG_CURVETO_CUBIC_ABS = 6; - _SVGPathSeg.PATHSEG_CURVETO_CUBIC_REL = 7; - _SVGPathSeg.PATHSEG_CURVETO_QUADRATIC_ABS = 8; - _SVGPathSeg.PATHSEG_CURVETO_QUADRATIC_REL = 9; - _SVGPathSeg.PATHSEG_ARC_ABS = 10; - _SVGPathSeg.PATHSEG_ARC_REL = 11; - _SVGPathSeg.PATHSEG_LINETO_HORIZONTAL_ABS = 12; - _SVGPathSeg.PATHSEG_LINETO_HORIZONTAL_REL = 13; - _SVGPathSeg.PATHSEG_LINETO_VERTICAL_ABS = 14; - _SVGPathSeg.PATHSEG_LINETO_VERTICAL_REL = 15; - _SVGPathSeg.PATHSEG_CURVETO_CUBIC_SMOOTH_ABS = 16; - _SVGPathSeg.PATHSEG_CURVETO_CUBIC_SMOOTH_REL = 17; - _SVGPathSeg.PATHSEG_CURVETO_QUADRATIC_SMOOTH_ABS = 18; - _SVGPathSeg.PATHSEG_CURVETO_QUADRATIC_SMOOTH_REL = 19; - - var _SVGPathSegClosePath = /*#__PURE__*/function (_SVGPathSeg2) { - _inherits(_SVGPathSegClosePath, _SVGPathSeg2); - - var _super = _createSuper(_SVGPathSegClosePath); - - function _SVGPathSegClosePath(owningPathSegList) { - _classCallCheck(this, _SVGPathSegClosePath); - - return _super.call(this, _SVGPathSeg.PATHSEG_CLOSEPATH, 'z', owningPathSegList); - } - - _createClass(_SVGPathSegClosePath, [{ - key: "toString", - value: function toString() { - return '[object SVGPathSegClosePath]'; - } - }, { - key: "_asPathString", - value: function _asPathString() { - return this.pathSegTypeAsLetter; - } - }, { - key: "clone", - value: function clone() { - return new _SVGPathSegClosePath(undefined); - } - }]); - - return _SVGPathSegClosePath; - }(_SVGPathSeg); - - var _SVGPathSegMovetoAbs = /*#__PURE__*/function (_SVGPathSeg3) { - _inherits(_SVGPathSegMovetoAbs, _SVGPathSeg3); - - var _super2 = _createSuper(_SVGPathSegMovetoAbs); - - function _SVGPathSegMovetoAbs(owningPathSegList, x, y) { - var _this; - - _classCallCheck(this, _SVGPathSegMovetoAbs); - - _this = _super2.call(this, _SVGPathSeg.PATHSEG_MOVETO_ABS, 'M', owningPathSegList); - _this._x = x; - _this._y = y; - return _this; - } - - _createClass(_SVGPathSegMovetoAbs, [{ - key: "toString", - value: function toString() { - return '[object SVGPathSegMovetoAbs]'; - } - }, { - key: "_asPathString", - value: function _asPathString() { - return this.pathSegTypeAsLetter + ' ' + this._x + ' ' + this._y; - } - }, { - key: "clone", - value: function clone() { - return new _SVGPathSegMovetoAbs(undefined, this._x, this._y); - } - }]); - - return _SVGPathSegMovetoAbs; - }(_SVGPathSeg); - - Object.defineProperties(_SVGPathSegMovetoAbs.prototype, { - x: { - get: function get() { - return this._x; - }, - set: function set(x) { - this._x = x; - - this._segmentChanged(); - }, - enumerable: true - }, - y: { - get: function get() { - return this._y; - }, - set: function set(y) { - this._y = y; - - this._segmentChanged(); - }, - enumerable: true - } - }); - - var _SVGPathSegMovetoRel = /*#__PURE__*/function (_SVGPathSeg4) { - _inherits(_SVGPathSegMovetoRel, _SVGPathSeg4); - - var _super3 = _createSuper(_SVGPathSegMovetoRel); - - function _SVGPathSegMovetoRel(owningPathSegList, x, y) { - var _this2; - - _classCallCheck(this, _SVGPathSegMovetoRel); - - _this2 = _super3.call(this, _SVGPathSeg.PATHSEG_MOVETO_REL, 'm', owningPathSegList); - _this2._x = x; - _this2._y = y; - return _this2; - } - - _createClass(_SVGPathSegMovetoRel, [{ - key: "toString", - value: function toString() { - return '[object SVGPathSegMovetoRel]'; - } - }, { - key: "_asPathString", - value: function _asPathString() { - return this.pathSegTypeAsLetter + ' ' + this._x + ' ' + this._y; - } - }, { - key: "clone", - value: function clone() { - return new _SVGPathSegMovetoRel(undefined, this._x, this._y); - } - }]); - - return _SVGPathSegMovetoRel; - }(_SVGPathSeg); - - Object.defineProperties(_SVGPathSegMovetoRel.prototype, { - x: { - get: function get() { - return this._x; - }, - set: function set(x) { - this._x = x; - - this._segmentChanged(); - }, - enumerable: true - }, - y: { - get: function get() { - return this._y; - }, - set: function set(y) { - this._y = y; - - this._segmentChanged(); - }, - enumerable: true - } - }); - - var _SVGPathSegLinetoAbs = /*#__PURE__*/function (_SVGPathSeg5) { - _inherits(_SVGPathSegLinetoAbs, _SVGPathSeg5); - - var _super4 = _createSuper(_SVGPathSegLinetoAbs); - - function _SVGPathSegLinetoAbs(owningPathSegList, x, y) { - var _this3; - - _classCallCheck(this, _SVGPathSegLinetoAbs); - - _this3 = _super4.call(this, _SVGPathSeg.PATHSEG_LINETO_ABS, 'L', owningPathSegList); - _this3._x = x; - _this3._y = y; - return _this3; - } - - _createClass(_SVGPathSegLinetoAbs, [{ - key: "toString", - value: function toString() { - return '[object SVGPathSegLinetoAbs]'; - } - }, { - key: "_asPathString", - value: function _asPathString() { - return this.pathSegTypeAsLetter + ' ' + this._x + ' ' + this._y; - } - }, { - key: "clone", - value: function clone() { - return new _SVGPathSegLinetoAbs(undefined, this._x, this._y); - } - }]); - - return _SVGPathSegLinetoAbs; - }(_SVGPathSeg); - - Object.defineProperties(_SVGPathSegLinetoAbs.prototype, { - x: { - get: function get() { - return this._x; - }, - set: function set(x) { - this._x = x; - - this._segmentChanged(); - }, - enumerable: true - }, - y: { - get: function get() { - return this._y; - }, - set: function set(y) { - this._y = y; - - this._segmentChanged(); - }, - enumerable: true - } - }); - - var _SVGPathSegLinetoRel = /*#__PURE__*/function (_SVGPathSeg6) { - _inherits(_SVGPathSegLinetoRel, _SVGPathSeg6); - - var _super5 = _createSuper(_SVGPathSegLinetoRel); - - function _SVGPathSegLinetoRel(owningPathSegList, x, y) { - var _this4; - - _classCallCheck(this, _SVGPathSegLinetoRel); - - _this4 = _super5.call(this, _SVGPathSeg.PATHSEG_LINETO_REL, 'l', owningPathSegList); - _this4._x = x; - _this4._y = y; - return _this4; - } - - _createClass(_SVGPathSegLinetoRel, [{ - key: "toString", - value: function toString() { - return '[object SVGPathSegLinetoRel]'; - } - }, { - key: "_asPathString", - value: function _asPathString() { - return this.pathSegTypeAsLetter + ' ' + this._x + ' ' + this._y; - } - }, { - key: "clone", - value: function clone() { - return new _SVGPathSegLinetoRel(undefined, this._x, this._y); - } - }]); - - return _SVGPathSegLinetoRel; - }(_SVGPathSeg); - - Object.defineProperties(_SVGPathSegLinetoRel.prototype, { - x: { - get: function get() { - return this._x; - }, - set: function set(x) { - this._x = x; - - this._segmentChanged(); - }, - enumerable: true - }, - y: { - get: function get() { - return this._y; - }, - set: function set(y) { - this._y = y; - - this._segmentChanged(); - }, - enumerable: true - } - }); - - 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 = _super6.call(this, _SVGPathSeg.PATHSEG_CURVETO_CUBIC_ABS, 'C', owningPathSegList); - _this5._x = x; - _this5._y = y; - _this5._x1 = x1; - _this5._y1 = y1; - _this5._x2 = x2; - _this5._y2 = y2; - return _this5; - } - - _createClass(_SVGPathSegCurvetoCubicAbs, [{ - key: "toString", - value: function toString() { - return '[object SVGPathSegCurvetoCubicAbs]'; - } - }, { - key: "_asPathString", - value: function _asPathString() { - return this.pathSegTypeAsLetter + ' ' + this._x1 + ' ' + this._y1 + ' ' + this._x2 + ' ' + this._y2 + ' ' + this._x + ' ' + this._y; - } - }, { - key: "clone", - value: function clone() { - return new _SVGPathSegCurvetoCubicAbs(undefined, this._x, this._y, this._x1, this._y1, this._x2, this._y2); - } - }]); - - return _SVGPathSegCurvetoCubicAbs; - }(_SVGPathSeg); - - Object.defineProperties(_SVGPathSegCurvetoCubicAbs.prototype, { - x: { - get: function get() { - return this._x; - }, - set: function set(x) { - this._x = x; - - this._segmentChanged(); - }, - enumerable: true - }, - y: { - get: function get() { - return this._y; - }, - set: function set(y) { - this._y = y; - - this._segmentChanged(); - }, - enumerable: true - }, - x1: { - get: function get() { - return this._x1; - }, - set: function set(x1) { - this._x1 = x1; - - this._segmentChanged(); - }, - enumerable: true - }, - y1: { - get: function get() { - return this._y1; - }, - set: function set(y1) { - this._y1 = y1; - - this._segmentChanged(); - }, - enumerable: true - }, - x2: { - get: function get() { - return this._x2; - }, - set: function set(x2) { - this._x2 = x2; - - this._segmentChanged(); - }, - enumerable: true - }, - y2: { - get: function get() { - return this._y2; - }, - set: function set(y2) { - this._y2 = y2; - - this._segmentChanged(); - }, - enumerable: true - } - }); - - 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 = _super7.call(this, _SVGPathSeg.PATHSEG_CURVETO_CUBIC_REL, 'c', owningPathSegList); - _this6._x = x; - _this6._y = y; - _this6._x1 = x1; - _this6._y1 = y1; - _this6._x2 = x2; - _this6._y2 = y2; - return _this6; - } - - _createClass(_SVGPathSegCurvetoCubicRel, [{ - key: "toString", - value: function toString() { - return '[object SVGPathSegCurvetoCubicRel]'; - } - }, { - key: "_asPathString", - value: function _asPathString() { - return this.pathSegTypeAsLetter + ' ' + this._x1 + ' ' + this._y1 + ' ' + this._x2 + ' ' + this._y2 + ' ' + this._x + ' ' + this._y; - } - }, { - key: "clone", - value: function clone() { - return new _SVGPathSegCurvetoCubicRel(undefined, this._x, this._y, this._x1, this._y1, this._x2, this._y2); - } - }]); - - return _SVGPathSegCurvetoCubicRel; - }(_SVGPathSeg); - - Object.defineProperties(_SVGPathSegCurvetoCubicRel.prototype, { - x: { - get: function get() { - return this._x; - }, - set: function set(x) { - this._x = x; - - this._segmentChanged(); - }, - enumerable: true - }, - y: { - get: function get() { - return this._y; - }, - set: function set(y) { - this._y = y; - - this._segmentChanged(); - }, - enumerable: true - }, - x1: { - get: function get() { - return this._x1; - }, - set: function set(x1) { - this._x1 = x1; - - this._segmentChanged(); - }, - enumerable: true - }, - y1: { - get: function get() { - return this._y1; - }, - set: function set(y1) { - this._y1 = y1; - - this._segmentChanged(); - }, - enumerable: true - }, - x2: { - get: function get() { - return this._x2; - }, - set: function set(x2) { - this._x2 = x2; - - this._segmentChanged(); - }, - enumerable: true - }, - y2: { - get: function get() { - return this._y2; - }, - set: function set(y2) { - this._y2 = y2; - - this._segmentChanged(); - }, - enumerable: true - } - }); - - 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 = _super8.call(this, _SVGPathSeg.PATHSEG_CURVETO_QUADRATIC_ABS, 'Q', owningPathSegList); - _this7._x = x; - _this7._y = y; - _this7._x1 = x1; - _this7._y1 = y1; - return _this7; - } - - _createClass(_SVGPathSegCurvetoQuadraticAbs, [{ - key: "toString", - value: function toString() { - return '[object SVGPathSegCurvetoQuadraticAbs]'; - } - }, { - key: "_asPathString", - value: function _asPathString() { - return this.pathSegTypeAsLetter + ' ' + this._x1 + ' ' + this._y1 + ' ' + this._x + ' ' + this._y; - } - }, { - key: "clone", - value: function clone() { - return new _SVGPathSegCurvetoQuadraticAbs(undefined, this._x, this._y, this._x1, this._y1); - } - }]); - - return _SVGPathSegCurvetoQuadraticAbs; - }(_SVGPathSeg); - - Object.defineProperties(_SVGPathSegCurvetoQuadraticAbs.prototype, { - x: { - get: function get() { - return this._x; - }, - set: function set(x) { - this._x = x; - - this._segmentChanged(); - }, - enumerable: true - }, - y: { - get: function get() { - return this._y; - }, - set: function set(y) { - this._y = y; - - this._segmentChanged(); - }, - enumerable: true - }, - x1: { - get: function get() { - return this._x1; - }, - set: function set(x1) { - this._x1 = x1; - - this._segmentChanged(); - }, - enumerable: true - }, - y1: { - get: function get() { - return this._y1; - }, - set: function set(y1) { - this._y1 = y1; - - this._segmentChanged(); - }, - enumerable: true - } - }); - - 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 = _super9.call(this, _SVGPathSeg.PATHSEG_CURVETO_QUADRATIC_REL, 'q', owningPathSegList); - _this8._x = x; - _this8._y = y; - _this8._x1 = x1; - _this8._y1 = y1; - return _this8; - } - - _createClass(_SVGPathSegCurvetoQuadraticRel, [{ - key: "toString", - value: function toString() { - return '[object SVGPathSegCurvetoQuadraticRel]'; - } - }, { - key: "_asPathString", - value: function _asPathString() { - return this.pathSegTypeAsLetter + ' ' + this._x1 + ' ' + this._y1 + ' ' + this._x + ' ' + this._y; - } - }, { - key: "clone", - value: function clone() { - return new _SVGPathSegCurvetoQuadraticRel(undefined, this._x, this._y, this._x1, this._y1); - } - }]); - - return _SVGPathSegCurvetoQuadraticRel; - }(_SVGPathSeg); - - Object.defineProperties(_SVGPathSegCurvetoQuadraticRel.prototype, { - x: { - get: function get() { - return this._x; - }, - set: function set(x) { - this._x = x; - - this._segmentChanged(); - }, - enumerable: true - }, - y: { - get: function get() { - return this._y; - }, - set: function set(y) { - this._y = y; - - this._segmentChanged(); - }, - enumerable: true - }, - x1: { - get: function get() { - return this._x1; - }, - set: function set(x1) { - this._x1 = x1; - - this._segmentChanged(); - }, - enumerable: true - }, - y1: { - get: function get() { - return this._y1; - }, - set: function set(y1) { - this._y1 = y1; - - this._segmentChanged(); - }, - enumerable: true - } - }); - - 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 = _super10.call(this, _SVGPathSeg.PATHSEG_ARC_ABS, 'A', owningPathSegList); - _this9._x = x; - _this9._y = y; - _this9._r1 = r1; - _this9._r2 = r2; - _this9._angle = angle; - _this9._largeArcFlag = largeArcFlag; - _this9._sweepFlag = sweepFlag; - return _this9; - } - - _createClass(_SVGPathSegArcAbs, [{ - key: "toString", - value: function toString() { - return '[object SVGPathSegArcAbs]'; - } - }, { - key: "_asPathString", - value: function _asPathString() { - 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 clone() { - return new _SVGPathSegArcAbs(undefined, this._x, this._y, this._r1, this._r2, this._angle, this._largeArcFlag, this._sweepFlag); - } - }]); - - return _SVGPathSegArcAbs; - }(_SVGPathSeg); - - Object.defineProperties(_SVGPathSegArcAbs.prototype, { - x: { - get: function get() { - return this._x; - }, - set: function set(x) { - this._x = x; - - this._segmentChanged(); - }, - enumerable: true - }, - y: { - get: function get() { - return this._y; - }, - set: function set(y) { - this._y = y; - - this._segmentChanged(); - }, - enumerable: true - }, - r1: { - get: function get() { - return this._r1; - }, - set: function set(r1) { - this._r1 = r1; - - this._segmentChanged(); - }, - enumerable: true - }, - r2: { - get: function get() { - return this._r2; - }, - set: function set(r2) { - this._r2 = r2; - - this._segmentChanged(); - }, - enumerable: true - }, - angle: { - get: function get() { - return this._angle; - }, - set: function set(angle) { - this._angle = angle; - - this._segmentChanged(); - }, - enumerable: true - }, - largeArcFlag: { - get: function get() { - return this._largeArcFlag; - }, - set: function set(largeArcFlag) { - this._largeArcFlag = largeArcFlag; - - this._segmentChanged(); - }, - enumerable: true - }, - sweepFlag: { - get: function get() { - return this._sweepFlag; - }, - set: function set(sweepFlag) { - this._sweepFlag = sweepFlag; - - this._segmentChanged(); - }, - enumerable: true - } - }); - - 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 = _super11.call(this, _SVGPathSeg.PATHSEG_ARC_REL, 'a', owningPathSegList); - _this10._x = x; - _this10._y = y; - _this10._r1 = r1; - _this10._r2 = r2; - _this10._angle = angle; - _this10._largeArcFlag = largeArcFlag; - _this10._sweepFlag = sweepFlag; - return _this10; - } - - _createClass(_SVGPathSegArcRel, [{ - key: "toString", - value: function toString() { - return '[object SVGPathSegArcRel]'; - } - }, { - key: "_asPathString", - value: function _asPathString() { - 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 clone() { - return new _SVGPathSegArcRel(undefined, this._x, this._y, this._r1, this._r2, this._angle, this._largeArcFlag, this._sweepFlag); - } - }]); - - return _SVGPathSegArcRel; - }(_SVGPathSeg); - - Object.defineProperties(_SVGPathSegArcRel.prototype, { - x: { - get: function get() { - return this._x; - }, - set: function set(x) { - this._x = x; - - this._segmentChanged(); - }, - enumerable: true - }, - y: { - get: function get() { - return this._y; - }, - set: function set(y) { - this._y = y; - - this._segmentChanged(); - }, - enumerable: true - }, - r1: { - get: function get() { - return this._r1; - }, - set: function set(r1) { - this._r1 = r1; - - this._segmentChanged(); - }, - enumerable: true - }, - r2: { - get: function get() { - return this._r2; - }, - set: function set(r2) { - this._r2 = r2; - - this._segmentChanged(); - }, - enumerable: true - }, - angle: { - get: function get() { - return this._angle; - }, - set: function set(angle) { - this._angle = angle; - - this._segmentChanged(); - }, - enumerable: true - }, - largeArcFlag: { - get: function get() { - return this._largeArcFlag; - }, - set: function set(largeArcFlag) { - this._largeArcFlag = largeArcFlag; - - this._segmentChanged(); - }, - enumerable: true - }, - sweepFlag: { - get: function get() { - return this._sweepFlag; - }, - set: function set(sweepFlag) { - this._sweepFlag = sweepFlag; - - this._segmentChanged(); - }, - enumerable: true - } - }); - - var _SVGPathSegLinetoHorizontalAbs = /*#__PURE__*/function (_SVGPathSeg13) { - _inherits(_SVGPathSegLinetoHorizontalAbs, _SVGPathSeg13); - - var _super12 = _createSuper(_SVGPathSegLinetoHorizontalAbs); - - function _SVGPathSegLinetoHorizontalAbs(owningPathSegList, x) { - var _this11; - - _classCallCheck(this, _SVGPathSegLinetoHorizontalAbs); - - _this11 = _super12.call(this, _SVGPathSeg.PATHSEG_LINETO_HORIZONTAL_ABS, 'H', owningPathSegList); - _this11._x = x; - return _this11; - } - - _createClass(_SVGPathSegLinetoHorizontalAbs, [{ - key: "toString", - value: function toString() { - return '[object SVGPathSegLinetoHorizontalAbs]'; - } - }, { - key: "_asPathString", - value: function _asPathString() { - return this.pathSegTypeAsLetter + ' ' + this._x; - } - }, { - key: "clone", - value: function clone() { - return new _SVGPathSegLinetoHorizontalAbs(undefined, this._x); - } - }]); - - return _SVGPathSegLinetoHorizontalAbs; - }(_SVGPathSeg); - - Object.defineProperty(_SVGPathSegLinetoHorizontalAbs.prototype, 'x', { - get: function get() { - return this._x; - }, - set: function set(x) { - this._x = x; - - this._segmentChanged(); - }, - enumerable: true - }); - - var _SVGPathSegLinetoHorizontalRel = /*#__PURE__*/function (_SVGPathSeg14) { - _inherits(_SVGPathSegLinetoHorizontalRel, _SVGPathSeg14); - - var _super13 = _createSuper(_SVGPathSegLinetoHorizontalRel); - - function _SVGPathSegLinetoHorizontalRel(owningPathSegList, x) { - var _this12; - - _classCallCheck(this, _SVGPathSegLinetoHorizontalRel); - - _this12 = _super13.call(this, _SVGPathSeg.PATHSEG_LINETO_HORIZONTAL_REL, 'h', owningPathSegList); - _this12._x = x; - return _this12; - } - - _createClass(_SVGPathSegLinetoHorizontalRel, [{ - key: "toString", - value: function toString() { - return '[object SVGPathSegLinetoHorizontalRel]'; - } - }, { - key: "_asPathString", - value: function _asPathString() { - return this.pathSegTypeAsLetter + ' ' + this._x; - } - }, { - key: "clone", - value: function clone() { - return new _SVGPathSegLinetoHorizontalRel(undefined, this._x); - } - }]); - - return _SVGPathSegLinetoHorizontalRel; - }(_SVGPathSeg); - - Object.defineProperty(_SVGPathSegLinetoHorizontalRel.prototype, 'x', { - get: function get() { - return this._x; - }, - set: function set(x) { - this._x = x; - - this._segmentChanged(); - }, - enumerable: true - }); - - var _SVGPathSegLinetoVerticalAbs = /*#__PURE__*/function (_SVGPathSeg15) { - _inherits(_SVGPathSegLinetoVerticalAbs, _SVGPathSeg15); - - var _super14 = _createSuper(_SVGPathSegLinetoVerticalAbs); - - function _SVGPathSegLinetoVerticalAbs(owningPathSegList, y) { - var _this13; - - _classCallCheck(this, _SVGPathSegLinetoVerticalAbs); - - _this13 = _super14.call(this, _SVGPathSeg.PATHSEG_LINETO_VERTICAL_ABS, 'V', owningPathSegList); - _this13._y = y; - return _this13; - } - - _createClass(_SVGPathSegLinetoVerticalAbs, [{ - key: "toString", - value: function toString() { - return '[object SVGPathSegLinetoVerticalAbs]'; - } - }, { - key: "_asPathString", - value: function _asPathString() { - return this.pathSegTypeAsLetter + ' ' + this._y; - } - }, { - key: "clone", - value: function clone() { - return new _SVGPathSegLinetoVerticalAbs(undefined, this._y); - } - }]); - - return _SVGPathSegLinetoVerticalAbs; - }(_SVGPathSeg); - - Object.defineProperty(_SVGPathSegLinetoVerticalAbs.prototype, 'y', { - get: function get() { - return this._y; - }, - set: function set(y) { - this._y = y; - - this._segmentChanged(); - }, - enumerable: true - }); - - var _SVGPathSegLinetoVerticalRel = /*#__PURE__*/function (_SVGPathSeg16) { - _inherits(_SVGPathSegLinetoVerticalRel, _SVGPathSeg16); - - var _super15 = _createSuper(_SVGPathSegLinetoVerticalRel); - - function _SVGPathSegLinetoVerticalRel(owningPathSegList, y) { - var _this14; - - _classCallCheck(this, _SVGPathSegLinetoVerticalRel); - - _this14 = _super15.call(this, _SVGPathSeg.PATHSEG_LINETO_VERTICAL_REL, 'v', owningPathSegList); - _this14._y = y; - return _this14; - } - - _createClass(_SVGPathSegLinetoVerticalRel, [{ - key: "toString", - value: function toString() { - return '[object SVGPathSegLinetoVerticalRel]'; - } - }, { - key: "_asPathString", - value: function _asPathString() { - return this.pathSegTypeAsLetter + ' ' + this._y; - } - }, { - key: "clone", - value: function clone() { - return new _SVGPathSegLinetoVerticalRel(undefined, this._y); - } - }]); - - return _SVGPathSegLinetoVerticalRel; - }(_SVGPathSeg); - - Object.defineProperty(_SVGPathSegLinetoVerticalRel.prototype, 'y', { - get: function get() { - return this._y; - }, - set: function set(y) { - this._y = y; - - this._segmentChanged(); - }, - enumerable: true - }); - - 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 = _super16.call(this, _SVGPathSeg.PATHSEG_CURVETO_CUBIC_SMOOTH_ABS, 'S', owningPathSegList); - _this15._x = x; - _this15._y = y; - _this15._x2 = x2; - _this15._y2 = y2; - return _this15; - } - - _createClass(_SVGPathSegCurvetoCubicSmoothAbs, [{ - key: "toString", - value: function toString() { - return '[object SVGPathSegCurvetoCubicSmoothAbs]'; - } - }, { - key: "_asPathString", - value: function _asPathString() { - return this.pathSegTypeAsLetter + ' ' + this._x2 + ' ' + this._y2 + ' ' + this._x + ' ' + this._y; - } - }, { - key: "clone", - value: function clone() { - return new _SVGPathSegCurvetoCubicSmoothAbs(undefined, this._x, this._y, this._x2, this._y2); - } - }]); - - return _SVGPathSegCurvetoCubicSmoothAbs; - }(_SVGPathSeg); - - Object.defineProperties(_SVGPathSegCurvetoCubicSmoothAbs.prototype, { - x: { - get: function get() { - return this._x; - }, - set: function set(x) { - this._x = x; - - this._segmentChanged(); - }, - enumerable: true - }, - y: { - get: function get() { - return this._y; - }, - set: function set(y) { - this._y = y; - - this._segmentChanged(); - }, - enumerable: true - }, - x2: { - get: function get() { - return this._x2; - }, - set: function set(x2) { - this._x2 = x2; - - this._segmentChanged(); - }, - enumerable: true - }, - y2: { - get: function get() { - return this._y2; - }, - set: function set(y2) { - this._y2 = y2; - - this._segmentChanged(); - }, - enumerable: true - } - }); - - 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 = _super17.call(this, _SVGPathSeg.PATHSEG_CURVETO_CUBIC_SMOOTH_REL, 's', owningPathSegList); - _this16._x = x; - _this16._y = y; - _this16._x2 = x2; - _this16._y2 = y2; - return _this16; - } - - _createClass(_SVGPathSegCurvetoCubicSmoothRel, [{ - key: "toString", - value: function toString() { - return '[object SVGPathSegCurvetoCubicSmoothRel]'; - } - }, { - key: "_asPathString", - value: function _asPathString() { - return this.pathSegTypeAsLetter + ' ' + this._x2 + ' ' + this._y2 + ' ' + this._x + ' ' + this._y; - } - }, { - key: "clone", - value: function clone() { - return new _SVGPathSegCurvetoCubicSmoothRel(undefined, this._x, this._y, this._x2, this._y2); - } - }]); - - return _SVGPathSegCurvetoCubicSmoothRel; - }(_SVGPathSeg); - - Object.defineProperties(_SVGPathSegCurvetoCubicSmoothRel.prototype, { - x: { - get: function get() { - return this._x; - }, - set: function set(x) { - this._x = x; - - this._segmentChanged(); - }, - enumerable: true - }, - y: { - get: function get() { - return this._y; - }, - set: function set(y) { - this._y = y; - - this._segmentChanged(); - }, - enumerable: true - }, - x2: { - get: function get() { - return this._x2; - }, - set: function set(x2) { - this._x2 = x2; - - this._segmentChanged(); - }, - enumerable: true - }, - y2: { - get: function get() { - return this._y2; - }, - set: function set(y2) { - this._y2 = y2; - - this._segmentChanged(); - }, - enumerable: true - } - }); - - var _SVGPathSegCurvetoQuadraticSmoothAbs = /*#__PURE__*/function (_SVGPathSeg19) { - _inherits(_SVGPathSegCurvetoQuadraticSmoothAbs, _SVGPathSeg19); - - var _super18 = _createSuper(_SVGPathSegCurvetoQuadraticSmoothAbs); - - function _SVGPathSegCurvetoQuadraticSmoothAbs(owningPathSegList, x, y) { - var _this17; - - _classCallCheck(this, _SVGPathSegCurvetoQuadraticSmoothAbs); - - _this17 = _super18.call(this, _SVGPathSeg.PATHSEG_CURVETO_QUADRATIC_SMOOTH_ABS, 'T', owningPathSegList); - _this17._x = x; - _this17._y = y; - return _this17; - } - - _createClass(_SVGPathSegCurvetoQuadraticSmoothAbs, [{ - key: "toString", - value: function toString() { - return '[object SVGPathSegCurvetoQuadraticSmoothAbs]'; - } - }, { - key: "_asPathString", - value: function _asPathString() { - return this.pathSegTypeAsLetter + ' ' + this._x + ' ' + this._y; - } - }, { - key: "clone", - value: function clone() { - return new _SVGPathSegCurvetoQuadraticSmoothAbs(undefined, this._x, this._y); - } - }]); - - return _SVGPathSegCurvetoQuadraticSmoothAbs; - }(_SVGPathSeg); - - Object.defineProperties(_SVGPathSegCurvetoQuadraticSmoothAbs.prototype, { - x: { - get: function get() { - return this._x; - }, - set: function set(x) { - this._x = x; - - this._segmentChanged(); - }, - enumerable: true - }, - y: { - get: function get() { - return this._y; - }, - set: function set(y) { - this._y = y; - - this._segmentChanged(); - }, - enumerable: true - } - }); - - var _SVGPathSegCurvetoQuadraticSmoothRel = /*#__PURE__*/function (_SVGPathSeg20) { - _inherits(_SVGPathSegCurvetoQuadraticSmoothRel, _SVGPathSeg20); - - var _super19 = _createSuper(_SVGPathSegCurvetoQuadraticSmoothRel); - - function _SVGPathSegCurvetoQuadraticSmoothRel(owningPathSegList, x, y) { - var _this18; - - _classCallCheck(this, _SVGPathSegCurvetoQuadraticSmoothRel); - - _this18 = _super19.call(this, _SVGPathSeg.PATHSEG_CURVETO_QUADRATIC_SMOOTH_REL, 't', owningPathSegList); - _this18._x = x; - _this18._y = y; - return _this18; - } - - _createClass(_SVGPathSegCurvetoQuadraticSmoothRel, [{ - key: "toString", - value: function toString() { - return '[object SVGPathSegCurvetoQuadraticSmoothRel]'; - } - }, { - key: "_asPathString", - value: function _asPathString() { - return this.pathSegTypeAsLetter + ' ' + this._x + ' ' + this._y; - } - }, { - key: "clone", - value: function clone() { - return new _SVGPathSegCurvetoQuadraticSmoothRel(undefined, this._x, this._y); - } - }]); - - return _SVGPathSegCurvetoQuadraticSmoothRel; - }(_SVGPathSeg); - - Object.defineProperties(_SVGPathSegCurvetoQuadraticSmoothRel.prototype, { - x: { - get: function get() { - return this._x; - }, - set: function set(x) { - this._x = x; - - this._segmentChanged(); - }, - enumerable: true - }, - y: { - get: function get() { - return this._y; - }, - set: function set(y) { - this._y = y; - - this._segmentChanged(); - }, - enumerable: true - } - }); // Add createSVGPathSeg* functions to SVGPathElement. - // Spec: https://www.w3.org/TR/SVG11/single-page.html#paths-InterfaceSVGPathElement. - - SVGPathElement.prototype.createSVGPathSegClosePath = function () { - return new _SVGPathSegClosePath(undefined); - }; - - SVGPathElement.prototype.createSVGPathSegMovetoAbs = function (x, y) { - return new _SVGPathSegMovetoAbs(undefined, x, y); - }; - - SVGPathElement.prototype.createSVGPathSegMovetoRel = function (x, y) { - return new _SVGPathSegMovetoRel(undefined, x, y); - }; - - SVGPathElement.prototype.createSVGPathSegLinetoAbs = function (x, y) { - return new _SVGPathSegLinetoAbs(undefined, x, y); - }; - - SVGPathElement.prototype.createSVGPathSegLinetoRel = function (x, y) { - return new _SVGPathSegLinetoRel(undefined, x, y); - }; - - SVGPathElement.prototype.createSVGPathSegCurvetoCubicAbs = function (x, y, x1, y1, x2, y2) { - return new _SVGPathSegCurvetoCubicAbs(undefined, x, y, x1, y1, x2, y2); - }; - - SVGPathElement.prototype.createSVGPathSegCurvetoCubicRel = function (x, y, x1, y1, x2, y2) { - return new _SVGPathSegCurvetoCubicRel(undefined, x, y, x1, y1, x2, y2); - }; - - SVGPathElement.prototype.createSVGPathSegCurvetoQuadraticAbs = function (x, y, x1, y1) { - return new _SVGPathSegCurvetoQuadraticAbs(undefined, x, y, x1, y1); - }; - - SVGPathElement.prototype.createSVGPathSegCurvetoQuadraticRel = function (x, y, x1, y1) { - return new _SVGPathSegCurvetoQuadraticRel(undefined, x, y, x1, y1); - }; - - SVGPathElement.prototype.createSVGPathSegArcAbs = function (x, y, r1, r2, angle, largeArcFlag, sweepFlag) { - return new _SVGPathSegArcAbs(undefined, x, y, r1, r2, angle, largeArcFlag, sweepFlag); - }; - - SVGPathElement.prototype.createSVGPathSegArcRel = function (x, y, r1, r2, angle, largeArcFlag, sweepFlag) { - return new _SVGPathSegArcRel(undefined, x, y, r1, r2, angle, largeArcFlag, sweepFlag); - }; - - SVGPathElement.prototype.createSVGPathSegLinetoHorizontalAbs = function (x) { - return new _SVGPathSegLinetoHorizontalAbs(undefined, x); - }; - - SVGPathElement.prototype.createSVGPathSegLinetoHorizontalRel = function (x) { - return new _SVGPathSegLinetoHorizontalRel(undefined, x); - }; - - SVGPathElement.prototype.createSVGPathSegLinetoVerticalAbs = function (y) { - return new _SVGPathSegLinetoVerticalAbs(undefined, y); - }; - - SVGPathElement.prototype.createSVGPathSegLinetoVerticalRel = function (y) { - return new _SVGPathSegLinetoVerticalRel(undefined, y); - }; - - SVGPathElement.prototype.createSVGPathSegCurvetoCubicSmoothAbs = function (x, y, x2, y2) { - return new _SVGPathSegCurvetoCubicSmoothAbs(undefined, x, y, x2, y2); - }; - - SVGPathElement.prototype.createSVGPathSegCurvetoCubicSmoothRel = function (x, y, x2, y2) { - return new _SVGPathSegCurvetoCubicSmoothRel(undefined, x, y, x2, y2); - }; - - SVGPathElement.prototype.createSVGPathSegCurvetoQuadraticSmoothAbs = function (x, y) { - return new _SVGPathSegCurvetoQuadraticSmoothAbs(undefined, x, y); - }; - - SVGPathElement.prototype.createSVGPathSegCurvetoQuadraticSmoothRel = function (x, y) { - return new _SVGPathSegCurvetoQuadraticSmoothRel(undefined, x, y); - }; - - if (!('getPathSegAtLength' in SVGPathElement.prototype)) { - // Add getPathSegAtLength to SVGPathElement. - // Spec: https://www.w3.org/TR/SVG11/single-page.html#paths-__svg__SVGPathElement__getPathSegAtLength - // This polyfill requires SVGPathElement.getTotalLength to implement the distance-along-a-path algorithm. - SVGPathElement.prototype.getPathSegAtLength = function (distance) { - if (distance === undefined || !isFinite(distance)) { - throw new Error('Invalid arguments.'); - } - - var measurementElement = document.createElementNS('http://www.w3.org/2000/svg', 'path'); - measurementElement.setAttribute('d', this.getAttribute('d')); - var lastPathSegment = measurementElement.pathSegList.numberOfItems - 1; // If the path is empty, return 0. - - if (lastPathSegment <= 0) { - return 0; - } - - do { - measurementElement.pathSegList.removeItem(lastPathSegment); - - if (distance > measurementElement.getTotalLength()) { - break; - } - - lastPathSegment--; - } while (lastPathSegment > 0); - - return lastPathSegment; - }; - } - - window.SVGPathSeg = _SVGPathSeg; - window.SVGPathSegClosePath = _SVGPathSegClosePath; - window.SVGPathSegMovetoAbs = _SVGPathSegMovetoAbs; - window.SVGPathSegMovetoRel = _SVGPathSegMovetoRel; - window.SVGPathSegLinetoAbs = _SVGPathSegLinetoAbs; - window.SVGPathSegLinetoRel = _SVGPathSegLinetoRel; - window.SVGPathSegCurvetoCubicAbs = _SVGPathSegCurvetoCubicAbs; - window.SVGPathSegCurvetoCubicRel = _SVGPathSegCurvetoCubicRel; - window.SVGPathSegCurvetoQuadraticAbs = _SVGPathSegCurvetoQuadraticAbs; - window.SVGPathSegCurvetoQuadraticRel = _SVGPathSegCurvetoQuadraticRel; - window.SVGPathSegArcAbs = _SVGPathSegArcAbs; - window.SVGPathSegArcRel = _SVGPathSegArcRel; - window.SVGPathSegLinetoHorizontalAbs = _SVGPathSegLinetoHorizontalAbs; - window.SVGPathSegLinetoHorizontalRel = _SVGPathSegLinetoHorizontalRel; - window.SVGPathSegLinetoVerticalAbs = _SVGPathSegLinetoVerticalAbs; - window.SVGPathSegLinetoVerticalRel = _SVGPathSegLinetoVerticalRel; - window.SVGPathSegCurvetoCubicSmoothAbs = _SVGPathSegCurvetoCubicSmoothAbs; - window.SVGPathSegCurvetoCubicSmoothRel = _SVGPathSegCurvetoCubicSmoothRel; - window.SVGPathSegCurvetoQuadraticSmoothAbs = _SVGPathSegCurvetoQuadraticSmoothAbs; - window.SVGPathSegCurvetoQuadraticSmoothRel = _SVGPathSegCurvetoQuadraticSmoothRel; - } // Checking for SVGPathSegList in window checks for the case of an implementation without the - // SVGPathSegList API. - // The second check for appendItem is specific to Firefox 59+ which removed only parts of the - // SVGPathSegList API (e.g., appendItem). In this case we need to re-implement the entire API - // so the polyfill data (i.e., _list) is used throughout. - - - if (!('SVGPathSegList' in window) || !('appendItem' in window.SVGPathSegList.prototype)) { - // Spec: https://www.w3.org/TR/SVG11/single-page.html#paths-InterfaceSVGPathSegList - var SVGPathSegList = /*#__PURE__*/function () { - function SVGPathSegList(pathElement) { - _classCallCheck(this, SVGPathSegList); - - this._pathElement = pathElement; - this._list = this._parsePath(this._pathElement.getAttribute('d')); // Use a MutationObserver to catch changes to the path's "d" attribute. - - this._mutationObserverConfig = { - attributes: true, - attributeFilter: ['d'] - }; - this._pathElementMutationObserver = new MutationObserver(this._updateListFromPathMutations.bind(this)); - - this._pathElementMutationObserver.observe(this._pathElement, this._mutationObserverConfig); - } // Process any pending mutations to the path element and update the list as needed. - // This should be the first call of all public functions and is needed because - // MutationObservers are not synchronous so we can have pending asynchronous mutations. - - - _createClass(SVGPathSegList, [{ - key: "_checkPathSynchronizedToList", - value: function _checkPathSynchronizedToList() { - this._updateListFromPathMutations(this._pathElementMutationObserver.takeRecords()); - } - }, { - key: "_updateListFromPathMutations", - value: function _updateListFromPathMutations(mutationRecords) { - if (!this._pathElement) { - return; - } - - var hasPathMutations = false; - mutationRecords.forEach(function (record) { - if (record.attributeName === 'd') { - hasPathMutations = true; - } - }); - - if (hasPathMutations) { - this._list = this._parsePath(this._pathElement.getAttribute('d')); - } - } // Serialize the list and update the path's 'd' attribute. - - }, { - key: "_writeListToPath", - value: function _writeListToPath() { - this._pathElementMutationObserver.disconnect(); - - this._pathElement.setAttribute('d', SVGPathSegList._pathSegArrayAsString(this._list)); - - this._pathElementMutationObserver.observe(this._pathElement, this._mutationObserverConfig); - } // When a path segment changes the list needs to be synchronized back to the path element. - - }, { - key: "segmentChanged", - value: function segmentChanged(pathSeg) { - this._writeListToPath(); - } - }, { - key: "clear", - value: function clear() { - this._checkPathSynchronizedToList(); - - this._list.forEach(function (pathSeg) { - pathSeg._owningPathSegList = null; - }); - - this._list = []; - - this._writeListToPath(); - } - }, { - key: "initialize", - value: function initialize(newItem) { - this._checkPathSynchronizedToList(); - - this._list = [newItem]; - newItem._owningPathSegList = this; - - this._writeListToPath(); - - return newItem; - } - }, { - key: "_checkValidIndex", - value: function _checkValidIndex(index) { - if (isNaN(index) || index < 0 || index >= this.numberOfItems) { - throw new Error('INDEX_SIZE_ERR'); - } - } - }, { - key: "getItem", - value: function getItem(index) { - this._checkPathSynchronizedToList(); - - this._checkValidIndex(index); - - return this._list[index]; - } - }, { - key: "insertItemBefore", - value: function insertItemBefore(newItem, index) { - this._checkPathSynchronizedToList(); // Spec: If the index is greater than or equal to numberOfItems, then the new item is appended to the end of the list. - - - if (index > this.numberOfItems) { - index = this.numberOfItems; - } - - if (newItem._owningPathSegList) { - // SVG2 spec says to make a copy. - newItem = newItem.clone(); - } - - this._list.splice(index, 0, newItem); - - newItem._owningPathSegList = this; - - this._writeListToPath(); - - return newItem; - } - }, { - key: "replaceItem", - value: function replaceItem(newItem, index) { - this._checkPathSynchronizedToList(); - - if (newItem._owningPathSegList) { - // SVG2 spec says to make a copy. - newItem = newItem.clone(); - } - - this._checkValidIndex(index); - - this._list[index] = newItem; - newItem._owningPathSegList = this; - - this._writeListToPath(); - - return newItem; - } - }, { - key: "removeItem", - value: function removeItem(index) { - this._checkPathSynchronizedToList(); - - this._checkValidIndex(index); - - var item = this._list[index]; - - this._list.splice(index, 1); - - this._writeListToPath(); - - return item; - } - }, { - key: "appendItem", - value: function appendItem(newItem) { - this._checkPathSynchronizedToList(); - - if (newItem._owningPathSegList) { - // SVG2 spec says to make a copy. - newItem = newItem.clone(); - } - - this._list.push(newItem); - - newItem._owningPathSegList = this; // TODO: Optimize this to just append to the existing attribute. - - this._writeListToPath(); - - return newItem; - } // This closely follows SVGPathParser::parsePath from Source/core/svg/SVGPathParser.cpp. - - }, { - key: "_parsePath", - value: function _parsePath(string) { - if (!string || !string.length) { - return []; - } - - var owningPathSegList = this; - - var Builder = /*#__PURE__*/function () { - function Builder() { - _classCallCheck(this, Builder); - - this.pathSegList = []; - } - - _createClass(Builder, [{ - key: "appendSegment", - value: function appendSegment(pathSeg) { - this.pathSegList.push(pathSeg); - } - }]); - - return Builder; - }(); - - var Source = /*#__PURE__*/function () { - function Source(string) { - _classCallCheck(this, Source); - - this._string = string; - this._currentIndex = 0; - this._endIndex = this._string.length; - this._previousCommand = SVGPathSeg.PATHSEG_UNKNOWN; - - this._skipOptionalSpaces(); - } - - _createClass(Source, [{ - key: "_isCurrentSpace", - value: function _isCurrentSpace() { - var character = this._string[this._currentIndex]; - return character <= ' ' && (character === ' ' || character === '\n' || character === '\t' || character === '\r' || character === '\f'); - } - }, { - key: "_skipOptionalSpaces", - value: function _skipOptionalSpaces() { - while (this._currentIndex < this._endIndex && this._isCurrentSpace()) { - this._currentIndex++; - } - - return this._currentIndex < this._endIndex; - } - }, { - key: "_skipOptionalSpacesOrDelimiter", - value: function _skipOptionalSpacesOrDelimiter() { - if (this._currentIndex < this._endIndex && !this._isCurrentSpace() && this._string.charAt(this._currentIndex) !== ',') { - return false; - } - - if (this._skipOptionalSpaces()) { - if (this._currentIndex < this._endIndex && this._string.charAt(this._currentIndex) === ',') { - this._currentIndex++; - - this._skipOptionalSpaces(); - } - } - - return this._currentIndex < this._endIndex; - } - }, { - key: "hasMoreData", - value: function hasMoreData() { - return this._currentIndex < this._endIndex; - } - }, { - key: "peekSegmentType", - value: function peekSegmentType() { - var lookahead = this._string[this._currentIndex]; - return this._pathSegTypeFromChar(lookahead); - } - }, { - key: "_pathSegTypeFromChar", - value: function _pathSegTypeFromChar(lookahead) { - switch (lookahead) { - case 'Z': - case 'z': - return SVGPathSeg.PATHSEG_CLOSEPATH; - - case 'M': - return SVGPathSeg.PATHSEG_MOVETO_ABS; - - case 'm': - return SVGPathSeg.PATHSEG_MOVETO_REL; - - case 'L': - return SVGPathSeg.PATHSEG_LINETO_ABS; - - case 'l': - return SVGPathSeg.PATHSEG_LINETO_REL; - - case 'C': - return SVGPathSeg.PATHSEG_CURVETO_CUBIC_ABS; - - case 'c': - return SVGPathSeg.PATHSEG_CURVETO_CUBIC_REL; - - case 'Q': - return SVGPathSeg.PATHSEG_CURVETO_QUADRATIC_ABS; - - case 'q': - return SVGPathSeg.PATHSEG_CURVETO_QUADRATIC_REL; - - case 'A': - return SVGPathSeg.PATHSEG_ARC_ABS; - - case 'a': - return SVGPathSeg.PATHSEG_ARC_REL; - - case 'H': - return SVGPathSeg.PATHSEG_LINETO_HORIZONTAL_ABS; - - case 'h': - return SVGPathSeg.PATHSEG_LINETO_HORIZONTAL_REL; - - case 'V': - return SVGPathSeg.PATHSEG_LINETO_VERTICAL_ABS; - - case 'v': - return SVGPathSeg.PATHSEG_LINETO_VERTICAL_REL; - - case 'S': - return SVGPathSeg.PATHSEG_CURVETO_CUBIC_SMOOTH_ABS; - - case 's': - return SVGPathSeg.PATHSEG_CURVETO_CUBIC_SMOOTH_REL; - - case 'T': - return SVGPathSeg.PATHSEG_CURVETO_QUADRATIC_SMOOTH_ABS; - - case 't': - return SVGPathSeg.PATHSEG_CURVETO_QUADRATIC_SMOOTH_REL; - - default: - return SVGPathSeg.PATHSEG_UNKNOWN; - } - } - }, { - key: "_nextCommandHelper", - value: function _nextCommandHelper(lookahead, previousCommand) { - // Check for remaining coordinates in the current command. - if ((lookahead === '+' || lookahead === '-' || lookahead === '.' || lookahead >= '0' && lookahead <= '9') && previousCommand !== SVGPathSeg.PATHSEG_CLOSEPATH) { - if (previousCommand === SVGPathSeg.PATHSEG_MOVETO_ABS) { - return SVGPathSeg.PATHSEG_LINETO_ABS; - } - - if (previousCommand === SVGPathSeg.PATHSEG_MOVETO_REL) { - return SVGPathSeg.PATHSEG_LINETO_REL; - } - - return previousCommand; - } - - return SVGPathSeg.PATHSEG_UNKNOWN; - } - }, { - key: "initialCommandIsMoveTo", - value: function initialCommandIsMoveTo() { - // If the path is empty it is still valid, so return true. - if (!this.hasMoreData()) { - return true; - } - - var command = this.peekSegmentType(); // Path must start with moveTo. - - return command === SVGPathSeg.PATHSEG_MOVETO_ABS || command === SVGPathSeg.PATHSEG_MOVETO_REL; - } // Parse a number from an SVG path. This very closely follows genericParseNumber(...) from Source/core/svg/SVGParserUtilities.cpp. - // Spec: https://www.w3.org/TR/SVG11/single-page.html#paths-PathDataBNF - - }, { - key: "_parseNumber", - value: function _parseNumber() { - var exponent = 0; - var integer = 0; - var frac = 1; - var decimal = 0; - var sign = 1; - var expsign = 1; - var startIndex = this._currentIndex; - - this._skipOptionalSpaces(); // Read the sign. - - - if (this._currentIndex < this._endIndex && this._string.charAt(this._currentIndex) === '+') { - this._currentIndex++; - } else if (this._currentIndex < this._endIndex && this._string.charAt(this._currentIndex) === '-') { - this._currentIndex++; - sign = -1; - } - - if (this._currentIndex === this._endIndex || (this._string.charAt(this._currentIndex) < '0' || this._string.charAt(this._currentIndex) > '9') && this._string.charAt(this._currentIndex) !== '.') { - // The first character of a number must be one of [0-9+-.]. - return undefined; - } // Read the integer part, build right-to-left. - - - var startIntPartIndex = this._currentIndex; - - while (this._currentIndex < this._endIndex && this._string.charAt(this._currentIndex) >= '0' && this._string.charAt(this._currentIndex) <= '9') { - this._currentIndex++; // Advance to first non-digit. - } - - if (this._currentIndex !== startIntPartIndex) { - var scanIntPartIndex = this._currentIndex - 1; - var multiplier = 1; - - while (scanIntPartIndex >= startIntPartIndex) { - integer += multiplier * (this._string.charAt(scanIntPartIndex--) - '0'); - multiplier *= 10; - } - } // Read the decimals. - - - if (this._currentIndex < this._endIndex && this._string.charAt(this._currentIndex) === '.') { - this._currentIndex++; // There must be a least one digit following the . - - if (this._currentIndex >= this._endIndex || this._string.charAt(this._currentIndex) < '0' || this._string.charAt(this._currentIndex) > '9') { - return undefined; - } - - while (this._currentIndex < this._endIndex && this._string.charAt(this._currentIndex) >= '0' && this._string.charAt(this._currentIndex) <= '9') { - frac *= 10; - decimal += (this._string.charAt(this._currentIndex) - '0') / frac; - this._currentIndex += 1; - } - } // Read the exponent part. - - - if (this._currentIndex !== startIndex && this._currentIndex + 1 < this._endIndex && (this._string.charAt(this._currentIndex) === 'e' || this._string.charAt(this._currentIndex) === 'E') && this._string.charAt(this._currentIndex + 1) !== 'x' && this._string.charAt(this._currentIndex + 1) !== 'm') { - this._currentIndex++; // Read the sign of the exponent. - - if (this._string.charAt(this._currentIndex) === '+') { - this._currentIndex++; - } else if (this._string.charAt(this._currentIndex) === '-') { - this._currentIndex++; - expsign = -1; - } // There must be an exponent. - - - if (this._currentIndex >= this._endIndex || this._string.charAt(this._currentIndex) < '0' || this._string.charAt(this._currentIndex) > '9') { - return undefined; - } - - while (this._currentIndex < this._endIndex && this._string.charAt(this._currentIndex) >= '0' && this._string.charAt(this._currentIndex) <= '9') { - exponent *= 10; - exponent += this._string.charAt(this._currentIndex) - '0'; - this._currentIndex++; - } - } - - var number = integer + decimal; - number *= sign; - - if (exponent) { - number *= Math.pow(10, expsign * exponent); - } - - if (startIndex === this._currentIndex) { - return undefined; - } - - this._skipOptionalSpacesOrDelimiter(); - - return number; - } - }, { - key: "_parseArcFlag", - value: function _parseArcFlag() { - if (this._currentIndex >= this._endIndex) { - return undefined; - } - - var flag = false; - - var flagChar = this._string.charAt(this._currentIndex++); - - if (flagChar === '0') { - flag = false; - } else if (flagChar === '1') { - flag = true; - } else { - return undefined; - } - - this._skipOptionalSpacesOrDelimiter(); - - return flag; - } - }, { - key: "parseSegment", - value: function parseSegment() { - var lookahead = this._string[this._currentIndex]; - - var command = this._pathSegTypeFromChar(lookahead); - - if (command === SVGPathSeg.PATHSEG_UNKNOWN) { - // Possibly an implicit command. Not allowed if this is the first command. - if (this._previousCommand === SVGPathSeg.PATHSEG_UNKNOWN) { - return null; - } - - command = this._nextCommandHelper(lookahead, this._previousCommand); - - if (command === SVGPathSeg.PATHSEG_UNKNOWN) { - return null; - } - } else { - this._currentIndex++; - } - - this._previousCommand = command; - - switch (command) { - case SVGPathSeg.PATHSEG_MOVETO_REL: - return new SVGPathSegMovetoRel(owningPathSegList, this._parseNumber(), this._parseNumber()); - - case SVGPathSeg.PATHSEG_MOVETO_ABS: - return new SVGPathSegMovetoAbs(owningPathSegList, this._parseNumber(), this._parseNumber()); - - case SVGPathSeg.PATHSEG_LINETO_REL: - return new SVGPathSegLinetoRel(owningPathSegList, this._parseNumber(), this._parseNumber()); - - case SVGPathSeg.PATHSEG_LINETO_ABS: - return new SVGPathSegLinetoAbs(owningPathSegList, this._parseNumber(), this._parseNumber()); - - case SVGPathSeg.PATHSEG_LINETO_HORIZONTAL_REL: - return new SVGPathSegLinetoHorizontalRel(owningPathSegList, this._parseNumber()); - - case SVGPathSeg.PATHSEG_LINETO_HORIZONTAL_ABS: - return new SVGPathSegLinetoHorizontalAbs(owningPathSegList, this._parseNumber()); - - case SVGPathSeg.PATHSEG_LINETO_VERTICAL_REL: - return new SVGPathSegLinetoVerticalRel(owningPathSegList, this._parseNumber()); - - case SVGPathSeg.PATHSEG_LINETO_VERTICAL_ABS: - return new SVGPathSegLinetoVerticalAbs(owningPathSegList, this._parseNumber()); - - case SVGPathSeg.PATHSEG_CLOSEPATH: - this._skipOptionalSpaces(); - - return new SVGPathSegClosePath(owningPathSegList); - - case SVGPathSeg.PATHSEG_CURVETO_CUBIC_REL: - { - var points = { - x1: this._parseNumber(), - y1: this._parseNumber(), - x2: this._parseNumber(), - y2: this._parseNumber(), - x: this._parseNumber(), - y: this._parseNumber() - }; - return new SVGPathSegCurvetoCubicRel(owningPathSegList, points.x, points.y, points.x1, points.y1, points.x2, points.y2); - } - - case SVGPathSeg.PATHSEG_CURVETO_CUBIC_ABS: - { - var _points = { - x1: this._parseNumber(), - y1: this._parseNumber(), - x2: this._parseNumber(), - y2: this._parseNumber(), - x: this._parseNumber(), - y: this._parseNumber() - }; - return new SVGPathSegCurvetoCubicAbs(owningPathSegList, _points.x, _points.y, _points.x1, _points.y1, _points.x2, _points.y2); - } - - case SVGPathSeg.PATHSEG_CURVETO_CUBIC_SMOOTH_REL: - { - var _points2 = { - x2: this._parseNumber(), - y2: this._parseNumber(), - x: this._parseNumber(), - y: this._parseNumber() - }; - return new SVGPathSegCurvetoCubicSmoothRel(owningPathSegList, _points2.x, _points2.y, _points2.x2, _points2.y2); - } - - case SVGPathSeg.PATHSEG_CURVETO_CUBIC_SMOOTH_ABS: - { - var _points3 = { - x2: this._parseNumber(), - y2: this._parseNumber(), - x: this._parseNumber(), - y: this._parseNumber() - }; - return new SVGPathSegCurvetoCubicSmoothAbs(owningPathSegList, _points3.x, _points3.y, _points3.x2, _points3.y2); - } - - case SVGPathSeg.PATHSEG_CURVETO_QUADRATIC_REL: - { - var _points4 = { - x1: this._parseNumber(), - y1: this._parseNumber(), - x: this._parseNumber(), - y: this._parseNumber() - }; - return new SVGPathSegCurvetoQuadraticRel(owningPathSegList, _points4.x, _points4.y, _points4.x1, _points4.y1); - } - - case SVGPathSeg.PATHSEG_CURVETO_QUADRATIC_ABS: - { - var _points5 = { - x1: this._parseNumber(), - y1: this._parseNumber(), - x: this._parseNumber(), - y: this._parseNumber() - }; - return new SVGPathSegCurvetoQuadraticAbs(owningPathSegList, _points5.x, _points5.y, _points5.x1, _points5.y1); - } - - case SVGPathSeg.PATHSEG_CURVETO_QUADRATIC_SMOOTH_REL: - return new SVGPathSegCurvetoQuadraticSmoothRel(owningPathSegList, this._parseNumber(), this._parseNumber()); - - case SVGPathSeg.PATHSEG_CURVETO_QUADRATIC_SMOOTH_ABS: - return new SVGPathSegCurvetoQuadraticSmoothAbs(owningPathSegList, this._parseNumber(), this._parseNumber()); - - case SVGPathSeg.PATHSEG_ARC_REL: - { - var _points6 = { - x1: this._parseNumber(), - y1: this._parseNumber(), - arcAngle: this._parseNumber(), - arcLarge: this._parseArcFlag(), - arcSweep: this._parseArcFlag(), - x: this._parseNumber(), - y: this._parseNumber() - }; - return new SVGPathSegArcRel(owningPathSegList, _points6.x, _points6.y, _points6.x1, _points6.y1, _points6.arcAngle, _points6.arcLarge, _points6.arcSweep); - } - - case SVGPathSeg.PATHSEG_ARC_ABS: - { - var _points7 = { - x1: this._parseNumber(), - y1: this._parseNumber(), - arcAngle: this._parseNumber(), - arcLarge: this._parseArcFlag(), - arcSweep: this._parseArcFlag(), - x: this._parseNumber(), - y: this._parseNumber() - }; - return new SVGPathSegArcAbs(owningPathSegList, _points7.x, _points7.y, _points7.x1, _points7.y1, _points7.arcAngle, _points7.arcLarge, _points7.arcSweep); - } - - default: - throw new Error('Unknown path seg type.'); - } - } - }]); - - return Source; - }(); - - var builder = new Builder(); - var source = new Source(string); - - if (!source.initialCommandIsMoveTo()) { - return []; - } - - while (source.hasMoreData()) { - var pathSeg = source.parseSegment(); - - if (!pathSeg) { - return []; - } - - builder.appendSegment(pathSeg); - } - - return builder.pathSegList; - } // STATIC - - }], [{ - key: "_pathSegArrayAsString", - value: function _pathSegArrayAsString(pathSegArray) { - var string = ''; - var first = true; - pathSegArray.forEach(function (pathSeg) { - if (first) { - first = false; - string += pathSeg._asPathString(); - } else { - string += ' ' + pathSeg._asPathString(); - } - }); - return string; - } - }]); - - return SVGPathSegList; - }(); - - SVGPathSegList.prototype.classname = 'SVGPathSegList'; - Object.defineProperty(SVGPathSegList.prototype, 'numberOfItems', { - get: function get() { - this._checkPathSynchronizedToList(); - - return this._list.length; - }, - enumerable: true - }); // Add the pathSegList accessors to SVGPathElement. - // Spec: https://www.w3.org/TR/SVG11/single-page.html#paths-InterfaceSVGAnimatedPathData - - Object.defineProperties(SVGPathElement.prototype, { - pathSegList: { - get: function get() { - if (!this._pathSegList) { - this._pathSegList = new SVGPathSegList(this); - } - - return this._pathSegList; - }, - enumerable: true - }, - // TODO: The following are not implemented and simply return SVGPathElement.pathSegList. - normalizedPathSegList: { - get: function get() { - return this.pathSegList; - }, - enumerable: true - }, - animatedPathSegList: { - get: function get() { - return this.pathSegList; - }, - enumerable: true - }, - animatedNormalizedPathSegList: { - get: function get() { - return this.pathSegList; - }, - enumerable: true - } - }); - window.SVGPathSegList = SVGPathSegList; - } -})(); - -// The button toggles whether the path is open or closed - -var extClosepath = { - name: 'closepath', - init: function init(_ref) { - return _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee() { - var importLocale, $, strings, selElems, updateButton, showPanel, toggleClosed, buttons; - return regeneratorRuntime.wrap(function _callee$(_context) { - while (1) { - switch (_context.prev = _context.next) { - case 0: - importLocale = _ref.importLocale, $ = _ref.$; - _context.next = 3; - return importLocale(); - - case 3: - strings = _context.sent; - - updateButton = function updateButton(path) { - var seglist = path.pathSegList, - closed = seglist.getItem(seglist.numberOfItems - 1).pathSegType === 1, - showbutton = closed ? '#tool_openpath' : '#tool_closepath', - hidebutton = closed ? '#tool_closepath' : '#tool_openpath'; - $(hidebutton).hide(); - $(showbutton).show(); - }; - - showPanel = function showPanel(on) { - $('#closepath_panel').toggle(on); - - if (on) { - var path = selElems[0]; - - if (path) { - updateButton(path); - } - } - }; - - toggleClosed = function toggleClosed() { - var path = selElems[0]; - - if (path) { - var seglist = path.pathSegList, - last = seglist.numberOfItems - 1; // is closed - - if (seglist.getItem(last).pathSegType === 1) { - seglist.removeItem(last); - } else { - seglist.appendItem(path.createSVGPathSegClosePath()); - } - - updateButton(path); - } - }; - - buttons = [{ - id: 'tool_openpath', - icon: 'openpath.png', - type: 'context', - panel: 'closepath_panel', - events: { - click: function click() { - toggleClosed(); - } - } - }, { - id: 'tool_closepath', - icon: 'closepath.png', - type: 'context', - panel: 'closepath_panel', - events: { - click: function click() { - toggleClosed(); - } - } - }]; - return _context.abrupt("return", { - name: strings.name, - svgicons: 'closepath_icons.svg', - buttons: strings.buttons.map(function (button, i) { - return Object.assign(buttons[i], button); - }), - callback: function callback() { - $('#closepath_panel').hide(); - }, - selectedChanged: function selectedChanged(opts) { - selElems = opts.elems; - var i = selElems.length; - - while (i--) { - var elem = selElems[i]; - - if (elem && elem.tagName === 'path') { - if (opts.selectedElement && !opts.multiselected) { - showPanel(true); - } else { - showPanel(false); - } - } else { - showPanel(false); - } - } - } - }); - - case 9: - case "end": - return _context.stop(); - } - } - }, _callee); - }))(); - } -}; - -export default extClosepath; +function _AwaitValue(t){this.wrapped=t}function _AsyncGenerator(t){var e,n;function resume(e,n){try{var r=t[e](n),i=r.value,a=i instanceof _AwaitValue;Promise.resolve(a?i.wrapped:i).then((function(t){a?resume("return"===e?"return":"next",t):settle(r.done?"return":"normal",t)}),(function(t){resume("throw",t)}))}catch(t){settle("throw",t)}}function settle(t,r){switch(t){case"return":e.resolve({value:r,done:!0});break;case"throw":e.reject(r);break;default:e.resolve({value:r,done:!1})}(e=e.next)?resume(e.key,e.arg):n=null}this._invoke=function send(t,r){return new Promise((function(i,a){var s={key:t,arg:r,resolve:i,reject:a,next:null};n?n=n.next=s:(e=n=s,resume(t,r))}))},"function"!=typeof t.return&&(this.return=void 0)}function asyncGeneratorStep(t,e,n,r,i,a,s){try{var h=t[a](s),o=h.value}catch(t){return void n(t)}h.done?e(o):Promise.resolve(o).then(r,i)}function _classCallCheck(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function _defineProperties(t,e){for(var n=0;ne.getTotalLength())break;n--}while(n>0);return n}),window.SVGPathSeg=t,window.SVGPathSegClosePath=e,window.SVGPathSegMovetoAbs=n,window.SVGPathSegMovetoRel=r,window.SVGPathSegLinetoAbs=i,window.SVGPathSegLinetoRel=a,window.SVGPathSegCurvetoCubicAbs=s,window.SVGPathSegCurvetoCubicRel=h,window.SVGPathSegCurvetoQuadraticAbs=o,window.SVGPathSegCurvetoQuadraticRel=_,window.SVGPathSegArcAbs=u,window.SVGPathSegArcRel=c,window.SVGPathSegLinetoHorizontalAbs=S,window.SVGPathSegLinetoHorizontalRel=g,window.SVGPathSegLinetoVerticalAbs=l,window.SVGPathSegLinetoVerticalRel=P,window.SVGPathSegCurvetoCubicSmoothAbs=p,window.SVGPathSegCurvetoCubicSmoothRel=f,window.SVGPathSegCurvetoQuadraticSmoothAbs=y,window.SVGPathSegCurvetoQuadraticSmoothRel=C}if(!("SVGPathSegList"in window)||!("appendItem"in window.SVGPathSegList.prototype)){var A=function(){function SVGPathSegList(t){_classCallCheck(this,SVGPathSegList),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 _createClass(SVGPathSegList,[{key:"_checkPathSynchronizedToList",value:function _checkPathSynchronizedToList(){this._updateListFromPathMutations(this._pathElementMutationObserver.takeRecords())}},{key:"_updateListFromPathMutations",value:function _updateListFromPathMutations(t){if(this._pathElement){var e=!1;t.forEach((function(t){"d"===t.attributeName&&(e=!0)})),e&&(this._list=this._parsePath(this._pathElement.getAttribute("d")))}}},{key:"_writeListToPath",value:function _writeListToPath(){this._pathElementMutationObserver.disconnect(),this._pathElement.setAttribute("d",SVGPathSegList._pathSegArrayAsString(this._list)),this._pathElementMutationObserver.observe(this._pathElement,this._mutationObserverConfig)}},{key:"segmentChanged",value:function segmentChanged(t){this._writeListToPath()}},{key:"clear",value:function clear(){this._checkPathSynchronizedToList(),this._list.forEach((function(t){t._owningPathSegList=null})),this._list=[],this._writeListToPath()}},{key:"initialize",value:function initialize(t){return this._checkPathSynchronizedToList(),this._list=[t],t._owningPathSegList=this,this._writeListToPath(),t}},{key:"_checkValidIndex",value:function _checkValidIndex(t){if(isNaN(t)||t<0||t>=this.numberOfItems)throw new Error("INDEX_SIZE_ERR")}},{key:"getItem",value:function getItem(t){return this._checkPathSynchronizedToList(),this._checkValidIndex(t),this._list[t]}},{key:"insertItemBefore",value:function insertItemBefore(t,e){return this._checkPathSynchronizedToList(),e>this.numberOfItems&&(e=this.numberOfItems),t._owningPathSegList&&(t=t.clone()),this._list.splice(e,0,t),t._owningPathSegList=this,this._writeListToPath(),t}},{key:"replaceItem",value:function replaceItem(t,e){return this._checkPathSynchronizedToList(),t._owningPathSegList&&(t=t.clone()),this._checkValidIndex(e),this._list[e]=t,t._owningPathSegList=this,this._writeListToPath(),t}},{key:"removeItem",value:function removeItem(t){this._checkPathSynchronizedToList(),this._checkValidIndex(t);var e=this._list[t];return this._list.splice(t,1),this._writeListToPath(),e}},{key:"appendItem",value:function appendItem(t){return this._checkPathSynchronizedToList(),t._owningPathSegList&&(t=t.clone()),this._list.push(t),t._owningPathSegList=this,this._writeListToPath(),t}},{key:"_parsePath",value:function _parsePath(t){if(!t||!t.length)return[];var e=this,n=function(){function Builder(){_classCallCheck(this,Builder),this.pathSegList=[]}return _createClass(Builder,[{key:"appendSegment",value:function appendSegment(t){this.pathSegList.push(t)}}]),Builder}(),r=function(){function Source(t){_classCallCheck(this,Source),this._string=t,this._currentIndex=0,this._endIndex=this._string.length,this._previousCommand=SVGPathSeg.PATHSEG_UNKNOWN,this._skipOptionalSpaces()}return _createClass(Source,[{key:"_isCurrentSpace",value:function _isCurrentSpace(){var t=this._string[this._currentIndex];return t<=" "&&(" "===t||"\n"===t||"\t"===t||"\r"===t||"\f"===t)}},{key:"_skipOptionalSpaces",value:function _skipOptionalSpaces(){for(;this._currentIndex="0"&&t<="9")&&e!==SVGPathSeg.PATHSEG_CLOSEPATH?e===SVGPathSeg.PATHSEG_MOVETO_ABS?SVGPathSeg.PATHSEG_LINETO_ABS:e===SVGPathSeg.PATHSEG_MOVETO_REL?SVGPathSeg.PATHSEG_LINETO_REL:e:SVGPathSeg.PATHSEG_UNKNOWN}},{key:"initialCommandIsMoveTo",value:function initialCommandIsMoveTo(){if(!this.hasMoreData())return!0;var t=this.peekSegmentType();return t===SVGPathSeg.PATHSEG_MOVETO_ABS||t===SVGPathSeg.PATHSEG_MOVETO_REL}},{key:"_parseNumber",value:function _parseNumber(){var t=0,e=0,n=1,r=0,i=1,a=1,s=this._currentIndex;if(this._skipOptionalSpaces(),this._currentIndex"9")&&"."!==this._string.charAt(this._currentIndex))){for(var h=this._currentIndex;this._currentIndex="0"&&this._string.charAt(this._currentIndex)<="9";)this._currentIndex++;if(this._currentIndex!==h)for(var o=this._currentIndex-1,_=1;o>=h;)e+=_*(this._string.charAt(o--)-"0"),_*=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!==s&&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";)t*=10,t+=this._string.charAt(this._currentIndex)-"0",this._currentIndex++}var u=e+r;if(u*=i,t&&(u*=Math.pow(10,a*t)),s!==this._currentIndex)return this._skipOptionalSpacesOrDelimiter(),u}}},{key:"_parseArcFlag",value:function _parseArcFlag(){if(!(this._currentIndex>=this._endIndex)){var t=!1,e=this._string.charAt(this._currentIndex++);if("0"===e)t=!1;else{if("1"!==e)return;t=!0}return this._skipOptionalSpacesOrDelimiter(),t}}},{key:"parseSegment",value:function parseSegment(){var t=this._string[this._currentIndex],n=this._pathSegTypeFromChar(t);if(n===SVGPathSeg.PATHSEG_UNKNOWN){if(this._previousCommand===SVGPathSeg.PATHSEG_UNKNOWN)return null;if((n=this._nextCommandHelper(t,this._previousCommand))===SVGPathSeg.PATHSEG_UNKNOWN)return null}else this._currentIndex++;switch(this._previousCommand=n,n){case SVGPathSeg.PATHSEG_MOVETO_REL:return new SVGPathSegMovetoRel(e,this._parseNumber(),this._parseNumber());case SVGPathSeg.PATHSEG_MOVETO_ABS:return new SVGPathSegMovetoAbs(e,this._parseNumber(),this._parseNumber());case SVGPathSeg.PATHSEG_LINETO_REL:return new SVGPathSegLinetoRel(e,this._parseNumber(),this._parseNumber());case SVGPathSeg.PATHSEG_LINETO_ABS:return new SVGPathSegLinetoAbs(e,this._parseNumber(),this._parseNumber());case SVGPathSeg.PATHSEG_LINETO_HORIZONTAL_REL:return new SVGPathSegLinetoHorizontalRel(e,this._parseNumber());case SVGPathSeg.PATHSEG_LINETO_HORIZONTAL_ABS:return new SVGPathSegLinetoHorizontalAbs(e,this._parseNumber());case SVGPathSeg.PATHSEG_LINETO_VERTICAL_REL:return new SVGPathSegLinetoVerticalRel(e,this._parseNumber());case SVGPathSeg.PATHSEG_LINETO_VERTICAL_ABS:return new SVGPathSegLinetoVerticalAbs(e,this._parseNumber());case SVGPathSeg.PATHSEG_CLOSEPATH:return this._skipOptionalSpaces(),new SVGPathSegClosePath(e);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(e,r.x,r.y,r.x1,r.y1,r.x2,r.y2);case SVGPathSeg.PATHSEG_CURVETO_CUBIC_ABS:var i={x1:this._parseNumber(),y1:this._parseNumber(),x2:this._parseNumber(),y2:this._parseNumber(),x:this._parseNumber(),y:this._parseNumber()};return new SVGPathSegCurvetoCubicAbs(e,i.x,i.y,i.x1,i.y1,i.x2,i.y2);case SVGPathSeg.PATHSEG_CURVETO_CUBIC_SMOOTH_REL:var a={x2:this._parseNumber(),y2:this._parseNumber(),x:this._parseNumber(),y:this._parseNumber()};return new SVGPathSegCurvetoCubicSmoothRel(e,a.x,a.y,a.x2,a.y2);case SVGPathSeg.PATHSEG_CURVETO_CUBIC_SMOOTH_ABS:var s={x2:this._parseNumber(),y2:this._parseNumber(),x:this._parseNumber(),y:this._parseNumber()};return new SVGPathSegCurvetoCubicSmoothAbs(e,s.x,s.y,s.x2,s.y2);case SVGPathSeg.PATHSEG_CURVETO_QUADRATIC_REL:var h={x1:this._parseNumber(),y1:this._parseNumber(),x:this._parseNumber(),y:this._parseNumber()};return new SVGPathSegCurvetoQuadraticRel(e,h.x,h.y,h.x1,h.y1);case SVGPathSeg.PATHSEG_CURVETO_QUADRATIC_ABS:var o={x1:this._parseNumber(),y1:this._parseNumber(),x:this._parseNumber(),y:this._parseNumber()};return new SVGPathSegCurvetoQuadraticAbs(e,o.x,o.y,o.x1,o.y1);case SVGPathSeg.PATHSEG_CURVETO_QUADRATIC_SMOOTH_REL:return new SVGPathSegCurvetoQuadraticSmoothRel(e,this._parseNumber(),this._parseNumber());case SVGPathSeg.PATHSEG_CURVETO_QUADRATIC_SMOOTH_ABS:return new SVGPathSegCurvetoQuadraticSmoothAbs(e,this._parseNumber(),this._parseNumber());case SVGPathSeg.PATHSEG_ARC_REL:var _={x1:this._parseNumber(),y1:this._parseNumber(),arcAngle:this._parseNumber(),arcLarge:this._parseArcFlag(),arcSweep:this._parseArcFlag(),x:this._parseNumber(),y:this._parseNumber()};return new SVGPathSegArcRel(e,_.x,_.y,_.x1,_.y1,_.arcAngle,_.arcLarge,_.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(e,u.x,u.y,u.x1,u.y1,u.arcAngle,u.arcLarge,u.arcSweep);default:throw new Error("Unknown path seg type.")}}}]),Source}(),i=new n,a=new r(t);if(!a.initialCommandIsMoveTo())return[];for(;a.hasMoreData();){var s=a.parseSegment();if(!s)return[];i.appendSegment(s)}return i.pathSegList}}],[{key:"_pathSegArrayAsString",value:function _pathSegArrayAsString(t){var e="",n=!0;return t.forEach((function(t){n?(n=!1,e+=t._asPathString()):e+=" "+t._asPathString()})),e}}]),SVGPathSegList}();A.prototype.classname="SVGPathSegList",Object.defineProperty(A.prototype,"numberOfItems",{get:function get(){return this._checkPathSynchronizedToList(),this._list.length},enumerable:!0}),Object.defineProperties(SVGPathElement.prototype,{pathSegList:{get:function get(){return this._pathSegList||(this._pathSegList=new A(this)),this._pathSegList},enumerable:!0},normalizedPathSegList:{get:function get(){return this.pathSegList},enumerable:!0},animatedPathSegList:{get:function get(){return this.pathSegList},enumerable:!0},animatedNormalizedPathSegList:{get:function get(){return this.pathSegList},enumerable:!0}}),window.SVGPathSegList=A}}();var t={name:"closepath",init:function init(t){return function _asyncToGenerator(t){return function(){var e=this,n=arguments;return new Promise((function(r,i){var a=t.apply(e,n);function _next(t){asyncGeneratorStep(a,r,i,_next,_throw,"next",t)}function _throw(t){asyncGeneratorStep(a,r,i,_next,_throw,"throw",t)}_next(void 0)}))}}(regeneratorRuntime.mark((function _callee(){var e,n,r,i,a,s,h,o;return regeneratorRuntime.wrap((function _callee$(_){for(;;)switch(_.prev=_.next){case 0:return e=t.importLocale,n=t.$,_.next=3,e();case 3:return r=_.sent,a=function updateButton(t){var e=t.pathSegList,r=1===e.getItem(e.numberOfItems-1).pathSegType,i=r?"#tool_openpath":"#tool_closepath";n(r?"#tool_closepath":"#tool_openpath").hide(),n(i).show()},s=function showPanel(t){if(n("#closepath_panel").toggle(t),t){var e=i[0];e&&a(e)}},h=function toggleClosed(){var t=i[0];if(t){var e=t.pathSegList,n=e.numberOfItems-1;1===e.getItem(n).pathSegType?e.removeItem(n):e.appendItem(t.createSVGPathSegClosePath()),a(t)}},o=[{id:"tool_openpath",icon:"openpath.png",type:"context",panel:"closepath_panel",events:{click:function click(){h()}}},{id:"tool_closepath",icon:"closepath.png",type:"context",panel:"closepath_panel",events:{click:function click(){h()}}}],_.abrupt("return",{name:r.name,svgicons:"closepath_icons.svg",buttons:r.buttons.map((function(t,e){return Object.assign(o[e],t)})),callback:function callback(){n("#closepath_panel").hide()},selectedChanged:function selectedChanged(t){for(var e=(i=t.elems).length;e--;){var n=i[e];n&&"path"===n.tagName&&t.selectedElement&&!t.multiselected?s(!0):s(!1)}}});case 9:case"end":return _.stop()}}),_callee)})))()}};export default t; //# sourceMappingURL=ext-closepath.js.map diff --git a/dist/editor/extensions/ext-closepath.js.map b/dist/editor/extensions/ext-closepath.js.map index 92e6ba04..9bb7b2b5 100644 --- a/dist/editor/extensions/ext-closepath.js.map +++ b/dist/editor/extensions/ext-closepath.js.map @@ -1 +1 @@ -{"version":3,"file":"ext-closepath.js","sources":["../../../src/common/svgpathseg.js","../../../src/editor/extensions/ext-closepath.js"],"sourcesContent":["/* eslint-disable import/unambiguous, max-len */\n/* globals SVGPathSeg, SVGPathSegMovetoRel, SVGPathSegMovetoAbs,\n SVGPathSegMovetoRel, SVGPathSegLinetoRel, SVGPathSegLinetoAbs,\n SVGPathSegLinetoHorizontalRel, SVGPathSegLinetoHorizontalAbs,\n SVGPathSegLinetoVerticalRel, SVGPathSegLinetoVerticalAbs,\n SVGPathSegClosePath, SVGPathSegCurvetoCubicRel,\n SVGPathSegCurvetoCubicAbs, SVGPathSegCurvetoCubicSmoothRel,\n SVGPathSegCurvetoCubicSmoothAbs, SVGPathSegCurvetoQuadraticRel,\n SVGPathSegCurvetoQuadraticAbs, SVGPathSegCurvetoQuadraticSmoothRel,\n SVGPathSegCurvetoQuadraticSmoothAbs, SVGPathSegArcRel, SVGPathSegArcAbs */\n/**\n* SVGPathSeg API polyfill\n* https://github.com/progers/pathseg\n*\n* This is a drop-in replacement for the `SVGPathSeg` and `SVGPathSegList` APIs\n* that were removed from SVG2 ({@link https://lists.w3.org/Archives/Public/www-svg/2015Jun/0044.html}),\n* including the latest spec changes which were implemented in Firefox 43 and\n* Chrome 46.\n*/\n/* eslint-disable no-shadow, class-methods-use-this, jsdoc/require-jsdoc */\n// Linting: We avoid `no-shadow` as ESLint thinks these are still available globals\n// Linting: We avoid `class-methods-use-this` as this is a polyfill that must\n// follow the conventions\n(() => {\nif (!('SVGPathSeg' in window)) {\n // Spec: https://www.w3.org/TR/SVG11/single-page.html#paths-InterfaceSVGPathSeg\n class SVGPathSeg {\n constructor (type, typeAsLetter, owningPathSegList) {\n this.pathSegType = type;\n this.pathSegTypeAsLetter = typeAsLetter;\n this._owningPathSegList = owningPathSegList;\n }\n // Notify owning PathSegList on any changes so they can be synchronized back to the path element.\n _segmentChanged () {\n if (this._owningPathSegList) {\n this._owningPathSegList.segmentChanged(this);\n }\n }\n }\n SVGPathSeg.prototype.classname = 'SVGPathSeg';\n\n SVGPathSeg.PATHSEG_UNKNOWN = 0;\n SVGPathSeg.PATHSEG_CLOSEPATH = 1;\n SVGPathSeg.PATHSEG_MOVETO_ABS = 2;\n SVGPathSeg.PATHSEG_MOVETO_REL = 3;\n SVGPathSeg.PATHSEG_LINETO_ABS = 4;\n SVGPathSeg.PATHSEG_LINETO_REL = 5;\n SVGPathSeg.PATHSEG_CURVETO_CUBIC_ABS = 6;\n SVGPathSeg.PATHSEG_CURVETO_CUBIC_REL = 7;\n SVGPathSeg.PATHSEG_CURVETO_QUADRATIC_ABS = 8;\n SVGPathSeg.PATHSEG_CURVETO_QUADRATIC_REL = 9;\n SVGPathSeg.PATHSEG_ARC_ABS = 10;\n SVGPathSeg.PATHSEG_ARC_REL = 11;\n SVGPathSeg.PATHSEG_LINETO_HORIZONTAL_ABS = 12;\n SVGPathSeg.PATHSEG_LINETO_HORIZONTAL_REL = 13;\n SVGPathSeg.PATHSEG_LINETO_VERTICAL_ABS = 14;\n SVGPathSeg.PATHSEG_LINETO_VERTICAL_REL = 15;\n SVGPathSeg.PATHSEG_CURVETO_CUBIC_SMOOTH_ABS = 16;\n SVGPathSeg.PATHSEG_CURVETO_CUBIC_SMOOTH_REL = 17;\n SVGPathSeg.PATHSEG_CURVETO_QUADRATIC_SMOOTH_ABS = 18;\n SVGPathSeg.PATHSEG_CURVETO_QUADRATIC_SMOOTH_REL = 19;\n\n class SVGPathSegClosePath extends SVGPathSeg {\n constructor (owningPathSegList) {\n super(SVGPathSeg.PATHSEG_CLOSEPATH, 'z', owningPathSegList);\n }\n toString () { return '[object SVGPathSegClosePath]'; }\n _asPathString () { return this.pathSegTypeAsLetter; }\n clone () { return new SVGPathSegClosePath(undefined); }\n }\n\n class SVGPathSegMovetoAbs extends SVGPathSeg {\n constructor (owningPathSegList, x, y) {\n super(SVGPathSeg.PATHSEG_MOVETO_ABS, 'M', owningPathSegList);\n this._x = x;\n this._y = y;\n }\n toString () { return '[object SVGPathSegMovetoAbs]'; }\n _asPathString () { return this.pathSegTypeAsLetter + ' ' + this._x + ' ' + this._y; }\n clone () { return new SVGPathSegMovetoAbs(undefined, this._x, this._y); }\n }\n Object.defineProperties(SVGPathSegMovetoAbs.prototype, {\n x: {\n get () { return this._x; }, set (x) { this._x = x; this._segmentChanged(); }, enumerable: true\n },\n y: {\n get () { return this._y; }, set (y) { this._y = y; this._segmentChanged(); }, enumerable: true\n }\n });\n\n class SVGPathSegMovetoRel extends SVGPathSeg {\n constructor (owningPathSegList, x, y) {\n super(SVGPathSeg.PATHSEG_MOVETO_REL, 'm', owningPathSegList);\n this._x = x;\n this._y = y;\n }\n toString () { return '[object SVGPathSegMovetoRel]'; }\n _asPathString () { return this.pathSegTypeAsLetter + ' ' + this._x + ' ' + this._y; }\n clone () { return new SVGPathSegMovetoRel(undefined, this._x, this._y); }\n }\n Object.defineProperties(SVGPathSegMovetoRel.prototype, {\n x: {get () { return this._x; }, set (x) { this._x = x; this._segmentChanged(); }, enumerable: true},\n y: {get () { return this._y; }, set (y) { this._y = y; this._segmentChanged(); }, enumerable: true}\n });\n\n class SVGPathSegLinetoAbs extends SVGPathSeg {\n constructor (owningPathSegList, x, y) {\n super(SVGPathSeg.PATHSEG_LINETO_ABS, 'L', owningPathSegList);\n this._x = x;\n this._y = y;\n }\n toString () { return '[object SVGPathSegLinetoAbs]'; }\n _asPathString () { return this.pathSegTypeAsLetter + ' ' + this._x + ' ' + this._y; }\n clone () { return new SVGPathSegLinetoAbs(undefined, this._x, this._y); }\n }\n Object.defineProperties(SVGPathSegLinetoAbs.prototype, {\n x: {get () { return this._x; }, set (x) { this._x = x; this._segmentChanged(); }, enumerable: true},\n y: {get () { return this._y; }, set (y) { this._y = y; this._segmentChanged(); }, enumerable: true}\n });\n\n class SVGPathSegLinetoRel extends SVGPathSeg {\n constructor (owningPathSegList, x, y) {\n super(SVGPathSeg.PATHSEG_LINETO_REL, 'l', owningPathSegList);\n this._x = x;\n this._y = y;\n }\n toString () { return '[object SVGPathSegLinetoRel]'; }\n _asPathString () { return this.pathSegTypeAsLetter + ' ' + this._x + ' ' + this._y; }\n clone () { return new SVGPathSegLinetoRel(undefined, this._x, this._y); }\n }\n Object.defineProperties(SVGPathSegLinetoRel.prototype, {\n x: {get () { return this._x; }, set (x) { this._x = x; this._segmentChanged(); }, enumerable: true},\n y: {get () { return this._y; }, set (y) { this._y = y; this._segmentChanged(); }, enumerable: true}\n });\n\n class SVGPathSegCurvetoCubicAbs extends SVGPathSeg {\n constructor (owningPathSegList, x, y, x1, y1, x2, y2) {\n super(SVGPathSeg.PATHSEG_CURVETO_CUBIC_ABS, 'C', owningPathSegList);\n this._x = x;\n this._y = y;\n this._x1 = x1;\n this._y1 = y1;\n this._x2 = x2;\n this._y2 = y2;\n }\n toString () { return '[object SVGPathSegCurvetoCubicAbs]'; }\n _asPathString () { return this.pathSegTypeAsLetter + ' ' + this._x1 + ' ' + this._y1 + ' ' + this._x2 + ' ' + this._y2 + ' ' + this._x + ' ' + this._y; }\n clone () { return new SVGPathSegCurvetoCubicAbs(undefined, this._x, this._y, this._x1, this._y1, this._x2, this._y2); }\n }\n Object.defineProperties(SVGPathSegCurvetoCubicAbs.prototype, {\n x: {get () { return this._x; }, set (x) { this._x = x; this._segmentChanged(); }, enumerable: true},\n y: {get () { return this._y; }, set (y) { this._y = y; this._segmentChanged(); }, enumerable: true},\n x1: {get () { return this._x1; }, set (x1) { this._x1 = x1; this._segmentChanged(); }, enumerable: true},\n y1: {get () { return this._y1; }, set (y1) { this._y1 = y1; this._segmentChanged(); }, enumerable: true},\n x2: {get () { return this._x2; }, set (x2) { this._x2 = x2; this._segmentChanged(); }, enumerable: true},\n y2: {get () { return this._y2; }, set (y2) { this._y2 = y2; this._segmentChanged(); }, enumerable: true}\n });\n\n class SVGPathSegCurvetoCubicRel extends SVGPathSeg {\n constructor (owningPathSegList, x, y, x1, y1, x2, y2) {\n super(SVGPathSeg.PATHSEG_CURVETO_CUBIC_REL, 'c', owningPathSegList);\n this._x = x;\n this._y = y;\n this._x1 = x1;\n this._y1 = y1;\n this._x2 = x2;\n this._y2 = y2;\n }\n toString () { return '[object SVGPathSegCurvetoCubicRel]'; }\n _asPathString () { return this.pathSegTypeAsLetter + ' ' + this._x1 + ' ' + this._y1 + ' ' + this._x2 + ' ' + this._y2 + ' ' + this._x + ' ' + this._y; }\n clone () { return new SVGPathSegCurvetoCubicRel(undefined, this._x, this._y, this._x1, this._y1, this._x2, this._y2); }\n }\n Object.defineProperties(SVGPathSegCurvetoCubicRel.prototype, {\n x: {get () { return this._x; }, set (x) { this._x = x; this._segmentChanged(); }, enumerable: true},\n y: {get () { return this._y; }, set (y) { this._y = y; this._segmentChanged(); }, enumerable: true},\n x1: {get () { return this._x1; }, set (x1) { this._x1 = x1; this._segmentChanged(); }, enumerable: true},\n y1: {get () { return this._y1; }, set (y1) { this._y1 = y1; this._segmentChanged(); }, enumerable: true},\n x2: {get () { return this._x2; }, set (x2) { this._x2 = x2; this._segmentChanged(); }, enumerable: true},\n y2: {get () { return this._y2; }, set (y2) { this._y2 = y2; this._segmentChanged(); }, enumerable: true}\n });\n\n class SVGPathSegCurvetoQuadraticAbs extends SVGPathSeg {\n constructor (owningPathSegList, x, y, x1, y1) {\n super(SVGPathSeg.PATHSEG_CURVETO_QUADRATIC_ABS, 'Q', owningPathSegList);\n this._x = x;\n this._y = y;\n this._x1 = x1;\n this._y1 = y1;\n }\n toString () { return '[object SVGPathSegCurvetoQuadraticAbs]'; }\n _asPathString () { return this.pathSegTypeAsLetter + ' ' + this._x1 + ' ' + this._y1 + ' ' + this._x + ' ' + this._y; }\n clone () { return new SVGPathSegCurvetoQuadraticAbs(undefined, this._x, this._y, this._x1, this._y1); }\n }\n Object.defineProperties(SVGPathSegCurvetoQuadraticAbs.prototype, {\n x: {get () { return this._x; }, set (x) { this._x = x; this._segmentChanged(); }, enumerable: true},\n y: {get () { return this._y; }, set (y) { this._y = y; this._segmentChanged(); }, enumerable: true},\n x1: {get () { return this._x1; }, set (x1) { this._x1 = x1; this._segmentChanged(); }, enumerable: true},\n y1: {get () { return this._y1; }, set (y1) { this._y1 = y1; this._segmentChanged(); }, enumerable: true}\n });\n\n class SVGPathSegCurvetoQuadraticRel extends SVGPathSeg {\n constructor (owningPathSegList, x, y, x1, y1) {\n super(SVGPathSeg.PATHSEG_CURVETO_QUADRATIC_REL, 'q', owningPathSegList);\n this._x = x;\n this._y = y;\n this._x1 = x1;\n this._y1 = y1;\n }\n toString () { return '[object SVGPathSegCurvetoQuadraticRel]'; }\n _asPathString () { return this.pathSegTypeAsLetter + ' ' + this._x1 + ' ' + this._y1 + ' ' + this._x + ' ' + this._y; }\n clone () { return new SVGPathSegCurvetoQuadraticRel(undefined, this._x, this._y, this._x1, this._y1); }\n }\n Object.defineProperties(SVGPathSegCurvetoQuadraticRel.prototype, {\n x: {get () { return this._x; }, set (x) { this._x = x; this._segmentChanged(); }, enumerable: true},\n y: {get () { return this._y; }, set (y) { this._y = y; this._segmentChanged(); }, enumerable: true},\n x1: {get () { return this._x1; }, set (x1) { this._x1 = x1; this._segmentChanged(); }, enumerable: true},\n y1: {get () { return this._y1; }, set (y1) { this._y1 = y1; this._segmentChanged(); }, enumerable: true}\n });\n\n class SVGPathSegArcAbs extends SVGPathSeg {\n constructor (owningPathSegList, x, y, r1, r2, angle, largeArcFlag, sweepFlag) {\n super(SVGPathSeg.PATHSEG_ARC_ABS, 'A', owningPathSegList);\n this._x = x;\n this._y = y;\n this._r1 = r1;\n this._r2 = r2;\n this._angle = angle;\n this._largeArcFlag = largeArcFlag;\n this._sweepFlag = sweepFlag;\n }\n toString () { return '[object SVGPathSegArcAbs]'; }\n _asPathString () { return this.pathSegTypeAsLetter + ' ' + this._r1 + ' ' + this._r2 + ' ' + this._angle + ' ' + (this._largeArcFlag ? '1' : '0') + ' ' + (this._sweepFlag ? '1' : '0') + ' ' + this._x + ' ' + this._y; }\n clone () { return new SVGPathSegArcAbs(undefined, this._x, this._y, this._r1, this._r2, this._angle, this._largeArcFlag, this._sweepFlag); }\n }\n Object.defineProperties(SVGPathSegArcAbs.prototype, {\n x: {get () { return this._x; }, set (x) { this._x = x; this._segmentChanged(); }, enumerable: true},\n y: {get () { return this._y; }, set (y) { this._y = y; this._segmentChanged(); }, enumerable: true},\n r1: {get () { return this._r1; }, set (r1) { this._r1 = r1; this._segmentChanged(); }, enumerable: true},\n r2: {get () { return this._r2; }, set (r2) { this._r2 = r2; this._segmentChanged(); }, enumerable: true},\n angle: {get () { return this._angle; }, set (angle) { this._angle = angle; this._segmentChanged(); }, enumerable: true},\n largeArcFlag: {get () { return this._largeArcFlag; }, set (largeArcFlag) { this._largeArcFlag = largeArcFlag; this._segmentChanged(); }, enumerable: true},\n sweepFlag: {get () { return this._sweepFlag; }, set (sweepFlag) { this._sweepFlag = sweepFlag; this._segmentChanged(); }, enumerable: true}\n });\n\n class SVGPathSegArcRel extends SVGPathSeg {\n constructor (owningPathSegList, x, y, r1, r2, angle, largeArcFlag, sweepFlag) {\n super(SVGPathSeg.PATHSEG_ARC_REL, 'a', owningPathSegList);\n this._x = x;\n this._y = y;\n this._r1 = r1;\n this._r2 = r2;\n this._angle = angle;\n this._largeArcFlag = largeArcFlag;\n this._sweepFlag = sweepFlag;\n }\n toString () { return '[object SVGPathSegArcRel]'; }\n _asPathString () { return this.pathSegTypeAsLetter + ' ' + this._r1 + ' ' + this._r2 + ' ' + this._angle + ' ' + (this._largeArcFlag ? '1' : '0') + ' ' + (this._sweepFlag ? '1' : '0') + ' ' + this._x + ' ' + this._y; }\n clone () { return new SVGPathSegArcRel(undefined, this._x, this._y, this._r1, this._r2, this._angle, this._largeArcFlag, this._sweepFlag); }\n }\n Object.defineProperties(SVGPathSegArcRel.prototype, {\n x: {get () { return this._x; }, set (x) { this._x = x; this._segmentChanged(); }, enumerable: true},\n y: {get () { return this._y; }, set (y) { this._y = y; this._segmentChanged(); }, enumerable: true},\n r1: {get () { return this._r1; }, set (r1) { this._r1 = r1; this._segmentChanged(); }, enumerable: true},\n r2: {get () { return this._r2; }, set (r2) { this._r2 = r2; this._segmentChanged(); }, enumerable: true},\n angle: {get () { return this._angle; }, set (angle) { this._angle = angle; this._segmentChanged(); }, enumerable: true},\n largeArcFlag: {get () { return this._largeArcFlag; }, set (largeArcFlag) { this._largeArcFlag = largeArcFlag; this._segmentChanged(); }, enumerable: true},\n sweepFlag: {get () { return this._sweepFlag; }, set (sweepFlag) { this._sweepFlag = sweepFlag; this._segmentChanged(); }, enumerable: true}\n });\n\n class SVGPathSegLinetoHorizontalAbs extends SVGPathSeg {\n constructor (owningPathSegList, x) {\n super(SVGPathSeg.PATHSEG_LINETO_HORIZONTAL_ABS, 'H', owningPathSegList);\n this._x = x;\n }\n toString () { return '[object SVGPathSegLinetoHorizontalAbs]'; }\n _asPathString () { return this.pathSegTypeAsLetter + ' ' + this._x; }\n clone () { return new SVGPathSegLinetoHorizontalAbs(undefined, this._x); }\n }\n Object.defineProperty(SVGPathSegLinetoHorizontalAbs.prototype, 'x', {get () { return this._x; }, set (x) { this._x = x; this._segmentChanged(); }, enumerable: true});\n\n class SVGPathSegLinetoHorizontalRel extends SVGPathSeg {\n constructor (owningPathSegList, x) {\n super(SVGPathSeg.PATHSEG_LINETO_HORIZONTAL_REL, 'h', owningPathSegList);\n this._x = x;\n }\n toString () { return '[object SVGPathSegLinetoHorizontalRel]'; }\n _asPathString () { return this.pathSegTypeAsLetter + ' ' + this._x; }\n clone () { return new SVGPathSegLinetoHorizontalRel(undefined, this._x); }\n }\n Object.defineProperty(SVGPathSegLinetoHorizontalRel.prototype, 'x', {get () { return this._x; }, set (x) { this._x = x; this._segmentChanged(); }, enumerable: true});\n\n class SVGPathSegLinetoVerticalAbs extends SVGPathSeg {\n constructor (owningPathSegList, y) {\n super(SVGPathSeg.PATHSEG_LINETO_VERTICAL_ABS, 'V', owningPathSegList);\n this._y = y;\n }\n toString () { return '[object SVGPathSegLinetoVerticalAbs]'; }\n _asPathString () { return this.pathSegTypeAsLetter + ' ' + this._y; }\n clone () { return new SVGPathSegLinetoVerticalAbs(undefined, this._y); }\n }\n Object.defineProperty(SVGPathSegLinetoVerticalAbs.prototype, 'y', {get () { return this._y; }, set (y) { this._y = y; this._segmentChanged(); }, enumerable: true});\n\n class SVGPathSegLinetoVerticalRel extends SVGPathSeg {\n constructor (owningPathSegList, y) {\n super(SVGPathSeg.PATHSEG_LINETO_VERTICAL_REL, 'v', owningPathSegList);\n this._y = y;\n }\n toString () { return '[object SVGPathSegLinetoVerticalRel]'; }\n _asPathString () { return this.pathSegTypeAsLetter + ' ' + this._y; }\n clone () { return new SVGPathSegLinetoVerticalRel(undefined, this._y); }\n }\n Object.defineProperty(SVGPathSegLinetoVerticalRel.prototype, 'y', {get () { return this._y; }, set (y) { this._y = y; this._segmentChanged(); }, enumerable: true});\n\n class SVGPathSegCurvetoCubicSmoothAbs extends SVGPathSeg {\n constructor (owningPathSegList, x, y, x2, y2) {\n super(SVGPathSeg.PATHSEG_CURVETO_CUBIC_SMOOTH_ABS, 'S', owningPathSegList);\n this._x = x;\n this._y = y;\n this._x2 = x2;\n this._y2 = y2;\n }\n toString () { return '[object SVGPathSegCurvetoCubicSmoothAbs]'; }\n _asPathString () { return this.pathSegTypeAsLetter + ' ' + this._x2 + ' ' + this._y2 + ' ' + this._x + ' ' + this._y; }\n clone () { return new SVGPathSegCurvetoCubicSmoothAbs(undefined, this._x, this._y, this._x2, this._y2); }\n }\n Object.defineProperties(SVGPathSegCurvetoCubicSmoothAbs.prototype, {\n x: {get () { return this._x; }, set (x) { this._x = x; this._segmentChanged(); }, enumerable: true},\n y: {get () { return this._y; }, set (y) { this._y = y; this._segmentChanged(); }, enumerable: true},\n x2: {get () { return this._x2; }, set (x2) { this._x2 = x2; this._segmentChanged(); }, enumerable: true},\n y2: {get () { return this._y2; }, set (y2) { this._y2 = y2; this._segmentChanged(); }, enumerable: true}\n });\n\n class SVGPathSegCurvetoCubicSmoothRel extends SVGPathSeg {\n constructor (owningPathSegList, x, y, x2, y2) {\n super(SVGPathSeg.PATHSEG_CURVETO_CUBIC_SMOOTH_REL, 's', owningPathSegList);\n this._x = x;\n this._y = y;\n this._x2 = x2;\n this._y2 = y2;\n }\n toString () { return '[object SVGPathSegCurvetoCubicSmoothRel]'; }\n _asPathString () { return this.pathSegTypeAsLetter + ' ' + this._x2 + ' ' + this._y2 + ' ' + this._x + ' ' + this._y; }\n clone () { return new SVGPathSegCurvetoCubicSmoothRel(undefined, this._x, this._y, this._x2, this._y2); }\n }\n Object.defineProperties(SVGPathSegCurvetoCubicSmoothRel.prototype, {\n x: {get () { return this._x; }, set (x) { this._x = x; this._segmentChanged(); }, enumerable: true},\n y: {get () { return this._y; }, set (y) { this._y = y; this._segmentChanged(); }, enumerable: true},\n x2: {get () { return this._x2; }, set (x2) { this._x2 = x2; this._segmentChanged(); }, enumerable: true},\n y2: {get () { return this._y2; }, set (y2) { this._y2 = y2; this._segmentChanged(); }, enumerable: true}\n });\n\n class SVGPathSegCurvetoQuadraticSmoothAbs extends SVGPathSeg {\n constructor (owningPathSegList, x, y) {\n super(SVGPathSeg.PATHSEG_CURVETO_QUADRATIC_SMOOTH_ABS, 'T', owningPathSegList);\n this._x = x;\n this._y = y;\n }\n toString () { return '[object SVGPathSegCurvetoQuadraticSmoothAbs]'; }\n _asPathString () { return this.pathSegTypeAsLetter + ' ' + this._x + ' ' + this._y; }\n clone () { return new SVGPathSegCurvetoQuadraticSmoothAbs(undefined, this._x, this._y); }\n }\n Object.defineProperties(SVGPathSegCurvetoQuadraticSmoothAbs.prototype, {\n x: {get () { return this._x; }, set (x) { this._x = x; this._segmentChanged(); }, enumerable: true},\n y: {get () { return this._y; }, set (y) { this._y = y; this._segmentChanged(); }, enumerable: true}\n });\n\n class SVGPathSegCurvetoQuadraticSmoothRel extends SVGPathSeg {\n constructor (owningPathSegList, x, y) {\n super(SVGPathSeg.PATHSEG_CURVETO_QUADRATIC_SMOOTH_REL, 't', owningPathSegList);\n this._x = x;\n this._y = y;\n }\n toString () { return '[object SVGPathSegCurvetoQuadraticSmoothRel]'; }\n _asPathString () { return this.pathSegTypeAsLetter + ' ' + this._x + ' ' + this._y; }\n clone () { return new SVGPathSegCurvetoQuadraticSmoothRel(undefined, this._x, this._y); }\n }\n Object.defineProperties(SVGPathSegCurvetoQuadraticSmoothRel.prototype, {\n x: {get () { return this._x; }, set (x) { this._x = x; this._segmentChanged(); }, enumerable: true},\n y: {get () { return this._y; }, set (y) { this._y = y; this._segmentChanged(); }, enumerable: true}\n });\n\n // Add createSVGPathSeg* functions to SVGPathElement.\n // Spec: https://www.w3.org/TR/SVG11/single-page.html#paths-InterfaceSVGPathElement.\n SVGPathElement.prototype.createSVGPathSegClosePath = function () { return new SVGPathSegClosePath(undefined); };\n SVGPathElement.prototype.createSVGPathSegMovetoAbs = function (x, y) { return new SVGPathSegMovetoAbs(undefined, x, y); };\n SVGPathElement.prototype.createSVGPathSegMovetoRel = function (x, y) { return new SVGPathSegMovetoRel(undefined, x, y); };\n SVGPathElement.prototype.createSVGPathSegLinetoAbs = function (x, y) { return new SVGPathSegLinetoAbs(undefined, x, y); };\n SVGPathElement.prototype.createSVGPathSegLinetoRel = function (x, y) { return new SVGPathSegLinetoRel(undefined, x, y); };\n SVGPathElement.prototype.createSVGPathSegCurvetoCubicAbs = function (x, y, x1, y1, x2, y2) { return new SVGPathSegCurvetoCubicAbs(undefined, x, y, x1, y1, x2, y2); };\n SVGPathElement.prototype.createSVGPathSegCurvetoCubicRel = function (x, y, x1, y1, x2, y2) { return new SVGPathSegCurvetoCubicRel(undefined, x, y, x1, y1, x2, y2); };\n SVGPathElement.prototype.createSVGPathSegCurvetoQuadraticAbs = function (x, y, x1, y1) { return new SVGPathSegCurvetoQuadraticAbs(undefined, x, y, x1, y1); };\n SVGPathElement.prototype.createSVGPathSegCurvetoQuadraticRel = function (x, y, x1, y1) { return new SVGPathSegCurvetoQuadraticRel(undefined, x, y, x1, y1); };\n SVGPathElement.prototype.createSVGPathSegArcAbs = function (x, y, r1, r2, angle, largeArcFlag, sweepFlag) { return new SVGPathSegArcAbs(undefined, x, y, r1, r2, angle, largeArcFlag, sweepFlag); };\n SVGPathElement.prototype.createSVGPathSegArcRel = function (x, y, r1, r2, angle, largeArcFlag, sweepFlag) { return new SVGPathSegArcRel(undefined, x, y, r1, r2, angle, largeArcFlag, sweepFlag); };\n SVGPathElement.prototype.createSVGPathSegLinetoHorizontalAbs = function (x) { return new SVGPathSegLinetoHorizontalAbs(undefined, x); };\n SVGPathElement.prototype.createSVGPathSegLinetoHorizontalRel = function (x) { return new SVGPathSegLinetoHorizontalRel(undefined, x); };\n SVGPathElement.prototype.createSVGPathSegLinetoVerticalAbs = function (y) { return new SVGPathSegLinetoVerticalAbs(undefined, y); };\n SVGPathElement.prototype.createSVGPathSegLinetoVerticalRel = function (y) { return new SVGPathSegLinetoVerticalRel(undefined, y); };\n SVGPathElement.prototype.createSVGPathSegCurvetoCubicSmoothAbs = function (x, y, x2, y2) { return new SVGPathSegCurvetoCubicSmoothAbs(undefined, x, y, x2, y2); };\n SVGPathElement.prototype.createSVGPathSegCurvetoCubicSmoothRel = function (x, y, x2, y2) { return new SVGPathSegCurvetoCubicSmoothRel(undefined, x, y, x2, y2); };\n SVGPathElement.prototype.createSVGPathSegCurvetoQuadraticSmoothAbs = function (x, y) { return new SVGPathSegCurvetoQuadraticSmoothAbs(undefined, x, y); };\n SVGPathElement.prototype.createSVGPathSegCurvetoQuadraticSmoothRel = function (x, y) { return new SVGPathSegCurvetoQuadraticSmoothRel(undefined, x, y); };\n\n if (!('getPathSegAtLength' in SVGPathElement.prototype)) {\n // Add getPathSegAtLength to SVGPathElement.\n // Spec: https://www.w3.org/TR/SVG11/single-page.html#paths-__svg__SVGPathElement__getPathSegAtLength\n // This polyfill requires SVGPathElement.getTotalLength to implement the distance-along-a-path algorithm.\n SVGPathElement.prototype.getPathSegAtLength = function (distance) {\n if (distance === undefined || !isFinite(distance)) {\n throw new Error('Invalid arguments.');\n }\n\n const measurementElement = document.createElementNS('http://www.w3.org/2000/svg', 'path');\n measurementElement.setAttribute('d', this.getAttribute('d'));\n let lastPathSegment = measurementElement.pathSegList.numberOfItems - 1;\n\n // If the path is empty, return 0.\n if (lastPathSegment <= 0) {\n return 0;\n }\n\n do {\n measurementElement.pathSegList.removeItem(lastPathSegment);\n if (distance > measurementElement.getTotalLength()) {\n break;\n }\n lastPathSegment--;\n } while (lastPathSegment > 0);\n return lastPathSegment;\n };\n }\n\n window.SVGPathSeg = SVGPathSeg;\n window.SVGPathSegClosePath = SVGPathSegClosePath;\n window.SVGPathSegMovetoAbs = SVGPathSegMovetoAbs;\n window.SVGPathSegMovetoRel = SVGPathSegMovetoRel;\n window.SVGPathSegLinetoAbs = SVGPathSegLinetoAbs;\n window.SVGPathSegLinetoRel = SVGPathSegLinetoRel;\n window.SVGPathSegCurvetoCubicAbs = SVGPathSegCurvetoCubicAbs;\n window.SVGPathSegCurvetoCubicRel = SVGPathSegCurvetoCubicRel;\n window.SVGPathSegCurvetoQuadraticAbs = SVGPathSegCurvetoQuadraticAbs;\n window.SVGPathSegCurvetoQuadraticRel = SVGPathSegCurvetoQuadraticRel;\n window.SVGPathSegArcAbs = SVGPathSegArcAbs;\n window.SVGPathSegArcRel = SVGPathSegArcRel;\n window.SVGPathSegLinetoHorizontalAbs = SVGPathSegLinetoHorizontalAbs;\n window.SVGPathSegLinetoHorizontalRel = SVGPathSegLinetoHorizontalRel;\n window.SVGPathSegLinetoVerticalAbs = SVGPathSegLinetoVerticalAbs;\n window.SVGPathSegLinetoVerticalRel = SVGPathSegLinetoVerticalRel;\n window.SVGPathSegCurvetoCubicSmoothAbs = SVGPathSegCurvetoCubicSmoothAbs;\n window.SVGPathSegCurvetoCubicSmoothRel = SVGPathSegCurvetoCubicSmoothRel;\n window.SVGPathSegCurvetoQuadraticSmoothAbs = SVGPathSegCurvetoQuadraticSmoothAbs;\n window.SVGPathSegCurvetoQuadraticSmoothRel = SVGPathSegCurvetoQuadraticSmoothRel;\n}\n\n// Checking for SVGPathSegList in window checks for the case of an implementation without the\n// SVGPathSegList API.\n// The second check for appendItem is specific to Firefox 59+ which removed only parts of the\n// SVGPathSegList API (e.g., appendItem). In this case we need to re-implement the entire API\n// so the polyfill data (i.e., _list) is used throughout.\nif (!('SVGPathSegList' in window) || !('appendItem' in window.SVGPathSegList.prototype)) {\n // Spec: https://www.w3.org/TR/SVG11/single-page.html#paths-InterfaceSVGPathSegList\n class SVGPathSegList {\n constructor (pathElement) {\n this._pathElement = pathElement;\n this._list = this._parsePath(this._pathElement.getAttribute('d'));\n\n // Use a MutationObserver to catch changes to the path's \"d\" attribute.\n this._mutationObserverConfig = {attributes: true, attributeFilter: ['d']};\n this._pathElementMutationObserver = new MutationObserver(this._updateListFromPathMutations.bind(this));\n this._pathElementMutationObserver.observe(this._pathElement, this._mutationObserverConfig);\n }\n // Process any pending mutations to the path element and update the list as needed.\n // This should be the first call of all public functions and is needed because\n // MutationObservers are not synchronous so we can have pending asynchronous mutations.\n _checkPathSynchronizedToList () {\n this._updateListFromPathMutations(this._pathElementMutationObserver.takeRecords());\n }\n\n _updateListFromPathMutations (mutationRecords) {\n if (!this._pathElement) {\n return;\n }\n let hasPathMutations = false;\n mutationRecords.forEach((record) => {\n if (record.attributeName === 'd') {\n hasPathMutations = true;\n }\n });\n if (hasPathMutations) {\n this._list = this._parsePath(this._pathElement.getAttribute('d'));\n }\n }\n\n // Serialize the list and update the path's 'd' attribute.\n _writeListToPath () {\n this._pathElementMutationObserver.disconnect();\n this._pathElement.setAttribute('d', SVGPathSegList._pathSegArrayAsString(this._list));\n this._pathElementMutationObserver.observe(this._pathElement, this._mutationObserverConfig);\n }\n\n // When a path segment changes the list needs to be synchronized back to the path element.\n segmentChanged (pathSeg) {\n this._writeListToPath();\n }\n\n clear () {\n this._checkPathSynchronizedToList();\n\n this._list.forEach((pathSeg) => {\n pathSeg._owningPathSegList = null;\n });\n this._list = [];\n this._writeListToPath();\n }\n\n initialize (newItem) {\n this._checkPathSynchronizedToList();\n\n this._list = [newItem];\n newItem._owningPathSegList = this;\n this._writeListToPath();\n return newItem;\n }\n\n _checkValidIndex (index) {\n if (isNaN(index) || index < 0 || index >= this.numberOfItems) {\n throw new Error('INDEX_SIZE_ERR');\n }\n }\n\n getItem (index) {\n this._checkPathSynchronizedToList();\n\n this._checkValidIndex(index);\n return this._list[index];\n }\n\n insertItemBefore (newItem, index) {\n this._checkPathSynchronizedToList();\n\n // Spec: If the index is greater than or equal to numberOfItems, then the new item is appended to the end of the list.\n if (index > this.numberOfItems) {\n index = this.numberOfItems;\n }\n if (newItem._owningPathSegList) {\n // SVG2 spec says to make a copy.\n newItem = newItem.clone();\n }\n this._list.splice(index, 0, newItem);\n newItem._owningPathSegList = this;\n this._writeListToPath();\n return newItem;\n }\n\n replaceItem (newItem, index) {\n this._checkPathSynchronizedToList();\n\n if (newItem._owningPathSegList) {\n // SVG2 spec says to make a copy.\n newItem = newItem.clone();\n }\n this._checkValidIndex(index);\n this._list[index] = newItem;\n newItem._owningPathSegList = this;\n this._writeListToPath();\n return newItem;\n }\n\n removeItem (index) {\n this._checkPathSynchronizedToList();\n\n this._checkValidIndex(index);\n const item = this._list[index];\n this._list.splice(index, 1);\n this._writeListToPath();\n return item;\n }\n\n appendItem (newItem) {\n this._checkPathSynchronizedToList();\n\n if (newItem._owningPathSegList) {\n // SVG2 spec says to make a copy.\n newItem = newItem.clone();\n }\n this._list.push(newItem);\n newItem._owningPathSegList = this;\n // TODO: Optimize this to just append to the existing attribute.\n this._writeListToPath();\n return newItem;\n }\n\n // This closely follows SVGPathParser::parsePath from Source/core/svg/SVGPathParser.cpp.\n _parsePath (string) {\n if (!string || !string.length) {\n return [];\n }\n\n const owningPathSegList = this;\n\n class Builder {\n constructor () {\n this.pathSegList = [];\n }\n appendSegment (pathSeg) {\n this.pathSegList.push(pathSeg);\n }\n }\n\n class Source {\n constructor (string) {\n this._string = string;\n this._currentIndex = 0;\n this._endIndex = this._string.length;\n this._previousCommand = SVGPathSeg.PATHSEG_UNKNOWN;\n\n this._skipOptionalSpaces();\n }\n _isCurrentSpace () {\n const character = this._string[this._currentIndex];\n return character <= ' ' && (character === ' ' || character === '\\n' || character === '\\t' || character === '\\r' || character === '\\f');\n }\n\n _skipOptionalSpaces () {\n while (this._currentIndex < this._endIndex && this._isCurrentSpace()) {\n this._currentIndex++;\n }\n return this._currentIndex < this._endIndex;\n }\n\n _skipOptionalSpacesOrDelimiter () {\n if (this._currentIndex < this._endIndex && !this._isCurrentSpace() && this._string.charAt(this._currentIndex) !== ',') {\n return false;\n }\n if (this._skipOptionalSpaces()) {\n if (this._currentIndex < this._endIndex && this._string.charAt(this._currentIndex) === ',') {\n this._currentIndex++;\n this._skipOptionalSpaces();\n }\n }\n return this._currentIndex < this._endIndex;\n }\n\n hasMoreData () {\n return this._currentIndex < this._endIndex;\n }\n\n peekSegmentType () {\n const lookahead = this._string[this._currentIndex];\n return this._pathSegTypeFromChar(lookahead);\n }\n\n _pathSegTypeFromChar (lookahead) {\n switch (lookahead) {\n case 'Z':\n case 'z':\n return SVGPathSeg.PATHSEG_CLOSEPATH;\n case 'M':\n return SVGPathSeg.PATHSEG_MOVETO_ABS;\n case 'm':\n return SVGPathSeg.PATHSEG_MOVETO_REL;\n case 'L':\n return SVGPathSeg.PATHSEG_LINETO_ABS;\n case 'l':\n return SVGPathSeg.PATHSEG_LINETO_REL;\n case 'C':\n return SVGPathSeg.PATHSEG_CURVETO_CUBIC_ABS;\n case 'c':\n return SVGPathSeg.PATHSEG_CURVETO_CUBIC_REL;\n case 'Q':\n return SVGPathSeg.PATHSEG_CURVETO_QUADRATIC_ABS;\n case 'q':\n return SVGPathSeg.PATHSEG_CURVETO_QUADRATIC_REL;\n case 'A':\n return SVGPathSeg.PATHSEG_ARC_ABS;\n case 'a':\n return SVGPathSeg.PATHSEG_ARC_REL;\n case 'H':\n return SVGPathSeg.PATHSEG_LINETO_HORIZONTAL_ABS;\n case 'h':\n return SVGPathSeg.PATHSEG_LINETO_HORIZONTAL_REL;\n case 'V':\n return SVGPathSeg.PATHSEG_LINETO_VERTICAL_ABS;\n case 'v':\n return SVGPathSeg.PATHSEG_LINETO_VERTICAL_REL;\n case 'S':\n return SVGPathSeg.PATHSEG_CURVETO_CUBIC_SMOOTH_ABS;\n case 's':\n return SVGPathSeg.PATHSEG_CURVETO_CUBIC_SMOOTH_REL;\n case 'T':\n return SVGPathSeg.PATHSEG_CURVETO_QUADRATIC_SMOOTH_ABS;\n case 't':\n return SVGPathSeg.PATHSEG_CURVETO_QUADRATIC_SMOOTH_REL;\n default:\n return SVGPathSeg.PATHSEG_UNKNOWN;\n }\n }\n\n _nextCommandHelper (lookahead, previousCommand) {\n // Check for remaining coordinates in the current command.\n if ((lookahead === '+' || lookahead === '-' || lookahead === '.' || (lookahead >= '0' && lookahead <= '9')) && previousCommand !== SVGPathSeg.PATHSEG_CLOSEPATH) {\n if (previousCommand === SVGPathSeg.PATHSEG_MOVETO_ABS) {\n return SVGPathSeg.PATHSEG_LINETO_ABS;\n }\n if (previousCommand === SVGPathSeg.PATHSEG_MOVETO_REL) {\n return SVGPathSeg.PATHSEG_LINETO_REL;\n }\n return previousCommand;\n }\n return SVGPathSeg.PATHSEG_UNKNOWN;\n }\n\n initialCommandIsMoveTo () {\n // If the path is empty it is still valid, so return true.\n if (!this.hasMoreData()) {\n return true;\n }\n const command = this.peekSegmentType();\n // Path must start with moveTo.\n return command === SVGPathSeg.PATHSEG_MOVETO_ABS || command === SVGPathSeg.PATHSEG_MOVETO_REL;\n }\n\n // Parse a number from an SVG path. This very closely follows genericParseNumber(...) from Source/core/svg/SVGParserUtilities.cpp.\n // Spec: https://www.w3.org/TR/SVG11/single-page.html#paths-PathDataBNF\n _parseNumber () {\n let exponent = 0;\n let integer = 0;\n let frac = 1;\n let decimal = 0;\n let sign = 1;\n let expsign = 1;\n\n const startIndex = this._currentIndex;\n\n this._skipOptionalSpaces();\n\n // Read the sign.\n if (this._currentIndex < this._endIndex && this._string.charAt(this._currentIndex) === '+') {\n this._currentIndex++;\n } else if (this._currentIndex < this._endIndex && this._string.charAt(this._currentIndex) === '-') {\n this._currentIndex++;\n sign = -1;\n }\n\n if (this._currentIndex === this._endIndex || ((this._string.charAt(this._currentIndex) < '0' || this._string.charAt(this._currentIndex) > '9') && this._string.charAt(this._currentIndex) !== '.')) {\n // The first character of a number must be one of [0-9+-.].\n return undefined;\n }\n\n // Read the integer part, build right-to-left.\n const startIntPartIndex = this._currentIndex;\n while (this._currentIndex < this._endIndex && this._string.charAt(this._currentIndex) >= '0' && this._string.charAt(this._currentIndex) <= '9') {\n this._currentIndex++; // Advance to first non-digit.\n }\n\n if (this._currentIndex !== startIntPartIndex) {\n let scanIntPartIndex = this._currentIndex - 1;\n let multiplier = 1;\n while (scanIntPartIndex >= startIntPartIndex) {\n integer += multiplier * (this._string.charAt(scanIntPartIndex--) - '0');\n multiplier *= 10;\n }\n }\n\n // Read the decimals.\n if (this._currentIndex < this._endIndex && this._string.charAt(this._currentIndex) === '.') {\n this._currentIndex++;\n\n // There must be a least one digit following the .\n if (this._currentIndex >= this._endIndex || this._string.charAt(this._currentIndex) < '0' || this._string.charAt(this._currentIndex) > '9') {\n return undefined;\n }\n while (this._currentIndex < this._endIndex && this._string.charAt(this._currentIndex) >= '0' && this._string.charAt(this._currentIndex) <= '9') {\n frac *= 10;\n decimal += (this._string.charAt(this._currentIndex) - '0') / frac;\n this._currentIndex += 1;\n }\n }\n\n // Read the exponent part.\n if (this._currentIndex !== startIndex && this._currentIndex + 1 < this._endIndex && (this._string.charAt(this._currentIndex) === 'e' || this._string.charAt(this._currentIndex) === 'E') && (this._string.charAt(this._currentIndex + 1) !== 'x' && this._string.charAt(this._currentIndex + 1) !== 'm')) {\n this._currentIndex++;\n\n // Read the sign of the exponent.\n if (this._string.charAt(this._currentIndex) === '+') {\n this._currentIndex++;\n } else if (this._string.charAt(this._currentIndex) === '-') {\n this._currentIndex++;\n expsign = -1;\n }\n\n // There must be an exponent.\n if (this._currentIndex >= this._endIndex || this._string.charAt(this._currentIndex) < '0' || this._string.charAt(this._currentIndex) > '9') {\n return undefined;\n }\n\n while (this._currentIndex < this._endIndex && this._string.charAt(this._currentIndex) >= '0' && this._string.charAt(this._currentIndex) <= '9') {\n exponent *= 10;\n exponent += (this._string.charAt(this._currentIndex) - '0');\n this._currentIndex++;\n }\n }\n\n let number = integer + decimal;\n number *= sign;\n\n if (exponent) {\n number *= 10 ** (expsign * exponent);\n }\n\n if (startIndex === this._currentIndex) {\n return undefined;\n }\n\n this._skipOptionalSpacesOrDelimiter();\n\n return number;\n }\n\n _parseArcFlag () {\n if (this._currentIndex >= this._endIndex) {\n return undefined;\n }\n let flag = false;\n const flagChar = this._string.charAt(this._currentIndex++);\n if (flagChar === '0') {\n flag = false;\n } else if (flagChar === '1') {\n flag = true;\n } else {\n return undefined;\n }\n\n this._skipOptionalSpacesOrDelimiter();\n return flag;\n }\n\n parseSegment () {\n const lookahead = this._string[this._currentIndex];\n let command = this._pathSegTypeFromChar(lookahead);\n if (command === SVGPathSeg.PATHSEG_UNKNOWN) {\n // Possibly an implicit command. Not allowed if this is the first command.\n if (this._previousCommand === SVGPathSeg.PATHSEG_UNKNOWN) {\n return null;\n }\n command = this._nextCommandHelper(lookahead, this._previousCommand);\n if (command === SVGPathSeg.PATHSEG_UNKNOWN) {\n return null;\n }\n } else {\n this._currentIndex++;\n }\n\n this._previousCommand = command;\n\n switch (command) {\n case SVGPathSeg.PATHSEG_MOVETO_REL:\n return new SVGPathSegMovetoRel(owningPathSegList, this._parseNumber(), this._parseNumber());\n case SVGPathSeg.PATHSEG_MOVETO_ABS:\n return new SVGPathSegMovetoAbs(owningPathSegList, this._parseNumber(), this._parseNumber());\n case SVGPathSeg.PATHSEG_LINETO_REL:\n return new SVGPathSegLinetoRel(owningPathSegList, this._parseNumber(), this._parseNumber());\n case SVGPathSeg.PATHSEG_LINETO_ABS:\n return new SVGPathSegLinetoAbs(owningPathSegList, this._parseNumber(), this._parseNumber());\n case SVGPathSeg.PATHSEG_LINETO_HORIZONTAL_REL:\n return new SVGPathSegLinetoHorizontalRel(owningPathSegList, this._parseNumber());\n case SVGPathSeg.PATHSEG_LINETO_HORIZONTAL_ABS:\n return new SVGPathSegLinetoHorizontalAbs(owningPathSegList, this._parseNumber());\n case SVGPathSeg.PATHSEG_LINETO_VERTICAL_REL:\n return new SVGPathSegLinetoVerticalRel(owningPathSegList, this._parseNumber());\n case SVGPathSeg.PATHSEG_LINETO_VERTICAL_ABS:\n return new SVGPathSegLinetoVerticalAbs(owningPathSegList, this._parseNumber());\n case SVGPathSeg.PATHSEG_CLOSEPATH:\n this._skipOptionalSpaces();\n return new SVGPathSegClosePath(owningPathSegList);\n case SVGPathSeg.PATHSEG_CURVETO_CUBIC_REL: {\n const points = {x1: this._parseNumber(), y1: this._parseNumber(), x2: this._parseNumber(), y2: this._parseNumber(), x: this._parseNumber(), y: this._parseNumber()};\n return new SVGPathSegCurvetoCubicRel(owningPathSegList, points.x, points.y, points.x1, points.y1, points.x2, points.y2);\n } case SVGPathSeg.PATHSEG_CURVETO_CUBIC_ABS: {\n const points = {x1: this._parseNumber(), y1: this._parseNumber(), x2: this._parseNumber(), y2: this._parseNumber(), x: this._parseNumber(), y: this._parseNumber()};\n return new SVGPathSegCurvetoCubicAbs(owningPathSegList, points.x, points.y, points.x1, points.y1, points.x2, points.y2);\n } case SVGPathSeg.PATHSEG_CURVETO_CUBIC_SMOOTH_REL: {\n const points = {x2: this._parseNumber(), y2: this._parseNumber(), x: this._parseNumber(), y: this._parseNumber()};\n return new SVGPathSegCurvetoCubicSmoothRel(owningPathSegList, points.x, points.y, points.x2, points.y2);\n } case SVGPathSeg.PATHSEG_CURVETO_CUBIC_SMOOTH_ABS: {\n const points = {x2: this._parseNumber(), y2: this._parseNumber(), x: this._parseNumber(), y: this._parseNumber()};\n return new SVGPathSegCurvetoCubicSmoothAbs(owningPathSegList, points.x, points.y, points.x2, points.y2);\n } case SVGPathSeg.PATHSEG_CURVETO_QUADRATIC_REL: {\n const points = {x1: this._parseNumber(), y1: this._parseNumber(), x: this._parseNumber(), y: this._parseNumber()};\n return new SVGPathSegCurvetoQuadraticRel(owningPathSegList, points.x, points.y, points.x1, points.y1);\n } case SVGPathSeg.PATHSEG_CURVETO_QUADRATIC_ABS: {\n const points = {x1: this._parseNumber(), y1: this._parseNumber(), x: this._parseNumber(), y: this._parseNumber()};\n return new SVGPathSegCurvetoQuadraticAbs(owningPathSegList, points.x, points.y, points.x1, points.y1);\n } case SVGPathSeg.PATHSEG_CURVETO_QUADRATIC_SMOOTH_REL:\n return new SVGPathSegCurvetoQuadraticSmoothRel(owningPathSegList, this._parseNumber(), this._parseNumber());\n case SVGPathSeg.PATHSEG_CURVETO_QUADRATIC_SMOOTH_ABS:\n return new SVGPathSegCurvetoQuadraticSmoothAbs(owningPathSegList, this._parseNumber(), this._parseNumber());\n case SVGPathSeg.PATHSEG_ARC_REL: {\n const points = {x1: this._parseNumber(), y1: this._parseNumber(), arcAngle: this._parseNumber(), arcLarge: this._parseArcFlag(), arcSweep: this._parseArcFlag(), x: this._parseNumber(), y: this._parseNumber()};\n return new SVGPathSegArcRel(owningPathSegList, points.x, points.y, points.x1, points.y1, points.arcAngle, points.arcLarge, points.arcSweep);\n } case SVGPathSeg.PATHSEG_ARC_ABS: {\n const points = {x1: this._parseNumber(), y1: this._parseNumber(), arcAngle: this._parseNumber(), arcLarge: this._parseArcFlag(), arcSweep: this._parseArcFlag(), x: this._parseNumber(), y: this._parseNumber()};\n return new SVGPathSegArcAbs(owningPathSegList, points.x, points.y, points.x1, points.y1, points.arcAngle, points.arcLarge, points.arcSweep);\n } default:\n throw new Error('Unknown path seg type.');\n }\n }\n }\n\n const builder = new Builder();\n const source = new Source(string);\n\n if (!source.initialCommandIsMoveTo()) {\n return [];\n }\n while (source.hasMoreData()) {\n const pathSeg = source.parseSegment();\n if (!pathSeg) {\n return [];\n }\n builder.appendSegment(pathSeg);\n }\n\n return builder.pathSegList;\n }\n\n // STATIC\n static _pathSegArrayAsString (pathSegArray) {\n let string = '';\n let first = true;\n pathSegArray.forEach((pathSeg) => {\n if (first) {\n first = false;\n string += pathSeg._asPathString();\n } else {\n string += ' ' + pathSeg._asPathString();\n }\n });\n return string;\n }\n }\n\n SVGPathSegList.prototype.classname = 'SVGPathSegList';\n\n Object.defineProperty(SVGPathSegList.prototype, 'numberOfItems', {\n get () {\n this._checkPathSynchronizedToList();\n return this._list.length;\n },\n enumerable: true\n });\n\n // Add the pathSegList accessors to SVGPathElement.\n // Spec: https://www.w3.org/TR/SVG11/single-page.html#paths-InterfaceSVGAnimatedPathData\n Object.defineProperties(SVGPathElement.prototype, {\n pathSegList: {\n get () {\n if (!this._pathSegList) {\n this._pathSegList = new SVGPathSegList(this);\n }\n return this._pathSegList;\n },\n enumerable: true\n },\n // TODO: The following are not implemented and simply return SVGPathElement.pathSegList.\n normalizedPathSegList: {get () { return this.pathSegList; }, enumerable: true},\n animatedPathSegList: {get () { return this.pathSegList; }, enumerable: true},\n animatedNormalizedPathSegList: {get () { return this.pathSegList; }, enumerable: true}\n });\n window.SVGPathSegList = SVGPathSegList;\n}\n})();\n","/**\n * @file ext-closepath.js\n *\n * @license MIT\n *\n * @copyright 2010 Jeff Schiller\n *\n */\nimport '../../common/svgpathseg.js';\n\n// This extension adds a simple button to the contextual panel for paths\n// The button toggles whether the path is open or closed\nexport default {\n name: 'closepath',\n async init ({importLocale, $}) {\n const strings = await importLocale();\n let selElems;\n const updateButton = function (path) {\n const seglist = path.pathSegList,\n closed = seglist.getItem(seglist.numberOfItems - 1).pathSegType === 1,\n showbutton = closed ? '#tool_openpath' : '#tool_closepath',\n hidebutton = closed ? '#tool_closepath' : '#tool_openpath';\n $(hidebutton).hide();\n $(showbutton).show();\n };\n const showPanel = function (on) {\n $('#closepath_panel').toggle(on);\n if (on) {\n const path = selElems[0];\n if (path) { updateButton(path); }\n }\n };\n const toggleClosed = function () {\n const path = selElems[0];\n if (path) {\n const seglist = path.pathSegList,\n last = seglist.numberOfItems - 1;\n // is closed\n if (seglist.getItem(last).pathSegType === 1) {\n seglist.removeItem(last);\n } else {\n seglist.appendItem(path.createSVGPathSegClosePath());\n }\n updateButton(path);\n }\n };\n\n const buttons = [\n {\n id: 'tool_openpath',\n icon: 'openpath.png',\n type: 'context',\n panel: 'closepath_panel',\n events: {\n click () {\n toggleClosed();\n }\n }\n },\n {\n id: 'tool_closepath',\n icon: 'closepath.png',\n type: 'context',\n panel: 'closepath_panel',\n events: {\n click () {\n toggleClosed();\n }\n }\n }\n ];\n\n return {\n name: strings.name,\n svgicons: 'closepath_icons.svg',\n buttons: strings.buttons.map((button, i) => {\n return Object.assign(buttons[i], button);\n }),\n callback () {\n $('#closepath_panel').hide();\n },\n selectedChanged (opts) {\n selElems = opts.elems;\n let i = selElems.length;\n while (i--) {\n const elem = selElems[i];\n if (elem && elem.tagName === 'path') {\n if (opts.selectedElement && !opts.multiselected) {\n showPanel(true);\n } else {\n showPanel(false);\n }\n } else {\n showPanel(false);\n }\n }\n }\n };\n }\n};\n"],"names":["window","SVGPathSeg","type","typeAsLetter","owningPathSegList","pathSegType","pathSegTypeAsLetter","_owningPathSegList","segmentChanged","prototype","classname","PATHSEG_UNKNOWN","PATHSEG_CLOSEPATH","PATHSEG_MOVETO_ABS","PATHSEG_MOVETO_REL","PATHSEG_LINETO_ABS","PATHSEG_LINETO_REL","PATHSEG_CURVETO_CUBIC_ABS","PATHSEG_CURVETO_CUBIC_REL","PATHSEG_CURVETO_QUADRATIC_ABS","PATHSEG_CURVETO_QUADRATIC_REL","PATHSEG_ARC_ABS","PATHSEG_ARC_REL","PATHSEG_LINETO_HORIZONTAL_ABS","PATHSEG_LINETO_HORIZONTAL_REL","PATHSEG_LINETO_VERTICAL_ABS","PATHSEG_LINETO_VERTICAL_REL","PATHSEG_CURVETO_CUBIC_SMOOTH_ABS","PATHSEG_CURVETO_CUBIC_SMOOTH_REL","PATHSEG_CURVETO_QUADRATIC_SMOOTH_ABS","PATHSEG_CURVETO_QUADRATIC_SMOOTH_REL","SVGPathSegClosePath","undefined","SVGPathSegMovetoAbs","x","y","_x","_y","Object","defineProperties","get","set","_segmentChanged","enumerable","SVGPathSegMovetoRel","SVGPathSegLinetoAbs","SVGPathSegLinetoRel","SVGPathSegCurvetoCubicAbs","x1","y1","x2","y2","_x1","_y1","_x2","_y2","SVGPathSegCurvetoCubicRel","SVGPathSegCurvetoQuadraticAbs","SVGPathSegCurvetoQuadraticRel","SVGPathSegArcAbs","r1","r2","angle","largeArcFlag","sweepFlag","_r1","_r2","_angle","_largeArcFlag","_sweepFlag","SVGPathSegArcRel","SVGPathSegLinetoHorizontalAbs","defineProperty","SVGPathSegLinetoHorizontalRel","SVGPathSegLinetoVerticalAbs","SVGPathSegLinetoVerticalRel","SVGPathSegCurvetoCubicSmoothAbs","SVGPathSegCurvetoCubicSmoothRel","SVGPathSegCurvetoQuadraticSmoothAbs","SVGPathSegCurvetoQuadraticSmoothRel","SVGPathElement","createSVGPathSegClosePath","createSVGPathSegMovetoAbs","createSVGPathSegMovetoRel","createSVGPathSegLinetoAbs","createSVGPathSegLinetoRel","createSVGPathSegCurvetoCubicAbs","createSVGPathSegCurvetoCubicRel","createSVGPathSegCurvetoQuadraticAbs","createSVGPathSegCurvetoQuadraticRel","createSVGPathSegArcAbs","createSVGPathSegArcRel","createSVGPathSegLinetoHorizontalAbs","createSVGPathSegLinetoHorizontalRel","createSVGPathSegLinetoVerticalAbs","createSVGPathSegLinetoVerticalRel","createSVGPathSegCurvetoCubicSmoothAbs","createSVGPathSegCurvetoCubicSmoothRel","createSVGPathSegCurvetoQuadraticSmoothAbs","createSVGPathSegCurvetoQuadraticSmoothRel","getPathSegAtLength","distance","isFinite","Error","measurementElement","document","createElementNS","setAttribute","getAttribute","lastPathSegment","pathSegList","numberOfItems","removeItem","getTotalLength","SVGPathSegList","pathElement","_pathElement","_list","_parsePath","_mutationObserverConfig","attributes","attributeFilter","_pathElementMutationObserver","MutationObserver","_updateListFromPathMutations","bind","observe","takeRecords","mutationRecords","hasPathMutations","forEach","record","attributeName","disconnect","_pathSegArrayAsString","pathSeg","_writeListToPath","_checkPathSynchronizedToList","newItem","index","isNaN","_checkValidIndex","clone","splice","item","push","string","length","Builder","Source","_string","_currentIndex","_endIndex","_previousCommand","_skipOptionalSpaces","character","_isCurrentSpace","charAt","lookahead","_pathSegTypeFromChar","previousCommand","hasMoreData","command","peekSegmentType","exponent","integer","frac","decimal","sign","expsign","startIndex","startIntPartIndex","scanIntPartIndex","multiplier","number","_skipOptionalSpacesOrDelimiter","flag","flagChar","_nextCommandHelper","_parseNumber","points","arcAngle","arcLarge","_parseArcFlag","arcSweep","builder","source","initialCommandIsMoveTo","parseSegment","appendSegment","pathSegArray","first","_asPathString","_pathSegList","normalizedPathSegList","animatedPathSegList","animatedNormalizedPathSegList","name","init","importLocale","$","strings","updateButton","path","seglist","closed","getItem","showbutton","hidebutton","hide","show","showPanel","on","toggle","selElems","toggleClosed","last","appendItem","buttons","id","icon","panel","events","click","svgicons","map","button","i","assign","callback","selectedChanged","opts","elems","elem","tagName","selectedElement","multiselected"],"mappings":";;;;;;;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C,KAAD,CAAT;AACD;AACF,qBAND,MAMO;AACLA,sBAAAA,SAAS,CAAC,KAAD,CAAT;AACD;AACF;AACF;AAxBI,eA1DsB;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAoF9B;AAtFY,CAAf;;;;"} \ No newline at end of file +{"version":3,"file":"ext-closepath.js","sources":["../../../src/common/svgpathseg.js","../../../src/editor/extensions/ext-closepath.js"],"sourcesContent":["/* eslint-disable import/unambiguous, max-len */\n/* globals SVGPathSeg, SVGPathSegMovetoRel, SVGPathSegMovetoAbs,\n SVGPathSegMovetoRel, SVGPathSegLinetoRel, SVGPathSegLinetoAbs,\n SVGPathSegLinetoHorizontalRel, SVGPathSegLinetoHorizontalAbs,\n SVGPathSegLinetoVerticalRel, SVGPathSegLinetoVerticalAbs,\n SVGPathSegClosePath, SVGPathSegCurvetoCubicRel,\n SVGPathSegCurvetoCubicAbs, SVGPathSegCurvetoCubicSmoothRel,\n SVGPathSegCurvetoCubicSmoothAbs, SVGPathSegCurvetoQuadraticRel,\n SVGPathSegCurvetoQuadraticAbs, SVGPathSegCurvetoQuadraticSmoothRel,\n SVGPathSegCurvetoQuadraticSmoothAbs, SVGPathSegArcRel, SVGPathSegArcAbs */\n/**\n* SVGPathSeg API polyfill\n* https://github.com/progers/pathseg\n*\n* This is a drop-in replacement for the `SVGPathSeg` and `SVGPathSegList` APIs\n* that were removed from SVG2 ({@link https://lists.w3.org/Archives/Public/www-svg/2015Jun/0044.html}),\n* including the latest spec changes which were implemented in Firefox 43 and\n* Chrome 46.\n*/\n/* eslint-disable no-shadow, class-methods-use-this, jsdoc/require-jsdoc */\n// Linting: We avoid `no-shadow` as ESLint thinks these are still available globals\n// Linting: We avoid `class-methods-use-this` as this is a polyfill that must\n// follow the conventions\n(() => {\nif (!('SVGPathSeg' in window)) {\n // Spec: https://www.w3.org/TR/SVG11/single-page.html#paths-InterfaceSVGPathSeg\n class SVGPathSeg {\n constructor (type, typeAsLetter, owningPathSegList) {\n this.pathSegType = type;\n this.pathSegTypeAsLetter = typeAsLetter;\n this._owningPathSegList = owningPathSegList;\n }\n // Notify owning PathSegList on any changes so they can be synchronized back to the path element.\n _segmentChanged () {\n if (this._owningPathSegList) {\n this._owningPathSegList.segmentChanged(this);\n }\n }\n }\n SVGPathSeg.prototype.classname = 'SVGPathSeg';\n\n SVGPathSeg.PATHSEG_UNKNOWN = 0;\n SVGPathSeg.PATHSEG_CLOSEPATH = 1;\n SVGPathSeg.PATHSEG_MOVETO_ABS = 2;\n SVGPathSeg.PATHSEG_MOVETO_REL = 3;\n SVGPathSeg.PATHSEG_LINETO_ABS = 4;\n SVGPathSeg.PATHSEG_LINETO_REL = 5;\n SVGPathSeg.PATHSEG_CURVETO_CUBIC_ABS = 6;\n SVGPathSeg.PATHSEG_CURVETO_CUBIC_REL = 7;\n SVGPathSeg.PATHSEG_CURVETO_QUADRATIC_ABS = 8;\n SVGPathSeg.PATHSEG_CURVETO_QUADRATIC_REL = 9;\n SVGPathSeg.PATHSEG_ARC_ABS = 10;\n SVGPathSeg.PATHSEG_ARC_REL = 11;\n SVGPathSeg.PATHSEG_LINETO_HORIZONTAL_ABS = 12;\n SVGPathSeg.PATHSEG_LINETO_HORIZONTAL_REL = 13;\n SVGPathSeg.PATHSEG_LINETO_VERTICAL_ABS = 14;\n SVGPathSeg.PATHSEG_LINETO_VERTICAL_REL = 15;\n SVGPathSeg.PATHSEG_CURVETO_CUBIC_SMOOTH_ABS = 16;\n SVGPathSeg.PATHSEG_CURVETO_CUBIC_SMOOTH_REL = 17;\n SVGPathSeg.PATHSEG_CURVETO_QUADRATIC_SMOOTH_ABS = 18;\n SVGPathSeg.PATHSEG_CURVETO_QUADRATIC_SMOOTH_REL = 19;\n\n class SVGPathSegClosePath extends SVGPathSeg {\n constructor (owningPathSegList) {\n super(SVGPathSeg.PATHSEG_CLOSEPATH, 'z', owningPathSegList);\n }\n toString () { return '[object SVGPathSegClosePath]'; }\n _asPathString () { return this.pathSegTypeAsLetter; }\n clone () { return new SVGPathSegClosePath(undefined); }\n }\n\n class SVGPathSegMovetoAbs extends SVGPathSeg {\n constructor (owningPathSegList, x, y) {\n super(SVGPathSeg.PATHSEG_MOVETO_ABS, 'M', owningPathSegList);\n this._x = x;\n this._y = y;\n }\n toString () { return '[object SVGPathSegMovetoAbs]'; }\n _asPathString () { return this.pathSegTypeAsLetter + ' ' + this._x + ' ' + this._y; }\n clone () { return new SVGPathSegMovetoAbs(undefined, this._x, this._y); }\n }\n Object.defineProperties(SVGPathSegMovetoAbs.prototype, {\n x: {\n get () { return this._x; }, set (x) { this._x = x; this._segmentChanged(); }, enumerable: true\n },\n y: {\n get () { return this._y; }, set (y) { this._y = y; this._segmentChanged(); }, enumerable: true\n }\n });\n\n class SVGPathSegMovetoRel extends SVGPathSeg {\n constructor (owningPathSegList, x, y) {\n super(SVGPathSeg.PATHSEG_MOVETO_REL, 'm', owningPathSegList);\n this._x = x;\n this._y = y;\n }\n toString () { return '[object SVGPathSegMovetoRel]'; }\n _asPathString () { return this.pathSegTypeAsLetter + ' ' + this._x + ' ' + this._y; }\n clone () { return new SVGPathSegMovetoRel(undefined, this._x, this._y); }\n }\n Object.defineProperties(SVGPathSegMovetoRel.prototype, {\n x: {get () { return this._x; }, set (x) { this._x = x; this._segmentChanged(); }, enumerable: true},\n y: {get () { return this._y; }, set (y) { this._y = y; this._segmentChanged(); }, enumerable: true}\n });\n\n class SVGPathSegLinetoAbs extends SVGPathSeg {\n constructor (owningPathSegList, x, y) {\n super(SVGPathSeg.PATHSEG_LINETO_ABS, 'L', owningPathSegList);\n this._x = x;\n this._y = y;\n }\n toString () { return '[object SVGPathSegLinetoAbs]'; }\n _asPathString () { return this.pathSegTypeAsLetter + ' ' + this._x + ' ' + this._y; }\n clone () { return new SVGPathSegLinetoAbs(undefined, this._x, this._y); }\n }\n Object.defineProperties(SVGPathSegLinetoAbs.prototype, {\n x: {get () { return this._x; }, set (x) { this._x = x; this._segmentChanged(); }, enumerable: true},\n y: {get () { return this._y; }, set (y) { this._y = y; this._segmentChanged(); }, enumerable: true}\n });\n\n class SVGPathSegLinetoRel extends SVGPathSeg {\n constructor (owningPathSegList, x, y) {\n super(SVGPathSeg.PATHSEG_LINETO_REL, 'l', owningPathSegList);\n this._x = x;\n this._y = y;\n }\n toString () { return '[object SVGPathSegLinetoRel]'; }\n _asPathString () { return this.pathSegTypeAsLetter + ' ' + this._x + ' ' + this._y; }\n clone () { return new SVGPathSegLinetoRel(undefined, this._x, this._y); }\n }\n Object.defineProperties(SVGPathSegLinetoRel.prototype, {\n x: {get () { return this._x; }, set (x) { this._x = x; this._segmentChanged(); }, enumerable: true},\n y: {get () { return this._y; }, set (y) { this._y = y; this._segmentChanged(); }, enumerable: true}\n });\n\n class SVGPathSegCurvetoCubicAbs extends SVGPathSeg {\n constructor (owningPathSegList, x, y, x1, y1, x2, y2) {\n super(SVGPathSeg.PATHSEG_CURVETO_CUBIC_ABS, 'C', owningPathSegList);\n this._x = x;\n this._y = y;\n this._x1 = x1;\n this._y1 = y1;\n this._x2 = x2;\n this._y2 = y2;\n }\n toString () { return '[object SVGPathSegCurvetoCubicAbs]'; }\n _asPathString () { return this.pathSegTypeAsLetter + ' ' + this._x1 + ' ' + this._y1 + ' ' + this._x2 + ' ' + this._y2 + ' ' + this._x + ' ' + this._y; }\n clone () { return new SVGPathSegCurvetoCubicAbs(undefined, this._x, this._y, this._x1, this._y1, this._x2, this._y2); }\n }\n Object.defineProperties(SVGPathSegCurvetoCubicAbs.prototype, {\n x: {get () { return this._x; }, set (x) { this._x = x; this._segmentChanged(); }, enumerable: true},\n y: {get () { return this._y; }, set (y) { this._y = y; this._segmentChanged(); }, enumerable: true},\n x1: {get () { return this._x1; }, set (x1) { this._x1 = x1; this._segmentChanged(); }, enumerable: true},\n y1: {get () { return this._y1; }, set (y1) { this._y1 = y1; this._segmentChanged(); }, enumerable: true},\n x2: {get () { return this._x2; }, set (x2) { this._x2 = x2; this._segmentChanged(); }, enumerable: true},\n y2: {get () { return this._y2; }, set (y2) { this._y2 = y2; this._segmentChanged(); }, enumerable: true}\n });\n\n class SVGPathSegCurvetoCubicRel extends SVGPathSeg {\n constructor (owningPathSegList, x, y, x1, y1, x2, y2) {\n super(SVGPathSeg.PATHSEG_CURVETO_CUBIC_REL, 'c', owningPathSegList);\n this._x = x;\n this._y = y;\n this._x1 = x1;\n this._y1 = y1;\n this._x2 = x2;\n this._y2 = y2;\n }\n toString () { return '[object SVGPathSegCurvetoCubicRel]'; }\n _asPathString () { return this.pathSegTypeAsLetter + ' ' + this._x1 + ' ' + this._y1 + ' ' + this._x2 + ' ' + this._y2 + ' ' + this._x + ' ' + this._y; }\n clone () { return new SVGPathSegCurvetoCubicRel(undefined, this._x, this._y, this._x1, this._y1, this._x2, this._y2); }\n }\n Object.defineProperties(SVGPathSegCurvetoCubicRel.prototype, {\n x: {get () { return this._x; }, set (x) { this._x = x; this._segmentChanged(); }, enumerable: true},\n y: {get () { return this._y; }, set (y) { this._y = y; this._segmentChanged(); }, enumerable: true},\n x1: {get () { return this._x1; }, set (x1) { this._x1 = x1; this._segmentChanged(); }, enumerable: true},\n y1: {get () { return this._y1; }, set (y1) { this._y1 = y1; this._segmentChanged(); }, enumerable: true},\n x2: {get () { return this._x2; }, set (x2) { this._x2 = x2; this._segmentChanged(); }, enumerable: true},\n y2: {get () { return this._y2; }, set (y2) { this._y2 = y2; this._segmentChanged(); }, enumerable: true}\n });\n\n class SVGPathSegCurvetoQuadraticAbs extends SVGPathSeg {\n constructor (owningPathSegList, x, y, x1, y1) {\n super(SVGPathSeg.PATHSEG_CURVETO_QUADRATIC_ABS, 'Q', owningPathSegList);\n this._x = x;\n this._y = y;\n this._x1 = x1;\n this._y1 = y1;\n }\n toString () { return '[object SVGPathSegCurvetoQuadraticAbs]'; }\n _asPathString () { return this.pathSegTypeAsLetter + ' ' + this._x1 + ' ' + this._y1 + ' ' + this._x + ' ' + this._y; }\n clone () { return new SVGPathSegCurvetoQuadraticAbs(undefined, this._x, this._y, this._x1, this._y1); }\n }\n Object.defineProperties(SVGPathSegCurvetoQuadraticAbs.prototype, {\n x: {get () { return this._x; }, set (x) { this._x = x; this._segmentChanged(); }, enumerable: true},\n y: {get () { return this._y; }, set (y) { this._y = y; this._segmentChanged(); }, enumerable: true},\n x1: {get () { return this._x1; }, set (x1) { this._x1 = x1; this._segmentChanged(); }, enumerable: true},\n y1: {get () { return this._y1; }, set (y1) { this._y1 = y1; this._segmentChanged(); }, enumerable: true}\n });\n\n class SVGPathSegCurvetoQuadraticRel extends SVGPathSeg {\n constructor (owningPathSegList, x, y, x1, y1) {\n super(SVGPathSeg.PATHSEG_CURVETO_QUADRATIC_REL, 'q', owningPathSegList);\n this._x = x;\n this._y = y;\n this._x1 = x1;\n this._y1 = y1;\n }\n toString () { return '[object SVGPathSegCurvetoQuadraticRel]'; }\n _asPathString () { return this.pathSegTypeAsLetter + ' ' + this._x1 + ' ' + this._y1 + ' ' + this._x + ' ' + this._y; }\n clone () { return new SVGPathSegCurvetoQuadraticRel(undefined, this._x, this._y, this._x1, this._y1); }\n }\n Object.defineProperties(SVGPathSegCurvetoQuadraticRel.prototype, {\n x: {get () { return this._x; }, set (x) { this._x = x; this._segmentChanged(); }, enumerable: true},\n y: {get () { return this._y; }, set (y) { this._y = y; this._segmentChanged(); }, enumerable: true},\n x1: {get () { return this._x1; }, set (x1) { this._x1 = x1; this._segmentChanged(); }, enumerable: true},\n y1: {get () { return this._y1; }, set (y1) { this._y1 = y1; this._segmentChanged(); }, enumerable: true}\n });\n\n class SVGPathSegArcAbs extends SVGPathSeg {\n constructor (owningPathSegList, x, y, r1, r2, angle, largeArcFlag, sweepFlag) {\n super(SVGPathSeg.PATHSEG_ARC_ABS, 'A', owningPathSegList);\n this._x = x;\n this._y = y;\n this._r1 = r1;\n this._r2 = r2;\n this._angle = angle;\n this._largeArcFlag = largeArcFlag;\n this._sweepFlag = sweepFlag;\n }\n toString () { return '[object SVGPathSegArcAbs]'; }\n _asPathString () { return this.pathSegTypeAsLetter + ' ' + this._r1 + ' ' + this._r2 + ' ' + this._angle + ' ' + (this._largeArcFlag ? '1' : '0') + ' ' + (this._sweepFlag ? '1' : '0') + ' ' + this._x + ' ' + this._y; }\n clone () { return new SVGPathSegArcAbs(undefined, this._x, this._y, this._r1, this._r2, this._angle, this._largeArcFlag, this._sweepFlag); }\n }\n Object.defineProperties(SVGPathSegArcAbs.prototype, {\n x: {get () { return this._x; }, set (x) { this._x = x; this._segmentChanged(); }, enumerable: true},\n y: {get () { return this._y; }, set (y) { this._y = y; this._segmentChanged(); }, enumerable: true},\n r1: {get () { return this._r1; }, set (r1) { this._r1 = r1; this._segmentChanged(); }, enumerable: true},\n r2: {get () { return this._r2; }, set (r2) { this._r2 = r2; this._segmentChanged(); }, enumerable: true},\n angle: {get () { return this._angle; }, set (angle) { this._angle = angle; this._segmentChanged(); }, enumerable: true},\n largeArcFlag: {get () { return this._largeArcFlag; }, set (largeArcFlag) { this._largeArcFlag = largeArcFlag; this._segmentChanged(); }, enumerable: true},\n sweepFlag: {get () { return this._sweepFlag; }, set (sweepFlag) { this._sweepFlag = sweepFlag; this._segmentChanged(); }, enumerable: true}\n });\n\n class SVGPathSegArcRel extends SVGPathSeg {\n constructor (owningPathSegList, x, y, r1, r2, angle, largeArcFlag, sweepFlag) {\n super(SVGPathSeg.PATHSEG_ARC_REL, 'a', owningPathSegList);\n this._x = x;\n this._y = y;\n this._r1 = r1;\n this._r2 = r2;\n this._angle = angle;\n this._largeArcFlag = largeArcFlag;\n this._sweepFlag = sweepFlag;\n }\n toString () { return '[object SVGPathSegArcRel]'; }\n _asPathString () { return this.pathSegTypeAsLetter + ' ' + this._r1 + ' ' + this._r2 + ' ' + this._angle + ' ' + (this._largeArcFlag ? '1' : '0') + ' ' + (this._sweepFlag ? '1' : '0') + ' ' + this._x + ' ' + this._y; }\n clone () { return new SVGPathSegArcRel(undefined, this._x, this._y, this._r1, this._r2, this._angle, this._largeArcFlag, this._sweepFlag); }\n }\n Object.defineProperties(SVGPathSegArcRel.prototype, {\n x: {get () { return this._x; }, set (x) { this._x = x; this._segmentChanged(); }, enumerable: true},\n y: {get () { return this._y; }, set (y) { this._y = y; this._segmentChanged(); }, enumerable: true},\n r1: {get () { return this._r1; }, set (r1) { this._r1 = r1; this._segmentChanged(); }, enumerable: true},\n r2: {get () { return this._r2; }, set (r2) { this._r2 = r2; this._segmentChanged(); }, enumerable: true},\n angle: {get () { return this._angle; }, set (angle) { this._angle = angle; this._segmentChanged(); }, enumerable: true},\n largeArcFlag: {get () { return this._largeArcFlag; }, set (largeArcFlag) { this._largeArcFlag = largeArcFlag; this._segmentChanged(); }, enumerable: true},\n sweepFlag: {get () { return this._sweepFlag; }, set (sweepFlag) { this._sweepFlag = sweepFlag; this._segmentChanged(); }, enumerable: true}\n });\n\n class SVGPathSegLinetoHorizontalAbs extends SVGPathSeg {\n constructor (owningPathSegList, x) {\n super(SVGPathSeg.PATHSEG_LINETO_HORIZONTAL_ABS, 'H', owningPathSegList);\n this._x = x;\n }\n toString () { return '[object SVGPathSegLinetoHorizontalAbs]'; }\n _asPathString () { return this.pathSegTypeAsLetter + ' ' + this._x; }\n clone () { return new SVGPathSegLinetoHorizontalAbs(undefined, this._x); }\n }\n Object.defineProperty(SVGPathSegLinetoHorizontalAbs.prototype, 'x', {get () { return this._x; }, set (x) { this._x = x; this._segmentChanged(); }, enumerable: true});\n\n class SVGPathSegLinetoHorizontalRel extends SVGPathSeg {\n constructor (owningPathSegList, x) {\n super(SVGPathSeg.PATHSEG_LINETO_HORIZONTAL_REL, 'h', owningPathSegList);\n this._x = x;\n }\n toString () { return '[object SVGPathSegLinetoHorizontalRel]'; }\n _asPathString () { return this.pathSegTypeAsLetter + ' ' + this._x; }\n clone () { return new SVGPathSegLinetoHorizontalRel(undefined, this._x); }\n }\n Object.defineProperty(SVGPathSegLinetoHorizontalRel.prototype, 'x', {get () { return this._x; }, set (x) { this._x = x; this._segmentChanged(); }, enumerable: true});\n\n class SVGPathSegLinetoVerticalAbs extends SVGPathSeg {\n constructor (owningPathSegList, y) {\n super(SVGPathSeg.PATHSEG_LINETO_VERTICAL_ABS, 'V', owningPathSegList);\n this._y = y;\n }\n toString () { return '[object SVGPathSegLinetoVerticalAbs]'; }\n _asPathString () { return this.pathSegTypeAsLetter + ' ' + this._y; }\n clone () { return new SVGPathSegLinetoVerticalAbs(undefined, this._y); }\n }\n Object.defineProperty(SVGPathSegLinetoVerticalAbs.prototype, 'y', {get () { return this._y; }, set (y) { this._y = y; this._segmentChanged(); }, enumerable: true});\n\n class SVGPathSegLinetoVerticalRel extends SVGPathSeg {\n constructor (owningPathSegList, y) {\n super(SVGPathSeg.PATHSEG_LINETO_VERTICAL_REL, 'v', owningPathSegList);\n this._y = y;\n }\n toString () { return '[object SVGPathSegLinetoVerticalRel]'; }\n _asPathString () { return this.pathSegTypeAsLetter + ' ' + this._y; }\n clone () { return new SVGPathSegLinetoVerticalRel(undefined, this._y); }\n }\n Object.defineProperty(SVGPathSegLinetoVerticalRel.prototype, 'y', {get () { return this._y; }, set (y) { this._y = y; this._segmentChanged(); }, enumerable: true});\n\n class SVGPathSegCurvetoCubicSmoothAbs extends SVGPathSeg {\n constructor (owningPathSegList, x, y, x2, y2) {\n super(SVGPathSeg.PATHSEG_CURVETO_CUBIC_SMOOTH_ABS, 'S', owningPathSegList);\n this._x = x;\n this._y = y;\n this._x2 = x2;\n this._y2 = y2;\n }\n toString () { return '[object SVGPathSegCurvetoCubicSmoothAbs]'; }\n _asPathString () { return this.pathSegTypeAsLetter + ' ' + this._x2 + ' ' + this._y2 + ' ' + this._x + ' ' + this._y; }\n clone () { return new SVGPathSegCurvetoCubicSmoothAbs(undefined, this._x, this._y, this._x2, this._y2); }\n }\n Object.defineProperties(SVGPathSegCurvetoCubicSmoothAbs.prototype, {\n x: {get () { return this._x; }, set (x) { this._x = x; this._segmentChanged(); }, enumerable: true},\n y: {get () { return this._y; }, set (y) { this._y = y; this._segmentChanged(); }, enumerable: true},\n x2: {get () { return this._x2; }, set (x2) { this._x2 = x2; this._segmentChanged(); }, enumerable: true},\n y2: {get () { return this._y2; }, set (y2) { this._y2 = y2; this._segmentChanged(); }, enumerable: true}\n });\n\n class SVGPathSegCurvetoCubicSmoothRel extends SVGPathSeg {\n constructor (owningPathSegList, x, y, x2, y2) {\n super(SVGPathSeg.PATHSEG_CURVETO_CUBIC_SMOOTH_REL, 's', owningPathSegList);\n this._x = x;\n this._y = y;\n this._x2 = x2;\n this._y2 = y2;\n }\n toString () { return '[object SVGPathSegCurvetoCubicSmoothRel]'; }\n _asPathString () { return this.pathSegTypeAsLetter + ' ' + this._x2 + ' ' + this._y2 + ' ' + this._x + ' ' + this._y; }\n clone () { return new SVGPathSegCurvetoCubicSmoothRel(undefined, this._x, this._y, this._x2, this._y2); }\n }\n Object.defineProperties(SVGPathSegCurvetoCubicSmoothRel.prototype, {\n x: {get () { return this._x; }, set (x) { this._x = x; this._segmentChanged(); }, enumerable: true},\n y: {get () { return this._y; }, set (y) { this._y = y; this._segmentChanged(); }, enumerable: true},\n x2: {get () { return this._x2; }, set (x2) { this._x2 = x2; this._segmentChanged(); }, enumerable: true},\n y2: {get () { return this._y2; }, set (y2) { this._y2 = y2; this._segmentChanged(); }, enumerable: true}\n });\n\n class SVGPathSegCurvetoQuadraticSmoothAbs extends SVGPathSeg {\n constructor (owningPathSegList, x, y) {\n super(SVGPathSeg.PATHSEG_CURVETO_QUADRATIC_SMOOTH_ABS, 'T', owningPathSegList);\n this._x = x;\n this._y = y;\n }\n toString () { return '[object SVGPathSegCurvetoQuadraticSmoothAbs]'; }\n _asPathString () { return this.pathSegTypeAsLetter + ' ' + this._x + ' ' + this._y; }\n clone () { return new SVGPathSegCurvetoQuadraticSmoothAbs(undefined, this._x, this._y); }\n }\n Object.defineProperties(SVGPathSegCurvetoQuadraticSmoothAbs.prototype, {\n x: {get () { return this._x; }, set (x) { this._x = x; this._segmentChanged(); }, enumerable: true},\n y: {get () { return this._y; }, set (y) { this._y = y; this._segmentChanged(); }, enumerable: true}\n });\n\n class SVGPathSegCurvetoQuadraticSmoothRel extends SVGPathSeg {\n constructor (owningPathSegList, x, y) {\n super(SVGPathSeg.PATHSEG_CURVETO_QUADRATIC_SMOOTH_REL, 't', owningPathSegList);\n this._x = x;\n this._y = y;\n }\n toString () { return '[object SVGPathSegCurvetoQuadraticSmoothRel]'; }\n _asPathString () { return this.pathSegTypeAsLetter + ' ' + this._x + ' ' + this._y; }\n clone () { return new SVGPathSegCurvetoQuadraticSmoothRel(undefined, this._x, this._y); }\n }\n Object.defineProperties(SVGPathSegCurvetoQuadraticSmoothRel.prototype, {\n x: {get () { return this._x; }, set (x) { this._x = x; this._segmentChanged(); }, enumerable: true},\n y: {get () { return this._y; }, set (y) { this._y = y; this._segmentChanged(); }, enumerable: true}\n });\n\n // Add createSVGPathSeg* functions to SVGPathElement.\n // Spec: https://www.w3.org/TR/SVG11/single-page.html#paths-InterfaceSVGPathElement.\n SVGPathElement.prototype.createSVGPathSegClosePath = function () { return new SVGPathSegClosePath(undefined); };\n SVGPathElement.prototype.createSVGPathSegMovetoAbs = function (x, y) { return new SVGPathSegMovetoAbs(undefined, x, y); };\n SVGPathElement.prototype.createSVGPathSegMovetoRel = function (x, y) { return new SVGPathSegMovetoRel(undefined, x, y); };\n SVGPathElement.prototype.createSVGPathSegLinetoAbs = function (x, y) { return new SVGPathSegLinetoAbs(undefined, x, y); };\n SVGPathElement.prototype.createSVGPathSegLinetoRel = function (x, y) { return new SVGPathSegLinetoRel(undefined, x, y); };\n SVGPathElement.prototype.createSVGPathSegCurvetoCubicAbs = function (x, y, x1, y1, x2, y2) { return new SVGPathSegCurvetoCubicAbs(undefined, x, y, x1, y1, x2, y2); };\n SVGPathElement.prototype.createSVGPathSegCurvetoCubicRel = function (x, y, x1, y1, x2, y2) { return new SVGPathSegCurvetoCubicRel(undefined, x, y, x1, y1, x2, y2); };\n SVGPathElement.prototype.createSVGPathSegCurvetoQuadraticAbs = function (x, y, x1, y1) { return new SVGPathSegCurvetoQuadraticAbs(undefined, x, y, x1, y1); };\n SVGPathElement.prototype.createSVGPathSegCurvetoQuadraticRel = function (x, y, x1, y1) { return new SVGPathSegCurvetoQuadraticRel(undefined, x, y, x1, y1); };\n SVGPathElement.prototype.createSVGPathSegArcAbs = function (x, y, r1, r2, angle, largeArcFlag, sweepFlag) { return new SVGPathSegArcAbs(undefined, x, y, r1, r2, angle, largeArcFlag, sweepFlag); };\n SVGPathElement.prototype.createSVGPathSegArcRel = function (x, y, r1, r2, angle, largeArcFlag, sweepFlag) { return new SVGPathSegArcRel(undefined, x, y, r1, r2, angle, largeArcFlag, sweepFlag); };\n SVGPathElement.prototype.createSVGPathSegLinetoHorizontalAbs = function (x) { return new SVGPathSegLinetoHorizontalAbs(undefined, x); };\n SVGPathElement.prototype.createSVGPathSegLinetoHorizontalRel = function (x) { return new SVGPathSegLinetoHorizontalRel(undefined, x); };\n SVGPathElement.prototype.createSVGPathSegLinetoVerticalAbs = function (y) { return new SVGPathSegLinetoVerticalAbs(undefined, y); };\n SVGPathElement.prototype.createSVGPathSegLinetoVerticalRel = function (y) { return new SVGPathSegLinetoVerticalRel(undefined, y); };\n SVGPathElement.prototype.createSVGPathSegCurvetoCubicSmoothAbs = function (x, y, x2, y2) { return new SVGPathSegCurvetoCubicSmoothAbs(undefined, x, y, x2, y2); };\n SVGPathElement.prototype.createSVGPathSegCurvetoCubicSmoothRel = function (x, y, x2, y2) { return new SVGPathSegCurvetoCubicSmoothRel(undefined, x, y, x2, y2); };\n SVGPathElement.prototype.createSVGPathSegCurvetoQuadraticSmoothAbs = function (x, y) { return new SVGPathSegCurvetoQuadraticSmoothAbs(undefined, x, y); };\n SVGPathElement.prototype.createSVGPathSegCurvetoQuadraticSmoothRel = function (x, y) { return new SVGPathSegCurvetoQuadraticSmoothRel(undefined, x, y); };\n\n if (!('getPathSegAtLength' in SVGPathElement.prototype)) {\n // Add getPathSegAtLength to SVGPathElement.\n // Spec: https://www.w3.org/TR/SVG11/single-page.html#paths-__svg__SVGPathElement__getPathSegAtLength\n // This polyfill requires SVGPathElement.getTotalLength to implement the distance-along-a-path algorithm.\n SVGPathElement.prototype.getPathSegAtLength = function (distance) {\n if (distance === undefined || !isFinite(distance)) {\n throw new Error('Invalid arguments.');\n }\n\n const measurementElement = document.createElementNS('http://www.w3.org/2000/svg', 'path');\n measurementElement.setAttribute('d', this.getAttribute('d'));\n let lastPathSegment = measurementElement.pathSegList.numberOfItems - 1;\n\n // If the path is empty, return 0.\n if (lastPathSegment <= 0) {\n return 0;\n }\n\n do {\n measurementElement.pathSegList.removeItem(lastPathSegment);\n if (distance > measurementElement.getTotalLength()) {\n break;\n }\n lastPathSegment--;\n } while (lastPathSegment > 0);\n return lastPathSegment;\n };\n }\n\n window.SVGPathSeg = SVGPathSeg;\n window.SVGPathSegClosePath = SVGPathSegClosePath;\n window.SVGPathSegMovetoAbs = SVGPathSegMovetoAbs;\n window.SVGPathSegMovetoRel = SVGPathSegMovetoRel;\n window.SVGPathSegLinetoAbs = SVGPathSegLinetoAbs;\n window.SVGPathSegLinetoRel = SVGPathSegLinetoRel;\n window.SVGPathSegCurvetoCubicAbs = SVGPathSegCurvetoCubicAbs;\n window.SVGPathSegCurvetoCubicRel = SVGPathSegCurvetoCubicRel;\n window.SVGPathSegCurvetoQuadraticAbs = SVGPathSegCurvetoQuadraticAbs;\n window.SVGPathSegCurvetoQuadraticRel = SVGPathSegCurvetoQuadraticRel;\n window.SVGPathSegArcAbs = SVGPathSegArcAbs;\n window.SVGPathSegArcRel = SVGPathSegArcRel;\n window.SVGPathSegLinetoHorizontalAbs = SVGPathSegLinetoHorizontalAbs;\n window.SVGPathSegLinetoHorizontalRel = SVGPathSegLinetoHorizontalRel;\n window.SVGPathSegLinetoVerticalAbs = SVGPathSegLinetoVerticalAbs;\n window.SVGPathSegLinetoVerticalRel = SVGPathSegLinetoVerticalRel;\n window.SVGPathSegCurvetoCubicSmoothAbs = SVGPathSegCurvetoCubicSmoothAbs;\n window.SVGPathSegCurvetoCubicSmoothRel = SVGPathSegCurvetoCubicSmoothRel;\n window.SVGPathSegCurvetoQuadraticSmoothAbs = SVGPathSegCurvetoQuadraticSmoothAbs;\n window.SVGPathSegCurvetoQuadraticSmoothRel = SVGPathSegCurvetoQuadraticSmoothRel;\n}\n\n// Checking for SVGPathSegList in window checks for the case of an implementation without the\n// SVGPathSegList API.\n// The second check for appendItem is specific to Firefox 59+ which removed only parts of the\n// SVGPathSegList API (e.g., appendItem). In this case we need to re-implement the entire API\n// so the polyfill data (i.e., _list) is used throughout.\nif (!('SVGPathSegList' in window) || !('appendItem' in window.SVGPathSegList.prototype)) {\n // Spec: https://www.w3.org/TR/SVG11/single-page.html#paths-InterfaceSVGPathSegList\n class SVGPathSegList {\n constructor (pathElement) {\n this._pathElement = pathElement;\n this._list = this._parsePath(this._pathElement.getAttribute('d'));\n\n // Use a MutationObserver to catch changes to the path's \"d\" attribute.\n this._mutationObserverConfig = {attributes: true, attributeFilter: ['d']};\n this._pathElementMutationObserver = new MutationObserver(this._updateListFromPathMutations.bind(this));\n this._pathElementMutationObserver.observe(this._pathElement, this._mutationObserverConfig);\n }\n // Process any pending mutations to the path element and update the list as needed.\n // This should be the first call of all public functions and is needed because\n // MutationObservers are not synchronous so we can have pending asynchronous mutations.\n _checkPathSynchronizedToList () {\n this._updateListFromPathMutations(this._pathElementMutationObserver.takeRecords());\n }\n\n _updateListFromPathMutations (mutationRecords) {\n if (!this._pathElement) {\n return;\n }\n let hasPathMutations = false;\n mutationRecords.forEach((record) => {\n if (record.attributeName === 'd') {\n hasPathMutations = true;\n }\n });\n if (hasPathMutations) {\n this._list = this._parsePath(this._pathElement.getAttribute('d'));\n }\n }\n\n // Serialize the list and update the path's 'd' attribute.\n _writeListToPath () {\n this._pathElementMutationObserver.disconnect();\n this._pathElement.setAttribute('d', SVGPathSegList._pathSegArrayAsString(this._list));\n this._pathElementMutationObserver.observe(this._pathElement, this._mutationObserverConfig);\n }\n\n // When a path segment changes the list needs to be synchronized back to the path element.\n segmentChanged (pathSeg) {\n this._writeListToPath();\n }\n\n clear () {\n this._checkPathSynchronizedToList();\n\n this._list.forEach((pathSeg) => {\n pathSeg._owningPathSegList = null;\n });\n this._list = [];\n this._writeListToPath();\n }\n\n initialize (newItem) {\n this._checkPathSynchronizedToList();\n\n this._list = [newItem];\n newItem._owningPathSegList = this;\n this._writeListToPath();\n return newItem;\n }\n\n _checkValidIndex (index) {\n if (isNaN(index) || index < 0 || index >= this.numberOfItems) {\n throw new Error('INDEX_SIZE_ERR');\n }\n }\n\n getItem (index) {\n this._checkPathSynchronizedToList();\n\n this._checkValidIndex(index);\n return this._list[index];\n }\n\n insertItemBefore (newItem, index) {\n this._checkPathSynchronizedToList();\n\n // Spec: If the index is greater than or equal to numberOfItems, then the new item is appended to the end of the list.\n if (index > this.numberOfItems) {\n index = this.numberOfItems;\n }\n if (newItem._owningPathSegList) {\n // SVG2 spec says to make a copy.\n newItem = newItem.clone();\n }\n this._list.splice(index, 0, newItem);\n newItem._owningPathSegList = this;\n this._writeListToPath();\n return newItem;\n }\n\n replaceItem (newItem, index) {\n this._checkPathSynchronizedToList();\n\n if (newItem._owningPathSegList) {\n // SVG2 spec says to make a copy.\n newItem = newItem.clone();\n }\n this._checkValidIndex(index);\n this._list[index] = newItem;\n newItem._owningPathSegList = this;\n this._writeListToPath();\n return newItem;\n }\n\n removeItem (index) {\n this._checkPathSynchronizedToList();\n\n this._checkValidIndex(index);\n const item = this._list[index];\n this._list.splice(index, 1);\n this._writeListToPath();\n return item;\n }\n\n appendItem (newItem) {\n this._checkPathSynchronizedToList();\n\n if (newItem._owningPathSegList) {\n // SVG2 spec says to make a copy.\n newItem = newItem.clone();\n }\n this._list.push(newItem);\n newItem._owningPathSegList = this;\n // TODO: Optimize this to just append to the existing attribute.\n this._writeListToPath();\n return newItem;\n }\n\n // This closely follows SVGPathParser::parsePath from Source/core/svg/SVGPathParser.cpp.\n _parsePath (string) {\n if (!string || !string.length) {\n return [];\n }\n\n const owningPathSegList = this;\n\n class Builder {\n constructor () {\n this.pathSegList = [];\n }\n appendSegment (pathSeg) {\n this.pathSegList.push(pathSeg);\n }\n }\n\n class Source {\n constructor (string) {\n this._string = string;\n this._currentIndex = 0;\n this._endIndex = this._string.length;\n this._previousCommand = SVGPathSeg.PATHSEG_UNKNOWN;\n\n this._skipOptionalSpaces();\n }\n _isCurrentSpace () {\n const character = this._string[this._currentIndex];\n return character <= ' ' && (character === ' ' || character === '\\n' || character === '\\t' || character === '\\r' || character === '\\f');\n }\n\n _skipOptionalSpaces () {\n while (this._currentIndex < this._endIndex && this._isCurrentSpace()) {\n this._currentIndex++;\n }\n return this._currentIndex < this._endIndex;\n }\n\n _skipOptionalSpacesOrDelimiter () {\n if (this._currentIndex < this._endIndex && !this._isCurrentSpace() && this._string.charAt(this._currentIndex) !== ',') {\n return false;\n }\n if (this._skipOptionalSpaces()) {\n if (this._currentIndex < this._endIndex && this._string.charAt(this._currentIndex) === ',') {\n this._currentIndex++;\n this._skipOptionalSpaces();\n }\n }\n return this._currentIndex < this._endIndex;\n }\n\n hasMoreData () {\n return this._currentIndex < this._endIndex;\n }\n\n peekSegmentType () {\n const lookahead = this._string[this._currentIndex];\n return this._pathSegTypeFromChar(lookahead);\n }\n\n _pathSegTypeFromChar (lookahead) {\n switch (lookahead) {\n case 'Z':\n case 'z':\n return SVGPathSeg.PATHSEG_CLOSEPATH;\n case 'M':\n return SVGPathSeg.PATHSEG_MOVETO_ABS;\n case 'm':\n return SVGPathSeg.PATHSEG_MOVETO_REL;\n case 'L':\n return SVGPathSeg.PATHSEG_LINETO_ABS;\n case 'l':\n return SVGPathSeg.PATHSEG_LINETO_REL;\n case 'C':\n return SVGPathSeg.PATHSEG_CURVETO_CUBIC_ABS;\n case 'c':\n return SVGPathSeg.PATHSEG_CURVETO_CUBIC_REL;\n case 'Q':\n return SVGPathSeg.PATHSEG_CURVETO_QUADRATIC_ABS;\n case 'q':\n return SVGPathSeg.PATHSEG_CURVETO_QUADRATIC_REL;\n case 'A':\n return SVGPathSeg.PATHSEG_ARC_ABS;\n case 'a':\n return SVGPathSeg.PATHSEG_ARC_REL;\n case 'H':\n return SVGPathSeg.PATHSEG_LINETO_HORIZONTAL_ABS;\n case 'h':\n return SVGPathSeg.PATHSEG_LINETO_HORIZONTAL_REL;\n case 'V':\n return SVGPathSeg.PATHSEG_LINETO_VERTICAL_ABS;\n case 'v':\n return SVGPathSeg.PATHSEG_LINETO_VERTICAL_REL;\n case 'S':\n return SVGPathSeg.PATHSEG_CURVETO_CUBIC_SMOOTH_ABS;\n case 's':\n return SVGPathSeg.PATHSEG_CURVETO_CUBIC_SMOOTH_REL;\n case 'T':\n return SVGPathSeg.PATHSEG_CURVETO_QUADRATIC_SMOOTH_ABS;\n case 't':\n return SVGPathSeg.PATHSEG_CURVETO_QUADRATIC_SMOOTH_REL;\n default:\n return SVGPathSeg.PATHSEG_UNKNOWN;\n }\n }\n\n _nextCommandHelper (lookahead, previousCommand) {\n // Check for remaining coordinates in the current command.\n if ((lookahead === '+' || lookahead === '-' || lookahead === '.' || (lookahead >= '0' && lookahead <= '9')) && previousCommand !== SVGPathSeg.PATHSEG_CLOSEPATH) {\n if (previousCommand === SVGPathSeg.PATHSEG_MOVETO_ABS) {\n return SVGPathSeg.PATHSEG_LINETO_ABS;\n }\n if (previousCommand === SVGPathSeg.PATHSEG_MOVETO_REL) {\n return SVGPathSeg.PATHSEG_LINETO_REL;\n }\n return previousCommand;\n }\n return SVGPathSeg.PATHSEG_UNKNOWN;\n }\n\n initialCommandIsMoveTo () {\n // If the path is empty it is still valid, so return true.\n if (!this.hasMoreData()) {\n return true;\n }\n const command = this.peekSegmentType();\n // Path must start with moveTo.\n return command === SVGPathSeg.PATHSEG_MOVETO_ABS || command === SVGPathSeg.PATHSEG_MOVETO_REL;\n }\n\n // Parse a number from an SVG path. This very closely follows genericParseNumber(...) from Source/core/svg/SVGParserUtilities.cpp.\n // Spec: https://www.w3.org/TR/SVG11/single-page.html#paths-PathDataBNF\n _parseNumber () {\n let exponent = 0;\n let integer = 0;\n let frac = 1;\n let decimal = 0;\n let sign = 1;\n let expsign = 1;\n\n const startIndex = this._currentIndex;\n\n this._skipOptionalSpaces();\n\n // Read the sign.\n if (this._currentIndex < this._endIndex && this._string.charAt(this._currentIndex) === '+') {\n this._currentIndex++;\n } else if (this._currentIndex < this._endIndex && this._string.charAt(this._currentIndex) === '-') {\n this._currentIndex++;\n sign = -1;\n }\n\n if (this._currentIndex === this._endIndex || ((this._string.charAt(this._currentIndex) < '0' || this._string.charAt(this._currentIndex) > '9') && this._string.charAt(this._currentIndex) !== '.')) {\n // The first character of a number must be one of [0-9+-.].\n return undefined;\n }\n\n // Read the integer part, build right-to-left.\n const startIntPartIndex = this._currentIndex;\n while (this._currentIndex < this._endIndex && this._string.charAt(this._currentIndex) >= '0' && this._string.charAt(this._currentIndex) <= '9') {\n this._currentIndex++; // Advance to first non-digit.\n }\n\n if (this._currentIndex !== startIntPartIndex) {\n let scanIntPartIndex = this._currentIndex - 1;\n let multiplier = 1;\n while (scanIntPartIndex >= startIntPartIndex) {\n integer += multiplier * (this._string.charAt(scanIntPartIndex--) - '0');\n multiplier *= 10;\n }\n }\n\n // Read the decimals.\n if (this._currentIndex < this._endIndex && this._string.charAt(this._currentIndex) === '.') {\n this._currentIndex++;\n\n // There must be a least one digit following the .\n if (this._currentIndex >= this._endIndex || this._string.charAt(this._currentIndex) < '0' || this._string.charAt(this._currentIndex) > '9') {\n return undefined;\n }\n while (this._currentIndex < this._endIndex && this._string.charAt(this._currentIndex) >= '0' && this._string.charAt(this._currentIndex) <= '9') {\n frac *= 10;\n decimal += (this._string.charAt(this._currentIndex) - '0') / frac;\n this._currentIndex += 1;\n }\n }\n\n // Read the exponent part.\n if (this._currentIndex !== startIndex && this._currentIndex + 1 < this._endIndex && (this._string.charAt(this._currentIndex) === 'e' || this._string.charAt(this._currentIndex) === 'E') && (this._string.charAt(this._currentIndex + 1) !== 'x' && this._string.charAt(this._currentIndex + 1) !== 'm')) {\n this._currentIndex++;\n\n // Read the sign of the exponent.\n if (this._string.charAt(this._currentIndex) === '+') {\n this._currentIndex++;\n } else if (this._string.charAt(this._currentIndex) === '-') {\n this._currentIndex++;\n expsign = -1;\n }\n\n // There must be an exponent.\n if (this._currentIndex >= this._endIndex || this._string.charAt(this._currentIndex) < '0' || this._string.charAt(this._currentIndex) > '9') {\n return undefined;\n }\n\n while (this._currentIndex < this._endIndex && this._string.charAt(this._currentIndex) >= '0' && this._string.charAt(this._currentIndex) <= '9') {\n exponent *= 10;\n exponent += (this._string.charAt(this._currentIndex) - '0');\n this._currentIndex++;\n }\n }\n\n let number = integer + decimal;\n number *= sign;\n\n if (exponent) {\n number *= 10 ** (expsign * exponent);\n }\n\n if (startIndex === this._currentIndex) {\n return undefined;\n }\n\n this._skipOptionalSpacesOrDelimiter();\n\n return number;\n }\n\n _parseArcFlag () {\n if (this._currentIndex >= this._endIndex) {\n return undefined;\n }\n let flag = false;\n const flagChar = this._string.charAt(this._currentIndex++);\n if (flagChar === '0') {\n flag = false;\n } else if (flagChar === '1') {\n flag = true;\n } else {\n return undefined;\n }\n\n this._skipOptionalSpacesOrDelimiter();\n return flag;\n }\n\n parseSegment () {\n const lookahead = this._string[this._currentIndex];\n let command = this._pathSegTypeFromChar(lookahead);\n if (command === SVGPathSeg.PATHSEG_UNKNOWN) {\n // Possibly an implicit command. Not allowed if this is the first command.\n if (this._previousCommand === SVGPathSeg.PATHSEG_UNKNOWN) {\n return null;\n }\n command = this._nextCommandHelper(lookahead, this._previousCommand);\n if (command === SVGPathSeg.PATHSEG_UNKNOWN) {\n return null;\n }\n } else {\n this._currentIndex++;\n }\n\n this._previousCommand = command;\n\n switch (command) {\n case SVGPathSeg.PATHSEG_MOVETO_REL:\n return new SVGPathSegMovetoRel(owningPathSegList, this._parseNumber(), this._parseNumber());\n case SVGPathSeg.PATHSEG_MOVETO_ABS:\n return new SVGPathSegMovetoAbs(owningPathSegList, this._parseNumber(), this._parseNumber());\n case SVGPathSeg.PATHSEG_LINETO_REL:\n return new SVGPathSegLinetoRel(owningPathSegList, this._parseNumber(), this._parseNumber());\n case SVGPathSeg.PATHSEG_LINETO_ABS:\n return new SVGPathSegLinetoAbs(owningPathSegList, this._parseNumber(), this._parseNumber());\n case SVGPathSeg.PATHSEG_LINETO_HORIZONTAL_REL:\n return new SVGPathSegLinetoHorizontalRel(owningPathSegList, this._parseNumber());\n case SVGPathSeg.PATHSEG_LINETO_HORIZONTAL_ABS:\n return new SVGPathSegLinetoHorizontalAbs(owningPathSegList, this._parseNumber());\n case SVGPathSeg.PATHSEG_LINETO_VERTICAL_REL:\n return new SVGPathSegLinetoVerticalRel(owningPathSegList, this._parseNumber());\n case SVGPathSeg.PATHSEG_LINETO_VERTICAL_ABS:\n return new SVGPathSegLinetoVerticalAbs(owningPathSegList, this._parseNumber());\n case SVGPathSeg.PATHSEG_CLOSEPATH:\n this._skipOptionalSpaces();\n return new SVGPathSegClosePath(owningPathSegList);\n case SVGPathSeg.PATHSEG_CURVETO_CUBIC_REL: {\n const points = {x1: this._parseNumber(), y1: this._parseNumber(), x2: this._parseNumber(), y2: this._parseNumber(), x: this._parseNumber(), y: this._parseNumber()};\n return new SVGPathSegCurvetoCubicRel(owningPathSegList, points.x, points.y, points.x1, points.y1, points.x2, points.y2);\n } case SVGPathSeg.PATHSEG_CURVETO_CUBIC_ABS: {\n const points = {x1: this._parseNumber(), y1: this._parseNumber(), x2: this._parseNumber(), y2: this._parseNumber(), x: this._parseNumber(), y: this._parseNumber()};\n return new SVGPathSegCurvetoCubicAbs(owningPathSegList, points.x, points.y, points.x1, points.y1, points.x2, points.y2);\n } case SVGPathSeg.PATHSEG_CURVETO_CUBIC_SMOOTH_REL: {\n const points = {x2: this._parseNumber(), y2: this._parseNumber(), x: this._parseNumber(), y: this._parseNumber()};\n return new SVGPathSegCurvetoCubicSmoothRel(owningPathSegList, points.x, points.y, points.x2, points.y2);\n } case SVGPathSeg.PATHSEG_CURVETO_CUBIC_SMOOTH_ABS: {\n const points = {x2: this._parseNumber(), y2: this._parseNumber(), x: this._parseNumber(), y: this._parseNumber()};\n return new SVGPathSegCurvetoCubicSmoothAbs(owningPathSegList, points.x, points.y, points.x2, points.y2);\n } case SVGPathSeg.PATHSEG_CURVETO_QUADRATIC_REL: {\n const points = {x1: this._parseNumber(), y1: this._parseNumber(), x: this._parseNumber(), y: this._parseNumber()};\n return new SVGPathSegCurvetoQuadraticRel(owningPathSegList, points.x, points.y, points.x1, points.y1);\n } case SVGPathSeg.PATHSEG_CURVETO_QUADRATIC_ABS: {\n const points = {x1: this._parseNumber(), y1: this._parseNumber(), x: this._parseNumber(), y: this._parseNumber()};\n return new SVGPathSegCurvetoQuadraticAbs(owningPathSegList, points.x, points.y, points.x1, points.y1);\n } case SVGPathSeg.PATHSEG_CURVETO_QUADRATIC_SMOOTH_REL:\n return new SVGPathSegCurvetoQuadraticSmoothRel(owningPathSegList, this._parseNumber(), this._parseNumber());\n case SVGPathSeg.PATHSEG_CURVETO_QUADRATIC_SMOOTH_ABS:\n return new SVGPathSegCurvetoQuadraticSmoothAbs(owningPathSegList, this._parseNumber(), this._parseNumber());\n case SVGPathSeg.PATHSEG_ARC_REL: {\n const points = {x1: this._parseNumber(), y1: this._parseNumber(), arcAngle: this._parseNumber(), arcLarge: this._parseArcFlag(), arcSweep: this._parseArcFlag(), x: this._parseNumber(), y: this._parseNumber()};\n return new SVGPathSegArcRel(owningPathSegList, points.x, points.y, points.x1, points.y1, points.arcAngle, points.arcLarge, points.arcSweep);\n } case SVGPathSeg.PATHSEG_ARC_ABS: {\n const points = {x1: this._parseNumber(), y1: this._parseNumber(), arcAngle: this._parseNumber(), arcLarge: this._parseArcFlag(), arcSweep: this._parseArcFlag(), x: this._parseNumber(), y: this._parseNumber()};\n return new SVGPathSegArcAbs(owningPathSegList, points.x, points.y, points.x1, points.y1, points.arcAngle, points.arcLarge, points.arcSweep);\n } default:\n throw new Error('Unknown path seg type.');\n }\n }\n }\n\n const builder = new Builder();\n const source = new Source(string);\n\n if (!source.initialCommandIsMoveTo()) {\n return [];\n }\n while (source.hasMoreData()) {\n const pathSeg = source.parseSegment();\n if (!pathSeg) {\n return [];\n }\n builder.appendSegment(pathSeg);\n }\n\n return builder.pathSegList;\n }\n\n // STATIC\n static _pathSegArrayAsString (pathSegArray) {\n let string = '';\n let first = true;\n pathSegArray.forEach((pathSeg) => {\n if (first) {\n first = false;\n string += pathSeg._asPathString();\n } else {\n string += ' ' + pathSeg._asPathString();\n }\n });\n return string;\n }\n }\n\n SVGPathSegList.prototype.classname = 'SVGPathSegList';\n\n Object.defineProperty(SVGPathSegList.prototype, 'numberOfItems', {\n get () {\n this._checkPathSynchronizedToList();\n return this._list.length;\n },\n enumerable: true\n });\n\n // Add the pathSegList accessors to SVGPathElement.\n // Spec: https://www.w3.org/TR/SVG11/single-page.html#paths-InterfaceSVGAnimatedPathData\n Object.defineProperties(SVGPathElement.prototype, {\n pathSegList: {\n get () {\n if (!this._pathSegList) {\n this._pathSegList = new SVGPathSegList(this);\n }\n return this._pathSegList;\n },\n enumerable: true\n },\n // TODO: The following are not implemented and simply return SVGPathElement.pathSegList.\n normalizedPathSegList: {get () { return this.pathSegList; }, enumerable: true},\n animatedPathSegList: {get () { return this.pathSegList; }, enumerable: true},\n animatedNormalizedPathSegList: {get () { return this.pathSegList; }, enumerable: true}\n });\n window.SVGPathSegList = SVGPathSegList;\n}\n})();\n","/**\n * @file ext-closepath.js\n *\n * @license MIT\n *\n * @copyright 2010 Jeff Schiller\n *\n */\nimport '../../common/svgpathseg.js';\n\n// This extension adds a simple button to the contextual panel for paths\n// The button toggles whether the path is open or closed\nexport default {\n name: 'closepath',\n async init ({importLocale, $}) {\n const strings = await importLocale();\n let selElems;\n const updateButton = function (path) {\n const seglist = path.pathSegList,\n closed = seglist.getItem(seglist.numberOfItems - 1).pathSegType === 1,\n showbutton = closed ? '#tool_openpath' : '#tool_closepath',\n hidebutton = closed ? '#tool_closepath' : '#tool_openpath';\n $(hidebutton).hide();\n $(showbutton).show();\n };\n const showPanel = function (on) {\n $('#closepath_panel').toggle(on);\n if (on) {\n const path = selElems[0];\n if (path) { updateButton(path); }\n }\n };\n const toggleClosed = function () {\n const path = selElems[0];\n if (path) {\n const seglist = path.pathSegList,\n last = seglist.numberOfItems - 1;\n // is closed\n if (seglist.getItem(last).pathSegType === 1) {\n seglist.removeItem(last);\n } else {\n seglist.appendItem(path.createSVGPathSegClosePath());\n }\n updateButton(path);\n }\n };\n\n const buttons = [\n {\n id: 'tool_openpath',\n icon: 'openpath.png',\n type: 'context',\n panel: 'closepath_panel',\n events: {\n click () {\n toggleClosed();\n }\n }\n },\n {\n id: 'tool_closepath',\n icon: 'closepath.png',\n type: 'context',\n panel: 'closepath_panel',\n events: {\n click () {\n toggleClosed();\n }\n }\n }\n ];\n\n return {\n name: strings.name,\n svgicons: 'closepath_icons.svg',\n buttons: strings.buttons.map((button, i) => {\n return Object.assign(buttons[i], button);\n }),\n callback () {\n $('#closepath_panel').hide();\n },\n selectedChanged (opts) {\n selElems = opts.elems;\n let i = selElems.length;\n while (i--) {\n const elem = selElems[i];\n if (elem && elem.tagName === 'path') {\n if (opts.selectedElement && !opts.multiselected) {\n showPanel(true);\n } else {\n showPanel(false);\n }\n } else {\n showPanel(false);\n }\n }\n }\n };\n }\n};\n"],"names":["window","SVGPathSeg","type","typeAsLetter","owningPathSegList","pathSegType","pathSegTypeAsLetter","_owningPathSegList","this","segmentChanged","prototype","classname","PATHSEG_UNKNOWN","PATHSEG_CLOSEPATH","PATHSEG_MOVETO_ABS","PATHSEG_MOVETO_REL","PATHSEG_LINETO_ABS","PATHSEG_LINETO_REL","PATHSEG_CURVETO_CUBIC_ABS","PATHSEG_CURVETO_CUBIC_REL","PATHSEG_CURVETO_QUADRATIC_ABS","PATHSEG_CURVETO_QUADRATIC_REL","PATHSEG_ARC_ABS","PATHSEG_ARC_REL","PATHSEG_LINETO_HORIZONTAL_ABS","PATHSEG_LINETO_HORIZONTAL_REL","PATHSEG_LINETO_VERTICAL_ABS","PATHSEG_LINETO_VERTICAL_REL","PATHSEG_CURVETO_CUBIC_SMOOTH_ABS","PATHSEG_CURVETO_CUBIC_SMOOTH_REL","PATHSEG_CURVETO_QUADRATIC_SMOOTH_ABS","PATHSEG_CURVETO_QUADRATIC_SMOOTH_REL","SVGPathSegClosePath","undefined","SVGPathSegMovetoAbs","x","y","_x","_y","Object","defineProperties","get","set","_segmentChanged","enumerable","SVGPathSegMovetoRel","SVGPathSegLinetoAbs","SVGPathSegLinetoRel","SVGPathSegCurvetoCubicAbs","x1","y1","x2","y2","_x1","_y1","_x2","_y2","SVGPathSegCurvetoCubicRel","SVGPathSegCurvetoQuadraticAbs","SVGPathSegCurvetoQuadraticRel","SVGPathSegArcAbs","r1","r2","angle","largeArcFlag","sweepFlag","_r1","_r2","_angle","_largeArcFlag","_sweepFlag","SVGPathSegArcRel","SVGPathSegLinetoHorizontalAbs","defineProperty","SVGPathSegLinetoHorizontalRel","SVGPathSegLinetoVerticalAbs","SVGPathSegLinetoVerticalRel","SVGPathSegCurvetoCubicSmoothAbs","SVGPathSegCurvetoCubicSmoothRel","SVGPathSegCurvetoQuadraticSmoothAbs","SVGPathSegCurvetoQuadraticSmoothRel","SVGPathElement","createSVGPathSegClosePath","createSVGPathSegMovetoAbs","createSVGPathSegMovetoRel","createSVGPathSegLinetoAbs","createSVGPathSegLinetoRel","createSVGPathSegCurvetoCubicAbs","createSVGPathSegCurvetoCubicRel","createSVGPathSegCurvetoQuadraticAbs","createSVGPathSegCurvetoQuadraticRel","createSVGPathSegArcAbs","createSVGPathSegArcRel","createSVGPathSegLinetoHorizontalAbs","createSVGPathSegLinetoHorizontalRel","createSVGPathSegLinetoVerticalAbs","createSVGPathSegLinetoVerticalRel","createSVGPathSegCurvetoCubicSmoothAbs","createSVGPathSegCurvetoCubicSmoothRel","createSVGPathSegCurvetoQuadraticSmoothAbs","createSVGPathSegCurvetoQuadraticSmoothRel","getPathSegAtLength","distance","isFinite","Error","measurementElement","document","createElementNS","setAttribute","getAttribute","lastPathSegment","pathSegList","numberOfItems","removeItem","getTotalLength","SVGPathSegList","pathElement","_pathElement","_list","_parsePath","_mutationObserverConfig","attributes","attributeFilter","_pathElementMutationObserver","MutationObserver","_updateListFromPathMutations","bind","observe","takeRecords","mutationRecords","hasPathMutations","forEach","record","attributeName","disconnect","_pathSegArrayAsString","pathSeg","_writeListToPath","_checkPathSynchronizedToList","newItem","index","isNaN","_checkValidIndex","clone","splice","item","push","string","length","Builder","Source","_string","_currentIndex","_endIndex","_previousCommand","_skipOptionalSpaces","character","_isCurrentSpace","charAt","lookahead","_pathSegTypeFromChar","previousCommand","hasMoreData","command","peekSegmentType","exponent","integer","frac","decimal","sign","expsign","startIndex","startIntPartIndex","scanIntPartIndex","multiplier","number","_skipOptionalSpacesOrDelimiter","flag","flagChar","_nextCommandHelper","_parseNumber","points","arcAngle","arcLarge","_parseArcFlag","arcSweep","builder","source","initialCommandIsMoveTo","parseSegment","appendSegment","pathSegArray","first","_asPathString","_pathSegList","normalizedPathSegList","animatedPathSegList","animatedNormalizedPathSegList","name","init","importLocale","$","strings","updateButton","path","seglist","closed","getItem","showbutton","hide","show","showPanel","on","toggle","selElems","toggleClosed","last","appendItem","buttons","id","icon","panel","events","click","svgicons","map","button","i","assign","callback","selectedChanged","opts","elems","elem","tagName","selectedElement","multiselected"],"mappings":"i5FAuBA,gBACM,eAAgBA,QAAS,KAEvBC,kCACSC,EAAMC,EAAcC,0CAC1BC,YAAcH,OACdI,oBAAsBH,OACtBI,mBAAqBH,2FAItBI,KAAKD,yBACFA,mBAAmBE,eAAeD,yBAI7CP,EAAWS,UAAUC,UAAY,aAEjCV,EAAWW,gBAAkB,EAC7BX,EAAWY,kBAAoB,EAC/BZ,EAAWa,mBAAqB,EAChCb,EAAWc,mBAAqB,EAChCd,EAAWe,mBAAqB,EAChCf,EAAWgB,mBAAqB,EAChChB,EAAWiB,0BAA4B,E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,EAAQC,UAC7B5L,OAAO6L,OAAOV,EAAQS,GAAID,MAEnCG,6BACE5B,EAAE,oBAAoBQ,QAExBqB,yCAAiBC,WAEXJ,GADJb,EAAWiB,EAAKC,OACCpF,OACV+E,KAAK,KACJM,EAAOnB,EAASa,GAClBM,GAAyB,SAAjBA,EAAKC,SACXH,EAAKI,kBAAoBJ,EAAKK,cAChCzB,GAAU,GAKZA,GAAU"} \ No newline at end of file diff --git a/dist/editor/extensions/ext-connector.js b/dist/editor/extensions/ext-connector.js index 432bd2be..16640754 100644 --- a/dist/editor/extensions/ext-connector.js +++ b/dist/editor/extensions/ext-connector.js @@ -1,1651 +1,4 @@ -function _typeof(obj) { - "@babel/helpers - typeof"; - - if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { - _typeof = function (obj) { - return typeof obj; - }; - } else { - _typeof = function (obj) { - return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; - }; - } - - return _typeof(obj); -} - -var REACT_ELEMENT_TYPE; - -function _jsx(type, props, key, children) { - if (!REACT_ELEMENT_TYPE) { - REACT_ELEMENT_TYPE = typeof Symbol === "function" && Symbol["for"] && Symbol["for"]("react.element") || 0xeac7; - } - - var defaultProps = type && type.defaultProps; - var childrenLength = arguments.length - 3; - - if (!props && childrenLength !== 0) { - props = { - children: void 0 - }; - } - - if (childrenLength === 1) { - props.children = children; - } else if (childrenLength > 1) { - var childArray = new Array(childrenLength); - - for (var i = 0; i < childrenLength; i++) { - childArray[i] = arguments[i + 3]; - } - - props.children = childArray; - } - - if (props && defaultProps) { - for (var propName in defaultProps) { - if (props[propName] === void 0) { - props[propName] = defaultProps[propName]; - } - } - } else if (!props) { - props = defaultProps || {}; - } - - return { - $$typeof: REACT_ELEMENT_TYPE, - type: type, - key: key === undefined ? null : '' + key, - ref: null, - props: props, - _owner: null - }; -} - -function _asyncIterator(iterable) { - var method; - - if (typeof Symbol !== "undefined") { - if (Symbol.asyncIterator) { - method = iterable[Symbol.asyncIterator]; - if (method != null) return method.call(iterable); - } - - if (Symbol.iterator) { - method = iterable[Symbol.iterator]; - if (method != null) return method.call(iterable); - } - } - - throw new TypeError("Object is not async iterable"); -} - -function _AwaitValue(value) { - this.wrapped = value; -} - -function _AsyncGenerator(gen) { - var front, back; - - function send(key, arg) { - return new Promise(function (resolve, reject) { - var request = { - key: key, - arg: arg, - resolve: resolve, - reject: reject, - next: null - }; - - if (back) { - back = back.next = request; - } else { - front = back = request; - resume(key, arg); - } - }); - } - - function resume(key, arg) { - try { - var result = gen[key](arg); - var value = result.value; - var wrappedAwait = value instanceof _AwaitValue; - Promise.resolve(wrappedAwait ? value.wrapped : value).then(function (arg) { - if (wrappedAwait) { - resume(key === "return" ? "return" : "next", arg); - return; - } - - settle(result.done ? "return" : "normal", arg); - }, function (err) { - resume("throw", err); - }); - } catch (err) { - settle("throw", err); - } - } - - function settle(type, value) { - switch (type) { - case "return": - front.resolve({ - value: value, - done: true - }); - break; - - case "throw": - front.reject(value); - break; - - default: - front.resolve({ - value: value, - done: false - }); - break; - } - - front = front.next; - - if (front) { - resume(front.key, front.arg); - } else { - back = null; - } - } - - this._invoke = send; - - if (typeof gen.return !== "function") { - this.return = undefined; - } -} - -if (typeof Symbol === "function" && Symbol.asyncIterator) { - _AsyncGenerator.prototype[Symbol.asyncIterator] = function () { - return this; - }; -} - -_AsyncGenerator.prototype.next = function (arg) { - return this._invoke("next", arg); -}; - -_AsyncGenerator.prototype.throw = function (arg) { - return this._invoke("throw", arg); -}; - -_AsyncGenerator.prototype.return = function (arg) { - return this._invoke("return", arg); -}; - -function _wrapAsyncGenerator(fn) { - return function () { - return new _AsyncGenerator(fn.apply(this, arguments)); - }; -} - -function _awaitAsyncGenerator(value) { - return new _AwaitValue(value); -} - -function _asyncGeneratorDelegate(inner, awaitWrap) { - var iter = {}, - waiting = false; - - function pump(key, value) { - waiting = true; - value = new Promise(function (resolve) { - resolve(inner[key](value)); - }); - return { - done: false, - value: awaitWrap(value) - }; - } - - ; - - if (typeof Symbol === "function" && Symbol.iterator) { - iter[Symbol.iterator] = function () { - return this; - }; - } - - iter.next = function (value) { - if (waiting) { - waiting = false; - return value; - } - - return pump("next", value); - }; - - if (typeof inner.throw === "function") { - iter.throw = function (value) { - if (waiting) { - waiting = false; - throw value; - } - - return pump("throw", value); - }; - } - - if (typeof inner.return === "function") { - iter.return = function (value) { - if (waiting) { - waiting = false; - return value; - } - - return pump("return", value); - }; - } - - return iter; -} - -function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { - try { - var info = gen[key](arg); - var value = info.value; - } catch (error) { - reject(error); - return; - } - - if (info.done) { - resolve(value); - } else { - Promise.resolve(value).then(_next, _throw); - } -} - -function _asyncToGenerator(fn) { - return function () { - var self = this, - args = arguments; - return new Promise(function (resolve, reject) { - var gen = fn.apply(self, args); - - function _next(value) { - asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value); - } - - function _throw(err) { - asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err); - } - - _next(undefined); - }); - }; -} - -function _classCallCheck(instance, Constructor) { - if (!(instance instanceof Constructor)) { - throw new TypeError("Cannot call a class as a function"); - } -} - -function _defineProperties(target, props) { - for (var i = 0; i < props.length; i++) { - var descriptor = props[i]; - descriptor.enumerable = descriptor.enumerable || false; - descriptor.configurable = true; - if ("value" in descriptor) descriptor.writable = true; - Object.defineProperty(target, descriptor.key, descriptor); - } -} - -function _createClass(Constructor, protoProps, staticProps) { - if (protoProps) _defineProperties(Constructor.prototype, protoProps); - if (staticProps) _defineProperties(Constructor, staticProps); - return Constructor; -} - -function _defineEnumerableProperties(obj, descs) { - for (var key in descs) { - var desc = descs[key]; - desc.configurable = desc.enumerable = true; - if ("value" in desc) desc.writable = true; - Object.defineProperty(obj, key, desc); - } - - if (Object.getOwnPropertySymbols) { - var objectSymbols = Object.getOwnPropertySymbols(descs); - - for (var i = 0; i < objectSymbols.length; i++) { - var sym = objectSymbols[i]; - var desc = descs[sym]; - desc.configurable = desc.enumerable = true; - if ("value" in desc) desc.writable = true; - Object.defineProperty(obj, sym, desc); - } - } - - return obj; -} - -function _defaults(obj, defaults) { - var keys = Object.getOwnPropertyNames(defaults); - - for (var i = 0; i < keys.length; i++) { - var key = keys[i]; - var value = Object.getOwnPropertyDescriptor(defaults, key); - - if (value && value.configurable && obj[key] === undefined) { - Object.defineProperty(obj, key, value); - } - } - - return obj; -} - -function _defineProperty(obj, key, value) { - if (key in obj) { - Object.defineProperty(obj, key, { - value: value, - enumerable: true, - configurable: true, - writable: true - }); - } else { - obj[key] = value; - } - - return obj; -} - -function _extends() { - _extends = Object.assign || function (target) { - for (var i = 1; i < arguments.length; i++) { - var source = arguments[i]; - - for (var key in source) { - if (Object.prototype.hasOwnProperty.call(source, key)) { - target[key] = source[key]; - } - } - } - - return target; - }; - - return _extends.apply(this, arguments); -} - -function _objectSpread(target) { - for (var i = 1; i < arguments.length; i++) { - var source = arguments[i] != null ? Object(arguments[i]) : {}; - var ownKeys = Object.keys(source); - - if (typeof Object.getOwnPropertySymbols === 'function') { - ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function (sym) { - return Object.getOwnPropertyDescriptor(source, sym).enumerable; - })); - } - - ownKeys.forEach(function (key) { - _defineProperty(target, key, source[key]); - }); - } - - return target; -} - -function ownKeys(object, enumerableOnly) { - var keys = Object.keys(object); - - if (Object.getOwnPropertySymbols) { - var symbols = Object.getOwnPropertySymbols(object); - if (enumerableOnly) symbols = symbols.filter(function (sym) { - return Object.getOwnPropertyDescriptor(object, sym).enumerable; - }); - keys.push.apply(keys, symbols); - } - - return keys; -} - -function _objectSpread2(target) { - for (var i = 1; i < arguments.length; i++) { - var source = arguments[i] != null ? arguments[i] : {}; - - if (i % 2) { - ownKeys(Object(source), true).forEach(function (key) { - _defineProperty(target, key, source[key]); - }); - } else if (Object.getOwnPropertyDescriptors) { - Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); - } else { - ownKeys(Object(source)).forEach(function (key) { - Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); - }); - } - } - - return target; -} - -function _inherits(subClass, superClass) { - if (typeof superClass !== "function" && superClass !== null) { - throw new TypeError("Super expression must either be null or a function"); - } - - subClass.prototype = Object.create(superClass && superClass.prototype, { - constructor: { - value: subClass, - writable: true, - configurable: true - } - }); - if (superClass) _setPrototypeOf(subClass, superClass); -} - -function _inheritsLoose(subClass, superClass) { - subClass.prototype = Object.create(superClass.prototype); - subClass.prototype.constructor = subClass; - subClass.__proto__ = superClass; -} - -function _getPrototypeOf(o) { - _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { - return o.__proto__ || Object.getPrototypeOf(o); - }; - return _getPrototypeOf(o); -} - -function _setPrototypeOf(o, p) { - _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { - o.__proto__ = p; - return o; - }; - - 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 _construct(Parent, args, Class) { - if (_isNativeReflectConstruct()) { - _construct = Reflect.construct; - } else { - _construct = function _construct(Parent, args, Class) { - var a = [null]; - a.push.apply(a, args); - var Constructor = Function.bind.apply(Parent, a); - var instance = new Constructor(); - if (Class) _setPrototypeOf(instance, Class.prototype); - return instance; - }; - } - - return _construct.apply(null, arguments); -} - -function _isNativeFunction(fn) { - return Function.toString.call(fn).indexOf("[native code]") !== -1; -} - -function _wrapNativeSuper(Class) { - var _cache = typeof Map === "function" ? new Map() : undefined; - - _wrapNativeSuper = function _wrapNativeSuper(Class) { - if (Class === null || !_isNativeFunction(Class)) return Class; - - if (typeof Class !== "function") { - throw new TypeError("Super expression must either be null or a function"); - } - - if (typeof _cache !== "undefined") { - if (_cache.has(Class)) return _cache.get(Class); - - _cache.set(Class, Wrapper); - } - - function Wrapper() { - return _construct(Class, arguments, _getPrototypeOf(this).constructor); - } - - Wrapper.prototype = Object.create(Class.prototype, { - constructor: { - value: Wrapper, - enumerable: false, - writable: true, - configurable: true - } - }); - return _setPrototypeOf(Wrapper, Class); - }; - - return _wrapNativeSuper(Class); -} - -function _instanceof(left, right) { - if (right != null && typeof Symbol !== "undefined" && right[Symbol.hasInstance]) { - return !!right[Symbol.hasInstance](left); - } else { - return left instanceof right; - } -} - -function _interopRequireDefault(obj) { - return obj && obj.__esModule ? obj : { - default: obj - }; -} - -function _getRequireWildcardCache() { - if (typeof WeakMap !== "function") return null; - var cache = new WeakMap(); - - _getRequireWildcardCache = function () { - return cache; - }; - - return cache; -} - -function _interopRequireWildcard(obj) { - if (obj && obj.__esModule) { - return obj; - } - - if (obj === null || typeof obj !== "object" && typeof obj !== "function") { - return { - default: obj - }; - } - - var cache = _getRequireWildcardCache(); - - if (cache && cache.has(obj)) { - return cache.get(obj); - } - - var newObj = {}; - var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; - - for (var key in obj) { - if (Object.prototype.hasOwnProperty.call(obj, key)) { - var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; - - if (desc && (desc.get || desc.set)) { - Object.defineProperty(newObj, key, desc); - } else { - newObj[key] = obj[key]; - } - } - } - - newObj.default = obj; - - if (cache) { - cache.set(obj, newObj); - } - - return newObj; -} - -function _newArrowCheck(innerThis, boundThis) { - if (innerThis !== boundThis) { - throw new TypeError("Cannot instantiate an arrow function"); - } -} - -function _objectDestructuringEmpty(obj) { - if (obj == null) throw new TypeError("Cannot destructure undefined"); -} - -function _objectWithoutPropertiesLoose(source, excluded) { - if (source == null) return {}; - var target = {}; - var sourceKeys = Object.keys(source); - var key, i; - - for (i = 0; i < sourceKeys.length; i++) { - key = sourceKeys[i]; - if (excluded.indexOf(key) >= 0) continue; - target[key] = source[key]; - } - - return target; -} - -function _objectWithoutProperties(source, excluded) { - if (source == null) return {}; - - var target = _objectWithoutPropertiesLoose(source, excluded); - - var key, i; - - if (Object.getOwnPropertySymbols) { - var sourceSymbolKeys = Object.getOwnPropertySymbols(source); - - for (i = 0; i < sourceSymbolKeys.length; i++) { - key = sourceSymbolKeys[i]; - if (excluded.indexOf(key) >= 0) continue; - if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; - target[key] = source[key]; - } - } - - return target; -} - -function _assertThisInitialized(self) { - if (self === void 0) { - throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); - } - - return self; -} - -function _possibleConstructorReturn(self, call) { - if (call && (typeof call === "object" || typeof call === "function")) { - return call; - } - - return _assertThisInitialized(self); -} - -function _createSuper(Derived) { - var hasNativeReflectConstruct = _isNativeReflectConstruct(); - - return function _createSuperInternal() { - var Super = _getPrototypeOf(Derived), - result; - - if (hasNativeReflectConstruct) { - 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); - if (object === null) break; - } - - return object; -} - -function _get(target, property, receiver) { - if (typeof Reflect !== "undefined" && Reflect.get) { - _get = Reflect.get; - } else { - _get = function _get(target, property, receiver) { - var base = _superPropBase(target, property); - - if (!base) return; - var desc = Object.getOwnPropertyDescriptor(base, property); - - if (desc.get) { - return desc.get.call(receiver); - } - - return desc.value; - }; - } - - return _get(target, property, receiver || target); -} - -function set(target, property, value, receiver) { - if (typeof Reflect !== "undefined" && Reflect.set) { - set = Reflect.set; - } else { - set = function set(target, property, value, receiver) { - var base = _superPropBase(target, property); - - var desc; - - if (base) { - desc = Object.getOwnPropertyDescriptor(base, property); - - if (desc.set) { - desc.set.call(receiver, value); - return true; - } else if (!desc.writable) { - return false; - } - } - - desc = Object.getOwnPropertyDescriptor(receiver, property); - - if (desc) { - if (!desc.writable) { - return false; - } - - desc.value = value; - Object.defineProperty(receiver, property, desc); - } else { - _defineProperty(receiver, property, value); - } - - return true; - }; - } - - return set(target, property, value, receiver); -} - -function _set(target, property, value, receiver, isStrict) { - var s = set(target, property, value, receiver || target); - - if (!s && isStrict) { - throw new Error('failed to set property'); - } - - return value; -} - -function _taggedTemplateLiteral(strings, raw) { - if (!raw) { - raw = strings.slice(0); - } - - return Object.freeze(Object.defineProperties(strings, { - raw: { - value: Object.freeze(raw) - } - })); -} - -function _taggedTemplateLiteralLoose(strings, raw) { - if (!raw) { - raw = strings.slice(0); - } - - strings.raw = raw; - return strings; -} - -function _readOnlyError(name) { - throw new Error("\"" + name + "\" is read-only"); -} - -function _classNameTDZError(name) { - throw new Error("Class \"" + name + "\" cannot be referenced in computed property keys."); -} - -function _temporalUndefined() {} - -function _tdz(name) { - throw new ReferenceError(name + " is not defined - temporal dead zone"); -} - -function _temporalRef(val, name) { - return val === _temporalUndefined ? _tdz(name) : val; -} - -function _slicedToArray(arr, i) { - return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); -} - -function _slicedToArrayLoose(arr, i) { - return _arrayWithHoles(arr) || _iterableToArrayLimitLoose(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); -} - -function _toArray(arr) { - return _arrayWithHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableRest(); -} - -function _toConsumableArray(arr) { - return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); -} - -function _arrayWithoutHoles(arr) { - if (Array.isArray(arr)) return _arrayLikeToArray(arr); -} - -function _arrayWithHoles(arr) { - if (Array.isArray(arr)) return arr; -} - -function _maybeArrayLike(next, arr, i) { - if (arr && !Array.isArray(arr) && typeof arr.length === "number") { - var len = arr.length; - return _arrayLikeToArray(arr, i !== void 0 && i < len ? i : len); - } - - return next(arr, i); -} - -function _iterableToArray(iter) { - if (typeof Symbol !== "undefined" && Symbol.iterator in Object(iter)) return Array.from(iter); -} - -function _iterableToArrayLimit(arr, i) { - if (typeof Symbol === "undefined" || !(Symbol.iterator in Object(arr))) return; - var _arr = []; - var _n = true; - var _d = false; - var _e = undefined; - - try { - for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { - _arr.push(_s.value); - - if (i && _arr.length === i) break; - } - } catch (err) { - _d = true; - _e = err; - } finally { - try { - if (!_n && _i["return"] != null) _i["return"](); - } finally { - if (_d) throw _e; - } - } - - return _arr; -} - -function _iterableToArrayLimitLoose(arr, i) { - if (typeof Symbol === "undefined" || !(Symbol.iterator in Object(arr))) return; - var _arr = []; - - for (var _iterator = arr[Symbol.iterator](), _step; !(_step = _iterator.next()).done;) { - _arr.push(_step.value); - - if (i && _arr.length === i) break; - } - - 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(o); - 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.\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.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); -} - -function _createForOfIteratorHelper(o, allowArrayLike) { - var it; - - if (typeof Symbol === "undefined" || o[Symbol.iterator] == null) { - if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") { - if (it) o = it; - 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 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; - } - } - }; -} - -function _createForOfIteratorHelperLoose(o, allowArrayLike) { - var it; - - if (typeof Symbol === "undefined" || o[Symbol.iterator] == null) { - if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") { - if (it) o = it; - var i = 0; - return function () { - if (i >= o.length) return { - done: true - }; - return { - done: false, - value: o[i++] - }; - }; - } - - throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); - } - - it = o[Symbol.iterator](); - return it.next.bind(it); -} - -function _skipFirstGeneratorNext(fn) { - return function () { - var it = fn.apply(this, arguments); - it.next(); - return it; - }; -} - -function _toPrimitive(input, hint) { - if (typeof input !== "object" || input === null) return input; - var prim = input[Symbol.toPrimitive]; - - if (prim !== undefined) { - var res = prim.call(input, hint || "default"); - if (typeof res !== "object") return res; - throw new TypeError("@@toPrimitive must return a primitive value."); - } - - return (hint === "string" ? String : Number)(input); -} - -function _toPropertyKey(arg) { - var key = _toPrimitive(arg, "string"); - - return typeof key === "symbol" ? key : String(key); -} - -function _initializerWarningHelper(descriptor, context) { - throw new Error('Decorating class property failed. Please ensure that ' + 'proposal-class-properties is enabled and runs after the decorators transform.'); -} - -function _initializerDefineProperty(target, property, descriptor, context) { - if (!descriptor) return; - Object.defineProperty(target, property, { - enumerable: descriptor.enumerable, - configurable: descriptor.configurable, - writable: descriptor.writable, - value: descriptor.initializer ? descriptor.initializer.call(context) : void 0 - }); -} - -function _applyDecoratedDescriptor(target, property, decorators, descriptor, context) { - var desc = {}; - Object.keys(descriptor).forEach(function (key) { - desc[key] = descriptor[key]; - }); - desc.enumerable = !!desc.enumerable; - desc.configurable = !!desc.configurable; - - if ('value' in desc || desc.initializer) { - desc.writable = true; - } - - desc = decorators.slice().reverse().reduce(function (desc, decorator) { - return decorator(target, property, desc) || desc; - }, desc); - - if (context && desc.initializer !== void 0) { - desc.value = desc.initializer ? desc.initializer.call(context) : void 0; - desc.initializer = undefined; - } - - if (desc.initializer === void 0) { - Object.defineProperty(target, property, desc); - desc = null; - } - - return desc; -} - -var id = 0; - -function _classPrivateFieldLooseKey(name) { - return "__private_" + id++ + "_" + name; -} - -function _classPrivateFieldLooseBase(receiver, privateKey) { - if (!Object.prototype.hasOwnProperty.call(receiver, privateKey)) { - throw new TypeError("attempted to use private field on non-instance"); - } - - return receiver; -} - -function _classPrivateFieldGet(receiver, privateMap) { - var descriptor = privateMap.get(receiver); - - if (!descriptor) { - throw new TypeError("attempted to get private field on non-instance"); - } - - if (descriptor.get) { - return descriptor.get.call(receiver); - } - - return descriptor.value; -} - -function _classPrivateFieldSet(receiver, privateMap, value) { - var descriptor = privateMap.get(receiver); - - if (!descriptor) { - throw new TypeError("attempted to set private field on non-instance"); - } - - if (descriptor.set) { - descriptor.set.call(receiver, value); - } else { - if (!descriptor.writable) { - throw new TypeError("attempted to set read only private field"); - } - - descriptor.value = value; - } - - return value; -} - -function _classPrivateFieldDestructureSet(receiver, privateMap) { - if (!privateMap.has(receiver)) { - throw new TypeError("attempted to set private field on non-instance"); - } - - var descriptor = privateMap.get(receiver); - - if (descriptor.set) { - if (!("__destrObj" in descriptor)) { - descriptor.__destrObj = { - set value(v) { - descriptor.set.call(receiver, v); - } - - }; - } - - return descriptor.__destrObj; - } else { - if (!descriptor.writable) { - throw new TypeError("attempted to set read only private field"); - } - - return descriptor; - } -} - -function _classStaticPrivateFieldSpecGet(receiver, classConstructor, descriptor) { - if (receiver !== classConstructor) { - throw new TypeError("Private static access of wrong provenance"); - } - - if (descriptor.get) { - return descriptor.get.call(receiver); - } - - return descriptor.value; -} - -function _classStaticPrivateFieldSpecSet(receiver, classConstructor, descriptor, value) { - if (receiver !== classConstructor) { - throw new TypeError("Private static access of wrong provenance"); - } - - if (descriptor.set) { - descriptor.set.call(receiver, value); - } else { - if (!descriptor.writable) { - throw new TypeError("attempted to set read only private field"); - } - - descriptor.value = value; - } - - return value; -} - -function _classStaticPrivateMethodGet(receiver, classConstructor, method) { - if (receiver !== classConstructor) { - throw new TypeError("Private static access of wrong provenance"); - } - - return method; -} - -function _classStaticPrivateMethodSet() { - throw new TypeError("attempted to set read only static private field"); -} - -function _decorate(decorators, factory, superClass, mixins) { - var api = _getDecoratorsApi(); - - if (mixins) { - for (var i = 0; i < mixins.length; i++) { - api = mixins[i](api); - } - } - - var r = factory(function initialize(O) { - api.initializeInstanceElements(O, decorated.elements); - }, superClass); - var decorated = api.decorateClass(_coalesceClassElements(r.d.map(_createElementDescriptor)), decorators); - api.initializeClassElements(r.F, decorated.elements); - return api.runClassFinishers(r.F, decorated.finishers); -} - -function _getDecoratorsApi() { - _getDecoratorsApi = function () { - return api; - }; - - var api = { - elementsDefinitionOrder: [["method"], ["field"]], - initializeInstanceElements: function (O, elements) { - ["method", "field"].forEach(function (kind) { - elements.forEach(function (element) { - if (element.kind === kind && element.placement === "own") { - this.defineClassElement(O, element); - } - }, this); - }, this); - }, - initializeClassElements: function (F, elements) { - var proto = F.prototype; - ["method", "field"].forEach(function (kind) { - elements.forEach(function (element) { - var placement = element.placement; - - if (element.kind === kind && (placement === "static" || placement === "prototype")) { - var receiver = placement === "static" ? F : proto; - this.defineClassElement(receiver, element); - } - }, this); - }, this); - }, - defineClassElement: function (receiver, element) { - var descriptor = element.descriptor; - - if (element.kind === "field") { - var initializer = element.initializer; - descriptor = { - enumerable: descriptor.enumerable, - writable: descriptor.writable, - configurable: descriptor.configurable, - value: initializer === void 0 ? void 0 : initializer.call(receiver) - }; - } - - Object.defineProperty(receiver, element.key, descriptor); - }, - decorateClass: function (elements, decorators) { - var newElements = []; - var finishers = []; - var placements = { - static: [], - prototype: [], - own: [] - }; - elements.forEach(function (element) { - this.addElementPlacement(element, placements); - }, this); - elements.forEach(function (element) { - if (!_hasDecorators(element)) return newElements.push(element); - var elementFinishersExtras = this.decorateElement(element, placements); - newElements.push(elementFinishersExtras.element); - newElements.push.apply(newElements, elementFinishersExtras.extras); - finishers.push.apply(finishers, elementFinishersExtras.finishers); - }, this); - - if (!decorators) { - return { - elements: newElements, - finishers: finishers - }; - } - - var result = this.decorateConstructor(newElements, decorators); - finishers.push.apply(finishers, result.finishers); - result.finishers = finishers; - return result; - }, - addElementPlacement: function (element, placements, silent) { - var keys = placements[element.placement]; - - if (!silent && keys.indexOf(element.key) !== -1) { - throw new TypeError("Duplicated element (" + element.key + ")"); - } - - keys.push(element.key); - }, - decorateElement: function (element, placements) { - var extras = []; - var finishers = []; - - for (var decorators = element.decorators, i = decorators.length - 1; i >= 0; i--) { - var keys = placements[element.placement]; - keys.splice(keys.indexOf(element.key), 1); - var elementObject = this.fromElementDescriptor(element); - var elementFinisherExtras = this.toElementFinisherExtras((0, decorators[i])(elementObject) || elementObject); - element = elementFinisherExtras.element; - this.addElementPlacement(element, placements); - - if (elementFinisherExtras.finisher) { - finishers.push(elementFinisherExtras.finisher); - } - - var newExtras = elementFinisherExtras.extras; - - if (newExtras) { - for (var j = 0; j < newExtras.length; j++) { - this.addElementPlacement(newExtras[j], placements); - } - - extras.push.apply(extras, newExtras); - } - } - - return { - element: element, - finishers: finishers, - extras: extras - }; - }, - decorateConstructor: function (elements, decorators) { - var finishers = []; - - for (var i = decorators.length - 1; i >= 0; i--) { - var obj = this.fromClassDescriptor(elements); - var elementsAndFinisher = this.toClassDescriptor((0, decorators[i])(obj) || obj); - - if (elementsAndFinisher.finisher !== undefined) { - finishers.push(elementsAndFinisher.finisher); - } - - if (elementsAndFinisher.elements !== undefined) { - elements = elementsAndFinisher.elements; - - for (var j = 0; j < elements.length - 1; j++) { - for (var k = j + 1; k < elements.length; k++) { - if (elements[j].key === elements[k].key && elements[j].placement === elements[k].placement) { - throw new TypeError("Duplicated element (" + elements[j].key + ")"); - } - } - } - } - } - - return { - elements: elements, - finishers: finishers - }; - }, - fromElementDescriptor: function (element) { - var obj = { - kind: element.kind, - key: element.key, - placement: element.placement, - descriptor: element.descriptor - }; - var desc = { - value: "Descriptor", - configurable: true - }; - Object.defineProperty(obj, Symbol.toStringTag, desc); - if (element.kind === "field") obj.initializer = element.initializer; - return obj; - }, - toElementDescriptors: function (elementObjects) { - if (elementObjects === undefined) return; - return _toArray(elementObjects).map(function (elementObject) { - var element = this.toElementDescriptor(elementObject); - this.disallowProperty(elementObject, "finisher", "An element descriptor"); - this.disallowProperty(elementObject, "extras", "An element descriptor"); - return element; - }, this); - }, - toElementDescriptor: function (elementObject) { - var kind = String(elementObject.kind); - - if (kind !== "method" && kind !== "field") { - throw new TypeError('An element descriptor\'s .kind property must be either "method" or' + ' "field", but a decorator created an element descriptor with' + ' .kind "' + kind + '"'); - } - - var key = _toPropertyKey(elementObject.key); - - var placement = String(elementObject.placement); - - if (placement !== "static" && placement !== "prototype" && placement !== "own") { - throw new TypeError('An element descriptor\'s .placement property must be one of "static",' + ' "prototype" or "own", but a decorator created an element descriptor' + ' with .placement "' + placement + '"'); - } - - var descriptor = elementObject.descriptor; - this.disallowProperty(elementObject, "elements", "An element descriptor"); - var element = { - kind: kind, - key: key, - placement: placement, - descriptor: Object.assign({}, descriptor) - }; - - if (kind !== "field") { - this.disallowProperty(elementObject, "initializer", "A method descriptor"); - } else { - this.disallowProperty(descriptor, "get", "The property descriptor of a field descriptor"); - this.disallowProperty(descriptor, "set", "The property descriptor of a field descriptor"); - this.disallowProperty(descriptor, "value", "The property descriptor of a field descriptor"); - element.initializer = elementObject.initializer; - } - - return element; - }, - toElementFinisherExtras: function (elementObject) { - var element = this.toElementDescriptor(elementObject); - - var finisher = _optionalCallableProperty(elementObject, "finisher"); - - var extras = this.toElementDescriptors(elementObject.extras); - return { - element: element, - finisher: finisher, - extras: extras - }; - }, - fromClassDescriptor: function (elements) { - var obj = { - kind: "class", - elements: elements.map(this.fromElementDescriptor, this) - }; - var desc = { - value: "Descriptor", - configurable: true - }; - Object.defineProperty(obj, Symbol.toStringTag, desc); - return obj; - }, - toClassDescriptor: function (obj) { - var kind = String(obj.kind); - - if (kind !== "class") { - throw new TypeError('A class descriptor\'s .kind property must be "class", but a decorator' + ' created a class descriptor with .kind "' + kind + '"'); - } - - this.disallowProperty(obj, "key", "A class descriptor"); - this.disallowProperty(obj, "placement", "A class descriptor"); - this.disallowProperty(obj, "descriptor", "A class descriptor"); - this.disallowProperty(obj, "initializer", "A class descriptor"); - this.disallowProperty(obj, "extras", "A class descriptor"); - - var finisher = _optionalCallableProperty(obj, "finisher"); - - var elements = this.toElementDescriptors(obj.elements); - return { - elements: elements, - finisher: finisher - }; - }, - runClassFinishers: function (constructor, finishers) { - for (var i = 0; i < finishers.length; i++) { - var newConstructor = (0, finishers[i])(constructor); - - if (newConstructor !== undefined) { - if (typeof newConstructor !== "function") { - throw new TypeError("Finishers must return a constructor."); - } - - constructor = newConstructor; - } - } - - return constructor; - }, - disallowProperty: function (obj, name, objectType) { - if (obj[name] !== undefined) { - throw new TypeError(objectType + " can't have a ." + name + " property."); - } - } - }; - return api; -} - -function _createElementDescriptor(def) { - var key = _toPropertyKey(def.key); - - var descriptor; - - if (def.kind === "method") { - descriptor = { - value: def.value, - writable: true, - configurable: true, - enumerable: false - }; - } else if (def.kind === "get") { - descriptor = { - get: def.value, - configurable: true, - enumerable: false - }; - } else if (def.kind === "set") { - descriptor = { - set: def.value, - configurable: true, - enumerable: false - }; - } else if (def.kind === "field") { - descriptor = { - configurable: true, - writable: true, - enumerable: true - }; - } - - var element = { - kind: def.kind === "field" ? "field" : "method", - key: key, - placement: def.static ? "static" : def.kind === "field" ? "own" : "prototype", - descriptor: descriptor - }; - if (def.decorators) element.decorators = def.decorators; - if (def.kind === "field") element.initializer = def.value; - return element; -} - -function _coalesceGetterSetter(element, other) { - if (element.descriptor.get !== undefined) { - other.descriptor.get = element.descriptor.get; - } else { - other.descriptor.set = element.descriptor.set; - } -} - -function _coalesceClassElements(elements) { - var newElements = []; - - var isSameElement = function (other) { - return other.kind === "method" && other.key === element.key && other.placement === element.placement; - }; - - for (var i = 0; i < elements.length; i++) { - var element = elements[i]; - var other; - - if (element.kind === "method" && (other = newElements.find(isSameElement))) { - if (_isDataDescriptor(element.descriptor) || _isDataDescriptor(other.descriptor)) { - if (_hasDecorators(element) || _hasDecorators(other)) { - throw new ReferenceError("Duplicated methods (" + element.key + ") can't be decorated."); - } - - other.descriptor = element.descriptor; - } else { - if (_hasDecorators(element)) { - if (_hasDecorators(other)) { - throw new ReferenceError("Decorators can't be placed on different accessors with for " + "the same property (" + element.key + ")."); - } - - other.decorators = element.decorators; - } - - _coalesceGetterSetter(element, other); - } - } else { - newElements.push(element); - } - } - - return newElements; -} - -function _hasDecorators(element) { - return element.decorators && element.decorators.length; -} - -function _isDataDescriptor(desc) { - return desc !== undefined && !(desc.value === undefined && desc.writable === undefined); -} - -function _optionalCallableProperty(obj, name) { - var value = obj[name]; - - if (value !== undefined && typeof value !== "function") { - throw new TypeError("Expected '" + name + "' to be a function"); - } - - return value; -} - -function _classPrivateMethodGet(receiver, privateSet, fn) { - if (!privateSet.has(receiver)) { - throw new TypeError("attempted to get private field on non-instance"); - } - - return fn; -} - -function _classPrivateMethodSet() { - throw new TypeError("attempted to reassign private method"); -} - -function _wrapRegExp(re, groups) { - _wrapRegExp = function (re, groups) { - return new BabelRegExp(re, undefined, groups); - }; - - var _RegExp = _wrapNativeSuper(RegExp); - - var _super = RegExp.prototype; - - var _groups = new WeakMap(); - - function BabelRegExp(re, flags, groups) { - var _this = _RegExp.call(this, re, flags); - - _groups.set(_this, groups || _groups.get(re)); - - return _this; - } - - _inherits(BabelRegExp, _RegExp); - - BabelRegExp.prototype.exec = function (str) { - var result = _super.exec.call(this, str); - - if (result) result.groups = buildGroups(result, this); - return result; - }; - - BabelRegExp.prototype[Symbol.replace] = function (str, substitution) { - if (typeof substitution === "string") { - var groups = _groups.get(this); - - return _super[Symbol.replace].call(this, str, substitution.replace(/\$<([^>]+)>/g, function (_, name) { - return "$" + groups[name]; - })); - } else if (typeof substitution === "function") { - var _this = this; - - return _super[Symbol.replace].call(this, str, function () { - var args = []; - args.push.apply(args, arguments); - - if (typeof args[args.length - 1] !== "object") { - args.push(buildGroups(args, _this)); - } - - return substitution.apply(this, args); - }); - } else { - return _super[Symbol.replace].call(this, str, substitution); - } - }; - - function buildGroups(result, re) { - var g = _groups.get(re); - - return Object.keys(g).reduce(function (groups, name) { - groups[name] = result[g[name]]; - return groups; - }, Object.create(null)); - } - - return _wrapRegExp.apply(this, arguments); -} - +function _AwaitValue(t){this.wrapped=t}function _AsyncGenerator(t){var e,r;function resume(e,r){try{var n=t[e](r),o=n.value,a=o instanceof _AwaitValue;Promise.resolve(a?o.wrapped:o).then((function(t){a?resume("return"===e?"return":"next",t):settle(n.done?"return":"normal",t)}),(function(t){resume("throw",t)}))}catch(t){settle("throw",t)}}function settle(t,n){switch(t){case"return":e.resolve({value:n,done:!0});break;case"throw":e.reject(n);break;default:e.resolve({value:n,done:!1})}(e=e.next)?resume(e.key,e.arg):r=null}this._invoke=function send(t,n){return new Promise((function(o,a){var i={key:t,arg:n,resolve:o,reject:a,next:null};r?r=r.next=i:(e=r=i,resume(t,n))}))},"function"!=typeof t.return&&(this.return=void 0)}function asyncGeneratorStep(t,e,r,n,o,a,i){try{var s=t[a](i),c=s.value}catch(t){return void r(t)}s.done?e(c):Promise.resolve(c).then(n,o)}"function"==typeof Symbol&&Symbol.asyncIterator&&(_AsyncGenerator.prototype[Symbol.asyncIterator]=function(){return this}),_AsyncGenerator.prototype.next=function(t){return this._invoke("next",t)},_AsyncGenerator.prototype.throw=function(t){return this._invoke("throw",t)},_AsyncGenerator.prototype.return=function(t){return this._invoke("return",t)}; /** * @file ext-connector.js * @@ -1654,647 +7,5 @@ function _wrapRegExp(re, groups) { * @copyright 2010 Alexis Deveria * */ -var extConnector = { - name: 'connector', - init: function init(S) { - var _this = this; - - return _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee() { - var svgEditor, svgCanvas, getElem, $, svgroot, importLocale, addElem, selManager, connSel, elData, strings, startX, startY, curLine, startElem, endElem, seNs, svgcontent, started, connections, selElems, getBBintersect, getOffset, showPanel, setPoint, updateLine, findConnectors, updateConnectors, init, buttons; - return regeneratorRuntime.wrap(function _callee$(_context) { - while (1) { - switch (_context.prev = _context.next) { - case 0: - init = function _init() { - // Make sure all connectors have data set - $(svgcontent).find('*').each(function () { - var conn = this.getAttributeNS(seNs, 'connector'); - - if (conn) { - this.setAttribute('class', connSel.substr(1)); - var connData = conn.split(' '); - var sbb = svgCanvas.getStrokedBBox([getElem(connData[0])]); - var ebb = svgCanvas.getStrokedBBox([getElem(connData[1])]); - $(this).data('c_start', connData[0]).data('c_end', connData[1]).data('start_bb', sbb).data('end_bb', ebb); - svgCanvas.getEditorNS(true); - } - }); // updateConnectors(); - }; - - 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. - findConnectors(elems); - - if (connections.length) { - // Update line with element - var i = connections.length; - - while (i--) { - var conn = connections[i]; - var line = conn.connector; - var elem = conn.elem; // const sw = line.getAttribute('stroke-width') * 5; - - var pre = conn.is_start ? 'start' : 'end'; // Update bbox for this element - - var bb = svgCanvas.getStrokedBBox([elem]); - bb.x = conn.start_x; - bb.y = conn.start_y; - elData(line, pre + '_bb', bb); - /* const addOffset = */ - - elData(line, pre + '_off'); - var altPre = conn.is_start ? 'end' : 'start'; // Get center pt of connected element - - var bb2 = elData(line, altPre + '_bb'); - var srcX = bb2.x + bb2.width / 2; - var srcY = bb2.y + bb2.height / 2; // Set point of element being moved - - var pt = getBBintersect(srcX, srcY, bb, getOffset(pre, line)); - setPoint(line, conn.is_start ? 0 : 'end', pt.x, pt.y, true); // Set point of connected element - - var pt2 = getBBintersect(pt.x, pt.y, elData(line, altPre + '_bb'), getOffset(altPre, line)); - setPoint(line, conn.is_start ? 'end' : 0, pt2.x, pt2.y, true); // Update points attribute manually for webkit - - if (navigator.userAgent.includes('AppleWebKit')) { - var pts = line.points; - var len = pts.numberOfItems; - var ptArr = []; - - for (var j = 0; j < len; j++) { - pt = pts.getItem(j); - ptArr[j] = pt.x + ',' + pt.y; - } - - line.setAttribute('points', ptArr.join(' ')); - } - } - } - }; - - 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 - - connectors.each(function () { - var addThis; - /** - * - * @returns {void} - */ - - function add() { - if (elems.includes(this)) { - // Pretend this element is selected - addThis = true; - } - } // Grab the ends - - - var parts = []; - ['start', 'end'].forEach(function (pos, i) { - var key = 'c_' + pos; - var part = elData(this, key); - - if (part === null || part === undefined) { - // Does this ever return nullish values? - part = document.getElementById(this.attributes['se:connector'].value.split(' ')[i]); - elData(this, 'c_' + pos, part.id); - elData(this, pos + '_bb', svgCanvas.getStrokedBBox([part])); - } else part = document.getElementById(part); - - parts.push(part); - }, this); - - for (var i = 0; i < 2; i++) { - var cElem = parts[i]; - addThis = false; // The connected element might be part of a selected group - - $(cElem).parents().each(add); - - if (!cElem || !cElem.parentNode) { - $(this).remove(); - continue; - } - - if (elems.includes(cElem) || addThis) { - var bb = svgCanvas.getStrokedBBox([cElem]); - connections.push({ - elem: cElem, - connector: this, - is_start: i === 0, - start_x: bb.x, - start_y: bb.y - }); - } - } - }); - }; - - updateLine = function _updateLine(diffX, diffY) { - // Update line with element - var i = connections.length; - - while (i--) { - var conn = connections[i]; - var line = conn.connector; // const {elem} = conn; - - var pre = conn.is_start ? 'start' : 'end'; // const sw = line.getAttribute('stroke-width') * 5; - // Update bbox for this element - - var bb = elData(line, pre + '_bb'); - bb.x = conn.start_x + diffX; - bb.y = conn.start_y + diffY; - elData(line, pre + '_bb', bb); - var altPre = conn.is_start ? 'end' : 'start'; // Get center pt of connected element - - var bb2 = elData(line, altPre + '_bb'); - var srcX = bb2.x + bb2.width / 2; - var srcY = bb2.y + bb2.height / 2; // Set point of element being moved - - var pt = getBBintersect(srcX, srcY, bb, getOffset(pre, line)); // $(line).data(pre+'_off')?sw:0 - - setPoint(line, conn.is_start ? 0 : 'end', pt.x, pt.y, true); // Set point of connected element - - var pt2 = getBBintersect(pt.x, pt.y, elData(line, altPre + '_bb'), getOffset(altPre, line)); - setPoint(line, conn.is_start ? 'end' : 0, pt2.x, pt2.y, true); - } - }; - - setPoint = function _setPoint(elem, pos, x, y, setMid) { - var pts = elem.points; - var pt = svgroot.createSVGPoint(); - pt.x = x; - pt.y = y; - - if (pos === 'end') { - pos = pts.numberOfItems - 1; - } // TODO: Test for this on init, then use alt only if needed - - - try { - pts.replaceItem(pt, pos); - } catch (err) { - // Should only occur in FF which formats points attr as "n,n n,n", so just split - var ptArr = elem.getAttribute('points').split(' '); - - for (var i = 0; i < ptArr.length; i++) { - if (i === pos) { - ptArr[i] = x + ',' + y; - } - } - - elem.setAttribute('points', ptArr.join(' ')); - } - - if (setMid) { - // Add center point - var ptStart = pts.getItem(0); - var ptEnd = pts.getItem(pts.numberOfItems - 1); - setPoint(elem, 1, (ptEnd.x + ptStart.x) / 2, (ptEnd.y + ptStart.y) / 2); - } - }; - - showPanel = function _showPanel(on) { - var connRules = $('#connector_rules'); - - if (!connRules.length) { - connRules = $('').appendTo('head'); - } - - connRules.text(!on ? '' : '#tool_clone, #tool_topath, #tool_angle, #xy_panel { display: none !important; }'); - $('#connector_panel').toggle(on); - }; - - 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 - - var size = line.getAttribute('stroke-width') * 5; - return giveOffset ? size : 0; - }; - - getBBintersect = function _getBBintersect(x, y, bb, offset) { - if (offset) { - offset -= 0; - bb = $.extend({}, bb); - bb.width += offset; - bb.height += offset; - bb.x -= offset / 2; - bb.y -= offset / 2; - } - - var midX = bb.x + bb.width / 2; - var midY = bb.y + bb.height / 2; - var lenX = x - midX; - var lenY = y - midY; - var slope = Math.abs(lenY / lenX); - var ratio; - - if (slope < bb.height / bb.width) { - ratio = bb.width / 2 / Math.abs(lenX); - } else { - ratio = lenY ? bb.height / 2 / Math.abs(lenY) : 0; - } - - return { - x: midX + lenX * ratio, - y: midY + lenY * ratio - }; - }; - - svgEditor = _this; - svgCanvas = svgEditor.canvas; - getElem = svgCanvas.getElem; - $ = S.$, svgroot = S.svgroot, importLocale = S.importLocale, addElem = svgCanvas.addSVGElementFromJson, selManager = S.selectorManager, connSel = '.se_connector', elData = $.data; - _context.next = 14; - return importLocale(); - - case 14: - strings = _context.sent; - svgcontent = S.svgcontent, started = false, connections = [], selElems = []; - /** - * - * @param {Float} x - * @param {Float} y - * @param {module:utilities.BBoxObject} bb - * @param {Float} offset - * @returns {module:math.XYObject} - */ - - // Do once - (function () { - var gse = svgCanvas.groupSelectedElements; - - svgCanvas.groupSelectedElements = function () { - svgCanvas.removeFromSelection($(connSel).toArray()); - - for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) { - args[_key] = arguments[_key]; - } - - return gse.apply(this, args); - }; - - var mse = svgCanvas.moveSelectedElements; - - svgCanvas.moveSelectedElements = function () { - for (var _len2 = arguments.length, args = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) { - args[_key2] = arguments[_key2]; - } - - var cmd = mse.apply(this, args); - updateConnectors(); - return cmd; - }; - - seNs = svgCanvas.getEditorNS(); - })(); - /** - * Do on reset. - * @returns {void} - */ - - - // $(svgroot).parent().mousemove(function (e) { - // // if (started - // // || svgCanvas.getMode() !== 'connector' - // // || e.target.parentNode.parentNode !== svgcontent) return; - // - // console.log('y') - // // if (e.target.parentNode.parentNode === svgcontent) { - // // - // // } - // }); - buttons = [{ - id: 'mode_connect', - type: 'mode', - icon: svgEditor.curConfig.imgPath + 'cut.png', - includeWith: { - button: '#tool_line', - isDefault: false, - position: 1 - }, - events: { - click: function click() { - svgCanvas.setMode('connector'); - } - } - }]; - return _context.abrupt("return", { - name: strings.name, - svgicons: 'conn.svg', - buttons: strings.buttons.map(function (button, i) { - return Object.assign(buttons[i], button); - }), - - /* async */ - addLangData: function addLangData(_ref) { - var lang = _ref.lang; - // , importLocale: importLoc - return { - data: strings.langList - }; - }, - mouseDown: function mouseDown(opts) { - var e = opts.event; - startX = opts.start_x; - startY = opts.start_y; - var mode = svgCanvas.getMode(); - var initStroke = svgEditor.curConfig.initStroke; - - if (mode === 'connector') { - if (started) { - return undefined; - } - - var mouseTarget = e.target; - var parents = $(mouseTarget).parents(); - - if ($.inArray(svgcontent, parents) !== -1) { - // Connectable element - // If child of foreignObject, use parent - var fo = $(mouseTarget).closest('foreignObject'); - startElem = fo.length ? fo[0] : mouseTarget; // Get center of source element - - var bb = svgCanvas.getStrokedBBox([startElem]); - var x = bb.x + bb.width / 2; - var y = bb.y + bb.height / 2; - started = true; - curLine = addElem({ - element: 'polyline', - attr: { - id: svgCanvas.getNextId(), - points: x + ',' + y + ' ' + x + ',' + y + ' ' + startX + ',' + startY, - stroke: '#' + initStroke.color, - 'stroke-width': !startElem.stroke_width || startElem.stroke_width === 0 ? initStroke.width : startElem.stroke_width, - fill: 'none', - opacity: initStroke.opacity, - style: 'pointer-events:none' - } - }); - elData(curLine, 'start_bb', bb); - } - - return { - started: true - }; - } - - if (mode === 'select') { - findConnectors(); - } - - return undefined; - }, - mouseMove: function mouseMove(opts) { - var zoom = svgCanvas.getZoom(); // const e = opts.event; - - var x = opts.mouse_x / zoom; - var y = opts.mouse_y / zoom; - var diffX = x - startX, - diffY = y - startY; - var mode = svgCanvas.getMode(); - - if (mode === 'connector' && started) { - // const sw = curLine.getAttribute('stroke-width') * 3; - // Set start point (adjusts based on bb) - var pt = getBBintersect(x, y, elData(curLine, 'start_bb'), getOffset('start', curLine)); - startX = pt.x; - startY = pt.y; - setPoint(curLine, 0, pt.x, pt.y, true); // Set end point - - setPoint(curLine, 'end', x, y, true); - } else if (mode === 'select') { - var slen = selElems.length; - - while (slen--) { - var elem = selElems[slen]; // Look for selected connector elements - - if (elem && elData(elem, 'c_start')) { - // Remove the "translate" transform given to move - svgCanvas.removeFromSelection([elem]); - svgCanvas.getTransformList(elem).clear(); - } - } - - if (connections.length) { - updateLine(diffX, diffY); - } - } - }, - mouseUp: function mouseUp(opts) { - // const zoom = svgCanvas.getZoom(); - var e = opts.event; // , x = opts.mouse_x / zoom, - // , y = opts.mouse_y / zoom, - - var mouseTarget = e.target; - - if (svgCanvas.getMode() !== 'connector') { - return undefined; - } - - var fo = $(mouseTarget).closest('foreignObject'); - - if (fo.length) { - mouseTarget = fo[0]; - } - - var parents = $(mouseTarget).parents(); - - if (mouseTarget === startElem) { - // Start line through click - started = true; - return { - keep: true, - element: null, - started: started - }; - } - - if ($.inArray(svgcontent, parents) === -1) { - // Not a valid target element, so remove line - $(curLine).remove(); - started = false; - return { - keep: false, - element: null, - started: started - }; - } // Valid end element - - - endElem = mouseTarget; - var startId = startElem.id, - endId = endElem.id; - var connStr = startId + ' ' + endId; - var altStr = endId + ' ' + startId; // Don't create connector if one already exists - - var dupe = $(svgcontent).find(connSel).filter(function () { - var conn = this.getAttributeNS(seNs, 'connector'); - - if (conn === connStr || conn === altStr) { - return true; - } - - return false; - }); - - if (dupe.length) { - $(curLine).remove(); - return { - keep: false, - element: null, - started: false - }; - } - - var bb = svgCanvas.getStrokedBBox([endElem]); - var pt = getBBintersect(startX, startY, bb, getOffset('start', curLine)); - setPoint(curLine, 'end', pt.x, pt.y, true); - $(curLine).data('c_start', startId).data('c_end', endId).data('end_bb', bb); - seNs = svgCanvas.getEditorNS(true); - curLine.setAttributeNS(seNs, 'se:connector', connStr); - curLine.setAttribute('class', connSel.substr(1)); - curLine.setAttribute('opacity', 1); - svgCanvas.addToSelection([curLine]); - svgCanvas.moveToBottomSelectedElement(); - selManager.requestSelector(curLine).showGrips(false); - started = false; - return { - keep: true, - element: curLine, - started: started - }; - }, - selectedChanged: function selectedChanged(opts) { - // TODO: Find better way to skip operations if no connectors are in use - if (!$(svgcontent).find(connSel).length) { - return; - } - - if (svgCanvas.getMode() === 'connector') { - svgCanvas.setMode('select'); - } // Use this to update the current selected elements - - - selElems = opts.elems; - var i = selElems.length; - - while (i--) { - var elem = selElems[i]; - - if (elem && elData(elem, 'c_start')) { - selManager.requestSelector(elem).showGrips(false); - - if (opts.selectedElement && !opts.multiselected) { - // TODO: Set up context tools and hide most regular line tools - showPanel(true); - } else { - showPanel(false); - } - } else { - showPanel(false); - } - } - - updateConnectors(); - }, - elementChanged: function elementChanged(opts) { - var elem = opts.elems[0]; - if (!elem) return; - - if (elem.tagName === 'svg' && elem.id === 'svgcontent') { - // Update svgcontent (can change on import) - svgcontent = elem; - init(); - } // Has marker, so change offset - - - if (elem.getAttribute('marker-start') || elem.getAttribute('marker-mid') || elem.getAttribute('marker-end')) { - var start = elem.getAttribute('marker-start'); - var mid = elem.getAttribute('marker-mid'); - var end = elem.getAttribute('marker-end'); - curLine = elem; - $(elem).data('start_off', Boolean(start)).data('end_off', Boolean(end)); - - if (elem.tagName === 'line' && mid) { - // Convert to polyline to accept mid-arrow - var x1 = Number(elem.getAttribute('x1')); - var x2 = Number(elem.getAttribute('x2')); - var y1 = Number(elem.getAttribute('y1')); - var y2 = Number(elem.getAttribute('y2')); - var _elem = elem, - id = _elem.id; - var midPt = ' ' + (x1 + x2) / 2 + ',' + (y1 + y2) / 2 + ' '; - var pline = addElem({ - element: 'polyline', - attr: { - points: x1 + ',' + y1 + midPt + x2 + ',' + y2, - stroke: elem.getAttribute('stroke'), - 'stroke-width': elem.getAttribute('stroke-width'), - 'marker-mid': mid, - fill: 'none', - opacity: elem.getAttribute('opacity') || 1 - } - }); - $(elem).after(pline).remove(); - svgCanvas.clearSelection(); - pline.id = id; - svgCanvas.addToSelection([pline]); - elem = pline; - } - } // Update line if it's a connector - - - if (elem.getAttribute('class') === connSel.substr(1)) { - var _start = getElem(elData(elem, 'c_start')); - - updateConnectors([_start]); - } else { - updateConnectors(); - } - }, - IDsUpdated: function IDsUpdated(input) { - var remove = []; - input.elems.forEach(function (elem) { - if ('se:connector' in elem.attr) { - elem.attr['se:connector'] = elem.attr['se:connector'].split(' ').map(function (oldID) { - return input.changes[oldID]; - }).join(' '); // Check validity - the field would be something like 'svg_21 svg_22', but - // if one end is missing, it would be 'svg_21' and therefore fail this test - - if (!/. ./.test(elem.attr['se:connector'])) { - remove.push(elem.attr.id); - } - } - }); - return { - remove: remove - }; - }, - toolButtonStateUpdate: function toolButtonStateUpdate(opts) { - if (opts.nostroke) { - if ($('#mode_connect').hasClass('tool_button_current')) { - svgEditor.clickSelect(); - } - } - - $('#mode_connect').toggleClass('disabled', opts.nostroke); - } - }); - - case 19: - case "end": - return _context.stop(); - } - } - }, _callee); - }))(); - } -}; - -export default extConnector; +var t={name:"connector",init:function init(t){var e=this;return function _asyncToGenerator(t){return function(){var e=this,r=arguments;return new Promise((function(n,o){var a=t.apply(e,r);function _next(t){asyncGeneratorStep(a,n,o,_next,_throw,"next",t)}function _throw(t){asyncGeneratorStep(a,n,o,_next,_throw,"throw",t)}_next(void 0)}))}}(regeneratorRuntime.mark((function _callee(){var r,n,o,a,i,s,c,u,l,d,f,h,g,m,v,_,p,b,y,x,k,w,A,S,B,E,I,N,G,M;return regeneratorRuntime.wrap((function _callee$(C){for(;;)switch(C.prev=C.next){case 0:return G=function _init(){a(b).find("*").each((function(){var t=this.getAttributeNS(p,"connector");if(t){this.setAttribute("class",l.substr(1));var e=t.split(" "),r=n.getStrokedBBox([o(e[0])]),i=n.getStrokedBBox([o(e[1])]);a(this).data("c_start",e[0]).data("c_end",e[1]).data("start_bb",r).data("end_bb",i),n.getEditorNS(!0)}}))},N=function _updateConnectors(t){if(I(t),x.length)for(var e=x.length;e--;){var r=x[e],o=r.connector,a=r.elem,i=r.is_start?"start":"end",s=n.getStrokedBBox([a]);s.x=r.start_x,s.y=r.start_y,d(o,i+"_bb",s),d(o,i+"_off");var c=r.is_start?"end":"start",u=d(o,c+"_bb"),l=u.x+u.width/2,f=u.y+u.height/2,h=w(l,f,s,A(i,o));B(o,r.is_start?0:"end",h.x,h.y,!0);var g=w(h.x,h.y,d(o,c+"_bb"),A(c,o));if(B(o,r.is_start?"end":0,g.x,g.y,!0),navigator.userAgent.includes("AppleWebKit")){for(var m=o.points,v=m.numberOfItems,_=[],p=0;p0&&void 0!==arguments[0]?arguments[0]:k,e=a(b).find(l);x=[],e.each((function(){var e;function add(){t.includes(this)&&(e=!0)}var r=[];["start","end"].forEach((function(t,e){var o=d(this,"c_"+t);null==o?(o=document.getElementById(this.attributes["se:connector"].value.split(" ")[e]),d(this,"c_"+t,o.id),d(this,t+"_bb",n.getStrokedBBox([o]))):o=document.getElementById(o),r.push(o)}),this);for(var o=0;o<2;o++){var i=r[o];if(e=!1,a(i).parents().each(add),i&&i.parentNode){if(t.includes(i)||e){var s=n.getStrokedBBox([i]);x.push({elem:i,connector:this,is_start:0===o,start_x:s.x,start_y:s.y})}}else a(this).remove()}}))},E=function _updateLine(t,e){for(var r=x.length;r--;){var n=x[r],o=n.connector,a=n.is_start?"start":"end",i=d(o,a+"_bb");i.x=n.start_x+t,i.y=n.start_y+e,d(o,a+"_bb",i);var s=n.is_start?"end":"start",c=d(o,s+"_bb"),u=c.x+c.width/2,l=c.y+c.height/2,f=w(u,l,i,A(a,o));B(o,n.is_start?0:"end",f.x,f.y,!0);var h=w(f.x,f.y,d(o,s+"_bb"),A(s,o));B(o,n.is_start?"end":0,h.x,h.y,!0)}},B=function _setPoint(t,e,r,n,o){var a=t.points,s=i.createSVGPoint();s.x=r,s.y=n,"end"===e&&(e=a.numberOfItems-1);try{a.replaceItem(s,e)}catch(o){for(var c=t.getAttribute("points").split(" "),u=0;u').appendTo("head")),e.text(t?"#tool_clone, #tool_topath, #tool_angle, #xy_panel { display: none !important; }":""),a("#connector_panel").toggle(t)},A=function _getOffset(t,e){var r=e.getAttribute("marker-"+t),n=5*e.getAttribute("stroke-width");return r?n:0},w=function _getBBintersect(t,e,r,n){n&&(n-=0,(r=a.extend({},r)).width+=n,r.height+=n,r.x-=n/2,r.y-=n/2);var o,i=r.x+r.width/2,s=r.y+r.height/2,c=t-i,u=e-s;return{x:i+c*(o=Math.abs(u/c)').appendTo('head');\n }\n connRules.text(!on ? '' : '#tool_clone, #tool_topath, #tool_angle, #xy_panel { display: none !important; }');\n $('#connector_panel').toggle(on);\n }\n\n /**\n * @param {Element} elem\n * @param {Integer|\"end\"} pos\n * @param {Float} x\n * @param {Float} y\n * @param {boolean} [setMid]\n * @returns {void}\n */\n function setPoint (elem, pos, x, y, setMid) {\n const pts = elem.points;\n const pt = svgroot.createSVGPoint();\n pt.x = x;\n pt.y = y;\n if (pos === 'end') { pos = pts.numberOfItems - 1; }\n // TODO: Test for this on init, then use alt only if needed\n try {\n pts.replaceItem(pt, pos);\n } catch (err) {\n // Should only occur in FF which formats points attr as \"n,n n,n\", so just split\n const ptArr = elem.getAttribute('points').split(' ');\n for (let i = 0; i < ptArr.length; i++) {\n if (i === pos) {\n ptArr[i] = x + ',' + y;\n }\n }\n elem.setAttribute('points', ptArr.join(' '));\n }\n\n if (setMid) {\n // Add center point\n const ptStart = pts.getItem(0);\n const ptEnd = pts.getItem(pts.numberOfItems - 1);\n setPoint(elem, 1, (ptEnd.x + ptStart.x) / 2, (ptEnd.y + ptStart.y) / 2);\n }\n }\n\n /**\n * @param {Float} diffX\n * @param {Float} diffY\n * @returns {void}\n */\n function updateLine (diffX, diffY) {\n // Update line with element\n let i = connections.length;\n while (i--) {\n const conn = connections[i];\n const line = conn.connector;\n // const {elem} = conn;\n\n const pre = conn.is_start ? 'start' : 'end';\n // const sw = line.getAttribute('stroke-width') * 5;\n\n // Update bbox for this element\n const bb = elData(line, pre + '_bb');\n bb.x = conn.start_x + diffX;\n bb.y = conn.start_y + diffY;\n elData(line, pre + '_bb', bb);\n\n const altPre = conn.is_start ? 'end' : 'start';\n\n // Get center pt of connected element\n const bb2 = elData(line, altPre + '_bb');\n const srcX = bb2.x + bb2.width / 2;\n const srcY = bb2.y + bb2.height / 2;\n\n // Set point of element being moved\n const pt = getBBintersect(srcX, srcY, bb, getOffset(pre, line)); // $(line).data(pre+'_off')?sw:0\n setPoint(line, conn.is_start ? 0 : 'end', pt.x, pt.y, true);\n\n // Set point of connected element\n const pt2 = getBBintersect(pt.x, pt.y, elData(line, altPre + '_bb'), getOffset(altPre, line));\n setPoint(line, conn.is_start ? 'end' : 0, pt2.x, pt2.y, true);\n }\n }\n\n /**\n *\n * @param {Element[]} [elems=selElems] Array of elements\n * @returns {void}\n */\n function findConnectors (elems = selElems) {\n const connectors = $(svgcontent).find(connSel);\n connections = [];\n\n // Loop through connectors to see if one is connected to the element\n connectors.each(function () {\n let addThis;\n /**\n *\n * @returns {void}\n */\n function add () {\n if (elems.includes(this)) {\n // Pretend this element is selected\n addThis = true;\n }\n }\n\n // Grab the ends\n const parts = [];\n ['start', 'end'].forEach(function (pos, i) {\n const key = 'c_' + pos;\n let part = elData(this, key);\n if (part === null || part === undefined) { // Does this ever return nullish values?\n part = document.getElementById(\n this.attributes['se:connector'].value.split(' ')[i]\n );\n elData(this, 'c_' + pos, part.id);\n elData(this, pos + '_bb', svgCanvas.getStrokedBBox([part]));\n } else part = document.getElementById(part);\n parts.push(part);\n }, this);\n\n for (let i = 0; i < 2; i++) {\n const cElem = parts[i];\n\n addThis = false;\n // The connected element might be part of a selected group\n $(cElem).parents().each(add);\n\n if (!cElem || !cElem.parentNode) {\n $(this).remove();\n continue;\n }\n if (elems.includes(cElem) || addThis) {\n const bb = svgCanvas.getStrokedBBox([cElem]);\n connections.push({\n elem: cElem,\n connector: this,\n is_start: (i === 0),\n start_x: bb.x,\n start_y: bb.y\n });\n }\n }\n });\n }\n\n /**\n * @param {Element[]} [elems=selElems]\n * @returns {void}\n */\n function updateConnectors (elems) {\n // Updates connector lines based on selected elements\n // Is not used on mousemove, as it runs getStrokedBBox every time,\n // which isn't necessary there.\n findConnectors(elems);\n if (connections.length) {\n // Update line with element\n let i = connections.length;\n while (i--) {\n const conn = connections[i];\n const line = conn.connector;\n const {elem} = conn;\n\n // const sw = line.getAttribute('stroke-width') * 5;\n const pre = conn.is_start ? 'start' : 'end';\n\n // Update bbox for this element\n const bb = svgCanvas.getStrokedBBox([elem]);\n bb.x = conn.start_x;\n bb.y = conn.start_y;\n elData(line, pre + '_bb', bb);\n /* const addOffset = */ elData(line, pre + '_off');\n\n const altPre = conn.is_start ? 'end' : 'start';\n\n // Get center pt of connected element\n const bb2 = elData(line, altPre + '_bb');\n const srcX = bb2.x + bb2.width / 2;\n const srcY = bb2.y + bb2.height / 2;\n\n // Set point of element being moved\n let pt = getBBintersect(srcX, srcY, bb, getOffset(pre, line));\n setPoint(line, conn.is_start ? 0 : 'end', pt.x, pt.y, true);\n\n // Set point of connected element\n const pt2 = getBBintersect(pt.x, pt.y, elData(line, altPre + '_bb'), getOffset(altPre, line));\n setPoint(line, conn.is_start ? 'end' : 0, pt2.x, pt2.y, true);\n\n // Update points attribute manually for webkit\n if (navigator.userAgent.includes('AppleWebKit')) {\n const pts = line.points;\n const len = pts.numberOfItems;\n const ptArr = [];\n for (let j = 0; j < len; j++) {\n pt = pts.getItem(j);\n ptArr[j] = pt.x + ',' + pt.y;\n }\n line.setAttribute('points', ptArr.join(' '));\n }\n }\n }\n }\n\n // Do once\n (function () {\n const gse = svgCanvas.groupSelectedElements;\n\n svgCanvas.groupSelectedElements = function (...args) {\n svgCanvas.removeFromSelection($(connSel).toArray());\n return gse.apply(this, args);\n };\n\n const mse = svgCanvas.moveSelectedElements;\n\n svgCanvas.moveSelectedElements = function (...args) {\n const cmd = mse.apply(this, args);\n updateConnectors();\n return cmd;\n };\n\n seNs = svgCanvas.getEditorNS();\n }());\n\n /**\n * Do on reset.\n * @returns {void}\n */\n function init () {\n // Make sure all connectors have data set\n $(svgcontent).find('*').each(function () {\n const conn = this.getAttributeNS(seNs, 'connector');\n if (conn) {\n this.setAttribute('class', connSel.substr(1));\n const connData = conn.split(' ');\n const sbb = svgCanvas.getStrokedBBox([getElem(connData[0])]);\n const ebb = svgCanvas.getStrokedBBox([getElem(connData[1])]);\n $(this).data('c_start', connData[0])\n .data('c_end', connData[1])\n .data('start_bb', sbb)\n .data('end_bb', ebb);\n svgCanvas.getEditorNS(true);\n }\n });\n // updateConnectors();\n }\n\n // $(svgroot).parent().mousemove(function (e) {\n // // if (started\n // // || svgCanvas.getMode() !== 'connector'\n // // || e.target.parentNode.parentNode !== svgcontent) return;\n //\n // console.log('y')\n // // if (e.target.parentNode.parentNode === svgcontent) {\n // //\n // // }\n // });\n\n const buttons = [{\n id: 'mode_connect',\n type: 'mode',\n icon: svgEditor.curConfig.imgPath + 'cut.png',\n includeWith: {\n button: '#tool_line',\n isDefault: false,\n position: 1\n },\n events: {\n click () {\n svgCanvas.setMode('connector');\n }\n }\n }];\n\n return {\n name: strings.name,\n svgicons: 'conn.svg',\n buttons: strings.buttons.map((button, i) => {\n return Object.assign(buttons[i], button);\n }),\n /* async */ addLangData ({lang}) { // , importLocale: importLoc\n return {\n data: strings.langList\n };\n },\n mouseDown (opts) {\n const e = opts.event;\n startX = opts.start_x;\n startY = opts.start_y;\n const mode = svgCanvas.getMode();\n const {curConfig: {initStroke}} = svgEditor;\n\n if (mode === 'connector') {\n if (started) { return undefined; }\n\n const mouseTarget = e.target;\n\n const parents = $(mouseTarget).parents();\n\n if ($.inArray(svgcontent, parents) !== -1) {\n // Connectable element\n\n // If child of foreignObject, use parent\n const fo = $(mouseTarget).closest('foreignObject');\n startElem = fo.length ? fo[0] : mouseTarget;\n\n // Get center of source element\n const bb = svgCanvas.getStrokedBBox([startElem]);\n const x = bb.x + bb.width / 2;\n const y = bb.y + bb.height / 2;\n\n started = true;\n curLine = addElem({\n element: 'polyline',\n attr: {\n id: svgCanvas.getNextId(),\n points: (x + ',' + y + ' ' + x + ',' + y + ' ' + startX + ',' + startY),\n stroke: '#' + initStroke.color,\n 'stroke-width': (!startElem.stroke_width || startElem.stroke_width === 0)\n ? initStroke.width\n : startElem.stroke_width,\n fill: 'none',\n opacity: initStroke.opacity,\n style: 'pointer-events:none'\n }\n });\n elData(curLine, 'start_bb', bb);\n }\n return {\n started: true\n };\n }\n if (mode === 'select') {\n findConnectors();\n }\n return undefined;\n },\n mouseMove (opts) {\n const zoom = svgCanvas.getZoom();\n // const e = opts.event;\n const x = opts.mouse_x / zoom;\n const y = opts.mouse_y / zoom;\n\n const diffX = x - startX,\n diffY = y - startY;\n\n const mode = svgCanvas.getMode();\n\n if (mode === 'connector' && started) {\n // const sw = curLine.getAttribute('stroke-width') * 3;\n // Set start point (adjusts based on bb)\n const pt = getBBintersect(x, y, elData(curLine, 'start_bb'), getOffset('start', curLine));\n startX = pt.x;\n startY = pt.y;\n\n setPoint(curLine, 0, pt.x, pt.y, true);\n\n // Set end point\n setPoint(curLine, 'end', x, y, true);\n } else if (mode === 'select') {\n let slen = selElems.length;\n while (slen--) {\n const elem = selElems[slen];\n // Look for selected connector elements\n if (elem && elData(elem, 'c_start')) {\n // Remove the \"translate\" transform given to move\n svgCanvas.removeFromSelection([elem]);\n svgCanvas.getTransformList(elem).clear();\n }\n }\n if (connections.length) {\n updateLine(diffX, diffY);\n }\n }\n },\n mouseUp (opts) {\n // const zoom = svgCanvas.getZoom();\n const e = opts.event;\n // , x = opts.mouse_x / zoom,\n // , y = opts.mouse_y / zoom,\n let mouseTarget = e.target;\n\n if (svgCanvas.getMode() !== 'connector') {\n return undefined;\n }\n const fo = $(mouseTarget).closest('foreignObject');\n if (fo.length) { mouseTarget = fo[0]; }\n\n const parents = $(mouseTarget).parents();\n\n if (mouseTarget === startElem) {\n // Start line through click\n started = true;\n return {\n keep: true,\n element: null,\n started\n };\n }\n if ($.inArray(svgcontent, parents) === -1) {\n // Not a valid target element, so remove line\n $(curLine).remove();\n started = false;\n return {\n keep: false,\n element: null,\n started\n };\n }\n // Valid end element\n endElem = mouseTarget;\n\n const startId = startElem.id, endId = endElem.id;\n const connStr = startId + ' ' + endId;\n const altStr = endId + ' ' + startId;\n // Don't create connector if one already exists\n const dupe = $(svgcontent).find(connSel).filter(function () {\n const conn = this.getAttributeNS(seNs, 'connector');\n if (conn === connStr || conn === altStr) { return true; }\n return false;\n });\n if (dupe.length) {\n $(curLine).remove();\n return {\n keep: false,\n element: null,\n started: false\n };\n }\n\n const bb = svgCanvas.getStrokedBBox([endElem]);\n\n const pt = getBBintersect(startX, startY, bb, getOffset('start', curLine));\n setPoint(curLine, 'end', pt.x, pt.y, true);\n $(curLine)\n .data('c_start', startId)\n .data('c_end', endId)\n .data('end_bb', bb);\n seNs = svgCanvas.getEditorNS(true);\n curLine.setAttributeNS(seNs, 'se:connector', connStr);\n curLine.setAttribute('class', connSel.substr(1));\n curLine.setAttribute('opacity', 1);\n svgCanvas.addToSelection([curLine]);\n svgCanvas.moveToBottomSelectedElement();\n selManager.requestSelector(curLine).showGrips(false);\n started = false;\n return {\n keep: true,\n element: curLine,\n started\n };\n },\n selectedChanged (opts) {\n // TODO: Find better way to skip operations if no connectors are in use\n if (!$(svgcontent).find(connSel).length) { return; }\n\n if (svgCanvas.getMode() === 'connector') {\n svgCanvas.setMode('select');\n }\n\n // Use this to update the current selected elements\n selElems = opts.elems;\n\n let i = selElems.length;\n while (i--) {\n const elem = selElems[i];\n if (elem && elData(elem, 'c_start')) {\n selManager.requestSelector(elem).showGrips(false);\n if (opts.selectedElement && !opts.multiselected) {\n // TODO: Set up context tools and hide most regular line tools\n showPanel(true);\n } else {\n showPanel(false);\n }\n } else {\n showPanel(false);\n }\n }\n updateConnectors();\n },\n elementChanged (opts) {\n let elem = opts.elems[0];\n if (!elem) return;\n if (elem.tagName === 'svg' && elem.id === 'svgcontent') {\n // Update svgcontent (can change on import)\n svgcontent = elem;\n init();\n }\n\n // Has marker, so change offset\n if (\n elem.getAttribute('marker-start') ||\n elem.getAttribute('marker-mid') ||\n elem.getAttribute('marker-end')\n ) {\n const start = elem.getAttribute('marker-start');\n const mid = elem.getAttribute('marker-mid');\n const end = elem.getAttribute('marker-end');\n curLine = elem;\n $(elem)\n .data('start_off', Boolean(start))\n .data('end_off', Boolean(end));\n\n if (elem.tagName === 'line' && mid) {\n // Convert to polyline to accept mid-arrow\n\n const x1 = Number(elem.getAttribute('x1'));\n const x2 = Number(elem.getAttribute('x2'));\n const y1 = Number(elem.getAttribute('y1'));\n const y2 = Number(elem.getAttribute('y2'));\n const {id} = elem;\n\n const midPt = (' ' + ((x1 + x2) / 2) + ',' + ((y1 + y2) / 2) + ' ');\n const pline = addElem({\n element: 'polyline',\n attr: {\n points: (x1 + ',' + y1 + midPt + x2 + ',' + y2),\n stroke: elem.getAttribute('stroke'),\n 'stroke-width': elem.getAttribute('stroke-width'),\n 'marker-mid': mid,\n fill: 'none',\n opacity: elem.getAttribute('opacity') || 1\n }\n });\n $(elem).after(pline).remove();\n svgCanvas.clearSelection();\n pline.id = id;\n svgCanvas.addToSelection([pline]);\n elem = pline;\n }\n }\n // Update line if it's a connector\n if (elem.getAttribute('class') === connSel.substr(1)) {\n const start = getElem(elData(elem, 'c_start'));\n updateConnectors([start]);\n } else {\n updateConnectors();\n }\n },\n IDsUpdated (input) {\n const remove = [];\n input.elems.forEach(function (elem) {\n if ('se:connector' in elem.attr) {\n elem.attr['se:connector'] = elem.attr['se:connector'].split(' ')\n .map(function (oldID) { return input.changes[oldID]; }).join(' ');\n\n // Check validity - the field would be something like 'svg_21 svg_22', but\n // if one end is missing, it would be 'svg_21' and therefore fail this test\n if (!(/. ./).test(elem.attr['se:connector'])) {\n remove.push(elem.attr.id);\n }\n }\n });\n return {remove};\n },\n toolButtonStateUpdate (opts) {\n if (opts.nostroke) {\n if ($('#mode_connect').hasClass('tool_button_current')) {\n svgEditor.clickSelect();\n }\n }\n $('#mode_connect')\n .toggleClass('disabled', opts.nostroke);\n }\n };\n }\n};\n"],"names":["name","init","S","getBBintersect","getOffset","showPanel","setPoint","updateLine","findConnectors","updateConnectors","$","svgcontent","find","each","conn","getAttributeNS","seNs","setAttribute","connSel","substr","connData","split","sbb","svgCanvas","getStrokedBBox","getElem","ebb","data","getEditorNS","elems","connections","length","i","line","connector","elem","pre","is_start","bb","x","start_x","y","start_y","elData","altPre","bb2","srcX","width","srcY","height","pt","pt2","navigator","userAgent","includes","pts","points","len","numberOfItems","ptArr","j","getItem","join","selElems","connectors","addThis","add","parts","forEach","pos","key","part","undefined","document","getElementById","attributes","value","id","push","cElem","parents","parentNode","remove","diffX","diffY","setMid","svgroot","createSVGPoint","replaceItem","err","getAttribute","ptStart","ptEnd","on","connRules","appendTo","text","toggle","side","giveOffset","size","offset","extend","midX","midY","lenX","lenY","slope","Math","abs","ratio","svgEditor","canvas","importLocale","addElem","addSVGElementFromJson","selManager","selectorManager","strings","started","gse","groupSelectedElements","removeFromSelection","toArray","args","apply","mse","moveSelectedElements","cmd","buttons","type","icon","curConfig","imgPath","includeWith","button","isDefault","position","events","click","setMode","svgicons","map","Object","assign","addLangData","lang","langList","mouseDown","opts","e","event","startX","startY","mode","getMode","initStroke","mouseTarget","target","inArray","fo","closest","startElem","curLine","element","attr","getNextId","stroke","color","stroke_width","fill","opacity","style","mouseMove","zoom","getZoom","mouse_x","mouse_y","slen","getTransformList","clear","mouseUp","keep","endElem","startId","endId","connStr","altStr","dupe","filter","setAttributeNS","addToSelection","moveToBottomSelectedElement","requestSelector","showGrips","selectedChanged","selectedElement","multiselected","elementChanged","tagName","start","mid","end","Boolean","x1","Number","x2","y1","y2","midPt","pline","after","clearSelection","IDsUpdated","input","oldID","changes","test","toolButtonStateUpdate","nostroke","hasClass","clickSelect","toggleClass"],"mappings":";;;;;;;;;;;;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EAC8BzJ,IAD9B,CACmC,GADnC,CAA5B,CAD+B;AAK/B;;AACA,0BAAI,CAAE,KAAD,CAAQ2J,IAAR,CAAatL,IAAI,CAACkI,IAAL,CAAU,cAAV,CAAb,CAAL,EAA8C;AAC5CnF,wBAAAA,MAAM,CAACJ,IAAP,CAAY3C,IAAI,CAACkI,IAAL,CAAUxF,EAAtB;AACD;AACF;AACF,mBAXD;AAYA,yBAAO;AAACK,oBAAAA,MAAM,EAANA;AAAD,mBAAP;AACD,iBAxRI;AAyRLwI,gBAAAA,qBAzRK,iCAyRkBrE,IAzRlB,EAyRwB;AAC3B,sBAAIA,IAAI,CAACsE,QAAT,EAAmB;AACjB,wBAAIjN,CAAC,CAAC,eAAD,CAAD,CAAmBkN,QAAnB,CAA4B,qBAA5B,CAAJ,EAAwD;AACtD7G,sBAAAA,SAAS,CAAC8G,WAAV;AACD;AACF;;AACDnN,kBAAAA,CAAC,CAAC,eAAD,CAAD,CACGoN,WADH,CACe,UADf,EAC2BzE,IAAI,CAACsE,QADhC;AAED;AAjSI,eAnWM;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAsoBd;AAxoBY,CAAf;;;;"} \ No newline at end of file +{"version":3,"file":"ext-connector.js","sources":["../../../src/editor/extensions/ext-connector.js"],"sourcesContent":["/**\n * @file ext-connector.js\n *\n * @license MIT\n *\n * @copyright 2010 Alexis Deveria\n *\n */\n\nexport default {\n name: 'connector',\n async init (S) {\n const svgEditor = this;\n const svgCanvas = svgEditor.canvas;\n const {getElem} = svgCanvas;\n const {$, svgroot, importLocale} = S,\n addElem = svgCanvas.addSVGElementFromJson,\n selManager = S.selectorManager,\n connSel = '.se_connector',\n // connect_str = '-SE_CONNECT-',\n elData = $.data;\n const strings = await importLocale();\n\n let startX,\n startY,\n curLine,\n startElem,\n endElem,\n seNs,\n {svgcontent} = S,\n started = false,\n connections = [],\n selElems = [];\n\n /**\n *\n * @param {Float} x\n * @param {Float} y\n * @param {module:utilities.BBoxObject} bb\n * @param {Float} offset\n * @returns {module:math.XYObject}\n */\n function getBBintersect (x, y, bb, offset) {\n if (offset) {\n offset -= 0;\n bb = $.extend({}, bb);\n bb.width += offset;\n bb.height += offset;\n bb.x -= offset / 2;\n bb.y -= offset / 2;\n }\n\n const midX = bb.x + bb.width / 2;\n const midY = bb.y + bb.height / 2;\n const lenX = x - midX;\n const lenY = y - midY;\n\n const slope = Math.abs(lenY / lenX);\n\n let ratio;\n if (slope < bb.height / bb.width) {\n ratio = (bb.width / 2) / Math.abs(lenX);\n } else {\n ratio = lenY\n ? (bb.height / 2) / Math.abs(lenY)\n : 0;\n }\n\n return {\n x: midX + lenX * ratio,\n y: midY + lenY * ratio\n };\n }\n\n /**\n * @param {\"start\"|\"end\"} side\n * @param {Element} line\n * @returns {Float}\n */\n function getOffset (side, line) {\n const giveOffset = line.getAttribute('marker-' + side);\n // const giveOffset = $(line).data(side+'_off');\n\n // TODO: Make this number (5) be based on marker width/height\n const size = line.getAttribute('stroke-width') * 5;\n return giveOffset ? size : 0;\n }\n\n /**\n * @param {boolean} on\n * @returns {void}\n */\n function showPanel (on) {\n let connRules = $('#connector_rules');\n if (!connRules.length) {\n connRules = $('').appendTo('head');\n }\n connRules.text(!on ? '' : '#tool_clone, #tool_topath, #tool_angle, #xy_panel { display: none !important; }');\n $('#connector_panel').toggle(on);\n }\n\n /**\n * @param {Element} elem\n * @param {Integer|\"end\"} pos\n * @param {Float} x\n * @param {Float} y\n * @param {boolean} [setMid]\n * @returns {void}\n */\n function setPoint (elem, pos, x, y, setMid) {\n const pts = elem.points;\n const pt = svgroot.createSVGPoint();\n pt.x = x;\n pt.y = y;\n if (pos === 'end') { pos = pts.numberOfItems - 1; }\n // TODO: Test for this on init, then use alt only if needed\n try {\n pts.replaceItem(pt, pos);\n } catch (err) {\n // Should only occur in FF which formats points attr as \"n,n n,n\", so just split\n const ptArr = elem.getAttribute('points').split(' ');\n for (let i = 0; i < ptArr.length; i++) {\n if (i === pos) {\n ptArr[i] = x + ',' + y;\n }\n }\n elem.setAttribute('points', ptArr.join(' '));\n }\n\n if (setMid) {\n // Add center point\n const ptStart = pts.getItem(0);\n const ptEnd = pts.getItem(pts.numberOfItems - 1);\n setPoint(elem, 1, (ptEnd.x + ptStart.x) / 2, (ptEnd.y + ptStart.y) / 2);\n }\n }\n\n /**\n * @param {Float} diffX\n * @param {Float} diffY\n * @returns {void}\n */\n function updateLine (diffX, diffY) {\n // Update line with element\n let i = connections.length;\n while (i--) {\n const conn = connections[i];\n const line = conn.connector;\n // const {elem} = conn;\n\n const pre = conn.is_start ? 'start' : 'end';\n // const sw = line.getAttribute('stroke-width') * 5;\n\n // Update bbox for this element\n const bb = elData(line, pre + '_bb');\n bb.x = conn.start_x + diffX;\n bb.y = conn.start_y + diffY;\n elData(line, pre + '_bb', bb);\n\n const altPre = conn.is_start ? 'end' : 'start';\n\n // Get center pt of connected element\n const bb2 = elData(line, altPre + '_bb');\n const srcX = bb2.x + bb2.width / 2;\n const srcY = bb2.y + bb2.height / 2;\n\n // Set point of element being moved\n const pt = getBBintersect(srcX, srcY, bb, getOffset(pre, line)); // $(line).data(pre+'_off')?sw:0\n setPoint(line, conn.is_start ? 0 : 'end', pt.x, pt.y, true);\n\n // Set point of connected element\n const pt2 = getBBintersect(pt.x, pt.y, elData(line, altPre + '_bb'), getOffset(altPre, line));\n setPoint(line, conn.is_start ? 'end' : 0, pt2.x, pt2.y, true);\n }\n }\n\n /**\n *\n * @param {Element[]} [elems=selElems] Array of elements\n * @returns {void}\n */\n function findConnectors (elems = selElems) {\n const connectors = $(svgcontent).find(connSel);\n connections = [];\n\n // Loop through connectors to see if one is connected to the element\n connectors.each(function () {\n let addThis;\n /**\n *\n * @returns {void}\n */\n function add () {\n if (elems.includes(this)) {\n // Pretend this element is selected\n addThis = true;\n }\n }\n\n // Grab the ends\n const parts = [];\n ['start', 'end'].forEach(function (pos, i) {\n const key = 'c_' + pos;\n let part = elData(this, key);\n if (part === null || part === undefined) { // Does this ever return nullish values?\n part = document.getElementById(\n this.attributes['se:connector'].value.split(' ')[i]\n );\n elData(this, 'c_' + pos, part.id);\n elData(this, pos + '_bb', svgCanvas.getStrokedBBox([part]));\n } else part = document.getElementById(part);\n parts.push(part);\n }, this);\n\n for (let i = 0; i < 2; i++) {\n const cElem = parts[i];\n\n addThis = false;\n // The connected element might be part of a selected group\n $(cElem).parents().each(add);\n\n if (!cElem || !cElem.parentNode) {\n $(this).remove();\n continue;\n }\n if (elems.includes(cElem) || addThis) {\n const bb = svgCanvas.getStrokedBBox([cElem]);\n connections.push({\n elem: cElem,\n connector: this,\n is_start: (i === 0),\n start_x: bb.x,\n start_y: bb.y\n });\n }\n }\n });\n }\n\n /**\n * @param {Element[]} [elems=selElems]\n * @returns {void}\n */\n function updateConnectors (elems) {\n // Updates connector lines based on selected elements\n // Is not used on mousemove, as it runs getStrokedBBox every time,\n // which isn't necessary there.\n findConnectors(elems);\n if (connections.length) {\n // Update line with element\n let i = connections.length;\n while (i--) {\n const conn = connections[i];\n const line = conn.connector;\n const {elem} = conn;\n\n // const sw = line.getAttribute('stroke-width') * 5;\n const pre = conn.is_start ? 'start' : 'end';\n\n // Update bbox for this element\n const bb = svgCanvas.getStrokedBBox([elem]);\n bb.x = conn.start_x;\n bb.y = conn.start_y;\n elData(line, pre + '_bb', bb);\n /* const addOffset = */ elData(line, pre + '_off');\n\n const altPre = conn.is_start ? 'end' : 'start';\n\n // Get center pt of connected element\n const bb2 = elData(line, altPre + '_bb');\n const srcX = bb2.x + bb2.width / 2;\n const srcY = bb2.y + bb2.height / 2;\n\n // Set point of element being moved\n let pt = getBBintersect(srcX, srcY, bb, getOffset(pre, line));\n setPoint(line, conn.is_start ? 0 : 'end', pt.x, pt.y, true);\n\n // Set point of connected element\n const pt2 = getBBintersect(pt.x, pt.y, elData(line, altPre + '_bb'), getOffset(altPre, line));\n setPoint(line, conn.is_start ? 'end' : 0, pt2.x, pt2.y, true);\n\n // Update points attribute manually for webkit\n if (navigator.userAgent.includes('AppleWebKit')) {\n const pts = line.points;\n const len = pts.numberOfItems;\n const ptArr = [];\n for (let j = 0; j < len; j++) {\n pt = pts.getItem(j);\n ptArr[j] = pt.x + ',' + pt.y;\n }\n line.setAttribute('points', ptArr.join(' '));\n }\n }\n }\n }\n\n // Do once\n (function () {\n const gse = svgCanvas.groupSelectedElements;\n\n svgCanvas.groupSelectedElements = function (...args) {\n svgCanvas.removeFromSelection($(connSel).toArray());\n return gse.apply(this, args);\n };\n\n const mse = svgCanvas.moveSelectedElements;\n\n svgCanvas.moveSelectedElements = function (...args) {\n const cmd = mse.apply(this, args);\n updateConnectors();\n return cmd;\n };\n\n seNs = svgCanvas.getEditorNS();\n }());\n\n /**\n * Do on reset.\n * @returns {void}\n */\n function init () {\n // Make sure all connectors have data set\n $(svgcontent).find('*').each(function () {\n const conn = this.getAttributeNS(seNs, 'connector');\n if (conn) {\n this.setAttribute('class', connSel.substr(1));\n const connData = conn.split(' ');\n const sbb = svgCanvas.getStrokedBBox([getElem(connData[0])]);\n const ebb = svgCanvas.getStrokedBBox([getElem(connData[1])]);\n $(this).data('c_start', connData[0])\n .data('c_end', connData[1])\n .data('start_bb', sbb)\n .data('end_bb', ebb);\n svgCanvas.getEditorNS(true);\n }\n });\n // updateConnectors();\n }\n\n // $(svgroot).parent().mousemove(function (e) {\n // // if (started\n // // || svgCanvas.getMode() !== 'connector'\n // // || e.target.parentNode.parentNode !== svgcontent) return;\n //\n // console.log('y')\n // // if (e.target.parentNode.parentNode === svgcontent) {\n // //\n // // }\n // });\n\n const buttons = [{\n id: 'mode_connect',\n type: 'mode',\n icon: svgEditor.curConfig.imgPath + 'cut.png',\n includeWith: {\n button: '#tool_line',\n isDefault: false,\n position: 1\n },\n events: {\n click () {\n svgCanvas.setMode('connector');\n }\n }\n }];\n\n return {\n name: strings.name,\n svgicons: 'conn.svg',\n buttons: strings.buttons.map((button, i) => {\n return Object.assign(buttons[i], button);\n }),\n /* async */ addLangData ({lang}) { // , importLocale: importLoc\n return {\n data: strings.langList\n };\n },\n mouseDown (opts) {\n const e = opts.event;\n startX = opts.start_x;\n startY = opts.start_y;\n const mode = svgCanvas.getMode();\n const {curConfig: {initStroke}} = svgEditor;\n\n if (mode === 'connector') {\n if (started) { return undefined; }\n\n const mouseTarget = e.target;\n\n const parents = $(mouseTarget).parents();\n\n if ($.inArray(svgcontent, parents) !== -1) {\n // Connectable element\n\n // If child of foreignObject, use parent\n const fo = $(mouseTarget).closest('foreignObject');\n startElem = fo.length ? fo[0] : mouseTarget;\n\n // Get center of source element\n const bb = svgCanvas.getStrokedBBox([startElem]);\n const x = bb.x + bb.width / 2;\n const y = bb.y + bb.height / 2;\n\n started = true;\n curLine = addElem({\n element: 'polyline',\n attr: {\n id: svgCanvas.getNextId(),\n points: (x + ',' + y + ' ' + x + ',' + y + ' ' + startX + ',' + startY),\n stroke: '#' + initStroke.color,\n 'stroke-width': (!startElem.stroke_width || startElem.stroke_width === 0)\n ? initStroke.width\n : startElem.stroke_width,\n fill: 'none',\n opacity: initStroke.opacity,\n style: 'pointer-events:none'\n }\n });\n elData(curLine, 'start_bb', bb);\n }\n return {\n started: true\n };\n }\n if (mode === 'select') {\n findConnectors();\n }\n return undefined;\n },\n mouseMove (opts) {\n const zoom = svgCanvas.getZoom();\n // const e = opts.event;\n const x = opts.mouse_x / zoom;\n const y = opts.mouse_y / zoom;\n\n const diffX = x - startX,\n diffY = y - startY;\n\n const mode = svgCanvas.getMode();\n\n if (mode === 'connector' && started) {\n // const sw = curLine.getAttribute('stroke-width') * 3;\n // Set start point (adjusts based on bb)\n const pt = getBBintersect(x, y, elData(curLine, 'start_bb'), getOffset('start', curLine));\n startX = pt.x;\n startY = pt.y;\n\n setPoint(curLine, 0, pt.x, pt.y, true);\n\n // Set end point\n setPoint(curLine, 'end', x, y, true);\n } else if (mode === 'select') {\n let slen = selElems.length;\n while (slen--) {\n const elem = selElems[slen];\n // Look for selected connector elements\n if (elem && elData(elem, 'c_start')) {\n // Remove the \"translate\" transform given to move\n svgCanvas.removeFromSelection([elem]);\n svgCanvas.getTransformList(elem).clear();\n }\n }\n if (connections.length) {\n updateLine(diffX, diffY);\n }\n }\n },\n mouseUp (opts) {\n // const zoom = svgCanvas.getZoom();\n const e = opts.event;\n // , x = opts.mouse_x / zoom,\n // , y = opts.mouse_y / zoom,\n let mouseTarget = e.target;\n\n if (svgCanvas.getMode() !== 'connector') {\n return undefined;\n }\n const fo = $(mouseTarget).closest('foreignObject');\n if (fo.length) { mouseTarget = fo[0]; }\n\n const parents = $(mouseTarget).parents();\n\n if (mouseTarget === startElem) {\n // Start line through click\n started = true;\n return {\n keep: true,\n element: null,\n started\n };\n }\n if ($.inArray(svgcontent, parents) === -1) {\n // Not a valid target element, so remove line\n $(curLine).remove();\n started = false;\n return {\n keep: false,\n element: null,\n started\n };\n }\n // Valid end element\n endElem = mouseTarget;\n\n const startId = startElem.id, endId = endElem.id;\n const connStr = startId + ' ' + endId;\n const altStr = endId + ' ' + startId;\n // Don't create connector if one already exists\n const dupe = $(svgcontent).find(connSel).filter(function () {\n const conn = this.getAttributeNS(seNs, 'connector');\n if (conn === connStr || conn === altStr) { return true; }\n return false;\n });\n if (dupe.length) {\n $(curLine).remove();\n return {\n keep: false,\n element: null,\n started: false\n };\n }\n\n const bb = svgCanvas.getStrokedBBox([endElem]);\n\n const pt = getBBintersect(startX, startY, bb, getOffset('start', curLine));\n setPoint(curLine, 'end', pt.x, pt.y, true);\n $(curLine)\n .data('c_start', startId)\n .data('c_end', endId)\n .data('end_bb', bb);\n seNs = svgCanvas.getEditorNS(true);\n curLine.setAttributeNS(seNs, 'se:connector', connStr);\n curLine.setAttribute('class', connSel.substr(1));\n curLine.setAttribute('opacity', 1);\n svgCanvas.addToSelection([curLine]);\n svgCanvas.moveToBottomSelectedElement();\n selManager.requestSelector(curLine).showGrips(false);\n started = false;\n return {\n keep: true,\n element: curLine,\n started\n };\n },\n selectedChanged (opts) {\n // TODO: Find better way to skip operations if no connectors are in use\n if (!$(svgcontent).find(connSel).length) { return; }\n\n if (svgCanvas.getMode() === 'connector') {\n svgCanvas.setMode('select');\n }\n\n // Use this to update the current selected elements\n selElems = opts.elems;\n\n let i = selElems.length;\n while (i--) {\n const elem = selElems[i];\n if (elem && elData(elem, 'c_start')) {\n selManager.requestSelector(elem).showGrips(false);\n if (opts.selectedElement && !opts.multiselected) {\n // TODO: Set up context tools and hide most regular line tools\n showPanel(true);\n } else {\n showPanel(false);\n }\n } else {\n showPanel(false);\n }\n }\n updateConnectors();\n },\n elementChanged (opts) {\n let elem = opts.elems[0];\n if (!elem) return;\n if (elem.tagName === 'svg' && elem.id === 'svgcontent') {\n // Update svgcontent (can change on import)\n svgcontent = elem;\n init();\n }\n\n // Has marker, so change offset\n if (\n elem.getAttribute('marker-start') ||\n elem.getAttribute('marker-mid') ||\n elem.getAttribute('marker-end')\n ) {\n const start = elem.getAttribute('marker-start');\n const mid = elem.getAttribute('marker-mid');\n const end = elem.getAttribute('marker-end');\n curLine = elem;\n $(elem)\n .data('start_off', Boolean(start))\n .data('end_off', Boolean(end));\n\n if (elem.tagName === 'line' && mid) {\n // Convert to polyline to accept mid-arrow\n\n const x1 = Number(elem.getAttribute('x1'));\n const x2 = Number(elem.getAttribute('x2'));\n const y1 = Number(elem.getAttribute('y1'));\n const y2 = Number(elem.getAttribute('y2'));\n const {id} = elem;\n\n const midPt = (' ' + ((x1 + x2) / 2) + ',' + ((y1 + y2) / 2) + ' ');\n const pline = addElem({\n element: 'polyline',\n attr: {\n points: (x1 + ',' + y1 + midPt + x2 + ',' + y2),\n stroke: elem.getAttribute('stroke'),\n 'stroke-width': elem.getAttribute('stroke-width'),\n 'marker-mid': mid,\n fill: 'none',\n opacity: elem.getAttribute('opacity') || 1\n }\n });\n $(elem).after(pline).remove();\n svgCanvas.clearSelection();\n pline.id = id;\n svgCanvas.addToSelection([pline]);\n elem = pline;\n }\n }\n // Update line if it's a connector\n if (elem.getAttribute('class') === connSel.substr(1)) {\n const start = getElem(elData(elem, 'c_start'));\n updateConnectors([start]);\n } else {\n updateConnectors();\n }\n },\n IDsUpdated (input) {\n const remove = [];\n input.elems.forEach(function (elem) {\n if ('se:connector' in elem.attr) {\n elem.attr['se:connector'] = elem.attr['se:connector'].split(' ')\n .map(function (oldID) { return input.changes[oldID]; }).join(' ');\n\n // Check validity - the field would be something like 'svg_21 svg_22', but\n // if one end is missing, it would be 'svg_21' and therefore fail this test\n if (!(/. ./).test(elem.attr['se:connector'])) {\n remove.push(elem.attr.id);\n }\n }\n });\n return {remove};\n },\n toolButtonStateUpdate (opts) {\n if (opts.nostroke) {\n if ($('#mode_connect').hasClass('tool_button_current')) {\n svgEditor.clickSelect();\n }\n }\n $('#mode_connect')\n .toggleClass('disabled', opts.nostroke);\n }\n };\n }\n};\n"],"names":["name","init","S","getBBintersect","getOffset","showPanel","setPoint","updateLine","findConnectors","updateConnectors","$","svgcontent","find","each","conn","this","getAttributeNS","seNs","setAttribute","connSel","substr","connData","split","sbb","svgCanvas","getStrokedBBox","getElem","ebb","data","getEditorNS","elems","connections","length","i","line","connector","elem","pre","is_start","bb","x","start_x","y","start_y","elData","altPre","bb2","srcX","width","srcY","height","pt","pt2","navigator","userAgent","includes","pts","points","len","numberOfItems","ptArr","j","getItem","join","selElems","connectors","addThis","add","parts","forEach","pos","part","document","getElementById","attributes","value","id","push","cElem","parents","parentNode","remove","diffX","diffY","setMid","svgroot","createSVGPoint","replaceItem","err","getAttribute","ptStart","ptEnd","on","connRules","appendTo","text","toggle","side","giveOffset","size","offset","extend","ratio","midX","midY","lenX","lenY","Math","abs","svgEditor","_this","canvas","importLocale","addElem","addSVGElementFromJson","selManager","selectorManager","strings","started","gse","groupSelectedElements","removeFromSelection","toArray","args","apply","mse","moveSelectedElements","cmd","buttons","type","icon","curConfig","imgPath","includeWith","button","isDefault","position","events","click","setMode","svgicons","map","Object","assign","addLangData","lang","langList","mouseDown","opts","e","event","startX","startY","mode","getMode","initStroke","mouseTarget","target","inArray","fo","closest","startElem","curLine","element","attr","getNextId","stroke","color","stroke_width","fill","opacity","style","mouseMove","zoom","getZoom","mouse_x","mouse_y","slen","getTransformList","clear","mouseUp","keep","endElem","startId","endId","connStr","altStr","filter","setAttributeNS","addToSelection","moveToBottomSelectedElement","requestSelector","showGrips","selectedChanged","selectedElement","multiselected","elementChanged","tagName","start","mid","end","Boolean","x1","Number","x2","y1","y2","pline","after","clearSelection","IDsUpdated","input","oldID","changes","test","toolButtonStateUpdate","nostroke","hasClass","clickSelect","toggleClass"],"mappings":";;;;;;;;;AASA,MAAe,CACbA,KAAM,YACAC,mBAAMC,oYA+BDC,EAqCAC,EAaAC,EAiBAC,EAiCAC,EAuCAC,EA8DAC,EA6EAR,oGAAAA,mBAEPS,EAAEC,GAAYC,KAAK,KAAKC,MAAK,eACrBC,EAAOC,KAAKC,eAAeC,EAAM,gBACnCH,EAAM,MACHI,aAAa,QAASC,EAAQC,OAAO,QACpCC,EAAWP,EAAKQ,MAAM,KACtBC,EAAMC,EAAUC,eAAe,CAACC,EAAQL,EAAS,MACjDM,EAAMH,EAAUC,eAAe,CAACC,EAAQL,EAAS,MACvDX,EAAEK,MAAMa,KAAK,UAAWP,EAAS,IAC9BO,KAAK,QAASP,EAAS,IACvBO,KAAK,WAAYL,GACjBK,KAAK,SAAUD,GAClBH,EAAUK,aAAY,QA1FnBpB,6BAAkBqB,MAIzBtB,EAAesB,GACXC,EAAYC,eAEVC,EAAIF,EAAYC,OACbC,KAAK,KACJnB,EAAOiB,EAAYE,GACnBC,EAAOpB,EAAKqB,UACXC,EAAQtB,EAARsB,KAGDC,EAAMvB,EAAKwB,SAAW,QAAU,MAGhCC,EAAKf,EAAUC,eAAe,CAACW,IACrCG,EAAGC,EAAI1B,EAAK2B,QACZF,EAAGG,EAAI5B,EAAK6B,QACZC,EAAOV,EAAMG,EAAM,MAAOE,GACFK,EAAOV,EAAMG,EAAM,YAErCQ,EAAS/B,EAAKwB,SAAW,MAAQ,QAGjCQ,EAAMF,EAAOV,EAAM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AK,KAI1BF,EAAK,IAAME,EAC5CxC,OAAQlI,EAAKqD,aAAa,yBACVrD,EAAKqD,aAAa,6BACpB8G,EACd9B,KAAM,OACNC,QAAStI,EAAKqD,aAAa,YAAc,KAG7C/E,EAAE0B,GAAM4K,MAAMD,GAAO9H,SACrBzD,EAAUyL,iBACVF,EAAMnI,GAAKA,EACXpD,EAAUqK,eAAe,CAACkB,IAC1B3K,EAAO2K,MAIP3K,EAAKqD,aAAa,WAAatE,EAAQC,OAAO,GAAI,KAC9CkL,EAAQ5K,EAAQkB,EAAOR,EAAM,YACnC3B,EAAiB,CAAC6L,SAElB7L,MAGJyM,+BAAYC,OACJlI,EAAS,UACfkI,EAAMrL,MAAMuC,SAAQ,SAAUjC,GACxB,iBAAkBA,EAAKgI,OACzBhI,EAAKgI,KAAK,gBAAkBhI,EAAKgI,KAAK,gBAAgB9I,MAAM,KACzDuH,KAAI,SAAUuE,UAAgBD,EAAME,QAAQD,MAAWrJ,KAAK,KAIzD,MAAOuJ,KAAKlL,EAAKgI,KAAK,kBAC1BnF,EAAOJ,KAAKzC,EAAKgI,KAAKxF,QAIrB,CAACK,OAAAA,IAEVsI,qDAAuBnE,GACjBA,EAAKoE,UACH9M,EAAE,iBAAiB+M,SAAS,wBAC9B5G,EAAU6G,cAGdhN,EAAE,iBACCiN,YAAY,WAAYvE,EAAKoE"} \ No newline at end of file diff --git a/dist/editor/extensions/ext-eyedropper.js b/dist/editor/extensions/ext-eyedropper.js index cbeab223..ad1830f3 100644 --- a/dist/editor/extensions/ext-eyedropper.js +++ b/dist/editor/extensions/ext-eyedropper.js @@ -1,1651 +1,4 @@ -function _typeof(obj) { - "@babel/helpers - typeof"; - - if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { - _typeof = function (obj) { - return typeof obj; - }; - } else { - _typeof = function (obj) { - return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; - }; - } - - return _typeof(obj); -} - -var REACT_ELEMENT_TYPE; - -function _jsx(type, props, key, children) { - if (!REACT_ELEMENT_TYPE) { - REACT_ELEMENT_TYPE = typeof Symbol === "function" && Symbol["for"] && Symbol["for"]("react.element") || 0xeac7; - } - - var defaultProps = type && type.defaultProps; - var childrenLength = arguments.length - 3; - - if (!props && childrenLength !== 0) { - props = { - children: void 0 - }; - } - - if (childrenLength === 1) { - props.children = children; - } else if (childrenLength > 1) { - var childArray = new Array(childrenLength); - - for (var i = 0; i < childrenLength; i++) { - childArray[i] = arguments[i + 3]; - } - - props.children = childArray; - } - - if (props && defaultProps) { - for (var propName in defaultProps) { - if (props[propName] === void 0) { - props[propName] = defaultProps[propName]; - } - } - } else if (!props) { - props = defaultProps || {}; - } - - return { - $$typeof: REACT_ELEMENT_TYPE, - type: type, - key: key === undefined ? null : '' + key, - ref: null, - props: props, - _owner: null - }; -} - -function _asyncIterator(iterable) { - var method; - - if (typeof Symbol !== "undefined") { - if (Symbol.asyncIterator) { - method = iterable[Symbol.asyncIterator]; - if (method != null) return method.call(iterable); - } - - if (Symbol.iterator) { - method = iterable[Symbol.iterator]; - if (method != null) return method.call(iterable); - } - } - - throw new TypeError("Object is not async iterable"); -} - -function _AwaitValue(value) { - this.wrapped = value; -} - -function _AsyncGenerator(gen) { - var front, back; - - function send(key, arg) { - return new Promise(function (resolve, reject) { - var request = { - key: key, - arg: arg, - resolve: resolve, - reject: reject, - next: null - }; - - if (back) { - back = back.next = request; - } else { - front = back = request; - resume(key, arg); - } - }); - } - - function resume(key, arg) { - try { - var result = gen[key](arg); - var value = result.value; - var wrappedAwait = value instanceof _AwaitValue; - Promise.resolve(wrappedAwait ? value.wrapped : value).then(function (arg) { - if (wrappedAwait) { - resume(key === "return" ? "return" : "next", arg); - return; - } - - settle(result.done ? "return" : "normal", arg); - }, function (err) { - resume("throw", err); - }); - } catch (err) { - settle("throw", err); - } - } - - function settle(type, value) { - switch (type) { - case "return": - front.resolve({ - value: value, - done: true - }); - break; - - case "throw": - front.reject(value); - break; - - default: - front.resolve({ - value: value, - done: false - }); - break; - } - - front = front.next; - - if (front) { - resume(front.key, front.arg); - } else { - back = null; - } - } - - this._invoke = send; - - if (typeof gen.return !== "function") { - this.return = undefined; - } -} - -if (typeof Symbol === "function" && Symbol.asyncIterator) { - _AsyncGenerator.prototype[Symbol.asyncIterator] = function () { - return this; - }; -} - -_AsyncGenerator.prototype.next = function (arg) { - return this._invoke("next", arg); -}; - -_AsyncGenerator.prototype.throw = function (arg) { - return this._invoke("throw", arg); -}; - -_AsyncGenerator.prototype.return = function (arg) { - return this._invoke("return", arg); -}; - -function _wrapAsyncGenerator(fn) { - return function () { - return new _AsyncGenerator(fn.apply(this, arguments)); - }; -} - -function _awaitAsyncGenerator(value) { - return new _AwaitValue(value); -} - -function _asyncGeneratorDelegate(inner, awaitWrap) { - var iter = {}, - waiting = false; - - function pump(key, value) { - waiting = true; - value = new Promise(function (resolve) { - resolve(inner[key](value)); - }); - return { - done: false, - value: awaitWrap(value) - }; - } - - ; - - if (typeof Symbol === "function" && Symbol.iterator) { - iter[Symbol.iterator] = function () { - return this; - }; - } - - iter.next = function (value) { - if (waiting) { - waiting = false; - return value; - } - - return pump("next", value); - }; - - if (typeof inner.throw === "function") { - iter.throw = function (value) { - if (waiting) { - waiting = false; - throw value; - } - - return pump("throw", value); - }; - } - - if (typeof inner.return === "function") { - iter.return = function (value) { - if (waiting) { - waiting = false; - return value; - } - - return pump("return", value); - }; - } - - return iter; -} - -function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { - try { - var info = gen[key](arg); - var value = info.value; - } catch (error) { - reject(error); - return; - } - - if (info.done) { - resolve(value); - } else { - Promise.resolve(value).then(_next, _throw); - } -} - -function _asyncToGenerator(fn) { - return function () { - var self = this, - args = arguments; - return new Promise(function (resolve, reject) { - var gen = fn.apply(self, args); - - function _next(value) { - asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value); - } - - function _throw(err) { - asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err); - } - - _next(undefined); - }); - }; -} - -function _classCallCheck(instance, Constructor) { - if (!(instance instanceof Constructor)) { - throw new TypeError("Cannot call a class as a function"); - } -} - -function _defineProperties(target, props) { - for (var i = 0; i < props.length; i++) { - var descriptor = props[i]; - descriptor.enumerable = descriptor.enumerable || false; - descriptor.configurable = true; - if ("value" in descriptor) descriptor.writable = true; - Object.defineProperty(target, descriptor.key, descriptor); - } -} - -function _createClass(Constructor, protoProps, staticProps) { - if (protoProps) _defineProperties(Constructor.prototype, protoProps); - if (staticProps) _defineProperties(Constructor, staticProps); - return Constructor; -} - -function _defineEnumerableProperties(obj, descs) { - for (var key in descs) { - var desc = descs[key]; - desc.configurable = desc.enumerable = true; - if ("value" in desc) desc.writable = true; - Object.defineProperty(obj, key, desc); - } - - if (Object.getOwnPropertySymbols) { - var objectSymbols = Object.getOwnPropertySymbols(descs); - - for (var i = 0; i < objectSymbols.length; i++) { - var sym = objectSymbols[i]; - var desc = descs[sym]; - desc.configurable = desc.enumerable = true; - if ("value" in desc) desc.writable = true; - Object.defineProperty(obj, sym, desc); - } - } - - return obj; -} - -function _defaults(obj, defaults) { - var keys = Object.getOwnPropertyNames(defaults); - - for (var i = 0; i < keys.length; i++) { - var key = keys[i]; - var value = Object.getOwnPropertyDescriptor(defaults, key); - - if (value && value.configurable && obj[key] === undefined) { - Object.defineProperty(obj, key, value); - } - } - - return obj; -} - -function _defineProperty(obj, key, value) { - if (key in obj) { - Object.defineProperty(obj, key, { - value: value, - enumerable: true, - configurable: true, - writable: true - }); - } else { - obj[key] = value; - } - - return obj; -} - -function _extends() { - _extends = Object.assign || function (target) { - for (var i = 1; i < arguments.length; i++) { - var source = arguments[i]; - - for (var key in source) { - if (Object.prototype.hasOwnProperty.call(source, key)) { - target[key] = source[key]; - } - } - } - - return target; - }; - - return _extends.apply(this, arguments); -} - -function _objectSpread(target) { - for (var i = 1; i < arguments.length; i++) { - var source = arguments[i] != null ? Object(arguments[i]) : {}; - var ownKeys = Object.keys(source); - - if (typeof Object.getOwnPropertySymbols === 'function') { - ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function (sym) { - return Object.getOwnPropertyDescriptor(source, sym).enumerable; - })); - } - - ownKeys.forEach(function (key) { - _defineProperty(target, key, source[key]); - }); - } - - return target; -} - -function ownKeys(object, enumerableOnly) { - var keys = Object.keys(object); - - if (Object.getOwnPropertySymbols) { - var symbols = Object.getOwnPropertySymbols(object); - if (enumerableOnly) symbols = symbols.filter(function (sym) { - return Object.getOwnPropertyDescriptor(object, sym).enumerable; - }); - keys.push.apply(keys, symbols); - } - - return keys; -} - -function _objectSpread2(target) { - for (var i = 1; i < arguments.length; i++) { - var source = arguments[i] != null ? arguments[i] : {}; - - if (i % 2) { - ownKeys(Object(source), true).forEach(function (key) { - _defineProperty(target, key, source[key]); - }); - } else if (Object.getOwnPropertyDescriptors) { - Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); - } else { - ownKeys(Object(source)).forEach(function (key) { - Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); - }); - } - } - - return target; -} - -function _inherits(subClass, superClass) { - if (typeof superClass !== "function" && superClass !== null) { - throw new TypeError("Super expression must either be null or a function"); - } - - subClass.prototype = Object.create(superClass && superClass.prototype, { - constructor: { - value: subClass, - writable: true, - configurable: true - } - }); - if (superClass) _setPrototypeOf(subClass, superClass); -} - -function _inheritsLoose(subClass, superClass) { - subClass.prototype = Object.create(superClass.prototype); - subClass.prototype.constructor = subClass; - subClass.__proto__ = superClass; -} - -function _getPrototypeOf(o) { - _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { - return o.__proto__ || Object.getPrototypeOf(o); - }; - return _getPrototypeOf(o); -} - -function _setPrototypeOf(o, p) { - _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { - o.__proto__ = p; - return o; - }; - - 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 _construct(Parent, args, Class) { - if (_isNativeReflectConstruct()) { - _construct = Reflect.construct; - } else { - _construct = function _construct(Parent, args, Class) { - var a = [null]; - a.push.apply(a, args); - var Constructor = Function.bind.apply(Parent, a); - var instance = new Constructor(); - if (Class) _setPrototypeOf(instance, Class.prototype); - return instance; - }; - } - - return _construct.apply(null, arguments); -} - -function _isNativeFunction(fn) { - return Function.toString.call(fn).indexOf("[native code]") !== -1; -} - -function _wrapNativeSuper(Class) { - var _cache = typeof Map === "function" ? new Map() : undefined; - - _wrapNativeSuper = function _wrapNativeSuper(Class) { - if (Class === null || !_isNativeFunction(Class)) return Class; - - if (typeof Class !== "function") { - throw new TypeError("Super expression must either be null or a function"); - } - - if (typeof _cache !== "undefined") { - if (_cache.has(Class)) return _cache.get(Class); - - _cache.set(Class, Wrapper); - } - - function Wrapper() { - return _construct(Class, arguments, _getPrototypeOf(this).constructor); - } - - Wrapper.prototype = Object.create(Class.prototype, { - constructor: { - value: Wrapper, - enumerable: false, - writable: true, - configurable: true - } - }); - return _setPrototypeOf(Wrapper, Class); - }; - - return _wrapNativeSuper(Class); -} - -function _instanceof(left, right) { - if (right != null && typeof Symbol !== "undefined" && right[Symbol.hasInstance]) { - return !!right[Symbol.hasInstance](left); - } else { - return left instanceof right; - } -} - -function _interopRequireDefault(obj) { - return obj && obj.__esModule ? obj : { - default: obj - }; -} - -function _getRequireWildcardCache() { - if (typeof WeakMap !== "function") return null; - var cache = new WeakMap(); - - _getRequireWildcardCache = function () { - return cache; - }; - - return cache; -} - -function _interopRequireWildcard(obj) { - if (obj && obj.__esModule) { - return obj; - } - - if (obj === null || typeof obj !== "object" && typeof obj !== "function") { - return { - default: obj - }; - } - - var cache = _getRequireWildcardCache(); - - if (cache && cache.has(obj)) { - return cache.get(obj); - } - - var newObj = {}; - var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; - - for (var key in obj) { - if (Object.prototype.hasOwnProperty.call(obj, key)) { - var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; - - if (desc && (desc.get || desc.set)) { - Object.defineProperty(newObj, key, desc); - } else { - newObj[key] = obj[key]; - } - } - } - - newObj.default = obj; - - if (cache) { - cache.set(obj, newObj); - } - - return newObj; -} - -function _newArrowCheck(innerThis, boundThis) { - if (innerThis !== boundThis) { - throw new TypeError("Cannot instantiate an arrow function"); - } -} - -function _objectDestructuringEmpty(obj) { - if (obj == null) throw new TypeError("Cannot destructure undefined"); -} - -function _objectWithoutPropertiesLoose(source, excluded) { - if (source == null) return {}; - var target = {}; - var sourceKeys = Object.keys(source); - var key, i; - - for (i = 0; i < sourceKeys.length; i++) { - key = sourceKeys[i]; - if (excluded.indexOf(key) >= 0) continue; - target[key] = source[key]; - } - - return target; -} - -function _objectWithoutProperties(source, excluded) { - if (source == null) return {}; - - var target = _objectWithoutPropertiesLoose(source, excluded); - - var key, i; - - if (Object.getOwnPropertySymbols) { - var sourceSymbolKeys = Object.getOwnPropertySymbols(source); - - for (i = 0; i < sourceSymbolKeys.length; i++) { - key = sourceSymbolKeys[i]; - if (excluded.indexOf(key) >= 0) continue; - if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; - target[key] = source[key]; - } - } - - return target; -} - -function _assertThisInitialized(self) { - if (self === void 0) { - throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); - } - - return self; -} - -function _possibleConstructorReturn(self, call) { - if (call && (typeof call === "object" || typeof call === "function")) { - return call; - } - - return _assertThisInitialized(self); -} - -function _createSuper(Derived) { - var hasNativeReflectConstruct = _isNativeReflectConstruct(); - - return function _createSuperInternal() { - var Super = _getPrototypeOf(Derived), - result; - - if (hasNativeReflectConstruct) { - 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); - if (object === null) break; - } - - return object; -} - -function _get(target, property, receiver) { - if (typeof Reflect !== "undefined" && Reflect.get) { - _get = Reflect.get; - } else { - _get = function _get(target, property, receiver) { - var base = _superPropBase(target, property); - - if (!base) return; - var desc = Object.getOwnPropertyDescriptor(base, property); - - if (desc.get) { - return desc.get.call(receiver); - } - - return desc.value; - }; - } - - return _get(target, property, receiver || target); -} - -function set(target, property, value, receiver) { - if (typeof Reflect !== "undefined" && Reflect.set) { - set = Reflect.set; - } else { - set = function set(target, property, value, receiver) { - var base = _superPropBase(target, property); - - var desc; - - if (base) { - desc = Object.getOwnPropertyDescriptor(base, property); - - if (desc.set) { - desc.set.call(receiver, value); - return true; - } else if (!desc.writable) { - return false; - } - } - - desc = Object.getOwnPropertyDescriptor(receiver, property); - - if (desc) { - if (!desc.writable) { - return false; - } - - desc.value = value; - Object.defineProperty(receiver, property, desc); - } else { - _defineProperty(receiver, property, value); - } - - return true; - }; - } - - return set(target, property, value, receiver); -} - -function _set(target, property, value, receiver, isStrict) { - var s = set(target, property, value, receiver || target); - - if (!s && isStrict) { - throw new Error('failed to set property'); - } - - return value; -} - -function _taggedTemplateLiteral(strings, raw) { - if (!raw) { - raw = strings.slice(0); - } - - return Object.freeze(Object.defineProperties(strings, { - raw: { - value: Object.freeze(raw) - } - })); -} - -function _taggedTemplateLiteralLoose(strings, raw) { - if (!raw) { - raw = strings.slice(0); - } - - strings.raw = raw; - return strings; -} - -function _readOnlyError(name) { - throw new Error("\"" + name + "\" is read-only"); -} - -function _classNameTDZError(name) { - throw new Error("Class \"" + name + "\" cannot be referenced in computed property keys."); -} - -function _temporalUndefined() {} - -function _tdz(name) { - throw new ReferenceError(name + " is not defined - temporal dead zone"); -} - -function _temporalRef(val, name) { - return val === _temporalUndefined ? _tdz(name) : val; -} - -function _slicedToArray(arr, i) { - return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); -} - -function _slicedToArrayLoose(arr, i) { - return _arrayWithHoles(arr) || _iterableToArrayLimitLoose(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); -} - -function _toArray(arr) { - return _arrayWithHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableRest(); -} - -function _toConsumableArray(arr) { - return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); -} - -function _arrayWithoutHoles(arr) { - if (Array.isArray(arr)) return _arrayLikeToArray(arr); -} - -function _arrayWithHoles(arr) { - if (Array.isArray(arr)) return arr; -} - -function _maybeArrayLike(next, arr, i) { - if (arr && !Array.isArray(arr) && typeof arr.length === "number") { - var len = arr.length; - return _arrayLikeToArray(arr, i !== void 0 && i < len ? i : len); - } - - return next(arr, i); -} - -function _iterableToArray(iter) { - if (typeof Symbol !== "undefined" && Symbol.iterator in Object(iter)) return Array.from(iter); -} - -function _iterableToArrayLimit(arr, i) { - if (typeof Symbol === "undefined" || !(Symbol.iterator in Object(arr))) return; - var _arr = []; - var _n = true; - var _d = false; - var _e = undefined; - - try { - for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { - _arr.push(_s.value); - - if (i && _arr.length === i) break; - } - } catch (err) { - _d = true; - _e = err; - } finally { - try { - if (!_n && _i["return"] != null) _i["return"](); - } finally { - if (_d) throw _e; - } - } - - return _arr; -} - -function _iterableToArrayLimitLoose(arr, i) { - if (typeof Symbol === "undefined" || !(Symbol.iterator in Object(arr))) return; - var _arr = []; - - for (var _iterator = arr[Symbol.iterator](), _step; !(_step = _iterator.next()).done;) { - _arr.push(_step.value); - - if (i && _arr.length === i) break; - } - - 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(o); - 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.\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.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); -} - -function _createForOfIteratorHelper(o, allowArrayLike) { - var it; - - if (typeof Symbol === "undefined" || o[Symbol.iterator] == null) { - if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") { - if (it) o = it; - 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 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; - } - } - }; -} - -function _createForOfIteratorHelperLoose(o, allowArrayLike) { - var it; - - if (typeof Symbol === "undefined" || o[Symbol.iterator] == null) { - if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") { - if (it) o = it; - var i = 0; - return function () { - if (i >= o.length) return { - done: true - }; - return { - done: false, - value: o[i++] - }; - }; - } - - throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); - } - - it = o[Symbol.iterator](); - return it.next.bind(it); -} - -function _skipFirstGeneratorNext(fn) { - return function () { - var it = fn.apply(this, arguments); - it.next(); - return it; - }; -} - -function _toPrimitive(input, hint) { - if (typeof input !== "object" || input === null) return input; - var prim = input[Symbol.toPrimitive]; - - if (prim !== undefined) { - var res = prim.call(input, hint || "default"); - if (typeof res !== "object") return res; - throw new TypeError("@@toPrimitive must return a primitive value."); - } - - return (hint === "string" ? String : Number)(input); -} - -function _toPropertyKey(arg) { - var key = _toPrimitive(arg, "string"); - - return typeof key === "symbol" ? key : String(key); -} - -function _initializerWarningHelper(descriptor, context) { - throw new Error('Decorating class property failed. Please ensure that ' + 'proposal-class-properties is enabled and runs after the decorators transform.'); -} - -function _initializerDefineProperty(target, property, descriptor, context) { - if (!descriptor) return; - Object.defineProperty(target, property, { - enumerable: descriptor.enumerable, - configurable: descriptor.configurable, - writable: descriptor.writable, - value: descriptor.initializer ? descriptor.initializer.call(context) : void 0 - }); -} - -function _applyDecoratedDescriptor(target, property, decorators, descriptor, context) { - var desc = {}; - Object.keys(descriptor).forEach(function (key) { - desc[key] = descriptor[key]; - }); - desc.enumerable = !!desc.enumerable; - desc.configurable = !!desc.configurable; - - if ('value' in desc || desc.initializer) { - desc.writable = true; - } - - desc = decorators.slice().reverse().reduce(function (desc, decorator) { - return decorator(target, property, desc) || desc; - }, desc); - - if (context && desc.initializer !== void 0) { - desc.value = desc.initializer ? desc.initializer.call(context) : void 0; - desc.initializer = undefined; - } - - if (desc.initializer === void 0) { - Object.defineProperty(target, property, desc); - desc = null; - } - - return desc; -} - -var id = 0; - -function _classPrivateFieldLooseKey(name) { - return "__private_" + id++ + "_" + name; -} - -function _classPrivateFieldLooseBase(receiver, privateKey) { - if (!Object.prototype.hasOwnProperty.call(receiver, privateKey)) { - throw new TypeError("attempted to use private field on non-instance"); - } - - return receiver; -} - -function _classPrivateFieldGet(receiver, privateMap) { - var descriptor = privateMap.get(receiver); - - if (!descriptor) { - throw new TypeError("attempted to get private field on non-instance"); - } - - if (descriptor.get) { - return descriptor.get.call(receiver); - } - - return descriptor.value; -} - -function _classPrivateFieldSet(receiver, privateMap, value) { - var descriptor = privateMap.get(receiver); - - if (!descriptor) { - throw new TypeError("attempted to set private field on non-instance"); - } - - if (descriptor.set) { - descriptor.set.call(receiver, value); - } else { - if (!descriptor.writable) { - throw new TypeError("attempted to set read only private field"); - } - - descriptor.value = value; - } - - return value; -} - -function _classPrivateFieldDestructureSet(receiver, privateMap) { - if (!privateMap.has(receiver)) { - throw new TypeError("attempted to set private field on non-instance"); - } - - var descriptor = privateMap.get(receiver); - - if (descriptor.set) { - if (!("__destrObj" in descriptor)) { - descriptor.__destrObj = { - set value(v) { - descriptor.set.call(receiver, v); - } - - }; - } - - return descriptor.__destrObj; - } else { - if (!descriptor.writable) { - throw new TypeError("attempted to set read only private field"); - } - - return descriptor; - } -} - -function _classStaticPrivateFieldSpecGet(receiver, classConstructor, descriptor) { - if (receiver !== classConstructor) { - throw new TypeError("Private static access of wrong provenance"); - } - - if (descriptor.get) { - return descriptor.get.call(receiver); - } - - return descriptor.value; -} - -function _classStaticPrivateFieldSpecSet(receiver, classConstructor, descriptor, value) { - if (receiver !== classConstructor) { - throw new TypeError("Private static access of wrong provenance"); - } - - if (descriptor.set) { - descriptor.set.call(receiver, value); - } else { - if (!descriptor.writable) { - throw new TypeError("attempted to set read only private field"); - } - - descriptor.value = value; - } - - return value; -} - -function _classStaticPrivateMethodGet(receiver, classConstructor, method) { - if (receiver !== classConstructor) { - throw new TypeError("Private static access of wrong provenance"); - } - - return method; -} - -function _classStaticPrivateMethodSet() { - throw new TypeError("attempted to set read only static private field"); -} - -function _decorate(decorators, factory, superClass, mixins) { - var api = _getDecoratorsApi(); - - if (mixins) { - for (var i = 0; i < mixins.length; i++) { - api = mixins[i](api); - } - } - - var r = factory(function initialize(O) { - api.initializeInstanceElements(O, decorated.elements); - }, superClass); - var decorated = api.decorateClass(_coalesceClassElements(r.d.map(_createElementDescriptor)), decorators); - api.initializeClassElements(r.F, decorated.elements); - return api.runClassFinishers(r.F, decorated.finishers); -} - -function _getDecoratorsApi() { - _getDecoratorsApi = function () { - return api; - }; - - var api = { - elementsDefinitionOrder: [["method"], ["field"]], - initializeInstanceElements: function (O, elements) { - ["method", "field"].forEach(function (kind) { - elements.forEach(function (element) { - if (element.kind === kind && element.placement === "own") { - this.defineClassElement(O, element); - } - }, this); - }, this); - }, - initializeClassElements: function (F, elements) { - var proto = F.prototype; - ["method", "field"].forEach(function (kind) { - elements.forEach(function (element) { - var placement = element.placement; - - if (element.kind === kind && (placement === "static" || placement === "prototype")) { - var receiver = placement === "static" ? F : proto; - this.defineClassElement(receiver, element); - } - }, this); - }, this); - }, - defineClassElement: function (receiver, element) { - var descriptor = element.descriptor; - - if (element.kind === "field") { - var initializer = element.initializer; - descriptor = { - enumerable: descriptor.enumerable, - writable: descriptor.writable, - configurable: descriptor.configurable, - value: initializer === void 0 ? void 0 : initializer.call(receiver) - }; - } - - Object.defineProperty(receiver, element.key, descriptor); - }, - decorateClass: function (elements, decorators) { - var newElements = []; - var finishers = []; - var placements = { - static: [], - prototype: [], - own: [] - }; - elements.forEach(function (element) { - this.addElementPlacement(element, placements); - }, this); - elements.forEach(function (element) { - if (!_hasDecorators(element)) return newElements.push(element); - var elementFinishersExtras = this.decorateElement(element, placements); - newElements.push(elementFinishersExtras.element); - newElements.push.apply(newElements, elementFinishersExtras.extras); - finishers.push.apply(finishers, elementFinishersExtras.finishers); - }, this); - - if (!decorators) { - return { - elements: newElements, - finishers: finishers - }; - } - - var result = this.decorateConstructor(newElements, decorators); - finishers.push.apply(finishers, result.finishers); - result.finishers = finishers; - return result; - }, - addElementPlacement: function (element, placements, silent) { - var keys = placements[element.placement]; - - if (!silent && keys.indexOf(element.key) !== -1) { - throw new TypeError("Duplicated element (" + element.key + ")"); - } - - keys.push(element.key); - }, - decorateElement: function (element, placements) { - var extras = []; - var finishers = []; - - for (var decorators = element.decorators, i = decorators.length - 1; i >= 0; i--) { - var keys = placements[element.placement]; - keys.splice(keys.indexOf(element.key), 1); - var elementObject = this.fromElementDescriptor(element); - var elementFinisherExtras = this.toElementFinisherExtras((0, decorators[i])(elementObject) || elementObject); - element = elementFinisherExtras.element; - this.addElementPlacement(element, placements); - - if (elementFinisherExtras.finisher) { - finishers.push(elementFinisherExtras.finisher); - } - - var newExtras = elementFinisherExtras.extras; - - if (newExtras) { - for (var j = 0; j < newExtras.length; j++) { - this.addElementPlacement(newExtras[j], placements); - } - - extras.push.apply(extras, newExtras); - } - } - - return { - element: element, - finishers: finishers, - extras: extras - }; - }, - decorateConstructor: function (elements, decorators) { - var finishers = []; - - for (var i = decorators.length - 1; i >= 0; i--) { - var obj = this.fromClassDescriptor(elements); - var elementsAndFinisher = this.toClassDescriptor((0, decorators[i])(obj) || obj); - - if (elementsAndFinisher.finisher !== undefined) { - finishers.push(elementsAndFinisher.finisher); - } - - if (elementsAndFinisher.elements !== undefined) { - elements = elementsAndFinisher.elements; - - for (var j = 0; j < elements.length - 1; j++) { - for (var k = j + 1; k < elements.length; k++) { - if (elements[j].key === elements[k].key && elements[j].placement === elements[k].placement) { - throw new TypeError("Duplicated element (" + elements[j].key + ")"); - } - } - } - } - } - - return { - elements: elements, - finishers: finishers - }; - }, - fromElementDescriptor: function (element) { - var obj = { - kind: element.kind, - key: element.key, - placement: element.placement, - descriptor: element.descriptor - }; - var desc = { - value: "Descriptor", - configurable: true - }; - Object.defineProperty(obj, Symbol.toStringTag, desc); - if (element.kind === "field") obj.initializer = element.initializer; - return obj; - }, - toElementDescriptors: function (elementObjects) { - if (elementObjects === undefined) return; - return _toArray(elementObjects).map(function (elementObject) { - var element = this.toElementDescriptor(elementObject); - this.disallowProperty(elementObject, "finisher", "An element descriptor"); - this.disallowProperty(elementObject, "extras", "An element descriptor"); - return element; - }, this); - }, - toElementDescriptor: function (elementObject) { - var kind = String(elementObject.kind); - - if (kind !== "method" && kind !== "field") { - throw new TypeError('An element descriptor\'s .kind property must be either "method" or' + ' "field", but a decorator created an element descriptor with' + ' .kind "' + kind + '"'); - } - - var key = _toPropertyKey(elementObject.key); - - var placement = String(elementObject.placement); - - if (placement !== "static" && placement !== "prototype" && placement !== "own") { - throw new TypeError('An element descriptor\'s .placement property must be one of "static",' + ' "prototype" or "own", but a decorator created an element descriptor' + ' with .placement "' + placement + '"'); - } - - var descriptor = elementObject.descriptor; - this.disallowProperty(elementObject, "elements", "An element descriptor"); - var element = { - kind: kind, - key: key, - placement: placement, - descriptor: Object.assign({}, descriptor) - }; - - if (kind !== "field") { - this.disallowProperty(elementObject, "initializer", "A method descriptor"); - } else { - this.disallowProperty(descriptor, "get", "The property descriptor of a field descriptor"); - this.disallowProperty(descriptor, "set", "The property descriptor of a field descriptor"); - this.disallowProperty(descriptor, "value", "The property descriptor of a field descriptor"); - element.initializer = elementObject.initializer; - } - - return element; - }, - toElementFinisherExtras: function (elementObject) { - var element = this.toElementDescriptor(elementObject); - - var finisher = _optionalCallableProperty(elementObject, "finisher"); - - var extras = this.toElementDescriptors(elementObject.extras); - return { - element: element, - finisher: finisher, - extras: extras - }; - }, - fromClassDescriptor: function (elements) { - var obj = { - kind: "class", - elements: elements.map(this.fromElementDescriptor, this) - }; - var desc = { - value: "Descriptor", - configurable: true - }; - Object.defineProperty(obj, Symbol.toStringTag, desc); - return obj; - }, - toClassDescriptor: function (obj) { - var kind = String(obj.kind); - - if (kind !== "class") { - throw new TypeError('A class descriptor\'s .kind property must be "class", but a decorator' + ' created a class descriptor with .kind "' + kind + '"'); - } - - this.disallowProperty(obj, "key", "A class descriptor"); - this.disallowProperty(obj, "placement", "A class descriptor"); - this.disallowProperty(obj, "descriptor", "A class descriptor"); - this.disallowProperty(obj, "initializer", "A class descriptor"); - this.disallowProperty(obj, "extras", "A class descriptor"); - - var finisher = _optionalCallableProperty(obj, "finisher"); - - var elements = this.toElementDescriptors(obj.elements); - return { - elements: elements, - finisher: finisher - }; - }, - runClassFinishers: function (constructor, finishers) { - for (var i = 0; i < finishers.length; i++) { - var newConstructor = (0, finishers[i])(constructor); - - if (newConstructor !== undefined) { - if (typeof newConstructor !== "function") { - throw new TypeError("Finishers must return a constructor."); - } - - constructor = newConstructor; - } - } - - return constructor; - }, - disallowProperty: function (obj, name, objectType) { - if (obj[name] !== undefined) { - throw new TypeError(objectType + " can't have a ." + name + " property."); - } - } - }; - return api; -} - -function _createElementDescriptor(def) { - var key = _toPropertyKey(def.key); - - var descriptor; - - if (def.kind === "method") { - descriptor = { - value: def.value, - writable: true, - configurable: true, - enumerable: false - }; - } else if (def.kind === "get") { - descriptor = { - get: def.value, - configurable: true, - enumerable: false - }; - } else if (def.kind === "set") { - descriptor = { - set: def.value, - configurable: true, - enumerable: false - }; - } else if (def.kind === "field") { - descriptor = { - configurable: true, - writable: true, - enumerable: true - }; - } - - var element = { - kind: def.kind === "field" ? "field" : "method", - key: key, - placement: def.static ? "static" : def.kind === "field" ? "own" : "prototype", - descriptor: descriptor - }; - if (def.decorators) element.decorators = def.decorators; - if (def.kind === "field") element.initializer = def.value; - return element; -} - -function _coalesceGetterSetter(element, other) { - if (element.descriptor.get !== undefined) { - other.descriptor.get = element.descriptor.get; - } else { - other.descriptor.set = element.descriptor.set; - } -} - -function _coalesceClassElements(elements) { - var newElements = []; - - var isSameElement = function (other) { - return other.kind === "method" && other.key === element.key && other.placement === element.placement; - }; - - for (var i = 0; i < elements.length; i++) { - var element = elements[i]; - var other; - - if (element.kind === "method" && (other = newElements.find(isSameElement))) { - if (_isDataDescriptor(element.descriptor) || _isDataDescriptor(other.descriptor)) { - if (_hasDecorators(element) || _hasDecorators(other)) { - throw new ReferenceError("Duplicated methods (" + element.key + ") can't be decorated."); - } - - other.descriptor = element.descriptor; - } else { - if (_hasDecorators(element)) { - if (_hasDecorators(other)) { - throw new ReferenceError("Decorators can't be placed on different accessors with for " + "the same property (" + element.key + ")."); - } - - other.decorators = element.decorators; - } - - _coalesceGetterSetter(element, other); - } - } else { - newElements.push(element); - } - } - - return newElements; -} - -function _hasDecorators(element) { - return element.decorators && element.decorators.length; -} - -function _isDataDescriptor(desc) { - return desc !== undefined && !(desc.value === undefined && desc.writable === undefined); -} - -function _optionalCallableProperty(obj, name) { - var value = obj[name]; - - if (value !== undefined && typeof value !== "function") { - throw new TypeError("Expected '" + name + "' to be a function"); - } - - return value; -} - -function _classPrivateMethodGet(receiver, privateSet, fn) { - if (!privateSet.has(receiver)) { - throw new TypeError("attempted to get private field on non-instance"); - } - - return fn; -} - -function _classPrivateMethodSet() { - throw new TypeError("attempted to reassign private method"); -} - -function _wrapRegExp(re, groups) { - _wrapRegExp = function (re, groups) { - return new BabelRegExp(re, undefined, groups); - }; - - var _RegExp = _wrapNativeSuper(RegExp); - - var _super = RegExp.prototype; - - var _groups = new WeakMap(); - - function BabelRegExp(re, flags, groups) { - var _this = _RegExp.call(this, re, flags); - - _groups.set(_this, groups || _groups.get(re)); - - return _this; - } - - _inherits(BabelRegExp, _RegExp); - - BabelRegExp.prototype.exec = function (str) { - var result = _super.exec.call(this, str); - - if (result) result.groups = buildGroups(result, this); - return result; - }; - - BabelRegExp.prototype[Symbol.replace] = function (str, substitution) { - if (typeof substitution === "string") { - var groups = _groups.get(this); - - return _super[Symbol.replace].call(this, str, substitution.replace(/\$<([^>]+)>/g, function (_, name) { - return "$" + groups[name]; - })); - } else if (typeof substitution === "function") { - var _this = this; - - return _super[Symbol.replace].call(this, str, function () { - var args = []; - args.push.apply(args, arguments); - - if (typeof args[args.length - 1] !== "object") { - args.push(buildGroups(args, _this)); - } - - return substitution.apply(this, args); - }); - } else { - return _super[Symbol.replace].call(this, str, substitution); - } - }; - - function buildGroups(result, re) { - var g = _groups.get(re); - - return Object.keys(g).reduce(function (groups, name) { - groups[name] = result[g[name]]; - return groups; - }, Object.create(null)); - } - - return _wrapRegExp.apply(this, arguments); -} - +function _AwaitValue(e){this.wrapped=e}function _AsyncGenerator(e){var t,r;function resume(t,r){try{var n=e[t](r),o=n.value,i=o instanceof _AwaitValue;Promise.resolve(i?o.wrapped:o).then((function(e){i?resume("return"===t?"return":"next",e):settle(n.done?"return":"normal",e)}),(function(e){resume("throw",e)}))}catch(e){settle("throw",e)}}function settle(e,n){switch(e){case"return":t.resolve({value:n,done:!0});break;case"throw":t.reject(n);break;default:t.resolve({value:n,done:!1})}(t=t.next)?resume(t.key,t.arg):r=null}this._invoke=function send(e,n){return new Promise((function(o,i){var a={key:e,arg:n,resolve:o,reject:i,next:null};r?r=r.next=a:(t=r=a,resume(e,n))}))},"function"!=typeof e.return&&(this.return=void 0)}function asyncGeneratorStep(e,t,r,n,o,i,a){try{var s=e[i](a),c=s.value}catch(e){return void r(e)}s.done?t(c):Promise.resolve(c).then(n,o)}"function"==typeof Symbol&&Symbol.asyncIterator&&(_AsyncGenerator.prototype[Symbol.asyncIterator]=function(){return this}),_AsyncGenerator.prototype.next=function(e){return this._invoke("next",e)},_AsyncGenerator.prototype.throw=function(e){return this._invoke("throw",e)},_AsyncGenerator.prototype.return=function(e){return this._invoke("return",e)}; /** * @file ext-eyedropper.js * @@ -1654,157 +7,5 @@ function _wrapRegExp(re, groups) { * @copyright 2010 Jeff Schiller * */ -var extEyedropper = { - name: 'eyedropper', - init: function init(S) { - var _this = this; - - return _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee() { - var strings, svgEditor, $, ChangeElementCommand, svgCanvas, addToHistory, currentStyle, getStyle, buttons; - return regeneratorRuntime.wrap(function _callee$(_context) { - while (1) { - switch (_context.prev = _context.next) { - case 0: - getStyle = function _getStyle(opts) { - // if we are in eyedropper mode, we don't want to disable the eye-dropper tool - var mode = svgCanvas.getMode(); - - if (mode === 'eyedropper') { - return; - } - - var tool = $('#tool_eyedropper'); // enable-eye-dropper if one element is selected - - var elem = null; - - if (!opts.multiselected && opts.elems[0] && !['svg', 'g', 'use'].includes(opts.elems[0].nodeName)) { - elem = opts.elems[0]; - tool.removeClass('disabled'); // grab the current style - - currentStyle.fillPaint = elem.getAttribute('fill') || 'black'; - currentStyle.fillOpacity = elem.getAttribute('fill-opacity') || 1.0; - currentStyle.strokePaint = elem.getAttribute('stroke'); - currentStyle.strokeOpacity = elem.getAttribute('stroke-opacity') || 1.0; - currentStyle.strokeWidth = elem.getAttribute('stroke-width'); - currentStyle.strokeDashArray = elem.getAttribute('stroke-dasharray'); - currentStyle.strokeLinecap = elem.getAttribute('stroke-linecap'); - currentStyle.strokeLinejoin = elem.getAttribute('stroke-linejoin'); - currentStyle.opacity = elem.getAttribute('opacity') || 1.0; // disable eye-dropper tool - } else { - tool.addClass('disabled'); - } - }; - - _context.next = 3; - return S.importLocale(); - - case 3: - strings = _context.sent; - svgEditor = _this; - $ = S.$, ChangeElementCommand = S.ChangeElementCommand, svgCanvas = svgEditor.canvas, addToHistory = function addToHistory(cmd) { - svgCanvas.undoMgr.addCommandToHistory(cmd); - }, currentStyle = { - fillPaint: 'red', - fillOpacity: 1.0, - strokePaint: 'black', - strokeOpacity: 1.0, - strokeWidth: 5, - strokeDashArray: null, - opacity: 1.0, - strokeLinecap: 'butt', - strokeLinejoin: 'miter' - }; - /** - * - * @param {module:svgcanvas.SvgCanvas#event:ext_selectedChanged|module:svgcanvas.SvgCanvas#event:ext_elementChanged} opts - * @returns {void} - */ - - buttons = [{ - id: 'tool_eyedropper', - icon: 'eyedropper.png', - type: 'mode', - events: { - click: function click() { - svgCanvas.setMode('eyedropper'); - } - } - }]; - return _context.abrupt("return", { - name: strings.name, - svgicons: 'eyedropper-icon.xml', - buttons: strings.buttons.map(function (button, i) { - return Object.assign(buttons[i], button); - }), - // if we have selected an element, grab its paint and enable the eye dropper button - selectedChanged: getStyle, - elementChanged: getStyle, - mouseDown: function mouseDown(opts) { - var mode = svgCanvas.getMode(); - - if (mode === 'eyedropper') { - var e = opts.event; - var target = e.target; - - if (!['svg', 'g', 'use'].includes(target.nodeName)) { - var changes = {}; - - var change = function change(elem, attrname, newvalue) { - changes[attrname] = elem.getAttribute(attrname); - elem.setAttribute(attrname, newvalue); - }; - - if (currentStyle.fillPaint) { - change(target, 'fill', currentStyle.fillPaint); - } - - if (currentStyle.fillOpacity) { - change(target, 'fill-opacity', currentStyle.fillOpacity); - } - - if (currentStyle.strokePaint) { - change(target, 'stroke', currentStyle.strokePaint); - } - - if (currentStyle.strokeOpacity) { - change(target, 'stroke-opacity', currentStyle.strokeOpacity); - } - - if (currentStyle.strokeWidth) { - change(target, 'stroke-width', currentStyle.strokeWidth); - } - - if (currentStyle.strokeDashArray) { - change(target, 'stroke-dasharray', currentStyle.strokeDashArray); - } - - if (currentStyle.opacity) { - change(target, 'opacity', currentStyle.opacity); - } - - if (currentStyle.strokeLinecap) { - change(target, 'stroke-linecap', currentStyle.strokeLinecap); - } - - if (currentStyle.strokeLinejoin) { - change(target, 'stroke-linejoin', currentStyle.strokeLinejoin); - } - - addToHistory(new ChangeElementCommand(target, changes)); - } - } - } - }); - - case 8: - case "end": - return _context.stop(); - } - } - }, _callee); - }))(); - } -}; - -export default extEyedropper; +var e={name:"eyedropper",init:function init(e){var t=this;return function _asyncToGenerator(e){return function(){var t=this,r=arguments;return new Promise((function(n,o){var i=e.apply(t,r);function _next(e){asyncGeneratorStep(i,n,o,_next,_throw,"next",e)}function _throw(e){asyncGeneratorStep(i,n,o,_next,_throw,"throw",e)}_next(void 0)}))}}(regeneratorRuntime.mark((function _callee(){var r,n,o,i,a,s,c,u,l;return regeneratorRuntime.wrap((function _callee$(p){for(;;)switch(p.prev=p.next){case 0:return u=function _getStyle(e){if("eyedropper"!==a.getMode()){var t=o("#tool_eyedropper"),r=null;e.multiselected||!e.elems[0]||["svg","g","use"].includes(e.elems[0].nodeName)?t.addClass("disabled"):(r=e.elems[0],t.removeClass("disabled"),c.fillPaint=r.getAttribute("fill")||"black",c.fillOpacity=r.getAttribute("fill-opacity")||1,c.strokePaint=r.getAttribute("stroke"),c.strokeOpacity=r.getAttribute("stroke-opacity")||1,c.strokeWidth=r.getAttribute("stroke-width"),c.strokeDashArray=r.getAttribute("stroke-dasharray"),c.strokeLinecap=r.getAttribute("stroke-linecap"),c.strokeLinejoin=r.getAttribute("stroke-linejoin"),c.opacity=r.getAttribute("opacity")||1)}},p.next=3,e.importLocale();case 3:return r=p.sent,n=t,o=e.$,i=e.ChangeElementCommand,a=n.canvas,s=function addToHistory(e){a.undoMgr.addCommandToHistory(e)},c={fillPaint:"red",fillOpacity:1,strokePaint:"black",strokeOpacity:1,strokeWidth:5,strokeDashArray:null,opacity:1,strokeLinecap:"butt",strokeLinejoin:"miter"},l=[{id:"tool_eyedropper",icon:"eyedropper.png",type:"mode",events:{click:function click(){a.setMode("eyedropper")}}}],p.abrupt("return",{name:r.name,svgicons:"eyedropper-icon.xml",buttons:r.buttons.map((function(e,t){return Object.assign(l[t],e)})),selectedChanged:u,elementChanged:u,mouseDown:function mouseDown(e){if("eyedropper"===a.getMode()){var t=e.event.target;if(!["svg","g","use"].includes(t.nodeName)){var r={},n=function change(e,t,n){r[t]=e.getAttribute(t),e.setAttribute(t,n)};c.fillPaint&&n(t,"fill",c.fillPaint),c.fillOpacity&&n(t,"fill-opacity",c.fillOpacity),c.strokePaint&&n(t,"stroke",c.strokePaint),c.strokeOpacity&&n(t,"stroke-opacity",c.strokeOpacity),c.strokeWidth&&n(t,"stroke-width",c.strokeWidth),c.strokeDashArray&&n(t,"stroke-dasharray",c.strokeDashArray),c.opacity&&n(t,"opacity",c.opacity),c.strokeLinecap&&n(t,"stroke-linecap",c.strokeLinecap),c.strokeLinejoin&&n(t,"stroke-linejoin",c.strokeLinejoin),s(new i(t,r))}}}});case 8:case"end":return p.stop()}}),_callee)})))()}};export default e; //# sourceMappingURL=ext-eyedropper.js.map diff --git a/dist/editor/extensions/ext-eyedropper.js.map b/dist/editor/extensions/ext-eyedropper.js.map index 2fba5956..6f30a215 100644 --- a/dist/editor/extensions/ext-eyedropper.js.map +++ b/dist/editor/extensions/ext-eyedropper.js.map @@ -1 +1 @@ -{"version":3,"file":"ext-eyedropper.js","sources":["../../../src/editor/extensions/ext-eyedropper.js"],"sourcesContent":["/**\n * @file ext-eyedropper.js\n *\n * @license MIT\n *\n * @copyright 2010 Jeff Schiller\n *\n */\n\nexport default {\n name: 'eyedropper',\n async init (S) {\n const strings = await S.importLocale();\n const svgEditor = this;\n const {$, ChangeElementCommand} = S, // , svgcontent,\n // svgdoc = S.svgroot.parentNode.ownerDocument,\n svgCanvas = svgEditor.canvas,\n addToHistory = function (cmd) { svgCanvas.undoMgr.addCommandToHistory(cmd); },\n currentStyle = {\n fillPaint: 'red', fillOpacity: 1.0,\n strokePaint: 'black', strokeOpacity: 1.0,\n strokeWidth: 5, strokeDashArray: null,\n opacity: 1.0,\n strokeLinecap: 'butt',\n strokeLinejoin: 'miter'\n };\n\n /**\n *\n * @param {module:svgcanvas.SvgCanvas#event:ext_selectedChanged|module:svgcanvas.SvgCanvas#event:ext_elementChanged} opts\n * @returns {void}\n */\n function getStyle (opts) {\n // if we are in eyedropper mode, we don't want to disable the eye-dropper tool\n const mode = svgCanvas.getMode();\n if (mode === 'eyedropper') { return; }\n\n const tool = $('#tool_eyedropper');\n // enable-eye-dropper if one element is selected\n let elem = null;\n if (!opts.multiselected && opts.elems[0] &&\n !['svg', 'g', 'use'].includes(opts.elems[0].nodeName)\n ) {\n elem = opts.elems[0];\n tool.removeClass('disabled');\n // grab the current style\n currentStyle.fillPaint = elem.getAttribute('fill') || 'black';\n currentStyle.fillOpacity = elem.getAttribute('fill-opacity') || 1.0;\n currentStyle.strokePaint = elem.getAttribute('stroke');\n currentStyle.strokeOpacity = elem.getAttribute('stroke-opacity') || 1.0;\n currentStyle.strokeWidth = elem.getAttribute('stroke-width');\n currentStyle.strokeDashArray = elem.getAttribute('stroke-dasharray');\n currentStyle.strokeLinecap = elem.getAttribute('stroke-linecap');\n currentStyle.strokeLinejoin = elem.getAttribute('stroke-linejoin');\n currentStyle.opacity = elem.getAttribute('opacity') || 1.0;\n // disable eye-dropper tool\n } else {\n tool.addClass('disabled');\n }\n }\n\n const buttons = [\n {\n id: 'tool_eyedropper',\n icon: 'eyedropper.png',\n type: 'mode',\n events: {\n click () {\n svgCanvas.setMode('eyedropper');\n }\n }\n }\n ];\n\n return {\n name: strings.name,\n svgicons: 'eyedropper-icon.xml',\n buttons: strings.buttons.map((button, i) => {\n return Object.assign(buttons[i], button);\n }),\n\n // if we have selected an element, grab its paint and enable the eye dropper button\n selectedChanged: getStyle,\n elementChanged: getStyle,\n\n mouseDown (opts) {\n const mode = svgCanvas.getMode();\n if (mode === 'eyedropper') {\n const e = opts.event;\n const {target} = e;\n if (!['svg', 'g', 'use'].includes(target.nodeName)) {\n const changes = {};\n\n const change = function (elem, attrname, newvalue) {\n changes[attrname] = elem.getAttribute(attrname);\n elem.setAttribute(attrname, newvalue);\n };\n\n if (currentStyle.fillPaint) { change(target, 'fill', currentStyle.fillPaint); }\n if (currentStyle.fillOpacity) { change(target, 'fill-opacity', currentStyle.fillOpacity); }\n if (currentStyle.strokePaint) { change(target, 'stroke', currentStyle.strokePaint); }\n if (currentStyle.strokeOpacity) { change(target, 'stroke-opacity', currentStyle.strokeOpacity); }\n if (currentStyle.strokeWidth) { change(target, 'stroke-width', currentStyle.strokeWidth); }\n if (currentStyle.strokeDashArray) { change(target, 'stroke-dasharray', currentStyle.strokeDashArray); }\n if (currentStyle.opacity) { change(target, 'opacity', currentStyle.opacity); }\n if (currentStyle.strokeLinecap) { change(target, 'stroke-linecap', currentStyle.strokeLinecap); }\n if (currentStyle.strokeLinejoin) { change(target, 'stroke-linejoin', currentStyle.strokeLinejoin); }\n\n addToHistory(new ChangeElementCommand(target, changes));\n }\n }\n }\n };\n }\n};\n"],"names":["name","init","S","getStyle","opts","mode","svgCanvas","getMode","tool","$","elem","multiselected","elems","includes","nodeName","removeClass","currentStyle","fillPaint","getAttribute","fillOpacity","strokePaint","strokeOpacity","strokeWidth","strokeDashArray","strokeLinecap","strokeLinejoin","opacity","addClass","importLocale","strings","svgEditor","ChangeElementCommand","canvas","addToHistory","cmd","undoMgr","addCommandToHistory","buttons","id","icon","type","events","click","setMode","svgicons","map","button","i","Object","assign","selectedChanged","elementChanged","mouseDown","e","event","target","changes","change","attrname","newvalue","setAttribute"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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AACrF,0BAAIJ,YAAY,CAACK,aAAjB,EAAgC;AAAEoC,wBAAAA,MAAM,CAACF,MAAD,EAAS,gBAAT,EAA2BvC,YAAY,CAACK,aAAxC,CAAN;AAA+D;;AACjG,0BAAIL,YAAY,CAACM,WAAjB,EAA8B;AAAEmC,wBAAAA,MAAM,CAACF,MAAD,EAAS,cAAT,EAAyBvC,YAAY,CAACM,WAAtC,CAAN;AAA2D;;AAC3F,0BAAIN,YAAY,CAACO,eAAjB,EAAkC;AAAEkC,wBAAAA,MAAM,CAACF,MAAD,EAAS,kBAAT,EAA6BvC,YAAY,CAACO,eAA1C,CAAN;AAAmE;;AACvG,0BAAIP,YAAY,CAACU,OAAjB,EAA0B;AAAE+B,wBAAAA,MAAM,CAACF,MAAD,EAAS,SAAT,EAAoBvC,YAAY,CAACU,OAAjC,CAAN;AAAkD;;AAC9E,0BAAIV,YAAY,CAACQ,aAAjB,EAAgC;AAAEiC,wBAAAA,MAAM,CAACF,MAAD,EAAS,gBAAT,EAA2BvC,YAAY,CAACQ,aAAxC,CAAN;AAA+D;;AACjG,0BAAIR,YAAY,CAACS,cAAjB,EAAiC;AAAEgC,wBAAAA,MAAM,CAACF,MAAD,EAAS,iBAAT,EAA4BvC,YAAY,CAACS,cAAzC,CAAN;AAAiE;;AAEpGQ,sBAAAA,YAAY,CAAC,IAAIF,oBAAJ,CAAyBwB,MAAzB,EAAiCC,OAAjC,CAAD,CAAZ;AACD;AACF;AACF;AArCI,eA/DM;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAsGd;AAxGY,CAAf;;;;"} \ No newline at end of file +{"version":3,"file":"ext-eyedropper.js","sources":["../../../src/editor/extensions/ext-eyedropper.js"],"sourcesContent":["/**\n * @file ext-eyedropper.js\n *\n * @license MIT\n *\n * @copyright 2010 Jeff Schiller\n *\n */\n\nexport default {\n name: 'eyedropper',\n async init (S) {\n const strings = await S.importLocale();\n const svgEditor = this;\n const {$, ChangeElementCommand} = S, // , svgcontent,\n // svgdoc = S.svgroot.parentNode.ownerDocument,\n svgCanvas = svgEditor.canvas,\n addToHistory = function (cmd) { svgCanvas.undoMgr.addCommandToHistory(cmd); },\n currentStyle = {\n fillPaint: 'red', fillOpacity: 1.0,\n strokePaint: 'black', strokeOpacity: 1.0,\n strokeWidth: 5, strokeDashArray: null,\n opacity: 1.0,\n strokeLinecap: 'butt',\n strokeLinejoin: 'miter'\n };\n\n /**\n *\n * @param {module:svgcanvas.SvgCanvas#event:ext_selectedChanged|module:svgcanvas.SvgCanvas#event:ext_elementChanged} opts\n * @returns {void}\n */\n function getStyle (opts) {\n // if we are in eyedropper mode, we don't want to disable the eye-dropper tool\n const mode = svgCanvas.getMode();\n if (mode === 'eyedropper') { return; }\n\n const tool = $('#tool_eyedropper');\n // enable-eye-dropper if one element is selected\n let elem = null;\n if (!opts.multiselected && opts.elems[0] &&\n !['svg', 'g', 'use'].includes(opts.elems[0].nodeName)\n ) {\n elem = opts.elems[0];\n tool.removeClass('disabled');\n // grab the current style\n currentStyle.fillPaint = elem.getAttribute('fill') || 'black';\n currentStyle.fillOpacity = elem.getAttribute('fill-opacity') || 1.0;\n currentStyle.strokePaint = elem.getAttribute('stroke');\n currentStyle.strokeOpacity = elem.getAttribute('stroke-opacity') || 1.0;\n currentStyle.strokeWidth = elem.getAttribute('stroke-width');\n currentStyle.strokeDashArray = elem.getAttribute('stroke-dasharray');\n currentStyle.strokeLinecap = elem.getAttribute('stroke-linecap');\n currentStyle.strokeLinejoin = elem.getAttribute('stroke-linejoin');\n currentStyle.opacity = elem.getAttribute('opacity') || 1.0;\n // disable eye-dropper tool\n } else {\n tool.addClass('disabled');\n }\n }\n\n const buttons = [\n {\n id: 'tool_eyedropper',\n icon: 'eyedropper.png',\n type: 'mode',\n events: {\n click () {\n svgCanvas.setMode('eyedropper');\n }\n }\n }\n ];\n\n return {\n name: strings.name,\n svgicons: 'eyedropper-icon.xml',\n buttons: strings.buttons.map((button, i) => {\n return Object.assign(buttons[i], button);\n }),\n\n // if we have selected an element, grab its paint and enable the eye dropper button\n selectedChanged: getStyle,\n elementChanged: getStyle,\n\n mouseDown (opts) {\n const mode = svgCanvas.getMode();\n if (mode === 'eyedropper') {\n const e = opts.event;\n const {target} = e;\n if (!['svg', 'g', 'use'].includes(target.nodeName)) {\n const changes = {};\n\n const change = function (elem, attrname, newvalue) {\n changes[attrname] = elem.getAttribute(attrname);\n elem.setAttribute(attrname, newvalue);\n };\n\n if (currentStyle.fillPaint) { change(target, 'fill', currentStyle.fillPaint); }\n if (currentStyle.fillOpacity) { change(target, 'fill-opacity', currentStyle.fillOpacity); }\n if (currentStyle.strokePaint) { change(target, 'stroke', currentStyle.strokePaint); }\n if (currentStyle.strokeOpacity) { change(target, 'stroke-opacity', currentStyle.strokeOpacity); }\n if (currentStyle.strokeWidth) { change(target, 'stroke-width', currentStyle.strokeWidth); }\n if (currentStyle.strokeDashArray) { change(target, 'stroke-dasharray', currentStyle.strokeDashArray); }\n if (currentStyle.opacity) { change(target, 'opacity', currentStyle.opacity); }\n if (currentStyle.strokeLinecap) { change(target, 'stroke-linecap', currentStyle.strokeLinecap); }\n if (currentStyle.strokeLinejoin) { change(target, 'stroke-linejoin', currentStyle.strokeLinejoin); }\n\n addToHistory(new ChangeElementCommand(target, changes));\n }\n }\n }\n };\n }\n};\n"],"names":["name","init","S","getStyle","opts","svgCanvas","getMode","tool","$","elem","multiselected","elems","includes","nodeName","addClass","removeClass","currentStyle","fillPaint","getAttribute","fillOpacity","strokePaint","strokeOpacity","strokeWidth","strokeDashArray","strokeLinecap","strokeLinejoin","opacity","importLocale","strings","svgEditor","_this","ChangeElementCommand","canvas","addToHistory","cmd","undoMgr","addCommandToHistory","buttons","id","icon","type","events","click","setMode","svgicons","map","button","i","Object","assign","selectedChanged","elementChanged","mouseDown","target","event","changes","change","attrname","newvalue","setAttribute"],"mappings":";;;;;;;;;AASA,MAAe,CACbA,KAAM,aACAC,mBAAMC,wWAqBDC,oGAAAA,qBAAUC,MAGJ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,WACF,CAAC,MAAO,IAAK,OAAOzC,SAASyC,EAAOxC,UAAW,KAC5C0C,EAAU,GAEVC,EAAS,SAATA,OAAmB/C,EAAMgD,EAAUC,GACvCH,EAAQE,GAAYhD,EAAKS,aAAauC,GACtChD,EAAKkD,aAAaF,EAAUC,IAG1B1C,EAAaC,WAAauC,EAAOH,EAAQ,OAAQrC,EAAaC,WAC9DD,EAAaG,aAAeqC,EAAOH,EAAQ,eAAgBrC,EAAaG,aACxEH,EAAaI,aAAeoC,EAAOH,EAAQ,SAAUrC,EAAaI,aAClEJ,EAAaK,eAAiBmC,EAAOH,EAAQ,iBAAkBrC,EAAaK,eAC5EL,EAAaM,aAAekC,EAAOH,EAAQ,eAAgBrC,EAAaM,aACxEN,EAAaO,iBAAmBiC,EAAOH,EAAQ,mBAAoBrC,EAAaO,iBAChFP,EAAaU,SAAW8B,EAAOH,EAAQ,UAAWrC,EAAaU,SAC/DV,EAAaQ,eAAiBgC,EAAOH,EAAQ,iBAAkBrC,EAAaQ,eAC5ER,EAAaS,gBAAkB+B,EAAOH,EAAQ,kBAAmBrC,EAAaS,gBAElFQ,EAAa,IAAIF,EAAqBsB,EAAQE"} \ No newline at end of file diff --git a/dist/editor/extensions/ext-foreignobject.js b/dist/editor/extensions/ext-foreignobject.js index 299e645e..252ffb14 100644 --- a/dist/editor/extensions/ext-foreignobject.js +++ b/dist/editor/extensions/ext-foreignobject.js @@ -1,1651 +1,4 @@ -function _typeof(obj) { - "@babel/helpers - typeof"; - - if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { - _typeof = function (obj) { - return typeof obj; - }; - } else { - _typeof = function (obj) { - return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; - }; - } - - return _typeof(obj); -} - -var REACT_ELEMENT_TYPE; - -function _jsx(type, props, key, children) { - if (!REACT_ELEMENT_TYPE) { - REACT_ELEMENT_TYPE = typeof Symbol === "function" && Symbol["for"] && Symbol["for"]("react.element") || 0xeac7; - } - - var defaultProps = type && type.defaultProps; - var childrenLength = arguments.length - 3; - - if (!props && childrenLength !== 0) { - props = { - children: void 0 - }; - } - - if (childrenLength === 1) { - props.children = children; - } else if (childrenLength > 1) { - var childArray = new Array(childrenLength); - - for (var i = 0; i < childrenLength; i++) { - childArray[i] = arguments[i + 3]; - } - - props.children = childArray; - } - - if (props && defaultProps) { - for (var propName in defaultProps) { - if (props[propName] === void 0) { - props[propName] = defaultProps[propName]; - } - } - } else if (!props) { - props = defaultProps || {}; - } - - return { - $$typeof: REACT_ELEMENT_TYPE, - type: type, - key: key === undefined ? null : '' + key, - ref: null, - props: props, - _owner: null - }; -} - -function _asyncIterator(iterable) { - var method; - - if (typeof Symbol !== "undefined") { - if (Symbol.asyncIterator) { - method = iterable[Symbol.asyncIterator]; - if (method != null) return method.call(iterable); - } - - if (Symbol.iterator) { - method = iterable[Symbol.iterator]; - if (method != null) return method.call(iterable); - } - } - - throw new TypeError("Object is not async iterable"); -} - -function _AwaitValue(value) { - this.wrapped = value; -} - -function _AsyncGenerator(gen) { - var front, back; - - function send(key, arg) { - return new Promise(function (resolve, reject) { - var request = { - key: key, - arg: arg, - resolve: resolve, - reject: reject, - next: null - }; - - if (back) { - back = back.next = request; - } else { - front = back = request; - resume(key, arg); - } - }); - } - - function resume(key, arg) { - try { - var result = gen[key](arg); - var value = result.value; - var wrappedAwait = value instanceof _AwaitValue; - Promise.resolve(wrappedAwait ? value.wrapped : value).then(function (arg) { - if (wrappedAwait) { - resume(key === "return" ? "return" : "next", arg); - return; - } - - settle(result.done ? "return" : "normal", arg); - }, function (err) { - resume("throw", err); - }); - } catch (err) { - settle("throw", err); - } - } - - function settle(type, value) { - switch (type) { - case "return": - front.resolve({ - value: value, - done: true - }); - break; - - case "throw": - front.reject(value); - break; - - default: - front.resolve({ - value: value, - done: false - }); - break; - } - - front = front.next; - - if (front) { - resume(front.key, front.arg); - } else { - back = null; - } - } - - this._invoke = send; - - if (typeof gen.return !== "function") { - this.return = undefined; - } -} - -if (typeof Symbol === "function" && Symbol.asyncIterator) { - _AsyncGenerator.prototype[Symbol.asyncIterator] = function () { - return this; - }; -} - -_AsyncGenerator.prototype.next = function (arg) { - return this._invoke("next", arg); -}; - -_AsyncGenerator.prototype.throw = function (arg) { - return this._invoke("throw", arg); -}; - -_AsyncGenerator.prototype.return = function (arg) { - return this._invoke("return", arg); -}; - -function _wrapAsyncGenerator(fn) { - return function () { - return new _AsyncGenerator(fn.apply(this, arguments)); - }; -} - -function _awaitAsyncGenerator(value) { - return new _AwaitValue(value); -} - -function _asyncGeneratorDelegate(inner, awaitWrap) { - var iter = {}, - waiting = false; - - function pump(key, value) { - waiting = true; - value = new Promise(function (resolve) { - resolve(inner[key](value)); - }); - return { - done: false, - value: awaitWrap(value) - }; - } - - ; - - if (typeof Symbol === "function" && Symbol.iterator) { - iter[Symbol.iterator] = function () { - return this; - }; - } - - iter.next = function (value) { - if (waiting) { - waiting = false; - return value; - } - - return pump("next", value); - }; - - if (typeof inner.throw === "function") { - iter.throw = function (value) { - if (waiting) { - waiting = false; - throw value; - } - - return pump("throw", value); - }; - } - - if (typeof inner.return === "function") { - iter.return = function (value) { - if (waiting) { - waiting = false; - return value; - } - - return pump("return", value); - }; - } - - return iter; -} - -function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { - try { - var info = gen[key](arg); - var value = info.value; - } catch (error) { - reject(error); - return; - } - - if (info.done) { - resolve(value); - } else { - Promise.resolve(value).then(_next, _throw); - } -} - -function _asyncToGenerator(fn) { - return function () { - var self = this, - args = arguments; - return new Promise(function (resolve, reject) { - var gen = fn.apply(self, args); - - function _next(value) { - asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value); - } - - function _throw(err) { - asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err); - } - - _next(undefined); - }); - }; -} - -function _classCallCheck(instance, Constructor) { - if (!(instance instanceof Constructor)) { - throw new TypeError("Cannot call a class as a function"); - } -} - -function _defineProperties(target, props) { - for (var i = 0; i < props.length; i++) { - var descriptor = props[i]; - descriptor.enumerable = descriptor.enumerable || false; - descriptor.configurable = true; - if ("value" in descriptor) descriptor.writable = true; - Object.defineProperty(target, descriptor.key, descriptor); - } -} - -function _createClass(Constructor, protoProps, staticProps) { - if (protoProps) _defineProperties(Constructor.prototype, protoProps); - if (staticProps) _defineProperties(Constructor, staticProps); - return Constructor; -} - -function _defineEnumerableProperties(obj, descs) { - for (var key in descs) { - var desc = descs[key]; - desc.configurable = desc.enumerable = true; - if ("value" in desc) desc.writable = true; - Object.defineProperty(obj, key, desc); - } - - if (Object.getOwnPropertySymbols) { - var objectSymbols = Object.getOwnPropertySymbols(descs); - - for (var i = 0; i < objectSymbols.length; i++) { - var sym = objectSymbols[i]; - var desc = descs[sym]; - desc.configurable = desc.enumerable = true; - if ("value" in desc) desc.writable = true; - Object.defineProperty(obj, sym, desc); - } - } - - return obj; -} - -function _defaults(obj, defaults) { - var keys = Object.getOwnPropertyNames(defaults); - - for (var i = 0; i < keys.length; i++) { - var key = keys[i]; - var value = Object.getOwnPropertyDescriptor(defaults, key); - - if (value && value.configurable && obj[key] === undefined) { - Object.defineProperty(obj, key, value); - } - } - - return obj; -} - -function _defineProperty(obj, key, value) { - if (key in obj) { - Object.defineProperty(obj, key, { - value: value, - enumerable: true, - configurable: true, - writable: true - }); - } else { - obj[key] = value; - } - - return obj; -} - -function _extends() { - _extends = Object.assign || function (target) { - for (var i = 1; i < arguments.length; i++) { - var source = arguments[i]; - - for (var key in source) { - if (Object.prototype.hasOwnProperty.call(source, key)) { - target[key] = source[key]; - } - } - } - - return target; - }; - - return _extends.apply(this, arguments); -} - -function _objectSpread(target) { - for (var i = 1; i < arguments.length; i++) { - var source = arguments[i] != null ? Object(arguments[i]) : {}; - var ownKeys = Object.keys(source); - - if (typeof Object.getOwnPropertySymbols === 'function') { - ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function (sym) { - return Object.getOwnPropertyDescriptor(source, sym).enumerable; - })); - } - - ownKeys.forEach(function (key) { - _defineProperty(target, key, source[key]); - }); - } - - return target; -} - -function ownKeys(object, enumerableOnly) { - var keys = Object.keys(object); - - if (Object.getOwnPropertySymbols) { - var symbols = Object.getOwnPropertySymbols(object); - if (enumerableOnly) symbols = symbols.filter(function (sym) { - return Object.getOwnPropertyDescriptor(object, sym).enumerable; - }); - keys.push.apply(keys, symbols); - } - - return keys; -} - -function _objectSpread2(target) { - for (var i = 1; i < arguments.length; i++) { - var source = arguments[i] != null ? arguments[i] : {}; - - if (i % 2) { - ownKeys(Object(source), true).forEach(function (key) { - _defineProperty(target, key, source[key]); - }); - } else if (Object.getOwnPropertyDescriptors) { - Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); - } else { - ownKeys(Object(source)).forEach(function (key) { - Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); - }); - } - } - - return target; -} - -function _inherits(subClass, superClass) { - if (typeof superClass !== "function" && superClass !== null) { - throw new TypeError("Super expression must either be null or a function"); - } - - subClass.prototype = Object.create(superClass && superClass.prototype, { - constructor: { - value: subClass, - writable: true, - configurable: true - } - }); - if (superClass) _setPrototypeOf(subClass, superClass); -} - -function _inheritsLoose(subClass, superClass) { - subClass.prototype = Object.create(superClass.prototype); - subClass.prototype.constructor = subClass; - subClass.__proto__ = superClass; -} - -function _getPrototypeOf(o) { - _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { - return o.__proto__ || Object.getPrototypeOf(o); - }; - return _getPrototypeOf(o); -} - -function _setPrototypeOf(o, p) { - _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { - o.__proto__ = p; - return o; - }; - - 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 _construct(Parent, args, Class) { - if (_isNativeReflectConstruct()) { - _construct = Reflect.construct; - } else { - _construct = function _construct(Parent, args, Class) { - var a = [null]; - a.push.apply(a, args); - var Constructor = Function.bind.apply(Parent, a); - var instance = new Constructor(); - if (Class) _setPrototypeOf(instance, Class.prototype); - return instance; - }; - } - - return _construct.apply(null, arguments); -} - -function _isNativeFunction(fn) { - return Function.toString.call(fn).indexOf("[native code]") !== -1; -} - -function _wrapNativeSuper(Class) { - var _cache = typeof Map === "function" ? new Map() : undefined; - - _wrapNativeSuper = function _wrapNativeSuper(Class) { - if (Class === null || !_isNativeFunction(Class)) return Class; - - if (typeof Class !== "function") { - throw new TypeError("Super expression must either be null or a function"); - } - - if (typeof _cache !== "undefined") { - if (_cache.has(Class)) return _cache.get(Class); - - _cache.set(Class, Wrapper); - } - - function Wrapper() { - return _construct(Class, arguments, _getPrototypeOf(this).constructor); - } - - Wrapper.prototype = Object.create(Class.prototype, { - constructor: { - value: Wrapper, - enumerable: false, - writable: true, - configurable: true - } - }); - return _setPrototypeOf(Wrapper, Class); - }; - - return _wrapNativeSuper(Class); -} - -function _instanceof(left, right) { - if (right != null && typeof Symbol !== "undefined" && right[Symbol.hasInstance]) { - return !!right[Symbol.hasInstance](left); - } else { - return left instanceof right; - } -} - -function _interopRequireDefault(obj) { - return obj && obj.__esModule ? obj : { - default: obj - }; -} - -function _getRequireWildcardCache() { - if (typeof WeakMap !== "function") return null; - var cache = new WeakMap(); - - _getRequireWildcardCache = function () { - return cache; - }; - - return cache; -} - -function _interopRequireWildcard(obj) { - if (obj && obj.__esModule) { - return obj; - } - - if (obj === null || typeof obj !== "object" && typeof obj !== "function") { - return { - default: obj - }; - } - - var cache = _getRequireWildcardCache(); - - if (cache && cache.has(obj)) { - return cache.get(obj); - } - - var newObj = {}; - var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; - - for (var key in obj) { - if (Object.prototype.hasOwnProperty.call(obj, key)) { - var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; - - if (desc && (desc.get || desc.set)) { - Object.defineProperty(newObj, key, desc); - } else { - newObj[key] = obj[key]; - } - } - } - - newObj.default = obj; - - if (cache) { - cache.set(obj, newObj); - } - - return newObj; -} - -function _newArrowCheck(innerThis, boundThis) { - if (innerThis !== boundThis) { - throw new TypeError("Cannot instantiate an arrow function"); - } -} - -function _objectDestructuringEmpty(obj) { - if (obj == null) throw new TypeError("Cannot destructure undefined"); -} - -function _objectWithoutPropertiesLoose(source, excluded) { - if (source == null) return {}; - var target = {}; - var sourceKeys = Object.keys(source); - var key, i; - - for (i = 0; i < sourceKeys.length; i++) { - key = sourceKeys[i]; - if (excluded.indexOf(key) >= 0) continue; - target[key] = source[key]; - } - - return target; -} - -function _objectWithoutProperties(source, excluded) { - if (source == null) return {}; - - var target = _objectWithoutPropertiesLoose(source, excluded); - - var key, i; - - if (Object.getOwnPropertySymbols) { - var sourceSymbolKeys = Object.getOwnPropertySymbols(source); - - for (i = 0; i < sourceSymbolKeys.length; i++) { - key = sourceSymbolKeys[i]; - if (excluded.indexOf(key) >= 0) continue; - if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; - target[key] = source[key]; - } - } - - return target; -} - -function _assertThisInitialized(self) { - if (self === void 0) { - throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); - } - - return self; -} - -function _possibleConstructorReturn(self, call) { - if (call && (typeof call === "object" || typeof call === "function")) { - return call; - } - - return _assertThisInitialized(self); -} - -function _createSuper(Derived) { - var hasNativeReflectConstruct = _isNativeReflectConstruct(); - - return function _createSuperInternal() { - var Super = _getPrototypeOf(Derived), - result; - - if (hasNativeReflectConstruct) { - 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); - if (object === null) break; - } - - return object; -} - -function _get(target, property, receiver) { - if (typeof Reflect !== "undefined" && Reflect.get) { - _get = Reflect.get; - } else { - _get = function _get(target, property, receiver) { - var base = _superPropBase(target, property); - - if (!base) return; - var desc = Object.getOwnPropertyDescriptor(base, property); - - if (desc.get) { - return desc.get.call(receiver); - } - - return desc.value; - }; - } - - return _get(target, property, receiver || target); -} - -function set(target, property, value, receiver) { - if (typeof Reflect !== "undefined" && Reflect.set) { - set = Reflect.set; - } else { - set = function set(target, property, value, receiver) { - var base = _superPropBase(target, property); - - var desc; - - if (base) { - desc = Object.getOwnPropertyDescriptor(base, property); - - if (desc.set) { - desc.set.call(receiver, value); - return true; - } else if (!desc.writable) { - return false; - } - } - - desc = Object.getOwnPropertyDescriptor(receiver, property); - - if (desc) { - if (!desc.writable) { - return false; - } - - desc.value = value; - Object.defineProperty(receiver, property, desc); - } else { - _defineProperty(receiver, property, value); - } - - return true; - }; - } - - return set(target, property, value, receiver); -} - -function _set(target, property, value, receiver, isStrict) { - var s = set(target, property, value, receiver || target); - - if (!s && isStrict) { - throw new Error('failed to set property'); - } - - return value; -} - -function _taggedTemplateLiteral(strings, raw) { - if (!raw) { - raw = strings.slice(0); - } - - return Object.freeze(Object.defineProperties(strings, { - raw: { - value: Object.freeze(raw) - } - })); -} - -function _taggedTemplateLiteralLoose(strings, raw) { - if (!raw) { - raw = strings.slice(0); - } - - strings.raw = raw; - return strings; -} - -function _readOnlyError(name) { - throw new Error("\"" + name + "\" is read-only"); -} - -function _classNameTDZError(name) { - throw new Error("Class \"" + name + "\" cannot be referenced in computed property keys."); -} - -function _temporalUndefined() {} - -function _tdz(name) { - throw new ReferenceError(name + " is not defined - temporal dead zone"); -} - -function _temporalRef(val, name) { - return val === _temporalUndefined ? _tdz(name) : val; -} - -function _slicedToArray(arr, i) { - return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); -} - -function _slicedToArrayLoose(arr, i) { - return _arrayWithHoles(arr) || _iterableToArrayLimitLoose(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); -} - -function _toArray(arr) { - return _arrayWithHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableRest(); -} - -function _toConsumableArray(arr) { - return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); -} - -function _arrayWithoutHoles(arr) { - if (Array.isArray(arr)) return _arrayLikeToArray(arr); -} - -function _arrayWithHoles(arr) { - if (Array.isArray(arr)) return arr; -} - -function _maybeArrayLike(next, arr, i) { - if (arr && !Array.isArray(arr) && typeof arr.length === "number") { - var len = arr.length; - return _arrayLikeToArray(arr, i !== void 0 && i < len ? i : len); - } - - return next(arr, i); -} - -function _iterableToArray(iter) { - if (typeof Symbol !== "undefined" && Symbol.iterator in Object(iter)) return Array.from(iter); -} - -function _iterableToArrayLimit(arr, i) { - if (typeof Symbol === "undefined" || !(Symbol.iterator in Object(arr))) return; - var _arr = []; - var _n = true; - var _d = false; - var _e = undefined; - - try { - for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { - _arr.push(_s.value); - - if (i && _arr.length === i) break; - } - } catch (err) { - _d = true; - _e = err; - } finally { - try { - if (!_n && _i["return"] != null) _i["return"](); - } finally { - if (_d) throw _e; - } - } - - return _arr; -} - -function _iterableToArrayLimitLoose(arr, i) { - if (typeof Symbol === "undefined" || !(Symbol.iterator in Object(arr))) return; - var _arr = []; - - for (var _iterator = arr[Symbol.iterator](), _step; !(_step = _iterator.next()).done;) { - _arr.push(_step.value); - - if (i && _arr.length === i) break; - } - - 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(o); - 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.\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.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); -} - -function _createForOfIteratorHelper(o, allowArrayLike) { - var it; - - if (typeof Symbol === "undefined" || o[Symbol.iterator] == null) { - if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") { - if (it) o = it; - 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 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; - } - } - }; -} - -function _createForOfIteratorHelperLoose(o, allowArrayLike) { - var it; - - if (typeof Symbol === "undefined" || o[Symbol.iterator] == null) { - if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") { - if (it) o = it; - var i = 0; - return function () { - if (i >= o.length) return { - done: true - }; - return { - done: false, - value: o[i++] - }; - }; - } - - throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); - } - - it = o[Symbol.iterator](); - return it.next.bind(it); -} - -function _skipFirstGeneratorNext(fn) { - return function () { - var it = fn.apply(this, arguments); - it.next(); - return it; - }; -} - -function _toPrimitive(input, hint) { - if (typeof input !== "object" || input === null) return input; - var prim = input[Symbol.toPrimitive]; - - if (prim !== undefined) { - var res = prim.call(input, hint || "default"); - if (typeof res !== "object") return res; - throw new TypeError("@@toPrimitive must return a primitive value."); - } - - return (hint === "string" ? String : Number)(input); -} - -function _toPropertyKey(arg) { - var key = _toPrimitive(arg, "string"); - - return typeof key === "symbol" ? key : String(key); -} - -function _initializerWarningHelper(descriptor, context) { - throw new Error('Decorating class property failed. Please ensure that ' + 'proposal-class-properties is enabled and runs after the decorators transform.'); -} - -function _initializerDefineProperty(target, property, descriptor, context) { - if (!descriptor) return; - Object.defineProperty(target, property, { - enumerable: descriptor.enumerable, - configurable: descriptor.configurable, - writable: descriptor.writable, - value: descriptor.initializer ? descriptor.initializer.call(context) : void 0 - }); -} - -function _applyDecoratedDescriptor(target, property, decorators, descriptor, context) { - var desc = {}; - Object.keys(descriptor).forEach(function (key) { - desc[key] = descriptor[key]; - }); - desc.enumerable = !!desc.enumerable; - desc.configurable = !!desc.configurable; - - if ('value' in desc || desc.initializer) { - desc.writable = true; - } - - desc = decorators.slice().reverse().reduce(function (desc, decorator) { - return decorator(target, property, desc) || desc; - }, desc); - - if (context && desc.initializer !== void 0) { - desc.value = desc.initializer ? desc.initializer.call(context) : void 0; - desc.initializer = undefined; - } - - if (desc.initializer === void 0) { - Object.defineProperty(target, property, desc); - desc = null; - } - - return desc; -} - -var id = 0; - -function _classPrivateFieldLooseKey(name) { - return "__private_" + id++ + "_" + name; -} - -function _classPrivateFieldLooseBase(receiver, privateKey) { - if (!Object.prototype.hasOwnProperty.call(receiver, privateKey)) { - throw new TypeError("attempted to use private field on non-instance"); - } - - return receiver; -} - -function _classPrivateFieldGet(receiver, privateMap) { - var descriptor = privateMap.get(receiver); - - if (!descriptor) { - throw new TypeError("attempted to get private field on non-instance"); - } - - if (descriptor.get) { - return descriptor.get.call(receiver); - } - - return descriptor.value; -} - -function _classPrivateFieldSet(receiver, privateMap, value) { - var descriptor = privateMap.get(receiver); - - if (!descriptor) { - throw new TypeError("attempted to set private field on non-instance"); - } - - if (descriptor.set) { - descriptor.set.call(receiver, value); - } else { - if (!descriptor.writable) { - throw new TypeError("attempted to set read only private field"); - } - - descriptor.value = value; - } - - return value; -} - -function _classPrivateFieldDestructureSet(receiver, privateMap) { - if (!privateMap.has(receiver)) { - throw new TypeError("attempted to set private field on non-instance"); - } - - var descriptor = privateMap.get(receiver); - - if (descriptor.set) { - if (!("__destrObj" in descriptor)) { - descriptor.__destrObj = { - set value(v) { - descriptor.set.call(receiver, v); - } - - }; - } - - return descriptor.__destrObj; - } else { - if (!descriptor.writable) { - throw new TypeError("attempted to set read only private field"); - } - - return descriptor; - } -} - -function _classStaticPrivateFieldSpecGet(receiver, classConstructor, descriptor) { - if (receiver !== classConstructor) { - throw new TypeError("Private static access of wrong provenance"); - } - - if (descriptor.get) { - return descriptor.get.call(receiver); - } - - return descriptor.value; -} - -function _classStaticPrivateFieldSpecSet(receiver, classConstructor, descriptor, value) { - if (receiver !== classConstructor) { - throw new TypeError("Private static access of wrong provenance"); - } - - if (descriptor.set) { - descriptor.set.call(receiver, value); - } else { - if (!descriptor.writable) { - throw new TypeError("attempted to set read only private field"); - } - - descriptor.value = value; - } - - return value; -} - -function _classStaticPrivateMethodGet(receiver, classConstructor, method) { - if (receiver !== classConstructor) { - throw new TypeError("Private static access of wrong provenance"); - } - - return method; -} - -function _classStaticPrivateMethodSet() { - throw new TypeError("attempted to set read only static private field"); -} - -function _decorate(decorators, factory, superClass, mixins) { - var api = _getDecoratorsApi(); - - if (mixins) { - for (var i = 0; i < mixins.length; i++) { - api = mixins[i](api); - } - } - - var r = factory(function initialize(O) { - api.initializeInstanceElements(O, decorated.elements); - }, superClass); - var decorated = api.decorateClass(_coalesceClassElements(r.d.map(_createElementDescriptor)), decorators); - api.initializeClassElements(r.F, decorated.elements); - return api.runClassFinishers(r.F, decorated.finishers); -} - -function _getDecoratorsApi() { - _getDecoratorsApi = function () { - return api; - }; - - var api = { - elementsDefinitionOrder: [["method"], ["field"]], - initializeInstanceElements: function (O, elements) { - ["method", "field"].forEach(function (kind) { - elements.forEach(function (element) { - if (element.kind === kind && element.placement === "own") { - this.defineClassElement(O, element); - } - }, this); - }, this); - }, - initializeClassElements: function (F, elements) { - var proto = F.prototype; - ["method", "field"].forEach(function (kind) { - elements.forEach(function (element) { - var placement = element.placement; - - if (element.kind === kind && (placement === "static" || placement === "prototype")) { - var receiver = placement === "static" ? F : proto; - this.defineClassElement(receiver, element); - } - }, this); - }, this); - }, - defineClassElement: function (receiver, element) { - var descriptor = element.descriptor; - - if (element.kind === "field") { - var initializer = element.initializer; - descriptor = { - enumerable: descriptor.enumerable, - writable: descriptor.writable, - configurable: descriptor.configurable, - value: initializer === void 0 ? void 0 : initializer.call(receiver) - }; - } - - Object.defineProperty(receiver, element.key, descriptor); - }, - decorateClass: function (elements, decorators) { - var newElements = []; - var finishers = []; - var placements = { - static: [], - prototype: [], - own: [] - }; - elements.forEach(function (element) { - this.addElementPlacement(element, placements); - }, this); - elements.forEach(function (element) { - if (!_hasDecorators(element)) return newElements.push(element); - var elementFinishersExtras = this.decorateElement(element, placements); - newElements.push(elementFinishersExtras.element); - newElements.push.apply(newElements, elementFinishersExtras.extras); - finishers.push.apply(finishers, elementFinishersExtras.finishers); - }, this); - - if (!decorators) { - return { - elements: newElements, - finishers: finishers - }; - } - - var result = this.decorateConstructor(newElements, decorators); - finishers.push.apply(finishers, result.finishers); - result.finishers = finishers; - return result; - }, - addElementPlacement: function (element, placements, silent) { - var keys = placements[element.placement]; - - if (!silent && keys.indexOf(element.key) !== -1) { - throw new TypeError("Duplicated element (" + element.key + ")"); - } - - keys.push(element.key); - }, - decorateElement: function (element, placements) { - var extras = []; - var finishers = []; - - for (var decorators = element.decorators, i = decorators.length - 1; i >= 0; i--) { - var keys = placements[element.placement]; - keys.splice(keys.indexOf(element.key), 1); - var elementObject = this.fromElementDescriptor(element); - var elementFinisherExtras = this.toElementFinisherExtras((0, decorators[i])(elementObject) || elementObject); - element = elementFinisherExtras.element; - this.addElementPlacement(element, placements); - - if (elementFinisherExtras.finisher) { - finishers.push(elementFinisherExtras.finisher); - } - - var newExtras = elementFinisherExtras.extras; - - if (newExtras) { - for (var j = 0; j < newExtras.length; j++) { - this.addElementPlacement(newExtras[j], placements); - } - - extras.push.apply(extras, newExtras); - } - } - - return { - element: element, - finishers: finishers, - extras: extras - }; - }, - decorateConstructor: function (elements, decorators) { - var finishers = []; - - for (var i = decorators.length - 1; i >= 0; i--) { - var obj = this.fromClassDescriptor(elements); - var elementsAndFinisher = this.toClassDescriptor((0, decorators[i])(obj) || obj); - - if (elementsAndFinisher.finisher !== undefined) { - finishers.push(elementsAndFinisher.finisher); - } - - if (elementsAndFinisher.elements !== undefined) { - elements = elementsAndFinisher.elements; - - for (var j = 0; j < elements.length - 1; j++) { - for (var k = j + 1; k < elements.length; k++) { - if (elements[j].key === elements[k].key && elements[j].placement === elements[k].placement) { - throw new TypeError("Duplicated element (" + elements[j].key + ")"); - } - } - } - } - } - - return { - elements: elements, - finishers: finishers - }; - }, - fromElementDescriptor: function (element) { - var obj = { - kind: element.kind, - key: element.key, - placement: element.placement, - descriptor: element.descriptor - }; - var desc = { - value: "Descriptor", - configurable: true - }; - Object.defineProperty(obj, Symbol.toStringTag, desc); - if (element.kind === "field") obj.initializer = element.initializer; - return obj; - }, - toElementDescriptors: function (elementObjects) { - if (elementObjects === undefined) return; - return _toArray(elementObjects).map(function (elementObject) { - var element = this.toElementDescriptor(elementObject); - this.disallowProperty(elementObject, "finisher", "An element descriptor"); - this.disallowProperty(elementObject, "extras", "An element descriptor"); - return element; - }, this); - }, - toElementDescriptor: function (elementObject) { - var kind = String(elementObject.kind); - - if (kind !== "method" && kind !== "field") { - throw new TypeError('An element descriptor\'s .kind property must be either "method" or' + ' "field", but a decorator created an element descriptor with' + ' .kind "' + kind + '"'); - } - - var key = _toPropertyKey(elementObject.key); - - var placement = String(elementObject.placement); - - if (placement !== "static" && placement !== "prototype" && placement !== "own") { - throw new TypeError('An element descriptor\'s .placement property must be one of "static",' + ' "prototype" or "own", but a decorator created an element descriptor' + ' with .placement "' + placement + '"'); - } - - var descriptor = elementObject.descriptor; - this.disallowProperty(elementObject, "elements", "An element descriptor"); - var element = { - kind: kind, - key: key, - placement: placement, - descriptor: Object.assign({}, descriptor) - }; - - if (kind !== "field") { - this.disallowProperty(elementObject, "initializer", "A method descriptor"); - } else { - this.disallowProperty(descriptor, "get", "The property descriptor of a field descriptor"); - this.disallowProperty(descriptor, "set", "The property descriptor of a field descriptor"); - this.disallowProperty(descriptor, "value", "The property descriptor of a field descriptor"); - element.initializer = elementObject.initializer; - } - - return element; - }, - toElementFinisherExtras: function (elementObject) { - var element = this.toElementDescriptor(elementObject); - - var finisher = _optionalCallableProperty(elementObject, "finisher"); - - var extras = this.toElementDescriptors(elementObject.extras); - return { - element: element, - finisher: finisher, - extras: extras - }; - }, - fromClassDescriptor: function (elements) { - var obj = { - kind: "class", - elements: elements.map(this.fromElementDescriptor, this) - }; - var desc = { - value: "Descriptor", - configurable: true - }; - Object.defineProperty(obj, Symbol.toStringTag, desc); - return obj; - }, - toClassDescriptor: function (obj) { - var kind = String(obj.kind); - - if (kind !== "class") { - throw new TypeError('A class descriptor\'s .kind property must be "class", but a decorator' + ' created a class descriptor with .kind "' + kind + '"'); - } - - this.disallowProperty(obj, "key", "A class descriptor"); - this.disallowProperty(obj, "placement", "A class descriptor"); - this.disallowProperty(obj, "descriptor", "A class descriptor"); - this.disallowProperty(obj, "initializer", "A class descriptor"); - this.disallowProperty(obj, "extras", "A class descriptor"); - - var finisher = _optionalCallableProperty(obj, "finisher"); - - var elements = this.toElementDescriptors(obj.elements); - return { - elements: elements, - finisher: finisher - }; - }, - runClassFinishers: function (constructor, finishers) { - for (var i = 0; i < finishers.length; i++) { - var newConstructor = (0, finishers[i])(constructor); - - if (newConstructor !== undefined) { - if (typeof newConstructor !== "function") { - throw new TypeError("Finishers must return a constructor."); - } - - constructor = newConstructor; - } - } - - return constructor; - }, - disallowProperty: function (obj, name, objectType) { - if (obj[name] !== undefined) { - throw new TypeError(objectType + " can't have a ." + name + " property."); - } - } - }; - return api; -} - -function _createElementDescriptor(def) { - var key = _toPropertyKey(def.key); - - var descriptor; - - if (def.kind === "method") { - descriptor = { - value: def.value, - writable: true, - configurable: true, - enumerable: false - }; - } else if (def.kind === "get") { - descriptor = { - get: def.value, - configurable: true, - enumerable: false - }; - } else if (def.kind === "set") { - descriptor = { - set: def.value, - configurable: true, - enumerable: false - }; - } else if (def.kind === "field") { - descriptor = { - configurable: true, - writable: true, - enumerable: true - }; - } - - var element = { - kind: def.kind === "field" ? "field" : "method", - key: key, - placement: def.static ? "static" : def.kind === "field" ? "own" : "prototype", - descriptor: descriptor - }; - if (def.decorators) element.decorators = def.decorators; - if (def.kind === "field") element.initializer = def.value; - return element; -} - -function _coalesceGetterSetter(element, other) { - if (element.descriptor.get !== undefined) { - other.descriptor.get = element.descriptor.get; - } else { - other.descriptor.set = element.descriptor.set; - } -} - -function _coalesceClassElements(elements) { - var newElements = []; - - var isSameElement = function (other) { - return other.kind === "method" && other.key === element.key && other.placement === element.placement; - }; - - for (var i = 0; i < elements.length; i++) { - var element = elements[i]; - var other; - - if (element.kind === "method" && (other = newElements.find(isSameElement))) { - if (_isDataDescriptor(element.descriptor) || _isDataDescriptor(other.descriptor)) { - if (_hasDecorators(element) || _hasDecorators(other)) { - throw new ReferenceError("Duplicated methods (" + element.key + ") can't be decorated."); - } - - other.descriptor = element.descriptor; - } else { - if (_hasDecorators(element)) { - if (_hasDecorators(other)) { - throw new ReferenceError("Decorators can't be placed on different accessors with for " + "the same property (" + element.key + ")."); - } - - other.decorators = element.decorators; - } - - _coalesceGetterSetter(element, other); - } - } else { - newElements.push(element); - } - } - - return newElements; -} - -function _hasDecorators(element) { - return element.decorators && element.decorators.length; -} - -function _isDataDescriptor(desc) { - return desc !== undefined && !(desc.value === undefined && desc.writable === undefined); -} - -function _optionalCallableProperty(obj, name) { - var value = obj[name]; - - if (value !== undefined && typeof value !== "function") { - throw new TypeError("Expected '" + name + "' to be a function"); - } - - return value; -} - -function _classPrivateMethodGet(receiver, privateSet, fn) { - if (!privateSet.has(receiver)) { - throw new TypeError("attempted to get private field on non-instance"); - } - - return fn; -} - -function _classPrivateMethodSet() { - throw new TypeError("attempted to reassign private method"); -} - -function _wrapRegExp(re, groups) { - _wrapRegExp = function (re, groups) { - return new BabelRegExp(re, undefined, groups); - }; - - var _RegExp = _wrapNativeSuper(RegExp); - - var _super = RegExp.prototype; - - var _groups = new WeakMap(); - - function BabelRegExp(re, flags, groups) { - var _this = _RegExp.call(this, re, flags); - - _groups.set(_this, groups || _groups.get(re)); - - return _this; - } - - _inherits(BabelRegExp, _RegExp); - - BabelRegExp.prototype.exec = function (str) { - var result = _super.exec.call(this, str); - - if (result) result.groups = buildGroups(result, this); - return result; - }; - - BabelRegExp.prototype[Symbol.replace] = function (str, substitution) { - if (typeof substitution === "string") { - var groups = _groups.get(this); - - return _super[Symbol.replace].call(this, str, substitution.replace(/\$<([^>]+)>/g, function (_, name) { - return "$" + groups[name]; - })); - } else if (typeof substitution === "function") { - var _this = this; - - return _super[Symbol.replace].call(this, str, function () { - var args = []; - args.push.apply(args, arguments); - - if (typeof args[args.length - 1] !== "object") { - args.push(buildGroups(args, _this)); - } - - return substitution.apply(this, args); - }); - } else { - return _super[Symbol.replace].call(this, str, substitution); - } - }; - - function buildGroups(result, re) { - var g = _groups.get(re); - - return Object.keys(g).reduce(function (groups, name) { - groups[name] = result[g[name]]; - return groups; - }, Object.create(null)); - } - - return _wrapRegExp.apply(this, arguments); -} - +function _AwaitValue(e){this.wrapped=e}function _AsyncGenerator(e){var t,n;function resume(t,n){try{var r=e[t](n),o=r.value,i=o instanceof _AwaitValue;Promise.resolve(i?o.wrapped:o).then((function(e){i?resume("return"===t?"return":"next",e):settle(r.done?"return":"normal",e)}),(function(e){resume("throw",e)}))}catch(e){settle("throw",e)}}function settle(e,r){switch(e){case"return":t.resolve({value:r,done:!0});break;case"throw":t.reject(r);break;default:t.resolve({value:r,done:!1})}(t=t.next)?resume(t.key,t.arg):n=null}this._invoke=function send(e,r){return new Promise((function(o,i){var a={key:e,arg:r,resolve:o,reject:i,next:null};n?n=n.next=a:(t=n=a,resume(e,r))}))},"function"!=typeof e.return&&(this.return=void 0)}function asyncGeneratorStep(e,t,n,r,o,i,a){try{var c=e[i](a),s=c.value}catch(e){return void n(e)}c.done?t(s):Promise.resolve(s).then(r,o)}function _asyncToGenerator(e){return function(){var t=this,n=arguments;return new Promise((function(r,o){var i=e.apply(t,n);function _next(e){asyncGeneratorStep(i,r,o,_next,_throw,"next",e)}function _throw(e){asyncGeneratorStep(i,r,o,_next,_throw,"throw",e)}_next(void 0)}))}}"function"==typeof Symbol&&Symbol.asyncIterator&&(_AsyncGenerator.prototype[Symbol.asyncIterator]=function(){return this}),_AsyncGenerator.prototype.next=function(e){return this._invoke("next",e)},_AsyncGenerator.prototype.throw=function(e){return this._invoke("throw",e)},_AsyncGenerator.prototype.return=function(e){return this._invoke("return",e)}; /** * @file ext-foreignobject.js * @@ -1654,318 +7,5 @@ function _wrapRegExp(re, groups) { * @copyright 2010 Jacques Distler, 2010 Alexis Deveria * */ -var extForeignobject = { - name: 'foreignobject', - init: function init(S) { - var _this = this; - - return _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee2() { - var svgEditor, $, text2xml, NS, importLocale, svgCanvas, svgdoc, strings, properlySourceSizeTextArea, showPanel, toggleSourceButtons, selElems, started, newFO, editingforeign, setForeignString, showForeignEditor, setAttr, buttons, contextTools; - return regeneratorRuntime.wrap(function _callee2$(_context2) { - while (1) { - switch (_context2.prev = _context2.next) { - case 0: - setAttr = function _setAttr(attr, val) { - svgCanvas.changeSelectedAttribute(attr, val); - svgCanvas.call('changed', selElems); - }; - - showForeignEditor = function _showForeignEditor() { - var elt = selElems[0]; - - if (!elt || editingforeign) { - return; - } - - editingforeign = true; - toggleSourceButtons(true); - elt.removeAttribute('fill'); - var str = svgCanvas.svgToString(elt, 0); - $('#svg_source_textarea').val(str); - $('#svg_source_editor').fadeIn(); - properlySourceSizeTextArea(); - $('#svg_source_textarea').focus(); - }; - - setForeignString = function _setForeignString(xmlString) { - var elt = selElems[0]; // The parent `Element` to append to - - try { - // convert string into XML document - var newDoc = text2xml('' + xmlString + ''); // run it through our sanitizer to remove anything we do not support - - svgCanvas.sanitizeSvg(newDoc.documentElement); - elt.replaceWith(svgdoc.importNode(newDoc.documentElement.firstChild, true)); - svgCanvas.call('changed', [elt]); - svgCanvas.clearSelection(); - } catch (e) { - // Todo: Surface error to user - console.log(e); // eslint-disable-line no-console - - return false; - } - - return true; - }; - - toggleSourceButtons = function _toggleSourceButtons(on) { - $('#tool_source_save, #tool_source_cancel').toggle(!on); - $('#foreign_save, #foreign_cancel').toggle(on); - }; - - showPanel = function _showPanel(on) { - var fcRules = $('#fc_rules'); - - if (!fcRules.length) { - fcRules = $('').appendTo('head'); - } - - fcRules.text(!on ? '' : ' #tool_topath { display: none !important; }'); - $('#foreignObject_panel').toggle(on); - }; - - svgEditor = _this; - $ = S.$, text2xml = S.text2xml, NS = S.NS, importLocale = S.importLocale; - svgCanvas = svgEditor.canvas; - svgdoc = S.svgroot.parentNode.ownerDocument; - _context2.next = 11; - return importLocale(); - - case 11: - strings = _context2.sent; - - properlySourceSizeTextArea = function properlySourceSizeTextArea() { - // TODO: remove magic numbers here and get values from CSS - var height = $('#svg_source_container').height() - 80; - $('#svg_source_textarea').css('height', height); - }; - /** - * @param {boolean} on - * @returns {void} - */ - - - editingforeign = false; - /** - * This function sets the content of element elt to the input XML. - * @param {string} xmlString - The XML text - * @returns {boolean} This function returns false if the set was unsuccessful, true otherwise. - */ - - buttons = [{ - id: 'tool_foreign', - icon: 'foreignobject-tool.png', - type: 'mode', - events: { - click: function click() { - svgCanvas.setMode('foreign'); - } - } - }, { - id: 'edit_foreign', - icon: 'foreignobject-edit.png', - type: 'context', - panel: 'foreignObject_panel', - events: { - click: function click() { - showForeignEditor(); - } - } - }]; - contextTools = [{ - type: 'input', - panel: 'foreignObject_panel', - id: 'foreign_width', - size: 3, - events: { - change: function change() { - setAttr('width', this.value); - } - } - }, { - type: 'input', - panel: 'foreignObject_panel', - id: 'foreign_height', - events: { - change: function change() { - setAttr('height', this.value); - } - } - }, { - type: 'input', - panel: 'foreignObject_panel', - id: 'foreign_font_size', - size: 2, - defval: 16, - events: { - change: function change() { - setAttr('font-size', this.value); - } - } - }]; - return _context2.abrupt("return", { - name: strings.name, - svgicons: 'foreignobject-icons.xml', - buttons: strings.buttons.map(function (button, i) { - return Object.assign(buttons[i], button); - }), - context_tools: strings.contextTools.map(function (contextTool, i) { - return Object.assign(contextTools[i], contextTool); - }), - callback: function callback() { - $('#foreignObject_panel').hide(); - - var endChanges = function endChanges() { - $('#svg_source_editor').hide(); - editingforeign = false; - $('#svg_source_textarea').blur(); - toggleSourceButtons(false); - }; // TODO: Needs to be done after orig icon loads - - - setTimeout(function () { - // Create source save/cancel buttons - - /* const save = */ - $('#tool_source_save').clone().hide().attr('id', 'foreign_save').unbind().appendTo('#tool_source_back').click( /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee() { - var ok; - return regeneratorRuntime.wrap(function _callee$(_context) { - while (1) { - switch (_context.prev = _context.next) { - case 0: - if (editingforeign) { - _context.next = 2; - break; - } - - return _context.abrupt("return"); - - case 2: - if (setForeignString($('#svg_source_textarea').val())) { - _context.next = 11; - break; - } - - _context.next = 5; - return $.confirm('Errors found. Revert to original?'); - - case 5: - ok = _context.sent; - - if (ok) { - _context.next = 8; - break; - } - - return _context.abrupt("return"); - - case 8: - endChanges(); - _context.next = 12; - break; - - case 11: - endChanges(); - - case 12: - case "end": - return _context.stop(); - } - } - }, _callee); - }))); - /* const cancel = */ - - $('#tool_source_cancel').clone().hide().attr('id', 'foreign_cancel').unbind().appendTo('#tool_source_back').click(function () { - endChanges(); - }); - }, 3000); - }, - mouseDown: function mouseDown(opts) { - // const e = opts.event; - if (svgCanvas.getMode() !== 'foreign') { - return undefined; - } - - started = true; - newFO = svgCanvas.addSVGElementFromJson({ - element: 'foreignObject', - attr: { - x: opts.start_x, - y: opts.start_y, - id: svgCanvas.getNextId(), - 'font-size': 16, - // cur_text.font_size, - width: '48', - height: '20', - style: 'pointer-events:inherit' - } - }); - var m = svgdoc.createElementNS(NS.MATH, 'math'); - m.setAttributeNS(NS.XMLNS, 'xmlns', NS.MATH); - m.setAttribute('display', 'inline'); - var mi = svgdoc.createElementNS(NS.MATH, 'mi'); - mi.setAttribute('mathvariant', 'normal'); - mi.textContent = "\u03A6"; - var mo = svgdoc.createElementNS(NS.MATH, 'mo'); - mo.textContent = "\u222A"; - var mi2 = svgdoc.createElementNS(NS.MATH, 'mi'); - mi2.textContent = "\u2133"; - m.append(mi, mo, mi2); - newFO.append(m); - return { - started: true - }; - }, - mouseUp: function mouseUp(opts) { - // const e = opts.event; - if (svgCanvas.getMode() !== 'foreign' || !started) { - return undefined; - } - - var attrs = $(newFO).attr(['width', 'height']); - var keep = attrs.width !== '0' || attrs.height !== '0'; - svgCanvas.addToSelection([newFO], true); - return { - keep: keep, - element: newFO - }; - }, - selectedChanged: function selectedChanged(opts) { - // Use this to update the current selected elements - selElems = opts.elems; - var i = selElems.length; - - while (i--) { - var elem = selElems[i]; - - if (elem && elem.tagName === 'foreignObject') { - if (opts.selectedElement && !opts.multiselected) { - $('#foreign_font_size').val(elem.getAttribute('font-size')); - $('#foreign_width').val(elem.getAttribute('width')); - $('#foreign_height').val(elem.getAttribute('height')); - showPanel(true); - } else { - showPanel(false); - } - } else { - showPanel(false); - } - } - }, - elementChanged: function elementChanged(opts) {// const elem = opts.elems[0]; - } - }); - - case 17: - case "end": - return _context2.stop(); - } - } - }, _callee2); - }))(); - } -}; - -export default extForeignobject; +var e={name:"foreignobject",init:function init(e){var t=this;return _asyncToGenerator(regeneratorRuntime.mark((function _callee2(){var n,r,o,i,a,c,s,u,l,f,g,_,h,d,v,p,m,b,x,y;return regeneratorRuntime.wrap((function _callee2$(w){for(;;)switch(w.prev=w.next){case 0:return b=function _setAttr(e,t){c.changeSelectedAttribute(e,t),c.call("changed",_)},m=function _showForeignEditor(){var e=_[0];if(e&&!v){v=!0,g(!0),e.removeAttribute("fill");var t=c.svgToString(e,0);r("#svg_source_textarea").val(t),r("#svg_source_editor").fadeIn(),l(),r("#svg_source_textarea").focus()}},p=function _setForeignString(e){var t=_[0];try{var n=o(''+e+"");c.sanitizeSvg(n.documentElement),t.replaceWith(s.importNode(n.documentElement.firstChild,!0)),c.call("changed",[t]),c.clearSelection()}catch(e){return console.log(e),!1}return!0},g=function _toggleSourceButtons(e){r("#tool_source_save, #tool_source_cancel").toggle(!e),r("#foreign_save, #foreign_cancel").toggle(e)},f=function _showPanel(e){var t=r("#fc_rules");t.length||(t=r('').appendTo("head")),t.text(e?" #tool_topath { display: none !important; }":""),r("#foreignObject_panel").toggle(e)},n=t,r=e.$,o=e.text2xml,i=e.NS,a=e.importLocale,c=n.canvas,s=e.svgroot.parentNode.ownerDocument,w.next=11,a();case 11:return u=w.sent,l=function properlySourceSizeTextArea(){var e=r("#svg_source_container").height()-80;r("#svg_source_textarea").css("height",e)},v=!1,x=[{id:"tool_foreign",icon:"foreignobject-tool.png",type:"mode",events:{click:function click(){c.setMode("foreign")}}},{id:"edit_foreign",icon:"foreignobject-edit.png",type:"context",panel:"foreignObject_panel",events:{click:function click(){m()}}}],y=[{type:"input",panel:"foreignObject_panel",id:"foreign_width",size:3,events:{change:function change(){b("width",this.value)}}},{type:"input",panel:"foreignObject_panel",id:"foreign_height",events:{change:function change(){b("height",this.value)}}},{type:"input",panel:"foreignObject_panel",id:"foreign_font_size",size:2,defval:16,events:{change:function change(){b("font-size",this.value)}}}],w.abrupt("return",{name:u.name,svgicons:"foreignobject-icons.xml",buttons:u.buttons.map((function(e,t){return Object.assign(x[t],e)})),context_tools:u.contextTools.map((function(e,t){return Object.assign(y[t],e)})),callback:function callback(){r("#foreignObject_panel").hide();var e=function endChanges(){r("#svg_source_editor").hide(),v=!1,r("#svg_source_textarea").blur(),g(!1)};setTimeout((function(){r("#tool_source_save").clone().hide().attr("id","foreign_save").unbind().appendTo("#tool_source_back").click(_asyncToGenerator(regeneratorRuntime.mark((function _callee(){return regeneratorRuntime.wrap((function _callee$(t){for(;;)switch(t.prev=t.next){case 0:if(v){t.next=2;break}return t.abrupt("return");case 2:if(p(r("#svg_source_textarea").val())){t.next=11;break}return t.next=5,r.confirm("Errors found. Revert to original?");case 5:if(t.sent){t.next=8;break}return t.abrupt("return");case 8:e(),t.next=12;break;case 11:e();case 12:case"end":return t.stop()}}),_callee)})))),r("#tool_source_cancel").clone().hide().attr("id","foreign_cancel").unbind().appendTo("#tool_source_back").click((function(){e()}))}),3e3)},mouseDown:function mouseDown(e){if("foreign"===c.getMode()){h=!0,d=c.addSVGElementFromJson({element:"foreignObject",attr:{x:e.start_x,y:e.start_y,id:c.getNextId(),"font-size":16,width:"48",height:"20",style:"pointer-events:inherit"}});var t=s.createElementNS(i.MATH,"math");t.setAttributeNS(i.XMLNS,"xmlns",i.MATH),t.setAttribute("display","inline");var n=s.createElementNS(i.MATH,"mi");n.setAttribute("mathvariant","normal"),n.textContent="Φ";var r=s.createElementNS(i.MATH,"mo");r.textContent="∪";var o=s.createElementNS(i.MATH,"mi");return o.textContent="ℳ",t.append(n,r,o),d.append(t),{started:!0}}},mouseUp:function mouseUp(e){if("foreign"===c.getMode()&&h){var t=r(d).attr(["width","height"]),n="0"!==t.width||"0"!==t.height;return c.addToSelection([d],!0),{keep:n,element:d}}},selectedChanged:function selectedChanged(e){for(var t=(_=e.elems).length;t--;){var n=_[t];n&&"foreignObject"===n.tagName&&e.selectedElement&&!e.multiselected?(r("#foreign_font_size").val(n.getAttribute("font-size")),r("#foreign_width").val(n.getAttribute("width")),r("#foreign_height").val(n.getAttribute("height")),f(!0)):f(!1)}},elementChanged:function elementChanged(e){}});case 17:case"end":return w.stop()}}),_callee2)})))()}};export default e; //# sourceMappingURL=ext-foreignobject.js.map diff --git a/dist/editor/extensions/ext-foreignobject.js.map b/dist/editor/extensions/ext-foreignobject.js.map index 1f6d42a5..66f3b8af 100644 --- a/dist/editor/extensions/ext-foreignobject.js.map +++ b/dist/editor/extensions/ext-foreignobject.js.map @@ -1 +1 @@ -{"version":3,"file":"ext-foreignobject.js","sources":["../../../src/editor/extensions/ext-foreignobject.js"],"sourcesContent":["/**\n * @file ext-foreignobject.js\n *\n * @license Apache-2.0\n *\n * @copyright 2010 Jacques Distler, 2010 Alexis Deveria\n *\n */\n\nexport default {\n name: 'foreignobject',\n async init (S) {\n const svgEditor = this;\n const {$, text2xml, NS, importLocale} = S;\n const svgCanvas = svgEditor.canvas;\n const\n // {svgcontent} = S,\n // addElem = svgCanvas.addSVGElementFromJson,\n svgdoc = S.svgroot.parentNode.ownerDocument;\n const strings = await importLocale();\n\n const properlySourceSizeTextArea = function () {\n // TODO: remove magic numbers here and get values from CSS\n const height = $('#svg_source_container').height() - 80;\n $('#svg_source_textarea').css('height', height);\n };\n\n /**\n * @param {boolean} on\n * @returns {void}\n */\n function showPanel (on) {\n let fcRules = $('#fc_rules');\n if (!fcRules.length) {\n fcRules = $('').appendTo('head');\n }\n fcRules.text(!on ? '' : ' #tool_topath { display: none !important; }');\n $('#foreignObject_panel').toggle(on);\n }\n\n /**\n * @param {boolean} on\n * @returns {void}\n */\n function toggleSourceButtons (on) {\n $('#tool_source_save, #tool_source_cancel').toggle(!on);\n $('#foreign_save, #foreign_cancel').toggle(on);\n }\n\n let selElems,\n started,\n newFO,\n editingforeign = false;\n\n /**\n * This function sets the content of element elt to the input XML.\n * @param {string} xmlString - The XML text\n * @returns {boolean} This function returns false if the set was unsuccessful, true otherwise.\n */\n function setForeignString (xmlString) {\n const elt = selElems[0]; // The parent `Element` to append to\n try {\n // convert string into XML document\n const newDoc = text2xml('' + xmlString + '');\n // run it through our sanitizer to remove anything we do not support\n svgCanvas.sanitizeSvg(newDoc.documentElement);\n elt.replaceWith(svgdoc.importNode(newDoc.documentElement.firstChild, true));\n svgCanvas.call('changed', [elt]);\n svgCanvas.clearSelection();\n } catch (e) {\n // Todo: Surface error to user\n console.log(e); // eslint-disable-line no-console\n return false;\n }\n\n return true;\n }\n\n /**\n *\n * @returns {void}\n */\n function showForeignEditor () {\n const elt = selElems[0];\n if (!elt || editingforeign) { return; }\n editingforeign = true;\n toggleSourceButtons(true);\n elt.removeAttribute('fill');\n\n const str = svgCanvas.svgToString(elt, 0);\n $('#svg_source_textarea').val(str);\n $('#svg_source_editor').fadeIn();\n properlySourceSizeTextArea();\n $('#svg_source_textarea').focus();\n }\n\n /**\n * @param {string} attr\n * @param {string|Float} val\n * @returns {void}\n */\n function setAttr (attr, val) {\n svgCanvas.changeSelectedAttribute(attr, val);\n svgCanvas.call('changed', selElems);\n }\n\n const buttons = [{\n id: 'tool_foreign',\n icon: 'foreignobject-tool.png',\n type: 'mode',\n events: {\n click () {\n svgCanvas.setMode('foreign');\n }\n }\n }, {\n id: 'edit_foreign',\n icon: 'foreignobject-edit.png',\n type: 'context',\n panel: 'foreignObject_panel',\n events: {\n click () {\n showForeignEditor();\n }\n }\n }];\n\n const contextTools = [\n {\n type: 'input',\n panel: 'foreignObject_panel',\n id: 'foreign_width',\n size: 3,\n events: {\n change () {\n setAttr('width', this.value);\n }\n }\n }, {\n type: 'input',\n panel: 'foreignObject_panel',\n id: 'foreign_height',\n events: {\n change () {\n setAttr('height', this.value);\n }\n }\n }, {\n type: 'input',\n panel: 'foreignObject_panel',\n id: 'foreign_font_size',\n size: 2,\n defval: 16,\n events: {\n change () {\n setAttr('font-size', this.value);\n }\n }\n }\n ];\n\n return {\n name: strings.name,\n svgicons: 'foreignobject-icons.xml',\n buttons: strings.buttons.map((button, i) => {\n return Object.assign(buttons[i], button);\n }),\n context_tools: strings.contextTools.map((contextTool, i) => {\n return Object.assign(contextTools[i], contextTool);\n }),\n callback () {\n $('#foreignObject_panel').hide();\n\n const endChanges = function () {\n $('#svg_source_editor').hide();\n editingforeign = false;\n $('#svg_source_textarea').blur();\n toggleSourceButtons(false);\n };\n\n // TODO: Needs to be done after orig icon loads\n setTimeout(function () {\n // Create source save/cancel buttons\n /* const save = */ $('#tool_source_save').clone()\n .hide().attr('id', 'foreign_save').unbind()\n .appendTo('#tool_source_back').click(async function () {\n if (!editingforeign) { return; }\n\n if (!setForeignString($('#svg_source_textarea').val())) {\n const ok = await $.confirm('Errors found. Revert to original?');\n if (!ok) { return; }\n endChanges();\n } else {\n endChanges();\n }\n // setSelectMode();\n });\n\n /* const cancel = */ $('#tool_source_cancel').clone()\n .hide().attr('id', 'foreign_cancel').unbind()\n .appendTo('#tool_source_back').click(function () {\n endChanges();\n });\n }, 3000);\n },\n mouseDown (opts) {\n // const e = opts.event;\n if (svgCanvas.getMode() !== 'foreign') {\n return undefined;\n }\n started = true;\n newFO = svgCanvas.addSVGElementFromJson({\n element: 'foreignObject',\n attr: {\n x: opts.start_x,\n y: opts.start_y,\n id: svgCanvas.getNextId(),\n 'font-size': 16, // cur_text.font_size,\n width: '48',\n height: '20',\n style: 'pointer-events:inherit'\n }\n });\n const m = svgdoc.createElementNS(NS.MATH, 'math');\n m.setAttributeNS(NS.XMLNS, 'xmlns', NS.MATH);\n m.setAttribute('display', 'inline');\n const mi = svgdoc.createElementNS(NS.MATH, 'mi');\n mi.setAttribute('mathvariant', 'normal');\n mi.textContent = '\\u03A6';\n const mo = svgdoc.createElementNS(NS.MATH, 'mo');\n mo.textContent = '\\u222A';\n const mi2 = svgdoc.createElementNS(NS.MATH, 'mi');\n mi2.textContent = '\\u2133';\n m.append(mi, mo, mi2);\n newFO.append(m);\n return {\n started: true\n };\n },\n mouseUp (opts) {\n // const e = opts.event;\n if (svgCanvas.getMode() !== 'foreign' || !started) {\n return undefined;\n }\n const attrs = $(newFO).attr(['width', 'height']);\n const keep = (attrs.width !== '0' || attrs.height !== '0');\n svgCanvas.addToSelection([newFO], true);\n\n return {\n keep,\n element: newFO\n };\n },\n selectedChanged (opts) {\n // Use this to update the current selected elements\n selElems = opts.elems;\n\n let i = selElems.length;\n while (i--) {\n const elem = selElems[i];\n if (elem && elem.tagName === 'foreignObject') {\n if (opts.selectedElement && !opts.multiselected) {\n $('#foreign_font_size').val(elem.getAttribute('font-size'));\n $('#foreign_width').val(elem.getAttribute('width'));\n $('#foreign_height').val(elem.getAttribute('height'));\n showPanel(true);\n } else {\n showPanel(false);\n }\n } else {\n showPanel(false);\n }\n }\n },\n elementChanged (opts) {\n // const elem = opts.elems[0];\n }\n };\n }\n};\n"],"names":["name","init","S","showPanel","toggleSourceButtons","setForeignString","showForeignEditor","setAttr","attr","val","svgCanvas","changeSelectedAttribute","call","selElems","elt","editingforeign","removeAttribute","str","svgToString","$","fadeIn","properlySourceSizeTextArea","focus","xmlString","newDoc","text2xml","NS","SVG","XLINK","sanitizeSvg","documentElement","replaceWith","svgdoc","importNode","firstChild","clearSelection","e","console","log","on","toggle","fcRules","length","appendTo","text","svgEditor","importLocale","canvas","svgroot","parentNode","ownerDocument","strings","height","css","buttons","id","icon","type","events","click","setMode","panel","contextTools","size","change","value","defval","svgicons","map","button","i","Object","assign","context_tools","contextTool","callback","hide","endChanges","blur","setTimeout","clone","unbind","confirm","ok","mouseDown","opts","getMode","undefined","started","newFO","addSVGElementFromJson","element","x","start_x","y","start_y","getNextId","width","style","m","createElementNS","MATH","setAttributeNS","XMLNS","setAttribute","mi","textContent","mo","mi2","append","mouseUp","attrs","keep","addToSelection","selectedChanged","elems","elem","tagName","selectedElement","multiselected","getAttribute","elementChanged"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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,gBAAAA,cAjHK,0BAiHWpC,IAjHX,EAiHiB;AAErB;AAnHI,eAtJM;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AA2Qd;AA7QY,CAAf;;;;"} \ No newline at end of file +{"version":3,"file":"ext-foreignobject.js","sources":["../../../src/editor/extensions/ext-foreignobject.js"],"sourcesContent":["/**\n * @file ext-foreignobject.js\n *\n * @license Apache-2.0\n *\n * @copyright 2010 Jacques Distler, 2010 Alexis Deveria\n *\n */\n\nexport default {\n name: 'foreignobject',\n async init (S) {\n const svgEditor = this;\n const {$, text2xml, NS, importLocale} = S;\n const svgCanvas = svgEditor.canvas;\n const\n // {svgcontent} = S,\n // addElem = svgCanvas.addSVGElementFromJson,\n svgdoc = S.svgroot.parentNode.ownerDocument;\n const strings = await importLocale();\n\n const properlySourceSizeTextArea = function () {\n // TODO: remove magic numbers here and get values from CSS\n const height = $('#svg_source_container').height() - 80;\n $('#svg_source_textarea').css('height', height);\n };\n\n /**\n * @param {boolean} on\n * @returns {void}\n */\n function showPanel (on) {\n let fcRules = $('#fc_rules');\n if (!fcRules.length) {\n fcRules = $('').appendTo('head');\n }\n fcRules.text(!on ? '' : ' #tool_topath { display: none !important; }');\n $('#foreignObject_panel').toggle(on);\n }\n\n /**\n * @param {boolean} on\n * @returns {void}\n */\n function toggleSourceButtons (on) {\n $('#tool_source_save, #tool_source_cancel').toggle(!on);\n $('#foreign_save, #foreign_cancel').toggle(on);\n }\n\n let selElems,\n started,\n newFO,\n editingforeign = false;\n\n /**\n * This function sets the content of element elt to the input XML.\n * @param {string} xmlString - The XML text\n * @returns {boolean} This function returns false if the set was unsuccessful, true otherwise.\n */\n function setForeignString (xmlString) {\n const elt = selElems[0]; // The parent `Element` to append to\n try {\n // convert string into XML document\n const newDoc = text2xml('' + xmlString + '');\n // run it through our sanitizer to remove anything we do not support\n svgCanvas.sanitizeSvg(newDoc.documentElement);\n elt.replaceWith(svgdoc.importNode(newDoc.documentElement.firstChild, true));\n svgCanvas.call('changed', [elt]);\n svgCanvas.clearSelection();\n } catch (e) {\n // Todo: Surface error to user\n console.log(e); // eslint-disable-line no-console\n return false;\n }\n\n return true;\n }\n\n /**\n *\n * @returns {void}\n */\n function showForeignEditor () {\n const elt = selElems[0];\n if (!elt || editingforeign) { return; }\n editingforeign = true;\n toggleSourceButtons(true);\n elt.removeAttribute('fill');\n\n const str = svgCanvas.svgToString(elt, 0);\n $('#svg_source_textarea').val(str);\n $('#svg_source_editor').fadeIn();\n properlySourceSizeTextArea();\n $('#svg_source_textarea').focus();\n }\n\n /**\n * @param {string} attr\n * @param {string|Float} val\n * @returns {void}\n */\n function setAttr (attr, val) {\n svgCanvas.changeSelectedAttribute(attr, val);\n svgCanvas.call('changed', selElems);\n }\n\n const buttons = [{\n id: 'tool_foreign',\n icon: 'foreignobject-tool.png',\n type: 'mode',\n events: {\n click () {\n svgCanvas.setMode('foreign');\n }\n }\n }, {\n id: 'edit_foreign',\n icon: 'foreignobject-edit.png',\n type: 'context',\n panel: 'foreignObject_panel',\n events: {\n click () {\n showForeignEditor();\n }\n }\n }];\n\n const contextTools = [\n {\n type: 'input',\n panel: 'foreignObject_panel',\n id: 'foreign_width',\n size: 3,\n events: {\n change () {\n setAttr('width', this.value);\n }\n }\n }, {\n type: 'input',\n panel: 'foreignObject_panel',\n id: 'foreign_height',\n events: {\n change () {\n setAttr('height', this.value);\n }\n }\n }, {\n type: 'input',\n panel: 'foreignObject_panel',\n id: 'foreign_font_size',\n size: 2,\n defval: 16,\n events: {\n change () {\n setAttr('font-size', this.value);\n }\n }\n }\n ];\n\n return {\n name: strings.name,\n svgicons: 'foreignobject-icons.xml',\n buttons: strings.buttons.map((button, i) => {\n return Object.assign(buttons[i], button);\n }),\n context_tools: strings.contextTools.map((contextTool, i) => {\n return Object.assign(contextTools[i], contextTool);\n }),\n callback () {\n $('#foreignObject_panel').hide();\n\n const endChanges = function () {\n $('#svg_source_editor').hide();\n editingforeign = false;\n $('#svg_source_textarea').blur();\n toggleSourceButtons(false);\n };\n\n // TODO: Needs to be done after orig icon loads\n setTimeout(function () {\n // Create source save/cancel buttons\n /* const save = */ $('#tool_source_save').clone()\n .hide().attr('id', 'foreign_save').unbind()\n .appendTo('#tool_source_back').click(async function () {\n if (!editingforeign) { return; }\n\n if (!setForeignString($('#svg_source_textarea').val())) {\n const ok = await $.confirm('Errors found. Revert to original?');\n if (!ok) { return; }\n endChanges();\n } else {\n endChanges();\n }\n // setSelectMode();\n });\n\n /* const cancel = */ $('#tool_source_cancel').clone()\n .hide().attr('id', 'foreign_cancel').unbind()\n .appendTo('#tool_source_back').click(function () {\n endChanges();\n });\n }, 3000);\n },\n mouseDown (opts) {\n // const e = opts.event;\n if (svgCanvas.getMode() !== 'foreign') {\n return undefined;\n }\n started = true;\n newFO = svgCanvas.addSVGElementFromJson({\n element: 'foreignObject',\n attr: {\n x: opts.start_x,\n y: opts.start_y,\n id: svgCanvas.getNextId(),\n 'font-size': 16, // cur_text.font_size,\n width: '48',\n height: '20',\n style: 'pointer-events:inherit'\n }\n });\n const m = svgdoc.createElementNS(NS.MATH, 'math');\n m.setAttributeNS(NS.XMLNS, 'xmlns', NS.MATH);\n m.setAttribute('display', 'inline');\n const mi = svgdoc.createElementNS(NS.MATH, 'mi');\n mi.setAttribute('mathvariant', 'normal');\n mi.textContent = '\\u03A6';\n const mo = svgdoc.createElementNS(NS.MATH, 'mo');\n mo.textContent = '\\u222A';\n const mi2 = svgdoc.createElementNS(NS.MATH, 'mi');\n mi2.textContent = '\\u2133';\n m.append(mi, mo, mi2);\n newFO.append(m);\n return {\n started: true\n };\n },\n mouseUp (opts) {\n // const e = opts.event;\n if (svgCanvas.getMode() !== 'foreign' || !started) {\n return undefined;\n }\n const attrs = $(newFO).attr(['width', 'height']);\n const keep = (attrs.width !== '0' || attrs.height !== '0');\n svgCanvas.addToSelection([newFO], true);\n\n return {\n keep,\n element: newFO\n };\n },\n selectedChanged (opts) {\n // Use this to update the current selected elements\n selElems = opts.elems;\n\n let i = selElems.length;\n while (i--) {\n const elem = selElems[i];\n if (elem && elem.tagName === 'foreignObject') {\n if (opts.selectedElement && !opts.multiselected) {\n $('#foreign_font_size').val(elem.getAttribute('font-size'));\n $('#foreign_width').val(elem.getAttribute('width'));\n $('#foreign_height').val(elem.getAttribute('height'));\n showPanel(true);\n } else {\n showPanel(false);\n }\n } else {\n showPanel(false);\n }\n }\n },\n elementChanged (opts) {\n // const elem = opts.elems[0];\n }\n };\n }\n};\n"],"names":["name","init","S","showPanel","toggleSourceButtons","setForeignString","showForeignEditor","setAttr","attr","val","svgCanvas","changeSelectedAttribute","call","selElems","elt","editingforeign","removeAttribute","str","svgToString","$","fadeIn","properlySourceSizeTextArea","focus","xmlString","newDoc","text2xml","NS","SVG","XLINK","sanitizeSvg","documentElement","replaceWith","svgdoc","importNode","firstChild","clearSelection","e","console","log","on","toggle","fcRules","length","appendTo","text","svgEditor","_this","importLocale","canvas","svgroot","parentNode","ownerDocument","strings","height","css","buttons","id","icon","type","events","click","setMode","panel","contextTools","size","change","this","value","defval","svgicons","map","button","i","Object","assign","context_tools","contextTool","callback","hide","endChanges","blur","setTimeout","clone","unbind","confirm","mouseDown","opts","getMode","started","newFO","addSVGElementFromJson","element","x","start_x","y","start_y","getNextId","width","style","m","createElementNS","MATH","setAttributeNS","XMLNS","setAttribute","mi","textContent","mo","mi2","append","mouseUp","attrs","keep","addToSelection","selectedChanged","elems","elem","tagName","selectedElement","multiselected","getAttribute","elementChanged"],"mappings":";;;;;;;;;AASA,MAAe,CACbA,KAAM,gBACAC,mBAAMC,0GAoBDC,EAaAC,UAeAC,EAuBAC,EAmBAC,uGAAAA,oBAASC,EAAMC,GACtBC,EAAUC,wBAAwBH,EAAMC,GACxCC,EAAUE,KAAK,UAAWC,IArBnBP,oCACDQ,EAAMD,EAAS,MAChBC,IAAOC,GACZA,GAAiB,EACjBX,GAAoB,GACpBU,EAAIE,gBAAgB,YAEdC,EAAMP,EAAUQ,YAAYJ,EAAK,GACvCK,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,QAAS7E,EAAG2E,MACvCF,EAAEK,aAAa,UAAW,cACpBC,EAAKzE,EAAOoE,gBAAgB1E,EAAG2E,KAAM,MAC3CI,EAAGD,aAAa,cAAe,UAC/BC,EAAGC,YAAc,QACXC,EAAK3E,EAAOoE,gBAAgB1E,EAAG2E,KAAM,MAC3CM,EAAGD,YAAc,QACXE,EAAM5E,EAAOoE,gBAAgB1E,EAAG2E,KAAM,aAC5CO,EAAIF,YAAc,IAClBP,EAAEU,OAAOJ,EAAIE,EAAIC,GACjBnB,EAAMoB,OAAOV,GACN,CACLX,SAAS,KAGbsB,yBAASxB,MAEqB,YAAxB5E,EAAU6E,WAA4BC,OAGpCuB,EAAQ5F,EAAEsE,GAAOjF,KAAK,CAAC,QAAS,WAChCwG,EAAwB,MAAhBD,EAAMd,OAAkC,MAAjBc,EAAM1D,cAC3C3C,EAAUuG,eAAe,CAACxB,IAAQ,GAE3B,CACLuB,KAAAA,EACArB,QAASF,KAGbyB,yCAAiB5B,WAIXd,GAFJ3D,EAAWyE,EAAK6B,OAECzE,OACV8B,KAAK,KACJ4C,EAAOvG,EAAS2D,GAClB4C,GAAyB,kBAAjBA,EAAKC,SACX/B,EAAKgC,kBAAoBhC,EAAKiC,eAChCpG,EAAE,sBAAsBV,IAAI2G,EAAKI,aAAa,cAC9CrG,EAAE,kBAAkBV,IAAI2G,EAAKI,aAAa,UAC1CrG,EAAE,mBAAmBV,IAAI2G,EAAKI,aAAa,WAC3CrH,GAAU,IAKZA,GAAU,KAIhBsH,uCAAgBnC"} \ No newline at end of file diff --git a/dist/editor/extensions/ext-grid.js b/dist/editor/extensions/ext-grid.js index 641c5e41..14dbe570 100644 --- a/dist/editor/extensions/ext-grid.js +++ b/dist/editor/extensions/ext-grid.js @@ -1,1651 +1,4 @@ -function _typeof(obj) { - "@babel/helpers - typeof"; - - if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { - _typeof = function (obj) { - return typeof obj; - }; - } else { - _typeof = function (obj) { - return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; - }; - } - - return _typeof(obj); -} - -var REACT_ELEMENT_TYPE; - -function _jsx(type, props, key, children) { - if (!REACT_ELEMENT_TYPE) { - REACT_ELEMENT_TYPE = typeof Symbol === "function" && Symbol["for"] && Symbol["for"]("react.element") || 0xeac7; - } - - var defaultProps = type && type.defaultProps; - var childrenLength = arguments.length - 3; - - if (!props && childrenLength !== 0) { - props = { - children: void 0 - }; - } - - if (childrenLength === 1) { - props.children = children; - } else if (childrenLength > 1) { - var childArray = new Array(childrenLength); - - for (var i = 0; i < childrenLength; i++) { - childArray[i] = arguments[i + 3]; - } - - props.children = childArray; - } - - if (props && defaultProps) { - for (var propName in defaultProps) { - if (props[propName] === void 0) { - props[propName] = defaultProps[propName]; - } - } - } else if (!props) { - props = defaultProps || {}; - } - - return { - $$typeof: REACT_ELEMENT_TYPE, - type: type, - key: key === undefined ? null : '' + key, - ref: null, - props: props, - _owner: null - }; -} - -function _asyncIterator(iterable) { - var method; - - if (typeof Symbol !== "undefined") { - if (Symbol.asyncIterator) { - method = iterable[Symbol.asyncIterator]; - if (method != null) return method.call(iterable); - } - - if (Symbol.iterator) { - method = iterable[Symbol.iterator]; - if (method != null) return method.call(iterable); - } - } - - throw new TypeError("Object is not async iterable"); -} - -function _AwaitValue(value) { - this.wrapped = value; -} - -function _AsyncGenerator(gen) { - var front, back; - - function send(key, arg) { - return new Promise(function (resolve, reject) { - var request = { - key: key, - arg: arg, - resolve: resolve, - reject: reject, - next: null - }; - - if (back) { - back = back.next = request; - } else { - front = back = request; - resume(key, arg); - } - }); - } - - function resume(key, arg) { - try { - var result = gen[key](arg); - var value = result.value; - var wrappedAwait = value instanceof _AwaitValue; - Promise.resolve(wrappedAwait ? value.wrapped : value).then(function (arg) { - if (wrappedAwait) { - resume(key === "return" ? "return" : "next", arg); - return; - } - - settle(result.done ? "return" : "normal", arg); - }, function (err) { - resume("throw", err); - }); - } catch (err) { - settle("throw", err); - } - } - - function settle(type, value) { - switch (type) { - case "return": - front.resolve({ - value: value, - done: true - }); - break; - - case "throw": - front.reject(value); - break; - - default: - front.resolve({ - value: value, - done: false - }); - break; - } - - front = front.next; - - if (front) { - resume(front.key, front.arg); - } else { - back = null; - } - } - - this._invoke = send; - - if (typeof gen.return !== "function") { - this.return = undefined; - } -} - -if (typeof Symbol === "function" && Symbol.asyncIterator) { - _AsyncGenerator.prototype[Symbol.asyncIterator] = function () { - return this; - }; -} - -_AsyncGenerator.prototype.next = function (arg) { - return this._invoke("next", arg); -}; - -_AsyncGenerator.prototype.throw = function (arg) { - return this._invoke("throw", arg); -}; - -_AsyncGenerator.prototype.return = function (arg) { - return this._invoke("return", arg); -}; - -function _wrapAsyncGenerator(fn) { - return function () { - return new _AsyncGenerator(fn.apply(this, arguments)); - }; -} - -function _awaitAsyncGenerator(value) { - return new _AwaitValue(value); -} - -function _asyncGeneratorDelegate(inner, awaitWrap) { - var iter = {}, - waiting = false; - - function pump(key, value) { - waiting = true; - value = new Promise(function (resolve) { - resolve(inner[key](value)); - }); - return { - done: false, - value: awaitWrap(value) - }; - } - - ; - - if (typeof Symbol === "function" && Symbol.iterator) { - iter[Symbol.iterator] = function () { - return this; - }; - } - - iter.next = function (value) { - if (waiting) { - waiting = false; - return value; - } - - return pump("next", value); - }; - - if (typeof inner.throw === "function") { - iter.throw = function (value) { - if (waiting) { - waiting = false; - throw value; - } - - return pump("throw", value); - }; - } - - if (typeof inner.return === "function") { - iter.return = function (value) { - if (waiting) { - waiting = false; - return value; - } - - return pump("return", value); - }; - } - - return iter; -} - -function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { - try { - var info = gen[key](arg); - var value = info.value; - } catch (error) { - reject(error); - return; - } - - if (info.done) { - resolve(value); - } else { - Promise.resolve(value).then(_next, _throw); - } -} - -function _asyncToGenerator(fn) { - return function () { - var self = this, - args = arguments; - return new Promise(function (resolve, reject) { - var gen = fn.apply(self, args); - - function _next(value) { - asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value); - } - - function _throw(err) { - asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err); - } - - _next(undefined); - }); - }; -} - -function _classCallCheck(instance, Constructor) { - if (!(instance instanceof Constructor)) { - throw new TypeError("Cannot call a class as a function"); - } -} - -function _defineProperties(target, props) { - for (var i = 0; i < props.length; i++) { - var descriptor = props[i]; - descriptor.enumerable = descriptor.enumerable || false; - descriptor.configurable = true; - if ("value" in descriptor) descriptor.writable = true; - Object.defineProperty(target, descriptor.key, descriptor); - } -} - -function _createClass(Constructor, protoProps, staticProps) { - if (protoProps) _defineProperties(Constructor.prototype, protoProps); - if (staticProps) _defineProperties(Constructor, staticProps); - return Constructor; -} - -function _defineEnumerableProperties(obj, descs) { - for (var key in descs) { - var desc = descs[key]; - desc.configurable = desc.enumerable = true; - if ("value" in desc) desc.writable = true; - Object.defineProperty(obj, key, desc); - } - - if (Object.getOwnPropertySymbols) { - var objectSymbols = Object.getOwnPropertySymbols(descs); - - for (var i = 0; i < objectSymbols.length; i++) { - var sym = objectSymbols[i]; - var desc = descs[sym]; - desc.configurable = desc.enumerable = true; - if ("value" in desc) desc.writable = true; - Object.defineProperty(obj, sym, desc); - } - } - - return obj; -} - -function _defaults(obj, defaults) { - var keys = Object.getOwnPropertyNames(defaults); - - for (var i = 0; i < keys.length; i++) { - var key = keys[i]; - var value = Object.getOwnPropertyDescriptor(defaults, key); - - if (value && value.configurable && obj[key] === undefined) { - Object.defineProperty(obj, key, value); - } - } - - return obj; -} - -function _defineProperty(obj, key, value) { - if (key in obj) { - Object.defineProperty(obj, key, { - value: value, - enumerable: true, - configurable: true, - writable: true - }); - } else { - obj[key] = value; - } - - return obj; -} - -function _extends() { - _extends = Object.assign || function (target) { - for (var i = 1; i < arguments.length; i++) { - var source = arguments[i]; - - for (var key in source) { - if (Object.prototype.hasOwnProperty.call(source, key)) { - target[key] = source[key]; - } - } - } - - return target; - }; - - return _extends.apply(this, arguments); -} - -function _objectSpread(target) { - for (var i = 1; i < arguments.length; i++) { - var source = arguments[i] != null ? Object(arguments[i]) : {}; - var ownKeys = Object.keys(source); - - if (typeof Object.getOwnPropertySymbols === 'function') { - ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function (sym) { - return Object.getOwnPropertyDescriptor(source, sym).enumerable; - })); - } - - ownKeys.forEach(function (key) { - _defineProperty(target, key, source[key]); - }); - } - - return target; -} - -function ownKeys(object, enumerableOnly) { - var keys = Object.keys(object); - - if (Object.getOwnPropertySymbols) { - var symbols = Object.getOwnPropertySymbols(object); - if (enumerableOnly) symbols = symbols.filter(function (sym) { - return Object.getOwnPropertyDescriptor(object, sym).enumerable; - }); - keys.push.apply(keys, symbols); - } - - return keys; -} - -function _objectSpread2(target) { - for (var i = 1; i < arguments.length; i++) { - var source = arguments[i] != null ? arguments[i] : {}; - - if (i % 2) { - ownKeys(Object(source), true).forEach(function (key) { - _defineProperty(target, key, source[key]); - }); - } else if (Object.getOwnPropertyDescriptors) { - Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); - } else { - ownKeys(Object(source)).forEach(function (key) { - Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); - }); - } - } - - return target; -} - -function _inherits(subClass, superClass) { - if (typeof superClass !== "function" && superClass !== null) { - throw new TypeError("Super expression must either be null or a function"); - } - - subClass.prototype = Object.create(superClass && superClass.prototype, { - constructor: { - value: subClass, - writable: true, - configurable: true - } - }); - if (superClass) _setPrototypeOf(subClass, superClass); -} - -function _inheritsLoose(subClass, superClass) { - subClass.prototype = Object.create(superClass.prototype); - subClass.prototype.constructor = subClass; - subClass.__proto__ = superClass; -} - -function _getPrototypeOf(o) { - _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { - return o.__proto__ || Object.getPrototypeOf(o); - }; - return _getPrototypeOf(o); -} - -function _setPrototypeOf(o, p) { - _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { - o.__proto__ = p; - return o; - }; - - 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 _construct(Parent, args, Class) { - if (_isNativeReflectConstruct()) { - _construct = Reflect.construct; - } else { - _construct = function _construct(Parent, args, Class) { - var a = [null]; - a.push.apply(a, args); - var Constructor = Function.bind.apply(Parent, a); - var instance = new Constructor(); - if (Class) _setPrototypeOf(instance, Class.prototype); - return instance; - }; - } - - return _construct.apply(null, arguments); -} - -function _isNativeFunction(fn) { - return Function.toString.call(fn).indexOf("[native code]") !== -1; -} - -function _wrapNativeSuper(Class) { - var _cache = typeof Map === "function" ? new Map() : undefined; - - _wrapNativeSuper = function _wrapNativeSuper(Class) { - if (Class === null || !_isNativeFunction(Class)) return Class; - - if (typeof Class !== "function") { - throw new TypeError("Super expression must either be null or a function"); - } - - if (typeof _cache !== "undefined") { - if (_cache.has(Class)) return _cache.get(Class); - - _cache.set(Class, Wrapper); - } - - function Wrapper() { - return _construct(Class, arguments, _getPrototypeOf(this).constructor); - } - - Wrapper.prototype = Object.create(Class.prototype, { - constructor: { - value: Wrapper, - enumerable: false, - writable: true, - configurable: true - } - }); - return _setPrototypeOf(Wrapper, Class); - }; - - return _wrapNativeSuper(Class); -} - -function _instanceof(left, right) { - if (right != null && typeof Symbol !== "undefined" && right[Symbol.hasInstance]) { - return !!right[Symbol.hasInstance](left); - } else { - return left instanceof right; - } -} - -function _interopRequireDefault(obj) { - return obj && obj.__esModule ? obj : { - default: obj - }; -} - -function _getRequireWildcardCache() { - if (typeof WeakMap !== "function") return null; - var cache = new WeakMap(); - - _getRequireWildcardCache = function () { - return cache; - }; - - return cache; -} - -function _interopRequireWildcard(obj) { - if (obj && obj.__esModule) { - return obj; - } - - if (obj === null || typeof obj !== "object" && typeof obj !== "function") { - return { - default: obj - }; - } - - var cache = _getRequireWildcardCache(); - - if (cache && cache.has(obj)) { - return cache.get(obj); - } - - var newObj = {}; - var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; - - for (var key in obj) { - if (Object.prototype.hasOwnProperty.call(obj, key)) { - var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; - - if (desc && (desc.get || desc.set)) { - Object.defineProperty(newObj, key, desc); - } else { - newObj[key] = obj[key]; - } - } - } - - newObj.default = obj; - - if (cache) { - cache.set(obj, newObj); - } - - return newObj; -} - -function _newArrowCheck(innerThis, boundThis) { - if (innerThis !== boundThis) { - throw new TypeError("Cannot instantiate an arrow function"); - } -} - -function _objectDestructuringEmpty(obj) { - if (obj == null) throw new TypeError("Cannot destructure undefined"); -} - -function _objectWithoutPropertiesLoose(source, excluded) { - if (source == null) return {}; - var target = {}; - var sourceKeys = Object.keys(source); - var key, i; - - for (i = 0; i < sourceKeys.length; i++) { - key = sourceKeys[i]; - if (excluded.indexOf(key) >= 0) continue; - target[key] = source[key]; - } - - return target; -} - -function _objectWithoutProperties(source, excluded) { - if (source == null) return {}; - - var target = _objectWithoutPropertiesLoose(source, excluded); - - var key, i; - - if (Object.getOwnPropertySymbols) { - var sourceSymbolKeys = Object.getOwnPropertySymbols(source); - - for (i = 0; i < sourceSymbolKeys.length; i++) { - key = sourceSymbolKeys[i]; - if (excluded.indexOf(key) >= 0) continue; - if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; - target[key] = source[key]; - } - } - - return target; -} - -function _assertThisInitialized(self) { - if (self === void 0) { - throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); - } - - return self; -} - -function _possibleConstructorReturn(self, call) { - if (call && (typeof call === "object" || typeof call === "function")) { - return call; - } - - return _assertThisInitialized(self); -} - -function _createSuper(Derived) { - var hasNativeReflectConstruct = _isNativeReflectConstruct(); - - return function _createSuperInternal() { - var Super = _getPrototypeOf(Derived), - result; - - if (hasNativeReflectConstruct) { - 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); - if (object === null) break; - } - - return object; -} - -function _get(target, property, receiver) { - if (typeof Reflect !== "undefined" && Reflect.get) { - _get = Reflect.get; - } else { - _get = function _get(target, property, receiver) { - var base = _superPropBase(target, property); - - if (!base) return; - var desc = Object.getOwnPropertyDescriptor(base, property); - - if (desc.get) { - return desc.get.call(receiver); - } - - return desc.value; - }; - } - - return _get(target, property, receiver || target); -} - -function set(target, property, value, receiver) { - if (typeof Reflect !== "undefined" && Reflect.set) { - set = Reflect.set; - } else { - set = function set(target, property, value, receiver) { - var base = _superPropBase(target, property); - - var desc; - - if (base) { - desc = Object.getOwnPropertyDescriptor(base, property); - - if (desc.set) { - desc.set.call(receiver, value); - return true; - } else if (!desc.writable) { - return false; - } - } - - desc = Object.getOwnPropertyDescriptor(receiver, property); - - if (desc) { - if (!desc.writable) { - return false; - } - - desc.value = value; - Object.defineProperty(receiver, property, desc); - } else { - _defineProperty(receiver, property, value); - } - - return true; - }; - } - - return set(target, property, value, receiver); -} - -function _set(target, property, value, receiver, isStrict) { - var s = set(target, property, value, receiver || target); - - if (!s && isStrict) { - throw new Error('failed to set property'); - } - - return value; -} - -function _taggedTemplateLiteral(strings, raw) { - if (!raw) { - raw = strings.slice(0); - } - - return Object.freeze(Object.defineProperties(strings, { - raw: { - value: Object.freeze(raw) - } - })); -} - -function _taggedTemplateLiteralLoose(strings, raw) { - if (!raw) { - raw = strings.slice(0); - } - - strings.raw = raw; - return strings; -} - -function _readOnlyError(name) { - throw new Error("\"" + name + "\" is read-only"); -} - -function _classNameTDZError(name) { - throw new Error("Class \"" + name + "\" cannot be referenced in computed property keys."); -} - -function _temporalUndefined() {} - -function _tdz(name) { - throw new ReferenceError(name + " is not defined - temporal dead zone"); -} - -function _temporalRef(val, name) { - return val === _temporalUndefined ? _tdz(name) : val; -} - -function _slicedToArray(arr, i) { - return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); -} - -function _slicedToArrayLoose(arr, i) { - return _arrayWithHoles(arr) || _iterableToArrayLimitLoose(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); -} - -function _toArray(arr) { - return _arrayWithHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableRest(); -} - -function _toConsumableArray(arr) { - return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); -} - -function _arrayWithoutHoles(arr) { - if (Array.isArray(arr)) return _arrayLikeToArray(arr); -} - -function _arrayWithHoles(arr) { - if (Array.isArray(arr)) return arr; -} - -function _maybeArrayLike(next, arr, i) { - if (arr && !Array.isArray(arr) && typeof arr.length === "number") { - var len = arr.length; - return _arrayLikeToArray(arr, i !== void 0 && i < len ? i : len); - } - - return next(arr, i); -} - -function _iterableToArray(iter) { - if (typeof Symbol !== "undefined" && Symbol.iterator in Object(iter)) return Array.from(iter); -} - -function _iterableToArrayLimit(arr, i) { - if (typeof Symbol === "undefined" || !(Symbol.iterator in Object(arr))) return; - var _arr = []; - var _n = true; - var _d = false; - var _e = undefined; - - try { - for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { - _arr.push(_s.value); - - if (i && _arr.length === i) break; - } - } catch (err) { - _d = true; - _e = err; - } finally { - try { - if (!_n && _i["return"] != null) _i["return"](); - } finally { - if (_d) throw _e; - } - } - - return _arr; -} - -function _iterableToArrayLimitLoose(arr, i) { - if (typeof Symbol === "undefined" || !(Symbol.iterator in Object(arr))) return; - var _arr = []; - - for (var _iterator = arr[Symbol.iterator](), _step; !(_step = _iterator.next()).done;) { - _arr.push(_step.value); - - if (i && _arr.length === i) break; - } - - 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(o); - 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.\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.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); -} - -function _createForOfIteratorHelper(o, allowArrayLike) { - var it; - - if (typeof Symbol === "undefined" || o[Symbol.iterator] == null) { - if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") { - if (it) o = it; - 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 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; - } - } - }; -} - -function _createForOfIteratorHelperLoose(o, allowArrayLike) { - var it; - - if (typeof Symbol === "undefined" || o[Symbol.iterator] == null) { - if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") { - if (it) o = it; - var i = 0; - return function () { - if (i >= o.length) return { - done: true - }; - return { - done: false, - value: o[i++] - }; - }; - } - - throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); - } - - it = o[Symbol.iterator](); - return it.next.bind(it); -} - -function _skipFirstGeneratorNext(fn) { - return function () { - var it = fn.apply(this, arguments); - it.next(); - return it; - }; -} - -function _toPrimitive(input, hint) { - if (typeof input !== "object" || input === null) return input; - var prim = input[Symbol.toPrimitive]; - - if (prim !== undefined) { - var res = prim.call(input, hint || "default"); - if (typeof res !== "object") return res; - throw new TypeError("@@toPrimitive must return a primitive value."); - } - - return (hint === "string" ? String : Number)(input); -} - -function _toPropertyKey(arg) { - var key = _toPrimitive(arg, "string"); - - return typeof key === "symbol" ? key : String(key); -} - -function _initializerWarningHelper(descriptor, context) { - throw new Error('Decorating class property failed. Please ensure that ' + 'proposal-class-properties is enabled and runs after the decorators transform.'); -} - -function _initializerDefineProperty(target, property, descriptor, context) { - if (!descriptor) return; - Object.defineProperty(target, property, { - enumerable: descriptor.enumerable, - configurable: descriptor.configurable, - writable: descriptor.writable, - value: descriptor.initializer ? descriptor.initializer.call(context) : void 0 - }); -} - -function _applyDecoratedDescriptor(target, property, decorators, descriptor, context) { - var desc = {}; - Object.keys(descriptor).forEach(function (key) { - desc[key] = descriptor[key]; - }); - desc.enumerable = !!desc.enumerable; - desc.configurable = !!desc.configurable; - - if ('value' in desc || desc.initializer) { - desc.writable = true; - } - - desc = decorators.slice().reverse().reduce(function (desc, decorator) { - return decorator(target, property, desc) || desc; - }, desc); - - if (context && desc.initializer !== void 0) { - desc.value = desc.initializer ? desc.initializer.call(context) : void 0; - desc.initializer = undefined; - } - - if (desc.initializer === void 0) { - Object.defineProperty(target, property, desc); - desc = null; - } - - return desc; -} - -var id = 0; - -function _classPrivateFieldLooseKey(name) { - return "__private_" + id++ + "_" + name; -} - -function _classPrivateFieldLooseBase(receiver, privateKey) { - if (!Object.prototype.hasOwnProperty.call(receiver, privateKey)) { - throw new TypeError("attempted to use private field on non-instance"); - } - - return receiver; -} - -function _classPrivateFieldGet(receiver, privateMap) { - var descriptor = privateMap.get(receiver); - - if (!descriptor) { - throw new TypeError("attempted to get private field on non-instance"); - } - - if (descriptor.get) { - return descriptor.get.call(receiver); - } - - return descriptor.value; -} - -function _classPrivateFieldSet(receiver, privateMap, value) { - var descriptor = privateMap.get(receiver); - - if (!descriptor) { - throw new TypeError("attempted to set private field on non-instance"); - } - - if (descriptor.set) { - descriptor.set.call(receiver, value); - } else { - if (!descriptor.writable) { - throw new TypeError("attempted to set read only private field"); - } - - descriptor.value = value; - } - - return value; -} - -function _classPrivateFieldDestructureSet(receiver, privateMap) { - if (!privateMap.has(receiver)) { - throw new TypeError("attempted to set private field on non-instance"); - } - - var descriptor = privateMap.get(receiver); - - if (descriptor.set) { - if (!("__destrObj" in descriptor)) { - descriptor.__destrObj = { - set value(v) { - descriptor.set.call(receiver, v); - } - - }; - } - - return descriptor.__destrObj; - } else { - if (!descriptor.writable) { - throw new TypeError("attempted to set read only private field"); - } - - return descriptor; - } -} - -function _classStaticPrivateFieldSpecGet(receiver, classConstructor, descriptor) { - if (receiver !== classConstructor) { - throw new TypeError("Private static access of wrong provenance"); - } - - if (descriptor.get) { - return descriptor.get.call(receiver); - } - - return descriptor.value; -} - -function _classStaticPrivateFieldSpecSet(receiver, classConstructor, descriptor, value) { - if (receiver !== classConstructor) { - throw new TypeError("Private static access of wrong provenance"); - } - - if (descriptor.set) { - descriptor.set.call(receiver, value); - } else { - if (!descriptor.writable) { - throw new TypeError("attempted to set read only private field"); - } - - descriptor.value = value; - } - - return value; -} - -function _classStaticPrivateMethodGet(receiver, classConstructor, method) { - if (receiver !== classConstructor) { - throw new TypeError("Private static access of wrong provenance"); - } - - return method; -} - -function _classStaticPrivateMethodSet() { - throw new TypeError("attempted to set read only static private field"); -} - -function _decorate(decorators, factory, superClass, mixins) { - var api = _getDecoratorsApi(); - - if (mixins) { - for (var i = 0; i < mixins.length; i++) { - api = mixins[i](api); - } - } - - var r = factory(function initialize(O) { - api.initializeInstanceElements(O, decorated.elements); - }, superClass); - var decorated = api.decorateClass(_coalesceClassElements(r.d.map(_createElementDescriptor)), decorators); - api.initializeClassElements(r.F, decorated.elements); - return api.runClassFinishers(r.F, decorated.finishers); -} - -function _getDecoratorsApi() { - _getDecoratorsApi = function () { - return api; - }; - - var api = { - elementsDefinitionOrder: [["method"], ["field"]], - initializeInstanceElements: function (O, elements) { - ["method", "field"].forEach(function (kind) { - elements.forEach(function (element) { - if (element.kind === kind && element.placement === "own") { - this.defineClassElement(O, element); - } - }, this); - }, this); - }, - initializeClassElements: function (F, elements) { - var proto = F.prototype; - ["method", "field"].forEach(function (kind) { - elements.forEach(function (element) { - var placement = element.placement; - - if (element.kind === kind && (placement === "static" || placement === "prototype")) { - var receiver = placement === "static" ? F : proto; - this.defineClassElement(receiver, element); - } - }, this); - }, this); - }, - defineClassElement: function (receiver, element) { - var descriptor = element.descriptor; - - if (element.kind === "field") { - var initializer = element.initializer; - descriptor = { - enumerable: descriptor.enumerable, - writable: descriptor.writable, - configurable: descriptor.configurable, - value: initializer === void 0 ? void 0 : initializer.call(receiver) - }; - } - - Object.defineProperty(receiver, element.key, descriptor); - }, - decorateClass: function (elements, decorators) { - var newElements = []; - var finishers = []; - var placements = { - static: [], - prototype: [], - own: [] - }; - elements.forEach(function (element) { - this.addElementPlacement(element, placements); - }, this); - elements.forEach(function (element) { - if (!_hasDecorators(element)) return newElements.push(element); - var elementFinishersExtras = this.decorateElement(element, placements); - newElements.push(elementFinishersExtras.element); - newElements.push.apply(newElements, elementFinishersExtras.extras); - finishers.push.apply(finishers, elementFinishersExtras.finishers); - }, this); - - if (!decorators) { - return { - elements: newElements, - finishers: finishers - }; - } - - var result = this.decorateConstructor(newElements, decorators); - finishers.push.apply(finishers, result.finishers); - result.finishers = finishers; - return result; - }, - addElementPlacement: function (element, placements, silent) { - var keys = placements[element.placement]; - - if (!silent && keys.indexOf(element.key) !== -1) { - throw new TypeError("Duplicated element (" + element.key + ")"); - } - - keys.push(element.key); - }, - decorateElement: function (element, placements) { - var extras = []; - var finishers = []; - - for (var decorators = element.decorators, i = decorators.length - 1; i >= 0; i--) { - var keys = placements[element.placement]; - keys.splice(keys.indexOf(element.key), 1); - var elementObject = this.fromElementDescriptor(element); - var elementFinisherExtras = this.toElementFinisherExtras((0, decorators[i])(elementObject) || elementObject); - element = elementFinisherExtras.element; - this.addElementPlacement(element, placements); - - if (elementFinisherExtras.finisher) { - finishers.push(elementFinisherExtras.finisher); - } - - var newExtras = elementFinisherExtras.extras; - - if (newExtras) { - for (var j = 0; j < newExtras.length; j++) { - this.addElementPlacement(newExtras[j], placements); - } - - extras.push.apply(extras, newExtras); - } - } - - return { - element: element, - finishers: finishers, - extras: extras - }; - }, - decorateConstructor: function (elements, decorators) { - var finishers = []; - - for (var i = decorators.length - 1; i >= 0; i--) { - var obj = this.fromClassDescriptor(elements); - var elementsAndFinisher = this.toClassDescriptor((0, decorators[i])(obj) || obj); - - if (elementsAndFinisher.finisher !== undefined) { - finishers.push(elementsAndFinisher.finisher); - } - - if (elementsAndFinisher.elements !== undefined) { - elements = elementsAndFinisher.elements; - - for (var j = 0; j < elements.length - 1; j++) { - for (var k = j + 1; k < elements.length; k++) { - if (elements[j].key === elements[k].key && elements[j].placement === elements[k].placement) { - throw new TypeError("Duplicated element (" + elements[j].key + ")"); - } - } - } - } - } - - return { - elements: elements, - finishers: finishers - }; - }, - fromElementDescriptor: function (element) { - var obj = { - kind: element.kind, - key: element.key, - placement: element.placement, - descriptor: element.descriptor - }; - var desc = { - value: "Descriptor", - configurable: true - }; - Object.defineProperty(obj, Symbol.toStringTag, desc); - if (element.kind === "field") obj.initializer = element.initializer; - return obj; - }, - toElementDescriptors: function (elementObjects) { - if (elementObjects === undefined) return; - return _toArray(elementObjects).map(function (elementObject) { - var element = this.toElementDescriptor(elementObject); - this.disallowProperty(elementObject, "finisher", "An element descriptor"); - this.disallowProperty(elementObject, "extras", "An element descriptor"); - return element; - }, this); - }, - toElementDescriptor: function (elementObject) { - var kind = String(elementObject.kind); - - if (kind !== "method" && kind !== "field") { - throw new TypeError('An element descriptor\'s .kind property must be either "method" or' + ' "field", but a decorator created an element descriptor with' + ' .kind "' + kind + '"'); - } - - var key = _toPropertyKey(elementObject.key); - - var placement = String(elementObject.placement); - - if (placement !== "static" && placement !== "prototype" && placement !== "own") { - throw new TypeError('An element descriptor\'s .placement property must be one of "static",' + ' "prototype" or "own", but a decorator created an element descriptor' + ' with .placement "' + placement + '"'); - } - - var descriptor = elementObject.descriptor; - this.disallowProperty(elementObject, "elements", "An element descriptor"); - var element = { - kind: kind, - key: key, - placement: placement, - descriptor: Object.assign({}, descriptor) - }; - - if (kind !== "field") { - this.disallowProperty(elementObject, "initializer", "A method descriptor"); - } else { - this.disallowProperty(descriptor, "get", "The property descriptor of a field descriptor"); - this.disallowProperty(descriptor, "set", "The property descriptor of a field descriptor"); - this.disallowProperty(descriptor, "value", "The property descriptor of a field descriptor"); - element.initializer = elementObject.initializer; - } - - return element; - }, - toElementFinisherExtras: function (elementObject) { - var element = this.toElementDescriptor(elementObject); - - var finisher = _optionalCallableProperty(elementObject, "finisher"); - - var extras = this.toElementDescriptors(elementObject.extras); - return { - element: element, - finisher: finisher, - extras: extras - }; - }, - fromClassDescriptor: function (elements) { - var obj = { - kind: "class", - elements: elements.map(this.fromElementDescriptor, this) - }; - var desc = { - value: "Descriptor", - configurable: true - }; - Object.defineProperty(obj, Symbol.toStringTag, desc); - return obj; - }, - toClassDescriptor: function (obj) { - var kind = String(obj.kind); - - if (kind !== "class") { - throw new TypeError('A class descriptor\'s .kind property must be "class", but a decorator' + ' created a class descriptor with .kind "' + kind + '"'); - } - - this.disallowProperty(obj, "key", "A class descriptor"); - this.disallowProperty(obj, "placement", "A class descriptor"); - this.disallowProperty(obj, "descriptor", "A class descriptor"); - this.disallowProperty(obj, "initializer", "A class descriptor"); - this.disallowProperty(obj, "extras", "A class descriptor"); - - var finisher = _optionalCallableProperty(obj, "finisher"); - - var elements = this.toElementDescriptors(obj.elements); - return { - elements: elements, - finisher: finisher - }; - }, - runClassFinishers: function (constructor, finishers) { - for (var i = 0; i < finishers.length; i++) { - var newConstructor = (0, finishers[i])(constructor); - - if (newConstructor !== undefined) { - if (typeof newConstructor !== "function") { - throw new TypeError("Finishers must return a constructor."); - } - - constructor = newConstructor; - } - } - - return constructor; - }, - disallowProperty: function (obj, name, objectType) { - if (obj[name] !== undefined) { - throw new TypeError(objectType + " can't have a ." + name + " property."); - } - } - }; - return api; -} - -function _createElementDescriptor(def) { - var key = _toPropertyKey(def.key); - - var descriptor; - - if (def.kind === "method") { - descriptor = { - value: def.value, - writable: true, - configurable: true, - enumerable: false - }; - } else if (def.kind === "get") { - descriptor = { - get: def.value, - configurable: true, - enumerable: false - }; - } else if (def.kind === "set") { - descriptor = { - set: def.value, - configurable: true, - enumerable: false - }; - } else if (def.kind === "field") { - descriptor = { - configurable: true, - writable: true, - enumerable: true - }; - } - - var element = { - kind: def.kind === "field" ? "field" : "method", - key: key, - placement: def.static ? "static" : def.kind === "field" ? "own" : "prototype", - descriptor: descriptor - }; - if (def.decorators) element.decorators = def.decorators; - if (def.kind === "field") element.initializer = def.value; - return element; -} - -function _coalesceGetterSetter(element, other) { - if (element.descriptor.get !== undefined) { - other.descriptor.get = element.descriptor.get; - } else { - other.descriptor.set = element.descriptor.set; - } -} - -function _coalesceClassElements(elements) { - var newElements = []; - - var isSameElement = function (other) { - return other.kind === "method" && other.key === element.key && other.placement === element.placement; - }; - - for (var i = 0; i < elements.length; i++) { - var element = elements[i]; - var other; - - if (element.kind === "method" && (other = newElements.find(isSameElement))) { - if (_isDataDescriptor(element.descriptor) || _isDataDescriptor(other.descriptor)) { - if (_hasDecorators(element) || _hasDecorators(other)) { - throw new ReferenceError("Duplicated methods (" + element.key + ") can't be decorated."); - } - - other.descriptor = element.descriptor; - } else { - if (_hasDecorators(element)) { - if (_hasDecorators(other)) { - throw new ReferenceError("Decorators can't be placed on different accessors with for " + "the same property (" + element.key + ")."); - } - - other.decorators = element.decorators; - } - - _coalesceGetterSetter(element, other); - } - } else { - newElements.push(element); - } - } - - return newElements; -} - -function _hasDecorators(element) { - return element.decorators && element.decorators.length; -} - -function _isDataDescriptor(desc) { - return desc !== undefined && !(desc.value === undefined && desc.writable === undefined); -} - -function _optionalCallableProperty(obj, name) { - var value = obj[name]; - - if (value !== undefined && typeof value !== "function") { - throw new TypeError("Expected '" + name + "' to be a function"); - } - - return value; -} - -function _classPrivateMethodGet(receiver, privateSet, fn) { - if (!privateSet.has(receiver)) { - throw new TypeError("attempted to get private field on non-instance"); - } - - return fn; -} - -function _classPrivateMethodSet() { - throw new TypeError("attempted to reassign private method"); -} - -function _wrapRegExp(re, groups) { - _wrapRegExp = function (re, groups) { - return new BabelRegExp(re, undefined, groups); - }; - - var _RegExp = _wrapNativeSuper(RegExp); - - var _super = RegExp.prototype; - - var _groups = new WeakMap(); - - function BabelRegExp(re, flags, groups) { - var _this = _RegExp.call(this, re, flags); - - _groups.set(_this, groups || _groups.get(re)); - - return _this; - } - - _inherits(BabelRegExp, _RegExp); - - BabelRegExp.prototype.exec = function (str) { - var result = _super.exec.call(this, str); - - if (result) result.groups = buildGroups(result, this); - return result; - }; - - BabelRegExp.prototype[Symbol.replace] = function (str, substitution) { - if (typeof substitution === "string") { - var groups = _groups.get(this); - - return _super[Symbol.replace].call(this, str, substitution.replace(/\$<([^>]+)>/g, function (_, name) { - return "$" + groups[name]; - })); - } else if (typeof substitution === "function") { - var _this = this; - - return _super[Symbol.replace].call(this, str, function () { - var args = []; - args.push.apply(args, arguments); - - if (typeof args[args.length - 1] !== "object") { - args.push(buildGroups(args, _this)); - } - - return substitution.apply(this, args); - }); - } else { - return _super[Symbol.replace].call(this, str, substitution); - } - }; - - function buildGroups(result, re) { - var g = _groups.get(re); - - return Object.keys(g).reduce(function (groups, name) { - groups[name] = result[g[name]]; - return groups; - }, Object.create(null)); - } - - return _wrapRegExp.apply(this, arguments); -} - +function _AwaitValue(e){this.wrapped=e}function _AsyncGenerator(e){var t,n;function resume(t,n){try{var r=e[t](n),o=r.value,a=o instanceof _AwaitValue;Promise.resolve(a?o.wrapped:o).then((function(e){a?resume("return"===t?"return":"next",e):settle(r.done?"return":"normal",e)}),(function(e){resume("throw",e)}))}catch(e){settle("throw",e)}}function settle(e,r){switch(e){case"return":t.resolve({value:r,done:!0});break;case"throw":t.reject(r);break;default:t.resolve({value:r,done:!1})}(t=t.next)?resume(t.key,t.arg):n=null}this._invoke=function send(e,r){return new Promise((function(o,a){var i={key:e,arg:r,resolve:o,reject:a,next:null};n?n=n.next=i:(t=n=i,resume(e,r))}))},"function"!=typeof e.return&&(this.return=void 0)}function asyncGeneratorStep(e,t,n,r,o,a,i){try{var s=e[a](i),c=s.value}catch(e){return void n(e)}s.done?t(c):Promise.resolve(c).then(r,o)}"function"==typeof Symbol&&Symbol.asyncIterator&&(_AsyncGenerator.prototype[Symbol.asyncIterator]=function(){return this}),_AsyncGenerator.prototype.next=function(e){return this._invoke("next",e)},_AsyncGenerator.prototype.throw=function(e){return this._invoke("throw",e)},_AsyncGenerator.prototype.return=function(e){return this._invoke("return",e)}; /** * @file ext-grid.js * @@ -1654,177 +7,5 @@ function _wrapRegExp(re, groups) { * @copyright 2010 Redou Mine, 2010 Alexis Deveria * */ -var extGrid = { - name: 'grid', - init: function init(_ref) { - var _this = this; - - return _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee() { - 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 _gridUpdate() { - if (showGrid) { - updateGrid(svgCanvas.getZoom()); - } - - $('#canvasGrid').toggle(showGrid); - $('#view_grid').toggleClass('push_button_pressed tool_button'); - }; - - updateGrid = function _updateGrid(zoom) { - // TODO: Try this with elements, then compare performance difference - var unit = units[svgEditor.curConfig.baseUnit]; // 1 = 1px - - var uMulti = unit * zoom; // Calculate the main number interval - - var rawM = 100 / uMulti; - var multi = 1; - intervals.some(function (num) { - multi = num; - return rawM <= num; - }); - var bigInt = multi * uMulti; // Set the canvas size to the width of the container - - hcanvas.width = bigInt; - hcanvas.height = bigInt; - var ctx = hcanvas.getContext('2d'); - var curD = 0.5; - var part = bigInt / 10; - ctx.globalAlpha = 0.2; - ctx.strokeStyle = svgEditor.curConfig.gridColor; - - for (var i = 1; i < 10; i++) { - var subD = Math.round(part * i) + 0.5; // const lineNum = (i % 2)?12:10; - - var lineNum = 0; - ctx.moveTo(subD, bigInt); - ctx.lineTo(subD, lineNum); - ctx.moveTo(bigInt, subD); - ctx.lineTo(lineNum, subD); - } - - ctx.stroke(); - ctx.beginPath(); - ctx.globalAlpha = 0.5; - ctx.moveTo(curD, bigInt); - ctx.lineTo(curD, 0); - ctx.moveTo(bigInt, curD); - ctx.lineTo(0, curD); - ctx.stroke(); - var datauri = hcanvas.toDataURL('image/png'); - gridimg.setAttribute('width', bigInt); - gridimg.setAttribute('height', bigInt); - gridimg.parentNode.setAttribute('width', bigInt); - gridimg.parentNode.setAttribute('height', bigInt); - svgCanvas.setHref(gridimg, datauri); - }; - - $ = _ref.$, NS = _ref.NS, getTypeMap = _ref.getTypeMap, importLocale = _ref.importLocale; - _context.next = 5; - return importLocale(); - - case 5: - strings = _context.sent; - svgEditor = _this; - svgCanvas = svgEditor.canvas; - svgdoc = document.getElementById('svgcanvas').ownerDocument, assignAttributes = svgCanvas.assignAttributes, hcanvas = document.createElement('canvas'), canvBG = $('#canvasBackground'), units = getTypeMap(), intervals = [0.01, 0.1, 1, 10, 100, 1000]; - showGrid = svgEditor.curConfig.showGrid || false; - $(hcanvas).hide().appendTo('body'); - canvasGrid = svgdoc.createElementNS(NS.SVG, 'svg'); - assignAttributes(canvasGrid, { - id: 'canvasGrid', - width: '100%', - height: '100%', - x: 0, - y: 0, - overflow: 'visible', - display: 'none' - }); - canvBG.append(canvasGrid); - gridDefs = svgdoc.createElementNS(NS.SVG, 'defs'); // grid-pattern - - gridPattern = svgdoc.createElementNS(NS.SVG, 'pattern'); - assignAttributes(gridPattern, { - id: 'gridpattern', - patternUnits: 'userSpaceOnUse', - x: 0, - // -(value.strokeWidth / 2), // position for strokewidth - y: 0, - // -(value.strokeWidth / 2), // position for strokewidth - width: 100, - height: 100 - }); - gridimg = svgdoc.createElementNS(NS.SVG, 'image'); - assignAttributes(gridimg, { - x: 0, - y: 0, - width: 100, - height: 100 - }); - gridPattern.append(gridimg); - gridDefs.append(gridPattern); - $('#canvasGrid').append(gridDefs); // grid-box - - gridBox = svgdoc.createElementNS(NS.SVG, 'rect'); - assignAttributes(gridBox, { - width: '100%', - height: '100%', - x: 0, - y: 0, - 'stroke-width': 0, - stroke: 'none', - fill: 'url(#gridpattern)', - style: 'pointer-events: none; display:visible;' - }); - $('#canvasGrid').append(gridBox); - /** - * - * @param {Float} zoom - * @returns {void} - */ - - buttons = [{ - id: 'view_grid', - icon: 'grid.png', - type: 'context', - panel: 'editor_panel', - events: { - click: function click() { - svgEditor.curConfig.showGrid = showGrid = !showGrid; - gridUpdate(); - } - } - }]; - return _context.abrupt("return", { - name: strings.name, - svgicons: 'grid-icon.xml', - zoomChanged: function zoomChanged(zoom) { - if (showGrid) { - updateGrid(zoom); - } - }, - callback: function callback() { - if (showGrid) { - gridUpdate(); - } - }, - buttons: strings.buttons.map(function (button, i) { - return Object.assign(buttons[i], button); - }) - }); - - case 27: - case "end": - return _context.stop(); - } - } - }, _callee); - }))(); - } -}; - -export default extGrid; +var e={name:"grid",init:function init(e){var t=this;return function _asyncToGenerator(e){return function(){var t=this,n=arguments;return new Promise((function(r,o){var a=e.apply(t,n);function _next(e){asyncGeneratorStep(a,r,o,_next,_throw,"next",e)}function _throw(e){asyncGeneratorStep(a,r,o,_next,_throw,"throw",e)}_next(void 0)}))}}(regeneratorRuntime.mark((function _callee(){var n,r,o,a,i,s,c,u,l,d,p,h,v,g,f,m,y,w,_,b,x,G;return regeneratorRuntime.wrap((function _callee$(k){for(;;)switch(k.prev=k.next){case 0:return x=function _gridUpdate(){g&&b(c.getZoom()),n("#canvasGrid").toggle(g),n("#view_grid").toggleClass("push_button_pressed tool_button")},b=function _updateGrid(e){var t=h[s.curConfig.baseUnit]*e,n=100/t,r=1;v.some((function(e){return r=e,n<=e}));var o=r*t;d.width=o,d.height=o;var a=d.getContext("2d"),i=.5,u=o/10;a.globalAlpha=.2,a.strokeStyle=s.curConfig.gridColor;for(var l=1;l<10;l++){var p=Math.round(u*l)+.5;a.moveTo(p,o),a.lineTo(p,0),a.moveTo(o,p),a.lineTo(0,p)}a.stroke(),a.beginPath(),a.globalAlpha=.5,a.moveTo(i,o),a.lineTo(i,0),a.moveTo(o,i),a.lineTo(0,i),a.stroke();var g=d.toDataURL("image/png");w.setAttribute("width",o),w.setAttribute("height",o),w.parentNode.setAttribute("width",o),w.parentNode.setAttribute("height",o),c.setHref(w,g)},n=e.$,r=e.NS,o=e.getTypeMap,a=e.importLocale,k.next=5,a();case 5:return i=k.sent,c=(s=t).canvas,u=document.getElementById("svgcanvas").ownerDocument,l=c.assignAttributes,d=document.createElement("canvas"),p=n("#canvasBackground"),h=o(),v=[.01,.1,1,10,100,1e3],g=s.curConfig.showGrid||!1,n(d).hide().appendTo("body"),f=u.createElementNS(r.SVG,"svg"),l(f,{id:"canvasGrid",width:"100%",height:"100%",x:0,y:0,overflow:"visible",display:"none"}),p.append(f),m=u.createElementNS(r.SVG,"defs"),y=u.createElementNS(r.SVG,"pattern"),l(y,{id:"gridpattern",patternUnits:"userSpaceOnUse",x:0,y:0,width:100,height:100}),w=u.createElementNS(r.SVG,"image"),l(w,{x:0,y:0,width:100,height:100}),y.append(w),m.append(y),n("#canvasGrid").append(m),_=u.createElementNS(r.SVG,"rect"),l(_,{width:"100%",height:"100%",x:0,y:0,"stroke-width":0,stroke:"none",fill:"url(#gridpattern)",style:"pointer-events: none; display:visible;"}),n("#canvasGrid").append(_),G=[{id:"view_grid",icon:"grid.png",type:"context",panel:"editor_panel",events:{click:function click(){s.curConfig.showGrid=g=!g,x()}}}],k.abrupt("return",{name:i.name,svgicons:"grid-icon.xml",zoomChanged:function zoomChanged(e){g&&b(e)},callback:function callback(){g&&x()},buttons:i.buttons.map((function(e,t){return Object.assign(G[t],e)}))});case 27:case"end":return k.stop()}}),_callee)})))()}};export default e; //# sourceMappingURL=ext-grid.js.map diff --git a/dist/editor/extensions/ext-grid.js.map b/dist/editor/extensions/ext-grid.js.map index 1ce58444..7360daf7 100644 --- a/dist/editor/extensions/ext-grid.js.map +++ b/dist/editor/extensions/ext-grid.js.map @@ -1 +1 @@ -{"version":3,"file":"ext-grid.js","sources":["../../../src/editor/extensions/ext-grid.js"],"sourcesContent":["/**\n * @file ext-grid.js\n *\n * @license Apache-2.0\n *\n * @copyright 2010 Redou Mine, 2010 Alexis Deveria\n *\n */\n\nexport default {\n name: 'grid',\n async init ({$, NS, getTypeMap, importLocale}) {\n const strings = await importLocale();\n const svgEditor = this;\n const svgCanvas = svgEditor.canvas;\n const svgdoc = document.getElementById('svgcanvas').ownerDocument,\n {assignAttributes} = svgCanvas,\n hcanvas = document.createElement('canvas'),\n canvBG = $('#canvasBackground'),\n units = getTypeMap(), // Assumes prior `init()` call on `units.js` module\n intervals = [0.01, 0.1, 1, 10, 100, 1000];\n let showGrid = svgEditor.curConfig.showGrid || false;\n\n $(hcanvas).hide().appendTo('body');\n\n const canvasGrid = svgdoc.createElementNS(NS.SVG, 'svg');\n assignAttributes(canvasGrid, {\n id: 'canvasGrid',\n width: '100%',\n height: '100%',\n x: 0,\n y: 0,\n overflow: 'visible',\n display: 'none'\n });\n canvBG.append(canvasGrid);\n const gridDefs = svgdoc.createElementNS(NS.SVG, 'defs');\n // grid-pattern\n const gridPattern = svgdoc.createElementNS(NS.SVG, 'pattern');\n assignAttributes(gridPattern, {\n id: 'gridpattern',\n patternUnits: 'userSpaceOnUse',\n x: 0, // -(value.strokeWidth / 2), // position for strokewidth\n y: 0, // -(value.strokeWidth / 2), // position for strokewidth\n width: 100,\n height: 100\n });\n\n const gridimg = svgdoc.createElementNS(NS.SVG, 'image');\n assignAttributes(gridimg, {\n x: 0,\n y: 0,\n width: 100,\n height: 100\n });\n gridPattern.append(gridimg);\n gridDefs.append(gridPattern);\n $('#canvasGrid').append(gridDefs);\n\n // grid-box\n const gridBox = svgdoc.createElementNS(NS.SVG, 'rect');\n assignAttributes(gridBox, {\n width: '100%',\n height: '100%',\n x: 0,\n y: 0,\n 'stroke-width': 0,\n stroke: 'none',\n fill: 'url(#gridpattern)',\n style: 'pointer-events: none; display:visible;'\n });\n $('#canvasGrid').append(gridBox);\n\n /**\n *\n * @param {Float} zoom\n * @returns {void}\n */\n function updateGrid (zoom) {\n // TODO: Try this with elements, then compare performance difference\n const unit = units[svgEditor.curConfig.baseUnit]; // 1 = 1px\n const uMulti = unit * zoom;\n // Calculate the main number interval\n const rawM = 100 / uMulti;\n let multi = 1;\n intervals.some((num) => {\n multi = num;\n return rawM <= num;\n });\n const bigInt = multi * uMulti;\n\n // Set the canvas size to the width of the container\n hcanvas.width = bigInt;\n hcanvas.height = bigInt;\n const ctx = hcanvas.getContext('2d');\n const curD = 0.5;\n const part = bigInt / 10;\n\n ctx.globalAlpha = 0.2;\n ctx.strokeStyle = svgEditor.curConfig.gridColor;\n for (let i = 1; i < 10; i++) {\n const subD = Math.round(part * i) + 0.5;\n // const lineNum = (i % 2)?12:10;\n const lineNum = 0;\n ctx.moveTo(subD, bigInt);\n ctx.lineTo(subD, lineNum);\n ctx.moveTo(bigInt, subD);\n ctx.lineTo(lineNum, subD);\n }\n ctx.stroke();\n ctx.beginPath();\n ctx.globalAlpha = 0.5;\n ctx.moveTo(curD, bigInt);\n ctx.lineTo(curD, 0);\n\n ctx.moveTo(bigInt, curD);\n ctx.lineTo(0, curD);\n ctx.stroke();\n\n const datauri = hcanvas.toDataURL('image/png');\n gridimg.setAttribute('width', bigInt);\n gridimg.setAttribute('height', bigInt);\n gridimg.parentNode.setAttribute('width', bigInt);\n gridimg.parentNode.setAttribute('height', bigInt);\n svgCanvas.setHref(gridimg, datauri);\n }\n\n /**\n *\n * @returns {void}\n */\n function gridUpdate () {\n if (showGrid) {\n updateGrid(svgCanvas.getZoom());\n }\n $('#canvasGrid').toggle(showGrid);\n $('#view_grid').toggleClass('push_button_pressed tool_button');\n }\n const buttons = [{\n id: 'view_grid',\n icon: 'grid.png',\n type: 'context',\n panel: 'editor_panel',\n events: {\n click () {\n svgEditor.curConfig.showGrid = showGrid = !showGrid;\n gridUpdate();\n }\n }\n }];\n return {\n name: strings.name,\n svgicons: 'grid-icon.xml',\n\n zoomChanged (zoom) {\n if (showGrid) { updateGrid(zoom); }\n },\n callback () {\n if (showGrid) {\n gridUpdate();\n }\n },\n buttons: strings.buttons.map((button, i) => {\n return Object.assign(buttons[i], button);\n })\n };\n }\n};\n"],"names":["name","init","updateGrid","gridUpdate","showGrid","svgCanvas","getZoom","$","toggle","toggleClass","zoom","unit","units","svgEditor","curConfig","baseUnit","uMulti","rawM","multi","intervals","some","num","bigInt","hcanvas","width","height","ctx","getContext","curD","part","globalAlpha","strokeStyle","gridColor","i","subD","Math","round","lineNum","moveTo","lineTo","stroke","beginPath","datauri","toDataURL","gridimg","setAttribute","parentNode","setHref","NS","getTypeMap","importLocale","strings","canvas","svgdoc","document","getElementById","ownerDocument","assignAttributes","createElement","canvBG","hide","appendTo","canvasGrid","createElementNS","SVG","id","x","y","overflow","display","append","gridDefs","gridPattern","patternUnits","gridBox","fill","style","buttons","icon","type","panel","events","click","svgicons","zoomChanged","callback","map","button","Object","assign"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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,gBAAAA,IAAI,EAAE,SAHS;AAIfC,gBAAAA,KAAK,EAAE,cAJQ;AAKfC,gBAAAA,MAAM,EAAE;AACNC,kBAAAA,KADM,mBACG;AACPrE,oBAAAA,SAAS,CAACC,SAAV,CAAoBV,QAApB,GAA+BA,QAAQ,GAAG,CAACA,QAA3C;AACAD,oBAAAA,UAAU;AACX;AAJK;AALO,eAAD,CA/H6B;AAAA,+CA2ItC;AACLH,gBAAAA,IAAI,EAAEmD,OAAO,CAACnD,IADT;AAELmF,gBAAAA,QAAQ,EAAE,eAFL;AAILC,gBAAAA,WAJK,uBAIQ1E,IAJR,EAIc;AACjB,sBAAIN,QAAJ,EAAc;AAAEF,oBAAAA,UAAU,CAACQ,IAAD,CAAV;AAAmB;AACpC,iBANI;AAOL2E,gBAAAA,QAPK,sBAOO;AACV,sBAAIjF,QAAJ,EAAc;AACZD,oBAAAA,UAAU;AACX;AACF,iBAXI;AAYL0E,gBAAAA,OAAO,EAAE1B,OAAO,CAAC0B,OAAR,CAAgBS,GAAhB,CAAoB,UAACC,MAAD,EAAStD,CAAT,EAAe;AAC1C,yBAAOuD,MAAM,CAACC,MAAP,CAAcZ,OAAO,CAAC5C,CAAD,CAArB,EAA0BsD,MAA1B,CAAP;AACD,iBAFQ;AAZJ,eA3IsC;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AA2J9C;AA7JY,CAAf;;;;"} \ No newline at end of file +{"version":3,"file":"ext-grid.js","sources":["../../../src/editor/extensions/ext-grid.js"],"sourcesContent":["/**\n * @file ext-grid.js\n *\n * @license Apache-2.0\n *\n * @copyright 2010 Redou Mine, 2010 Alexis Deveria\n *\n */\n\nexport default {\n name: 'grid',\n async init ({$, NS, getTypeMap, importLocale}) {\n const strings = await importLocale();\n const svgEditor = this;\n const svgCanvas = svgEditor.canvas;\n const svgdoc = document.getElementById('svgcanvas').ownerDocument,\n {assignAttributes} = svgCanvas,\n hcanvas = document.createElement('canvas'),\n canvBG = $('#canvasBackground'),\n units = getTypeMap(), // Assumes prior `init()` call on `units.js` module\n intervals = [0.01, 0.1, 1, 10, 100, 1000];\n let showGrid = svgEditor.curConfig.showGrid || false;\n\n $(hcanvas).hide().appendTo('body');\n\n const canvasGrid = svgdoc.createElementNS(NS.SVG, 'svg');\n assignAttributes(canvasGrid, {\n id: 'canvasGrid',\n width: '100%',\n height: '100%',\n x: 0,\n y: 0,\n overflow: 'visible',\n display: 'none'\n });\n canvBG.append(canvasGrid);\n const gridDefs = svgdoc.createElementNS(NS.SVG, 'defs');\n // grid-pattern\n const gridPattern = svgdoc.createElementNS(NS.SVG, 'pattern');\n assignAttributes(gridPattern, {\n id: 'gridpattern',\n patternUnits: 'userSpaceOnUse',\n x: 0, // -(value.strokeWidth / 2), // position for strokewidth\n y: 0, // -(value.strokeWidth / 2), // position for strokewidth\n width: 100,\n height: 100\n });\n\n const gridimg = svgdoc.createElementNS(NS.SVG, 'image');\n assignAttributes(gridimg, {\n x: 0,\n y: 0,\n width: 100,\n height: 100\n });\n gridPattern.append(gridimg);\n gridDefs.append(gridPattern);\n $('#canvasGrid').append(gridDefs);\n\n // grid-box\n const gridBox = svgdoc.createElementNS(NS.SVG, 'rect');\n assignAttributes(gridBox, {\n width: '100%',\n height: '100%',\n x: 0,\n y: 0,\n 'stroke-width': 0,\n stroke: 'none',\n fill: 'url(#gridpattern)',\n style: 'pointer-events: none; display:visible;'\n });\n $('#canvasGrid').append(gridBox);\n\n /**\n *\n * @param {Float} zoom\n * @returns {void}\n */\n function updateGrid (zoom) {\n // TODO: Try this with elements, then compare performance difference\n const unit = units[svgEditor.curConfig.baseUnit]; // 1 = 1px\n const uMulti = unit * zoom;\n // Calculate the main number interval\n const rawM = 100 / uMulti;\n let multi = 1;\n intervals.some((num) => {\n multi = num;\n return rawM <= num;\n });\n const bigInt = multi * uMulti;\n\n // Set the canvas size to the width of the container\n hcanvas.width = bigInt;\n hcanvas.height = bigInt;\n const ctx = hcanvas.getContext('2d');\n const curD = 0.5;\n const part = bigInt / 10;\n\n ctx.globalAlpha = 0.2;\n ctx.strokeStyle = svgEditor.curConfig.gridColor;\n for (let i = 1; i < 10; i++) {\n const subD = Math.round(part * i) + 0.5;\n // const lineNum = (i % 2)?12:10;\n const lineNum = 0;\n ctx.moveTo(subD, bigInt);\n ctx.lineTo(subD, lineNum);\n ctx.moveTo(bigInt, subD);\n ctx.lineTo(lineNum, subD);\n }\n ctx.stroke();\n ctx.beginPath();\n ctx.globalAlpha = 0.5;\n ctx.moveTo(curD, bigInt);\n ctx.lineTo(curD, 0);\n\n ctx.moveTo(bigInt, curD);\n ctx.lineTo(0, curD);\n ctx.stroke();\n\n const datauri = hcanvas.toDataURL('image/png');\n gridimg.setAttribute('width', bigInt);\n gridimg.setAttribute('height', bigInt);\n gridimg.parentNode.setAttribute('width', bigInt);\n gridimg.parentNode.setAttribute('height', bigInt);\n svgCanvas.setHref(gridimg, datauri);\n }\n\n /**\n *\n * @returns {void}\n */\n function gridUpdate () {\n if (showGrid) {\n updateGrid(svgCanvas.getZoom());\n }\n $('#canvasGrid').toggle(showGrid);\n $('#view_grid').toggleClass('push_button_pressed tool_button');\n }\n const buttons = [{\n id: 'view_grid',\n icon: 'grid.png',\n type: 'context',\n panel: 'editor_panel',\n events: {\n click () {\n svgEditor.curConfig.showGrid = showGrid = !showGrid;\n gridUpdate();\n }\n }\n }];\n return {\n name: strings.name,\n svgicons: 'grid-icon.xml',\n\n zoomChanged (zoom) {\n if (showGrid) { updateGrid(zoom); }\n },\n callback () {\n if (showGrid) {\n gridUpdate();\n }\n },\n buttons: strings.buttons.map((button, i) => {\n return Object.assign(buttons[i], button);\n })\n };\n }\n};\n"],"names":["name","init","updateGrid","gridUpdate","showGrid","svgCanvas","getZoom","$","toggle","toggleClass","zoom","uMulti","units","svgEditor","curConfig","baseUnit","rawM","multi","intervals","some","num","bigInt","hcanvas","width","height","ctx","getContext","curD","part","globalAlpha","strokeStyle","gridColor","i","subD","Math","round","moveTo","lineTo","stroke","beginPath","datauri","toDataURL","gridimg","setAttribute","parentNode","setHref","NS","getTypeMap","importLocale","strings","_this","canvas","svgdoc","document","getElementById","ownerDocument","assignAttributes","createElement","canvBG","hide","appendTo","canvasGrid","createElementNS","SVG","id","x","y","overflow","display","append","gridDefs","gridPattern","patternUnits","gridBox","fill","style","buttons","icon","type","panel","events","click","svgicons","zoomChanged","callback","map","button","Object","assign"],"mappings":";;;;;;;;;AASA,MAAe,CACbA,KAAM,OACAC,mZAmEKC,EAqDAC,oGAAAA,yBACHC,GACFF,EAAWG,EAAUC,WAEvBC,EAAE,eAAeC,OAAOJ,GACxBG,EAAE,cAAcE,YAAY,oCA1DrBP,uBAAYQ,OAGbC,EADOC,EAAMC,EAAUC,UAAUC,UACjBL,EAEhBM,EAAO,IAAML,EACfM,EAAQ,EACZC,EAAUC,MAAK,SAACC,UACdH,EAAQG,EACDJ,GAAQI,SAEXC,EAASJ,EAAQN,EAGvBW,EAAQC,MAAQF,EAChBC,EAAQE,OAASH,MACXI,EAAMH,EAAQI,WAAW,MACzBC,EAAO,GACPC,EAAOP,EAAS,GAEtBI,EAAII,YAAc,GAClBJ,EAAIK,YAAcjB,EAAUC,UAAUiB,cACjC,IAAIC,EAAI,EAAGA,EAAI,GAAIA,IAAK,KACrBC,EAAOC,KAAKC,MAAMP,EAAOI,GAAK,GAGpCP,EAAIW,OAAOH,EAAMZ,GACjBI,EAAIY,OAAOJ,EAFK,GAGhBR,EAAIW,OAAOf,EAAQY,GACnBR,EAAIY,OAJY,EAIIJ,GAEtBR,EAAIa,SACJb,EAAIc,YACJd,EAAII,YAAc,GAClBJ,EAAIW,OAAOT,EAAMN,GACjBI,EAAIY,OAAOV,EAAM,GAEjBF,EAAIW,OAAOf,EAAQM,GACnBF,EAAIY,OAAO,EAAGV,GACdF,EAAIa,aAEEE,EAAUlB,EAAQmB,UAAU,aAClCC,EAAQC,aAAa,QAAStB,GAC9BqB,EAAQC,aAAa,SAAUtB,GAC/BqB,EAAQE,WAAWD,aAAa,Q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ACfZ,GAAI,YACJa,KAAM,WACNC,KAAM,UACNC,MAAO,eACPC,OAAQ,CACNC,uBACEpE,EAAUC,UAAUV,SAAWA,GAAYA,EAC3CD,0BAIC,CACLH,KAAMiD,EAAQjD,KACdkF,SAAU,gBAEVC,iCAAazE,GACPN,GAAYF,EAAWQ,IAE7B0E,6BACMhF,GACFD,KAGJyE,QAAS3B,EAAQ2B,QAAQS,KAAI,SAACC,EAAQtD,UAC7BuD,OAAOC,OAAOZ,EAAQ5C,GAAIsD"} \ No newline at end of file diff --git a/dist/editor/extensions/ext-helloworld.js b/dist/editor/extensions/ext-helloworld.js index a2159952..72819254 100644 --- a/dist/editor/extensions/ext-helloworld.js +++ b/dist/editor/extensions/ext-helloworld.js @@ -1,1651 +1,4 @@ -function _typeof(obj) { - "@babel/helpers - typeof"; - - if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { - _typeof = function (obj) { - return typeof obj; - }; - } else { - _typeof = function (obj) { - return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; - }; - } - - return _typeof(obj); -} - -var REACT_ELEMENT_TYPE; - -function _jsx(type, props, key, children) { - if (!REACT_ELEMENT_TYPE) { - REACT_ELEMENT_TYPE = typeof Symbol === "function" && Symbol["for"] && Symbol["for"]("react.element") || 0xeac7; - } - - var defaultProps = type && type.defaultProps; - var childrenLength = arguments.length - 3; - - if (!props && childrenLength !== 0) { - props = { - children: void 0 - }; - } - - if (childrenLength === 1) { - props.children = children; - } else if (childrenLength > 1) { - var childArray = new Array(childrenLength); - - for (var i = 0; i < childrenLength; i++) { - childArray[i] = arguments[i + 3]; - } - - props.children = childArray; - } - - if (props && defaultProps) { - for (var propName in defaultProps) { - if (props[propName] === void 0) { - props[propName] = defaultProps[propName]; - } - } - } else if (!props) { - props = defaultProps || {}; - } - - return { - $$typeof: REACT_ELEMENT_TYPE, - type: type, - key: key === undefined ? null : '' + key, - ref: null, - props: props, - _owner: null - }; -} - -function _asyncIterator(iterable) { - var method; - - if (typeof Symbol !== "undefined") { - if (Symbol.asyncIterator) { - method = iterable[Symbol.asyncIterator]; - if (method != null) return method.call(iterable); - } - - if (Symbol.iterator) { - method = iterable[Symbol.iterator]; - if (method != null) return method.call(iterable); - } - } - - throw new TypeError("Object is not async iterable"); -} - -function _AwaitValue(value) { - this.wrapped = value; -} - -function _AsyncGenerator(gen) { - var front, back; - - function send(key, arg) { - return new Promise(function (resolve, reject) { - var request = { - key: key, - arg: arg, - resolve: resolve, - reject: reject, - next: null - }; - - if (back) { - back = back.next = request; - } else { - front = back = request; - resume(key, arg); - } - }); - } - - function resume(key, arg) { - try { - var result = gen[key](arg); - var value = result.value; - var wrappedAwait = value instanceof _AwaitValue; - Promise.resolve(wrappedAwait ? value.wrapped : value).then(function (arg) { - if (wrappedAwait) { - resume(key === "return" ? "return" : "next", arg); - return; - } - - settle(result.done ? "return" : "normal", arg); - }, function (err) { - resume("throw", err); - }); - } catch (err) { - settle("throw", err); - } - } - - function settle(type, value) { - switch (type) { - case "return": - front.resolve({ - value: value, - done: true - }); - break; - - case "throw": - front.reject(value); - break; - - default: - front.resolve({ - value: value, - done: false - }); - break; - } - - front = front.next; - - if (front) { - resume(front.key, front.arg); - } else { - back = null; - } - } - - this._invoke = send; - - if (typeof gen.return !== "function") { - this.return = undefined; - } -} - -if (typeof Symbol === "function" && Symbol.asyncIterator) { - _AsyncGenerator.prototype[Symbol.asyncIterator] = function () { - return this; - }; -} - -_AsyncGenerator.prototype.next = function (arg) { - return this._invoke("next", arg); -}; - -_AsyncGenerator.prototype.throw = function (arg) { - return this._invoke("throw", arg); -}; - -_AsyncGenerator.prototype.return = function (arg) { - return this._invoke("return", arg); -}; - -function _wrapAsyncGenerator(fn) { - return function () { - return new _AsyncGenerator(fn.apply(this, arguments)); - }; -} - -function _awaitAsyncGenerator(value) { - return new _AwaitValue(value); -} - -function _asyncGeneratorDelegate(inner, awaitWrap) { - var iter = {}, - waiting = false; - - function pump(key, value) { - waiting = true; - value = new Promise(function (resolve) { - resolve(inner[key](value)); - }); - return { - done: false, - value: awaitWrap(value) - }; - } - - ; - - if (typeof Symbol === "function" && Symbol.iterator) { - iter[Symbol.iterator] = function () { - return this; - }; - } - - iter.next = function (value) { - if (waiting) { - waiting = false; - return value; - } - - return pump("next", value); - }; - - if (typeof inner.throw === "function") { - iter.throw = function (value) { - if (waiting) { - waiting = false; - throw value; - } - - return pump("throw", value); - }; - } - - if (typeof inner.return === "function") { - iter.return = function (value) { - if (waiting) { - waiting = false; - return value; - } - - return pump("return", value); - }; - } - - return iter; -} - -function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { - try { - var info = gen[key](arg); - var value = info.value; - } catch (error) { - reject(error); - return; - } - - if (info.done) { - resolve(value); - } else { - Promise.resolve(value).then(_next, _throw); - } -} - -function _asyncToGenerator(fn) { - return function () { - var self = this, - args = arguments; - return new Promise(function (resolve, reject) { - var gen = fn.apply(self, args); - - function _next(value) { - asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value); - } - - function _throw(err) { - asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err); - } - - _next(undefined); - }); - }; -} - -function _classCallCheck(instance, Constructor) { - if (!(instance instanceof Constructor)) { - throw new TypeError("Cannot call a class as a function"); - } -} - -function _defineProperties(target, props) { - for (var i = 0; i < props.length; i++) { - var descriptor = props[i]; - descriptor.enumerable = descriptor.enumerable || false; - descriptor.configurable = true; - if ("value" in descriptor) descriptor.writable = true; - Object.defineProperty(target, descriptor.key, descriptor); - } -} - -function _createClass(Constructor, protoProps, staticProps) { - if (protoProps) _defineProperties(Constructor.prototype, protoProps); - if (staticProps) _defineProperties(Constructor, staticProps); - return Constructor; -} - -function _defineEnumerableProperties(obj, descs) { - for (var key in descs) { - var desc = descs[key]; - desc.configurable = desc.enumerable = true; - if ("value" in desc) desc.writable = true; - Object.defineProperty(obj, key, desc); - } - - if (Object.getOwnPropertySymbols) { - var objectSymbols = Object.getOwnPropertySymbols(descs); - - for (var i = 0; i < objectSymbols.length; i++) { - var sym = objectSymbols[i]; - var desc = descs[sym]; - desc.configurable = desc.enumerable = true; - if ("value" in desc) desc.writable = true; - Object.defineProperty(obj, sym, desc); - } - } - - return obj; -} - -function _defaults(obj, defaults) { - var keys = Object.getOwnPropertyNames(defaults); - - for (var i = 0; i < keys.length; i++) { - var key = keys[i]; - var value = Object.getOwnPropertyDescriptor(defaults, key); - - if (value && value.configurable && obj[key] === undefined) { - Object.defineProperty(obj, key, value); - } - } - - return obj; -} - -function _defineProperty(obj, key, value) { - if (key in obj) { - Object.defineProperty(obj, key, { - value: value, - enumerable: true, - configurable: true, - writable: true - }); - } else { - obj[key] = value; - } - - return obj; -} - -function _extends() { - _extends = Object.assign || function (target) { - for (var i = 1; i < arguments.length; i++) { - var source = arguments[i]; - - for (var key in source) { - if (Object.prototype.hasOwnProperty.call(source, key)) { - target[key] = source[key]; - } - } - } - - return target; - }; - - return _extends.apply(this, arguments); -} - -function _objectSpread(target) { - for (var i = 1; i < arguments.length; i++) { - var source = arguments[i] != null ? Object(arguments[i]) : {}; - var ownKeys = Object.keys(source); - - if (typeof Object.getOwnPropertySymbols === 'function') { - ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function (sym) { - return Object.getOwnPropertyDescriptor(source, sym).enumerable; - })); - } - - ownKeys.forEach(function (key) { - _defineProperty(target, key, source[key]); - }); - } - - return target; -} - -function ownKeys(object, enumerableOnly) { - var keys = Object.keys(object); - - if (Object.getOwnPropertySymbols) { - var symbols = Object.getOwnPropertySymbols(object); - if (enumerableOnly) symbols = symbols.filter(function (sym) { - return Object.getOwnPropertyDescriptor(object, sym).enumerable; - }); - keys.push.apply(keys, symbols); - } - - return keys; -} - -function _objectSpread2(target) { - for (var i = 1; i < arguments.length; i++) { - var source = arguments[i] != null ? arguments[i] : {}; - - if (i % 2) { - ownKeys(Object(source), true).forEach(function (key) { - _defineProperty(target, key, source[key]); - }); - } else if (Object.getOwnPropertyDescriptors) { - Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); - } else { - ownKeys(Object(source)).forEach(function (key) { - Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); - }); - } - } - - return target; -} - -function _inherits(subClass, superClass) { - if (typeof superClass !== "function" && superClass !== null) { - throw new TypeError("Super expression must either be null or a function"); - } - - subClass.prototype = Object.create(superClass && superClass.prototype, { - constructor: { - value: subClass, - writable: true, - configurable: true - } - }); - if (superClass) _setPrototypeOf(subClass, superClass); -} - -function _inheritsLoose(subClass, superClass) { - subClass.prototype = Object.create(superClass.prototype); - subClass.prototype.constructor = subClass; - subClass.__proto__ = superClass; -} - -function _getPrototypeOf(o) { - _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { - return o.__proto__ || Object.getPrototypeOf(o); - }; - return _getPrototypeOf(o); -} - -function _setPrototypeOf(o, p) { - _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { - o.__proto__ = p; - return o; - }; - - 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 _construct(Parent, args, Class) { - if (_isNativeReflectConstruct()) { - _construct = Reflect.construct; - } else { - _construct = function _construct(Parent, args, Class) { - var a = [null]; - a.push.apply(a, args); - var Constructor = Function.bind.apply(Parent, a); - var instance = new Constructor(); - if (Class) _setPrototypeOf(instance, Class.prototype); - return instance; - }; - } - - return _construct.apply(null, arguments); -} - -function _isNativeFunction(fn) { - return Function.toString.call(fn).indexOf("[native code]") !== -1; -} - -function _wrapNativeSuper(Class) { - var _cache = typeof Map === "function" ? new Map() : undefined; - - _wrapNativeSuper = function _wrapNativeSuper(Class) { - if (Class === null || !_isNativeFunction(Class)) return Class; - - if (typeof Class !== "function") { - throw new TypeError("Super expression must either be null or a function"); - } - - if (typeof _cache !== "undefined") { - if (_cache.has(Class)) return _cache.get(Class); - - _cache.set(Class, Wrapper); - } - - function Wrapper() { - return _construct(Class, arguments, _getPrototypeOf(this).constructor); - } - - Wrapper.prototype = Object.create(Class.prototype, { - constructor: { - value: Wrapper, - enumerable: false, - writable: true, - configurable: true - } - }); - return _setPrototypeOf(Wrapper, Class); - }; - - return _wrapNativeSuper(Class); -} - -function _instanceof(left, right) { - if (right != null && typeof Symbol !== "undefined" && right[Symbol.hasInstance]) { - return !!right[Symbol.hasInstance](left); - } else { - return left instanceof right; - } -} - -function _interopRequireDefault(obj) { - return obj && obj.__esModule ? obj : { - default: obj - }; -} - -function _getRequireWildcardCache() { - if (typeof WeakMap !== "function") return null; - var cache = new WeakMap(); - - _getRequireWildcardCache = function () { - return cache; - }; - - return cache; -} - -function _interopRequireWildcard(obj) { - if (obj && obj.__esModule) { - return obj; - } - - if (obj === null || typeof obj !== "object" && typeof obj !== "function") { - return { - default: obj - }; - } - - var cache = _getRequireWildcardCache(); - - if (cache && cache.has(obj)) { - return cache.get(obj); - } - - var newObj = {}; - var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; - - for (var key in obj) { - if (Object.prototype.hasOwnProperty.call(obj, key)) { - var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; - - if (desc && (desc.get || desc.set)) { - Object.defineProperty(newObj, key, desc); - } else { - newObj[key] = obj[key]; - } - } - } - - newObj.default = obj; - - if (cache) { - cache.set(obj, newObj); - } - - return newObj; -} - -function _newArrowCheck(innerThis, boundThis) { - if (innerThis !== boundThis) { - throw new TypeError("Cannot instantiate an arrow function"); - } -} - -function _objectDestructuringEmpty(obj) { - if (obj == null) throw new TypeError("Cannot destructure undefined"); -} - -function _objectWithoutPropertiesLoose(source, excluded) { - if (source == null) return {}; - var target = {}; - var sourceKeys = Object.keys(source); - var key, i; - - for (i = 0; i < sourceKeys.length; i++) { - key = sourceKeys[i]; - if (excluded.indexOf(key) >= 0) continue; - target[key] = source[key]; - } - - return target; -} - -function _objectWithoutProperties(source, excluded) { - if (source == null) return {}; - - var target = _objectWithoutPropertiesLoose(source, excluded); - - var key, i; - - if (Object.getOwnPropertySymbols) { - var sourceSymbolKeys = Object.getOwnPropertySymbols(source); - - for (i = 0; i < sourceSymbolKeys.length; i++) { - key = sourceSymbolKeys[i]; - if (excluded.indexOf(key) >= 0) continue; - if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; - target[key] = source[key]; - } - } - - return target; -} - -function _assertThisInitialized(self) { - if (self === void 0) { - throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); - } - - return self; -} - -function _possibleConstructorReturn(self, call) { - if (call && (typeof call === "object" || typeof call === "function")) { - return call; - } - - return _assertThisInitialized(self); -} - -function _createSuper(Derived) { - var hasNativeReflectConstruct = _isNativeReflectConstruct(); - - return function _createSuperInternal() { - var Super = _getPrototypeOf(Derived), - result; - - if (hasNativeReflectConstruct) { - 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); - if (object === null) break; - } - - return object; -} - -function _get(target, property, receiver) { - if (typeof Reflect !== "undefined" && Reflect.get) { - _get = Reflect.get; - } else { - _get = function _get(target, property, receiver) { - var base = _superPropBase(target, property); - - if (!base) return; - var desc = Object.getOwnPropertyDescriptor(base, property); - - if (desc.get) { - return desc.get.call(receiver); - } - - return desc.value; - }; - } - - return _get(target, property, receiver || target); -} - -function set(target, property, value, receiver) { - if (typeof Reflect !== "undefined" && Reflect.set) { - set = Reflect.set; - } else { - set = function set(target, property, value, receiver) { - var base = _superPropBase(target, property); - - var desc; - - if (base) { - desc = Object.getOwnPropertyDescriptor(base, property); - - if (desc.set) { - desc.set.call(receiver, value); - return true; - } else if (!desc.writable) { - return false; - } - } - - desc = Object.getOwnPropertyDescriptor(receiver, property); - - if (desc) { - if (!desc.writable) { - return false; - } - - desc.value = value; - Object.defineProperty(receiver, property, desc); - } else { - _defineProperty(receiver, property, value); - } - - return true; - }; - } - - return set(target, property, value, receiver); -} - -function _set(target, property, value, receiver, isStrict) { - var s = set(target, property, value, receiver || target); - - if (!s && isStrict) { - throw new Error('failed to set property'); - } - - return value; -} - -function _taggedTemplateLiteral(strings, raw) { - if (!raw) { - raw = strings.slice(0); - } - - return Object.freeze(Object.defineProperties(strings, { - raw: { - value: Object.freeze(raw) - } - })); -} - -function _taggedTemplateLiteralLoose(strings, raw) { - if (!raw) { - raw = strings.slice(0); - } - - strings.raw = raw; - return strings; -} - -function _readOnlyError(name) { - throw new Error("\"" + name + "\" is read-only"); -} - -function _classNameTDZError(name) { - throw new Error("Class \"" + name + "\" cannot be referenced in computed property keys."); -} - -function _temporalUndefined() {} - -function _tdz(name) { - throw new ReferenceError(name + " is not defined - temporal dead zone"); -} - -function _temporalRef(val, name) { - return val === _temporalUndefined ? _tdz(name) : val; -} - -function _slicedToArray(arr, i) { - return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); -} - -function _slicedToArrayLoose(arr, i) { - return _arrayWithHoles(arr) || _iterableToArrayLimitLoose(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); -} - -function _toArray(arr) { - return _arrayWithHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableRest(); -} - -function _toConsumableArray(arr) { - return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); -} - -function _arrayWithoutHoles(arr) { - if (Array.isArray(arr)) return _arrayLikeToArray(arr); -} - -function _arrayWithHoles(arr) { - if (Array.isArray(arr)) return arr; -} - -function _maybeArrayLike(next, arr, i) { - if (arr && !Array.isArray(arr) && typeof arr.length === "number") { - var len = arr.length; - return _arrayLikeToArray(arr, i !== void 0 && i < len ? i : len); - } - - return next(arr, i); -} - -function _iterableToArray(iter) { - if (typeof Symbol !== "undefined" && Symbol.iterator in Object(iter)) return Array.from(iter); -} - -function _iterableToArrayLimit(arr, i) { - if (typeof Symbol === "undefined" || !(Symbol.iterator in Object(arr))) return; - var _arr = []; - var _n = true; - var _d = false; - var _e = undefined; - - try { - for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { - _arr.push(_s.value); - - if (i && _arr.length === i) break; - } - } catch (err) { - _d = true; - _e = err; - } finally { - try { - if (!_n && _i["return"] != null) _i["return"](); - } finally { - if (_d) throw _e; - } - } - - return _arr; -} - -function _iterableToArrayLimitLoose(arr, i) { - if (typeof Symbol === "undefined" || !(Symbol.iterator in Object(arr))) return; - var _arr = []; - - for (var _iterator = arr[Symbol.iterator](), _step; !(_step = _iterator.next()).done;) { - _arr.push(_step.value); - - if (i && _arr.length === i) break; - } - - 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(o); - 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.\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.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); -} - -function _createForOfIteratorHelper(o, allowArrayLike) { - var it; - - if (typeof Symbol === "undefined" || o[Symbol.iterator] == null) { - if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") { - if (it) o = it; - 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 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; - } - } - }; -} - -function _createForOfIteratorHelperLoose(o, allowArrayLike) { - var it; - - if (typeof Symbol === "undefined" || o[Symbol.iterator] == null) { - if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") { - if (it) o = it; - var i = 0; - return function () { - if (i >= o.length) return { - done: true - }; - return { - done: false, - value: o[i++] - }; - }; - } - - throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); - } - - it = o[Symbol.iterator](); - return it.next.bind(it); -} - -function _skipFirstGeneratorNext(fn) { - return function () { - var it = fn.apply(this, arguments); - it.next(); - return it; - }; -} - -function _toPrimitive(input, hint) { - if (typeof input !== "object" || input === null) return input; - var prim = input[Symbol.toPrimitive]; - - if (prim !== undefined) { - var res = prim.call(input, hint || "default"); - if (typeof res !== "object") return res; - throw new TypeError("@@toPrimitive must return a primitive value."); - } - - return (hint === "string" ? String : Number)(input); -} - -function _toPropertyKey(arg) { - var key = _toPrimitive(arg, "string"); - - return typeof key === "symbol" ? key : String(key); -} - -function _initializerWarningHelper(descriptor, context) { - throw new Error('Decorating class property failed. Please ensure that ' + 'proposal-class-properties is enabled and runs after the decorators transform.'); -} - -function _initializerDefineProperty(target, property, descriptor, context) { - if (!descriptor) return; - Object.defineProperty(target, property, { - enumerable: descriptor.enumerable, - configurable: descriptor.configurable, - writable: descriptor.writable, - value: descriptor.initializer ? descriptor.initializer.call(context) : void 0 - }); -} - -function _applyDecoratedDescriptor(target, property, decorators, descriptor, context) { - var desc = {}; - Object.keys(descriptor).forEach(function (key) { - desc[key] = descriptor[key]; - }); - desc.enumerable = !!desc.enumerable; - desc.configurable = !!desc.configurable; - - if ('value' in desc || desc.initializer) { - desc.writable = true; - } - - desc = decorators.slice().reverse().reduce(function (desc, decorator) { - return decorator(target, property, desc) || desc; - }, desc); - - if (context && desc.initializer !== void 0) { - desc.value = desc.initializer ? desc.initializer.call(context) : void 0; - desc.initializer = undefined; - } - - if (desc.initializer === void 0) { - Object.defineProperty(target, property, desc); - desc = null; - } - - return desc; -} - -var id = 0; - -function _classPrivateFieldLooseKey(name) { - return "__private_" + id++ + "_" + name; -} - -function _classPrivateFieldLooseBase(receiver, privateKey) { - if (!Object.prototype.hasOwnProperty.call(receiver, privateKey)) { - throw new TypeError("attempted to use private field on non-instance"); - } - - return receiver; -} - -function _classPrivateFieldGet(receiver, privateMap) { - var descriptor = privateMap.get(receiver); - - if (!descriptor) { - throw new TypeError("attempted to get private field on non-instance"); - } - - if (descriptor.get) { - return descriptor.get.call(receiver); - } - - return descriptor.value; -} - -function _classPrivateFieldSet(receiver, privateMap, value) { - var descriptor = privateMap.get(receiver); - - if (!descriptor) { - throw new TypeError("attempted to set private field on non-instance"); - } - - if (descriptor.set) { - descriptor.set.call(receiver, value); - } else { - if (!descriptor.writable) { - throw new TypeError("attempted to set read only private field"); - } - - descriptor.value = value; - } - - return value; -} - -function _classPrivateFieldDestructureSet(receiver, privateMap) { - if (!privateMap.has(receiver)) { - throw new TypeError("attempted to set private field on non-instance"); - } - - var descriptor = privateMap.get(receiver); - - if (descriptor.set) { - if (!("__destrObj" in descriptor)) { - descriptor.__destrObj = { - set value(v) { - descriptor.set.call(receiver, v); - } - - }; - } - - return descriptor.__destrObj; - } else { - if (!descriptor.writable) { - throw new TypeError("attempted to set read only private field"); - } - - return descriptor; - } -} - -function _classStaticPrivateFieldSpecGet(receiver, classConstructor, descriptor) { - if (receiver !== classConstructor) { - throw new TypeError("Private static access of wrong provenance"); - } - - if (descriptor.get) { - return descriptor.get.call(receiver); - } - - return descriptor.value; -} - -function _classStaticPrivateFieldSpecSet(receiver, classConstructor, descriptor, value) { - if (receiver !== classConstructor) { - throw new TypeError("Private static access of wrong provenance"); - } - - if (descriptor.set) { - descriptor.set.call(receiver, value); - } else { - if (!descriptor.writable) { - throw new TypeError("attempted to set read only private field"); - } - - descriptor.value = value; - } - - return value; -} - -function _classStaticPrivateMethodGet(receiver, classConstructor, method) { - if (receiver !== classConstructor) { - throw new TypeError("Private static access of wrong provenance"); - } - - return method; -} - -function _classStaticPrivateMethodSet() { - throw new TypeError("attempted to set read only static private field"); -} - -function _decorate(decorators, factory, superClass, mixins) { - var api = _getDecoratorsApi(); - - if (mixins) { - for (var i = 0; i < mixins.length; i++) { - api = mixins[i](api); - } - } - - var r = factory(function initialize(O) { - api.initializeInstanceElements(O, decorated.elements); - }, superClass); - var decorated = api.decorateClass(_coalesceClassElements(r.d.map(_createElementDescriptor)), decorators); - api.initializeClassElements(r.F, decorated.elements); - return api.runClassFinishers(r.F, decorated.finishers); -} - -function _getDecoratorsApi() { - _getDecoratorsApi = function () { - return api; - }; - - var api = { - elementsDefinitionOrder: [["method"], ["field"]], - initializeInstanceElements: function (O, elements) { - ["method", "field"].forEach(function (kind) { - elements.forEach(function (element) { - if (element.kind === kind && element.placement === "own") { - this.defineClassElement(O, element); - } - }, this); - }, this); - }, - initializeClassElements: function (F, elements) { - var proto = F.prototype; - ["method", "field"].forEach(function (kind) { - elements.forEach(function (element) { - var placement = element.placement; - - if (element.kind === kind && (placement === "static" || placement === "prototype")) { - var receiver = placement === "static" ? F : proto; - this.defineClassElement(receiver, element); - } - }, this); - }, this); - }, - defineClassElement: function (receiver, element) { - var descriptor = element.descriptor; - - if (element.kind === "field") { - var initializer = element.initializer; - descriptor = { - enumerable: descriptor.enumerable, - writable: descriptor.writable, - configurable: descriptor.configurable, - value: initializer === void 0 ? void 0 : initializer.call(receiver) - }; - } - - Object.defineProperty(receiver, element.key, descriptor); - }, - decorateClass: function (elements, decorators) { - var newElements = []; - var finishers = []; - var placements = { - static: [], - prototype: [], - own: [] - }; - elements.forEach(function (element) { - this.addElementPlacement(element, placements); - }, this); - elements.forEach(function (element) { - if (!_hasDecorators(element)) return newElements.push(element); - var elementFinishersExtras = this.decorateElement(element, placements); - newElements.push(elementFinishersExtras.element); - newElements.push.apply(newElements, elementFinishersExtras.extras); - finishers.push.apply(finishers, elementFinishersExtras.finishers); - }, this); - - if (!decorators) { - return { - elements: newElements, - finishers: finishers - }; - } - - var result = this.decorateConstructor(newElements, decorators); - finishers.push.apply(finishers, result.finishers); - result.finishers = finishers; - return result; - }, - addElementPlacement: function (element, placements, silent) { - var keys = placements[element.placement]; - - if (!silent && keys.indexOf(element.key) !== -1) { - throw new TypeError("Duplicated element (" + element.key + ")"); - } - - keys.push(element.key); - }, - decorateElement: function (element, placements) { - var extras = []; - var finishers = []; - - for (var decorators = element.decorators, i = decorators.length - 1; i >= 0; i--) { - var keys = placements[element.placement]; - keys.splice(keys.indexOf(element.key), 1); - var elementObject = this.fromElementDescriptor(element); - var elementFinisherExtras = this.toElementFinisherExtras((0, decorators[i])(elementObject) || elementObject); - element = elementFinisherExtras.element; - this.addElementPlacement(element, placements); - - if (elementFinisherExtras.finisher) { - finishers.push(elementFinisherExtras.finisher); - } - - var newExtras = elementFinisherExtras.extras; - - if (newExtras) { - for (var j = 0; j < newExtras.length; j++) { - this.addElementPlacement(newExtras[j], placements); - } - - extras.push.apply(extras, newExtras); - } - } - - return { - element: element, - finishers: finishers, - extras: extras - }; - }, - decorateConstructor: function (elements, decorators) { - var finishers = []; - - for (var i = decorators.length - 1; i >= 0; i--) { - var obj = this.fromClassDescriptor(elements); - var elementsAndFinisher = this.toClassDescriptor((0, decorators[i])(obj) || obj); - - if (elementsAndFinisher.finisher !== undefined) { - finishers.push(elementsAndFinisher.finisher); - } - - if (elementsAndFinisher.elements !== undefined) { - elements = elementsAndFinisher.elements; - - for (var j = 0; j < elements.length - 1; j++) { - for (var k = j + 1; k < elements.length; k++) { - if (elements[j].key === elements[k].key && elements[j].placement === elements[k].placement) { - throw new TypeError("Duplicated element (" + elements[j].key + ")"); - } - } - } - } - } - - return { - elements: elements, - finishers: finishers - }; - }, - fromElementDescriptor: function (element) { - var obj = { - kind: element.kind, - key: element.key, - placement: element.placement, - descriptor: element.descriptor - }; - var desc = { - value: "Descriptor", - configurable: true - }; - Object.defineProperty(obj, Symbol.toStringTag, desc); - if (element.kind === "field") obj.initializer = element.initializer; - return obj; - }, - toElementDescriptors: function (elementObjects) { - if (elementObjects === undefined) return; - return _toArray(elementObjects).map(function (elementObject) { - var element = this.toElementDescriptor(elementObject); - this.disallowProperty(elementObject, "finisher", "An element descriptor"); - this.disallowProperty(elementObject, "extras", "An element descriptor"); - return element; - }, this); - }, - toElementDescriptor: function (elementObject) { - var kind = String(elementObject.kind); - - if (kind !== "method" && kind !== "field") { - throw new TypeError('An element descriptor\'s .kind property must be either "method" or' + ' "field", but a decorator created an element descriptor with' + ' .kind "' + kind + '"'); - } - - var key = _toPropertyKey(elementObject.key); - - var placement = String(elementObject.placement); - - if (placement !== "static" && placement !== "prototype" && placement !== "own") { - throw new TypeError('An element descriptor\'s .placement property must be one of "static",' + ' "prototype" or "own", but a decorator created an element descriptor' + ' with .placement "' + placement + '"'); - } - - var descriptor = elementObject.descriptor; - this.disallowProperty(elementObject, "elements", "An element descriptor"); - var element = { - kind: kind, - key: key, - placement: placement, - descriptor: Object.assign({}, descriptor) - }; - - if (kind !== "field") { - this.disallowProperty(elementObject, "initializer", "A method descriptor"); - } else { - this.disallowProperty(descriptor, "get", "The property descriptor of a field descriptor"); - this.disallowProperty(descriptor, "set", "The property descriptor of a field descriptor"); - this.disallowProperty(descriptor, "value", "The property descriptor of a field descriptor"); - element.initializer = elementObject.initializer; - } - - return element; - }, - toElementFinisherExtras: function (elementObject) { - var element = this.toElementDescriptor(elementObject); - - var finisher = _optionalCallableProperty(elementObject, "finisher"); - - var extras = this.toElementDescriptors(elementObject.extras); - return { - element: element, - finisher: finisher, - extras: extras - }; - }, - fromClassDescriptor: function (elements) { - var obj = { - kind: "class", - elements: elements.map(this.fromElementDescriptor, this) - }; - var desc = { - value: "Descriptor", - configurable: true - }; - Object.defineProperty(obj, Symbol.toStringTag, desc); - return obj; - }, - toClassDescriptor: function (obj) { - var kind = String(obj.kind); - - if (kind !== "class") { - throw new TypeError('A class descriptor\'s .kind property must be "class", but a decorator' + ' created a class descriptor with .kind "' + kind + '"'); - } - - this.disallowProperty(obj, "key", "A class descriptor"); - this.disallowProperty(obj, "placement", "A class descriptor"); - this.disallowProperty(obj, "descriptor", "A class descriptor"); - this.disallowProperty(obj, "initializer", "A class descriptor"); - this.disallowProperty(obj, "extras", "A class descriptor"); - - var finisher = _optionalCallableProperty(obj, "finisher"); - - var elements = this.toElementDescriptors(obj.elements); - return { - elements: elements, - finisher: finisher - }; - }, - runClassFinishers: function (constructor, finishers) { - for (var i = 0; i < finishers.length; i++) { - var newConstructor = (0, finishers[i])(constructor); - - if (newConstructor !== undefined) { - if (typeof newConstructor !== "function") { - throw new TypeError("Finishers must return a constructor."); - } - - constructor = newConstructor; - } - } - - return constructor; - }, - disallowProperty: function (obj, name, objectType) { - if (obj[name] !== undefined) { - throw new TypeError(objectType + " can't have a ." + name + " property."); - } - } - }; - return api; -} - -function _createElementDescriptor(def) { - var key = _toPropertyKey(def.key); - - var descriptor; - - if (def.kind === "method") { - descriptor = { - value: def.value, - writable: true, - configurable: true, - enumerable: false - }; - } else if (def.kind === "get") { - descriptor = { - get: def.value, - configurable: true, - enumerable: false - }; - } else if (def.kind === "set") { - descriptor = { - set: def.value, - configurable: true, - enumerable: false - }; - } else if (def.kind === "field") { - descriptor = { - configurable: true, - writable: true, - enumerable: true - }; - } - - var element = { - kind: def.kind === "field" ? "field" : "method", - key: key, - placement: def.static ? "static" : def.kind === "field" ? "own" : "prototype", - descriptor: descriptor - }; - if (def.decorators) element.decorators = def.decorators; - if (def.kind === "field") element.initializer = def.value; - return element; -} - -function _coalesceGetterSetter(element, other) { - if (element.descriptor.get !== undefined) { - other.descriptor.get = element.descriptor.get; - } else { - other.descriptor.set = element.descriptor.set; - } -} - -function _coalesceClassElements(elements) { - var newElements = []; - - var isSameElement = function (other) { - return other.kind === "method" && other.key === element.key && other.placement === element.placement; - }; - - for (var i = 0; i < elements.length; i++) { - var element = elements[i]; - var other; - - if (element.kind === "method" && (other = newElements.find(isSameElement))) { - if (_isDataDescriptor(element.descriptor) || _isDataDescriptor(other.descriptor)) { - if (_hasDecorators(element) || _hasDecorators(other)) { - throw new ReferenceError("Duplicated methods (" + element.key + ") can't be decorated."); - } - - other.descriptor = element.descriptor; - } else { - if (_hasDecorators(element)) { - if (_hasDecorators(other)) { - throw new ReferenceError("Decorators can't be placed on different accessors with for " + "the same property (" + element.key + ")."); - } - - other.decorators = element.decorators; - } - - _coalesceGetterSetter(element, other); - } - } else { - newElements.push(element); - } - } - - return newElements; -} - -function _hasDecorators(element) { - return element.decorators && element.decorators.length; -} - -function _isDataDescriptor(desc) { - return desc !== undefined && !(desc.value === undefined && desc.writable === undefined); -} - -function _optionalCallableProperty(obj, name) { - var value = obj[name]; - - if (value !== undefined && typeof value !== "function") { - throw new TypeError("Expected '" + name + "' to be a function"); - } - - return value; -} - -function _classPrivateMethodGet(receiver, privateSet, fn) { - if (!privateSet.has(receiver)) { - throw new TypeError("attempted to get private field on non-instance"); - } - - return fn; -} - -function _classPrivateMethodSet() { - throw new TypeError("attempted to reassign private method"); -} - -function _wrapRegExp(re, groups) { - _wrapRegExp = function (re, groups) { - return new BabelRegExp(re, undefined, groups); - }; - - var _RegExp = _wrapNativeSuper(RegExp); - - var _super = RegExp.prototype; - - var _groups = new WeakMap(); - - function BabelRegExp(re, flags, groups) { - var _this = _RegExp.call(this, re, flags); - - _groups.set(_this, groups || _groups.get(re)); - - return _this; - } - - _inherits(BabelRegExp, _RegExp); - - BabelRegExp.prototype.exec = function (str) { - var result = _super.exec.call(this, str); - - if (result) result.groups = buildGroups(result, this); - return result; - }; - - BabelRegExp.prototype[Symbol.replace] = function (str, substitution) { - if (typeof substitution === "string") { - var groups = _groups.get(this); - - return _super[Symbol.replace].call(this, str, substitution.replace(/\$<([^>]+)>/g, function (_, name) { - return "$" + groups[name]; - })); - } else if (typeof substitution === "function") { - var _this = this; - - return _super[Symbol.replace].call(this, str, function () { - var args = []; - args.push.apply(args, arguments); - - if (typeof args[args.length - 1] !== "object") { - args.push(buildGroups(args, _this)); - } - - return substitution.apply(this, args); - }); - } else { - return _super[Symbol.replace].call(this, str, substitution); - } - }; - - function buildGroups(result, re) { - var g = _groups.get(re); - - return Object.keys(g).reduce(function (groups, name) { - groups[name] = result[g[name]]; - return groups; - }, Object.create(null)); - } - - return _wrapRegExp.apply(this, arguments); -} - +function _AwaitValue(e){this.wrapped=e}function _AsyncGenerator(e){var r,t;function resume(r,t){try{var n=e[r](t),o=n.value,a=o instanceof _AwaitValue;Promise.resolve(a?o.wrapped:o).then((function(e){a?resume("return"===r?"return":"next",e):settle(n.done?"return":"normal",e)}),(function(e){resume("throw",e)}))}catch(e){settle("throw",e)}}function settle(e,n){switch(e){case"return":r.resolve({value:n,done:!0});break;case"throw":r.reject(n);break;default:r.resolve({value:n,done:!1})}(r=r.next)?resume(r.key,r.arg):t=null}this._invoke=function send(e,n){return new Promise((function(o,a){var i={key:e,arg:n,resolve:o,reject:a,next:null};t?t=t.next=i:(r=t=i,resume(e,n))}))},"function"!=typeof e.return&&(this.return=void 0)}function asyncGeneratorStep(e,r,t,n,o,a,i){try{var u=e[a](i),l=u.value}catch(e){return void t(e)}u.done?r(l):Promise.resolve(l).then(n,o)}function _slicedToArray(e,r){return _arrayWithHoles(e)||function _iterableToArrayLimit(e,r){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(e)))return;var t=[],n=!0,o=!1,a=void 0;try{for(var i,u=e[Symbol.iterator]();!(n=(i=u.next()).done)&&(t.push(i.value),!r||t.length!==r);n=!0);}catch(e){o=!0,a=e}finally{try{n||null==u.return||u.return()}finally{if(o)throw a}}return t}(e,r)||_unsupportedIterableToArray(e,r)||_nonIterableRest()}function _arrayWithHoles(e){if(Array.isArray(e))return e}function _unsupportedIterableToArray(e,r){if(e){if("string"==typeof e)return _arrayLikeToArray(e,r);var t=Object.prototype.toString.call(e).slice(8,-1);return"Object"===t&&e.constructor&&(t=e.constructor.name),"Map"===t||"Set"===t?Array.from(e):"Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)?_arrayLikeToArray(e,r):void 0}}function _arrayLikeToArray(e,r){(null==r||r>e.length)&&(r=e.length);for(var t=0,n=new Array(r);t {\n text = text.replace('{' + prop + '}', val);\n });\n\n // Show the text using the custom alert function\n $.alert(text);\n }\n }\n };\n }\n};\n"],"names":["name","init","$","importLocale","strings","svgEditor","svgCanvas","canvas","svgicons","buttons","id","icon","type","title","events","click","setMode","mouseDown","getMode","started","undefined","mouseUp","opts","zoom","getZoom","x","mouse_x","y","mouse_y","text","forEach","prop","val","replace","alert"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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A,sBAAIX,SAAS,CAACY,OAAV,OAAwB,aAA5B,EAA2C;AACzC;AACA;AACA,2BAAO;AAACC,sBAAAA,OAAO,EAAE;AAAV,qBAAP;AACD;;AACD,yBAAOC,SAAP;AACD,iBAzCI;AA2CL;AACA;AACAC,gBAAAA,OA7CK,mBA6CIC,IA7CJ,EA6CU;AACb;AACA,sBAAIhB,SAAS,CAACY,OAAV,OAAwB,aAA5B,EAA2C;AACzC,wBAAMK,IAAI,GAAGjB,SAAS,CAACkB,OAAV,EAAb,CADyC;;AAIzC,wBAAMC,CAAC,GAAGH,IAAI,CAACI,OAAL,GAAeH,IAAzB;AACA,wBAAMI,CAAC,GAAGL,IAAI,CAACM,OAAL,GAAeL,IAAzB,CALyC;;AAAA,wBAQpCM,IARoC,GAQ5BzB,OAR4B,CAQpCyB,IARoC;AASzC,qBACE,CAAC,GAAD,EAAMJ,CAAN,CADF,EAEE,CAAC,GAAD,EAAME,CAAN,CAFF,EAGEG,OAHF,CAGU,iBAAiB;AAAA;AAAA,0BAAfC,IAAe;AAAA,0BAATC,GAAS;;AACzBH,sBAAAA,IAAI,GAAGA,IAAI,CAACI,OAAL,CAAa,MAAMF,IAAN,GAAa,GAA1B,EAA+BC,GAA/B,CAAP;AACD,qBALD,EATyC;;AAiBzC9B,oBAAAA,CAAC,CAACgC,KAAF,CAAQL,IAAR;AACD;AACF;AAlEI,eALsB;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAyE9B;AA3EY,CAAf;;;;"} \ No newline at end of file +{"version":3,"file":"ext-helloworld.js","sources":["../../../src/editor/extensions/ext-helloworld.js"],"sourcesContent":["/**\n * @file ext-helloworld.js\n *\n * @license MIT\n *\n * @copyright 2010 Alexis Deveria\n *\n */\n\n/**\n* This is a very basic SVG-Edit extension. It adds a \"Hello World\" button in\n* the left (\"mode\") panel. Clicking on the button, and then the canvas\n* will show the user the point on the canvas that was clicked on.\n*/\nexport default {\n name: 'helloworld',\n async init ({$, importLocale}) {\n // See `/editor/extensions/ext-locale/helloworld/`\n const strings = await importLocale();\n const svgEditor = this;\n const svgCanvas = svgEditor.canvas;\n return {\n name: strings.name,\n // For more notes on how to make an icon file, see the source of\n // the helloworld-icon.xml\n svgicons: 'helloworld-icon.xml',\n\n // Multiple buttons can be added in this array\n buttons: [{\n // Must match the icon ID in helloworld-icon.xml\n id: 'hello_world',\n\n // Fallback, e.g., for `file:///` access\n icon: 'helloworld.png',\n\n // This indicates that the button will be added to the \"mode\"\n // button panel on the left side\n type: 'mode',\n\n // Tooltip text\n title: strings.buttons[0].title,\n\n // Events\n events: {\n click () {\n // The action taken when the button is clicked on.\n // For \"mode\" buttons, any other button will\n // automatically be de-pressed.\n svgCanvas.setMode('hello_world');\n }\n }\n }],\n // This is triggered when the main mouse button is pressed down\n // on the editor canvas (not the tool panels)\n mouseDown () {\n // Check the mode on mousedown\n if (svgCanvas.getMode() === 'hello_world') {\n // The returned object must include \"started\" with\n // a value of true in order for mouseUp to be triggered\n return {started: true};\n }\n return undefined;\n },\n\n // This is triggered from anywhere, but \"started\" must have been set\n // to true (see above). Note that \"opts\" is an object with event info\n mouseUp (opts) {\n // Check the mode on mouseup\n if (svgCanvas.getMode() === 'hello_world') {\n const zoom = svgCanvas.getZoom();\n\n // Get the actual coordinate by dividing by the zoom value\n const x = opts.mouse_x / zoom;\n const y = opts.mouse_y / zoom;\n\n // We do our own formatting\n let {text} = strings;\n [\n ['x', x],\n ['y', y]\n ].forEach(([prop, val]) => {\n text = text.replace('{' + prop + '}', val);\n });\n\n // Show the text using the custom alert function\n $.alert(text);\n }\n }\n };\n }\n};\n"],"names":["name","init","$","importLocale","strings","svgCanvas","_this","canvas","svgicons","buttons","id","icon","type","title","events","click","setMode","mouseDown","getMode","started","mouseUp","opts","zoom","getZoom","x","mouse_x","y","mouse_y","text","forEach","prop","val","replace","alert"],"mappings":";;;;;;;;;AAcA,MAAe,CACbA,KAAM,aACAC,qdAAOC,IAAAA,EAAGC,IAAAA,sBAEQA,kBAAhBC,SAEAC,EADYC,EACUC,yBACrB,CACLP,KAAMI,EAAQJ,KAGdQ,SAAU,sBAGVC,QAAS,CAAC,CAERC,GAAI,cAGJC,KAAM,iBAINC,KAAM,OAGNC,MAAOT,EAAQK,QAAQ,GAAGI,MAG1BC,OAAQ,CACNC,uBAIEV,EAAUW,QAAQ,mBAMxBC,kCAE8B,gBAAxBZ,EAAUa,gBAGL,CAACC,SAAS,IAOrBC,yBAASC,MAEqB,gBAAxBhB,EAAUa,UAA6B,KACnCI,EAAOjB,EAAUkB,UAGjBC,EAAIH,EAAKI,QAAUH,EACnBI,EAAIL,EAAKM,QAAUL,EAGpBM,EAAQxB,EAARwB,MAEH,CAAC,IAAKJ,GACN,CAAC,IAAKE,IACNG,SAAQ,sCAAEC,OAAMC,OAChBH,EAAOA,EAAKI,QAAQ,IAAMF,EAAO,IAAKC,MAIxC7B,EAAE+B,MAAML"} \ No newline at end of file diff --git a/dist/editor/extensions/ext-imagelib.js b/dist/editor/extensions/ext-imagelib.js index 6c0ee9d0..3fc01c9f 100644 --- a/dist/editor/extensions/ext-imagelib.js +++ b/dist/editor/extensions/ext-imagelib.js @@ -1,1651 +1,4 @@ -function _typeof(obj) { - "@babel/helpers - typeof"; - - if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { - _typeof = function (obj) { - return typeof obj; - }; - } else { - _typeof = function (obj) { - return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; - }; - } - - return _typeof(obj); -} - -var REACT_ELEMENT_TYPE; - -function _jsx(type, props, key, children) { - if (!REACT_ELEMENT_TYPE) { - REACT_ELEMENT_TYPE = typeof Symbol === "function" && Symbol["for"] && Symbol["for"]("react.element") || 0xeac7; - } - - var defaultProps = type && type.defaultProps; - var childrenLength = arguments.length - 3; - - if (!props && childrenLength !== 0) { - props = { - children: void 0 - }; - } - - if (childrenLength === 1) { - props.children = children; - } else if (childrenLength > 1) { - var childArray = new Array(childrenLength); - - for (var i = 0; i < childrenLength; i++) { - childArray[i] = arguments[i + 3]; - } - - props.children = childArray; - } - - if (props && defaultProps) { - for (var propName in defaultProps) { - if (props[propName] === void 0) { - props[propName] = defaultProps[propName]; - } - } - } else if (!props) { - props = defaultProps || {}; - } - - return { - $$typeof: REACT_ELEMENT_TYPE, - type: type, - key: key === undefined ? null : '' + key, - ref: null, - props: props, - _owner: null - }; -} - -function _asyncIterator(iterable) { - var method; - - if (typeof Symbol !== "undefined") { - if (Symbol.asyncIterator) { - method = iterable[Symbol.asyncIterator]; - if (method != null) return method.call(iterable); - } - - if (Symbol.iterator) { - method = iterable[Symbol.iterator]; - if (method != null) return method.call(iterable); - } - } - - throw new TypeError("Object is not async iterable"); -} - -function _AwaitValue(value) { - this.wrapped = value; -} - -function _AsyncGenerator(gen) { - var front, back; - - function send(key, arg) { - return new Promise(function (resolve, reject) { - var request = { - key: key, - arg: arg, - resolve: resolve, - reject: reject, - next: null - }; - - if (back) { - back = back.next = request; - } else { - front = back = request; - resume(key, arg); - } - }); - } - - function resume(key, arg) { - try { - var result = gen[key](arg); - var value = result.value; - var wrappedAwait = value instanceof _AwaitValue; - Promise.resolve(wrappedAwait ? value.wrapped : value).then(function (arg) { - if (wrappedAwait) { - resume(key === "return" ? "return" : "next", arg); - return; - } - - settle(result.done ? "return" : "normal", arg); - }, function (err) { - resume("throw", err); - }); - } catch (err) { - settle("throw", err); - } - } - - function settle(type, value) { - switch (type) { - case "return": - front.resolve({ - value: value, - done: true - }); - break; - - case "throw": - front.reject(value); - break; - - default: - front.resolve({ - value: value, - done: false - }); - break; - } - - front = front.next; - - if (front) { - resume(front.key, front.arg); - } else { - back = null; - } - } - - this._invoke = send; - - if (typeof gen.return !== "function") { - this.return = undefined; - } -} - -if (typeof Symbol === "function" && Symbol.asyncIterator) { - _AsyncGenerator.prototype[Symbol.asyncIterator] = function () { - return this; - }; -} - -_AsyncGenerator.prototype.next = function (arg) { - return this._invoke("next", arg); -}; - -_AsyncGenerator.prototype.throw = function (arg) { - return this._invoke("throw", arg); -}; - -_AsyncGenerator.prototype.return = function (arg) { - return this._invoke("return", arg); -}; - -function _wrapAsyncGenerator(fn) { - return function () { - return new _AsyncGenerator(fn.apply(this, arguments)); - }; -} - -function _awaitAsyncGenerator(value) { - return new _AwaitValue(value); -} - -function _asyncGeneratorDelegate(inner, awaitWrap) { - var iter = {}, - waiting = false; - - function pump(key, value) { - waiting = true; - value = new Promise(function (resolve) { - resolve(inner[key](value)); - }); - return { - done: false, - value: awaitWrap(value) - }; - } - - ; - - if (typeof Symbol === "function" && Symbol.iterator) { - iter[Symbol.iterator] = function () { - return this; - }; - } - - iter.next = function (value) { - if (waiting) { - waiting = false; - return value; - } - - return pump("next", value); - }; - - if (typeof inner.throw === "function") { - iter.throw = function (value) { - if (waiting) { - waiting = false; - throw value; - } - - return pump("throw", value); - }; - } - - if (typeof inner.return === "function") { - iter.return = function (value) { - if (waiting) { - waiting = false; - return value; - } - - return pump("return", value); - }; - } - - return iter; -} - -function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { - try { - var info = gen[key](arg); - var value = info.value; - } catch (error) { - reject(error); - return; - } - - if (info.done) { - resolve(value); - } else { - Promise.resolve(value).then(_next, _throw); - } -} - -function _asyncToGenerator(fn) { - return function () { - var self = this, - args = arguments; - return new Promise(function (resolve, reject) { - var gen = fn.apply(self, args); - - function _next(value) { - asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value); - } - - function _throw(err) { - asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err); - } - - _next(undefined); - }); - }; -} - -function _classCallCheck(instance, Constructor) { - if (!(instance instanceof Constructor)) { - throw new TypeError("Cannot call a class as a function"); - } -} - -function _defineProperties(target, props) { - for (var i = 0; i < props.length; i++) { - var descriptor = props[i]; - descriptor.enumerable = descriptor.enumerable || false; - descriptor.configurable = true; - if ("value" in descriptor) descriptor.writable = true; - Object.defineProperty(target, descriptor.key, descriptor); - } -} - -function _createClass(Constructor, protoProps, staticProps) { - if (protoProps) _defineProperties(Constructor.prototype, protoProps); - if (staticProps) _defineProperties(Constructor, staticProps); - return Constructor; -} - -function _defineEnumerableProperties(obj, descs) { - for (var key in descs) { - var desc = descs[key]; - desc.configurable = desc.enumerable = true; - if ("value" in desc) desc.writable = true; - Object.defineProperty(obj, key, desc); - } - - if (Object.getOwnPropertySymbols) { - var objectSymbols = Object.getOwnPropertySymbols(descs); - - for (var i = 0; i < objectSymbols.length; i++) { - var sym = objectSymbols[i]; - var desc = descs[sym]; - desc.configurable = desc.enumerable = true; - if ("value" in desc) desc.writable = true; - Object.defineProperty(obj, sym, desc); - } - } - - return obj; -} - -function _defaults(obj, defaults) { - var keys = Object.getOwnPropertyNames(defaults); - - for (var i = 0; i < keys.length; i++) { - var key = keys[i]; - var value = Object.getOwnPropertyDescriptor(defaults, key); - - if (value && value.configurable && obj[key] === undefined) { - Object.defineProperty(obj, key, value); - } - } - - return obj; -} - -function _defineProperty(obj, key, value) { - if (key in obj) { - Object.defineProperty(obj, key, { - value: value, - enumerable: true, - configurable: true, - writable: true - }); - } else { - obj[key] = value; - } - - return obj; -} - -function _extends() { - _extends = Object.assign || function (target) { - for (var i = 1; i < arguments.length; i++) { - var source = arguments[i]; - - for (var key in source) { - if (Object.prototype.hasOwnProperty.call(source, key)) { - target[key] = source[key]; - } - } - } - - return target; - }; - - return _extends.apply(this, arguments); -} - -function _objectSpread(target) { - for (var i = 1; i < arguments.length; i++) { - var source = arguments[i] != null ? Object(arguments[i]) : {}; - var ownKeys = Object.keys(source); - - if (typeof Object.getOwnPropertySymbols === 'function') { - ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function (sym) { - return Object.getOwnPropertyDescriptor(source, sym).enumerable; - })); - } - - ownKeys.forEach(function (key) { - _defineProperty(target, key, source[key]); - }); - } - - return target; -} - -function ownKeys(object, enumerableOnly) { - var keys = Object.keys(object); - - if (Object.getOwnPropertySymbols) { - var symbols = Object.getOwnPropertySymbols(object); - if (enumerableOnly) symbols = symbols.filter(function (sym) { - return Object.getOwnPropertyDescriptor(object, sym).enumerable; - }); - keys.push.apply(keys, symbols); - } - - return keys; -} - -function _objectSpread2(target) { - for (var i = 1; i < arguments.length; i++) { - var source = arguments[i] != null ? arguments[i] : {}; - - if (i % 2) { - ownKeys(Object(source), true).forEach(function (key) { - _defineProperty(target, key, source[key]); - }); - } else if (Object.getOwnPropertyDescriptors) { - Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); - } else { - ownKeys(Object(source)).forEach(function (key) { - Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); - }); - } - } - - return target; -} - -function _inherits(subClass, superClass) { - if (typeof superClass !== "function" && superClass !== null) { - throw new TypeError("Super expression must either be null or a function"); - } - - subClass.prototype = Object.create(superClass && superClass.prototype, { - constructor: { - value: subClass, - writable: true, - configurable: true - } - }); - if (superClass) _setPrototypeOf(subClass, superClass); -} - -function _inheritsLoose(subClass, superClass) { - subClass.prototype = Object.create(superClass.prototype); - subClass.prototype.constructor = subClass; - subClass.__proto__ = superClass; -} - -function _getPrototypeOf(o) { - _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { - return o.__proto__ || Object.getPrototypeOf(o); - }; - return _getPrototypeOf(o); -} - -function _setPrototypeOf(o, p) { - _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { - o.__proto__ = p; - return o; - }; - - 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 _construct(Parent, args, Class) { - if (_isNativeReflectConstruct()) { - _construct = Reflect.construct; - } else { - _construct = function _construct(Parent, args, Class) { - var a = [null]; - a.push.apply(a, args); - var Constructor = Function.bind.apply(Parent, a); - var instance = new Constructor(); - if (Class) _setPrototypeOf(instance, Class.prototype); - return instance; - }; - } - - return _construct.apply(null, arguments); -} - -function _isNativeFunction(fn) { - return Function.toString.call(fn).indexOf("[native code]") !== -1; -} - -function _wrapNativeSuper(Class) { - var _cache = typeof Map === "function" ? new Map() : undefined; - - _wrapNativeSuper = function _wrapNativeSuper(Class) { - if (Class === null || !_isNativeFunction(Class)) return Class; - - if (typeof Class !== "function") { - throw new TypeError("Super expression must either be null or a function"); - } - - if (typeof _cache !== "undefined") { - if (_cache.has(Class)) return _cache.get(Class); - - _cache.set(Class, Wrapper); - } - - function Wrapper() { - return _construct(Class, arguments, _getPrototypeOf(this).constructor); - } - - Wrapper.prototype = Object.create(Class.prototype, { - constructor: { - value: Wrapper, - enumerable: false, - writable: true, - configurable: true - } - }); - return _setPrototypeOf(Wrapper, Class); - }; - - return _wrapNativeSuper(Class); -} - -function _instanceof(left, right) { - if (right != null && typeof Symbol !== "undefined" && right[Symbol.hasInstance]) { - return !!right[Symbol.hasInstance](left); - } else { - return left instanceof right; - } -} - -function _interopRequireDefault(obj) { - return obj && obj.__esModule ? obj : { - default: obj - }; -} - -function _getRequireWildcardCache() { - if (typeof WeakMap !== "function") return null; - var cache = new WeakMap(); - - _getRequireWildcardCache = function () { - return cache; - }; - - return cache; -} - -function _interopRequireWildcard(obj) { - if (obj && obj.__esModule) { - return obj; - } - - if (obj === null || typeof obj !== "object" && typeof obj !== "function") { - return { - default: obj - }; - } - - var cache = _getRequireWildcardCache(); - - if (cache && cache.has(obj)) { - return cache.get(obj); - } - - var newObj = {}; - var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; - - for (var key in obj) { - if (Object.prototype.hasOwnProperty.call(obj, key)) { - var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; - - if (desc && (desc.get || desc.set)) { - Object.defineProperty(newObj, key, desc); - } else { - newObj[key] = obj[key]; - } - } - } - - newObj.default = obj; - - if (cache) { - cache.set(obj, newObj); - } - - return newObj; -} - -function _newArrowCheck(innerThis, boundThis) { - if (innerThis !== boundThis) { - throw new TypeError("Cannot instantiate an arrow function"); - } -} - -function _objectDestructuringEmpty(obj) { - if (obj == null) throw new TypeError("Cannot destructure undefined"); -} - -function _objectWithoutPropertiesLoose(source, excluded) { - if (source == null) return {}; - var target = {}; - var sourceKeys = Object.keys(source); - var key, i; - - for (i = 0; i < sourceKeys.length; i++) { - key = sourceKeys[i]; - if (excluded.indexOf(key) >= 0) continue; - target[key] = source[key]; - } - - return target; -} - -function _objectWithoutProperties(source, excluded) { - if (source == null) return {}; - - var target = _objectWithoutPropertiesLoose(source, excluded); - - var key, i; - - if (Object.getOwnPropertySymbols) { - var sourceSymbolKeys = Object.getOwnPropertySymbols(source); - - for (i = 0; i < sourceSymbolKeys.length; i++) { - key = sourceSymbolKeys[i]; - if (excluded.indexOf(key) >= 0) continue; - if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; - target[key] = source[key]; - } - } - - return target; -} - -function _assertThisInitialized(self) { - if (self === void 0) { - throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); - } - - return self; -} - -function _possibleConstructorReturn(self, call) { - if (call && (typeof call === "object" || typeof call === "function")) { - return call; - } - - return _assertThisInitialized(self); -} - -function _createSuper(Derived) { - var hasNativeReflectConstruct = _isNativeReflectConstruct(); - - return function _createSuperInternal() { - var Super = _getPrototypeOf(Derived), - result; - - if (hasNativeReflectConstruct) { - 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); - if (object === null) break; - } - - return object; -} - -function _get(target, property, receiver) { - if (typeof Reflect !== "undefined" && Reflect.get) { - _get = Reflect.get; - } else { - _get = function _get(target, property, receiver) { - var base = _superPropBase(target, property); - - if (!base) return; - var desc = Object.getOwnPropertyDescriptor(base, property); - - if (desc.get) { - return desc.get.call(receiver); - } - - return desc.value; - }; - } - - return _get(target, property, receiver || target); -} - -function set(target, property, value, receiver) { - if (typeof Reflect !== "undefined" && Reflect.set) { - set = Reflect.set; - } else { - set = function set(target, property, value, receiver) { - var base = _superPropBase(target, property); - - var desc; - - if (base) { - desc = Object.getOwnPropertyDescriptor(base, property); - - if (desc.set) { - desc.set.call(receiver, value); - return true; - } else if (!desc.writable) { - return false; - } - } - - desc = Object.getOwnPropertyDescriptor(receiver, property); - - if (desc) { - if (!desc.writable) { - return false; - } - - desc.value = value; - Object.defineProperty(receiver, property, desc); - } else { - _defineProperty(receiver, property, value); - } - - return true; - }; - } - - return set(target, property, value, receiver); -} - -function _set(target, property, value, receiver, isStrict) { - var s = set(target, property, value, receiver || target); - - if (!s && isStrict) { - throw new Error('failed to set property'); - } - - return value; -} - -function _taggedTemplateLiteral(strings, raw) { - if (!raw) { - raw = strings.slice(0); - } - - return Object.freeze(Object.defineProperties(strings, { - raw: { - value: Object.freeze(raw) - } - })); -} - -function _taggedTemplateLiteralLoose(strings, raw) { - if (!raw) { - raw = strings.slice(0); - } - - strings.raw = raw; - return strings; -} - -function _readOnlyError(name) { - throw new Error("\"" + name + "\" is read-only"); -} - -function _classNameTDZError(name) { - throw new Error("Class \"" + name + "\" cannot be referenced in computed property keys."); -} - -function _temporalUndefined() {} - -function _tdz(name) { - throw new ReferenceError(name + " is not defined - temporal dead zone"); -} - -function _temporalRef(val, name) { - return val === _temporalUndefined ? _tdz(name) : val; -} - -function _slicedToArray(arr, i) { - return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); -} - -function _slicedToArrayLoose(arr, i) { - return _arrayWithHoles(arr) || _iterableToArrayLimitLoose(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); -} - -function _toArray(arr) { - return _arrayWithHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableRest(); -} - -function _toConsumableArray(arr) { - return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); -} - -function _arrayWithoutHoles(arr) { - if (Array.isArray(arr)) return _arrayLikeToArray(arr); -} - -function _arrayWithHoles(arr) { - if (Array.isArray(arr)) return arr; -} - -function _maybeArrayLike(next, arr, i) { - if (arr && !Array.isArray(arr) && typeof arr.length === "number") { - var len = arr.length; - return _arrayLikeToArray(arr, i !== void 0 && i < len ? i : len); - } - - return next(arr, i); -} - -function _iterableToArray(iter) { - if (typeof Symbol !== "undefined" && Symbol.iterator in Object(iter)) return Array.from(iter); -} - -function _iterableToArrayLimit(arr, i) { - if (typeof Symbol === "undefined" || !(Symbol.iterator in Object(arr))) return; - var _arr = []; - var _n = true; - var _d = false; - var _e = undefined; - - try { - for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { - _arr.push(_s.value); - - if (i && _arr.length === i) break; - } - } catch (err) { - _d = true; - _e = err; - } finally { - try { - if (!_n && _i["return"] != null) _i["return"](); - } finally { - if (_d) throw _e; - } - } - - return _arr; -} - -function _iterableToArrayLimitLoose(arr, i) { - if (typeof Symbol === "undefined" || !(Symbol.iterator in Object(arr))) return; - var _arr = []; - - for (var _iterator = arr[Symbol.iterator](), _step; !(_step = _iterator.next()).done;) { - _arr.push(_step.value); - - if (i && _arr.length === i) break; - } - - 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(o); - 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.\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.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); -} - -function _createForOfIteratorHelper(o, allowArrayLike) { - var it; - - if (typeof Symbol === "undefined" || o[Symbol.iterator] == null) { - if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") { - if (it) o = it; - 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 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; - } - } - }; -} - -function _createForOfIteratorHelperLoose(o, allowArrayLike) { - var it; - - if (typeof Symbol === "undefined" || o[Symbol.iterator] == null) { - if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") { - if (it) o = it; - var i = 0; - return function () { - if (i >= o.length) return { - done: true - }; - return { - done: false, - value: o[i++] - }; - }; - } - - throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); - } - - it = o[Symbol.iterator](); - return it.next.bind(it); -} - -function _skipFirstGeneratorNext(fn) { - return function () { - var it = fn.apply(this, arguments); - it.next(); - return it; - }; -} - -function _toPrimitive(input, hint) { - if (typeof input !== "object" || input === null) return input; - var prim = input[Symbol.toPrimitive]; - - if (prim !== undefined) { - var res = prim.call(input, hint || "default"); - if (typeof res !== "object") return res; - throw new TypeError("@@toPrimitive must return a primitive value."); - } - - return (hint === "string" ? String : Number)(input); -} - -function _toPropertyKey(arg) { - var key = _toPrimitive(arg, "string"); - - return typeof key === "symbol" ? key : String(key); -} - -function _initializerWarningHelper(descriptor, context) { - throw new Error('Decorating class property failed. Please ensure that ' + 'proposal-class-properties is enabled and runs after the decorators transform.'); -} - -function _initializerDefineProperty(target, property, descriptor, context) { - if (!descriptor) return; - Object.defineProperty(target, property, { - enumerable: descriptor.enumerable, - configurable: descriptor.configurable, - writable: descriptor.writable, - value: descriptor.initializer ? descriptor.initializer.call(context) : void 0 - }); -} - -function _applyDecoratedDescriptor(target, property, decorators, descriptor, context) { - var desc = {}; - Object.keys(descriptor).forEach(function (key) { - desc[key] = descriptor[key]; - }); - desc.enumerable = !!desc.enumerable; - desc.configurable = !!desc.configurable; - - if ('value' in desc || desc.initializer) { - desc.writable = true; - } - - desc = decorators.slice().reverse().reduce(function (desc, decorator) { - return decorator(target, property, desc) || desc; - }, desc); - - if (context && desc.initializer !== void 0) { - desc.value = desc.initializer ? desc.initializer.call(context) : void 0; - desc.initializer = undefined; - } - - if (desc.initializer === void 0) { - Object.defineProperty(target, property, desc); - desc = null; - } - - return desc; -} - -var id = 0; - -function _classPrivateFieldLooseKey(name) { - return "__private_" + id++ + "_" + name; -} - -function _classPrivateFieldLooseBase(receiver, privateKey) { - if (!Object.prototype.hasOwnProperty.call(receiver, privateKey)) { - throw new TypeError("attempted to use private field on non-instance"); - } - - return receiver; -} - -function _classPrivateFieldGet(receiver, privateMap) { - var descriptor = privateMap.get(receiver); - - if (!descriptor) { - throw new TypeError("attempted to get private field on non-instance"); - } - - if (descriptor.get) { - return descriptor.get.call(receiver); - } - - return descriptor.value; -} - -function _classPrivateFieldSet(receiver, privateMap, value) { - var descriptor = privateMap.get(receiver); - - if (!descriptor) { - throw new TypeError("attempted to set private field on non-instance"); - } - - if (descriptor.set) { - descriptor.set.call(receiver, value); - } else { - if (!descriptor.writable) { - throw new TypeError("attempted to set read only private field"); - } - - descriptor.value = value; - } - - return value; -} - -function _classPrivateFieldDestructureSet(receiver, privateMap) { - if (!privateMap.has(receiver)) { - throw new TypeError("attempted to set private field on non-instance"); - } - - var descriptor = privateMap.get(receiver); - - if (descriptor.set) { - if (!("__destrObj" in descriptor)) { - descriptor.__destrObj = { - set value(v) { - descriptor.set.call(receiver, v); - } - - }; - } - - return descriptor.__destrObj; - } else { - if (!descriptor.writable) { - throw new TypeError("attempted to set read only private field"); - } - - return descriptor; - } -} - -function _classStaticPrivateFieldSpecGet(receiver, classConstructor, descriptor) { - if (receiver !== classConstructor) { - throw new TypeError("Private static access of wrong provenance"); - } - - if (descriptor.get) { - return descriptor.get.call(receiver); - } - - return descriptor.value; -} - -function _classStaticPrivateFieldSpecSet(receiver, classConstructor, descriptor, value) { - if (receiver !== classConstructor) { - throw new TypeError("Private static access of wrong provenance"); - } - - if (descriptor.set) { - descriptor.set.call(receiver, value); - } else { - if (!descriptor.writable) { - throw new TypeError("attempted to set read only private field"); - } - - descriptor.value = value; - } - - return value; -} - -function _classStaticPrivateMethodGet(receiver, classConstructor, method) { - if (receiver !== classConstructor) { - throw new TypeError("Private static access of wrong provenance"); - } - - return method; -} - -function _classStaticPrivateMethodSet() { - throw new TypeError("attempted to set read only static private field"); -} - -function _decorate(decorators, factory, superClass, mixins) { - var api = _getDecoratorsApi(); - - if (mixins) { - for (var i = 0; i < mixins.length; i++) { - api = mixins[i](api); - } - } - - var r = factory(function initialize(O) { - api.initializeInstanceElements(O, decorated.elements); - }, superClass); - var decorated = api.decorateClass(_coalesceClassElements(r.d.map(_createElementDescriptor)), decorators); - api.initializeClassElements(r.F, decorated.elements); - return api.runClassFinishers(r.F, decorated.finishers); -} - -function _getDecoratorsApi() { - _getDecoratorsApi = function () { - return api; - }; - - var api = { - elementsDefinitionOrder: [["method"], ["field"]], - initializeInstanceElements: function (O, elements) { - ["method", "field"].forEach(function (kind) { - elements.forEach(function (element) { - if (element.kind === kind && element.placement === "own") { - this.defineClassElement(O, element); - } - }, this); - }, this); - }, - initializeClassElements: function (F, elements) { - var proto = F.prototype; - ["method", "field"].forEach(function (kind) { - elements.forEach(function (element) { - var placement = element.placement; - - if (element.kind === kind && (placement === "static" || placement === "prototype")) { - var receiver = placement === "static" ? F : proto; - this.defineClassElement(receiver, element); - } - }, this); - }, this); - }, - defineClassElement: function (receiver, element) { - var descriptor = element.descriptor; - - if (element.kind === "field") { - var initializer = element.initializer; - descriptor = { - enumerable: descriptor.enumerable, - writable: descriptor.writable, - configurable: descriptor.configurable, - value: initializer === void 0 ? void 0 : initializer.call(receiver) - }; - } - - Object.defineProperty(receiver, element.key, descriptor); - }, - decorateClass: function (elements, decorators) { - var newElements = []; - var finishers = []; - var placements = { - static: [], - prototype: [], - own: [] - }; - elements.forEach(function (element) { - this.addElementPlacement(element, placements); - }, this); - elements.forEach(function (element) { - if (!_hasDecorators(element)) return newElements.push(element); - var elementFinishersExtras = this.decorateElement(element, placements); - newElements.push(elementFinishersExtras.element); - newElements.push.apply(newElements, elementFinishersExtras.extras); - finishers.push.apply(finishers, elementFinishersExtras.finishers); - }, this); - - if (!decorators) { - return { - elements: newElements, - finishers: finishers - }; - } - - var result = this.decorateConstructor(newElements, decorators); - finishers.push.apply(finishers, result.finishers); - result.finishers = finishers; - return result; - }, - addElementPlacement: function (element, placements, silent) { - var keys = placements[element.placement]; - - if (!silent && keys.indexOf(element.key) !== -1) { - throw new TypeError("Duplicated element (" + element.key + ")"); - } - - keys.push(element.key); - }, - decorateElement: function (element, placements) { - var extras = []; - var finishers = []; - - for (var decorators = element.decorators, i = decorators.length - 1; i >= 0; i--) { - var keys = placements[element.placement]; - keys.splice(keys.indexOf(element.key), 1); - var elementObject = this.fromElementDescriptor(element); - var elementFinisherExtras = this.toElementFinisherExtras((0, decorators[i])(elementObject) || elementObject); - element = elementFinisherExtras.element; - this.addElementPlacement(element, placements); - - if (elementFinisherExtras.finisher) { - finishers.push(elementFinisherExtras.finisher); - } - - var newExtras = elementFinisherExtras.extras; - - if (newExtras) { - for (var j = 0; j < newExtras.length; j++) { - this.addElementPlacement(newExtras[j], placements); - } - - extras.push.apply(extras, newExtras); - } - } - - return { - element: element, - finishers: finishers, - extras: extras - }; - }, - decorateConstructor: function (elements, decorators) { - var finishers = []; - - for (var i = decorators.length - 1; i >= 0; i--) { - var obj = this.fromClassDescriptor(elements); - var elementsAndFinisher = this.toClassDescriptor((0, decorators[i])(obj) || obj); - - if (elementsAndFinisher.finisher !== undefined) { - finishers.push(elementsAndFinisher.finisher); - } - - if (elementsAndFinisher.elements !== undefined) { - elements = elementsAndFinisher.elements; - - for (var j = 0; j < elements.length - 1; j++) { - for (var k = j + 1; k < elements.length; k++) { - if (elements[j].key === elements[k].key && elements[j].placement === elements[k].placement) { - throw new TypeError("Duplicated element (" + elements[j].key + ")"); - } - } - } - } - } - - return { - elements: elements, - finishers: finishers - }; - }, - fromElementDescriptor: function (element) { - var obj = { - kind: element.kind, - key: element.key, - placement: element.placement, - descriptor: element.descriptor - }; - var desc = { - value: "Descriptor", - configurable: true - }; - Object.defineProperty(obj, Symbol.toStringTag, desc); - if (element.kind === "field") obj.initializer = element.initializer; - return obj; - }, - toElementDescriptors: function (elementObjects) { - if (elementObjects === undefined) return; - return _toArray(elementObjects).map(function (elementObject) { - var element = this.toElementDescriptor(elementObject); - this.disallowProperty(elementObject, "finisher", "An element descriptor"); - this.disallowProperty(elementObject, "extras", "An element descriptor"); - return element; - }, this); - }, - toElementDescriptor: function (elementObject) { - var kind = String(elementObject.kind); - - if (kind !== "method" && kind !== "field") { - throw new TypeError('An element descriptor\'s .kind property must be either "method" or' + ' "field", but a decorator created an element descriptor with' + ' .kind "' + kind + '"'); - } - - var key = _toPropertyKey(elementObject.key); - - var placement = String(elementObject.placement); - - if (placement !== "static" && placement !== "prototype" && placement !== "own") { - throw new TypeError('An element descriptor\'s .placement property must be one of "static",' + ' "prototype" or "own", but a decorator created an element descriptor' + ' with .placement "' + placement + '"'); - } - - var descriptor = elementObject.descriptor; - this.disallowProperty(elementObject, "elements", "An element descriptor"); - var element = { - kind: kind, - key: key, - placement: placement, - descriptor: Object.assign({}, descriptor) - }; - - if (kind !== "field") { - this.disallowProperty(elementObject, "initializer", "A method descriptor"); - } else { - this.disallowProperty(descriptor, "get", "The property descriptor of a field descriptor"); - this.disallowProperty(descriptor, "set", "The property descriptor of a field descriptor"); - this.disallowProperty(descriptor, "value", "The property descriptor of a field descriptor"); - element.initializer = elementObject.initializer; - } - - return element; - }, - toElementFinisherExtras: function (elementObject) { - var element = this.toElementDescriptor(elementObject); - - var finisher = _optionalCallableProperty(elementObject, "finisher"); - - var extras = this.toElementDescriptors(elementObject.extras); - return { - element: element, - finisher: finisher, - extras: extras - }; - }, - fromClassDescriptor: function (elements) { - var obj = { - kind: "class", - elements: elements.map(this.fromElementDescriptor, this) - }; - var desc = { - value: "Descriptor", - configurable: true - }; - Object.defineProperty(obj, Symbol.toStringTag, desc); - return obj; - }, - toClassDescriptor: function (obj) { - var kind = String(obj.kind); - - if (kind !== "class") { - throw new TypeError('A class descriptor\'s .kind property must be "class", but a decorator' + ' created a class descriptor with .kind "' + kind + '"'); - } - - this.disallowProperty(obj, "key", "A class descriptor"); - this.disallowProperty(obj, "placement", "A class descriptor"); - this.disallowProperty(obj, "descriptor", "A class descriptor"); - this.disallowProperty(obj, "initializer", "A class descriptor"); - this.disallowProperty(obj, "extras", "A class descriptor"); - - var finisher = _optionalCallableProperty(obj, "finisher"); - - var elements = this.toElementDescriptors(obj.elements); - return { - elements: elements, - finisher: finisher - }; - }, - runClassFinishers: function (constructor, finishers) { - for (var i = 0; i < finishers.length; i++) { - var newConstructor = (0, finishers[i])(constructor); - - if (newConstructor !== undefined) { - if (typeof newConstructor !== "function") { - throw new TypeError("Finishers must return a constructor."); - } - - constructor = newConstructor; - } - } - - return constructor; - }, - disallowProperty: function (obj, name, objectType) { - if (obj[name] !== undefined) { - throw new TypeError(objectType + " can't have a ." + name + " property."); - } - } - }; - return api; -} - -function _createElementDescriptor(def) { - var key = _toPropertyKey(def.key); - - var descriptor; - - if (def.kind === "method") { - descriptor = { - value: def.value, - writable: true, - configurable: true, - enumerable: false - }; - } else if (def.kind === "get") { - descriptor = { - get: def.value, - configurable: true, - enumerable: false - }; - } else if (def.kind === "set") { - descriptor = { - set: def.value, - configurable: true, - enumerable: false - }; - } else if (def.kind === "field") { - descriptor = { - configurable: true, - writable: true, - enumerable: true - }; - } - - var element = { - kind: def.kind === "field" ? "field" : "method", - key: key, - placement: def.static ? "static" : def.kind === "field" ? "own" : "prototype", - descriptor: descriptor - }; - if (def.decorators) element.decorators = def.decorators; - if (def.kind === "field") element.initializer = def.value; - return element; -} - -function _coalesceGetterSetter(element, other) { - if (element.descriptor.get !== undefined) { - other.descriptor.get = element.descriptor.get; - } else { - other.descriptor.set = element.descriptor.set; - } -} - -function _coalesceClassElements(elements) { - var newElements = []; - - var isSameElement = function (other) { - return other.kind === "method" && other.key === element.key && other.placement === element.placement; - }; - - for (var i = 0; i < elements.length; i++) { - var element = elements[i]; - var other; - - if (element.kind === "method" && (other = newElements.find(isSameElement))) { - if (_isDataDescriptor(element.descriptor) || _isDataDescriptor(other.descriptor)) { - if (_hasDecorators(element) || _hasDecorators(other)) { - throw new ReferenceError("Duplicated methods (" + element.key + ") can't be decorated."); - } - - other.descriptor = element.descriptor; - } else { - if (_hasDecorators(element)) { - if (_hasDecorators(other)) { - throw new ReferenceError("Decorators can't be placed on different accessors with for " + "the same property (" + element.key + ")."); - } - - other.decorators = element.decorators; - } - - _coalesceGetterSetter(element, other); - } - } else { - newElements.push(element); - } - } - - return newElements; -} - -function _hasDecorators(element) { - return element.decorators && element.decorators.length; -} - -function _isDataDescriptor(desc) { - return desc !== undefined && !(desc.value === undefined && desc.writable === undefined); -} - -function _optionalCallableProperty(obj, name) { - var value = obj[name]; - - if (value !== undefined && typeof value !== "function") { - throw new TypeError("Expected '" + name + "' to be a function"); - } - - return value; -} - -function _classPrivateMethodGet(receiver, privateSet, fn) { - if (!privateSet.has(receiver)) { - throw new TypeError("attempted to get private field on non-instance"); - } - - return fn; -} - -function _classPrivateMethodSet() { - throw new TypeError("attempted to reassign private method"); -} - -function _wrapRegExp(re, groups) { - _wrapRegExp = function (re, groups) { - return new BabelRegExp(re, undefined, groups); - }; - - var _RegExp = _wrapNativeSuper(RegExp); - - var _super = RegExp.prototype; - - var _groups = new WeakMap(); - - function BabelRegExp(re, flags, groups) { - var _this = _RegExp.call(this, re, flags); - - _groups.set(_this, groups || _groups.get(re)); - - return _this; - } - - _inherits(BabelRegExp, _RegExp); - - BabelRegExp.prototype.exec = function (str) { - var result = _super.exec.call(this, str); - - if (result) result.groups = buildGroups(result, this); - return result; - }; - - BabelRegExp.prototype[Symbol.replace] = function (str, substitution) { - if (typeof substitution === "string") { - var groups = _groups.get(this); - - return _super[Symbol.replace].call(this, str, substitution.replace(/\$<([^>]+)>/g, function (_, name) { - return "$" + groups[name]; - })); - } else if (typeof substitution === "function") { - var _this = this; - - return _super[Symbol.replace].call(this, str, function () { - var args = []; - args.push.apply(args, arguments); - - if (typeof args[args.length - 1] !== "object") { - args.push(buildGroups(args, _this)); - } - - return substitution.apply(this, args); - }); - } else { - return _super[Symbol.replace].call(this, str, substitution); - } - }; - - function buildGroups(result, re) { - var g = _groups.get(re); - - return Object.keys(g).reduce(function (groups, name) { - groups[name] = result[g[name]]; - return groups; - }, Object.create(null)); - } - - return _wrapRegExp.apply(this, arguments); -} - +function _typeof(e){return(_typeof="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})(e)}function _AwaitValue(e){this.wrapped=e}function _AsyncGenerator(e){var t,r;function resume(t,r){try{var n=e[t](r),o=n.value,i=o instanceof _AwaitValue;Promise.resolve(i?o.wrapped:o).then((function(e){i?resume("return"===t?"return":"next",e):settle(n.done?"return":"normal",e)}),(function(e){resume("throw",e)}))}catch(e){settle("throw",e)}}function settle(e,n){switch(e){case"return":t.resolve({value:n,done:!0});break;case"throw":t.reject(n);break;default:t.resolve({value:n,done:!1})}(t=t.next)?resume(t.key,t.arg):r=null}this._invoke=function send(e,n){return new Promise((function(o,i){var a={key:e,arg:n,resolve:o,reject:i,next:null};r?r=r.next=a:(t=r=a,resume(e,n))}))},"function"!=typeof e.return&&(this.return=void 0)}function asyncGeneratorStep(e,t,r,n,o,i,a){try{var s=e[i](a),c=s.value}catch(e){return void r(e)}s.done?t(c):Promise.resolve(c).then(n,o)}function _asyncToGenerator(e){return function(){var t=this,r=arguments;return new Promise((function(n,o){var i=e.apply(t,r);function _next(e){asyncGeneratorStep(i,n,o,_next,_throw,"next",e)}function _throw(e){asyncGeneratorStep(i,n,o,_next,_throw,"throw",e)}_next(void 0)}))}}"function"==typeof Symbol&&Symbol.asyncIterator&&(_AsyncGenerator.prototype[Symbol.asyncIterator]=function(){return this}),_AsyncGenerator.prototype.next=function(e){return this._invoke("next",e)},_AsyncGenerator.prototype.throw=function(e){return this._invoke("throw",e)},_AsyncGenerator.prototype.return=function(e){return this._invoke("return",e)}; /** * @file ext-imagelib.js * @@ -1654,522 +7,5 @@ function _wrapRegExp(re, groups) { * @copyright 2010 Alexis Deveria * */ -var extImagelib = { - name: 'imagelib', - init: function init(_ref) { - var _this = this; - - return _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee2() { - var $, decode64, importLocale, dropXMLInternalSubset, imagelibStrings, modularVersion, svgEditor, uiStrings, svgCanvas, 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 _showBrowser() { - var browser = $('#imgbrowse'); - - if (!browser.length) { - $('
' + '
').insertAfter('#svg_docprops'); - browser = $('#imgbrowse'); - var allLibs = imagelibStrings.select_lib; - var libOpts = $('