diff --git a/cypress/support/index.js b/cypress/support/index.js index 26ed7696..8d1916eb 100644 --- a/cypress/support/index.js +++ b/cypress/support/index.js @@ -32,13 +32,13 @@ import './commands.js'; import '@cypress/fiddle'; /** - * COVERAGE + * COVERAGE. * @see https://docs.cypress.io/guides/tooling/code-coverage.html#Install-the-plugin */ import '@cypress/code-coverage/support.js'; /** - * ACCESSIBILITY + * ACCESSIBILITY. * @see https://www.npmjs.com/package/cypress-axe */ import 'cypress-axe'; diff --git a/dist/canvg.js b/dist/canvg.js index 3501af4f..82fe0517 100644 --- a/dist/canvg.js +++ b/dist/canvg.js @@ -243,7 +243,7 @@ var canvg = (function (exports) { } /** - * For parsing color values + * For parsing color values. * @module RGBColor * @author Stoyan Stefanov * @see https://www.phpied.com/rgb-color-parser-in-javascript/ diff --git a/dist/extensions/ext-arrows.js b/dist/extensions/ext-arrows.js index 01cebaf8..70193c19 100644 --- a/dist/extensions/ext-arrows.js +++ b/dist/extensions/ext-arrows.js @@ -38,7 +38,7 @@ var svgEditorExtension_arrows = (function () { } /** - * ext-arrows.js + * @file ext-arrows.js * * @license MIT * diff --git a/dist/extensions/ext-closepath.js b/dist/extensions/ext-closepath.js index 92f67eb3..12d1cf25 100644 --- a/dist/extensions/ext-closepath.js +++ b/dist/extensions/ext-closepath.js @@ -38,7 +38,7 @@ var svgEditorExtension_closepath = (function () { } /** - * ext-closepath.js + * @file ext-closepath.js * * @license MIT * diff --git a/dist/extensions/ext-connector.js b/dist/extensions/ext-connector.js index 31ad0ffb..6991dcb3 100644 --- a/dist/extensions/ext-connector.js +++ b/dist/extensions/ext-connector.js @@ -40,7 +40,7 @@ var svgEditorExtension_connector = (function () { /* eslint-disable unicorn/no-fn-reference-in-iterator */ /** - * ext-connector.js + * @file ext-connector.js * * @license MIT * diff --git a/dist/extensions/ext-eyedropper.js b/dist/extensions/ext-eyedropper.js index 00bb20bb..b7ff5919 100644 --- a/dist/extensions/ext-eyedropper.js +++ b/dist/extensions/ext-eyedropper.js @@ -38,7 +38,7 @@ var svgEditorExtension_eyedropper = (function () { } /** - * ext-eyedropper.js + * @file ext-eyedropper.js * * @license MIT * diff --git a/dist/extensions/ext-foreignobject.js b/dist/extensions/ext-foreignobject.js index 0c45de8f..87ac57c9 100644 --- a/dist/extensions/ext-foreignobject.js +++ b/dist/extensions/ext-foreignobject.js @@ -38,7 +38,7 @@ var svgEditorExtension_foreignobject = (function () { } /** - * ext-foreignobject.js + * @file ext-foreignobject.js * * @license Apache-2.0 * diff --git a/dist/extensions/ext-grid.js b/dist/extensions/ext-grid.js index def6145b..ea8987c2 100644 --- a/dist/extensions/ext-grid.js +++ b/dist/extensions/ext-grid.js @@ -38,7 +38,7 @@ var svgEditorExtension_grid = (function () { } /** - * ext-grid.js + * @file ext-grid.js * * @license Apache-2.0 * diff --git a/dist/extensions/ext-helloworld.js b/dist/extensions/ext-helloworld.js index 8f04bc97..d16c9607 100644 --- a/dist/extensions/ext-helloworld.js +++ b/dist/extensions/ext-helloworld.js @@ -80,7 +80,7 @@ var svgEditorExtension_helloworld = (function () { } /** - * ext-helloworld.js + * @file ext-helloworld.js * * @license MIT * diff --git a/dist/extensions/ext-imagelib.js b/dist/extensions/ext-imagelib.js index f3a5c70e..3fef1e35 100644 --- a/dist/extensions/ext-imagelib.js +++ b/dist/extensions/ext-imagelib.js @@ -52,7 +52,7 @@ var svgEditorExtension_imagelib = (function () { } /** - * ext-imagelib.js + * @file ext-imagelib.js * * @license MIT * diff --git a/dist/extensions/ext-markers.js b/dist/extensions/ext-markers.js index 8dcce917..707b2aa9 100644 --- a/dist/extensions/ext-markers.js +++ b/dist/extensions/ext-markers.js @@ -38,7 +38,7 @@ var svgEditorExtension_markers = (function () { } /** - * ext-markers.js + * @file ext-markers.js * * @license Apache-2.0 * diff --git a/dist/extensions/ext-overview_window.js b/dist/extensions/ext-overview_window.js index 6f0504ae..c5e50a11 100644 --- a/dist/extensions/ext-overview_window.js +++ b/dist/extensions/ext-overview_window.js @@ -2,7 +2,7 @@ var svgEditorExtension_overview_window = (function () { 'use strict'; /** - * ext-overview_window.js + * @file ext-overview_window.js * * @license MIT * diff --git a/dist/extensions/ext-panning.js b/dist/extensions/ext-panning.js index 7ea9eb9c..b4026216 100644 --- a/dist/extensions/ext-panning.js +++ b/dist/extensions/ext-panning.js @@ -38,7 +38,7 @@ var svgEditorExtension_panning = (function () { } /** - * ext-panning.js + * @file ext-panning.js * * @license MIT * diff --git a/dist/extensions/ext-placemark.js b/dist/extensions/ext-placemark.js index 033e51f0..52cf38ee 100644 --- a/dist/extensions/ext-placemark.js +++ b/dist/extensions/ext-placemark.js @@ -80,7 +80,7 @@ var svgEditorExtension_placemark = (function () { } /** - * ext-placemark.js + * @file ext-placemark.js * * * @copyright 2010 CloudCanvas, Inc. All rights reserved diff --git a/dist/extensions/ext-polygon.js b/dist/extensions/ext-polygon.js index a35990a9..d028dd6d 100644 --- a/dist/extensions/ext-polygon.js +++ b/dist/extensions/ext-polygon.js @@ -38,7 +38,7 @@ var svgEditorExtension_polygon = (function () { } /** - * ext-polygon.js + * @file ext-polygon.js * * * @copyright 2010 CloudCanvas, Inc. All rights reserved diff --git a/dist/extensions/ext-server_moinsave.js b/dist/extensions/ext-server_moinsave.js index 2fe15581..1b529df5 100644 --- a/dist/extensions/ext-server_moinsave.js +++ b/dist/extensions/ext-server_moinsave.js @@ -243,7 +243,7 @@ var svgEditorExtension_server_moinsave = (function () { } /** - * For parsing color values + * For parsing color values. * @module RGBColor * @author Stoyan Stefanov * @see https://www.phpied.com/rgb-color-parser-in-javascript/ diff --git a/dist/extensions/ext-server_opensave.js b/dist/extensions/ext-server_opensave.js index 9f7a8c96..6db60b20 100644 --- a/dist/extensions/ext-server_opensave.js +++ b/dist/extensions/ext-server_opensave.js @@ -243,7 +243,7 @@ var svgEditorExtension_server_opensave = (function () { } /** - * For parsing color values + * For parsing color values. * @module RGBColor * @author Stoyan Stefanov * @see https://www.phpied.com/rgb-color-parser-in-javascript/ diff --git a/dist/extensions/ext-shapes.js b/dist/extensions/ext-shapes.js index dd7b1195..d631a206 100644 --- a/dist/extensions/ext-shapes.js +++ b/dist/extensions/ext-shapes.js @@ -80,7 +80,7 @@ var svgEditorExtension_shapes = (function () { } /** - * ext-shapes.js + * @file ext-shapes.js * * @license MIT * diff --git a/dist/extensions/ext-star.js b/dist/extensions/ext-star.js index 531249b4..61827807 100644 --- a/dist/extensions/ext-star.js +++ b/dist/extensions/ext-star.js @@ -38,7 +38,7 @@ var svgEditorExtension_star = (function () { } /** - * ext-star.js + * @file ext-star.js * * * @copyright 2010 CloudCanvas, Inc. All rights reserved diff --git a/dist/extensions/ext-storage.js b/dist/extensions/ext-storage.js index da4031a6..c7ebeaf1 100644 --- a/dist/extensions/ext-storage.js +++ b/dist/extensions/ext-storage.js @@ -80,7 +80,7 @@ var svgEditorExtension_storage = (function () { } /** - * ext-storage.js + * @file ext-storage.js * * This extension allows automatic saving of the SVG canvas contents upon * page unload (which can later be automatically retrieved upon future diff --git a/dist/extensions/ext-webappfind.js b/dist/extensions/ext-webappfind.js index 91646e56..0ebd6281 100644 --- a/dist/extensions/ext-webappfind.js +++ b/dist/extensions/ext-webappfind.js @@ -38,7 +38,8 @@ var svgEditorExtension_webappfind = (function () { } /** - * Depends on Firefox add-on and executables from {@link https://github.com/brettz9/webappfind} + * Depends on Firefox add-on and executables from + * {@link https://github.com/brettz9/webappfind}. * @author Brett Zamir * @license MIT * @todo See WebAppFind Readme for SVG-related todos diff --git a/dist/extensions/ext-xdomain-messaging.js b/dist/extensions/ext-xdomain-messaging.js index 2a87969e..f63e53e7 100644 --- a/dist/extensions/ext-xdomain-messaging.js +++ b/dist/extensions/ext-xdomain-messaging.js @@ -38,7 +38,7 @@ var svgEditorExtension_xdomain_messaging = (function () { /** * Should not be needed for same domain control (just call via child frame), * but an API common for cross-domain and same domain use can be found - * in embedapi.js with a demo at embedapi.html + * in embedapi.js with a demo at embedapi.html. */ var extXdomainMessaging = { name: 'xdomain-messaging', diff --git a/dist/index-es.js b/dist/index-es.js index 2d00e526..996fdd76 100644 --- a/dist/index-es.js +++ b/dist/index-es.js @@ -266,13 +266,13 @@ document.addEventListener('touchend', touchHandler, true); document.addEventListener('touchcancel', touchHandler, true); /** - * Namespaces or tools therefor + * Namespaces or tools therefor. * @module namespaces * @license MIT */ /** -* Common namepaces constants in alpha order +* Common namepaces constants in alpha order. * @enum {string} * @type {PlainObject} * @memberof module:namespaces @@ -2903,7 +2903,7 @@ var supportsNativeTransformLists = function supportsNativeTransformLists() { }; /** - * jQuery module to work with SVG attributes + * A jQuery module to work with SVG attributes. * @module jQueryAttr * @license MIT */ @@ -3073,14 +3073,14 @@ var listMap_ = {}; */ /** -* (DOES NOT THROW DOMException, INDEX_SIZE_ERR) +* DOES NOT THROW DOMException, INDEX_SIZE_ERR. * @function module:SVGTransformList.SVGEditTransformList#getItem * @param {Integer} index unsigned long * @returns {SVGTransform} */ /** -* (DOES NOT THROW DOMException, INDEX_SIZE_ERR) +* DOES NOT THROW DOMException, INDEX_SIZE_ERR. * @function module:SVGTransformList.SVGEditTransformList#insertItemBefore * @param {SVGTransform} newItem * @param {Integer} index unsigned long @@ -3088,7 +3088,7 @@ var listMap_ = {}; */ /** -* (DOES NOT THROW DOMException, INDEX_SIZE_ERR) +* DOES NOT THROW DOMException, INDEX_SIZE_ERR. * @function module:SVGTransformList.SVGEditTransformList#replaceItem * @param {SVGTransform} newItem * @param {Integer} index unsigned long @@ -3096,7 +3096,7 @@ var listMap_ = {}; */ /** -* (DOES NOT THROW DOMException, INDEX_SIZE_ERR) +* DOES NOT THROW DOMException, INDEX_SIZE_ERR. * @function module:SVGTransformList.SVGEditTransformList#removeItem * @param {Integer} index unsigned long * @returns {SVGTransform} @@ -3109,7 +3109,7 @@ var listMap_ = {}; */ /** -* NOT IMPLEMENTED +* NOT IMPLEMENTED. * @ignore * @function module:SVGTransformList.SVGEditTransformList#createSVGTransformFromMatrix * @param {SVGMatrix} matrix @@ -3117,7 +3117,7 @@ var listMap_ = {}; */ /** -* NOT IMPLEMENTED +* NOT IMPLEMENTED. * @ignore * @function module:SVGTransformList.SVGEditTransformList#consolidate * @returns {SVGTransform} @@ -3469,7 +3469,7 @@ var getTransformList = function getTransformList(elem) { }; /** - * Tools for working with units + * Tools for working with units. * @module units * @license MIT * @@ -3573,7 +3573,7 @@ var init = function init(elementContainer) { }; }; /** -* Group: Unit conversion functions +* Group: Unit conversion functions. */ /** @@ -3755,7 +3755,7 @@ var isValidUnit = function isValidUnit(attr, val, selectedElement) { }; /** -* Group: Undo/Redo history management +* Group: Undo/Redo history management. */ var HistoryEventTypes = { @@ -3798,7 +3798,7 @@ function () { */ /** - * Applies + * Applies. * * @function module:history.HistoryCommand#apply * @param {module:history.HistoryEventHandler} handler @@ -3808,7 +3808,7 @@ function () { /** * - * Unapplies + * Unapplies. * @function module:history.HistoryCommand#unapply * @param {module:history.HistoryEventHandler} handler * @fires module:history~Command#event:history @@ -3816,25 +3816,25 @@ function () { */ /** - * Returns the elements + * Returns the elements. * @function module:history.HistoryCommand#elements * @returns {Element[]} */ /** - * Gets the text + * Gets the text. * @function module:history.HistoryCommand#getText * @returns {string} */ /** - * Gives the type + * Gives the type. * @function module:history.HistoryCommand.type * @returns {string} */ /** - * Gives the type + * Gives the type. * @function module:history.HistoryCommand#type * @returns {string} */ @@ -4663,7 +4663,7 @@ var hstry = /*#__PURE__*/Object.freeze({ }); /** - * Mathematical utilities + * Mathematical utilities. * @module math * @license MIT * @@ -4959,7 +4959,7 @@ var editorContext_ = null; */ /** -* Object with the following keys/values +* Object with the following keys/values. * @typedef {PlainObject} module:path.SVGElementJSON * @property {string} element - Tag name of the SVG element to create * @property {PlainObject} attr - Has key-value attributes to assign to the new element. An `id` should be set so that {@link module:utilities.EditorContext#addSVGElementFromJson} can later re-identify the element for modification or replacement. @@ -4988,7 +4988,7 @@ var editorContext_ = null; */ /** - * Note: This doesn't round to an integer necessarily + * Note: This doesn't round to an integer necessarily. * @function module:path.EditorContext#round * @param {Float} val * @returns {Float} Rounded value to nearest value based on `currentZoom` @@ -5086,19 +5086,19 @@ var editorContext_ = null; */ /** - * Returns the last created DOM element ID string + * Returns the last created DOM element ID string. * @function module:path.EditorContext#getId * @returns {string} */ /** - * Creates and returns a unique ID string for a DOM element + * Creates and returns a unique ID string for a DOM element. * @function module:path.EditorContext#getNextId * @returns {string} */ /** - * Gets the desired element from a mouse event + * Gets the desired element from a mouse event. * @function module:path.EditorContext#getMouseTarget * @param {external:MouseEvent} evt - Event object from the mouse event * @returns {Element} DOM element we want @@ -6549,7 +6549,7 @@ var reorientGrads = function reorientGrads(elem, m) { } }; /** -* This is how we map paths to our preferred relative segment types +* This is how we map paths to our preferred relative segment types. * @name module:path.pathMap * @type {GenericArray} */ @@ -6805,8 +6805,8 @@ function pathDSegment(letter, points, morePoints, lastPoint) { /* eslint-disable jsdoc/require-property */ /** -* Group: Path edit functions -* Functions relating to editing path elements +* Group: Path edit functions. +* Functions relating to editing path elements. * @namespace {PlainObject} pathActions * @memberof module:path */ @@ -7793,7 +7793,7 @@ var pathActions = function () { // Can't seem to use `@borrows` here, so using `@see` /** - * Smooth polyline into path + * Smooth polyline into path. * @function module:path.pathActions.smoothPolylineIntoPath * @see module:path~smoothPolylineIntoPath */ @@ -7871,7 +7871,7 @@ var pathActions = function () { // Can't seem to use `@borrows` here, so using `@see` /** - * Convert a path to one with only absolute or relative values + * Convert a path to one with only absolute or relative values. * @function module:path.pathActions.convertPath * @see module:path.convertPath */ @@ -7892,7 +7892,7 @@ var domdoc_ = null; var domcontainer_ = null; var svgroot_ = null; /** -* Object with the following keys/values +* Object with the following keys/values. * @typedef {PlainObject} module:utilities.SVGElementJSON * @property {string} element - Tag name of the SVG element to create * @property {PlainObject} attr - Has key-value attributes to assign to the new element. An `id` should be set so that {@link module:utilities.EditorContext#addSVGElementFromJson} can later re-identify the element for modification or replacement. @@ -7916,7 +7916,7 @@ var svgroot_ = null; /** * Create a new SVG element based on the given object keys/values and add it * to the current layer. - * The element will be run through `cleanupElement` before being returned + * The element will be run through `cleanupElement` before being returned. * @function module:utilities.EditorContext#addSVGElementFromJson * @param {module:utilities.SVGElementJSON} data * @returns {Element} The new element @@ -9313,7 +9313,7 @@ var isNullish = function isNullish(val) { /* globals jQuery */ /** - * Adds context menu functionality + * Adds context menu functionality. * @module contextmenu * @license Apache-2.0 * @author Adam Bender @@ -11071,7 +11071,7 @@ var randomizeIds = function randomizeIds(enableRandomization, currentDrawing) { }; // Layer API Functions /** -* Group: Layers +* Group: Layers. */ /** @@ -11119,7 +11119,7 @@ var randomizeIds = function randomizeIds(enableRandomization, currentDrawing) { */ /** - * Run the callback function associated with the given event + * Run the callback function associated with the given event. * @function module:draw.DrawCanvasInit#call * @param {"changed"|"contextset"} ev - String with the event name * @param {module:svgcanvas.SvgCanvas#event:changed|module:svgcanvas.SvgCanvas#event:contextset} arg - Argument to pass through to the callback @@ -11443,7 +11443,7 @@ var REVERSE_NS = getReverseNS(); // Todo: Split out into core attributes, presen /** * This defines which elements and attributes that we support (or at least - * don't remove) + * don't remove). * @type {PlainObject} */ @@ -13654,7 +13654,7 @@ function SvgCanvas(container, config) { var svgroot = svgdoc.importNode(text2xml('' + '' + '' + '' + '' + '' + '' + '' + '' + '' + '' + '').documentElement, true); container.append(svgroot); /** - * The actual element that represents the final output SVG element + * The actual element that represents the final output SVG element. * @name module:svgcanvas~svgcontent * @type {SVGSVGElement} */ @@ -13699,7 +13699,7 @@ function SvgCanvas(container, config) { idprefix = p; }; /** - * Current draw.Drawing object + * Current `draw.Drawing` object. * @type {module:draw.Drawing} * @name module:svgcanvas.SvgCanvas#current_drawing_ */ @@ -13716,7 +13716,7 @@ function SvgCanvas(container, config) { return canvas.current_drawing_; }; /** - * Float displaying the current zoom level (1 = 100%, .5 = 50%, etc) + * Float displaying the current zoom level (1 = 100%, .5 = 50%, etc.). * @type {Float} */ @@ -13852,8 +13852,8 @@ function SvgCanvas(container, config) { return curConfig.baseUnit; }; /** - * initialize from units.js. - * Send in an object implementing the ElementContainer interface (see units.js) + * Initialize from units.js. + * Send in an object implementing the ElementContainer interface (see units.js). */ @@ -14085,7 +14085,7 @@ function SvgCanvas(container, config) { init$6(curConfig, /** - * Export to select.js + * Export to select.js. * @implements {module:select.SVGFactory} */ { @@ -14101,7 +14101,7 @@ function SvgCanvas(container, config) { getCurrentZoom: getCurrentZoom }); /** - * This object manages selectors for us + * This object manages selectors for us. * @name module:svgcanvas.SvgCanvas#selectorManager * @type {module:select.SelectorManager} */ @@ -14918,26 +14918,26 @@ function SvgCanvas(container, config) { var events = {}; canvas.call = call; /** - * Array of what was changed (elements, layers) + * Array of what was changed (elements, layers). * @event module:svgcanvas.SvgCanvas#event:changed * @type {Element[]} */ /** - * Array of selected elements + * Array of selected elements. * @event module:svgcanvas.SvgCanvas#event:selected * @type {Element[]} */ /** - * Array of selected elements + * Array of selected elements. * @event module:svgcanvas.SvgCanvas#event:transition * @type {Element[]} */ /** * The Element is always `SVGGElement`? - * If not `null`, will be the set current group element + * If not `null`, will be the set current group element. * @event module:svgcanvas.SvgCanvas#event:contextset * @type {null|Element} */ @@ -14998,7 +14998,7 @@ function SvgCanvas(container, config) { */ /** - * SVG canvas converted to string + * SVG canvas converted to string. * @event module:svgcanvas.SvgCanvas#event:saved * @type {string} */ @@ -15042,7 +15042,7 @@ function SvgCanvas(container, config) { /** * The promise return, if present, resolves to `undefined` - * (`extension_added`, `exported`, `saved`) + * (`extension_added`, `exported`, `saved`). * @typedef {Promise|void} module:svgcanvas.EventHandlerReturn */ @@ -15221,7 +15221,7 @@ function SvgCanvas(container, config) { var rootSctm = null; /** - * Group: Selection + * Group: Selection. */ // TODO: do we need to worry about selectedBBoxes here? @@ -15788,7 +15788,7 @@ function SvgCanvas(container, config) { break; } /** - * The main (left) mouse button is held down on the canvas area + * The main (left) mouse button is held down on the canvas area. * @event module:svgcanvas.SvgCanvas#event:ext_mouseDown * @type {PlainObject} * @property {MouseEvent} event The event object @@ -16331,7 +16331,7 @@ function SvgCanvas(container, config) { } } /** - * The mouse has moved on the canvas area + * The mouse has moved on the canvas area. * @event module:svgcanvas.SvgCanvas#event:ext_mouseMove * @type {PlainObject} * @property {MouseEvent} event The event object @@ -16648,7 +16648,7 @@ function SvgCanvas(container, config) { } } /** - * The main (left) mouse button is released (anywhere) + * The main (left) mouse button is released (anywhere). * @event module:svgcanvas.SvgCanvas#event:ext_mouseUp * @type {PlainObject} * @property {MouseEvent} event The event object @@ -16881,7 +16881,7 @@ function SvgCanvas(container, config) { /** * Group: Text edit functions - * Functions relating to editing text elements + * Functions relating to editing text elements. * @namespace {PlainObject} textActions * @memberof module:svgcanvas.SvgCanvas# */ @@ -17406,7 +17406,7 @@ function SvgCanvas(container, config) { ); }(); /** - * Group: Serialization + * Group: Serialization. */ /** @@ -17749,7 +17749,7 @@ function SvgCanvas(container, config) { }; // end svgToString() /** - * Function to run when image data is found + * Function to run when image data is found. * @callback module:svgcanvas.ImageEmbeddedCallback * @param {string|false} result Data URL * @returns {void} @@ -18922,7 +18922,7 @@ function SvgCanvas(container, config) { } }); /** - * Group: Document functions + * Group: Document functions. */ /** @@ -19389,7 +19389,7 @@ function SvgCanvas(container, config) { */ /** - * The bottom panel was updated + * The bottom panel was updated. * @event module:svgcanvas.SvgCanvas#event:ext_toolButtonStateUpdate * @type {PlainObject} * @property {boolean} nofill Indicates fill is disabled @@ -19397,7 +19397,7 @@ function SvgCanvas(container, config) { */ /** - * The element selection has changed (elements were added/removed from selection) + * The element selection has changed (elements were added/removed from selection). * @event module:svgcanvas.SvgCanvas#event:ext_selectedChanged * @type {PlainObject} * @property {Element[]} elems Array of the newly selected elements @@ -19414,14 +19414,14 @@ function SvgCanvas(container, config) { */ /** - * One or more elements were changed + * One or more elements were changed. * @event module:svgcanvas.SvgCanvas#event:ext_elementChanged * @type {PlainObject} * @property {Element[]} elems Array of the affected elements */ /** - * Invoked as soon as the locale is ready + * Invoked as soon as the locale is ready. * @event module:svgcanvas.SvgCanvas#event:ext_langReady * @type {PlainObject} * @property {string} lang The two-letter language code @@ -19444,13 +19444,13 @@ function SvgCanvas(container, config) { */ /** - * Called when new image is created + * Called when new image is created. * @event module:svgcanvas.SvgCanvas#event:ext_onNewDocument * @type {void} */ /** - * Called when sidepanel is resized or toggled + * Called when sidepanel is resized or toggled. * @event module:svgcanvas.SvgCanvas#event:ext_workareaResized * @type {void} */ @@ -19511,7 +19511,7 @@ function SvgCanvas(container, config) { currentMode = name; }; /** - * Group: Element Styling + * Group: Element Styling. */ /** @@ -20384,7 +20384,7 @@ function SvgCanvas(container, config) { canvas.ungroupSelectedElement(); }; /** - * Group: Element manipulation + * Group: Element manipulation. */ /** @@ -20733,7 +20733,7 @@ function SvgCanvas(container, config) { clipb.forEach(checkIDs); // Give extensions like the connector extension a chance to reflect new IDs and remove invalid elements /** - * Triggered when `pasteElements` is called from a paste action (context menu or key) + * Triggered when `pasteElements` is called from a paste action (context menu or key). * @event module:svgcanvas.SvgCanvas#event:ext_IDsUpdated * @type {PlainObject} * @property {module:svgcanvas.SVGAsJSON[]} elems @@ -21537,7 +21537,7 @@ function SvgCanvas(container, config) { this.moveSelectedElements(dx, dy); }; /** - * Group: Additional editor tools + * Group: Additional editor tools. */ /** @@ -22314,7 +22314,7 @@ function jQueryPluginBBQ (jQuery) { // Todo: Move to own module (and have it import a modular base64 encoder) /** - * SVG Icon Loader 2.0 + * @file SVG Icon Loader 2.0 * * jQuery Plugin for loading SVG icons from a single file * @@ -22475,13 +22475,13 @@ function jQueryPluginSVGIcons($) { var svgIcons = {}; /** * Map of raster images with each key being the SVG icon ID - * to replace, and the value the image file name + * to replace, and the value the image file name. * @typedef {PlainObject} external:jQuery.svgIcons.Fallback */ /** * Map of raster images with each key being the SVG icon ID - * whose `alt` will be set, and the value being the `alt` text + * whose `alt` will be set, and the value being the `alt` text. * @typedef {PlainObject} external:jQuery.svgIcons.Alts */ @@ -22896,7 +22896,7 @@ function jQueryPluginSVGIcons($) { } /** - * jGraduate 0.4 + * @file jGraduate 0.4 * * jQuery Plugin for a gradient picker * @@ -22995,14 +22995,14 @@ function jQueryPluginJGraduate($) { */ this.type = options.copy.type; /** - * Represents opacity (0-100) + * Represents opacity (0-100). * @name module:jGraduate~Paint#alpha * @type {Float} */ this.alpha = options.copy.alpha; /** - * Represents #RRGGBB hex of color + * Represents #RRGGBB hex of color. * @name module:jGraduate~Paint#solidColor * @type {string} */ @@ -23088,7 +23088,7 @@ function jQueryPluginJGraduate($) { /** @lends external:jQuery.fn.jGraduateDefaults */ { /** - * Creates an object with a 'none' color + * Creates an object with a 'none' color. * @type {external:jQuery.jGraduate.Paint} * @see module:jGraduate.Options */ @@ -24187,55 +24187,57 @@ function jQueryPluginJGraduate($) { } /** - * SpinButton control + * SpinButton control. * * Adds bells and whistles to any ordinary textbox to * make it look and feel like a SpinButton Control. * - * Supplies {@link external:jQuery.fn.SpinButton} (and also {@link external:jQuery.loadingStylesheets}) + * Supplies {@link external:jQuery.fn.SpinButton} (and also {@link external:jQuery.loadingStylesheets}). * - * Originally written by George Adamson, Software Unity (george.jquery@softwareunity.com) August 2006. - * - Added min/max options - * - Added step size option - * - Added bigStep (page up/down) option + * Originally written by George Adamson, Software Unity (george.jquery@softwareunity.com) August 2006: + * - Added min/max options. + * - Added step size option. + * - Added bigStep (page up/down) option. * * Modifications made by Mark Gibson, (mgibson@designlinks.net) September 2006: - * - Converted to jQuery plugin - * - Allow limited or unlimited min/max values - * - Allow custom class names, and add class to input element - * - Removed global vars - * - Reset (to original or through config) when invalid value entered - * - Repeat whilst holding mouse button down (with initial pause, like keyboard repeat) - * - Support mouse wheel in Firefox - * - Fix double click in IE - * - Refactored some code and renamed some vars + * - Converted to jQuery plugin. + * - Allow limited or unlimited min/max values. + * - Allow custom class names, and add class to input element. + * - Removed global vars. + * - Reset (to original or through config) when invalid value entered. + * - Repeat whilst holding mouse button down (with initial pause, like keyboard repeat). + * - Support mouse wheel in Firefox. + * - Fix double click in IE. + * - Refactored some code and renamed some vars. * * Modifications by Jeff Schiller, June 2009: * - provide callback function for when the value changes based on the following - * {@link https://www.mail-archive.com/jquery-en@googlegroups.com/msg36070.html} + * {@link https://www.mail-archive.com/jquery-en@googlegroups.com/msg36070.html}. * * Modifications by Jeff Schiller, July 2009: - * - improve styling for widget in Opera - * - consistent key-repeat handling cross-browser + * - improve styling for widget in Opera. + * - consistent key-repeat handling cross-browser. * * Modifications by Alexis Deveria, October 2009: - * - provide "stepfunc" callback option to allow custom function to run when changing a value + * - provide "stepfunc" callback option to allow custom function to run when changing a value. * - Made adjustValue(0) only run on certain keyup events, not all. * - * Tested in IE6, Opera9, Firefox 1.5 + * Tested in IE6, Opera9, Firefox 1.5. * - * | Version | Date | Author | Notes - * |---------|------|--------|------| - * | v1.0 | 11 Aug 2006 | George Adamson | First release - * | v1.1 | Aug 2006 | George Adamson | Minor enhancements - * | v1.2 | 27 Sep 2006 | Mark Gibson | Major enhancements - * | v1.3a | 28 Sep 2006 | George Adamson | Minor enhancements - * | v1.4 | 18 Jun 2009 | Jeff Schiller | Added callback function - * | v1.5 | 06 Jul 2009 | Jeff Schiller | Fixes for Opera. - * | v1.6 | 13 Oct 2009 | Alexis Deveria | Added stepfunc function - * | v1.7 | 21 Oct 2009 | Alexis Deveria | Minor fixes.
Fast-repeat for keys and live updating as you type. - * | v1.8 | 12 Jan 2010 | Benjamin Thomas | Fixes for mouseout behavior.
Added smallStep + * | Version | Date | Author | Notes | + * |---------|------|--------|-------| + * | v1.0 | 11 Aug 2006 | George Adamson | First release | + * | v1.1 | Aug 2006 | George Adamson | Minor enhancements | + * | v1.2 | 27 Sep 2006 | Mark Gibson | Major enhancements | + * | v1.3a | 28 Sep 2006 | George Adamson | Minor enhancements | + * | v1.4 | 18 Jun 2009 | Jeff Schiller | Added callback function | + * | v1.5 | 06 Jul 2009 | Jeff Schiller | Fixes for Opera. | + * | v1.6 | 13 Oct 2009 | Alexis Deveria | Added stepfunc function | + * | v1.7 | 21 Oct 2009 | Alexis Deveria | Minor fixes.
Fast-repeat for keys and live updating as you type. | + * | v1.8 | 12 Jan 2010 | Benjamin Thomas | Fixes for mouseout behavior.
Added smallStep | * | v1.9 | 20 May 2018 | Brett Zamir | Avoid SVGEdit dependency via `stateObj` config;
convert to ES6 module | + * . + * * @module jQuerySpinButton * @example // Create group of settings to initialise spinbutton(s). (Optional) @@ -24557,7 +24559,7 @@ function jQueryPluginSpinButton($) { } /** - * jQuery Context Menu Plugin + * @file jQuery Context Menu Plugin * Cory S.N. LaViska * A Beautiful Site ({@link https://abeautifulsite.net/}) * Modified by Alexis Deveria @@ -24889,7 +24891,7 @@ function jQueryContextMenu($) { /* eslint-disable no-bitwise */ /** - * jPicker (Adapted from version 1.1.6) + * @file jPicker (Adapted from version 1.1.6) * * jQuery Plugin for Photoshop style color picker * @@ -25751,7 +25753,7 @@ var jPicker = function jPicker($) { /* eslint-enable jsdoc/require-property */ /** - * Array holding references to each active instance of the jPicker control + * Array holding references to each active instance of the jPicker control. * @type {external:jQuery.fn.$.fn.jPicker[]} */ List: [], @@ -26145,7 +26147,7 @@ var jPicker = function jPicker($) { }, /** - * color conversion methods - make public to give use to external scripts + * Color conversion methods - make public to give use to external scripts. * @namespace */ ColorMethods: { @@ -26380,7 +26382,7 @@ var jPicker = function jPicker($) { */ /** - * Will be bound to active {@link jQuery.jPicker.Color} + * Will be bound to active {@link jQuery.jPicker.Color}. * @callback module:jPicker.LiveCallback * @param {external:jQuery} ui * @param {Element} context @@ -27819,8 +27821,8 @@ var jPicker = function jPicker($) { */ /** - * jPicker defaults - you can change anything in this section (such as the - * clientPath to your images) without fear of breaking the program + * The jPicker defaults - you can change anything in this section (such as the + * clientPath to your images) without fear of breaking the program. * @namespace {external:jQuery.fn.jPickerOptions} defaults * @memberof external:jQuery.fn.$.fn.jPicker * @borrows external:jQuery.fn.jPickerOptions as external:jQuery.fn.jPicker.defaults @@ -28294,7 +28296,7 @@ var setStrings = function setStrings(type, obj, ids) { }; /** * The "data" property is generally set to an an array of objects with -* "id" and "title" or "textContent" properties +* "id" and "title" or "textContent" properties. * @typedef {PlainObject} module:locale.AddLangExtensionLocaleData * @property {module:locale.LocaleStrings[]} data See {@tutorial LocaleDocs} */ @@ -28814,7 +28816,7 @@ function loadStylesheets(stylesheets) { } /** -* The main module for the visual SVG Editor +* The main module for the visual SVG Editor. * * @license MIT * @@ -28894,7 +28896,7 @@ var callbacks = [], */ /** -* Preferences +* Preferences. * @interface module:SVGEditor.Prefs * @property {string} [lang="en"] Two-letter language code. The language must exist in the Editor Preferences language list. Defaults to "en" if `locale.js` detection does not detect another language. * @property {module:SVGEditor.IconSize} [iconsize="s"|"m"] Size of the toolbar icons. Will default to 's' if the window height is smaller than the minimum height and 'm' otherwise. @@ -28918,13 +28920,13 @@ defaultPrefs = // EDITOR OPTIONS (DIALOG) /** - * Default to "en" if locale.js detection does not detect another language + * Default to "en" if locale.js detection does not detect another language. */ lang: '', /** - * Will default to 's' if the window height is smaller than the minimum height and - * 'm' otherwise + * Will default to 's' if the window height is smaller than the minimum + * height and 'm' otherwise. */ iconsize: '', bkgd_color: '#FFF', @@ -29092,7 +29094,7 @@ defaultConfig = { }, /** -* LOCALE +* LOCALE. * @name module:SVGEditor.uiStrings * @type {PlainObject} */ @@ -29265,7 +29267,7 @@ function getImportLocale(_ref) { ); } /** -* EXPORTS +* EXPORTS. */ /** @@ -29451,7 +29453,7 @@ editor.setConfig = function (opts, cfgCfg) { editor.curConfig = curConfig; // Update exported value }; /** -* All methods are optional +* All methods are optional. * @interface module:SVGEditor.CustomHandler * @type {PlainObject} */ @@ -29470,7 +29472,7 @@ editor.setConfig = function (opts, cfgCfg) { * Its responsibilities are: * - accept the string contents of the current document * - invoke a file chooser dialog in 'save' mode -* - save the file to location chosen by the user +* - save the file to location chosen by the user. * @function module:SVGEditor.CustomHandler#save * @param {external:Window} win * @param {module:svgcanvas.SvgCanvas#event:saved} svgStr A string of the SVG @@ -33209,7 +33211,7 @@ editor.init = function () { // TODO: Group UI functions into a public editor.ui interface. /** - * See {@link http://api.jquery.com/bind/#bind-eventType-eventData-handler} + * See {@link http://api.jquery.com/bind/#bind-eventType-eventData-handler}. * @callback module:SVGEditor.DropDownCallback * @param {external:jQuery.Event} ev See {@link http://api.jquery.com/Types/#Event} * @listens external:jQuery.Event @@ -35261,7 +35263,7 @@ editor.init = function () { /* eslint-disable jsdoc/require-property */ /** - * Associate all button actions as well as non-button keyboard shortcuts + * Associate all button actions as well as non-button keyboard shortcuts. * @namespace {PlainObject} module:SVGEditor~Actions */ diff --git a/dist/index-es.min.js b/dist/index-es.min.js index 7b3f668c..2e2db2b0 100644 --- a/dist/index-es.min.js +++ b/dist/index-es.min.js @@ -1,18 +1,18 @@ function e(t){return(e="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(t)}function t(e,t,n,r,a,i,o){try{var s=e[i](o),l=s.value}catch(e){return void n(e)}s.done?t(l):Promise.resolve(l).then(r,a)}function n(e){return function(){var n=this,r=arguments;return new Promise((function(a,i){var o=e.apply(n,r);function s(e){t(o,a,i,s,l,"next",e)}function l(e){t(o,a,i,s,l,"throw",e)}s(void 0)}))}}function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function a(e,t){for(var n=0;nt.getTotalLength())break;n--}while(n>0);return n}),window.SVGPathSeg=e,window.SVGPathSegClosePath=t,window.SVGPathSegMovetoAbs=n,window.SVGPathSegMovetoRel=a,window.SVGPathSegLinetoAbs=o,window.SVGPathSegLinetoRel=c,window.SVGPathSegCurvetoCubicAbs=d,window.SVGPathSegCurvetoCubicRel=h,window.SVGPathSegCurvetoQuadraticAbs=f,window.SVGPathSegCurvetoQuadraticRel=p,window.SVGPathSegArcAbs=g,window.SVGPathSegArcRel=m,window.SVGPathSegLinetoHorizontalAbs=v,window.SVGPathSegLinetoHorizontalRel=y,window.SVGPathSegLinetoVerticalAbs=_,window.SVGPathSegLinetoVerticalRel=b,window.SVGPathSegCurvetoCubicSmoothAbs=x,window.SVGPathSegCurvetoCubicSmoothRel=w,window.SVGPathSegCurvetoQuadraticSmoothAbs=S,window.SVGPathSegCurvetoQuadraticSmoothRel=k}if(!("SVGPathSegList"in window&&"appendItem"in window.SVGPathSegList.prototype)){var C=function(){function e(t){r(this,e),this._pathElement=t,this._list=this._parsePath(this._pathElement.getAttribute("d")),this._mutationObserverConfig={attributes:!0,attributeFilter:["d"]},this._pathElementMutationObserver=new MutationObserver(this._updateListFromPathMutations.bind(this)),this._pathElementMutationObserver.observe(this._pathElement,this._mutationObserverConfig)}return i(e,[{key:"_checkPathSynchronizedToList",value:function(){this._updateListFromPathMutations(this._pathElementMutationObserver.takeRecords())}},{key:"_updateListFromPathMutations",value:function(e){if(this._pathElement){var t=!1;e.forEach((function(e){"d"===e.attributeName&&(t=!0)})),t&&(this._list=this._parsePath(this._pathElement.getAttribute("d")))}}},{key:"_writeListToPath",value:function(){this._pathElementMutationObserver.disconnect(),this._pathElement.setAttribute("d",e._pathSegArrayAsString(this._list)),this._pathElementMutationObserver.observe(this._pathElement,this._mutationObserverConfig)}},{key:"segmentChanged",value:function(e){this._writeListToPath()}},{key:"clear",value:function(){this._checkPathSynchronizedToList(),this._list.forEach((function(e){e._owningPathSegList=null})),this._list=[],this._writeListToPath()}},{key:"initialize",value:function(e){return this._checkPathSynchronizedToList(),this._list=[e],e._owningPathSegList=this,this._writeListToPath(),e}},{key:"_checkValidIndex",value:function(e){if(isNaN(e)||e<0||e>=this.numberOfItems)throw new Error("INDEX_SIZE_ERR")}},{key:"getItem",value:function(e){return this._checkPathSynchronizedToList(),this._checkValidIndex(e),this._list[e]}},{key:"insertItemBefore",value:function(e,t){return this._checkPathSynchronizedToList(),t>this.numberOfItems&&(t=this.numberOfItems),e._owningPathSegList&&(e=e.clone()),this._list.splice(t,0,e),e._owningPathSegList=this,this._writeListToPath(),e}},{key:"replaceItem",value:function(e,t){return this._checkPathSynchronizedToList(),e._owningPathSegList&&(e=e.clone()),this._checkValidIndex(t),this._list[t]=e,e._owningPathSegList=this,this._writeListToPath(),e}},{key:"removeItem",value:function(e){this._checkPathSynchronizedToList(),this._checkValidIndex(e);var t=this._list[e];return this._list.splice(e,1),this._writeListToPath(),t}},{key:"appendItem",value:function(e){return this._checkPathSynchronizedToList(),e._owningPathSegList&&(e=e.clone()),this._list.push(e),e._owningPathSegList=this,this._writeListToPath(),e}},{key:"_parsePath",value:function(e){if(!e||!e.length)return[];var t=this,n=function(){function e(){r(this,e),this.pathSegList=[]}return i(e,[{key:"appendSegment",value:function(e){this.pathSegList.push(e)}}]),e}(),a=function(){function e(t){r(this,e),this._string=t,this._currentIndex=0,this._endIndex=this._string.length,this._previousCommand=SVGPathSeg.PATHSEG_UNKNOWN,this._skipOptionalSpaces()}return i(e,[{key:"_isCurrentSpace",value:function(){var e=this._string[this._currentIndex];return e<=" "&&(" "===e||"\n"===e||"\t"===e||"\r"===e||"\f"===e)}},{key:"_skipOptionalSpaces",value:function(){for(;this._currentIndex="0"&&e<="9")&&t!==SVGPathSeg.PATHSEG_CLOSEPATH?t===SVGPathSeg.PATHSEG_MOVETO_ABS?SVGPathSeg.PATHSEG_LINETO_ABS:t===SVGPathSeg.PATHSEG_MOVETO_REL?SVGPathSeg.PATHSEG_LINETO_REL:t:SVGPathSeg.PATHSEG_UNKNOWN}},{key:"initialCommandIsMoveTo",value:function(){if(!this.hasMoreData())return!0;var e=this.peekSegmentType();return e===SVGPathSeg.PATHSEG_MOVETO_ABS||e===SVGPathSeg.PATHSEG_MOVETO_REL}},{key:"_parseNumber",value:function(){var e=0,t=0,n=1,r=0,a=1,i=1,o=this._currentIndex;if(this._skipOptionalSpaces(),this._currentIndex"9")&&"."!==this._string.charAt(this._currentIndex))){for(var s=this._currentIndex;this._currentIndex="0"&&this._string.charAt(this._currentIndex)<="9";)this._currentIndex++;if(this._currentIndex!==s)for(var l=this._currentIndex-1,c=1;l>=s;)t+=c*(this._string.charAt(l--)-"0"),c*=10;if(this._currentIndex=this._endIndex||this._string.charAt(this._currentIndex)<"0"||this._string.charAt(this._currentIndex)>"9")return;for(;this._currentIndex="0"&&this._string.charAt(this._currentIndex)<="9";)n*=10,r+=(this._string.charAt(this._currentIndex)-"0")/n,this._currentIndex+=1}if(this._currentIndex!==o&&this._currentIndex+1=this._endIndex||this._string.charAt(this._currentIndex)<"0"||this._string.charAt(this._currentIndex)>"9")return;for(;this._currentIndex="0"&&this._string.charAt(this._currentIndex)<="9";)e*=10,e+=this._string.charAt(this._currentIndex)-"0",this._currentIndex++}var u=t+r;if(u*=a,e&&(u*=Math.pow(10,i*e)),o!==this._currentIndex)return this._skipOptionalSpacesOrDelimiter(),u}}},{key:"_parseArcFlag",value:function(){if(!(this._currentIndex>=this._endIndex)){var e=!1,t=this._string.charAt(this._currentIndex++);if("0"===t)e=!1;else{if("1"!==t)return;e=!0}return this._skipOptionalSpacesOrDelimiter(),e}}},{key:"parseSegment",value:function(){var e=this._string[this._currentIndex],n=this._pathSegTypeFromChar(e);if(n===SVGPathSeg.PATHSEG_UNKNOWN){if(this._previousCommand===SVGPathSeg.PATHSEG_UNKNOWN)return null;if((n=this._nextCommandHelper(e,this._previousCommand))===SVGPathSeg.PATHSEG_UNKNOWN)return null}else this._currentIndex++;switch(this._previousCommand=n,n){case SVGPathSeg.PATHSEG_MOVETO_REL:return new SVGPathSegMovetoRel(t,this._parseNumber(),this._parseNumber());case SVGPathSeg.PATHSEG_MOVETO_ABS:return new SVGPathSegMovetoAbs(t,this._parseNumber(),this._parseNumber());case SVGPathSeg.PATHSEG_LINETO_REL:return new SVGPathSegLinetoRel(t,this._parseNumber(),this._parseNumber());case SVGPathSeg.PATHSEG_LINETO_ABS:return new SVGPathSegLinetoAbs(t,this._parseNumber(),this._parseNumber());case SVGPathSeg.PATHSEG_LINETO_HORIZONTAL_REL:return new SVGPathSegLinetoHorizontalRel(t,this._parseNumber());case SVGPathSeg.PATHSEG_LINETO_HORIZONTAL_ABS:return new SVGPathSegLinetoHorizontalAbs(t,this._parseNumber());case SVGPathSeg.PATHSEG_LINETO_VERTICAL_REL:return new SVGPathSegLinetoVerticalRel(t,this._parseNumber());case SVGPathSeg.PATHSEG_LINETO_VERTICAL_ABS:return new SVGPathSegLinetoVerticalAbs(t,this._parseNumber());case SVGPathSeg.PATHSEG_CLOSEPATH:return this._skipOptionalSpaces(),new SVGPathSegClosePath(t);case SVGPathSeg.PATHSEG_CURVETO_CUBIC_REL:var r={x1:this._parseNumber(),y1:this._parseNumber(),x2:this._parseNumber(),y2:this._parseNumber(),x:this._parseNumber(),y:this._parseNumber()};return new SVGPathSegCurvetoCubicRel(t,r.x,r.y,r.x1,r.y1,r.x2,r.y2);case SVGPathSeg.PATHSEG_CURVETO_CUBIC_ABS:var a={x1:this._parseNumber(),y1:this._parseNumber(),x2:this._parseNumber(),y2:this._parseNumber(),x:this._parseNumber(),y:this._parseNumber()};return new SVGPathSegCurvetoCubicAbs(t,a.x,a.y,a.x1,a.y1,a.x2,a.y2);case SVGPathSeg.PATHSEG_CURVETO_CUBIC_SMOOTH_REL:var i={x2:this._parseNumber(),y2:this._parseNumber(),x:this._parseNumber(),y:this._parseNumber()};return new SVGPathSegCurvetoCubicSmoothRel(t,i.x,i.y,i.x2,i.y2);case SVGPathSeg.PATHSEG_CURVETO_CUBIC_SMOOTH_ABS:var o={x2:this._parseNumber(),y2:this._parseNumber(),x:this._parseNumber(),y:this._parseNumber()};return new SVGPathSegCurvetoCubicSmoothAbs(t,o.x,o.y,o.x2,o.y2);case SVGPathSeg.PATHSEG_CURVETO_QUADRATIC_REL:var s={x1:this._parseNumber(),y1:this._parseNumber(),x:this._parseNumber(),y:this._parseNumber()};return new SVGPathSegCurvetoQuadraticRel(t,s.x,s.y,s.x1,s.y1);case SVGPathSeg.PATHSEG_CURVETO_QUADRATIC_ABS:var l={x1:this._parseNumber(),y1:this._parseNumber(),x:this._parseNumber(),y:this._parseNumber()};return new SVGPathSegCurvetoQuadraticAbs(t,l.x,l.y,l.x1,l.y1);case SVGPathSeg.PATHSEG_CURVETO_QUADRATIC_SMOOTH_REL:return new SVGPathSegCurvetoQuadraticSmoothRel(t,this._parseNumber(),this._parseNumber());case SVGPathSeg.PATHSEG_CURVETO_QUADRATIC_SMOOTH_ABS:return new SVGPathSegCurvetoQuadraticSmoothAbs(t,this._parseNumber(),this._parseNumber());case SVGPathSeg.PATHSEG_ARC_REL:var c={x1:this._parseNumber(),y1:this._parseNumber(),arcAngle:this._parseNumber(),arcLarge:this._parseArcFlag(),arcSweep:this._parseArcFlag(),x:this._parseNumber(),y:this._parseNumber()};return new SVGPathSegArcRel(t,c.x,c.y,c.x1,c.y1,c.arcAngle,c.arcLarge,c.arcSweep);case SVGPathSeg.PATHSEG_ARC_ABS:var u={x1:this._parseNumber(),y1:this._parseNumber(),arcAngle:this._parseNumber(),arcLarge:this._parseArcFlag(),arcSweep:this._parseArcFlag(),x:this._parseNumber(),y:this._parseNumber()};return new SVGPathSegArcAbs(t,u.x,u.y,u.x1,u.y1,u.arcAngle,u.arcLarge,u.arcSweep);default:throw new Error("Unknown path seg type.")}}}]),e}(),o=new n,s=new a(e);if(!s.initialCommandIsMoveTo())return[];for(;s.hasMoreData();){var l=s.parseSegment();if(!l)return[];o.appendSegment(l)}return o.pathSegList}}],[{key:"_pathSegArrayAsString",value:function(e){var t="",n=!0;return e.forEach((function(e){n?(n=!1,t+=e._asPathString()):t+=" "+e._asPathString()})),t}}]),e}();C.prototype.classname="SVGPathSegList",Object.defineProperty(C.prototype,"numberOfItems",{get:function(){return this._checkPathSynchronizedToList(),this._list.length},enumerable:!0}),Object.defineProperties(SVGPathElement.prototype,{pathSegList:{get:function(){return this._pathSegList||(this._pathSegList=new C(this)),this._pathSegList},enumerable:!0},normalizedPathSegList:{get:function(){return this.pathSegList},enumerable:!0},animatedPathSegList:{get:function(){return this.pathSegList},enumerable:!0},animatedNormalizedPathSegList:{get:function(){return this.pathSegList},enumerable:!0}}),window.SVGPathSegList=C}}();var m,v=jQuery,y=(Boolean(document.createElementNS&&document.createElementNS(p.SVG,"svg").createSVGRect),navigator.userAgent),_=document.createElementNS(p.SVG,"svg"),b=Boolean(window.opera),x=y.includes("AppleWebKit"),w=y.includes("Gecko/"),S=y.includes("MSIE"),k=y.includes("Chrome/"),C=(y.includes("Windows"),y.includes("Macintosh")),A="ontouchstart"in window,E=Boolean(_.querySelector),G=Boolean(document.evaluate),P=function(){var e=document.createElementNS(p.SVG,"path");e.setAttribute("d","M0,0 10,10");var t=e.pathSegList,n=e.createSVGPathSegLinetoAbs(5,5);try{return t.replaceItem(n,1),!0}catch(e){}return!1}(),I=function(){var e=document.createElementNS(p.SVG,"path");e.setAttribute("d","M0,0 10,10");var t=e.pathSegList,n=e.createSVGPathSegLinetoAbs(5,5);try{return t.insertItemBefore(n,1),!0}catch(e){}return!1}(),N=function(){var e=document.createElementNS(p.SVG,"svg"),t=document.createElementNS(p.SVG,"svg");document.documentElement.append(e),t.setAttribute("x",5),e.append(t);var n=document.createElementNS(p.SVG,"text");n.textContent="a",t.append(n);try{return 0===n.getStartPositionOfChar(0).x}catch(e){return!1}finally{e.remove()}}(),T=function(){var e=document.createElementNS(p.SVG,"svg");document.documentElement.append(e);var t=document.createElementNS(p.SVG,"path");t.setAttribute("d","M0,0 C0,0 10,10 10,0"),e.append(t);var n=t.getBBox();return e.remove(),n.height>4&&n.height<5}(),L=function(){var e=document.createElementNS(p.SVG,"svg");document.documentElement.append(e);var t=document.createElementNS(p.SVG,"path");t.setAttribute("d","M0,0 10,0");var n=document.createElementNS(p.SVG,"path");n.setAttribute("d","M5,0 15,0");var r=document.createElementNS(p.SVG,"g");r.append(t,n),e.append(r);var a=r.getBBox();return e.remove(),15===a.width}(),M=(function(){var e=document.createElementNS(p.SVG,"rect");e.setAttribute("x",.1);var t=!e.cloneNode(!1).getAttribute("x").includes(",");t||v.alert('NOTE: This version of Opera is known to contain bugs in SVG-edit.\nPlease upgrade to the latest version in which the problems have been fixed.')}(),(m=document.createElementNS(p.SVG,"rect")).setAttribute("style","vector-effect:non-scaling-stroke"),"non-scaling-stroke"===m.style.vectorEffect),O=function(){var t=document.createElementNS(p.SVG,"rect").transform.baseVal,n=_.createSVGTransform();t.appendItem(n);var r=t.getItem(0),a=function(t){return t&&"object"===e(t)&&"function"==typeof t.setMatrix&&"angle"in t};return a(r)&&a(n)&&r.type===n.type&&r.angle===n.angle&&r.matrix.a===n.matrix.a&&r.matrix.b===n.matrix.b&&r.matrix.c===n.matrix.c&&r.matrix.d===n.matrix.d&&r.matrix.e===n.matrix.e&&r.matrix.f===n.matrix.f}(),j=function(){return b},V=function(){return x},R=function(){return w},B=function(){return S},D=function(){return k},U=function(){return C},F=function(){return A},H=function(){return L},z=function(){return M}; /** - * jQuery module to work with SVG attributes + * A jQuery module to work with SVG attributes. * @module jQueryAttr * @license MIT */ function q(t){var n=t.fn.attr;return t.fn.attr=function(t,r){var a=this.length;if(!a)return n.call(this,t,r);for(var i=0;i=0)return this._xforms[e];var t=new Error("DOMException with code=INDEX_SIZE_ERR");throw t.code=1,t}},{key:"insertItemBefore",value:function(e,t){var n=null;if(t>=0)if(t=0&&(this._removeFromOtherLists(e),this._xforms[t]=e,n=e,this._list._update()),n}},{key:"removeItem",value:function(e){if(e=0){var t,n=this._xforms[e],r=new Array(this.numberOfItems-1);for(t=0;t=0;t--)this.stack[t].unapply(e);e&&e.handleHistoryEvent(ce.AFTER_UNAPPLY,this)}},{key:"elements",value:function(){for(var e=[],t=this.stack.length;t--;)for(var n=this.stack[t].elements(),r=n.length;r--;)e.includes(n[r])||e.push(n[r]);return e}},{key:"addSubCommand",value:function(e){this.stack.push(e)}},{key:"isEmpty",value:function(){return!this.stack.length}}]),t}();ge.type=ge.prototype.type;var me,ve,ye,_e,be,xe=function(){function e(t){r(this,e),this.handler_=t||null,this.undoStackPointer=0,this.undoStack=[],this.undoChangeStackPointer=-1,this.undoableChangeStack=[]}return i(e,[{key:"resetUndoStack",value:function(){this.undoStack=[],this.undoStackPointer=0}},{key:"getUndoStackSize",value:function(){return this.undoStackPointer}},{key:"getRedoStackSize",value:function(){return this.undoStack.length-this.undoStackPointer}},{key:"getNextUndoCommandText",value:function(){return this.undoStackPointer>0?this.undoStack[this.undoStackPointer-1].getText():""}},{key:"getNextRedoCommandText",value:function(){return this.undoStackPointer0&&this.undoStack[--this.undoStackPointer].unapply(this.handler_)}},{key:"redo",value:function(){this.undoStackPointer0&&this.undoStack[this.undoStackPointer++].apply(this.handler_)}},{key:"addCommandToHistory",value:function(e){this.undoStackPointer0&&(this.undoStack=this.undoStack.splice(0,this.undoStackPointer)),this.undoStack.push(e),this.undoStackPointer=this.undoStack.length}},{key:"beginUndoableChange",value:function(e,t){for(var n=++this.undoChangeStackPointer,r=t.length,a=new Array(r),i=new Array(r);r--;){var o=t[r];an(o)||(i[r]=o,a[r]=o.getAttribute(e))}this.undoableChangeStack[n]={attrName:e,oldValues:a,elements:i}}},{key:"finishUndoableChange",value:function(){for(var e=this.undoChangeStackPointer--,t=this.undoableChangeStack[e],n=t.attrName,r=new ge("Change "+n),a=t.elements.length;a--;){var i=t.elements[a];if(!an(i)){var o={};o[n]=t.oldValues[a],o[n]!==i.getAttribute(n)&&r.addSubCommand(new pe(i,o,n))}}return this.undoableChangeStack[e]=null,r}}]),e}(),we=Object.freeze({__proto__:null,HistoryEventTypes:ce,MoveElementCommand:de,InsertElementCommand:he,RemoveElementCommand:fe,ChangeElementCommand:pe,BatchCommand:ge,UndoManager:xe}),Se=document.createElementNS(p.SVG,"svg"),ke=function(e,t,n){return{x:n.a*e+n.c*t+n.e,y:n.b*e+n.d*t+n.f}},Ce=function(e){return 1===e.a&&0===e.b&&0===e.c&&1===e.d&&0===e.e&&0===e.f},Ae=function(){for(var e=arguments.length,t=new Array(e),n=0;n(n=parseInt(n))){var r=n;n=t,t=r}for(var a=Se.createSVGMatrix(),i=t;i<=n;++i){var o=i>=0&&ie.x&&t.ye.y},Le=jQuery,Me={2:["x","y"],4:["x","y"],6:["x","y","x1","y1","x2","y2"],8:["x","y","x1","y1"],10:["x","y","r1","r2","angle","largeArcFlag","sweepFlag"],12:["x"],14:["y"],16:["x","y","x2","y2"],18:["x","y"]},Oe={},je=function(e){Object.assign(Oe,e.ui)},Ve=[],Re=!0,Be={},De=null,Ue=null,Fe=function(e){Ue=e,Ve=[0,"ClosePath"];Le.each(["Moveto","Lineto","CurvetoCubic","CurvetoQuadratic","Arc","LinetoHorizontal","LinetoVertical","CurvetoCubicSmooth","CurvetoQuadraticSmooth"],(function(e,t){Ve.push(t+"Abs"),Ve.push(t+"Rel")}))},He=function(e,t,n){var r=e.pathSegList;if(I)r.insertItemBefore(t,n);else{for(var a=r.numberOfItems,i=[],o=0;o0?(f=g element");this.elem=t,this.segs=[],this.selected_pts=[],De=this,this.init()}return i(e,[{key:"init",value:function(){Le(Xe()).find("*").each((function(){Le(this).attr("display","none")}));var e=this.elem.pathSegList,t=e.numberOfItems;this.segs=[],this.selected_pts=[],this.first_seg=null;for(var n=0;n=t?null:i[s+1],u=s-1<0?null:i[s-1];if(2===l.type){if(u&&1!==u.type){var d=i[o];d.next=i[o+1],d.next.prev=d,d.addGrip()}o=s}else if(c&&1===c.type)l.next=i[o+1],l.next.prev=l,l.mate=i[o],l.addGrip(),an(this.first_seg)&&(this.first_seg=l);else if(c)1!==l.type&&(l.addGrip(),c&&2!==c.type&&(l.next=c,l.next.prev=l));else if(1!==l.type){var h=i[o];h.next=i[o+1],h.next.prev=h,h.addGrip(),l.addGrip(),this.first_seg||(this.first_seg=i[o])}}return this}},{key:"eachSeg",value:function(e){for(var t=this.segs.length,n=0;n=0&&n.selected_pts.push(e)})),this.selected_pts.sort();var r=this.selected_pts.length,a=[];for(a.length=r;r--;){var i=this.selected_pts[r],o=this.segs[i];o.select(!0),a[r]=o.ptgrip}var s=e.subpathIsClosed(this.selected_pts[0]);Ue.addPtsToSelection({grips:a,closedSubpath:s})}}],[{key:"subpathIsClosed",value:function(e){var t=!1;return De.eachSeg((function(n){return n<=e||2!==this.type&&(1!==this.type||(t=!0,!1))})),t}}]),e}(),rt=function(e){var t=Be[e.id];return t||(t=Be[e.id]=new nt(e)),t},at=function(e){e in Be&&delete Be[e]},it=function(e,t){var n=e-ye,r=t-_e,a=Math.sqrt(n*n+r*r),i=Math.atan2(r,n)+be;return n=a*Math.cos(i)+ye,r=a*Math.sin(i)+_e,n-=me,r-=ve,a=Math.sqrt(n*n+r*r),i=Math.atan2(r,n)-be,{x:a*Math.cos(i)+me,y:a*Math.sin(i)+ve}},ot=function(){var e=De.elem;if(be=Zt(e,!0)){var t=De.oldbbox;ye=t.x+t.width/2,_e=t.y+t.height/2;var n=Dt(e);me=n.x+n.width/2,ve=n.y+n.height/2;var r=me-ye,a=ve-_e,i=Math.sqrt(r*r+a*a),o=Math.atan2(a,r)+be;me=i*Math.cos(o)+ye,ve=i*Math.sin(o)+_e;for(var s=e.pathSegList,l=s.numberOfItems;l;){l-=1;var c=s.getItem(l),u=c.pathSegType;if(1!==u){var d=it(c.x,c.y),h=[d.x,d.y];if(!an(c.x1)&&!an(c.x2)){var f=it(c.x1,c.y1),p=it(c.x2,c.y2);h.splice(h.length,0,f.x,f.y,p.x,p.y)}$e(u,l,h)}}Dt(e);var g=Ue.getSVGRoot().createSVGTransform(),m=$(e);g.setRotate(180*be/Math.PI,me,ve),m.replaceItem(g,0)}},st=[0,"z","M","m","L","l","C","c","Q","q","A","a","H","h","V","v","S","s","T","t"],lt=function(e,t){for(var n=e.pathSegList,r=n.numberOfItems,a=0,i=0,o="",s=null,l=0;l=C-w&&g<=C+w&&m>=A-w&&m<=A+w){S=!0;break}}a=Ue.getId(),at(a);var E,G,P=Jt(a),I=b.numberOfItems;if(S){if(x<=1&&I>=2){var N=b.getItem(0).x,T=b.getItem(0).y;E=4===(G=v.pathSegList.getItem(1)).pathSegType?_.createSVGPathSegLinetoAbs(N,T):_.createSVGPathSegCurvetoCubicAbs(N,T,G.x1/f,G.y1/f,N,T);var L=_.createSVGPathSegClosePath();b.appendItem(E),b.appendItem(L)}else if(I<3)return!1;if(Le(v).remove(),Ue.setDrawnPath(null),Ue.setStarted(!1),ht){De.matrix&&Ue.remapElement(P,{},De.matrix.inverse());var M=P.getAttribute("d"),O=Le(De.elem).attr("d");return Le(De.elem).attr("d",O+M),Le(P).remove(),De.matrix&&ot(),Fe(),gt.toEditMode(De.elem),De.selectPt(),!1}}else{if(!Le.contains(Ue.getContainer(),Ue.getMouseTarget(e)))return!1;var j=_.pathSegList.numberOfItems,V=_.pathSegList.getItem(j-1),R=V.x,B=V.y;if(e.shiftKey){var D=Ne(R,B,g,m);g=D.x,m=D.y}E=4===(G=v.pathSegList.getItem(1)).pathSegType?_.createSVGPathSegLinetoAbs(Ue.round(g),Ue.round(m)):_.createSVGPathSegCurvetoCubicAbs(Ue.round(g),Ue.round(m),G.x1/f,G.y1/f,G.x2/f,G.y2/f),_.pathSegList.appendItem(E),g*=f,m*=f,v.setAttribute("d",["M",g,m,g,m].join(" ")),y=j,ht&&(y+=De.segs.length),We(y,g,m)}}else{var U="M"+g+","+m+" ";Ue.setDrawnPath(Ue.addSVGElementFromJson({element:"path",curStyles:!0,attr:{d:U,id:Ue.getNextId(),opacity:Ue.getOpacity()/2}})),v.setAttribute("d",["M",d,h,d,h].join(" ")),y=ht?De.segs.length:0,We(y,d,h)}}},mouseMove:function(e,t){var n=Ue.getCurrentZoom();pt=!0;var r=Ue.getDrawnPath();if("path"!==Ue.getCurrentMode())if(De.dragging){var a=Ye({x:De.dragging[0],y:De.dragging[1]},De),i=Ye({x:e,y:t},De),o=i.x-a.x,s=i.y-a.y;De.dragging=[e,t],De.dragctrl?De.moveCtrl(o,s):De.movePts(o,s)}else De.selected_pts=[],De.eachSeg((function(e){if(this.next||this.prev){var t=Ue.getRubberBox().getBBox(),n=qe(this),r={x:n.x,y:n.y,width:0,height:0},a=Te(t,r);this.select(a),a&&De.selected_pts.push(this.index)}}));else{if(!r)return;var l=r.pathSegList,c=l.numberOfItems-1;if(ut){var u=Qe("1c1"),d=Qe("0c2");u.setAttribute("cx",e),u.setAttribute("cy",t),u.setAttribute("display","inline");var h=ut[0],f=ut[1],p=h+(h-e/n),g=f+(f-t/n);d.setAttribute("cx",p*n),d.setAttribute("cy",g*n),d.setAttribute("display","inline");var m=Ke(1);if(en(m,{x1:e,y1:t,x2:p*n,y2:g*n,display:"inline"}),0===c)dt=[e,t];else{var v=l.getItem(c-1),y=v.x,_=v.y;6===v.pathSegType?(y+=y-v.x2,_+=_-v.y2):dt&&(y=dt[0]/n,_=dt[1]/n),$e(6,c,[h,f,y,_,p,g],r)}}else{var b=Jt("path_stretch_line");if(b){var x=l.getItem(c);if(6===x.pathSegType){var w=x.x+(x.x-x.x2),S=x.y+(x.y-x.y2);$e(6,1,[e,t,w*n,S*n,e,t],b)}else dt?$e(6,1,[e,t,dt[0],dt[1],e,t],b):$e(4,1,[e,t],b)}}}},mouseUp:function(e,t,n,r){var a=Ue.getDrawnPath();if("path"===Ue.getCurrentMode())return ut=null,a||(t=Jt(Ue.getId()),Ue.setStarted(!1),dt=null),{keep:!0,element:t};var i=Ue.getRubberBox();if(De.dragging){var o=De.cur_pt;De.dragging=!1,De.dragctrl=!1,De.update(),pt&&De.endChanges("Move path point(s)"),e.shiftKey||pt||De.selectPt(o)}else i&&"none"!==i.getAttribute("display")?(i.setAttribute("display","none"),i.getAttribute("width")<=2&&i.getAttribute("height")<=2&>.toSelectMode(e.target)):gt.toSelectMode(e.target);pt=!1},toEditMode:function(e){De=rt(e),Ue.setCurrentMode("pathedit"),Ue.clearSelection(),De.show(!0).update(),De.oldbbox=Dt(De.elem),ht=!1},toSelectMode:function(e){var t=e===De.elem;Ue.setCurrentMode("select"),De.show(!1),ft=!1,Ue.clearSelection(),De.matrix&&ot(),t&&(Ue.call("selected",[e]),Ue.addToSelection([e],!0))},addSubPath:function(e){e?(Ue.setCurrentMode("path"),ht=!0):(gt.clear(!0),gt.toEditMode(De.elem))},select:function(e){ft===e?(gt.toEditMode(e),Ue.setCurrentMode("pathedit")):ft=e},reorient:function(){var e=Ue.getSelectedElements()[0];if(e&&0!==Zt(e)){var t=new ge("Reorient path"),n={d:e.getAttribute("d"),transform:e.getAttribute("transform")};t.addSubCommand(new pe(e,n)),Ue.clearSelection(),this.resetOrientation(e),Ue.addCommandToHistory(t),rt(e).show(!1).matrix=null,this.clear(),Ue.addToSelection([e],!0),Ue.call("changed",Ue.getSelectedElements())}},clear:function(e){var t=Ue.getDrawnPath();if(ft=null,t){var n=Jt(Ue.getId());Le(Jt("path_stretch_line")).remove(),Le(n).remove(),Le(Jt("pathpointgrip_container")).find("*").attr("display","none"),dt=null,Ue.setDrawnPath(null),Ue.setStarted(!1)}else"pathedit"===Ue.getCurrentMode()&&this.toSelectMode();De&&De.init().show(!1)},resetOrientation:function(e){if(an(e)||"path"!==e.nodeName)return!1;var t=$(e),n=Pe(t).matrix;t.clear(),e.removeAttribute("transform");for(var r=e.pathSegList,a=r.numberOfItems,i=function(t){var a=r.getItem(t),i=a.pathSegType;if(1===i)return"continue";var o=[];Le.each(["",1,2],(function(e,t){var r=a["x"+t],i=a["y"+t];if(void 0!==r&&void 0!==i){var s=ke(r,i,n);o.splice(o.length,0,s.x,s.y)}})),$e(i,t,o,e)},o=0;o0){var s=t.getItem(n-1).pathSegType;if(2===s){r(n-1,1),e();break}if(1===s&&t.numberOfItems-1===n){r(n,1),e();break}}}return!1}(),De.elem.pathSegList.numberOfItems<=1)return gt.toSelectMode(De.elem),void Ue.canvas.deleteSelectedElements();if(De.init(),De.clearSelection(),window.opera){var r=Le(De.elem);r.attr("d",r.attr("d"))}De.endChanges("Delete path node(s)")}},smoothPolylineIntoPath:function(e){var t,n=e.points,r=n.numberOfItems;if(r>=4){var a=n.getItem(0),i=null,o=[];for(o.push(["M",a.x,",",a.y," C"].join("")),t=1;t<=r-4;t+=3){var s=n.getItem(t),l=n.getItem(t+1),c=n.getItem(t+2);if(i){var u=et(i,s,a);if(u&&2===u.length){var d=o[o.length-1].split(",");d[2]=u[0].x,d[3]=u[0].y,o[o.length-1]=d.join(","),s=u[1]}}o.push([s.x,s.y,l.x,l.y,c.x,c.y].join(",")),a=c,i=l}for(o.push("L");t)/,"$1$2")},kt=function(e){return e.replace(/&/g,"&").replace(//g,">").replace(/"/g,""").replace(/'/g,"'")};function Ct(e){if(e=Gt(e),window.btoa)return window.btoa(e);var t=new Array(4*Math.floor((e.length+2)/3)),n=0,r=0;do{var a=e.charCodeAt(n++),i=e.charCodeAt(n++),o=e.charCodeAt(n++),s=a>>2,l=(3&a)<<4|i>>4,c=(15&i)<<2|o>>6,u=63&o;isNaN(i)?(c=64,u=64):isNaN(o)&&(u=64),t[r++]=vt.charAt(s),t[r++]=vt.charAt(l),t[r++]=vt.charAt(c),t[r++]=vt.charAt(u)}while(n>4,l=(15&a)<<4|i>>2,c=(3&i)<<6|o;t+=String.fromCharCode(s),64!==i&&(t+=String.fromCharCode(l)),64!==o&&(t+=String.fromCharCode(c))}while(nSVG-edit "],{type:"text/html"});return It(e)}(),Tt=function(e){var t,n;e.includes("0?t=t[0]:(t=e.ownerDocument.createElementNS(p.SVG,"defs"),e.firstChild?e.insertBefore(t,e.firstChild.nextSibling):e.append(t)),t},Rt=function(e){for(var t=e.pathSegList,n=t.numberOfItems,r=[[],[]],a=t.getItem(0),i=[a.x,a.y],o=function(e,t,n,r){return function(a){return 1-Math.pow(a,3)*i[e]+3-Math.pow(a,2)*a*t[e]+3*(1-a)*Math.pow(a,2)*n[e]+Math.pow(a,3)*r[e]}},s=0;s0&&y<1&&r[h].push(f(y));var _=(-p-Math.sqrt(v))/(2*g);_>0&&_<1&&r[h].push(f(_))}}else{if(0===p)continue;var b=-m/p;b>0&&b<1&&r[h].push(f(b))}}i=d}else r[0].push(l.x),r[1].push(l.y)}var x=Math.min.apply(null,r[0]),w=Math.max.apply(null,r[0])-x,S=Math.min.apply(null,r[1]);return{x:x,y:S,width:w,height:Math.max.apply(null,r[1])-S}};function Bt(e){if(H())try{return e.getBBox()}catch(e){}var t,n,r=mt.data(e,"ref"),a=null;r?(n=mt(r).children().clone().attr("visibility","hidden"),mt(wt).append(n),a=n.filter("line, path")):a=mt(e).find("line, path");var i=!1;if(a.length)if(a.each((function(){var e=this.getBBox();e.width&&e.height||(i=!0)})),i){var o=r?n:mt(e).children();t=Wt(o)}else t=e.getBBox();else t=e.getBBox();return r&&n.remove(),t}var Dt=function(e){var t=e||_t.geSelectedElements()[0];if(1!==e.nodeType)return null;var n,r=t.nodeName,a=null;switch(r){case"text":""===t.textContent?(t.textContent="a",a=t.getBBox(),t.textContent=""):t.getBBox&&(a=t.getBBox());break;case"path":T?t.getBBox&&(a=t.getBBox()):a=Rt(t);break;case"g":case"a":a=Bt(t);break;default:if("use"===r&&(a=Bt(t)),"use"===r||"foreignObject"===r&&V()){if(a||(a=t.getBBox()),!V()){var i=a,o=i.x,s=i.y;a={width:i.width,height:i.height,x:o+parseFloat(t.getAttribute("x")||0),y:s+parseFloat(t.getAttribute("y")||0)}}}else if(yt.includes(r))if(t)try{a=t.getBBox()}catch(e){var l=t.getExtentOfChar(0),c=t.getComputedTextLength();a={x:l.x,y:l.y,width:c,height:l.height}}else{var u=mt(t).closest("foreignObject");u.length&&u[0].getBBox&&(a=u[0].getBBox())}}return a&&(a={x:(n=a).x,y:n.y,width:n.width,height:n.height}),a},Ut=function(e){var t="";return mt.each(e,(function(e,n){var r=d(n,2),a=r[0],i=r[1];t+=a;for(var o=0;o-.001&&n<.001||(n<-89.99||n>89.99))}(i,o)){if(["ellipse","path","line","polyline","polygon"].includes(e.tagName))r=s=zt(e,t,n);else if("rect"===e.tagName){var l=e.getAttribute("rx"),c=e.getAttribute("ry");(l||c)&&(r=s=zt(e,t,n))}}if(!s){var u=Pe(a).matrix;r=Ge(r.x,r.y,r.width,r.height,u).aabox}}return r};function Yt(e){var t=e.getAttribute("stroke-width");return isNaN(t)||"none"===e.getAttribute("stroke")?0:t/2}var Wt=function(e,t,n){if(!e||!e.length)return!1;var r;if(mt.each(e,(function(){r||this.parentNode&&(r=qt(this,t,n))})),void 0===r)return null;var a=r.x+r.width,i=r.y+r.height,o=r.x,s=r.y;if(1===e.length){var l=Yt(e[0]);o-=l,s-=l,a+=l,i+=l}else mt.each(e,(function(e,r){var l=qt(r,t,n);if(l){var c=Yt(r);o=Math.min(o,l.x-c),s=Math.min(s,l.y-c),1===r.nodeType&&(a=Math.max(a,l.x+l.width+c),i=Math.max(i,l.y+l.height+c))}}));return r.x=o,r.y=s,r.width=a-o,r.height=i-s,r},Xt=function(e){e||(e=mt(_t.getSVGContent()).children());var t=[];return mt(e).children().each((function(e,n){n.getBBox&&t.push(n)})),t.reverse()},Qt=function(e){return e||(e=Xt()),Wt(e,_t.addSVGElementFromJson,_t.pathActions)},Kt=function(e,t){if(!e)return 0;for(var n=e.numberOfItems,r=0;r");var t=e.shortcut||"";on("#cmenu_canvas").append("
  • "+e.label+""+t+"
  • ")}(e)}))};function cn(e,t){["id","class","type"].forEach((function(n){n in t&&(e[n]=t[n])}))}function un(e,t){return dn(e,o({},t,{returnDefault:!0}))}function dn(e,t){return hn.apply(this,arguments)}function hn(){return(hn=n(regeneratorRuntime.mark((function e(t,n){var r,a;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(r=n.global,a=n.returnDefault,!!("svgEditor"in window&&window.svgEditor&&!1===window.svgEditor.modules)){e.next=4;break}return e.abrupt("return",pn(t,void 0,{returnDefault:a}));case 4:return e.next=6,fn(t);case 6:return e.abrupt("return",window[r]);case 7:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function fn(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return Array.isArray(e)?Promise.all(e.map((function(e){return fn(e,t)}))):new Promise((function(n,r){var a=document.createElement("script");function i(){r(new Error("Failed to import: ".concat(e))),s()}function o(){n(),s()}var s=function(){a.removeEventListener("error",i),a.removeEventListener("load",o),a.remove(),a.src=""};a.defer="defer",cn(a,t),a.addEventListener("error",i),a.addEventListener("load",o),a.src=e,document.head.append(a)}))}function pn(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=(arguments.length>2&&void 0!==arguments[2]?arguments[2]:{}).returnDefault,r=void 0!==n&&n;return Array.isArray(e)?Promise.all(e.map((function(e){return pn(e,t)}))):new Promise((function(n,a){var i="$importModule$"+Math.random().toString(32).slice(2),o=document.createElement("script");function s(){a(new Error("Failed to import: ".concat(e))),c()}function l(){n(window[i]),c()}var c=function(){delete window[i],o.removeEventListener("error",s),o.removeEventListener("load",l),o.remove(),URL.revokeObjectURL(o.src),o.src=""};cn(o,t),o.defer="defer",o.type="module",o.addEventListener("error",s),o.addEventListener("load",l);var u=function(e){var t=document.createElement("a");return t.setAttribute("href",e),t.cloneNode(!1).href}(e),d="import * as m from '".concat(u.replace(/'/g,"\\'"),"'; window.").concat(i," = ").concat(r?"m.default || ":"","m;"),h=new Blob([d],{type:"text/javascript"});o.src=URL.createObjectURL(h),document.head.append(o)}))}function gn(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{ok:"Ok",cancel:"Cancel"};t("#dialog_container").draggable({cancel:"#dialog_content, #dialog_buttons *",containment:"window"}).css("position","absolute");var r=t("#dialog_box"),a=t("#dialog_buttons"),i=t("#dialog_content");function o(o,s,l,c,u,d){i.html("

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

    ")+"

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