From e40a7647bed5a702ad3465c40a6e0c51e1443f72 Mon Sep 17 00:00:00 2001 From: lja1018 Date: Fri, 19 Mar 2021 11:04:14 +0900 Subject: [PATCH] chore: update version to v3.14.1 --- apps/image-editor/dist/tui-image-editor.css | 2 +- apps/image-editor/dist/tui-image-editor.js | 71 ++++++++++++++----- .../image-editor/dist/tui-image-editor.js.map | 2 +- .../dist/tui-image-editor.min.css | 2 +- .../dist/tui-image-editor.min.css.map | 2 +- .../image-editor/dist/tui-image-editor.min.js | 6 +- .../dist/tui-image-editor.min.js.map | 2 +- apps/image-editor/index.d.ts | 2 +- 8 files changed, 62 insertions(+), 27 deletions(-) diff --git a/apps/image-editor/dist/tui-image-editor.css b/apps/image-editor/dist/tui-image-editor.css index 45b22a883..b51153258 100644 --- a/apps/image-editor/dist/tui-image-editor.css +++ b/apps/image-editor/dist/tui-image-editor.css @@ -1,6 +1,6 @@ /*! * tui-image-editor.js - * @version 3.14.0 + * @version 3.14.1 * @author NHN. FE Development Lab * @license MIT */ diff --git a/apps/image-editor/dist/tui-image-editor.js b/apps/image-editor/dist/tui-image-editor.js index 2ae724707..c0787529f 100644 --- a/apps/image-editor/dist/tui-image-editor.js +++ b/apps/image-editor/dist/tui-image-editor.js @@ -1,6 +1,6 @@ /*! * tui-image-editor.js - * @version 3.14.0 + * @version 3.14.1 * @author NHN. FE Development Lab * @license MIT */ @@ -9238,6 +9238,14 @@ var DEFAULT_HORIZONTAL_SCROLL_RATIO = { BORDER_RADIUS: 0.003 }; var DEFAULT_ZOOM_LEVEL = 1.0; +var ZOOM_CHANGED = _consts.eventNames.ZOOM_CHANGED, + ADD_TEXT = _consts.eventNames.ADD_TEXT, + TEXT_EDITING = _consts.eventNames.TEXT_EDITING, + OBJECT_MODIFIED = _consts.eventNames.OBJECT_MODIFIED, + KEY_DOWN = _consts.eventNames.KEY_DOWN, + KEY_UP = _consts.eventNames.KEY_UP, + HAND_STARTED = _consts.eventNames.HAND_STARTED, + HAND_STOPPED = _consts.eventNames.HAND_STOPPED; /** * Zoom components @@ -9299,8 +9307,8 @@ var Zoom = function (_Component) { moveHand: _this._onMouseMoveWithHandMode.bind(_this), stopHand: _this._onMouseUpWithHandMode.bind(_this), zoomChanged: _this._changeScrollState.bind(_this), - keydown: _this._onKeyDown.bind(_this), - keyup: _this._onKeyUp.bind(_this) + keydown: _this._startHandModeWithSpaceBar.bind(_this), + keyup: _this._endHandModeWithSpaceBar.bind(_this) }; var canvas = _this.getCanvas(); @@ -9325,24 +9333,49 @@ var Zoom = function (_Component) { */ _this._horizontalScroll = new _fabric2.default.Rect(DEFAULT_SCROLL_OPTION); - canvas.on(_consts.eventNames.ZOOM_CHANGED, _this._listeners.zoomChanged); + canvas.on(ZOOM_CHANGED, _this._listeners.zoomChanged); - _fabric2.default.util.addListener(document, 'keydown', _this._listeners.keydown); - _fabric2.default.util.addListener(document, 'keyup', _this._listeners.keyup); + _this.graphics.on(ADD_TEXT, _this._startTextEditingHandler.bind(_this)); + _this.graphics.on(TEXT_EDITING, _this._startTextEditingHandler.bind(_this)); + _this.graphics.on(OBJECT_MODIFIED, _this._stopTextEditingHandler.bind(_this)); + _fabric2.default.util.addListener(document, KEY_DOWN, _this._listeners.keydown); + _fabric2.default.util.addListener(document, KEY_UP, _this._listeners.keyup); return _this; } /** - * Keydown event handler - * @param {KeyboardEvent} e - Event object + * Handler when you started editing text * @private */ _createClass(Zoom, [{ - key: '_onKeyDown', - value: function _onKeyDown(e) { - if (this.withSpace) { + key: '_startTextEditingHandler', + value: function _startTextEditingHandler() { + this.isTextEditing = true; + } + + /** + * Handler when you stopped editing text + * @private + */ + + }, { + key: '_stopTextEditingHandler', + value: function _stopTextEditingHandler() { + this.isTextEditing = false; + } + + /** + * Handler who turns on hand mode when the space bar is down + * @param {KeyboardEvent} e - Event object + * @private + */ + + }, { + key: '_startHandModeWithSpaceBar', + value: function _startHandModeWithSpaceBar(e) { + if (this.withSpace || this.isTextEditing) { return; } @@ -9354,14 +9387,14 @@ var Zoom = function (_Component) { } /** - * Keyup event handler + * Handler who turns off hand mode when space bar is up * @param {KeyboardEvent} e - Event object * @private */ }, { - key: '_onKeyUp', - value: function _onKeyUp(e) { + key: '_endHandModeWithSpaceBar', + value: function _endHandModeWithSpaceBar(e) { if (e.keyCode === _consts.keyCodes.SPACE) { e.preventDefault(); this.withSpace = false; @@ -9477,7 +9510,7 @@ var Zoom = function (_Component) { canvas.selection = false; canvas.defaultCursor = 'grab'; - canvas.fire(_consts.eventNames.HAND_STARTED); + canvas.fire(HAND_STARTED); } /** @@ -9498,7 +9531,7 @@ var Zoom = function (_Component) { this._startHandPoint = null; - canvas.fire(_consts.eventNames.HAND_STOPPED); + canvas.fire(HAND_STOPPED); } /** @@ -10009,7 +10042,7 @@ var Zoom = function (_Component) { }, { key: '_fireZoomChanged', value: function _fireZoomChanged(canvas, zoomLevel) { - canvas.fire(_consts.eventNames.ZOOM_CHANGED, { viewport: canvas.calcViewportBoundaries(), zoomLevel: zoomLevel }); + canvas.fire(ZOOM_CHANGED, { viewport: canvas.calcViewportBoundaries(), zoomLevel: zoomLevel }); } /** @@ -10201,7 +10234,9 @@ var eventNames = exports.eventNames = { AFTER_REDO: 'afterRedo', ZOOM_CHANGED: 'zoomChanged', HAND_STARTED: 'handStarted', - HAND_STOPPED: 'handStopped' + HAND_STOPPED: 'handStopped', + KEY_DOWN: 'keydown', + KEY_UP: 'keyup' }; /** diff --git a/apps/image-editor/dist/tui-image-editor.js.map b/apps/image-editor/dist/tui-image-editor.js.map index 69983ab0c..a31b90931 100644 --- a/apps/image-editor/dist/tui-image-editor.js.map +++ b/apps/image-editor/dist/tui-image-editor.js.map @@ -1 +1 @@ -{"version":3,"sources":["webpack://tui.ImageEditor/webpack/universalModuleDefinition","webpack://tui.ImageEditor/webpack/bootstrap","webpack://tui.ImageEditor/./node_modules/core-js-pure/es/promise/index.js","webpack://tui.ImageEditor/./node_modules/core-js-pure/features/promise/index.js","webpack://tui.ImageEditor/./node_modules/core-js-pure/internals/a-function.js","webpack://tui.ImageEditor/./node_modules/core-js-pure/internals/a-possible-prototype.js","webpack://tui.ImageEditor/./node_modules/core-js-pure/internals/add-to-unscopables.js","webpack://tui.ImageEditor/./node_modules/core-js-pure/internals/an-instance.js","webpack://tui.ImageEditor/./node_modules/core-js-pure/internals/an-object.js","webpack://tui.ImageEditor/./node_modules/core-js-pure/internals/array-includes.js","webpack://tui.ImageEditor/./node_modules/core-js-pure/internals/call-with-safe-iteration-closing.js","webpack://tui.ImageEditor/./node_modules/core-js-pure/internals/check-correctness-of-iteration.js","webpack://tui.ImageEditor/./node_modules/core-js-pure/internals/classof-raw.js","webpack://tui.ImageEditor/./node_modules/core-js-pure/internals/classof.js","webpack://tui.ImageEditor/./node_modules/core-js-pure/internals/correct-prototype-getter.js","webpack://tui.ImageEditor/./node_modules/core-js-pure/internals/create-iterator-constructor.js","webpack://tui.ImageEditor/./node_modules/core-js-pure/internals/create-non-enumerable-property.js","webpack://tui.ImageEditor/./node_modules/core-js-pure/internals/create-property-descriptor.js","webpack://tui.ImageEditor/./node_modules/core-js-pure/internals/define-iterator.js","webpack://tui.ImageEditor/./node_modules/core-js-pure/internals/descriptors.js","webpack://tui.ImageEditor/./node_modules/core-js-pure/internals/document-create-element.js","webpack://tui.ImageEditor/./node_modules/core-js-pure/internals/dom-iterables.js","webpack://tui.ImageEditor/./node_modules/core-js-pure/internals/engine-is-ios.js","webpack://tui.ImageEditor/./node_modules/core-js-pure/internals/engine-user-agent.js","webpack://tui.ImageEditor/./node_modules/core-js-pure/internals/engine-v8-version.js","webpack://tui.ImageEditor/./node_modules/core-js-pure/internals/enum-bug-keys.js","webpack://tui.ImageEditor/./node_modules/core-js-pure/internals/export.js","webpack://tui.ImageEditor/./node_modules/core-js-pure/internals/fails.js","webpack://tui.ImageEditor/./node_modules/core-js-pure/internals/function-bind-context.js","webpack://tui.ImageEditor/./node_modules/core-js-pure/internals/get-built-in.js","webpack://tui.ImageEditor/./node_modules/core-js-pure/internals/get-iterator-method.js","webpack://tui.ImageEditor/./node_modules/core-js-pure/internals/global.js","webpack://tui.ImageEditor/./node_modules/core-js-pure/internals/has.js","webpack://tui.ImageEditor/./node_modules/core-js-pure/internals/hidden-keys.js","webpack://tui.ImageEditor/./node_modules/core-js-pure/internals/host-report-errors.js","webpack://tui.ImageEditor/./node_modules/core-js-pure/internals/html.js","webpack://tui.ImageEditor/./node_modules/core-js-pure/internals/ie8-dom-define.js","webpack://tui.ImageEditor/./node_modules/core-js-pure/internals/indexed-object.js","webpack://tui.ImageEditor/./node_modules/core-js-pure/internals/inspect-source.js","webpack://tui.ImageEditor/./node_modules/core-js-pure/internals/internal-state.js","webpack://tui.ImageEditor/./node_modules/core-js-pure/internals/is-array-iterator-method.js","webpack://tui.ImageEditor/./node_modules/core-js-pure/internals/is-forced.js","webpack://tui.ImageEditor/./node_modules/core-js-pure/internals/is-object.js","webpack://tui.ImageEditor/./node_modules/core-js-pure/internals/is-pure.js","webpack://tui.ImageEditor/./node_modules/core-js-pure/internals/iterate.js","webpack://tui.ImageEditor/./node_modules/core-js-pure/internals/iterators-core.js","webpack://tui.ImageEditor/./node_modules/core-js-pure/internals/iterators.js","webpack://tui.ImageEditor/./node_modules/core-js-pure/internals/microtask.js","webpack://tui.ImageEditor/./node_modules/core-js-pure/internals/native-promise-constructor.js","webpack://tui.ImageEditor/./node_modules/core-js-pure/internals/native-symbol.js","webpack://tui.ImageEditor/./node_modules/core-js-pure/internals/native-weak-map.js","webpack://tui.ImageEditor/./node_modules/core-js-pure/internals/new-promise-capability.js","webpack://tui.ImageEditor/./node_modules/core-js-pure/internals/object-create.js","webpack://tui.ImageEditor/./node_modules/core-js-pure/internals/object-define-properties.js","webpack://tui.ImageEditor/./node_modules/core-js-pure/internals/object-define-property.js","webpack://tui.ImageEditor/./node_modules/core-js-pure/internals/object-get-own-property-descriptor.js","webpack://tui.ImageEditor/./node_modules/core-js-pure/internals/object-get-prototype-of.js","webpack://tui.ImageEditor/./node_modules/core-js-pure/internals/object-keys-internal.js","webpack://tui.ImageEditor/./node_modules/core-js-pure/internals/object-keys.js","webpack://tui.ImageEditor/./node_modules/core-js-pure/internals/object-property-is-enumerable.js","webpack://tui.ImageEditor/./node_modules/core-js-pure/internals/object-set-prototype-of.js","webpack://tui.ImageEditor/./node_modules/core-js-pure/internals/object-to-string.js","webpack://tui.ImageEditor/./node_modules/core-js-pure/internals/path.js","webpack://tui.ImageEditor/./node_modules/core-js-pure/internals/perform.js","webpack://tui.ImageEditor/./node_modules/core-js-pure/internals/promise-resolve.js","webpack://tui.ImageEditor/./node_modules/core-js-pure/internals/redefine-all.js","webpack://tui.ImageEditor/./node_modules/core-js-pure/internals/redefine.js","webpack://tui.ImageEditor/./node_modules/core-js-pure/internals/require-object-coercible.js","webpack://tui.ImageEditor/./node_modules/core-js-pure/internals/set-global.js","webpack://tui.ImageEditor/./node_modules/core-js-pure/internals/set-species.js","webpack://tui.ImageEditor/./node_modules/core-js-pure/internals/set-to-string-tag.js","webpack://tui.ImageEditor/./node_modules/core-js-pure/internals/shared-key.js","webpack://tui.ImageEditor/./node_modules/core-js-pure/internals/shared-store.js","webpack://tui.ImageEditor/./node_modules/core-js-pure/internals/shared.js","webpack://tui.ImageEditor/./node_modules/core-js-pure/internals/species-constructor.js","webpack://tui.ImageEditor/./node_modules/core-js-pure/internals/string-multibyte.js","webpack://tui.ImageEditor/./node_modules/core-js-pure/internals/task.js","webpack://tui.ImageEditor/./node_modules/core-js-pure/internals/to-absolute-index.js","webpack://tui.ImageEditor/./node_modules/core-js-pure/internals/to-indexed-object.js","webpack://tui.ImageEditor/./node_modules/core-js-pure/internals/to-integer.js","webpack://tui.ImageEditor/./node_modules/core-js-pure/internals/to-length.js","webpack://tui.ImageEditor/./node_modules/core-js-pure/internals/to-object.js","webpack://tui.ImageEditor/./node_modules/core-js-pure/internals/to-primitive.js","webpack://tui.ImageEditor/./node_modules/core-js-pure/internals/to-string-tag-support.js","webpack://tui.ImageEditor/./node_modules/core-js-pure/internals/uid.js","webpack://tui.ImageEditor/./node_modules/core-js-pure/internals/use-symbol-as-uid.js","webpack://tui.ImageEditor/./node_modules/core-js-pure/internals/well-known-symbol.js","webpack://tui.ImageEditor/./node_modules/core-js-pure/modules/es.array.iterator.js","webpack://tui.ImageEditor/./node_modules/core-js-pure/modules/es.object.to-string.js","webpack://tui.ImageEditor/./node_modules/core-js-pure/modules/es.promise.all-settled.js","webpack://tui.ImageEditor/./node_modules/core-js-pure/modules/es.promise.finally.js","webpack://tui.ImageEditor/./node_modules/core-js-pure/modules/es.promise.js","webpack://tui.ImageEditor/./node_modules/core-js-pure/modules/es.string.iterator.js","webpack://tui.ImageEditor/./node_modules/core-js-pure/modules/esnext.aggregate-error.js","webpack://tui.ImageEditor/./node_modules/core-js-pure/modules/esnext.promise.all-settled.js","webpack://tui.ImageEditor/./node_modules/core-js-pure/modules/esnext.promise.any.js","webpack://tui.ImageEditor/./node_modules/core-js-pure/modules/esnext.promise.try.js","webpack://tui.ImageEditor/./node_modules/core-js-pure/modules/web.dom-collections.iterator.js","webpack://tui.ImageEditor/(webpack)/buildin/global.js","webpack://tui.ImageEditor/./src/css/index.styl","webpack://tui.ImageEditor/./src/index.js","webpack://tui.ImageEditor/./src/js/action.js","webpack://tui.ImageEditor/./src/js/command/addIcon.js","webpack://tui.ImageEditor/./src/js/command/addImageObject.js","webpack://tui.ImageEditor/./src/js/command/addObject.js","webpack://tui.ImageEditor/./src/js/command/addShape.js","webpack://tui.ImageEditor/./src/js/command/addText.js","webpack://tui.ImageEditor/./src/js/command/applyFilter.js","webpack://tui.ImageEditor/./src/js/command/changeIconColor.js","webpack://tui.ImageEditor/./src/js/command/changeSelection.js","webpack://tui.ImageEditor/./src/js/command/changeShape.js","webpack://tui.ImageEditor/./src/js/command/changeText.js","webpack://tui.ImageEditor/./src/js/command/changeTextStyle.js","webpack://tui.ImageEditor/./src/js/command/clearObjects.js","webpack://tui.ImageEditor/./src/js/command/flip.js","webpack://tui.ImageEditor/./src/js/command/loadImage.js","webpack://tui.ImageEditor/./src/js/command/removeFilter.js","webpack://tui.ImageEditor/./src/js/command/removeObject.js","webpack://tui.ImageEditor/./src/js/command/resizeCanvasDimension.js","webpack://tui.ImageEditor/./src/js/command/rotate.js","webpack://tui.ImageEditor/./src/js/command/setObjectPosition.js","webpack://tui.ImageEditor/./src/js/command/setObjectProperties.js","webpack://tui.ImageEditor/./src/js/component/cropper.js","webpack://tui.ImageEditor/./src/js/component/filter.js","webpack://tui.ImageEditor/./src/js/component/flip.js","webpack://tui.ImageEditor/./src/js/component/freeDrawing.js","webpack://tui.ImageEditor/./src/js/component/icon.js","webpack://tui.ImageEditor/./src/js/component/imageLoader.js","webpack://tui.ImageEditor/./src/js/component/line.js","webpack://tui.ImageEditor/./src/js/component/rotation.js","webpack://tui.ImageEditor/./src/js/component/shape.js","webpack://tui.ImageEditor/./src/js/component/text.js","webpack://tui.ImageEditor/./src/js/component/zoom.js","webpack://tui.ImageEditor/./src/js/consts.js","webpack://tui.ImageEditor/./src/js/drawingMode/cropper.js","webpack://tui.ImageEditor/./src/js/drawingMode/freeDrawing.js","webpack://tui.ImageEditor/./src/js/drawingMode/icon.js","webpack://tui.ImageEditor/./src/js/drawingMode/lineDrawing.js","webpack://tui.ImageEditor/./src/js/drawingMode/shape.js","webpack://tui.ImageEditor/./src/js/drawingMode/text.js","webpack://tui.ImageEditor/./src/js/drawingMode/zoom.js","webpack://tui.ImageEditor/./src/js/extension/arrowLine.js","webpack://tui.ImageEditor/./src/js/extension/colorFilter.js","webpack://tui.ImageEditor/./src/js/extension/cropzone.js","webpack://tui.ImageEditor/./src/js/extension/emboss.js","webpack://tui.ImageEditor/./src/js/extension/mask.js","webpack://tui.ImageEditor/./src/js/extension/sharpen.js","webpack://tui.ImageEditor/./src/js/factory/command.js","webpack://tui.ImageEditor/./src/js/factory/errorMessage.js","webpack://tui.ImageEditor/./src/js/graphics.js","webpack://tui.ImageEditor/./src/js/helper/imagetracer.js","webpack://tui.ImageEditor/./src/js/helper/selectionModifyHelper.js","webpack://tui.ImageEditor/./src/js/helper/shapeFilterFillHelper.js","webpack://tui.ImageEditor/./src/js/helper/shapeResizeHelper.js","webpack://tui.ImageEditor/./src/js/imageEditor.js","webpack://tui.ImageEditor/./src/js/interface/command.js","webpack://tui.ImageEditor/./src/js/interface/component.js","webpack://tui.ImageEditor/./src/js/interface/drawingMode.js","webpack://tui.ImageEditor/./src/js/invoker.js","webpack://tui.ImageEditor/./src/js/polyfill.js","webpack://tui.ImageEditor/./src/js/ui.js","webpack://tui.ImageEditor/./src/js/ui/crop.js","webpack://tui.ImageEditor/./src/js/ui/draw.js","webpack://tui.ImageEditor/./src/js/ui/filter.js","webpack://tui.ImageEditor/./src/js/ui/flip.js","webpack://tui.ImageEditor/./src/js/ui/history.js","webpack://tui.ImageEditor/./src/js/ui/icon.js","webpack://tui.ImageEditor/./src/js/ui/locale/locale.js","webpack://tui.ImageEditor/./src/js/ui/mask.js","webpack://tui.ImageEditor/./src/js/ui/panelMenu.js","webpack://tui.ImageEditor/./src/js/ui/rotate.js","webpack://tui.ImageEditor/./src/js/ui/shape.js","webpack://tui.ImageEditor/./src/js/ui/submenuBase.js","webpack://tui.ImageEditor/./src/js/ui/template/controls.js","webpack://tui.ImageEditor/./src/js/ui/template/mainContainer.js","webpack://tui.ImageEditor/./src/js/ui/template/style.js","webpack://tui.ImageEditor/./src/js/ui/template/submenu/crop.js","webpack://tui.ImageEditor/./src/js/ui/template/submenu/draw.js","webpack://tui.ImageEditor/./src/js/ui/template/submenu/filter.js","webpack://tui.ImageEditor/./src/js/ui/template/submenu/flip.js","webpack://tui.ImageEditor/./src/js/ui/template/submenu/history.js","webpack://tui.ImageEditor/./src/js/ui/template/submenu/icon.js","webpack://tui.ImageEditor/./src/js/ui/template/submenu/mask.js","webpack://tui.ImageEditor/./src/js/ui/template/submenu/rotate.js","webpack://tui.ImageEditor/./src/js/ui/template/submenu/shape.js","webpack://tui.ImageEditor/./src/js/ui/template/submenu/text.js","webpack://tui.ImageEditor/./src/js/ui/text.js","webpack://tui.ImageEditor/./src/js/ui/theme/standard.js","webpack://tui.ImageEditor/./src/js/ui/theme/theme.js","webpack://tui.ImageEditor/./src/js/ui/tools/colorpicker.js","webpack://tui.ImageEditor/./src/js/ui/tools/range.js","webpack://tui.ImageEditor/./src/js/util.js","webpack://tui.ImageEditor/./src/svg/default.svg","webpack://tui.ImageEditor/external {\"commonjs\":[\"fabric\",\"fabric\"],\"commonjs2\":[\"fabric\",\"fabric\"],\"amd\":\"fabric\",\"root\":\"fabric\"}","webpack://tui.ImageEditor/external {\"commonjs\":\"tui-code-snippet\",\"commonjs2\":\"tui-code-snippet\",\"amd\":\"tui-code-snippet\",\"root\":[\"tui\",\"util\"]}","webpack://tui.ImageEditor/external {\"commonjs\":\"tui-color-picker\",\"commonjs2\":\"tui-color-picker\",\"amd\":\"tui-color-picker\",\"root\":[\"tui\",\"colorPicker\"]}"],"names":["module","exports","ImageEditor","getActions","main","_mainAction","shape","_shapeAction","crop","_cropAction","flip","_flipAction","rotate","_rotateAction","text","_textAction","mask","_maskAction","draw","_drawAction","icon","_iconAction","filter","_filterAction","history","_historyAction","exitCropOnAction","ui","submenu","stopDrawingMode","changeMenu","setAngleRangeBarOnAction","angle","setRangeBarAngle","setFilterStateRangeBarOnAction","filterOptions","setFilterState","onEndUndoRedo","result","toggleZoomMode","zoomMode","_graphics","getZoomMode","zoomModes","ZOOM","startDrawingMode","drawingModes","startZoomInMode","endZoomInMode","toggleHandMode","HAND","startHandMode","endHandMode","initLoadImage","imagePath","imageName","loadImageFromURL","then","sizeValue","initializeImgUrl","resizeEditor","imageSize","clearUndoStack","_invoker","fire","eventNames","EXECUTE_COMMAND","historyNames","LOAD_IMAGE","undo","isEmptyUndoStack","deactivateAll","redo","isEmptyRedoStack","reset","_initHistory","delete","changeHelpButtonEnabled","removeActiveObject","activeObjectId","deleteAll","clearObjects","load","file","alert","URL","createObjectURL","loadImageFromFile","activeMenuEvent","_clearHistory","message","Promise","reject","download","dataURL","toDataURL","getImageName","blob","type","w","window","saveAs","split","pop","open","document","body","innerHTML","event","toggleHistoryMenu","zoomIn","toggleZoomButtonStatus","zoomOut","hand","offZoomInButtonStatus","_commonAction","changeColor","color","changeIconColor","addIcon","iconType","iconColor","setDrawingIcon","cancelAddIcon","clearIconType","changeSelectableAll","changeCursor","registerDefaultIcons","path","iconObj","registerIcons","registerCustomIcon","imgUrl","imagetracer","Imagetracer","imageToSVG","svgstr","match","svgPath","name","left","top","tracerDefaultOption","setDrawMode","settings","setColor","setBrush","addImageObject","revokeObjectURL","LOAD_MASK_IMAGE","applyFilter","maskObjId","changeTextStyle","styleObj","isSilent","setAngle","changeShape","changeShapeObject","setDrawingShape","shapeType","cropRect","getCropzoneRect","CROP","cancel","preset","presetType","setCropzoneRect","changeApplyButtonStatus","flipType","applying","options","hasFilter","removeFilter","setReAction","on","undoStackChanged","length","redoStackChanged","objectActivated","obj","id","indexOf","setShapeStatus","strokeColor","stroke","strokeWidth","fillColor","fill","setMaxStrokeValue","Math","min","width","height","changeStandbyMode","setTextStyleStateOnAction","setIconPickerColor","addText","pos","textColor","fontSize","fontStyle","fontWeight","underline","fontFamily","position","originPosition","styles","addObjectAfter","objectScaled","strokeValue","getStrokeValue","setStrokeValue","selectionCleared","count","TEXT","CROPPER","SHAPE","modeChange","menu","drawingMenuNames","_changeActivateMode","bind","discardSelection","mixin","prototype","ICON","componentNames","command","commandNames","ADD_ICON","execute","graphics","iconComp","getComponent","add","objectProps","undoData","object","getObject","remove","resolve","commandFactory","register","ADD_IMAGE_OBJECT","ADD_OBJECT","contains","rejectMessages","addedObject","noObject","ADD_SHAPE","shapeComp","ADD_TEXT","textComp","undoObject","textObject","FILTER","cachedUndoDataForSilent","makeUndoData","prevfilterOption","APPLY_FILTER","filterComp","maskObj","isType","invalidParameters","snippet","extend","isRedo","getOptions","setUndoData","setActiveObject","CHANGE_ICON_COLOR","targetObj","getColor","CHANGE_SELECTION","props","forEach","prop","setObjectProperties","datum","forEachOwnProperties","value","key","CHANGE_SHAPE","change","CHANGE_TEXT","getText","textObj","undoValue","CHANGE_TEXT_STYLE","setStyle","CLEAR_OBJECTS","objects","removeAll","FLIP","FLIP_IMAGE","flipComp","setting","getCurrentSetting","set","IMAGE_LOADER","loader","prevImage","getCanvasImage","prevImageWidth","prevImageHeight","objectItem","evented","image","newImage","oldWidth","oldHeight","newWidth","newHeight","REMOVE_FILTER","REMOVE_OBJECT","removeObjectById","RESIZE_CANVAS_DIMENSION","dimension","size","cssMaxWidth","cssMaxHeight","setCssMaxDimension","adjustCanvasDimension","ROTATION","rotationComp","getCurrentAngle","ROTATE_IMAGE","args","SET_OBJECT_POSITION","posInfo","objectId","getObjectProperties","setObjectPosition","renderAll","SET_OBJECT_PROPERTIES","MOUSE_MOVE_THRESHOLD","DEFAULT_OPTION","presetRatio","Cropper","_cropzone","_startX","_startY","_withShiftKey","_listeners","keydown","_onKeyDown","keyup","_onKeyUp","mousedown","_onFabricMouseDown","mousemove","_onFabricMouseMove","mouseup","_onFabricMouseUp","canvas","getCanvas","forEachObject","Cropzone","cornerSize","cornerColor","CROPZONE_DEFAULT_OPTIONS","cropSelectionStyle","discardActiveObject","selection","defaultCursor","fabric","util","addListener","cropzone","off","removeListener","visible","fEvent","target","coord","getPointer","e","x","y","pointer","abs","_calcRectDimensionFromPoint","canvasWidth","getWidth","canvasHeight","getHeight","startX","startY","listeners","containsCropzone","imageData","url","isValid","_getPresetPropertiesForCropSize","originalWidth","originalHeight","standardSize","getScale","orignalValue","scaleWidth","map","scaleHeight","keyCode","keyCodes","SHIFT","Component","filters","Image","Mask","Sharpen","Emboss","ColorFilter","Filter","sourceImg","_getSourceImage","imgFilter","_getFilter","_createFilter","_changeFilterValues","_apply","action","unsupportedOperation","_removeFilter","callback","push","applyFilters","filterObj","fabricType","_getFabricFilterType","ImageFilter","item","i","charAt","toUpperCase","slice","Flip","canvasImage","flipX","flipY","newSetting","isChangingFlipX","isChangingFlipY","setImageProperties","_invertAngle","_flipObjects","parseFloat","setCoords","current","FreeDrawing","FREE_DRAWING","oColor","Color","isDrawingMode","brush","freeDrawingBrush","toRgba","pathMap","arrow","Icon","_oColor","_pathMap","_type","_iconColor","_handlers","selectionStyle","fObjectOptions","SELECTION_STYLE","_createIcon","_icon","controlStyle","createObjectProperties","pathInfos","get","Path","_startPoint","events","moveOriginPointer","scaleX","scaleY","OBJECT_ADDED","imageOption","padding","crossOrigin","ImageLoader","img","promise","backgroundImage","setCanvasImage","_setBackgroundImage","oImage","loadImage","setBackgroundImage","getElement","loadingImageFailed","Line","LINE","_width","arrowType","head","tail","_arrowType","setHeadOption","points","_line","ArrowLine","_createLineEventObjectProperties","x2","y2","params","x1","y1","startPosition","endPosition","Rotation","oldAngle","oldImageCenter","getCenterPoint","newImageCenter","_rotateForEachObject","angleDiff","centerDiff","objCenter","radian","degreesToRadians","newObjCenter","rotatePoint","additionalAngle","SHAPE_INIT_OPTIONS","rx","ry","SHAPE_DEFAULT_OPTIONS","DEFAULT_TYPE","DEFAULT_WIDTH","DEFAULT_HEIGHT","makeFabricFillOption","createStaticCanvas","fillOption","fillType","extOption","newStaticCanvas","Shape","_shapeObj","_options","_isSelected","uniformScaling","extendOption","_extendOptions","shapeObj","_createInstance","objectProperties","_bindEventOnShape","_resetPositionFillFilter","unsupportedType","hasFillOption","fillProp","SHAPE_FILL_TYPE","fillImage","filterOption","COLOR","originalShapeObj","instance","Rect","Ellipse","Triangle","selectionStyles","self","added","resizeHelper","setOrigins","selected","deselected","modified","currentObj","adjustOriginToCenter","modifiedInGroup","activeSelection","_fillFilterRePositionInGroupSelection","moving","rotating","scaling","setCursor","resize","startPointX","startPointY","isRegular","KEY_CODES","patternSourceCanvas","originalAngle","originX","originY","addWithUpdate","realizeTransform","defaultStyles","resetStyles","textAlign","DBCLICK_TIME","Text","_defaultStyles","_selectedObj","_editingObj","select","_onFabricSelect","selectClear","_onFabricSelectClear","_onFabricScaling","textChanged","_onFabricTextChanged","_textarea","_ratio","_lastClickTime","Date","getTime","_editingObjInfos","isPrevEditing","adjustOriginPosition","setCanvasRatio","editStatus","getPointByOrigin","newText","_setInitPos","isExisty","autofocus","IText","enterEditing","selectAll","getActiveObject","activeObj","val","_getTextDecorationAdaptObject","textDecoration","state","canvasElement","getCanvasElement","cssWidth","parseInt","style","maxWidth","originWidth","linethrough","overline","ratio","getCanvasRatio","textareaStyle","ceil","setTimeout","editingObj","editingObjInfos","textContent","transWidth","transHeight","display","stamp","TEXT_CHANGED","scrollLeft","scrollTop","getSelectedObj","setSelectedInfo","_fireAddText","originPointer","clientPosition","clientX","clientY","newClickTime","_isDoubleClick","isEditing","TEXT_EDITING","DEFAULT_SCROLL_OPTION","opacity","selectable","hoverCursor","DEFAULT_VERTICAL_SCROLL_RATIO","SIZE","MARGIN","BORDER_RADIUS","DEFAULT_HORIZONTAL_SCROLL_RATIO","DEFAULT_ZOOM_LEVEL","Zoom","zoomArea","_centerPoints","zoomLevel","DEFAULT","startZoom","_onMouseDownWithZoomMode","moveZoom","_onMouseMoveWithZoomMode","stopZoom","_onMouseUpWithZoomMode","startHand","_onMouseDownWithHandMode","moveHand","_onMouseMoveWithHandMode","stopHand","_onMouseUpWithHandMode","zoomChanged","_changeScrollState","aspectRatio","_verticalScroll","_horizontalScroll","ZOOM_CHANGED","withSpace","SPACE","preventDefault","_changeObjectsEventedState","_startHandPoint","HAND_STARTED","HAND_STOPPED","deltaX","deltaY","center","_getCenterPoint","_isMaxZoomLevel","prevZoomLevel","zoomToPoint","_fireZoomChanged","centerPoints","prevX","prevY","_isDefaultZoomLevel","point","setViewportTransform","_movePointOfZoom","viewport","tl","tr","bl","viewportWidth","viewportHeight","horizontalScrollWidth","horizontalScrollHeight","horizontalScrollLeft","horizontalScrollMargin","horizontalScrollBorderRadius","verticalScrollWidth","verticalScrollHeight","verticalScrollTop","verticalScrollMargin","verticalScrollBorderRadius","_addScrollBar","scrollBarTid","clearTimeout","calcViewportBoundaries","ZOOM_HELP_MENUS","COMMAND_HELP_MENUS","DELETE_HELP_MENUS","HELP_MENUS","SHAPE_TYPE","OBJ_TYPE","CROPZONE","filterType","VINTAGE","SEPIA2","REMOVE_COLOR","COLOR_FILTER","REMOVE_WHITE","BLEND_COLOR","BLEND","lockSkewingX","lockSkewingY","bringForward","hasRotatingPoint","hasBorders","lockScalingFlip","lockRotation","OBJECT_ACTIVATED","OBJECT_MOVED","OBJECT_SCALED","OBJECT_CREATED","OBJECT_ROTATED","OBJECT_MODIFIED","ICON_CREATE_RESIZE","ICON_CREATE_END","ADD_OBJECT_AFTER","MOUSE_DOWN","MOUSE_UP","MOUSE_MOVE","REDO_STACK_CHANGED","UNDO_STACK_CHANGED","SELECTION_CLEARED","SELECTION_CREATED","AFTER_UNDO","AFTER_REDO","ADD_MASK_IMAGE","Z","Y","C","V","BACKSPACE","DEL","ARROW_DOWN","ARROW_UP","borderColor","transparentCorners","invalidDrawingMode","isLock","noActiveObject","rotation","defaultIconPath","defaultRotateRangeValues","realTimeEvent","max","defaultDrawRangeValues","defaultShapeStrokeValues","defaultTextRangeValues","defaultFilterRangeValues","tintOpacityRange","useDecimal","removewhiteDistanceRange","brightnessRange","noiseRange","pixelateRange","colorfilterThresholdRange","blurFilterRange","emptyCropRectValues","LEFT","TOP","WIDTH","HEIGHT","CropperDrawingMode","cropper","components","start","end","DrawingMode","FreeDrawingMode","freeDrawing","IconDrawingMode","LineDrawingMode","LINE_DRAWING","lineDrawing","ShapeDrawingMode","TextDrawingMode","ZoomDrawingMode","zoom","ARROW_ANGLE","CHEVRON_SIZE_RATIO","TRIANGLE_SIZE_RATIO","RADIAN_CONVERSION_VALUE","createClass","initialize","callSuper","_render","ctx","calcLinePoints","fromX","fromY","toX","toY","linePosition","lineWidth","_renderBasicLinePath","_drawDecoratorPath","_renderStroke","beginPath","moveTo","lineTo","_drawDecoratorPathType","_drawTrianglePath","_drawChevronPath","decorateSize","closePath","standardX","standardY","compareX","compareY","atan2","PI","rotatedPosition","changeAngle","getRotatePosition","distance","referencePosition","cos","sin","BaseFilter","threshold","applyTo","canvasEl","context","getContext","getImageData","data","filterColor","sourceFromHex","len","_getColor","_isOutsideThreshold","putImageData","color1","color2","diff","bytes","CORNER_TYPE_TOP_LEFT","CORNER_TYPE_TOP_RIGHT","CORNER_TYPE_MIDDLE_TOP","CORNER_TYPE_MIDDLE_LEFT","CORNER_TYPE_MIDDLE_RIGHT","CORNER_TYPE_MIDDLE_BOTTOM","CORNER_TYPE_BOTTOM_LEFT","CORNER_TYPE_BOTTOM_RIGHT","CORNER_TYPE_LIST","NOOP_FUNCTION","cornerTypeValid","selectedCorner","getScaleBasis","diffX","diffY","extendsOptions","_addEventHandler","canvasEventDelegation","eventName","delegationState","isRegistered","canvasEventTrigger","canvasEventRegister","eventTrigger","_onMoving","_onScaling","_renderCropzone","cropzoneDashLineWidth","cropzoneDashLineOffset","originalFlipX","originalFlipY","originalScaleX","originalScaleY","scale","_fillOuterRect","_fillInnerRect","_strokeBorder","lineDashWidth","lineDashOffset","fillStyle","_getCoordinates","save","restore","outerX","outerY","_caculateInnerPosition","strokeStyle","outer","halfWidth","halfHeight","setLineDash","maxLeft","maxTop","transform","corner","_calcScalingSizeFromPointer","isCornerTypeValid","_resizeCropZone","adjustRatioCropzoneSize","leftMaker","topMaker","maxHeight","scaleTo","maxScaleFactor","v","_getCropzoneRectInfo","getBoundingRect","rectTop","rectLeft","rectWidth","rectHeight","rectRight","rectBottom","resizeInfoMap","mt","ml","mr","mb","br","Convolute","matrix","BlendImage","pipelineState","maskCanvasEl","_createCanvasOfMask","maskCtx","_drawMask","_mapData","createCanvasElement","maskImg","translate","drawImage","imgHeight","imgWidth","sourceData","maskData","commands","create","actions","Command","types","messages","UN_IMPLEMENTATION","NO_COMPONENT_NAME","methodName","toLowerCase","func","isArray","isString","forEachArray","CustomEvents","DEFAULT_CSS_MAX_WIDTH","DEFAULT_CSS_MAX_HEIGHT","EXTRA_PX_FOR_PASTE","cssOnly","backstoreOnly","Graphics","element","targetObjectForCopyPaste","_objects","_canvas","_drawingMode","NORMAL","_drawingModeMap","_componentMap","_handler","onMouseDown","_onMouseDown","onObjectAdded","_onObjectAdded","onObjectRemoved","_onObjectRemoved","onObjectMoved","_onObjectMoved","onObjectScaled","_onObjectScaled","onObjectModified","_onObjectModified","onObjectRotated","_onObjectRotated","onObjectSelected","_onObjectSelected","onPathCreated","_onPathCreated","onSelectionCleared","_onSelectionCleared","onSelectionCreated","_onSelectionCreated","_setObjectCachingToFalse","_setCanvasElement","_createDrawingModeInstances","_createComponents","_attachCanvasEvents","wrapperEl","clear","parentNode","removeChild","theArgs","getObjects","includesBackground","isValidGroup","isEmpty","hasOwnProperty","_activeObject","activeObject","isSelection","group","Group","_addFabricObject","getObjectId","ActiveSelection","mode","option","_isSameDrawingMode","drawingModeInstance","_getDrawingModeInstance","getDrawingMode","resetZoom","changeVisibility","dataUrl","maxDimension","_calcMaxDimension","setCanvasCssDimension","setCanvasBackstoreDimension","centerObject","setDimensions","withRendering","_callbackAfterLoadingImageObject","fromURL","getCenter","getCroppedImageData","drawingMode","compName","setStates","registerPaths","cursorType","clone","keys","targetOrigin","centerOrigin","staticCanvas","StaticCanvas","enableRetinaScaling","modeName","Object","objectCaching","selectedElement","nodeType","querySelector","nodeName","createElement","appendChild","Canvas","containerClass","_register","getName","wScaleFactor","hScaleFactor","floor","centerPos","handler","_removeFabricObject","_lazyFire","items","paramsMaker","existEventDelegation","predefinedKeys","_createTextProperties","makeFillPropertyForUserEvent","targetObject","isGroupSelect","targetObjects","newTargetObject","_cloneObject","addedObjects","getActiveSelectionFromObjects","_cloneObjectItem","all","_copyFabricObjectForPaste","clonedObject","addExtraPx","isReverse","_copyFabricObject","getCanvasSize","rightEdge","bottomEdge","cloned","processForCopiedObject","ImageTracer","pathomit","ltres","qtres","strokewidth","viewbox","linefilter","desc","rightangleenhance","pal","r","g","b","a","versionnumber","optionpresets","default","corsenabled","colorsampling","numberofcolors","mincolorratio","colorquantcycles","layering","roundcoords","lcpr","qcpr","blurradius","blurdelta","posterized1","posterized2","curvy","sharp","detailed","smoothed","grayscale","fixedpalette","randomsampling1","randomsampling2","artistic1","artistic2","artistic3","artistic4","posterized3","pathscan_combined_lookup","gks","specpalette","checkoptions","imagedataToSVG","getImgdata","imgd","td","imagedataToTracedata","getsvgstring","ii","colorquantization","tracedata","layers","palette","array","colornum","tracedlayer","batchtracepaths","internodes","pathscan","layeringstep","ls","layercontainerid","drawLayers","bps","batchpathscan","bis","batchinternodes","batchtracelayers","ok","k","arr","idx","cd","cdl","ci","paletteacc","pixelnum","j","cnt","generatepalette","samplepalette","samplepalette2","blur","n","random","ni","sqrt","nj","vx","vy","rcnt","gcnt","bcnt","graystep","colorqnum","pow","colorstep","rndnum","ah","aw","n1","n2","n3","n4","n5","n6","n7","n8","cnum","layer","paths","pacnt","pcnt","px","py","h","dir","pathfinished","holepath","lookuprow","boundingbox","holechildren","t","isholepath","parentidx","parentbbox","parentcnt","boundingboxincludes","childbbox","bpaths","ins","palen","nextidx","nextidx2","previdx","previdx2","testrightangle","linesegment","getdirection","idx1","idx2","idx3","idx4","idx5","binternodes","segtype1","segtype2","seqend","smp","segments","concat","fitseq","seqstart","errorpoint","errorval","curvepass","dist2","pl","fitpoint","t1","t2","t3","cpx","cpy","x3","y3","splitpoint","internodepaths","btracedpaths","tracepath","btbis","places","Number","toFixed","lnum","pathnum","str","tosvgcolorstr","roundtodec","hcnt","hsmp","lcnt","svgpathstring","c","parentid","div","getElementById","radius","delta","d","racc","gacc","bacc","aacc","wacc","imgd2","thisgk","himgd","Uint8ClampedArray","src","onload","torgbastr","fillRect","setCachedUndoDataForDimension","getCachedUndoDataForDimension","makeSelectionUndoData","makeSelectionUndoDatum","cachedUndoDataForChangeDimension","undoDatumMaker","getFillImageFromShape","rePositionFilterTypeFillImage","makeFilterOptionFromFabricImage","makeFillPatternForFilter","resetFillPatternCanvas","reMakePatternImageSource","getCachedCanvasImageElement","FILTER_OPTION_MAP","pixelate","POSITION_DIMENSION_MAP","FILTER_NAME_VALUE_MAP","cachedCanvasImageElement","rotatedShapeCornerDimension","getRotatedDimension","right","bottom","diffLeft","diffTop","cropX","cropY","fillImageMaxSize","calculateFillImageDimensionOutsideCanvas","imageObject","overflowAreaPositionFixer","outDistance","imageLeft","imageTop","calculateDistanceOverflowPart","calculateDimensionLeftTopEdge","calculateDimensionRightBottomEdge","insideCanvasRealImageWidth","insideCanvasRealImageHeight","cropDistance2","cropDistance","compareSize","copiedCanvasElement","makeFillImage","fabricProperty","Pattern","source","repeat","innerImage","newFillImage","toCanvasElement","shapePointNavigation","getShapeEdgePoint","shapeNeighborPointNavigation","linePointsOutsideCanvas","calculateLinePointsOutsideCanvas","reatAngles","calculateLineAngleOfOutsideCanvas","startPointIndex","diffPosition","getReversePositionForFlip","rotationChangePoint1","rotationChangePoint2","isForward","isReverseLeftPositionForFlip","isReverseTopPositionForFlip","minimumPoint","minimumPointIndex","index","endPointIndex1","endPointIndex2","linePointsOfOneVertexIndex","horizontalVerticalAngle","pointIndex","startPoint","endPoint","ax","ay","bx","by","cx","cy","dx","dy","currentCanvasImageAngle","fabricFilterClassName","DIVISOR","rect","circle","triangle","DIMENSION_KEYS","setStartPoint","originKey","substring","origins","getPositionsOfRotatedOrigin","origin","sx","sy","hasCenterOrigin","adjustOriginByStartPoint","centerPoint","originPositions","adjustOriginByMovingPointer","setPositionByOrigin","adjustDimensionOnScaling","dimensionKeys","maxScale","hasControls","adjustDimensionOnMouseMove","divisor","isTriangle","leftTopPoint","rightTopPoint","rightBottomPoint","leftBottomPoint","lt","rt","rb","lb","isScaling","isUndefined","wrapper","includeUI","usageStatistics","UIOption","UI","setUiDefaultSelectionStyle","Invoker","getEditorArea","_onObjectActivated","objectMoved","objectRotated","objectAdded","objectModified","createdPath","_onCreatedPath","_onAddText","addObject","_onAddObject","textEditing","_onTextEditing","_onTextChanged","iconCreateResize","_onIconCreateResize","iconCreateEnd","_onIconCreateEnd","_selectionCleared","selectionCreated","_selectionCreated","_attachInvokerEvents","_attachGraphicsEvents","_attachDomEvents","_setSelectionStyle","applyCropSelectionStyle","applyGroupSelectionStyle","initCanvas","enableGLFiltering","setSelectionStyle","setCropSelectionStyle","eventTarget","addEventListener","removeEventListener","ctrlKey","metaKey","isModifierKey","resetTargetObjectForCopyPaste","pasteObject","clearRedoStack","isDeleteKey","isRemoveReady","isReadyRemoveObject","getActiveObjectIdForRemove","removeObject","pushUndoStack","initHistory","clearHistory","commandName","executeSilent","iterationCount","imgFile","_flip","_rotate","setIconStyle","_setPositions","executeMethodName","_pushAddObjectCommand","_pushModifyObjectCommand","infos","_detachDomEvents","destroy","centerPosition","keyValue","getObjectPosition","createMessage","errorMessage","errorTypes","executeCallback","undoCallback","Error","apply","getEditor","isFunction","_undoStack","_redoStack","_isLocked","_isSilent","lock","unlock","pushRedoStack","_invokeExecution","_fireUndoStackChanged","_invokeUndo","_fireRedoStackChanged","Element","matches","msMatchesSelector","webkitMatchesSelector","closest","s","el","documentElement","parentElement","createElementNS","view","classListProp","protoProp","elemCtrProto","objCtr","strTrim","String","trim","replace","arrIndexOf","Array","DOMEx","code","DOMException","checkTokenAndGetIndex","classList","token","test","call","ClassList","elem","trimmedClasses","getAttribute","classes","_updateClassName","setAttribute","toString","classListProto","classListGetter","tokens","arguments","l","updated","splice","toggle","force","method","join","defineProperty","classListPropDesc","enumerable","configurable","ex","number","undefined","__defineGetter__","testElement","createMethod","original","DOMTokenList","_toggle","cache","checkUseElems","tid","debouncedCheck","unobserveChanges","observeChanges","observer","MutationObserver","observe","childList","subtree","attributes","disconnect","ignore","createRequest","getOrigin","loc","protocol","href","host","Request","origin2","XMLHttpRequest","location","withCredentials","XDomainRequest","xlinkNS","base","bcr","fallback","hash","inProgressCount","isHidden","uses","xhr","observeIfDone","attrUpdateFunc","spec","useEl","setAttributeNS","hasAttribute","onloadFunc","svg","responseText","getElementsByTagName","overflow","insertBefore","firstChild","onErrorTimeout","onerror","ontimeout","getBoundingClientRect","getAttributeNS","send","abort","winLoad","readyState","SUB_UI_COMPONENT","Crop","Rotate","Draw","BI_EXPRESSION_MINSIZE_WHEN_TOP_POSITION","HISTORY_MENU","HISTORY_PANEL_CLASS_NAME","CLASS_NAME_ON","ZOOM_BUTTON_TYPE","ZOOM_IN","Ui","_initializeOption","_actions","uiSize","_locale","Locale","locale","theme","Theme","eventHandler","_submenuChangeTransection","_selectedElement","_mainElement","_editorElementWrap","_editorElement","_menuBarElement","_subMenuElement","_makeUiElement","_setUiSize","_initMenuEvent","_makeSubMenu","_attachHistoryEvent","_attachZoomEvent","_removeUiEvent","_destroyAllMenu","cornerStyle","cornerStrokeColor","_getCanvasMaxDimension","editorElementStyle","menuBarPosition","_setEditorPosition","selectElementClassList","offsetWidth","targetClassList","_buttonElements","zoomInClassList","enabled","handClassList","buttonType","enableStatus","buttonClassList","menuIconPath","initMenu","elementDimension","menuName","SubComponentClass","$0","_makeMenuElement","makeSvgIcon","makeMenSvgIconSet","_addHistory","_selectPrevHistory","_selectNextHistory","changeHandButtonStatus","selector","biImage","getStyle","loadButtonStyle","downloadButtonStyle","commonStyle","headerStyle","submenuStyle","_helpMenuBarElement","querySelectorAll","_addHelpMenus","_historyMenu","History","_activateZoomMenus","helpMenuWithPartition","_makeHelpMenuWithPartition","_makeMenuPartitionElement","partitionElement","partitionInnerElement","className","useIconTypes","menuType","btnElement","menuItemHtml","_addTooltipAttribute","helpName","historyTitle","init","prev","next","historyButtonClassList","tooltipName","localize","files","addEvent","_addMainMenuEvent","_addSubMenuEvent","_addHelpActionEvent","_addDownloadEvent","_addMenuEvent","_initMenu","_removeHelpActionEvent","_removeDownloadEvent","_removeLoadEvent","_removeMainMenuEvent","removeEvent","loadImageInfo","_getLoadImage","_addLoadEvent","gridVisual","grid","_editorContainerElement","_changeMenu","changeStartMode","evt","createEvent","initEvent","dispatchEvent","registerDefaultIcon","scrollHeight","offsetHeight","scrollWidth","subMenuElement","templateHtml","status","_els","defaultPresetButton","_removeEvent","_applyEventHandler","_cancelEventHandler","cropzonePreset","_cropzonePresetEventHandler","button","_setPresetButtonActive","presetButton","Submenu","DRAW_OPACITY","lineSelectButton","drawColorPicker","Colorpicker","toggleDirection","drawRange","Range","slider","input","changeDrawType","_changeDrawType","_changeDrawColor","_changeDrawRange","lineType","getButtonType","PICKER_CONTROL_HEIGHT","BLEND_OPTIONS","FILTER_OPTIONS","filterNameMap","invert","sepia","sharpen","emboss","removeWhite","brightness","contrast","saturation","vintage","polaroid","noise","colorFilter","tint","multiply","blend","hue","gamma","RANGE_INSTANCE_NAMES","COLORPICKER_INSTANCE_NAMES","selectBoxShow","checkedMap","_makeControlElement","_destroyToolInstance","filterCheckElement","filterNameCamelCase","instanceName","blendType","changeBlendFilter","changeFilterState","filterName","_changeFilterState","changeFilterStateForRange","isLast","blandTypeClick","stopPropagation","filterBlendColor","filterMultiplyColor","filterTintColor","tintOpacity","colorPickerChangeShow","changedFilterInfos","_getFilterNameFromOptions","isRemove","_setFilterState","checked","blocksize","alpha","useAlpha","checkboxGroup","_getFilterOption","blurRange","FILTER_RANGE","_pickerWithRange","pickerControl","_pickerWithSelectbox","colorPickerControls","rangeWrap","rangeLabel","selectlistWrap","selectlist","optionlist","_makeSelectOptionList","_drawSelectOptionList","_pickerWithSelectboxForAddEvent","optionElement","optionValue","fireEvent","selectOption","flipStatus","flipButton","changeFlip","_changeFlip","flipClassList","historyClassName","selectedClassName","disabledClassName","menuElement","_eventHandler","_historyIndex","getListLength","detail","_hasDisabledItem","deleteListItemElement","html","makeListItemElement","pushListItemElement","_selectItem","_clickHistoryItem","listElement","removeClass","addClass","_addHistoryEventListener","_removeHistoryEventListener","Panel","_iconMap","registerIconButton","addIconButton","iconColorpicker","registerIcon","_registerIconHandler","_addIconHandler","_changeColorHandler","isSupportFileApi","applyButton","maskImageButton","loadMaskFile","_loadMaskFile","applyMask","_applyMask","panelElement","_makePanelElement","_makeListElement","panel","list","listItem","CLOCKWISE","COUNTERCLOCKWISE","_value","rotateButton","rotateRange","resultAngle","_setRangeBarRatio","rotationAngleChanged","_changeRotateForButton","_changeRotateForRange","rotateType","rotateAngle","clockwise","counterclockwise","newAngle","isRotatable","SHAPE_DEFAULT_OPTION","shapeSelectButton","shapeColorButton","strokeRange","fillColorpicker","strokeColorpicker","shapeTypeSelected","_changeShapeHandler","_changeStrokeRangeHandler","_changeFillColorHandler","_changeStrokeColorHandler","maxValue","strokeMaxValue","trigger","currentTarget","_makeSubMenuElement","selectName","occurredControl","hide","buttonNames","RegExp","iconStyle","iconSubMenu","subMenuLabelActive","subMenuLabelNormal","subMenuRangeTitle","submenuPartitionVertical","submenuPartitionHorizontal","submenuCheckbox","submenuRangePointer","submenuRangeValue","submenuColorpickerTitle","submenuColorpickerButton","submenuRangeBar","submenuRangeSubbar","submenuDisabledRangePointer","submenuDisabledRangeBar","submenuDisabledRangeSubbar","submenuIconSize","menuIconSize","biSize","menuIconStyle","submenuIconStyle","normal","active","hover","disabled","effect","bold","italic","align","textEffectButton","textAlignButton","textColorpicker","textRange","setTextEffect","_setTextEffectHandler","setTextAlign","_setTextAlignHandler","_changeTextRnageHandler","textStyle","setEffectState","setAlignState","effectName","effectValue","styleType","customTheme","_changeToObject","standardTheme","_styleMaker","_loadDefaultSvgIcon","firstProperty","_makeCssText","vertical","borderLeft","horizontal","borderBottom","backgroundColor","submenuLabelStyle","submenuPartitionStyle","styleOptions","styleObject","keyExplode","property","subProperty","converterStack","_toUnderScore","targetString","$1","parser","DOMParser","dom","parseFromString","isSubmenu","iconStyleInfo","svgIconPrefix","_makeSvgIconPrefix","iconName","svgIconClassName","_makeIconClassName","_makeSvgItem","PICKER_COLOR","colorpickerElement","defaultColor","_show","_colorpickerElement","_toggleDirection","_makePickerButtonElement","_makePickerLayerElement","_color","picker","tuiColorPicker","container","pickerElement","_addEvent","colorElement","title","label","_changeColorElement","pickerToggle","_pickerToggleEventHandler","pickerHide","isInPickerControl","_isElementInColorPickerControl","_isPaletteButton","_setPickerControlPosition","halfPickerWidth","clientWidth","INPUT_FILTER_REGEXP","rangeElements","rangeElement","rangeInputElement","_drawRangeElement","rangeWidth","_getRangeWidth","_min","_max","_useDecimal","_absMax","startChangingSlide","_startChangingSlide","stopChangingSlide","_stopChangingSlide","changeSlide","_changeSlide","changeSlideFinally","_changeSlideFinally","changeInput","_changeValueWithInput","changeInputFinally","changeInputWithArrow","_changeValueWithInputKeyEvent","_addClickEvent","_addDragEvent","_addInputEvent","_removeClickEvent","_removeDragEvent","_removeInputEvent","getElementWidth","getComputedStyle","bar","subbar","_valueUpDownForKeyEvent","unChanged","clampValue","step","stringValue","_filterForInputText","waitForChange","isNaN","changePosition","screenX","firstPosition","touchPx","firstLeft","resultValue","isValueChanged","offsetX","inputValue","absValue","leftPosition","clamp","keyMirror","makeStyleText","getProperties","toInteger","toCamelCase","getRgb","sendHostName","styleLoad","getSelector","base64ToBlob","fixFloatingPoint","assignmentForDestroy","cls","changeOrigin","flipObject","setCustomProperty","getCustomProperty","capitalizeString","includes","getFillTypeFromOption","getFillTypeFromObject","isShape","getObjectType","isSilentCommand","getHistoryTitle","getHelpMenuBarPosition","isEmptyCropzone","FLOATING_POINT_DIGIT","CSS_PREFIX","hostnameSent","minValue","styleStr","File","FileList","FileReader","styleBuffer","tagId","linkElement","styleData","encodeURIComponent","targetElement","rImageType","mimeString","raw","uInt8Array","header","imageType","atob","rawLength","Uint8Array","charCodeAt","Blob","prefix","fObject","customProps","propNames","resultObject","propName","targetArray","compareValue","toStartOfCapital","getFilterType","historyInfo","first"],"mappings":";;;;;;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iCAAiC;AACjC,CAAC;AACD,O;QCVA;QACA;;QAEA;QACA;;QAEA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;;QAEA;QACA;;QAEA;QACA;;QAEA;QACA;QACA;;;QAGA;QACA;;QAEA;QACA;;QAEA;QACA;QACA;QACA,0CAA0C,gCAAgC;QAC1E;QACA;;QAEA;QACA;QACA;QACA,wDAAwD,kBAAkB;QAC1E;QACA,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ACA;;AAEA;AACA;AACA;;;;;;;;;;;;ACTA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;AClCA,gBAAgB,mBAAO,CAAC,kGAAgC;;AAExD;;;;;;;;;;;;ACFA,iBAAiB,mBAAO,CAAC,wFAA2B;;AAEpD;;;;;;;;;;;;ACFA,aAAa,mBAAO,CAAC,4EAAqB;AAC1C,gBAAgB,mBAAO,CAAC,kGAAgC;;AAExD;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,CAAC;AACD;AACA;AACA;AACA;AACA;AACA;;AAEA;;;;;;;;;;;;ACnBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;;ACTa;AACb,aAAa,mBAAO,CAAC,4EAAqB;AAC1C,+BAA+B,mBAAO,CAAC,oIAAiD;AACxF,eAAe,mBAAO,CAAC,kFAAwB;AAC/C,WAAW,mBAAO,CAAC,wEAAmB;AACtC,WAAW,mBAAO,CAAC,0GAAoC;AACvD,kCAAkC,mBAAO,CAAC,4HAA6C;AACvF,UAAU,mBAAO,CAAC,sEAAkB;;AAEpC;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP,KAAK;AACL;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,sFAAsF;;AAEtF,iEAAiE;AACjE;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA,KAAK;;AAEL;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA,+DAA+D;AAC/D;AACA;AACA;AACA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AAO,CAAC,kGAAgC;;AAEzD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,sBAAsB,cAAc,eAAe,cAAc;AACjE;AACA;AACA;AACA,qCAAqC,cAAc;AACnD,CAAC;;AAED;AACA,yDAAyD,cAAc;AACvE,CAAC;;AAED;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,oCAAoC;AACpC;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW;AACX;AACA,WAAW;AACX,SAAS;AACT,OAAO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG,eAAe;AAClB;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT,OAAO;AACP;AACA;AACA;AACA;AACA,GAAG;AACH;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,KAAK;AACL,GAAG;AACH;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,uBAAuB;AACvB;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,OAAO;AACP,KAAK;AACL;AACA;AACA;AACA;AACA,GAAG;AACH,6BAA6B,cAAc;AAC3C;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA,KAAK,GAAG,eAAe;;AAEvB;AACA,wCAAwC,+CAA+C;AACvF;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;;AAEA,GAAG,2CAA2C;AAC9C;AACA,CAAC;;AAED;AACA;;AAEA;;AAEA;AACA,GAAG,8CAA8C;AACjD;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;;AAED,GAAG,yDAAyD;AAC5D;AACA;AACA;AACA;AACA;AACA,CAAC;;AAED,GAAG,2DAA2D;AAC9D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT,OAAO;AACP;AACA,KAAK;AACL;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP,KAAK;AACL;AACA;AACA;AACA,CAAC;;;;;;;;;;;;;AC1XY;AACb,aAAa,mBAAO,CAAC,gGAA+B;AACpD,0BAA0B,mBAAO,CAAC,4FAA6B;AAC/D,qBAAqB,mBAAO,CAAC,8FAA8B;;AAE3D;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA,CAAC;AACD;AACA;AACA;AACA;AACA,sCAAsC;AACtC;AACA;AACA,UAAU;AACV,CAAC;;;;;;;;;;;;;AC5BY;AACb,QAAQ,mBAAO,CAAC,4EAAqB;AACrC,kBAAkB,mBAAO,CAAC,sFAA0B;AACpD,qBAAqB,mBAAO,CAAC,8GAAsC;AACn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AA1C,IAAmD/mB,WAAWgnB,MAArE;AACD,C;;;;;;;;;;;ACvhBD,2uwB;;;;;;;;;;;ACAA,oD;;;;;;;;;;;ACAA,8D;;;;;;;;;;;ACAA,8D","file":"tui-image-editor.js","sourcesContent":["(function webpackUniversalModuleDefinition(root, factory) {\n\tif(typeof exports === 'object' && typeof module === 'object')\n\t\tmodule.exports = factory(require(\"fabric\")[\"fabric\"], require(\"tui-code-snippet\"), require(\"tui-color-picker\"));\n\telse if(typeof define === 'function' && define.amd)\n\t\tdefine([\"fabric\", \"tui-code-snippet\", \"tui-color-picker\"], factory);\n\telse if(typeof exports === 'object')\n\t\texports[\"ImageEditor\"] = factory(require(\"fabric\")[\"fabric\"], require(\"tui-code-snippet\"), require(\"tui-color-picker\"));\n\telse\n\t\troot[\"tui\"] = root[\"tui\"] || {}, root[\"tui\"][\"ImageEditor\"] = factory(root[\"fabric\"], root[\"tui\"][\"util\"], root[\"tui\"][\"colorPicker\"]);\n})(window, function(__WEBPACK_EXTERNAL_MODULE_fabric__, __WEBPACK_EXTERNAL_MODULE_tui_code_snippet__, __WEBPACK_EXTERNAL_MODULE_tui_color_picker__) {\nreturn "," \t// The module cache\n \tvar installedModules = {};\n\n \t// The require function\n \tfunction __webpack_require__(moduleId) {\n\n \t\t// Check if module is in cache\n \t\tif(installedModules[moduleId]) {\n \t\t\treturn installedModules[moduleId].exports;\n \t\t}\n \t\t// Create a new module (and put it into the cache)\n \t\tvar module = installedModules[moduleId] = {\n \t\t\ti: moduleId,\n \t\t\tl: false,\n \t\t\texports: {}\n \t\t};\n\n \t\t// Execute the module function\n \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n \t\t// Flag the module as loaded\n \t\tmodule.l = true;\n\n \t\t// Return the exports of the module\n \t\treturn module.exports;\n \t}\n\n\n \t// expose the modules object (__webpack_modules__)\n \t__webpack_require__.m = modules;\n\n \t// expose the module cache\n \t__webpack_require__.c = installedModules;\n\n \t// define getter function for harmony exports\n \t__webpack_require__.d = function(exports, name, getter) {\n \t\tif(!__webpack_require__.o(exports, name)) {\n \t\t\tObject.defineProperty(exports, name, { enumerable: true, get: getter });\n \t\t}\n \t};\n\n \t// define __esModule on exports\n \t__webpack_require__.r = function(exports) {\n \t\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n \t\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n \t\t}\n \t\tObject.defineProperty(exports, '__esModule', { value: true });\n \t};\n\n \t// create a fake namespace object\n \t// mode & 1: value is a module id, require it\n \t// mode & 2: merge all properties of value into the ns\n \t// mode & 4: return value when already ns object\n \t// mode & 8|1: behave like require\n \t__webpack_require__.t = function(value, mode) {\n \t\tif(mode & 1) value = __webpack_require__(value);\n \t\tif(mode & 8) return value;\n \t\tif((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;\n \t\tvar ns = Object.create(null);\n \t\t__webpack_require__.r(ns);\n \t\tObject.defineProperty(ns, 'default', { enumerable: true, value: value });\n \t\tif(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));\n \t\treturn ns;\n \t};\n\n \t// getDefaultExport function for compatibility with non-harmony modules\n \t__webpack_require__.n = function(module) {\n \t\tvar getter = module && module.__esModule ?\n \t\t\tfunction getDefault() { return module['default']; } :\n \t\t\tfunction getModuleExports() { return module; };\n \t\t__webpack_require__.d(getter, 'a', getter);\n \t\treturn getter;\n \t};\n\n \t// Object.prototype.hasOwnProperty.call\n \t__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };\n\n \t// __webpack_public_path__\n \t__webpack_require__.p = \"/dist\";\n\n\n \t// Load entry module and return exports\n \treturn __webpack_require__(__webpack_require__.s = \"./src/index.js\");\n","require('../../modules/es.object.to-string');\nrequire('../../modules/es.string.iterator');\nrequire('../../modules/web.dom-collections.iterator');\nrequire('../../modules/es.promise');\nrequire('../../modules/es.promise.all-settled');\nrequire('../../modules/es.promise.finally');\nvar path = require('../../internals/path');\n\nmodule.exports = path.Promise;\n","var parent = require('../../es/promise');\nrequire('../../modules/esnext.aggregate-error');\n// TODO: Remove from `core-js@4`\nrequire('../../modules/esnext.promise.all-settled');\nrequire('../../modules/esnext.promise.try');\nrequire('../../modules/esnext.promise.any');\n\nmodule.exports = parent;\n","module.exports = function (it) {\n if (typeof it != 'function') {\n throw TypeError(String(it) + ' is not a function');\n } return it;\n};\n","var isObject = require('../internals/is-object');\n\nmodule.exports = function (it) {\n if (!isObject(it) && it !== null) {\n throw TypeError(\"Can't set \" + String(it) + ' as a prototype');\n } return it;\n};\n","module.exports = function () { /* empty */ };\n","module.exports = function (it, Constructor, name) {\n if (!(it instanceof Constructor)) {\n throw TypeError('Incorrect ' + (name ? name + ' ' : '') + 'invocation');\n } return it;\n};\n","var isObject = require('../internals/is-object');\n\nmodule.exports = function (it) {\n if (!isObject(it)) {\n throw TypeError(String(it) + ' is not an object');\n } return it;\n};\n","var toIndexedObject = require('../internals/to-indexed-object');\nvar toLength = require('../internals/to-length');\nvar toAbsoluteIndex = require('../internals/to-absolute-index');\n\n// `Array.prototype.{ indexOf, includes }` methods implementation\nvar createMethod = function (IS_INCLUDES) {\n return function ($this, el, fromIndex) {\n var O = toIndexedObject($this);\n var length = toLength(O.length);\n var index = toAbsoluteIndex(fromIndex, length);\n var value;\n // Array#includes uses SameValueZero equality algorithm\n // eslint-disable-next-line no-self-compare\n if (IS_INCLUDES && el != el) while (length > index) {\n value = O[index++];\n // eslint-disable-next-line no-self-compare\n if (value != value) return true;\n // Array#indexOf ignores holes, Array#includes - not\n } else for (;length > index; index++) {\n if ((IS_INCLUDES || index in O) && O[index] === el) return IS_INCLUDES || index || 0;\n } return !IS_INCLUDES && -1;\n };\n};\n\nmodule.exports = {\n // `Array.prototype.includes` method\n // https://tc39.github.io/ecma262/#sec-array.prototype.includes\n includes: createMethod(true),\n // `Array.prototype.indexOf` method\n // https://tc39.github.io/ecma262/#sec-array.prototype.indexof\n indexOf: createMethod(false)\n};\n","var anObject = require('../internals/an-object');\n\n// call something on iterator step with safe closing on error\nmodule.exports = function (iterator, fn, value, ENTRIES) {\n try {\n return ENTRIES ? fn(anObject(value)[0], value[1]) : fn(value);\n // 7.4.6 IteratorClose(iterator, completion)\n } catch (error) {\n var returnMethod = iterator['return'];\n if (returnMethod !== undefined) anObject(returnMethod.call(iterator));\n throw error;\n }\n};\n","var wellKnownSymbol = require('../internals/well-known-symbol');\n\nvar ITERATOR = wellKnownSymbol('iterator');\nvar SAFE_CLOSING = false;\n\ntry {\n var called = 0;\n var iteratorWithReturn = {\n next: function () {\n return { done: !!called++ };\n },\n 'return': function () {\n SAFE_CLOSING = true;\n }\n };\n iteratorWithReturn[ITERATOR] = function () {\n return this;\n };\n // eslint-disable-next-line no-throw-literal\n Array.from(iteratorWithReturn, function () { throw 2; });\n} catch (error) { /* empty */ }\n\nmodule.exports = function (exec, SKIP_CLOSING) {\n if (!SKIP_CLOSING && !SAFE_CLOSING) return false;\n var ITERATION_SUPPORT = false;\n try {\n var object = {};\n object[ITERATOR] = function () {\n return {\n next: function () {\n return { done: ITERATION_SUPPORT = true };\n }\n };\n };\n exec(object);\n } catch (error) { /* empty */ }\n return ITERATION_SUPPORT;\n};\n","var toString = {}.toString;\n\nmodule.exports = function (it) {\n return toString.call(it).slice(8, -1);\n};\n","var TO_STRING_TAG_SUPPORT = require('../internals/to-string-tag-support');\nvar classofRaw = require('../internals/classof-raw');\nvar wellKnownSymbol = require('../internals/well-known-symbol');\n\nvar TO_STRING_TAG = wellKnownSymbol('toStringTag');\n// ES3 wrong here\nvar CORRECT_ARGUMENTS = classofRaw(function () { return arguments; }()) == 'Arguments';\n\n// fallback for IE11 Script Access Denied error\nvar tryGet = function (it, key) {\n try {\n return it[key];\n } catch (error) { /* empty */ }\n};\n\n// getting tag from ES6+ `Object.prototype.toString`\nmodule.exports = TO_STRING_TAG_SUPPORT ? classofRaw : function (it) {\n var O, tag, result;\n return it === undefined ? 'Undefined' : it === null ? 'Null'\n // @@toStringTag case\n : typeof (tag = tryGet(O = Object(it), TO_STRING_TAG)) == 'string' ? tag\n // builtinTag case\n : CORRECT_ARGUMENTS ? classofRaw(O)\n // ES3 arguments fallback\n : (result = classofRaw(O)) == 'Object' && typeof O.callee == 'function' ? 'Arguments' : result;\n};\n","var fails = require('../internals/fails');\n\nmodule.exports = !fails(function () {\n function F() { /* empty */ }\n F.prototype.constructor = null;\n return Object.getPrototypeOf(new F()) !== F.prototype;\n});\n","'use strict';\nvar IteratorPrototype = require('../internals/iterators-core').IteratorPrototype;\nvar create = require('../internals/object-create');\nvar createPropertyDescriptor = require('../internals/create-property-descriptor');\nvar setToStringTag = require('../internals/set-to-string-tag');\nvar Iterators = require('../internals/iterators');\n\nvar returnThis = function () { return this; };\n\nmodule.exports = function (IteratorConstructor, NAME, next) {\n var TO_STRING_TAG = NAME + ' Iterator';\n IteratorConstructor.prototype = create(IteratorPrototype, { next: createPropertyDescriptor(1, next) });\n setToStringTag(IteratorConstructor, TO_STRING_TAG, false, true);\n Iterators[TO_STRING_TAG] = returnThis;\n return IteratorConstructor;\n};\n","var DESCRIPTORS = require('../internals/descriptors');\nvar definePropertyModule = require('../internals/object-define-property');\nvar createPropertyDescriptor = require('../internals/create-property-descriptor');\n\nmodule.exports = DESCRIPTORS ? function (object, key, value) {\n return definePropertyModule.f(object, key, createPropertyDescriptor(1, value));\n} : function (object, key, value) {\n object[key] = value;\n return object;\n};\n","module.exports = function (bitmap, value) {\n return {\n enumerable: !(bitmap & 1),\n configurable: !(bitmap & 2),\n writable: !(bitmap & 4),\n value: value\n };\n};\n","'use strict';\nvar $ = require('../internals/export');\nvar createIteratorConstructor = require('../internals/create-iterator-constructor');\nvar getPrototypeOf = require('../internals/object-get-prototype-of');\nvar setPrototypeOf = require('../internals/object-set-prototype-of');\nvar setToStringTag = require('../internals/set-to-string-tag');\nvar createNonEnumerableProperty = require('../internals/create-non-enumerable-property');\nvar redefine = require('../internals/redefine');\nvar wellKnownSymbol = require('../internals/well-known-symbol');\nvar IS_PURE = require('../internals/is-pure');\nvar Iterators = require('../internals/iterators');\nvar IteratorsCore = require('../internals/iterators-core');\n\nvar IteratorPrototype = IteratorsCore.IteratorPrototype;\nvar BUGGY_SAFARI_ITERATORS = IteratorsCore.BUGGY_SAFARI_ITERATORS;\nvar ITERATOR = wellKnownSymbol('iterator');\nvar KEYS = 'keys';\nvar VALUES = 'values';\nvar ENTRIES = 'entries';\n\nvar returnThis = function () { return this; };\n\nmodule.exports = function (Iterable, NAME, IteratorConstructor, next, DEFAULT, IS_SET, FORCED) {\n createIteratorConstructor(IteratorConstructor, NAME, next);\n\n var getIterationMethod = function (KIND) {\n if (KIND === DEFAULT && defaultIterator) return defaultIterator;\n if (!BUGGY_SAFARI_ITERATORS && KIND in IterablePrototype) return IterablePrototype[KIND];\n switch (KIND) {\n case KEYS: return function keys() { return new IteratorConstructor(this, KIND); };\n case VALUES: return function values() { return new IteratorConstructor(this, KIND); };\n case ENTRIES: return function entries() { return new IteratorConstructor(this, KIND); };\n } return function () { return new IteratorConstructor(this); };\n };\n\n var TO_STRING_TAG = NAME + ' Iterator';\n var INCORRECT_VALUES_NAME = false;\n var IterablePrototype = Iterable.prototype;\n var nativeIterator = IterablePrototype[ITERATOR]\n || IterablePrototype['@@iterator']\n || DEFAULT && IterablePrototype[DEFAULT];\n var defaultIterator = !BUGGY_SAFARI_ITERATORS && nativeIterator || getIterationMethod(DEFAULT);\n var anyNativeIterator = NAME == 'Array' ? IterablePrototype.entries || nativeIterator : nativeIterator;\n var CurrentIteratorPrototype, methods, KEY;\n\n // fix native\n if (anyNativeIterator) {\n CurrentIteratorPrototype = getPrototypeOf(anyNativeIterator.call(new Iterable()));\n if (IteratorPrototype !== Object.prototype && CurrentIteratorPrototype.next) {\n if (!IS_PURE && getPrototypeOf(CurrentIteratorPrototype) !== IteratorPrototype) {\n if (setPrototypeOf) {\n setPrototypeOf(CurrentIteratorPrototype, IteratorPrototype);\n } else if (typeof CurrentIteratorPrototype[ITERATOR] != 'function') {\n createNonEnumerableProperty(CurrentIteratorPrototype, ITERATOR, returnThis);\n }\n }\n // Set @@toStringTag to native iterators\n setToStringTag(CurrentIteratorPrototype, TO_STRING_TAG, true, true);\n if (IS_PURE) Iterators[TO_STRING_TAG] = returnThis;\n }\n }\n\n // fix Array#{values, @@iterator}.name in V8 / FF\n if (DEFAULT == VALUES && nativeIterator && nativeIterator.name !== VALUES) {\n INCORRECT_VALUES_NAME = true;\n defaultIterator = function values() { return nativeIterator.call(this); };\n }\n\n // define iterator\n if ((!IS_PURE || FORCED) && IterablePrototype[ITERATOR] !== defaultIterator) {\n createNonEnumerableProperty(IterablePrototype, ITERATOR, defaultIterator);\n }\n Iterators[NAME] = defaultIterator;\n\n // export additional methods\n if (DEFAULT) {\n methods = {\n values: getIterationMethod(VALUES),\n keys: IS_SET ? defaultIterator : getIterationMethod(KEYS),\n entries: getIterationMethod(ENTRIES)\n };\n if (FORCED) for (KEY in methods) {\n if (BUGGY_SAFARI_ITERATORS || INCORRECT_VALUES_NAME || !(KEY in IterablePrototype)) {\n redefine(IterablePrototype, KEY, methods[KEY]);\n }\n } else $({ target: NAME, proto: true, forced: BUGGY_SAFARI_ITERATORS || INCORRECT_VALUES_NAME }, methods);\n }\n\n return methods;\n};\n","var fails = require('../internals/fails');\n\n// Thank's IE8 for his funny defineProperty\nmodule.exports = !fails(function () {\n return Object.defineProperty({}, 1, { get: function () { return 7; } })[1] != 7;\n});\n","var global = require('../internals/global');\nvar isObject = require('../internals/is-object');\n\nvar document = global.document;\n// typeof document.createElement is 'object' in old IE\nvar EXISTS = isObject(document) && isObject(document.createElement);\n\nmodule.exports = function (it) {\n return EXISTS ? document.createElement(it) : {};\n};\n","// iterable DOM collections\n// flag - `iterable` interface - 'entries', 'keys', 'values', 'forEach' methods\nmodule.exports = {\n CSSRuleList: 0,\n CSSStyleDeclaration: 0,\n CSSValueList: 0,\n ClientRectList: 0,\n DOMRectList: 0,\n DOMStringList: 0,\n DOMTokenList: 1,\n DataTransferItemList: 0,\n FileList: 0,\n HTMLAllCollection: 0,\n HTMLCollection: 0,\n HTMLFormElement: 0,\n HTMLSelectElement: 0,\n MediaList: 0,\n MimeTypeArray: 0,\n NamedNodeMap: 0,\n NodeList: 1,\n PaintRequestList: 0,\n Plugin: 0,\n PluginArray: 0,\n SVGLengthList: 0,\n SVGNumberList: 0,\n SVGPathSegList: 0,\n SVGPointList: 0,\n SVGStringList: 0,\n SVGTransformList: 0,\n SourceBufferList: 0,\n StyleSheetList: 0,\n TextTrackCueList: 0,\n TextTrackList: 0,\n TouchList: 0\n};\n","var userAgent = require('../internals/engine-user-agent');\n\nmodule.exports = /(iphone|ipod|ipad).*applewebkit/i.test(userAgent);\n","var getBuiltIn = require('../internals/get-built-in');\n\nmodule.exports = getBuiltIn('navigator', 'userAgent') || '';\n","var global = require('../internals/global');\nvar userAgent = require('../internals/engine-user-agent');\n\nvar process = global.process;\nvar versions = process && process.versions;\nvar v8 = versions && versions.v8;\nvar match, version;\n\nif (v8) {\n match = v8.split('.');\n version = match[0] + match[1];\n} else if (userAgent) {\n match = userAgent.match(/Edge\\/(\\d+)/);\n if (!match || match[1] >= 74) {\n match = userAgent.match(/Chrome\\/(\\d+)/);\n if (match) version = match[1];\n }\n}\n\nmodule.exports = version && +version;\n","// IE8- don't enum bug keys\nmodule.exports = [\n 'constructor',\n 'hasOwnProperty',\n 'isPrototypeOf',\n 'propertyIsEnumerable',\n 'toLocaleString',\n 'toString',\n 'valueOf'\n];\n","'use strict';\nvar global = require('../internals/global');\nvar getOwnPropertyDescriptor = require('../internals/object-get-own-property-descriptor').f;\nvar isForced = require('../internals/is-forced');\nvar path = require('../internals/path');\nvar bind = require('../internals/function-bind-context');\nvar createNonEnumerableProperty = require('../internals/create-non-enumerable-property');\nvar has = require('../internals/has');\n\nvar wrapConstructor = function (NativeConstructor) {\n var Wrapper = function (a, b, c) {\n if (this instanceof NativeConstructor) {\n switch (arguments.length) {\n case 0: return new NativeConstructor();\n case 1: return new NativeConstructor(a);\n case 2: return new NativeConstructor(a, b);\n } return new NativeConstructor(a, b, c);\n } return NativeConstructor.apply(this, arguments);\n };\n Wrapper.prototype = NativeConstructor.prototype;\n return Wrapper;\n};\n\n/*\n options.target - name of the target object\n options.global - target is the global object\n options.stat - export as static methods of target\n options.proto - export as prototype methods of target\n options.real - real prototype method for the `pure` version\n options.forced - export even if the native feature is available\n options.bind - bind methods to the target, required for the `pure` version\n options.wrap - wrap constructors to preventing global pollution, required for the `pure` version\n options.unsafe - use the simple assignment of property instead of delete + defineProperty\n options.sham - add a flag to not completely full polyfills\n options.enumerable - export as enumerable property\n options.noTargetGet - prevent calling a getter on target\n*/\nmodule.exports = function (options, source) {\n var TARGET = options.target;\n var GLOBAL = options.global;\n var STATIC = options.stat;\n var PROTO = options.proto;\n\n var nativeSource = GLOBAL ? global : STATIC ? global[TARGET] : (global[TARGET] || {}).prototype;\n\n var target = GLOBAL ? path : path[TARGET] || (path[TARGET] = {});\n var targetPrototype = target.prototype;\n\n var FORCED, USE_NATIVE, VIRTUAL_PROTOTYPE;\n var key, sourceProperty, targetProperty, nativeProperty, resultProperty, descriptor;\n\n for (key in source) {\n FORCED = isForced(GLOBAL ? key : TARGET + (STATIC ? '.' : '#') + key, options.forced);\n // contains in native\n USE_NATIVE = !FORCED && nativeSource && has(nativeSource, key);\n\n targetProperty = target[key];\n\n if (USE_NATIVE) if (options.noTargetGet) {\n descriptor = getOwnPropertyDescriptor(nativeSource, key);\n nativeProperty = descriptor && descriptor.value;\n } else nativeProperty = nativeSource[key];\n\n // export native or implementation\n sourceProperty = (USE_NATIVE && nativeProperty) ? nativeProperty : source[key];\n\n if (USE_NATIVE && typeof targetProperty === typeof sourceProperty) continue;\n\n // bind timers to global for call from export context\n if (options.bind && USE_NATIVE) resultProperty = bind(sourceProperty, global);\n // wrap global constructors for prevent changs in this version\n else if (options.wrap && USE_NATIVE) resultProperty = wrapConstructor(sourceProperty);\n // make static versions for prototype methods\n else if (PROTO && typeof sourceProperty == 'function') resultProperty = bind(Function.call, sourceProperty);\n // default case\n else resultProperty = sourceProperty;\n\n // add a flag to not completely full polyfills\n if (options.sham || (sourceProperty && sourceProperty.sham) || (targetProperty && targetProperty.sham)) {\n createNonEnumerableProperty(resultProperty, 'sham', true);\n }\n\n target[key] = resultProperty;\n\n if (PROTO) {\n VIRTUAL_PROTOTYPE = TARGET + 'Prototype';\n if (!has(path, VIRTUAL_PROTOTYPE)) {\n createNonEnumerableProperty(path, VIRTUAL_PROTOTYPE, {});\n }\n // export virtual prototype methods\n path[VIRTUAL_PROTOTYPE][key] = sourceProperty;\n // export real prototype methods\n if (options.real && targetPrototype && !targetPrototype[key]) {\n createNonEnumerableProperty(targetPrototype, key, sourceProperty);\n }\n }\n }\n};\n","module.exports = function (exec) {\n try {\n return !!exec();\n } catch (error) {\n return true;\n }\n};\n","var aFunction = require('../internals/a-function');\n\n// optional / simple context binding\nmodule.exports = function (fn, that, length) {\n aFunction(fn);\n if (that === undefined) return fn;\n switch (length) {\n case 0: return function () {\n return fn.call(that);\n };\n case 1: return function (a) {\n return fn.call(that, a);\n };\n case 2: return function (a, b) {\n return fn.call(that, a, b);\n };\n case 3: return function (a, b, c) {\n return fn.call(that, a, b, c);\n };\n }\n return function (/* ...args */) {\n return fn.apply(that, arguments);\n };\n};\n","var path = require('../internals/path');\nvar global = require('../internals/global');\n\nvar aFunction = function (variable) {\n return typeof variable == 'function' ? variable : undefined;\n};\n\nmodule.exports = function (namespace, method) {\n return arguments.length < 2 ? aFunction(path[namespace]) || aFunction(global[namespace])\n : path[namespace] && path[namespace][method] || global[namespace] && global[namespace][method];\n};\n","var classof = require('../internals/classof');\nvar Iterators = require('../internals/iterators');\nvar wellKnownSymbol = require('../internals/well-known-symbol');\n\nvar ITERATOR = wellKnownSymbol('iterator');\n\nmodule.exports = function (it) {\n if (it != undefined) return it[ITERATOR]\n || it['@@iterator']\n || Iterators[classof(it)];\n};\n","var check = function (it) {\n return it && it.Math == Math && it;\n};\n\n// https://github.com/zloirock/core-js/issues/86#issuecomment-115759028\nmodule.exports =\n // eslint-disable-next-line no-undef\n check(typeof globalThis == 'object' && globalThis) ||\n check(typeof window == 'object' && window) ||\n check(typeof self == 'object' && self) ||\n check(typeof global == 'object' && global) ||\n // eslint-disable-next-line no-new-func\n Function('return this')();\n","var hasOwnProperty = {}.hasOwnProperty;\n\nmodule.exports = function (it, key) {\n return hasOwnProperty.call(it, key);\n};\n","module.exports = {};\n","var global = require('../internals/global');\n\nmodule.exports = function (a, b) {\n var console = global.console;\n if (console && console.error) {\n arguments.length === 1 ? console.error(a) : console.error(a, b);\n }\n};\n","var getBuiltIn = require('../internals/get-built-in');\n\nmodule.exports = getBuiltIn('document', 'documentElement');\n","var DESCRIPTORS = require('../internals/descriptors');\nvar fails = require('../internals/fails');\nvar createElement = require('../internals/document-create-element');\n\n// Thank's IE8 for his funny defineProperty\nmodule.exports = !DESCRIPTORS && !fails(function () {\n return Object.defineProperty(createElement('div'), 'a', {\n get: function () { return 7; }\n }).a != 7;\n});\n","var fails = require('../internals/fails');\nvar classof = require('../internals/classof-raw');\n\nvar split = ''.split;\n\n// fallback for non-array-like ES3 and non-enumerable old V8 strings\nmodule.exports = fails(function () {\n // throws an error in rhino, see https://github.com/mozilla/rhino/issues/346\n // eslint-disable-next-line no-prototype-builtins\n return !Object('z').propertyIsEnumerable(0);\n}) ? function (it) {\n return classof(it) == 'String' ? split.call(it, '') : Object(it);\n} : Object;\n","var store = require('../internals/shared-store');\n\nvar functionToString = Function.toString;\n\n// this helper broken in `3.4.1-3.4.4`, so we can't use `shared` helper\nif (typeof store.inspectSource != 'function') {\n store.inspectSource = function (it) {\n return functionToString.call(it);\n };\n}\n\nmodule.exports = store.inspectSource;\n","var NATIVE_WEAK_MAP = require('../internals/native-weak-map');\nvar global = require('../internals/global');\nvar isObject = require('../internals/is-object');\nvar createNonEnumerableProperty = require('../internals/create-non-enumerable-property');\nvar objectHas = require('../internals/has');\nvar sharedKey = require('../internals/shared-key');\nvar hiddenKeys = require('../internals/hidden-keys');\n\nvar WeakMap = global.WeakMap;\nvar set, get, has;\n\nvar enforce = function (it) {\n return has(it) ? get(it) : set(it, {});\n};\n\nvar getterFor = function (TYPE) {\n return function (it) {\n var state;\n if (!isObject(it) || (state = get(it)).type !== TYPE) {\n throw TypeError('Incompatible receiver, ' + TYPE + ' required');\n } return state;\n };\n};\n\nif (NATIVE_WEAK_MAP) {\n var store = new WeakMap();\n var wmget = store.get;\n var wmhas = store.has;\n var wmset = store.set;\n set = function (it, metadata) {\n wmset.call(store, it, metadata);\n return metadata;\n };\n get = function (it) {\n return wmget.call(store, it) || {};\n };\n has = function (it) {\n return wmhas.call(store, it);\n };\n} else {\n var STATE = sharedKey('state');\n hiddenKeys[STATE] = true;\n set = function (it, metadata) {\n createNonEnumerableProperty(it, STATE, metadata);\n return metadata;\n };\n get = function (it) {\n return objectHas(it, STATE) ? it[STATE] : {};\n };\n has = function (it) {\n return objectHas(it, STATE);\n };\n}\n\nmodule.exports = {\n set: set,\n get: get,\n has: has,\n enforce: enforce,\n getterFor: getterFor\n};\n","var wellKnownSymbol = require('../internals/well-known-symbol');\nvar Iterators = require('../internals/iterators');\n\nvar ITERATOR = wellKnownSymbol('iterator');\nvar ArrayPrototype = Array.prototype;\n\n// check on default Array iterator\nmodule.exports = function (it) {\n return it !== undefined && (Iterators.Array === it || ArrayPrototype[ITERATOR] === it);\n};\n","var fails = require('../internals/fails');\n\nvar replacement = /#|\\.prototype\\./;\n\nvar isForced = function (feature, detection) {\n var value = data[normalize(feature)];\n return value == POLYFILL ? true\n : value == NATIVE ? false\n : typeof detection == 'function' ? fails(detection)\n : !!detection;\n};\n\nvar normalize = isForced.normalize = function (string) {\n return String(string).replace(replacement, '.').toLowerCase();\n};\n\nvar data = isForced.data = {};\nvar NATIVE = isForced.NATIVE = 'N';\nvar POLYFILL = isForced.POLYFILL = 'P';\n\nmodule.exports = isForced;\n","module.exports = function (it) {\n return typeof it === 'object' ? it !== null : typeof it === 'function';\n};\n","module.exports = true;\n","var anObject = require('../internals/an-object');\nvar isArrayIteratorMethod = require('../internals/is-array-iterator-method');\nvar toLength = require('../internals/to-length');\nvar bind = require('../internals/function-bind-context');\nvar getIteratorMethod = require('../internals/get-iterator-method');\nvar callWithSafeIterationClosing = require('../internals/call-with-safe-iteration-closing');\n\nvar Result = function (stopped, result) {\n this.stopped = stopped;\n this.result = result;\n};\n\nvar iterate = module.exports = function (iterable, fn, that, AS_ENTRIES, IS_ITERATOR) {\n var boundFunction = bind(fn, that, AS_ENTRIES ? 2 : 1);\n var iterator, iterFn, index, length, result, next, step;\n\n if (IS_ITERATOR) {\n iterator = iterable;\n } else {\n iterFn = getIteratorMethod(iterable);\n if (typeof iterFn != 'function') throw TypeError('Target is not iterable');\n // optimisation for array iterators\n if (isArrayIteratorMethod(iterFn)) {\n for (index = 0, length = toLength(iterable.length); length > index; index++) {\n result = AS_ENTRIES\n ? boundFunction(anObject(step = iterable[index])[0], step[1])\n : boundFunction(iterable[index]);\n if (result && result instanceof Result) return result;\n } return new Result(false);\n }\n iterator = iterFn.call(iterable);\n }\n\n next = iterator.next;\n while (!(step = next.call(iterator)).done) {\n result = callWithSafeIterationClosing(iterator, boundFunction, step.value, AS_ENTRIES);\n if (typeof result == 'object' && result && result instanceof Result) return result;\n } return new Result(false);\n};\n\niterate.stop = function (result) {\n return new Result(true, result);\n};\n","'use strict';\nvar getPrototypeOf = require('../internals/object-get-prototype-of');\nvar createNonEnumerableProperty = require('../internals/create-non-enumerable-property');\nvar has = require('../internals/has');\nvar wellKnownSymbol = require('../internals/well-known-symbol');\nvar IS_PURE = require('../internals/is-pure');\n\nvar ITERATOR = wellKnownSymbol('iterator');\nvar BUGGY_SAFARI_ITERATORS = false;\n\nvar returnThis = function () { return this; };\n\n// `%IteratorPrototype%` object\n// https://tc39.github.io/ecma262/#sec-%iteratorprototype%-object\nvar IteratorPrototype, PrototypeOfArrayIteratorPrototype, arrayIterator;\n\nif ([].keys) {\n arrayIterator = [].keys();\n // Safari 8 has buggy iterators w/o `next`\n if (!('next' in arrayIterator)) BUGGY_SAFARI_ITERATORS = true;\n else {\n PrototypeOfArrayIteratorPrototype = getPrototypeOf(getPrototypeOf(arrayIterator));\n if (PrototypeOfArrayIteratorPrototype !== Object.prototype) IteratorPrototype = PrototypeOfArrayIteratorPrototype;\n }\n}\n\nif (IteratorPrototype == undefined) IteratorPrototype = {};\n\n// 25.1.2.1.1 %IteratorPrototype%[@@iterator]()\nif (!IS_PURE && !has(IteratorPrototype, ITERATOR)) {\n createNonEnumerableProperty(IteratorPrototype, ITERATOR, returnThis);\n}\n\nmodule.exports = {\n IteratorPrototype: IteratorPrototype,\n BUGGY_SAFARI_ITERATORS: BUGGY_SAFARI_ITERATORS\n};\n","module.exports = {};\n","var global = require('../internals/global');\nvar getOwnPropertyDescriptor = require('../internals/object-get-own-property-descriptor').f;\nvar classof = require('../internals/classof-raw');\nvar macrotask = require('../internals/task').set;\nvar IS_IOS = require('../internals/engine-is-ios');\n\nvar MutationObserver = global.MutationObserver || global.WebKitMutationObserver;\nvar process = global.process;\nvar Promise = global.Promise;\nvar IS_NODE = classof(process) == 'process';\n// Node.js 11 shows ExperimentalWarning on getting `queueMicrotask`\nvar queueMicrotaskDescriptor = getOwnPropertyDescriptor(global, 'queueMicrotask');\nvar queueMicrotask = queueMicrotaskDescriptor && queueMicrotaskDescriptor.value;\n\nvar flush, head, last, notify, toggle, node, promise, then;\n\n// modern engines have queueMicrotask method\nif (!queueMicrotask) {\n flush = function () {\n var parent, fn;\n if (IS_NODE && (parent = process.domain)) parent.exit();\n while (head) {\n fn = head.fn;\n head = head.next;\n try {\n fn();\n } catch (error) {\n if (head) notify();\n else last = undefined;\n throw error;\n }\n } last = undefined;\n if (parent) parent.enter();\n };\n\n // Node.js\n if (IS_NODE) {\n notify = function () {\n process.nextTick(flush);\n };\n // browsers with MutationObserver, except iOS - https://github.com/zloirock/core-js/issues/339\n } else if (MutationObserver && !IS_IOS) {\n toggle = true;\n node = document.createTextNode('');\n new MutationObserver(flush).observe(node, { characterData: true });\n notify = function () {\n node.data = toggle = !toggle;\n };\n // environments with maybe non-completely correct, but existent Promise\n } else if (Promise && Promise.resolve) {\n // Promise.resolve without an argument throws an error in LG WebOS 2\n promise = Promise.resolve(undefined);\n then = promise.then;\n notify = function () {\n then.call(promise, flush);\n };\n // for other environments - macrotask based on:\n // - setImmediate\n // - MessageChannel\n // - window.postMessag\n // - onreadystatechange\n // - setTimeout\n } else {\n notify = function () {\n // strange IE + webpack dev server bug - use .call(global)\n macrotask.call(global, flush);\n };\n }\n}\n\nmodule.exports = queueMicrotask || function (fn) {\n var task = { fn: fn, next: undefined };\n if (last) last.next = task;\n if (!head) {\n head = task;\n notify();\n } last = task;\n};\n","var global = require('../internals/global');\n\nmodule.exports = global.Promise;\n","var fails = require('../internals/fails');\n\nmodule.exports = !!Object.getOwnPropertySymbols && !fails(function () {\n // Chrome 38 Symbol has incorrect toString conversion\n // eslint-disable-next-line no-undef\n return !String(Symbol());\n});\n","var global = require('../internals/global');\nvar inspectSource = require('../internals/inspect-source');\n\nvar WeakMap = global.WeakMap;\n\nmodule.exports = typeof WeakMap === 'function' && /native code/.test(inspectSource(WeakMap));\n","'use strict';\nvar aFunction = require('../internals/a-function');\n\nvar PromiseCapability = function (C) {\n var resolve, reject;\n this.promise = new C(function ($$resolve, $$reject) {\n if (resolve !== undefined || reject !== undefined) throw TypeError('Bad Promise constructor');\n resolve = $$resolve;\n reject = $$reject;\n });\n this.resolve = aFunction(resolve);\n this.reject = aFunction(reject);\n};\n\n// 25.4.1.5 NewPromiseCapability(C)\nmodule.exports.f = function (C) {\n return new PromiseCapability(C);\n};\n","var anObject = require('../internals/an-object');\nvar defineProperties = require('../internals/object-define-properties');\nvar enumBugKeys = require('../internals/enum-bug-keys');\nvar hiddenKeys = require('../internals/hidden-keys');\nvar html = require('../internals/html');\nvar documentCreateElement = require('../internals/document-create-element');\nvar sharedKey = require('../internals/shared-key');\n\nvar GT = '>';\nvar LT = '<';\nvar PROTOTYPE = 'prototype';\nvar SCRIPT = 'script';\nvar IE_PROTO = sharedKey('IE_PROTO');\n\nvar EmptyConstructor = function () { /* empty */ };\n\nvar scriptTag = function (content) {\n return LT + SCRIPT + GT + content + LT + '/' + SCRIPT + GT;\n};\n\n// Create object with fake `null` prototype: use ActiveX Object with cleared prototype\nvar NullProtoObjectViaActiveX = function (activeXDocument) {\n activeXDocument.write(scriptTag(''));\n activeXDocument.close();\n var temp = activeXDocument.parentWindow.Object;\n activeXDocument = null; // avoid memory leak\n return temp;\n};\n\n// Create object with fake `null` prototype: use iframe Object with cleared prototype\nvar NullProtoObjectViaIFrame = function () {\n // Thrash, waste and sodomy: IE GC bug\n var iframe = documentCreateElement('iframe');\n var JS = 'java' + SCRIPT + ':';\n var iframeDocument;\n iframe.style.display = 'none';\n html.appendChild(iframe);\n // https://github.com/zloirock/core-js/issues/475\n iframe.src = String(JS);\n iframeDocument = iframe.contentWindow.document;\n iframeDocument.open();\n iframeDocument.write(scriptTag('document.F=Object'));\n iframeDocument.close();\n return iframeDocument.F;\n};\n\n// Check for document.domain and active x support\n// No need to use active x approach when document.domain is not set\n// see https://github.com/es-shims/es5-shim/issues/150\n// variation of https://github.com/kitcambridge/es5-shim/commit/4f738ac066346\n// avoid IE GC bug\nvar activeXDocument;\nvar NullProtoObject = function () {\n try {\n /* global ActiveXObject */\n activeXDocument = document.domain && new ActiveXObject('htmlfile');\n } catch (error) { /* ignore */ }\n NullProtoObject = activeXDocument ? NullProtoObjectViaActiveX(activeXDocument) : NullProtoObjectViaIFrame();\n var length = enumBugKeys.length;\n while (length--) delete NullProtoObject[PROTOTYPE][enumBugKeys[length]];\n return NullProtoObject();\n};\n\nhiddenKeys[IE_PROTO] = true;\n\n// `Object.create` method\n// https://tc39.github.io/ecma262/#sec-object.create\nmodule.exports = Object.create || function create(O, Properties) {\n var result;\n if (O !== null) {\n EmptyConstructor[PROTOTYPE] = anObject(O);\n result = new EmptyConstructor();\n EmptyConstructor[PROTOTYPE] = null;\n // add \"__proto__\" for Object.getPrototypeOf polyfill\n result[IE_PROTO] = O;\n } else result = NullProtoObject();\n return Properties === undefined ? result : defineProperties(result, Properties);\n};\n","var DESCRIPTORS = require('../internals/descriptors');\nvar definePropertyModule = require('../internals/object-define-property');\nvar anObject = require('../internals/an-object');\nvar objectKeys = require('../internals/object-keys');\n\n// `Object.defineProperties` method\n// https://tc39.github.io/ecma262/#sec-object.defineproperties\nmodule.exports = DESCRIPTORS ? Object.defineProperties : function defineProperties(O, Properties) {\n anObject(O);\n var keys = objectKeys(Properties);\n var length = keys.length;\n var index = 0;\n var key;\n while (length > index) definePropertyModule.f(O, key = keys[index++], Properties[key]);\n return O;\n};\n","var DESCRIPTORS = require('../internals/descriptors');\nvar IE8_DOM_DEFINE = require('../internals/ie8-dom-define');\nvar anObject = require('../internals/an-object');\nvar toPrimitive = require('../internals/to-primitive');\n\nvar nativeDefineProperty = Object.defineProperty;\n\n// `Object.defineProperty` method\n// https://tc39.github.io/ecma262/#sec-object.defineproperty\nexports.f = DESCRIPTORS ? nativeDefineProperty : function defineProperty(O, P, Attributes) {\n anObject(O);\n P = toPrimitive(P, true);\n anObject(Attributes);\n if (IE8_DOM_DEFINE) try {\n return nativeDefineProperty(O, P, Attributes);\n } catch (error) { /* empty */ }\n if ('get' in Attributes || 'set' in Attributes) throw TypeError('Accessors not supported');\n if ('value' in Attributes) O[P] = Attributes.value;\n return O;\n};\n","var DESCRIPTORS = require('../internals/descriptors');\nvar propertyIsEnumerableModule = require('../internals/object-property-is-enumerable');\nvar createPropertyDescriptor = require('../internals/create-property-descriptor');\nvar toIndexedObject = require('../internals/to-indexed-object');\nvar toPrimitive = require('../internals/to-primitive');\nvar has = require('../internals/has');\nvar IE8_DOM_DEFINE = require('../internals/ie8-dom-define');\n\nvar nativeGetOwnPropertyDescriptor = Object.getOwnPropertyDescriptor;\n\n// `Object.getOwnPropertyDescriptor` method\n// https://tc39.github.io/ecma262/#sec-object.getownpropertydescriptor\nexports.f = DESCRIPTORS ? nativeGetOwnPropertyDescriptor : function getOwnPropertyDescriptor(O, P) {\n O = toIndexedObject(O);\n P = toPrimitive(P, true);\n if (IE8_DOM_DEFINE) try {\n return nativeGetOwnPropertyDescriptor(O, P);\n } catch (error) { /* empty */ }\n if (has(O, P)) return createPropertyDescriptor(!propertyIsEnumerableModule.f.call(O, P), O[P]);\n};\n","var has = require('../internals/has');\nvar toObject = require('../internals/to-object');\nvar sharedKey = require('../internals/shared-key');\nvar CORRECT_PROTOTYPE_GETTER = require('../internals/correct-prototype-getter');\n\nvar IE_PROTO = sharedKey('IE_PROTO');\nvar ObjectPrototype = Object.prototype;\n\n// `Object.getPrototypeOf` method\n// https://tc39.github.io/ecma262/#sec-object.getprototypeof\nmodule.exports = CORRECT_PROTOTYPE_GETTER ? Object.getPrototypeOf : function (O) {\n O = toObject(O);\n if (has(O, IE_PROTO)) return O[IE_PROTO];\n if (typeof O.constructor == 'function' && O instanceof O.constructor) {\n return O.constructor.prototype;\n } return O instanceof Object ? ObjectPrototype : null;\n};\n","var has = require('../internals/has');\nvar toIndexedObject = require('../internals/to-indexed-object');\nvar indexOf = require('../internals/array-includes').indexOf;\nvar hiddenKeys = require('../internals/hidden-keys');\n\nmodule.exports = function (object, names) {\n var O = toIndexedObject(object);\n var i = 0;\n var result = [];\n var key;\n for (key in O) !has(hiddenKeys, key) && has(O, key) && result.push(key);\n // Don't enum bug & hidden keys\n while (names.length > i) if (has(O, key = names[i++])) {\n ~indexOf(result, key) || result.push(key);\n }\n return result;\n};\n","var internalObjectKeys = require('../internals/object-keys-internal');\nvar enumBugKeys = require('../internals/enum-bug-keys');\n\n// `Object.keys` method\n// https://tc39.github.io/ecma262/#sec-object.keys\nmodule.exports = Object.keys || function keys(O) {\n return internalObjectKeys(O, enumBugKeys);\n};\n","'use strict';\nvar nativePropertyIsEnumerable = {}.propertyIsEnumerable;\nvar getOwnPropertyDescriptor = Object.getOwnPropertyDescriptor;\n\n// Nashorn ~ JDK8 bug\nvar NASHORN_BUG = getOwnPropertyDescriptor && !nativePropertyIsEnumerable.call({ 1: 2 }, 1);\n\n// `Object.prototype.propertyIsEnumerable` method implementation\n// https://tc39.github.io/ecma262/#sec-object.prototype.propertyisenumerable\nexports.f = NASHORN_BUG ? function propertyIsEnumerable(V) {\n var descriptor = getOwnPropertyDescriptor(this, V);\n return !!descriptor && descriptor.enumerable;\n} : nativePropertyIsEnumerable;\n","var anObject = require('../internals/an-object');\nvar aPossiblePrototype = require('../internals/a-possible-prototype');\n\n// `Object.setPrototypeOf` method\n// https://tc39.github.io/ecma262/#sec-object.setprototypeof\n// Works with __proto__ only. Old v8 can't work with null proto objects.\n/* eslint-disable no-proto */\nmodule.exports = Object.setPrototypeOf || ('__proto__' in {} ? function () {\n var CORRECT_SETTER = false;\n var test = {};\n var setter;\n try {\n setter = Object.getOwnPropertyDescriptor(Object.prototype, '__proto__').set;\n setter.call(test, []);\n CORRECT_SETTER = test instanceof Array;\n } catch (error) { /* empty */ }\n return function setPrototypeOf(O, proto) {\n anObject(O);\n aPossiblePrototype(proto);\n if (CORRECT_SETTER) setter.call(O, proto);\n else O.__proto__ = proto;\n return O;\n };\n}() : undefined);\n","'use strict';\nvar TO_STRING_TAG_SUPPORT = require('../internals/to-string-tag-support');\nvar classof = require('../internals/classof');\n\n// `Object.prototype.toString` method implementation\n// https://tc39.github.io/ecma262/#sec-object.prototype.tostring\nmodule.exports = TO_STRING_TAG_SUPPORT ? {}.toString : function toString() {\n return '[object ' + classof(this) + ']';\n};\n","module.exports = {};\n","module.exports = function (exec) {\n try {\n return { error: false, value: exec() };\n } catch (error) {\n return { error: true, value: error };\n }\n};\n","var anObject = require('../internals/an-object');\nvar isObject = require('../internals/is-object');\nvar newPromiseCapability = require('../internals/new-promise-capability');\n\nmodule.exports = function (C, x) {\n anObject(C);\n if (isObject(x) && x.constructor === C) return x;\n var promiseCapability = newPromiseCapability.f(C);\n var resolve = promiseCapability.resolve;\n resolve(x);\n return promiseCapability.promise;\n};\n","var redefine = require('../internals/redefine');\n\nmodule.exports = function (target, src, options) {\n for (var key in src) {\n if (options && options.unsafe && target[key]) target[key] = src[key];\n else redefine(target, key, src[key], options);\n } return target;\n};\n","var createNonEnumerableProperty = require('../internals/create-non-enumerable-property');\n\nmodule.exports = function (target, key, value, options) {\n if (options && options.enumerable) target[key] = value;\n else createNonEnumerableProperty(target, key, value);\n};\n","// `RequireObjectCoercible` abstract operation\n// https://tc39.github.io/ecma262/#sec-requireobjectcoercible\nmodule.exports = function (it) {\n if (it == undefined) throw TypeError(\"Can't call method on \" + it);\n return it;\n};\n","var global = require('../internals/global');\nvar createNonEnumerableProperty = require('../internals/create-non-enumerable-property');\n\nmodule.exports = function (key, value) {\n try {\n createNonEnumerableProperty(global, key, value);\n } catch (error) {\n global[key] = value;\n } return value;\n};\n","'use strict';\nvar getBuiltIn = require('../internals/get-built-in');\nvar definePropertyModule = require('../internals/object-define-property');\nvar wellKnownSymbol = require('../internals/well-known-symbol');\nvar DESCRIPTORS = require('../internals/descriptors');\n\nvar SPECIES = wellKnownSymbol('species');\n\nmodule.exports = function (CONSTRUCTOR_NAME) {\n var Constructor = getBuiltIn(CONSTRUCTOR_NAME);\n var defineProperty = definePropertyModule.f;\n\n if (DESCRIPTORS && Constructor && !Constructor[SPECIES]) {\n defineProperty(Constructor, SPECIES, {\n configurable: true,\n get: function () { return this; }\n });\n }\n};\n","var TO_STRING_TAG_SUPPORT = require('../internals/to-string-tag-support');\nvar defineProperty = require('../internals/object-define-property').f;\nvar createNonEnumerableProperty = require('../internals/create-non-enumerable-property');\nvar has = require('../internals/has');\nvar toString = require('../internals/object-to-string');\nvar wellKnownSymbol = require('../internals/well-known-symbol');\n\nvar TO_STRING_TAG = wellKnownSymbol('toStringTag');\n\nmodule.exports = function (it, TAG, STATIC, SET_METHOD) {\n if (it) {\n var target = STATIC ? it : it.prototype;\n if (!has(target, TO_STRING_TAG)) {\n defineProperty(target, TO_STRING_TAG, { configurable: true, value: TAG });\n }\n if (SET_METHOD && !TO_STRING_TAG_SUPPORT) {\n createNonEnumerableProperty(target, 'toString', toString);\n }\n }\n};\n","var shared = require('../internals/shared');\nvar uid = require('../internals/uid');\n\nvar keys = shared('keys');\n\nmodule.exports = function (key) {\n return keys[key] || (keys[key] = uid(key));\n};\n","var global = require('../internals/global');\nvar setGlobal = require('../internals/set-global');\n\nvar SHARED = '__core-js_shared__';\nvar store = global[SHARED] || setGlobal(SHARED, {});\n\nmodule.exports = store;\n","var IS_PURE = require('../internals/is-pure');\nvar store = require('../internals/shared-store');\n\n(module.exports = function (key, value) {\n return store[key] || (store[key] = value !== undefined ? value : {});\n})('versions', []).push({\n version: '3.6.4',\n mode: IS_PURE ? 'pure' : 'global',\n copyright: '© 2020 Denis Pushkarev (zloirock.ru)'\n});\n","var anObject = require('../internals/an-object');\nvar aFunction = require('../internals/a-function');\nvar wellKnownSymbol = require('../internals/well-known-symbol');\n\nvar SPECIES = wellKnownSymbol('species');\n\n// `SpeciesConstructor` abstract operation\n// https://tc39.github.io/ecma262/#sec-speciesconstructor\nmodule.exports = function (O, defaultConstructor) {\n var C = anObject(O).constructor;\n var S;\n return C === undefined || (S = anObject(C)[SPECIES]) == undefined ? defaultConstructor : aFunction(S);\n};\n","var toInteger = require('../internals/to-integer');\nvar requireObjectCoercible = require('../internals/require-object-coercible');\n\n// `String.prototype.{ codePointAt, at }` methods implementation\nvar createMethod = function (CONVERT_TO_STRING) {\n return function ($this, pos) {\n var S = String(requireObjectCoercible($this));\n var position = toInteger(pos);\n var size = S.length;\n var first, second;\n if (position < 0 || position >= size) return CONVERT_TO_STRING ? '' : undefined;\n first = S.charCodeAt(position);\n return first < 0xD800 || first > 0xDBFF || position + 1 === size\n || (second = S.charCodeAt(position + 1)) < 0xDC00 || second > 0xDFFF\n ? CONVERT_TO_STRING ? S.charAt(position) : first\n : CONVERT_TO_STRING ? S.slice(position, position + 2) : (first - 0xD800 << 10) + (second - 0xDC00) + 0x10000;\n };\n};\n\nmodule.exports = {\n // `String.prototype.codePointAt` method\n // https://tc39.github.io/ecma262/#sec-string.prototype.codepointat\n codeAt: createMethod(false),\n // `String.prototype.at` method\n // https://github.com/mathiasbynens/String.prototype.at\n charAt: createMethod(true)\n};\n","var global = require('../internals/global');\nvar fails = require('../internals/fails');\nvar classof = require('../internals/classof-raw');\nvar bind = require('../internals/function-bind-context');\nvar html = require('../internals/html');\nvar createElement = require('../internals/document-create-element');\nvar IS_IOS = require('../internals/engine-is-ios');\n\nvar location = global.location;\nvar set = global.setImmediate;\nvar clear = global.clearImmediate;\nvar process = global.process;\nvar MessageChannel = global.MessageChannel;\nvar Dispatch = global.Dispatch;\nvar counter = 0;\nvar queue = {};\nvar ONREADYSTATECHANGE = 'onreadystatechange';\nvar defer, channel, port;\n\nvar run = function (id) {\n // eslint-disable-next-line no-prototype-builtins\n if (queue.hasOwnProperty(id)) {\n var fn = queue[id];\n delete queue[id];\n fn();\n }\n};\n\nvar runner = function (id) {\n return function () {\n run(id);\n };\n};\n\nvar listener = function (event) {\n run(event.data);\n};\n\nvar post = function (id) {\n // old engines have not location.origin\n global.postMessage(id + '', location.protocol + '//' + location.host);\n};\n\n// Node.js 0.9+ & IE10+ has setImmediate, otherwise:\nif (!set || !clear) {\n set = function setImmediate(fn) {\n var args = [];\n var i = 1;\n while (arguments.length > i) args.push(arguments[i++]);\n queue[++counter] = function () {\n // eslint-disable-next-line no-new-func\n (typeof fn == 'function' ? fn : Function(fn)).apply(undefined, args);\n };\n defer(counter);\n return counter;\n };\n clear = function clearImmediate(id) {\n delete queue[id];\n };\n // Node.js 0.8-\n if (classof(process) == 'process') {\n defer = function (id) {\n process.nextTick(runner(id));\n };\n // Sphere (JS game engine) Dispatch API\n } else if (Dispatch && Dispatch.now) {\n defer = function (id) {\n Dispatch.now(runner(id));\n };\n // Browsers with MessageChannel, includes WebWorkers\n // except iOS - https://github.com/zloirock/core-js/issues/624\n } else if (MessageChannel && !IS_IOS) {\n channel = new MessageChannel();\n port = channel.port2;\n channel.port1.onmessage = listener;\n defer = bind(port.postMessage, port, 1);\n // Browsers with postMessage, skip WebWorkers\n // IE8 has postMessage, but it's sync & typeof its postMessage is 'object'\n } else if (global.addEventListener && typeof postMessage == 'function' && !global.importScripts && !fails(post)) {\n defer = post;\n global.addEventListener('message', listener, false);\n // IE8-\n } else if (ONREADYSTATECHANGE in createElement('script')) {\n defer = function (id) {\n html.appendChild(createElement('script'))[ONREADYSTATECHANGE] = function () {\n html.removeChild(this);\n run(id);\n };\n };\n // Rest old browsers\n } else {\n defer = function (id) {\n setTimeout(runner(id), 0);\n };\n }\n}\n\nmodule.exports = {\n set: set,\n clear: clear\n};\n","var toInteger = require('../internals/to-integer');\n\nvar max = Math.max;\nvar min = Math.min;\n\n// Helper for a popular repeating case of the spec:\n// Let integer be ? ToInteger(index).\n// If integer < 0, let result be max((length + integer), 0); else let result be min(integer, length).\nmodule.exports = function (index, length) {\n var integer = toInteger(index);\n return integer < 0 ? max(integer + length, 0) : min(integer, length);\n};\n","// toObject with fallback for non-array-like ES3 strings\nvar IndexedObject = require('../internals/indexed-object');\nvar requireObjectCoercible = require('../internals/require-object-coercible');\n\nmodule.exports = function (it) {\n return IndexedObject(requireObjectCoercible(it));\n};\n","var ceil = Math.ceil;\nvar floor = Math.floor;\n\n// `ToInteger` abstract operation\n// https://tc39.github.io/ecma262/#sec-tointeger\nmodule.exports = function (argument) {\n return isNaN(argument = +argument) ? 0 : (argument > 0 ? floor : ceil)(argument);\n};\n","var toInteger = require('../internals/to-integer');\n\nvar min = Math.min;\n\n// `ToLength` abstract operation\n// https://tc39.github.io/ecma262/#sec-tolength\nmodule.exports = function (argument) {\n return argument > 0 ? min(toInteger(argument), 0x1FFFFFFFFFFFFF) : 0; // 2 ** 53 - 1 == 9007199254740991\n};\n","var requireObjectCoercible = require('../internals/require-object-coercible');\n\n// `ToObject` abstract operation\n// https://tc39.github.io/ecma262/#sec-toobject\nmodule.exports = function (argument) {\n return Object(requireObjectCoercible(argument));\n};\n","var isObject = require('../internals/is-object');\n\n// `ToPrimitive` abstract operation\n// https://tc39.github.io/ecma262/#sec-toprimitive\n// instead of the ES6 spec version, we didn't implement @@toPrimitive case\n// and the second argument - flag - preferred type is a string\nmodule.exports = function (input, PREFERRED_STRING) {\n if (!isObject(input)) return input;\n var fn, val;\n if (PREFERRED_STRING && typeof (fn = input.toString) == 'function' && !isObject(val = fn.call(input))) return val;\n if (typeof (fn = input.valueOf) == 'function' && !isObject(val = fn.call(input))) return val;\n if (!PREFERRED_STRING && typeof (fn = input.toString) == 'function' && !isObject(val = fn.call(input))) return val;\n throw TypeError(\"Can't convert object to primitive value\");\n};\n","var wellKnownSymbol = require('../internals/well-known-symbol');\n\nvar TO_STRING_TAG = wellKnownSymbol('toStringTag');\nvar test = {};\n\ntest[TO_STRING_TAG] = 'z';\n\nmodule.exports = String(test) === '[object z]';\n","var id = 0;\nvar postfix = Math.random();\n\nmodule.exports = function (key) {\n return 'Symbol(' + String(key === undefined ? '' : key) + ')_' + (++id + postfix).toString(36);\n};\n","var NATIVE_SYMBOL = require('../internals/native-symbol');\n\nmodule.exports = NATIVE_SYMBOL\n // eslint-disable-next-line no-undef\n && !Symbol.sham\n // eslint-disable-next-line no-undef\n && typeof Symbol.iterator == 'symbol';\n","var global = require('../internals/global');\nvar shared = require('../internals/shared');\nvar has = require('../internals/has');\nvar uid = require('../internals/uid');\nvar NATIVE_SYMBOL = require('../internals/native-symbol');\nvar USE_SYMBOL_AS_UID = require('../internals/use-symbol-as-uid');\n\nvar WellKnownSymbolsStore = shared('wks');\nvar Symbol = global.Symbol;\nvar createWellKnownSymbol = USE_SYMBOL_AS_UID ? Symbol : Symbol && Symbol.withoutSetter || uid;\n\nmodule.exports = function (name) {\n if (!has(WellKnownSymbolsStore, name)) {\n if (NATIVE_SYMBOL && has(Symbol, name)) WellKnownSymbolsStore[name] = Symbol[name];\n else WellKnownSymbolsStore[name] = createWellKnownSymbol('Symbol.' + name);\n } return WellKnownSymbolsStore[name];\n};\n","'use strict';\nvar toIndexedObject = require('../internals/to-indexed-object');\nvar addToUnscopables = require('../internals/add-to-unscopables');\nvar Iterators = require('../internals/iterators');\nvar InternalStateModule = require('../internals/internal-state');\nvar defineIterator = require('../internals/define-iterator');\n\nvar ARRAY_ITERATOR = 'Array Iterator';\nvar setInternalState = InternalStateModule.set;\nvar getInternalState = InternalStateModule.getterFor(ARRAY_ITERATOR);\n\n// `Array.prototype.entries` method\n// https://tc39.github.io/ecma262/#sec-array.prototype.entries\n// `Array.prototype.keys` method\n// https://tc39.github.io/ecma262/#sec-array.prototype.keys\n// `Array.prototype.values` method\n// https://tc39.github.io/ecma262/#sec-array.prototype.values\n// `Array.prototype[@@iterator]` method\n// https://tc39.github.io/ecma262/#sec-array.prototype-@@iterator\n// `CreateArrayIterator` internal method\n// https://tc39.github.io/ecma262/#sec-createarrayiterator\nmodule.exports = defineIterator(Array, 'Array', function (iterated, kind) {\n setInternalState(this, {\n type: ARRAY_ITERATOR,\n target: toIndexedObject(iterated), // target\n index: 0, // next index\n kind: kind // kind\n });\n// `%ArrayIteratorPrototype%.next` method\n// https://tc39.github.io/ecma262/#sec-%arrayiteratorprototype%.next\n}, function () {\n var state = getInternalState(this);\n var target = state.target;\n var kind = state.kind;\n var index = state.index++;\n if (!target || index >= target.length) {\n state.target = undefined;\n return { value: undefined, done: true };\n }\n if (kind == 'keys') return { value: index, done: false };\n if (kind == 'values') return { value: target[index], done: false };\n return { value: [index, target[index]], done: false };\n}, 'values');\n\n// argumentsList[@@iterator] is %ArrayProto_values%\n// https://tc39.github.io/ecma262/#sec-createunmappedargumentsobject\n// https://tc39.github.io/ecma262/#sec-createmappedargumentsobject\nIterators.Arguments = Iterators.Array;\n\n// https://tc39.github.io/ecma262/#sec-array.prototype-@@unscopables\naddToUnscopables('keys');\naddToUnscopables('values');\naddToUnscopables('entries');\n","// empty\n","'use strict';\nvar $ = require('../internals/export');\nvar aFunction = require('../internals/a-function');\nvar newPromiseCapabilityModule = require('../internals/new-promise-capability');\nvar perform = require('../internals/perform');\nvar iterate = require('../internals/iterate');\n\n// `Promise.allSettled` method\n// https://github.com/tc39/proposal-promise-allSettled\n$({ target: 'Promise', stat: true }, {\n allSettled: function allSettled(iterable) {\n var C = this;\n var capability = newPromiseCapabilityModule.f(C);\n var resolve = capability.resolve;\n var reject = capability.reject;\n var result = perform(function () {\n var promiseResolve = aFunction(C.resolve);\n var values = [];\n var counter = 0;\n var remaining = 1;\n iterate(iterable, function (promise) {\n var index = counter++;\n var alreadyCalled = false;\n values.push(undefined);\n remaining++;\n promiseResolve.call(C, promise).then(function (value) {\n if (alreadyCalled) return;\n alreadyCalled = true;\n values[index] = { status: 'fulfilled', value: value };\n --remaining || resolve(values);\n }, function (e) {\n if (alreadyCalled) return;\n alreadyCalled = true;\n values[index] = { status: 'rejected', reason: e };\n --remaining || resolve(values);\n });\n });\n --remaining || resolve(values);\n });\n if (result.error) reject(result.value);\n return capability.promise;\n }\n});\n","'use strict';\nvar $ = require('../internals/export');\nvar IS_PURE = require('../internals/is-pure');\nvar NativePromise = require('../internals/native-promise-constructor');\nvar fails = require('../internals/fails');\nvar getBuiltIn = require('../internals/get-built-in');\nvar speciesConstructor = require('../internals/species-constructor');\nvar promiseResolve = require('../internals/promise-resolve');\nvar redefine = require('../internals/redefine');\n\n// Safari bug https://bugs.webkit.org/show_bug.cgi?id=200829\nvar NON_GENERIC = !!NativePromise && fails(function () {\n NativePromise.prototype['finally'].call({ then: function () { /* empty */ } }, function () { /* empty */ });\n});\n\n// `Promise.prototype.finally` method\n// https://tc39.github.io/ecma262/#sec-promise.prototype.finally\n$({ target: 'Promise', proto: true, real: true, forced: NON_GENERIC }, {\n 'finally': function (onFinally) {\n var C = speciesConstructor(this, getBuiltIn('Promise'));\n var isFunction = typeof onFinally == 'function';\n return this.then(\n isFunction ? function (x) {\n return promiseResolve(C, onFinally()).then(function () { return x; });\n } : onFinally,\n isFunction ? function (e) {\n return promiseResolve(C, onFinally()).then(function () { throw e; });\n } : onFinally\n );\n }\n});\n\n// patch native Promise.prototype for native async functions\nif (!IS_PURE && typeof NativePromise == 'function' && !NativePromise.prototype['finally']) {\n redefine(NativePromise.prototype, 'finally', getBuiltIn('Promise').prototype['finally']);\n}\n","'use strict';\nvar $ = require('../internals/export');\nvar IS_PURE = require('../internals/is-pure');\nvar global = require('../internals/global');\nvar getBuiltIn = require('../internals/get-built-in');\nvar NativePromise = require('../internals/native-promise-constructor');\nvar redefine = require('../internals/redefine');\nvar redefineAll = require('../internals/redefine-all');\nvar setToStringTag = require('../internals/set-to-string-tag');\nvar setSpecies = require('../internals/set-species');\nvar isObject = require('../internals/is-object');\nvar aFunction = require('../internals/a-function');\nvar anInstance = require('../internals/an-instance');\nvar classof = require('../internals/classof-raw');\nvar inspectSource = require('../internals/inspect-source');\nvar iterate = require('../internals/iterate');\nvar checkCorrectnessOfIteration = require('../internals/check-correctness-of-iteration');\nvar speciesConstructor = require('../internals/species-constructor');\nvar task = require('../internals/task').set;\nvar microtask = require('../internals/microtask');\nvar promiseResolve = require('../internals/promise-resolve');\nvar hostReportErrors = require('../internals/host-report-errors');\nvar newPromiseCapabilityModule = require('../internals/new-promise-capability');\nvar perform = require('../internals/perform');\nvar InternalStateModule = require('../internals/internal-state');\nvar isForced = require('../internals/is-forced');\nvar wellKnownSymbol = require('../internals/well-known-symbol');\nvar V8_VERSION = require('../internals/engine-v8-version');\n\nvar SPECIES = wellKnownSymbol('species');\nvar PROMISE = 'Promise';\nvar getInternalState = InternalStateModule.get;\nvar setInternalState = InternalStateModule.set;\nvar getInternalPromiseState = InternalStateModule.getterFor(PROMISE);\nvar PromiseConstructor = NativePromise;\nvar TypeError = global.TypeError;\nvar document = global.document;\nvar process = global.process;\nvar $fetch = getBuiltIn('fetch');\nvar newPromiseCapability = newPromiseCapabilityModule.f;\nvar newGenericPromiseCapability = newPromiseCapability;\nvar IS_NODE = classof(process) == 'process';\nvar DISPATCH_EVENT = !!(document && document.createEvent && global.dispatchEvent);\nvar UNHANDLED_REJECTION = 'unhandledrejection';\nvar REJECTION_HANDLED = 'rejectionhandled';\nvar PENDING = 0;\nvar FULFILLED = 1;\nvar REJECTED = 2;\nvar HANDLED = 1;\nvar UNHANDLED = 2;\nvar Internal, OwnPromiseCapability, PromiseWrapper, nativeThen;\n\nvar FORCED = isForced(PROMISE, function () {\n var GLOBAL_CORE_JS_PROMISE = inspectSource(PromiseConstructor) !== String(PromiseConstructor);\n if (!GLOBAL_CORE_JS_PROMISE) {\n // V8 6.6 (Node 10 and Chrome 66) have a bug with resolving custom thenables\n // https://bugs.chromium.org/p/chromium/issues/detail?id=830565\n // We can't detect it synchronously, so just check versions\n if (V8_VERSION === 66) return true;\n // Unhandled rejections tracking support, NodeJS Promise without it fails @@species test\n if (!IS_NODE && typeof PromiseRejectionEvent != 'function') return true;\n }\n // We need Promise#finally in the pure version for preventing prototype pollution\n if (IS_PURE && !PromiseConstructor.prototype['finally']) return true;\n // We can't use @@species feature detection in V8 since it causes\n // deoptimization and performance degradation\n // https://github.com/zloirock/core-js/issues/679\n if (V8_VERSION >= 51 && /native code/.test(PromiseConstructor)) return false;\n // Detect correctness of subclassing with @@species support\n var promise = PromiseConstructor.resolve(1);\n var FakePromise = function (exec) {\n exec(function () { /* empty */ }, function () { /* empty */ });\n };\n var constructor = promise.constructor = {};\n constructor[SPECIES] = FakePromise;\n return !(promise.then(function () { /* empty */ }) instanceof FakePromise);\n});\n\nvar INCORRECT_ITERATION = FORCED || !checkCorrectnessOfIteration(function (iterable) {\n PromiseConstructor.all(iterable)['catch'](function () { /* empty */ });\n});\n\n// helpers\nvar isThenable = function (it) {\n var then;\n return isObject(it) && typeof (then = it.then) == 'function' ? then : false;\n};\n\nvar notify = function (promise, state, isReject) {\n if (state.notified) return;\n state.notified = true;\n var chain = state.reactions;\n microtask(function () {\n var value = state.value;\n var ok = state.state == FULFILLED;\n var index = 0;\n // variable length - can't use forEach\n while (chain.length > index) {\n var reaction = chain[index++];\n var handler = ok ? reaction.ok : reaction.fail;\n var resolve = reaction.resolve;\n var reject = reaction.reject;\n var domain = reaction.domain;\n var result, then, exited;\n try {\n if (handler) {\n if (!ok) {\n if (state.rejection === UNHANDLED) onHandleUnhandled(promise, state);\n state.rejection = HANDLED;\n }\n if (handler === true) result = value;\n else {\n if (domain) domain.enter();\n result = handler(value); // can throw\n if (domain) {\n domain.exit();\n exited = true;\n }\n }\n if (result === reaction.promise) {\n reject(TypeError('Promise-chain cycle'));\n } else if (then = isThenable(result)) {\n then.call(result, resolve, reject);\n } else resolve(result);\n } else reject(value);\n } catch (error) {\n if (domain && !exited) domain.exit();\n reject(error);\n }\n }\n state.reactions = [];\n state.notified = false;\n if (isReject && !state.rejection) onUnhandled(promise, state);\n });\n};\n\nvar dispatchEvent = function (name, promise, reason) {\n var event, handler;\n if (DISPATCH_EVENT) {\n event = document.createEvent('Event');\n event.promise = promise;\n event.reason = reason;\n event.initEvent(name, false, true);\n global.dispatchEvent(event);\n } else event = { promise: promise, reason: reason };\n if (handler = global['on' + name]) handler(event);\n else if (name === UNHANDLED_REJECTION) hostReportErrors('Unhandled promise rejection', reason);\n};\n\nvar onUnhandled = function (promise, state) {\n task.call(global, function () {\n var value = state.value;\n var IS_UNHANDLED = isUnhandled(state);\n var result;\n if (IS_UNHANDLED) {\n result = perform(function () {\n if (IS_NODE) {\n process.emit('unhandledRejection', value, promise);\n } else dispatchEvent(UNHANDLED_REJECTION, promise, value);\n });\n // Browsers should not trigger `rejectionHandled` event if it was handled here, NodeJS - should\n state.rejection = IS_NODE || isUnhandled(state) ? UNHANDLED : HANDLED;\n if (result.error) throw result.value;\n }\n });\n};\n\nvar isUnhandled = function (state) {\n return state.rejection !== HANDLED && !state.parent;\n};\n\nvar onHandleUnhandled = function (promise, state) {\n task.call(global, function () {\n if (IS_NODE) {\n process.emit('rejectionHandled', promise);\n } else dispatchEvent(REJECTION_HANDLED, promise, state.value);\n });\n};\n\nvar bind = function (fn, promise, state, unwrap) {\n return function (value) {\n fn(promise, state, value, unwrap);\n };\n};\n\nvar internalReject = function (promise, state, value, unwrap) {\n if (state.done) return;\n state.done = true;\n if (unwrap) state = unwrap;\n state.value = value;\n state.state = REJECTED;\n notify(promise, state, true);\n};\n\nvar internalResolve = function (promise, state, value, unwrap) {\n if (state.done) return;\n state.done = true;\n if (unwrap) state = unwrap;\n try {\n if (promise === value) throw TypeError(\"Promise can't be resolved itself\");\n var then = isThenable(value);\n if (then) {\n microtask(function () {\n var wrapper = { done: false };\n try {\n then.call(value,\n bind(internalResolve, promise, wrapper, state),\n bind(internalReject, promise, wrapper, state)\n );\n } catch (error) {\n internalReject(promise, wrapper, error, state);\n }\n });\n } else {\n state.value = value;\n state.state = FULFILLED;\n notify(promise, state, false);\n }\n } catch (error) {\n internalReject(promise, { done: false }, error, state);\n }\n};\n\n// constructor polyfill\nif (FORCED) {\n // 25.4.3.1 Promise(executor)\n PromiseConstructor = function Promise(executor) {\n anInstance(this, PromiseConstructor, PROMISE);\n aFunction(executor);\n Internal.call(this);\n var state = getInternalState(this);\n try {\n executor(bind(internalResolve, this, state), bind(internalReject, this, state));\n } catch (error) {\n internalReject(this, state, error);\n }\n };\n // eslint-disable-next-line no-unused-vars\n Internal = function Promise(executor) {\n setInternalState(this, {\n type: PROMISE,\n done: false,\n notified: false,\n parent: false,\n reactions: [],\n rejection: false,\n state: PENDING,\n value: undefined\n });\n };\n Internal.prototype = redefineAll(PromiseConstructor.prototype, {\n // `Promise.prototype.then` method\n // https://tc39.github.io/ecma262/#sec-promise.prototype.then\n then: function then(onFulfilled, onRejected) {\n var state = getInternalPromiseState(this);\n var reaction = newPromiseCapability(speciesConstructor(this, PromiseConstructor));\n reaction.ok = typeof onFulfilled == 'function' ? onFulfilled : true;\n reaction.fail = typeof onRejected == 'function' && onRejected;\n reaction.domain = IS_NODE ? process.domain : undefined;\n state.parent = true;\n state.reactions.push(reaction);\n if (state.state != PENDING) notify(this, state, false);\n return reaction.promise;\n },\n // `Promise.prototype.catch` method\n // https://tc39.github.io/ecma262/#sec-promise.prototype.catch\n 'catch': function (onRejected) {\n return this.then(undefined, onRejected);\n }\n });\n OwnPromiseCapability = function () {\n var promise = new Internal();\n var state = getInternalState(promise);\n this.promise = promise;\n this.resolve = bind(internalResolve, promise, state);\n this.reject = bind(internalReject, promise, state);\n };\n newPromiseCapabilityModule.f = newPromiseCapability = function (C) {\n return C === PromiseConstructor || C === PromiseWrapper\n ? new OwnPromiseCapability(C)\n : newGenericPromiseCapability(C);\n };\n\n if (!IS_PURE && typeof NativePromise == 'function') {\n nativeThen = NativePromise.prototype.then;\n\n // wrap native Promise#then for native async functions\n redefine(NativePromise.prototype, 'then', function then(onFulfilled, onRejected) {\n var that = this;\n return new PromiseConstructor(function (resolve, reject) {\n nativeThen.call(that, resolve, reject);\n }).then(onFulfilled, onRejected);\n // https://github.com/zloirock/core-js/issues/640\n }, { unsafe: true });\n\n // wrap fetch result\n if (typeof $fetch == 'function') $({ global: true, enumerable: true, forced: true }, {\n // eslint-disable-next-line no-unused-vars\n fetch: function fetch(input /* , init */) {\n return promiseResolve(PromiseConstructor, $fetch.apply(global, arguments));\n }\n });\n }\n}\n\n$({ global: true, wrap: true, forced: FORCED }, {\n Promise: PromiseConstructor\n});\n\nsetToStringTag(PromiseConstructor, PROMISE, false, true);\nsetSpecies(PROMISE);\n\nPromiseWrapper = getBuiltIn(PROMISE);\n\n// statics\n$({ target: PROMISE, stat: true, forced: FORCED }, {\n // `Promise.reject` method\n // https://tc39.github.io/ecma262/#sec-promise.reject\n reject: function reject(r) {\n var capability = newPromiseCapability(this);\n capability.reject.call(undefined, r);\n return capability.promise;\n }\n});\n\n$({ target: PROMISE, stat: true, forced: IS_PURE || FORCED }, {\n // `Promise.resolve` method\n // https://tc39.github.io/ecma262/#sec-promise.resolve\n resolve: function resolve(x) {\n return promiseResolve(IS_PURE && this === PromiseWrapper ? PromiseConstructor : this, x);\n }\n});\n\n$({ target: PROMISE, stat: true, forced: INCORRECT_ITERATION }, {\n // `Promise.all` method\n // https://tc39.github.io/ecma262/#sec-promise.all\n all: function all(iterable) {\n var C = this;\n var capability = newPromiseCapability(C);\n var resolve = capability.resolve;\n var reject = capability.reject;\n var result = perform(function () {\n var $promiseResolve = aFunction(C.resolve);\n var values = [];\n var counter = 0;\n var remaining = 1;\n iterate(iterable, function (promise) {\n var index = counter++;\n var alreadyCalled = false;\n values.push(undefined);\n remaining++;\n $promiseResolve.call(C, promise).then(function (value) {\n if (alreadyCalled) return;\n alreadyCalled = true;\n values[index] = value;\n --remaining || resolve(values);\n }, reject);\n });\n --remaining || resolve(values);\n });\n if (result.error) reject(result.value);\n return capability.promise;\n },\n // `Promise.race` method\n // https://tc39.github.io/ecma262/#sec-promise.race\n race: function race(iterable) {\n var C = this;\n var capability = newPromiseCapability(C);\n var reject = capability.reject;\n var result = perform(function () {\n var $promiseResolve = aFunction(C.resolve);\n iterate(iterable, function (promise) {\n $promiseResolve.call(C, promise).then(capability.resolve, reject);\n });\n });\n if (result.error) reject(result.value);\n return capability.promise;\n }\n});\n","'use strict';\nvar charAt = require('../internals/string-multibyte').charAt;\nvar InternalStateModule = require('../internals/internal-state');\nvar defineIterator = require('../internals/define-iterator');\n\nvar STRING_ITERATOR = 'String Iterator';\nvar setInternalState = InternalStateModule.set;\nvar getInternalState = InternalStateModule.getterFor(STRING_ITERATOR);\n\n// `String.prototype[@@iterator]` method\n// https://tc39.github.io/ecma262/#sec-string.prototype-@@iterator\ndefineIterator(String, 'String', function (iterated) {\n setInternalState(this, {\n type: STRING_ITERATOR,\n string: String(iterated),\n index: 0\n });\n// `%StringIteratorPrototype%.next` method\n// https://tc39.github.io/ecma262/#sec-%stringiteratorprototype%.next\n}, function next() {\n var state = getInternalState(this);\n var string = state.string;\n var index = state.index;\n var point;\n if (index >= string.length) return { value: undefined, done: true };\n point = charAt(string, index);\n state.index += point.length;\n return { value: point, done: false };\n});\n","'use strict';\nvar $ = require('../internals/export');\nvar DESCRIPTORS = require('../internals/descriptors');\nvar getPrototypeOf = require('../internals/object-get-prototype-of');\nvar setPrototypeOf = require('../internals/object-set-prototype-of');\nvar create = require('../internals/object-create');\nvar defineProperty = require('../internals/object-define-property');\nvar createPropertyDescriptor = require('../internals/create-property-descriptor');\nvar iterate = require('../internals/iterate');\nvar createNonEnumerableProperty = require('../internals/create-non-enumerable-property');\nvar InternalStateModule = require('../internals/internal-state');\n\nvar setInternalState = InternalStateModule.set;\nvar getInternalAggregateErrorState = InternalStateModule.getterFor('AggregateError');\n\nvar $AggregateError = function AggregateError(errors, message) {\n var that = this;\n if (!(that instanceof $AggregateError)) return new $AggregateError(errors, message);\n if (setPrototypeOf) {\n that = setPrototypeOf(new Error(message), getPrototypeOf(that));\n }\n var errorsArray = [];\n iterate(errors, errorsArray.push, errorsArray);\n if (DESCRIPTORS) setInternalState(that, { errors: errorsArray, type: 'AggregateError' });\n else that.errors = errorsArray;\n if (message !== undefined) createNonEnumerableProperty(that, 'message', String(message));\n return that;\n};\n\n$AggregateError.prototype = create(Error.prototype, {\n constructor: createPropertyDescriptor(5, $AggregateError),\n message: createPropertyDescriptor(5, ''),\n name: createPropertyDescriptor(5, 'AggregateError')\n});\n\nif (DESCRIPTORS) defineProperty.f($AggregateError.prototype, 'errors', {\n get: function () {\n return getInternalAggregateErrorState(this).errors;\n },\n configurable: true\n});\n\n$({ global: true }, {\n AggregateError: $AggregateError\n});\n","// TODO: Remove from `core-js@4`\nrequire('./es.promise.all-settled.js');\n","'use strict';\nvar $ = require('../internals/export');\nvar aFunction = require('../internals/a-function');\nvar getBuiltIn = require('../internals/get-built-in');\nvar newPromiseCapabilityModule = require('../internals/new-promise-capability');\nvar perform = require('../internals/perform');\nvar iterate = require('../internals/iterate');\n\nvar PROMISE_ANY_ERROR = 'No one promise resolved';\n\n// `Promise.any` method\n// https://github.com/tc39/proposal-promise-any\n$({ target: 'Promise', stat: true }, {\n any: function any(iterable) {\n var C = this;\n var capability = newPromiseCapabilityModule.f(C);\n var resolve = capability.resolve;\n var reject = capability.reject;\n var result = perform(function () {\n var promiseResolve = aFunction(C.resolve);\n var errors = [];\n var counter = 0;\n var remaining = 1;\n var alreadyResolved = false;\n iterate(iterable, function (promise) {\n var index = counter++;\n var alreadyRejected = false;\n errors.push(undefined);\n remaining++;\n promiseResolve.call(C, promise).then(function (value) {\n if (alreadyRejected || alreadyResolved) return;\n alreadyResolved = true;\n resolve(value);\n }, function (e) {\n if (alreadyRejected || alreadyResolved) return;\n alreadyRejected = true;\n errors[index] = e;\n --remaining || reject(new (getBuiltIn('AggregateError'))(errors, PROMISE_ANY_ERROR));\n });\n });\n --remaining || reject(new (getBuiltIn('AggregateError'))(errors, PROMISE_ANY_ERROR));\n });\n if (result.error) reject(result.value);\n return capability.promise;\n }\n});\n","'use strict';\nvar $ = require('../internals/export');\nvar newPromiseCapabilityModule = require('../internals/new-promise-capability');\nvar perform = require('../internals/perform');\n\n// `Promise.try` method\n// https://github.com/tc39/proposal-promise-try\n$({ target: 'Promise', stat: true }, {\n 'try': function (callbackfn) {\n var promiseCapability = newPromiseCapabilityModule.f(this);\n var result = perform(callbackfn);\n (result.error ? promiseCapability.reject : promiseCapability.resolve)(result.value);\n return promiseCapability.promise;\n }\n});\n","require('./es.array.iterator');\nvar DOMIterables = require('../internals/dom-iterables');\nvar global = require('../internals/global');\nvar classof = require('../internals/classof');\nvar createNonEnumerableProperty = require('../internals/create-non-enumerable-property');\nvar Iterators = require('../internals/iterators');\nvar wellKnownSymbol = require('../internals/well-known-symbol');\n\nvar TO_STRING_TAG = wellKnownSymbol('toStringTag');\n\nfor (var COLLECTION_NAME in DOMIterables) {\n var Collection = global[COLLECTION_NAME];\n var CollectionPrototype = Collection && Collection.prototype;\n if (CollectionPrototype && classof(CollectionPrototype) !== TO_STRING_TAG) {\n createNonEnumerableProperty(CollectionPrototype, TO_STRING_TAG, COLLECTION_NAME);\n }\n Iterators[COLLECTION_NAME] = Iterators.Array;\n}\n","var g;\n\n// This works in non-strict mode\ng = (function() {\n\treturn this;\n})();\n\ntry {\n\t// This works if eval is allowed (see CSP)\n\tg = g || new Function(\"return this\")();\n} catch (e) {\n\t// This works if the window reference is available\n\tif (typeof window === \"object\") g = window;\n}\n\n// g can still be undefined, but nothing to do about it...\n// We return undefined, instead of nothing here, so it's\n// easier to handle this case. if(!global) { ...}\n\nmodule.exports = g;\n","// extracted by mini-css-extract-plugin","import '@/polyfill';\nimport ImageEditor from '@/imageEditor';\nimport '@css/index.styl';\n\n// commands\nimport '@/command/addIcon';\nimport '@/command/addImageObject';\nimport '@/command/addObject';\nimport '@/command/addShape';\nimport '@/command/addText';\nimport '@/command/applyFilter';\nimport '@/command/changeIconColor';\nimport '@/command/changeShape';\nimport '@/command/changeText';\nimport '@/command/changeTextStyle';\nimport '@/command/clearObjects';\nimport '@/command/flip';\nimport '@/command/loadImage';\nimport '@/command/removeFilter';\nimport '@/command/removeObject';\nimport '@/command/resizeCanvasDimension';\nimport '@/command/rotate';\nimport '@/command/setObjectProperties';\nimport '@/command/setObjectPosition';\nimport '@/command/changeSelection';\n\nmodule.exports = ImageEditor;\n","import { extend } from 'tui-code-snippet';\nimport Imagetracer from '@/helper/imagetracer';\nimport { isSupportFileApi, base64ToBlob, toInteger, isEmptyCropzone } from '@/util';\nimport { eventNames, historyNames, drawingModes, drawingMenuNames, zoomModes } from '@/consts';\n\nexport default {\n /**\n * Get ui actions\n * @returns {Object} actions for ui\n * @private\n */\n getActions() {\n return {\n main: this._mainAction(),\n shape: this._shapeAction(),\n crop: this._cropAction(),\n flip: this._flipAction(),\n rotate: this._rotateAction(),\n text: this._textAction(),\n mask: this._maskAction(),\n draw: this._drawAction(),\n icon: this._iconAction(),\n filter: this._filterAction(),\n history: this._historyAction(),\n };\n },\n\n /**\n * Main Action\n * @returns {Object} actions for ui main\n * @private\n */\n _mainAction() {\n const exitCropOnAction = () => {\n if (this.ui.submenu === 'crop') {\n this.stopDrawingMode();\n this.ui.changeMenu('crop');\n }\n };\n const setAngleRangeBarOnAction = (angle) => {\n if (this.ui.submenu === 'rotate') {\n this.ui.rotate.setRangeBarAngle('setAngle', angle);\n }\n };\n const setFilterStateRangeBarOnAction = (filterOptions) => {\n if (this.ui.submenu === 'filter') {\n this.ui.filter.setFilterState(filterOptions);\n }\n };\n const onEndUndoRedo = (result) => {\n setAngleRangeBarOnAction(result);\n setFilterStateRangeBarOnAction(result);\n\n return result;\n };\n const toggleZoomMode = () => {\n const zoomMode = this._graphics.getZoomMode();\n\n this.stopDrawingMode();\n if (zoomMode !== zoomModes.ZOOM) {\n this.startDrawingMode(drawingModes.ZOOM);\n this._graphics.startZoomInMode();\n } else {\n this._graphics.endZoomInMode();\n }\n };\n const toggleHandMode = () => {\n const zoomMode = this._graphics.getZoomMode();\n\n this.stopDrawingMode();\n if (zoomMode !== zoomModes.HAND) {\n this.startDrawingMode(drawingModes.ZOOM);\n this._graphics.startHandMode();\n } else {\n this._graphics.endHandMode();\n }\n };\n\n return extend(\n {\n initLoadImage: (imagePath, imageName) =>\n this.loadImageFromURL(imagePath, imageName).then((sizeValue) => {\n exitCropOnAction();\n this.ui.initializeImgUrl = imagePath;\n this.ui.resizeEditor({ imageSize: sizeValue });\n this.clearUndoStack();\n this._invoker.fire(eventNames.EXECUTE_COMMAND, historyNames.LOAD_IMAGE);\n }),\n undo: () => {\n if (!this.isEmptyUndoStack()) {\n exitCropOnAction();\n this.deactivateAll();\n this.undo().then(onEndUndoRedo);\n }\n },\n redo: () => {\n if (!this.isEmptyRedoStack()) {\n exitCropOnAction();\n this.deactivateAll();\n this.redo().then(onEndUndoRedo);\n }\n },\n reset: () => {\n exitCropOnAction();\n this.loadImageFromURL(this.ui.initializeImgUrl, 'resetImage').then((sizeValue) => {\n exitCropOnAction();\n this.ui.resizeEditor({ imageSize: sizeValue });\n this.clearUndoStack();\n this._initHistory();\n });\n },\n delete: () => {\n this.ui.changeHelpButtonEnabled('delete', false);\n exitCropOnAction();\n this.removeActiveObject();\n this.activeObjectId = null;\n },\n deleteAll: () => {\n exitCropOnAction();\n this.clearObjects();\n this.ui.changeHelpButtonEnabled('delete', false);\n this.ui.changeHelpButtonEnabled('deleteAll', false);\n },\n load: (file) => {\n if (!isSupportFileApi()) {\n alert('This browser does not support file-api');\n }\n\n this.ui.initializeImgUrl = URL.createObjectURL(file);\n this.loadImageFromFile(file)\n .then((sizeValue) => {\n exitCropOnAction();\n this.clearUndoStack();\n this.ui.activeMenuEvent();\n this.ui.resizeEditor({ imageSize: sizeValue });\n this._clearHistory();\n this._invoker.fire(eventNames.EXECUTE_COMMAND, historyNames.LOAD_IMAGE);\n })\n ['catch']((message) => Promise.reject(message));\n },\n download: () => {\n const dataURL = this.toDataURL();\n let imageName = this.getImageName();\n let blob, type, w;\n\n if (isSupportFileApi() && window.saveAs) {\n blob = base64ToBlob(dataURL);\n type = blob.type.split('/')[1];\n if (imageName.split('.').pop() !== type) {\n imageName += `.${type}`;\n }\n saveAs(blob, imageName); // eslint-disable-line\n } else {\n w = window.open();\n w.document.body.innerHTML = ``;\n }\n },\n history: (event) => {\n this.ui.toggleHistoryMenu(event);\n },\n zoomIn: () => {\n this.ui.toggleZoomButtonStatus('zoomIn');\n this.deactivateAll();\n toggleZoomMode();\n },\n zoomOut: () => {\n this._graphics.zoomOut();\n },\n hand: () => {\n this.ui.offZoomInButtonStatus();\n this.ui.toggleZoomButtonStatus('hand');\n this.deactivateAll();\n toggleHandMode();\n },\n },\n this._commonAction()\n );\n },\n\n /**\n * Icon Action\n * @returns {Object} actions for ui icon\n * @private\n */\n _iconAction() {\n return extend(\n {\n changeColor: (color) => {\n if (this.activeObjectId) {\n this.changeIconColor(this.activeObjectId, color);\n }\n },\n addIcon: (iconType, iconColor) => {\n this.startDrawingMode('ICON');\n this.setDrawingIcon(iconType, iconColor);\n },\n cancelAddIcon: () => {\n this.ui.icon.clearIconType();\n this.changeSelectableAll(true);\n this.changeCursor('default');\n this.stopDrawingMode();\n },\n registerDefaultIcons: (type, path) => {\n const iconObj = {};\n iconObj[type] = path;\n this.registerIcons(iconObj);\n },\n registerCustomIcon: (imgUrl, file) => {\n const imagetracer = new Imagetracer();\n imagetracer.imageToSVG(\n imgUrl,\n (svgstr) => {\n const [, svgPath] = svgstr.match(/path[^>]*d=\"([^\"]*)\"/);\n const iconObj = {};\n iconObj[file.name] = svgPath;\n this.registerIcons(iconObj);\n this.addIcon(file.name, {\n left: 100,\n top: 100,\n });\n },\n Imagetracer.tracerDefaultOption()\n );\n },\n },\n this._commonAction()\n );\n },\n\n /**\n * Draw Action\n * @returns {Object} actions for ui draw\n * @private\n */\n _drawAction() {\n return extend(\n {\n setDrawMode: (type, settings) => {\n this.stopDrawingMode();\n if (type === 'free') {\n this.startDrawingMode('FREE_DRAWING', settings);\n } else {\n this.startDrawingMode('LINE_DRAWING', settings);\n }\n },\n setColor: (color) => {\n this.setBrush({\n color,\n });\n },\n },\n this._commonAction()\n );\n },\n\n /**\n * Mask Action\n * @returns {Object} actions for ui mask\n * @private\n */\n _maskAction() {\n return extend(\n {\n loadImageFromURL: (imgUrl, file) => {\n return this.loadImageFromURL(this.toDataURL(), 'FilterImage').then(() => {\n this.addImageObject(imgUrl).then(() => {\n URL.revokeObjectURL(file);\n });\n this._invoker.fire(eventNames.EXECUTE_COMMAND, historyNames.LOAD_MASK_IMAGE);\n });\n },\n applyFilter: () => {\n this.applyFilter('mask', {\n maskObjId: this.activeObjectId,\n });\n },\n },\n this._commonAction()\n );\n },\n\n /**\n * Text Action\n * @returns {Object} actions for ui text\n * @private\n */\n _textAction() {\n return extend(\n {\n changeTextStyle: (styleObj, isSilent) => {\n if (this.activeObjectId) {\n this.changeTextStyle(this.activeObjectId, styleObj, isSilent);\n }\n },\n },\n this._commonAction()\n );\n },\n\n /**\n * Rotate Action\n * @returns {Object} actions for ui rotate\n * @private\n */\n _rotateAction() {\n return extend(\n {\n rotate: (angle, isSilent) => {\n this.rotate(angle, isSilent);\n this.ui.resizeEditor();\n this.ui.rotate.setRangeBarAngle('rotate', angle);\n },\n setAngle: (angle, isSilent) => {\n this.setAngle(angle, isSilent);\n this.ui.resizeEditor();\n this.ui.rotate.setRangeBarAngle('setAngle', angle);\n },\n },\n this._commonAction()\n );\n },\n\n /**\n * Shape Action\n * @returns {Object} actions for ui shape\n * @private\n */\n _shapeAction() {\n return extend(\n {\n changeShape: (changeShapeObject, isSilent) => {\n if (this.activeObjectId) {\n this.changeShape(this.activeObjectId, changeShapeObject, isSilent);\n }\n },\n setDrawingShape: (shapeType) => {\n this.setDrawingShape(shapeType);\n },\n },\n this._commonAction()\n );\n },\n\n /**\n * Crop Action\n * @returns {Object} actions for ui crop\n * @private\n */\n _cropAction() {\n return extend(\n {\n crop: () => {\n const cropRect = this.getCropzoneRect();\n if (cropRect && !isEmptyCropzone(cropRect)) {\n this.crop(cropRect)\n .then(() => {\n this.stopDrawingMode();\n this.ui.resizeEditor();\n this.ui.changeMenu('crop');\n this._invoker.fire(eventNames.EXECUTE_COMMAND, historyNames.CROP);\n })\n ['catch']((message) => Promise.reject(message));\n }\n },\n cancel: () => {\n this.stopDrawingMode();\n this.ui.changeMenu('crop');\n },\n /* eslint-disable */\n preset: (presetType) => {\n switch (presetType) {\n case 'preset-square':\n this.setCropzoneRect(1 / 1);\n break;\n case 'preset-3-2':\n this.setCropzoneRect(3 / 2);\n break;\n case 'preset-4-3':\n this.setCropzoneRect(4 / 3);\n break;\n case 'preset-5-4':\n this.setCropzoneRect(5 / 4);\n break;\n case 'preset-7-5':\n this.setCropzoneRect(7 / 5);\n break;\n case 'preset-16-9':\n this.setCropzoneRect(16 / 9);\n break;\n default:\n this.setCropzoneRect();\n this.ui.crop.changeApplyButtonStatus(false);\n break;\n }\n },\n },\n this._commonAction()\n );\n },\n\n /**\n * Flip Action\n * @returns {Object} actions for ui flip\n * @private\n */\n _flipAction() {\n return extend(\n {\n flip: (flipType) => this[flipType](),\n },\n this._commonAction()\n );\n },\n\n /**\n * Filter Action\n * @returns {Object} actions for ui filter\n * @private\n */\n _filterAction() {\n return extend(\n {\n applyFilter: (applying, type, options, isSilent) => {\n if (applying) {\n this.applyFilter(type, options, isSilent);\n } else if (this.hasFilter(type)) {\n this.removeFilter(type);\n }\n },\n },\n this._commonAction()\n );\n },\n\n /**\n * Image Editor Event Observer\n */\n setReAction() {\n this.on({\n undoStackChanged: (length) => {\n if (length) {\n this.ui.changeHelpButtonEnabled('undo', true);\n this.ui.changeHelpButtonEnabled('reset', true);\n } else {\n this.ui.changeHelpButtonEnabled('undo', false);\n this.ui.changeHelpButtonEnabled('reset', false);\n }\n this.ui.resizeEditor();\n },\n redoStackChanged: (length) => {\n if (length) {\n this.ui.changeHelpButtonEnabled('redo', true);\n } else {\n this.ui.changeHelpButtonEnabled('redo', false);\n }\n this.ui.resizeEditor();\n },\n /* eslint-disable complexity */\n objectActivated: (obj) => {\n this.activeObjectId = obj.id;\n\n this.ui.changeHelpButtonEnabled('delete', true);\n this.ui.changeHelpButtonEnabled('deleteAll', true);\n\n if (obj.type === 'cropzone') {\n this.ui.crop.changeApplyButtonStatus(true);\n } else if (['rect', 'circle', 'triangle'].indexOf(obj.type) > -1) {\n this.stopDrawingMode();\n if (this.ui.submenu !== 'shape') {\n this.ui.changeMenu('shape', false, false);\n }\n this.ui.shape.setShapeStatus({\n strokeColor: obj.stroke,\n strokeWidth: obj.strokeWidth,\n fillColor: obj.fill,\n });\n\n this.ui.shape.setMaxStrokeValue(Math.min(obj.width, obj.height));\n } else if (obj.type === 'path' || obj.type === 'line') {\n if (this.ui.submenu !== 'draw') {\n this.ui.changeMenu('draw', false, false);\n this.ui.draw.changeStandbyMode();\n }\n } else if (['i-text', 'text'].indexOf(obj.type) > -1) {\n if (this.ui.submenu !== 'text') {\n this.ui.changeMenu('text', false, false);\n }\n\n this.ui.text.setTextStyleStateOnAction(obj);\n } else if (obj.type === 'icon') {\n this.stopDrawingMode();\n if (this.ui.submenu !== 'icon') {\n this.ui.changeMenu('icon', false, false);\n }\n this.ui.icon.setIconPickerColor(obj.fill);\n }\n },\n /* eslint-enable complexity */\n addText: (pos) => {\n const { textColor: fill, fontSize, fontStyle, fontWeight, underline } = this.ui.text;\n const fontFamily = 'Noto Sans';\n\n this.addText('Double Click', {\n position: pos.originPosition,\n styles: { fill, fontSize, fontFamily, fontStyle, fontWeight, underline },\n }).then(() => {\n this.changeCursor('default');\n });\n },\n addObjectAfter: (obj) => {\n if (obj.type === 'icon') {\n this.ui.icon.changeStandbyMode();\n } else if (['rect', 'circle', 'triangle'].indexOf(obj.type) > -1) {\n this.ui.shape.setMaxStrokeValue(Math.min(obj.width, obj.height));\n this.ui.shape.changeStandbyMode();\n }\n },\n objectScaled: (obj) => {\n if (['i-text', 'text'].indexOf(obj.type) > -1) {\n this.ui.text.fontSize = toInteger(obj.fontSize);\n } else if (['rect', 'circle', 'triangle'].indexOf(obj.type) >= 0) {\n const { width, height } = obj;\n const strokeValue = this.ui.shape.getStrokeValue();\n\n if (width < strokeValue) {\n this.ui.shape.setStrokeValue(width);\n }\n if (height < strokeValue) {\n this.ui.shape.setStrokeValue(height);\n }\n }\n },\n selectionCleared: () => {\n this.activeObjectId = null;\n if (this.ui.submenu === 'text') {\n this.changeCursor('text');\n } else if (this.ui.submenu !== 'draw' && this.ui.submenu !== 'crop') {\n this.stopDrawingMode();\n }\n },\n });\n },\n\n /**\n * History Action\n * @returns {Object} history actions for ui\n * @private\n */\n _historyAction() {\n return {\n undo: (count) => this.undo(count),\n redo: (count) => this.redo(count),\n };\n },\n\n /**\n * Common Action\n * @returns {Object} common actions for ui\n * @private\n */\n _commonAction() {\n const { TEXT, CROPPER, SHAPE, ZOOM } = drawingModes;\n\n return {\n modeChange: (menu) => {\n switch (menu) {\n case drawingMenuNames.TEXT:\n this._changeActivateMode(TEXT);\n break;\n case drawingMenuNames.CROP:\n this.startDrawingMode(CROPPER);\n break;\n case drawingMenuNames.SHAPE:\n this._changeActivateMode(SHAPE);\n this.setDrawingShape(this.ui.shape.type, this.ui.shape.options);\n break;\n case drawingMenuNames.ZOOM:\n this.startDrawingMode(ZOOM);\n break;\n default:\n break;\n }\n },\n deactivateAll: this.deactivateAll.bind(this),\n changeSelectableAll: this.changeSelectableAll.bind(this),\n discardSelection: this.discardSelection.bind(this),\n stopDrawingMode: this.stopDrawingMode.bind(this),\n };\n },\n\n /**\n * Mixin\n * @param {ImageEditor} ImageEditor instance\n */\n mixin(ImageEditor) {\n extend(ImageEditor.prototype, this);\n },\n};\n","/**\n * @author NHN. FE Development Team \n * @fileoverview Add an icon\n */\nimport commandFactory from '@/factory/command';\nimport { Promise } from '@/util';\nimport { componentNames, commandNames } from '@/consts';\n\nconst { ICON } = componentNames;\n\nconst command = {\n name: commandNames.ADD_ICON,\n\n /**\n * Add an icon\n * @param {Graphics} graphics - Graphics instance\n * @param {string} type - Icon type ('arrow', 'cancel', custom icon name)\n * @param {Object} options - Icon options\n * @param {string} [options.fill] - Icon foreground color\n * @param {string} [options.left] - Icon x position\n * @param {string} [options.top] - Icon y position\n * @returns {Promise}\n */\n execute(graphics, type, options) {\n const iconComp = graphics.getComponent(ICON);\n\n return iconComp.add(type, options).then((objectProps) => {\n this.undoData.object = graphics.getObject(objectProps.id);\n\n return objectProps;\n });\n },\n\n /**\n * @param {Graphics} graphics - Graphics instance\n * @returns {Promise}\n */\n undo(graphics) {\n graphics.remove(this.undoData.object);\n\n return Promise.resolve();\n },\n};\n\ncommandFactory.register(command);\n\nexport default command;\n","/**\n * @author NHN. FE Development Team \n * @fileoverview Add an image object\n */\nimport commandFactory from '@/factory/command';\nimport { Promise } from '@/util';\nimport { commandNames } from '@/consts';\n\nconst command = {\n name: commandNames.ADD_IMAGE_OBJECT,\n\n /**\n * Add an image object\n * @param {Graphics} graphics - Graphics instance\n * @param {string} imgUrl - Image url to make object\n * @returns {Promise}\n */\n execute(graphics, imgUrl) {\n return graphics.addImageObject(imgUrl).then((objectProps) => {\n this.undoData.object = graphics.getObject(objectProps.id);\n\n return objectProps;\n });\n },\n\n /**\n * @param {Graphics} graphics - Graphics instance\n * @returns {Promise}\n */\n undo(graphics) {\n graphics.remove(this.undoData.object);\n\n return Promise.resolve();\n },\n};\n\ncommandFactory.register(command);\n\nexport default command;\n","/**\n * @author NHN. FE Development Team \n * @fileoverview Add an object\n */\nimport commandFactory from '@/factory/command';\nimport { Promise } from '@/util';\nimport { commandNames, rejectMessages } from '@/consts';\n\nconst command = {\n name: commandNames.ADD_OBJECT,\n\n /**\n * Add an object\n * @param {Graphics} graphics - Graphics instance\n * @param {Object} object - Fabric object\n * @returns {Promise}\n */\n execute(graphics, object) {\n return new Promise((resolve, reject) => {\n if (!graphics.contains(object)) {\n graphics.add(object);\n resolve(object);\n } else {\n reject(rejectMessages.addedObject);\n }\n });\n },\n\n /**\n * @param {Graphics} graphics - Graphics instance\n * @param {Object} object - Fabric object\n * @returns {Promise}\n */\n undo(graphics, object) {\n return new Promise((resolve, reject) => {\n if (graphics.contains(object)) {\n graphics.remove(object);\n resolve(object);\n } else {\n reject(rejectMessages.noObject);\n }\n });\n },\n};\n\ncommandFactory.register(command);\n\nexport default command;\n","/**\n * @author NHN. FE Development Team \n * @fileoverview Add a shape\n */\nimport commandFactory from '@/factory/command';\nimport { Promise } from '@/util';\nimport { componentNames, commandNames } from '@/consts';\n\nconst { SHAPE } = componentNames;\n\nconst command = {\n name: commandNames.ADD_SHAPE,\n\n /**\n * Add a shape\n * @param {Graphics} graphics - Graphics instance\n * @param {string} type - Shape type (ex: 'rect', 'circle', 'triangle')\n * @param {Object} options - Shape options\n * @param {string} [options.fill] - Shape foreground color (ex: '#fff', 'transparent')\n * @param {string} [options.stroke] - Shape outline color\n * @param {number} [options.strokeWidth] - Shape outline width\n * @param {number} [options.width] - Width value (When type option is 'rect', this options can use)\n * @param {number} [options.height] - Height value (When type option is 'rect', this options can use)\n * @param {number} [options.rx] - Radius x value (When type option is 'circle', this options can use)\n * @param {number} [options.ry] - Radius y value (When type option is 'circle', this options can use)\n * @param {number} [options.left] - Shape x position\n * @param {number} [options.top] - Shape y position\n * @param {number} [options.isRegular] - Whether resizing shape has 1:1 ratio or not\n * @returns {Promise}\n */\n execute(graphics, type, options) {\n const shapeComp = graphics.getComponent(SHAPE);\n\n return shapeComp.add(type, options).then((objectProps) => {\n const { id } = objectProps;\n\n this.undoData.object = graphics.getObject(id);\n\n return objectProps;\n });\n },\n\n /**\n * @param {Graphics} graphics - Graphics instance\n * @returns {Promise}\n */\n undo(graphics) {\n graphics.remove(this.undoData.object);\n\n return Promise.resolve();\n },\n};\n\ncommandFactory.register(command);\n\nexport default command;\n","/**\n * @author NHN. FE Development Team \n * @fileoverview Add a text object\n */\nimport commandFactory from '@/factory/command';\nimport { Promise } from '@/util';\nimport { componentNames, commandNames, rejectMessages } from '@/consts';\nimport {\n setCachedUndoDataForDimension,\n makeSelectionUndoData,\n makeSelectionUndoDatum,\n} from '@/helper/selectionModifyHelper';\n\nconst { TEXT } = componentNames;\n\nconst command = {\n name: commandNames.ADD_TEXT,\n\n /**\n * Add a text object\n * @param {Graphics} graphics - Graphics instance\n * @param {string} text - Initial input text\n * @param {Object} [options] Options for text styles\n * @param {Object} [options.styles] Initial styles\n * @param {string} [options.styles.fill] Color\n * @param {string} [options.styles.fontFamily] Font type for text\n * @param {number} [options.styles.fontSize] Size\n * @param {string} [options.styles.fontStyle] Type of inclination (normal / italic)\n * @param {string} [options.styles.fontWeight] Type of thicker or thinner looking (normal / bold)\n * @param {string} [options.styles.textAlign] Type of text align (left / center / right)\n * @param {string} [options.styles.textDecoration] Type of line (underline / line-through / overline)\n * @param {{x: number, y: number}} [options.position] - Initial position\n * @returns {Promise}\n */\n execute(graphics, text, options) {\n const textComp = graphics.getComponent(TEXT);\n\n if (this.undoData.object) {\n const undoObject = this.undoData.object;\n\n return new Promise((resolve, reject) => {\n if (!graphics.contains(undoObject)) {\n graphics.add(undoObject);\n resolve(undoObject);\n } else {\n reject(rejectMessages.redo);\n }\n });\n }\n\n return textComp.add(text, options).then((objectProps) => {\n const { id } = objectProps;\n const textObject = graphics.getObject(id);\n\n this.undoData.object = textObject;\n\n setCachedUndoDataForDimension(\n makeSelectionUndoData(textObject, () => makeSelectionUndoDatum(id, textObject, false))\n );\n\n return objectProps;\n });\n },\n\n /**\n * @param {Graphics} graphics - Graphics instance\n * @returns {Promise}\n */\n undo(graphics) {\n graphics.remove(this.undoData.object);\n\n return Promise.resolve();\n },\n};\n\ncommandFactory.register(command);\n\nexport default command;\n","/**\n * @author NHN. FE Development Team \n * @fileoverview Apply a filter into an image\n */\nimport snippet from 'tui-code-snippet';\nimport commandFactory from '@/factory/command';\nimport { componentNames, rejectMessages, commandNames } from '@/consts';\n\nconst { FILTER } = componentNames;\n\n/**\n * Cached data for undo\n * @type {Object}\n */\nlet cachedUndoDataForSilent = null;\n\n/**\n * Make undoData\n * @param {string} type - Filter type\n * @param {Object} prevfilterOption - prev Filter options\n * @param {Object} options - Filter options\n * @returns {object} - undo data\n */\nfunction makeUndoData(type, prevfilterOption, options) {\n const undoData = {};\n\n if (type === 'mask') {\n undoData.object = options.mask;\n }\n\n undoData.options = prevfilterOption;\n\n return undoData;\n}\n\nconst command = {\n name: commandNames.APPLY_FILTER,\n\n /**\n * Apply a filter into an image\n * @param {Graphics} graphics - Graphics instance\n * @param {string} type - Filter type\n * @param {Object} options - Filter options\n * @param {number} options.maskObjId - masking image object id\n * @param {boolean} isSilent - is silent execution or not\n * @returns {Promise}\n */\n execute(graphics, type, options, isSilent) {\n const filterComp = graphics.getComponent(FILTER);\n\n if (type === 'mask') {\n const maskObj = graphics.getObject(options.maskObjId);\n\n if (!(maskObj && maskObj.isType('image'))) {\n return Promise.reject(rejectMessages.invalidParameters);\n }\n\n snippet.extend(options, { mask: maskObj });\n graphics.remove(options.mask);\n }\n if (!this.isRedo) {\n const prevfilterOption = filterComp.getOptions(type);\n const undoData = makeUndoData(type, prevfilterOption, options);\n\n cachedUndoDataForSilent = this.setUndoData(undoData, cachedUndoDataForSilent, isSilent);\n }\n\n return filterComp.add(type, options);\n },\n\n /**\n * @param {Graphics} graphics - Graphics instance\n * @param {string} type - Filter type\n * @returns {Promise}\n */\n undo(graphics, type) {\n const filterComp = graphics.getComponent(FILTER);\n\n if (type === 'mask') {\n const mask = this.undoData.object;\n graphics.add(mask);\n graphics.setActiveObject(mask);\n\n return filterComp.remove(type);\n }\n\n // options changed case\n if (this.undoData.options) {\n return filterComp.add(type, this.undoData.options);\n }\n\n // filter added case\n return filterComp.remove(type);\n },\n};\n\ncommandFactory.register(command);\n\nexport default command;\n","/**\n * @author NHN. FE Development Team \n * @fileoverview Change icon color\n */\nimport commandFactory from '@/factory/command';\nimport { Promise } from '@/util';\nimport { componentNames, rejectMessages, commandNames } from '@/consts';\n\nconst { ICON } = componentNames;\n\nconst command = {\n name: commandNames.CHANGE_ICON_COLOR,\n\n /**\n * Change icon color\n * @param {Graphics} graphics - Graphics instance\n * @param {number} id - object id\n * @param {string} color - Color for icon\n * @returns {Promise}\n */\n execute(graphics, id, color) {\n return new Promise((resolve, reject) => {\n const iconComp = graphics.getComponent(ICON);\n const targetObj = graphics.getObject(id);\n\n if (!targetObj) {\n reject(rejectMessages.noObject);\n }\n\n this.undoData.object = targetObj;\n this.undoData.color = iconComp.getColor(targetObj);\n iconComp.setColor(color, targetObj);\n resolve();\n });\n },\n\n /**\n * @param {Graphics} graphics - Graphics instance\n * @returns {Promise}\n */\n undo(graphics) {\n const iconComp = graphics.getComponent(ICON);\n const { object: icon, color } = this.undoData;\n\n iconComp.setColor(color, icon);\n\n return Promise.resolve();\n },\n};\n\ncommandFactory.register(command);\n\nexport default command;\n","/**\n * @author NHN. FE Development Team \n * @fileoverview change selection\n */\nimport commandFactory from '@/factory/command';\nimport { Promise } from '@/util';\nimport { commandNames } from '@/consts';\nimport { getCachedUndoDataForDimension } from '@/helper/selectionModifyHelper';\n\nconst command = {\n name: commandNames.CHANGE_SELECTION,\n\n execute(graphics, props) {\n if (this.isRedo) {\n props.forEach((prop) => {\n graphics.setObjectProperties(prop.id, prop);\n });\n } else {\n this.undoData = getCachedUndoDataForDimension();\n }\n\n return Promise.resolve();\n },\n\n undo(graphics) {\n this.undoData.forEach((datum) => {\n graphics.setObjectProperties(datum.id, datum);\n });\n\n return Promise.resolve();\n },\n};\n\ncommandFactory.register(command);\n\nexport default command;\n","/**\n * @author NHN. FE Development Team \n * @fileoverview change a shape\n */\nimport snippet from 'tui-code-snippet';\nimport commandFactory from '@/factory/command';\nimport { Promise } from '@/util';\nimport { componentNames, rejectMessages, commandNames } from '@/consts';\n\nconst { SHAPE } = componentNames;\n\n/**\n * Cached data for undo\n * @type {Object}\n */\nlet cachedUndoDataForSilent = null;\n\n/**\n * Make undoData\n * @param {object} options - shape options\n * @param {Component} targetObj - shape component\n * @returns {object} - undo data\n */\nfunction makeUndoData(options, targetObj) {\n const undoData = {\n object: targetObj,\n options: {},\n };\n\n snippet.forEachOwnProperties(options, (value, key) => {\n undoData.options[key] = targetObj[key];\n });\n\n return undoData;\n}\n\nconst command = {\n name: commandNames.CHANGE_SHAPE,\n\n /**\n * Change a shape\n * @param {Graphics} graphics - Graphics instance\n * @param {number} id - object id\n * @param {Object} options - Shape options\n * @param {string} [options.fill] - Shape foreground color (ex: '#fff', 'transparent')\n * @param {string} [options.stroke] - Shape outline color\n * @param {number} [options.strokeWidth] - Shape outline width\n * @param {number} [options.width] - Width value (When type option is 'rect', this options can use)\n * @param {number} [options.height] - Height value (When type option is 'rect', this options can use)\n * @param {number} [options.rx] - Radius x value (When type option is 'circle', this options can use)\n * @param {number} [options.ry] - Radius y value (When type option is 'circle', this options can use)\n * @param {number} [options.left] - Shape x position\n * @param {number} [options.top] - Shape y position\n * @param {number} [options.isRegular] - Whether resizing shape has 1:1 ratio or not\n * @param {boolean} isSilent - is silent execution or not\n * @returns {Promise}\n */\n execute(graphics, id, options, isSilent) {\n const shapeComp = graphics.getComponent(SHAPE);\n const targetObj = graphics.getObject(id);\n\n if (!targetObj) {\n return Promise.reject(rejectMessages.noObject);\n }\n\n if (!this.isRedo) {\n const undoData = makeUndoData(options, targetObj);\n\n cachedUndoDataForSilent = this.setUndoData(undoData, cachedUndoDataForSilent, isSilent);\n }\n\n return shapeComp.change(targetObj, options);\n },\n\n /**\n * @param {Graphics} graphics - Graphics instance\n * @returns {Promise}\n */\n undo(graphics) {\n const shapeComp = graphics.getComponent(SHAPE);\n const { object: shape, options } = this.undoData;\n\n return shapeComp.change(shape, options);\n },\n};\n\ncommandFactory.register(command);\n\nexport default command;\n","/**\n * @author NHN. FE Development Team \n * @fileoverview Change a text\n */\nimport commandFactory from '@/factory/command';\nimport { Promise } from '@/util';\nimport { componentNames, rejectMessages, commandNames } from '@/consts';\n\nconst { TEXT } = componentNames;\n\nconst command = {\n name: commandNames.CHANGE_TEXT,\n\n /**\n * Change a text\n * @param {Graphics} graphics - Graphics instance\n * @param {number} id - object id\n * @param {string} text - Changing text\n * @returns {Promise}\n */\n execute(graphics, id, text) {\n const textComp = graphics.getComponent(TEXT);\n const targetObj = graphics.getObject(id);\n\n if (!targetObj) {\n return Promise.reject(rejectMessages.noObject);\n }\n\n this.undoData.object = targetObj;\n this.undoData.text = textComp.getText(targetObj);\n\n return textComp.change(targetObj, text);\n },\n\n /**\n * @param {Graphics} graphics - Graphics instance\n * @returns {Promise}\n */\n undo(graphics) {\n const textComp = graphics.getComponent(TEXT);\n const { object: textObj, text } = this.undoData;\n\n return textComp.change(textObj, text);\n },\n};\n\ncommandFactory.register(command);\n\nexport default command;\n","/**\n * @author NHN. FE Development Team \n * @fileoverview Change text styles\n */\nimport snippet from 'tui-code-snippet';\nimport commandFactory from '@/factory/command';\nimport { Promise } from '@/util';\nimport { componentNames, rejectMessages, commandNames } from '@/consts';\n\nconst { TEXT } = componentNames;\n\n/**\n * Cached data for undo\n * @type {Object}\n */\nlet cachedUndoDataForSilent = null;\n\n/**\n * Make undoData\n * @param {object} styles - text styles\n * @param {Component} targetObj - text component\n * @returns {object} - undo data\n */\nfunction makeUndoData(styles, targetObj) {\n const undoData = {\n object: targetObj,\n styles: {},\n };\n snippet.forEachOwnProperties(styles, (value, key) => {\n const undoValue = targetObj[key];\n undoData.styles[key] = undoValue;\n });\n\n return undoData;\n}\n\nconst command = {\n name: commandNames.CHANGE_TEXT_STYLE,\n\n /**\n * Change text styles\n * @param {Graphics} graphics - Graphics instance\n * @param {number} id - object id\n * @param {Object} styles - text styles\n * @param {string} [styles.fill] Color\n * @param {string} [styles.fontFamily] Font type for text\n * @param {number} [styles.fontSize] Size\n * @param {string} [styles.fontStyle] Type of inclination (normal / italic)\n * @param {string} [styles.fontWeight] Type of thicker or thinner looking (normal / bold)\n * @param {string} [styles.textAlign] Type of text align (left / center / right)\n * @param {string} [styles.textDecoration] Type of line (underline / line-through / overline)\n * @param {boolean} isSilent - is silent execution or not\n * @returns {Promise}\n */\n execute(graphics, id, styles, isSilent) {\n const textComp = graphics.getComponent(TEXT);\n const targetObj = graphics.getObject(id);\n\n if (!targetObj) {\n return Promise.reject(rejectMessages.noObject);\n }\n if (!this.isRedo) {\n const undoData = makeUndoData(styles, targetObj);\n\n cachedUndoDataForSilent = this.setUndoData(undoData, cachedUndoDataForSilent, isSilent);\n }\n\n return textComp.setStyle(targetObj, styles);\n },\n\n /**\n * @param {Graphics} graphics - Graphics instance\n * @returns {Promise}\n */\n undo(graphics) {\n const textComp = graphics.getComponent(TEXT);\n const { object: textObj, styles } = this.undoData;\n\n return textComp.setStyle(textObj, styles);\n },\n};\n\ncommandFactory.register(command);\n\nexport default command;\n","/**\n * @author NHN. FE Development Team \n * @fileoverview Clear all objects\n */\nimport commandFactory from '@/factory/command';\nimport { Promise } from '@/util';\nimport { commandNames } from '@/consts';\n\nconst command = {\n name: commandNames.CLEAR_OBJECTS,\n\n /**\n * Clear all objects without background (main) image\n * @param {Graphics} graphics - Graphics instance\n * @returns {Promise}\n */\n execute(graphics) {\n return new Promise((resolve) => {\n this.undoData.objects = graphics.removeAll();\n resolve();\n });\n },\n\n /**\n * @param {Graphics} graphics - Graphics instance\n * @returns {Promise}\n * @ignore\n */\n undo(graphics) {\n graphics.add(this.undoData.objects);\n\n return Promise.resolve();\n },\n};\n\ncommandFactory.register(command);\n\nexport default command;\n","/**\n * @author NHN. FE Development Team \n * @fileoverview Flip an image\n */\nimport commandFactory from '@/factory/command';\nimport { componentNames, commandNames } from '@/consts';\n\nconst { FLIP } = componentNames;\n\nconst command = {\n name: commandNames.FLIP_IMAGE,\n\n /**\n * flip an image\n * @param {Graphics} graphics - Graphics instance\n * @param {string} type - 'flipX' or 'flipY' or 'reset'\n * @returns {Promise}\n */\n execute(graphics, type) {\n const flipComp = graphics.getComponent(FLIP);\n\n this.undoData.setting = flipComp.getCurrentSetting();\n\n return flipComp[type]();\n },\n\n /**\n * @param {Graphics} graphics - Graphics instance\n * @returns {Promise}\n */\n undo(graphics) {\n const flipComp = graphics.getComponent(FLIP);\n\n return flipComp.set(this.undoData.setting);\n },\n};\n\ncommandFactory.register(command);\n\nexport default command;\n","/**\n * @author NHN. FE Development Team \n * @fileoverview Load a background (main) image\n */\nimport commandFactory from '@/factory/command';\nimport { componentNames, commandNames } from '@/consts';\n\nconst { IMAGE_LOADER } = componentNames;\n\nconst command = {\n name: commandNames.LOAD_IMAGE,\n\n /**\n * Load a background (main) image\n * @param {Graphics} graphics - Graphics instance\n * @param {string} imageName - Image name\n * @param {string} imgUrl - Image Url\n * @returns {Promise}\n */\n execute(graphics, imageName, imgUrl) {\n const loader = graphics.getComponent(IMAGE_LOADER);\n const prevImage = loader.getCanvasImage();\n const prevImageWidth = prevImage ? prevImage.width : 0;\n const prevImageHeight = prevImage ? prevImage.height : 0;\n const objects = graphics.removeAll(true).filter((objectItem) => objectItem.type !== 'cropzone');\n\n objects.forEach((objectItem) => {\n objectItem.evented = true;\n });\n\n this.undoData = {\n name: loader.getImageName(),\n image: prevImage,\n objects,\n };\n\n return loader.load(imageName, imgUrl).then((newImage) => ({\n oldWidth: prevImageWidth,\n oldHeight: prevImageHeight,\n newWidth: newImage.width,\n newHeight: newImage.height,\n }));\n },\n\n /**\n * @param {Graphics} graphics - Graphics instance\n * @returns {Promise}\n */\n undo(graphics) {\n const loader = graphics.getComponent(IMAGE_LOADER);\n const { objects, name, image } = this.undoData;\n\n graphics.removeAll(true);\n graphics.add(objects);\n\n return loader.load(name, image);\n },\n};\n\ncommandFactory.register(command);\n\nexport default command;\n","/**\n * @author NHN. FE Development Team \n * @fileoverview Remove a filter from an image\n */\nimport commandFactory from '@/factory/command';\nimport { componentNames, commandNames } from '@/consts';\n\nconst { FILTER } = componentNames;\n\nconst command = {\n name: commandNames.REMOVE_FILTER,\n\n /**\n * Remove a filter from an image\n * @param {Graphics} graphics - Graphics instance\n * @param {string} type - Filter type\n * @returns {Promise}\n */\n execute(graphics, type) {\n const filterComp = graphics.getComponent(FILTER);\n\n this.undoData.options = filterComp.getOptions(type);\n\n return filterComp.remove(type);\n },\n\n /**\n * @param {Graphics} graphics - Graphics instance\n * @param {string} type - Filter type\n * @returns {Promise}\n */\n undo(graphics, type) {\n const filterComp = graphics.getComponent(FILTER);\n const { options } = this.undoData;\n\n return filterComp.add(type, options);\n },\n};\n\ncommandFactory.register(command);\n\nexport default command;\n","/**\n * @author NHN. FE Development Team \n * @fileoverview Remove an object\n */\nimport commandFactory from '@/factory/command';\nimport { Promise } from '@/util';\nimport { commandNames, rejectMessages } from '@/consts';\n\nconst command = {\n name: commandNames.REMOVE_OBJECT,\n\n /**\n * Remove an object\n * @param {Graphics} graphics - Graphics instance\n * @param {number} id - object id\n * @returns {Promise}\n */\n execute(graphics, id) {\n return new Promise((resolve, reject) => {\n this.undoData.objects = graphics.removeObjectById(id);\n if (this.undoData.objects.length) {\n resolve();\n } else {\n reject(rejectMessages.noObject);\n }\n });\n },\n\n /**\n * @param {Graphics} graphics - Graphics instance\n * @returns {Promise}\n */\n undo(graphics) {\n graphics.add(this.undoData.objects);\n\n return Promise.resolve();\n },\n};\n\ncommandFactory.register(command);\n\nexport default command;\n","/**\n * @author NHN. FE Development Team \n * @fileoverview Resize a canvas\n */\nimport commandFactory from '@/factory/command';\nimport { Promise } from '@/util';\nimport { commandNames } from '@/consts';\n\nconst command = {\n name: commandNames.RESIZE_CANVAS_DIMENSION,\n\n /**\n * resize the canvas with given dimension\n * @param {Graphics} graphics - Graphics instance\n * @param {{width: number, height: number}} dimension - Max width & height\n * @returns {Promise}\n */\n execute(graphics, dimension) {\n return new Promise((resolve) => {\n this.undoData.size = {\n width: graphics.cssMaxWidth,\n height: graphics.cssMaxHeight,\n };\n\n graphics.setCssMaxDimension(dimension);\n graphics.adjustCanvasDimension();\n resolve();\n });\n },\n\n /**\n * @param {Graphics} graphics - Graphics instance\n * @returns {Promise}\n */\n undo(graphics) {\n graphics.setCssMaxDimension(this.undoData.size);\n graphics.adjustCanvasDimension();\n\n return Promise.resolve();\n },\n};\n\ncommandFactory.register(command);\n\nexport default command;\n","/**\n * @author NHN. FE Development Team \n * @fileoverview Rotate an image\n */\nimport commandFactory from '@/factory/command';\nimport { componentNames, commandNames } from '@/consts';\n\nconst { ROTATION } = componentNames;\n\n/**\n * Cached data for undo\n * @type {Object}\n */\nlet cachedUndoDataForSilent = null;\n\n/**\n * Make undo data\n * @param {Component} rotationComp - rotation component\n * @returns {object} - undodata\n */\nfunction makeUndoData(rotationComp) {\n return {\n angle: rotationComp.getCurrentAngle(),\n };\n}\n\nconst command = {\n name: commandNames.ROTATE_IMAGE,\n\n /**\n * Rotate an image\n * @param {Graphics} graphics - Graphics instance\n * @param {string} type - 'rotate' or 'setAngle'\n * @param {number} angle - angle value (degree)\n * @param {boolean} isSilent - is silent execution or not\n * @returns {Promise}\n */\n execute(graphics, type, angle, isSilent) {\n const rotationComp = graphics.getComponent(ROTATION);\n\n if (!this.isRedo) {\n const undoData = makeUndoData(rotationComp);\n\n cachedUndoDataForSilent = this.setUndoData(undoData, cachedUndoDataForSilent, isSilent);\n }\n\n return rotationComp[type](angle);\n },\n\n /**\n * @param {Graphics} graphics - Graphics instance\n * @returns {Promise}\n */\n undo(graphics) {\n const rotationComp = graphics.getComponent(ROTATION);\n const [, type, angle] = this.args;\n\n if (type === 'setAngle') {\n return rotationComp[type](this.undoData.angle);\n }\n\n return rotationComp.rotate(-angle);\n },\n};\n\ncommandFactory.register(command);\n\nexport default command;\n","/**\n * @author NHN. FE Development Team \n * @fileoverview Set object properties\n */\nimport commandFactory from '@/factory/command';\nimport { Promise } from '@/util';\nimport { commandNames, rejectMessages } from '@/consts';\n\nconst command = {\n name: commandNames.SET_OBJECT_POSITION,\n\n /**\n * Set object properties\n * @param {Graphics} graphics - Graphics instance\n * @param {number} id - object id\n * @param {Object} posInfo - position object\n * @param {number} posInfo.x - x position\n * @param {number} posInfo.y - y position\n * @param {string} posInfo.originX - can be 'left', 'center', 'right'\n * @param {string} posInfo.originY - can be 'top', 'center', 'bottom'\n * @returns {Promise}\n */\n execute(graphics, id, posInfo) {\n const targetObj = graphics.getObject(id);\n\n if (!targetObj) {\n return Promise.reject(rejectMessages.noObject);\n }\n\n this.undoData.objectId = id;\n this.undoData.props = graphics.getObjectProperties(id, ['left', 'top']);\n\n graphics.setObjectPosition(id, posInfo);\n graphics.renderAll();\n\n return Promise.resolve();\n },\n\n /**\n * @param {Graphics} graphics - Graphics instance\n * @returns {Promise}\n */\n undo(graphics) {\n const { objectId, props } = this.undoData;\n\n graphics.setObjectProperties(objectId, props);\n graphics.renderAll();\n\n return Promise.resolve();\n },\n};\n\ncommandFactory.register(command);\n\nexport default command;\n","/**\n * @author NHN. FE Development Team \n * @fileoverview Set object properties\n */\nimport snippet from 'tui-code-snippet';\nimport commandFactory from '@/factory/command';\nimport { Promise } from '@/util';\nimport { commandNames, rejectMessages } from '@/consts';\n\nconst command = {\n name: commandNames.SET_OBJECT_PROPERTIES,\n\n /**\n * Set object properties\n * @param {Graphics} graphics - Graphics instance\n * @param {number} id - object id\n * @param {Object} props - properties\n * @param {string} [props.fill] Color\n * @param {string} [props.fontFamily] Font type for text\n * @param {number} [props.fontSize] Size\n * @param {string} [props.fontStyle] Type of inclination (normal / italic)\n * @param {string} [props.fontWeight] Type of thicker or thinner looking (normal / bold)\n * @param {string} [props.textAlign] Type of text align (left / center / right)\n * @param {string} [props.textDecoration] Type of line (underline / line-through / overline)\n * @returns {Promise}\n */\n execute(graphics, id, props) {\n const targetObj = graphics.getObject(id);\n\n if (!targetObj) {\n return Promise.reject(rejectMessages.noObject);\n }\n\n this.undoData.props = {};\n snippet.forEachOwnProperties(props, (value, key) => {\n this.undoData.props[key] = targetObj[key];\n });\n\n graphics.setObjectProperties(id, props);\n\n return Promise.resolve();\n },\n\n /**\n * @param {Graphics} graphics - Graphics instance\n * @param {number} id - object id\n * @returns {Promise}\n */\n undo(graphics, id) {\n const { props } = this.undoData;\n\n graphics.setObjectProperties(id, props);\n\n return Promise.resolve();\n },\n};\n\ncommandFactory.register(command);\n\nexport default command;\n","/**\n * @author NHN. FE Development Team \n * @fileoverview Image crop module (start cropping, end cropping)\n */\nimport snippet from 'tui-code-snippet';\nimport fabric from 'fabric';\nimport Component from '@/interface/component';\nimport Cropzone from '@/extension/cropzone';\nimport { keyCodes, componentNames, CROPZONE_DEFAULT_OPTIONS } from '@/consts';\nimport { clamp, fixFloatingPoint } from '@/util';\n\nconst MOUSE_MOVE_THRESHOLD = 10;\nconst DEFAULT_OPTION = {\n presetRatio: null,\n top: -10,\n left: -10,\n height: 1,\n width: 1,\n};\n\n/**\n * Cropper components\n * @param {Graphics} graphics - Graphics instance\n * @extends {Component}\n * @class Cropper\n * @ignore\n */\nclass Cropper extends Component {\n constructor(graphics) {\n super(componentNames.CROPPER, graphics);\n\n /**\n * Cropzone\n * @type {Cropzone}\n * @private\n */\n this._cropzone = null;\n\n /**\n * StartX of Cropzone\n * @type {number}\n * @private\n */\n this._startX = null;\n\n /**\n * StartY of Cropzone\n * @type {number}\n * @private\n */\n this._startY = null;\n\n /**\n * State whether shortcut key is pressed or not\n * @type {boolean}\n * @private\n */\n this._withShiftKey = false;\n\n /**\n * Listeners\n * @type {object.}\n * @private\n */\n this._listeners = {\n keydown: this._onKeyDown.bind(this),\n keyup: this._onKeyUp.bind(this),\n mousedown: this._onFabricMouseDown.bind(this),\n mousemove: this._onFabricMouseMove.bind(this),\n mouseup: this._onFabricMouseUp.bind(this),\n };\n }\n\n /**\n * Start cropping\n */\n start() {\n if (this._cropzone) {\n return;\n }\n const canvas = this.getCanvas();\n\n canvas.forEachObject((obj) => {\n // {@link http://fabricjs.com/docs/fabric.Object.html#evented}\n obj.evented = false;\n });\n\n this._cropzone = new Cropzone(\n canvas,\n snippet.extend(\n {\n left: 0,\n top: 0,\n width: 0.5,\n height: 0.5,\n strokeWidth: 0, // {@link https://github.com/kangax/fabric.js/issues/2860}\n cornerSize: 10,\n cornerColor: 'black',\n fill: 'transparent',\n },\n CROPZONE_DEFAULT_OPTIONS,\n this.graphics.cropSelectionStyle\n )\n );\n\n canvas.discardActiveObject();\n canvas.add(this._cropzone);\n canvas.on('mouse:down', this._listeners.mousedown);\n canvas.selection = false;\n canvas.defaultCursor = 'crosshair';\n\n fabric.util.addListener(document, 'keydown', this._listeners.keydown);\n fabric.util.addListener(document, 'keyup', this._listeners.keyup);\n }\n\n /**\n * End cropping\n */\n end() {\n const canvas = this.getCanvas();\n const cropzone = this._cropzone;\n\n if (!cropzone) {\n return;\n }\n canvas.remove(cropzone);\n canvas.selection = true;\n canvas.defaultCursor = 'default';\n canvas.off('mouse:down', this._listeners.mousedown);\n canvas.forEachObject((obj) => {\n obj.evented = true;\n });\n\n this._cropzone = null;\n\n fabric.util.removeListener(document, 'keydown', this._listeners.keydown);\n fabric.util.removeListener(document, 'keyup', this._listeners.keyup);\n }\n\n /**\n * Change cropzone visible\n * @param {boolean} visible - cropzone visible state\n */\n changeVisibility(visible) {\n if (this._cropzone) {\n this._cropzone.set({ visible });\n }\n }\n\n /**\n * onMousedown handler in fabric canvas\n * @param {{target: fabric.Object, e: MouseEvent}} fEvent - Fabric event\n * @private\n */\n _onFabricMouseDown(fEvent) {\n const canvas = this.getCanvas();\n\n if (fEvent.target) {\n return;\n }\n\n canvas.selection = false;\n const coord = canvas.getPointer(fEvent.e);\n\n this._startX = coord.x;\n this._startY = coord.y;\n\n canvas.on({\n 'mouse:move': this._listeners.mousemove,\n 'mouse:up': this._listeners.mouseup,\n });\n }\n\n /**\n * onMousemove handler in fabric canvas\n * @param {{target: fabric.Object, e: MouseEvent}} fEvent - Fabric event\n * @private\n */\n _onFabricMouseMove(fEvent) {\n const canvas = this.getCanvas();\n const pointer = canvas.getPointer(fEvent.e);\n const { x, y } = pointer;\n const cropzone = this._cropzone;\n\n if (Math.abs(x - this._startX) + Math.abs(y - this._startY) > MOUSE_MOVE_THRESHOLD) {\n canvas.remove(cropzone);\n cropzone.set(this._calcRectDimensionFromPoint(x, y));\n\n canvas.add(cropzone);\n canvas.setActiveObject(cropzone);\n }\n }\n\n /**\n * Get rect dimension setting from Canvas-Mouse-Position(x, y)\n * @param {number} x - Canvas-Mouse-Position x\n * @param {number} y - Canvas-Mouse-Position Y\n * @returns {{left: number, top: number, width: number, height: number}}\n * @private\n */\n _calcRectDimensionFromPoint(x, y) {\n const canvas = this.getCanvas();\n const canvasWidth = canvas.getWidth();\n const canvasHeight = canvas.getHeight();\n const startX = this._startX;\n const startY = this._startY;\n let left = clamp(x, 0, startX);\n let top = clamp(y, 0, startY);\n let width = clamp(x, startX, canvasWidth) - left; // (startX <= x(mouse) <= canvasWidth) - left\n let height = clamp(y, startY, canvasHeight) - top; // (startY <= y(mouse) <= canvasHeight) - top\n\n if (this._withShiftKey) {\n // make fixed ratio cropzone\n if (width > height) {\n height = width;\n } else if (height > width) {\n width = height;\n }\n\n if (startX >= x) {\n left = startX - width;\n }\n\n if (startY >= y) {\n top = startY - height;\n }\n }\n\n return {\n left,\n top,\n width,\n height,\n };\n }\n\n /**\n * onMouseup handler in fabric canvas\n * @private\n */\n _onFabricMouseUp() {\n const cropzone = this._cropzone;\n const listeners = this._listeners;\n const canvas = this.getCanvas();\n\n canvas.setActiveObject(cropzone);\n canvas.off({\n 'mouse:move': listeners.mousemove,\n 'mouse:up': listeners.mouseup,\n });\n }\n\n /**\n * Get cropped image data\n * @param {Object} cropRect cropzone rect\n * @param {Number} cropRect.left left position\n * @param {Number} cropRect.top top position\n * @param {Number} cropRect.width width\n * @param {Number} cropRect.height height\n * @returns {?{imageName: string, url: string}} cropped Image data\n */\n getCroppedImageData(cropRect) {\n const canvas = this.getCanvas();\n const containsCropzone = canvas.contains(this._cropzone);\n if (!cropRect) {\n return null;\n }\n\n if (containsCropzone) {\n canvas.remove(this._cropzone);\n }\n\n const imageData = {\n imageName: this.getImageName(),\n url: canvas.toDataURL(cropRect),\n };\n\n if (containsCropzone) {\n canvas.add(this._cropzone);\n }\n\n return imageData;\n }\n\n /**\n * Get cropped rect\n * @returns {Object} rect\n */\n getCropzoneRect() {\n const cropzone = this._cropzone;\n\n if (!cropzone.isValid()) {\n return null;\n }\n\n return {\n left: cropzone.left,\n top: cropzone.top,\n width: cropzone.width,\n height: cropzone.height,\n };\n }\n\n /**\n * Set a cropzone square\n * @param {number} [presetRatio] - preset ratio\n */\n setCropzoneRect(presetRatio) {\n const canvas = this.getCanvas();\n const cropzone = this._cropzone;\n\n canvas.discardActiveObject();\n canvas.selection = false;\n canvas.remove(cropzone);\n\n cropzone.set(presetRatio ? this._getPresetPropertiesForCropSize(presetRatio) : DEFAULT_OPTION);\n\n canvas.add(cropzone);\n canvas.selection = true;\n\n if (presetRatio) {\n canvas.setActiveObject(cropzone);\n }\n }\n\n /**\n * get a cropzone square info\n * @param {number} presetRatio - preset ratio\n * @returns {{presetRatio: number, left: number, top: number, width: number, height: number}}\n * @private\n */\n _getPresetPropertiesForCropSize(presetRatio) {\n const canvas = this.getCanvas();\n const originalWidth = canvas.getWidth();\n const originalHeight = canvas.getHeight();\n\n const standardSize = originalWidth >= originalHeight ? originalWidth : originalHeight;\n const getScale = (value, orignalValue) => (value > orignalValue ? orignalValue / value : 1);\n\n let width = standardSize * presetRatio;\n let height = standardSize;\n\n const scaleWidth = getScale(width, originalWidth);\n [width, height] = snippet.map([width, height], (sizeValue) => sizeValue * scaleWidth);\n\n const scaleHeight = getScale(height, originalHeight);\n [width, height] = snippet.map([width, height], (sizeValue) =>\n fixFloatingPoint(sizeValue * scaleHeight)\n );\n\n return {\n presetRatio,\n top: (originalHeight - height) / 2,\n left: (originalWidth - width) / 2,\n width,\n height,\n };\n }\n\n /**\n * Keydown event handler\n * @param {KeyboardEvent} e - Event object\n * @private\n */\n _onKeyDown(e) {\n if (e.keyCode === keyCodes.SHIFT) {\n this._withShiftKey = true;\n }\n }\n\n /**\n * Keyup event handler\n * @param {KeyboardEvent} e - Event object\n * @private\n */\n _onKeyUp(e) {\n if (e.keyCode === keyCodes.SHIFT) {\n this._withShiftKey = false;\n }\n }\n}\n\nexport default Cropper;\n","/**\n * @author NHN. FE Development Team \n * @fileoverview Add filter module\n */\nimport { isUndefined, extend, forEach, filter } from 'tui-code-snippet';\nimport fabric from 'fabric';\nimport Component from '@/interface/component';\nimport { Promise } from '@/util';\nimport { rejectMessages, componentNames } from '@/consts';\nimport Mask from '@/extension/mask';\nimport Sharpen from '@/extension/sharpen';\nimport Emboss from '@/extension/emboss';\nimport ColorFilter from '@/extension/colorFilter';\n\nconst { filters } = fabric.Image;\n\nfilters.Mask = Mask;\nfilters.Sharpen = Sharpen;\nfilters.Emboss = Emboss;\nfilters.ColorFilter = ColorFilter;\n\n/**\n * Filter\n * @class Filter\n * @param {Graphics} graphics - Graphics instance\n * @extends {Component}\n * @ignore\n */\nclass Filter extends Component {\n constructor(graphics) {\n super(componentNames.FILTER, graphics);\n }\n\n /**\n * Add filter to source image (a specific filter is added on fabric.js)\n * @param {string} type - Filter type\n * @param {Object} [options] - Options of filter\n * @returns {Promise}\n */\n add(type, options) {\n return new Promise((resolve, reject) => {\n const sourceImg = this._getSourceImage();\n const canvas = this.getCanvas();\n let imgFilter = this._getFilter(sourceImg, type);\n if (!imgFilter) {\n imgFilter = this._createFilter(sourceImg, type, options);\n }\n\n if (!imgFilter) {\n reject(rejectMessages.invalidParameters);\n }\n\n this._changeFilterValues(imgFilter, options);\n\n this._apply(sourceImg, () => {\n canvas.renderAll();\n resolve({\n type,\n action: 'add',\n options,\n });\n });\n });\n }\n\n /**\n * Remove filter to source image\n * @param {string} type - Filter type\n * @returns {Promise}\n */\n remove(type) {\n return new Promise((resolve, reject) => {\n const sourceImg = this._getSourceImage();\n const canvas = this.getCanvas();\n const options = this.getOptions(type);\n\n if (!sourceImg.filters.length) {\n reject(rejectMessages.unsupportedOperation);\n }\n\n this._removeFilter(sourceImg, type);\n\n this._apply(sourceImg, () => {\n canvas.renderAll();\n resolve({\n type,\n action: 'remove',\n options,\n });\n });\n });\n }\n\n /**\n * Whether this has the filter or not\n * @param {string} type - Filter type\n * @returns {boolean} true if it has the filter\n */\n hasFilter(type) {\n return !!this._getFilter(this._getSourceImage(), type);\n }\n\n /**\n * Get a filter options\n * @param {string} type - Filter type\n * @returns {Object} filter options or null if there is no that filter\n */\n getOptions(type) {\n const sourceImg = this._getSourceImage();\n const imgFilter = this._getFilter(sourceImg, type);\n if (!imgFilter) {\n return null;\n }\n\n return extend({}, imgFilter.options);\n }\n\n /**\n * Change filter values\n * @param {Object} imgFilter object of filter\n * @param {Object} options object\n * @private\n */\n _changeFilterValues(imgFilter, options) {\n forEach(options, (value, key) => {\n if (!isUndefined(imgFilter[key])) {\n imgFilter[key] = value;\n }\n });\n forEach(imgFilter.options, (value, key) => {\n if (!isUndefined(options[key])) {\n imgFilter.options[key] = options[key];\n }\n });\n }\n\n /**\n * Apply filter\n * @param {fabric.Image} sourceImg - Source image to apply filter\n * @param {function} callback - Executed function after applying filter\n * @private\n */\n _apply(sourceImg, callback) {\n sourceImg.filters.push();\n const result = sourceImg.applyFilters();\n if (result) {\n callback();\n }\n }\n\n /**\n * Get source image on canvas\n * @returns {fabric.Image} Current source image on canvas\n * @private\n */\n _getSourceImage() {\n return this.getCanvasImage();\n }\n\n /**\n * Create filter instance\n * @param {fabric.Image} sourceImg - Source image to apply filter\n * @param {string} type - Filter type\n * @param {Object} [options] - Options of filter\n * @returns {Object} Fabric object of filter\n * @private\n */\n _createFilter(sourceImg, type, options) {\n let filterObj;\n // capitalize first letter for matching with fabric image filter name\n const fabricType = this._getFabricFilterType(type);\n const ImageFilter = fabric.Image.filters[fabricType];\n if (ImageFilter) {\n filterObj = new ImageFilter(options);\n filterObj.options = options;\n sourceImg.filters.push(filterObj);\n }\n\n return filterObj;\n }\n\n /**\n * Get applied filter instance\n * @param {fabric.Image} sourceImg - Source image to apply filter\n * @param {string} type - Filter type\n * @returns {Object} Fabric object of filter\n * @private\n */\n _getFilter(sourceImg, type) {\n let imgFilter = null;\n\n if (sourceImg) {\n const fabricType = this._getFabricFilterType(type);\n const { length } = sourceImg.filters;\n let item, i;\n\n for (i = 0; i < length; i += 1) {\n item = sourceImg.filters[i];\n if (item.type === fabricType) {\n imgFilter = item;\n break;\n }\n }\n }\n\n return imgFilter;\n }\n\n /**\n * Remove applied filter instance\n * @param {fabric.Image} sourceImg - Source image to apply filter\n * @param {string} type - Filter type\n * @private\n */\n _removeFilter(sourceImg, type) {\n const fabricType = this._getFabricFilterType(type);\n sourceImg.filters = filter(sourceImg.filters, (value) => value.type !== fabricType);\n }\n\n /**\n * Change filter class name to fabric's, especially capitalizing first letter\n * @param {string} type - Filter type\n * @example\n * 'grayscale' -> 'Grayscale'\n * @returns {string} Fabric filter class name\n */\n _getFabricFilterType(type) {\n return type.charAt(0).toUpperCase() + type.slice(1);\n }\n}\n\nexport default Filter;\n","/**\n * @author NHN. FE Development Team \n * @fileoverview Image flip module\n */\nimport snippet from 'tui-code-snippet';\nimport Component from '@/interface/component';\nimport { Promise } from '@/util';\nimport { componentNames, rejectMessages } from '@/consts';\n\n/**\n * Flip\n * @class Flip\n * @param {Graphics} graphics - Graphics instance\n * @extends {Component}\n * @ignore\n */\nclass Flip extends Component {\n constructor(graphics) {\n super(componentNames.FLIP, graphics);\n }\n\n /**\n * Get current flip settings\n * @returns {{flipX: Boolean, flipY: Boolean}}\n */\n getCurrentSetting() {\n const canvasImage = this.getCanvasImage();\n\n return {\n flipX: canvasImage.flipX,\n flipY: canvasImage.flipY,\n };\n }\n\n /**\n * Set flipX, flipY\n * @param {{flipX: Boolean, flipY: Boolean}} newSetting - Flip setting\n * @returns {Promise}\n */\n set(newSetting) {\n const setting = this.getCurrentSetting();\n const isChangingFlipX = setting.flipX !== newSetting.flipX;\n const isChangingFlipY = setting.flipY !== newSetting.flipY;\n\n if (!isChangingFlipX && !isChangingFlipY) {\n return Promise.reject(rejectMessages.flip);\n }\n\n snippet.extend(setting, newSetting);\n this.setImageProperties(setting, true);\n this._invertAngle(isChangingFlipX, isChangingFlipY);\n this._flipObjects(isChangingFlipX, isChangingFlipY);\n\n return Promise.resolve({\n flipX: setting.flipX,\n flipY: setting.flipY,\n angle: this.getCanvasImage().angle,\n });\n }\n\n /**\n * Invert image angle for flip\n * @param {boolean} isChangingFlipX - Change flipX\n * @param {boolean} isChangingFlipY - Change flipY\n */\n _invertAngle(isChangingFlipX, isChangingFlipY) {\n const canvasImage = this.getCanvasImage();\n let { angle } = canvasImage;\n\n if (isChangingFlipX) {\n angle *= -1;\n }\n if (isChangingFlipY) {\n angle *= -1;\n }\n canvasImage.rotate(parseFloat(angle)).setCoords(); // parseFloat for -0 to 0\n }\n\n /**\n * Flip objects\n * @param {boolean} isChangingFlipX - Change flipX\n * @param {boolean} isChangingFlipY - Change flipY\n * @private\n */\n _flipObjects(isChangingFlipX, isChangingFlipY) {\n const canvas = this.getCanvas();\n\n if (isChangingFlipX) {\n canvas.forEachObject((obj) => {\n obj\n .set({\n angle: parseFloat(obj.angle * -1), // parseFloat for -0 to 0\n flipX: !obj.flipX,\n left: canvas.width - obj.left,\n })\n .setCoords();\n });\n }\n if (isChangingFlipY) {\n canvas.forEachObject((obj) => {\n obj\n .set({\n angle: parseFloat(obj.angle * -1), // parseFloat for -0 to 0\n flipY: !obj.flipY,\n top: canvas.height - obj.top,\n })\n .setCoords();\n });\n }\n canvas.renderAll();\n }\n\n /**\n * Reset flip settings\n * @returns {Promise}\n */\n reset() {\n return this.set({\n flipX: false,\n flipY: false,\n });\n }\n\n /**\n * Flip x\n * @returns {Promise}\n */\n flipX() {\n const current = this.getCurrentSetting();\n\n return this.set({\n flipX: !current.flipX,\n flipY: current.flipY,\n });\n }\n\n /**\n * Flip y\n * @returns {Promise}\n */\n flipY() {\n const current = this.getCurrentSetting();\n\n return this.set({\n flipX: current.flipX,\n flipY: !current.flipY,\n });\n }\n}\n\nexport default Flip;\n","/**\n * @author NHN. FE Development Team \n * @fileoverview Free drawing module, Set brush\n */\nimport fabric from 'fabric';\nimport Component from '@/interface/component';\nimport { componentNames } from '@/consts';\n\n/**\n * FreeDrawing\n * @class FreeDrawing\n * @param {Graphics} graphics - Graphics instance\n * @extends {Component}\n * @ignore\n */\nclass FreeDrawing extends Component {\n constructor(graphics) {\n super(componentNames.FREE_DRAWING, graphics);\n\n /**\n * Brush width\n * @type {number}\n */\n this.width = 12;\n\n /**\n * fabric.Color instance for brush color\n * @type {fabric.Color}\n */\n this.oColor = new fabric.Color('rgba(0, 0, 0, 0.5)');\n }\n\n /**\n * Start free drawing mode\n * @param {{width: ?number, color: ?string}} [setting] - Brush width & color\n */\n start(setting) {\n const canvas = this.getCanvas();\n\n canvas.isDrawingMode = true;\n this.setBrush(setting);\n }\n\n /**\n * Set brush\n * @param {{width: ?number, color: ?string}} [setting] - Brush width & color\n */\n setBrush(setting) {\n const brush = this.getCanvas().freeDrawingBrush;\n\n setting = setting || {};\n this.width = setting.width || this.width;\n if (setting.color) {\n this.oColor = new fabric.Color(setting.color);\n }\n brush.width = this.width;\n brush.color = this.oColor.toRgba();\n }\n\n /**\n * End free drawing mode\n */\n end() {\n const canvas = this.getCanvas();\n\n canvas.isDrawingMode = false;\n }\n}\n\nexport default FreeDrawing;\n","/**\n * @author NHN. FE Development Team \n * @fileoverview Add icon module\n */\nimport snippet from 'tui-code-snippet';\nimport fabric from 'fabric';\nimport Component from '@/interface/component';\nimport { Promise } from '@/util';\nimport { eventNames as events, rejectMessages, componentNames, fObjectOptions } from '@/consts';\n\nconst pathMap = {\n arrow: 'M 0 90 H 105 V 120 L 160 60 L 105 0 V 30 H 0 Z',\n cancel:\n 'M 0 30 L 30 60 L 0 90 L 30 120 L 60 90 L 90 120 L 120 90 ' +\n 'L 90 60 L 120 30 L 90 0 L 60 30 L 30 0 Z',\n};\n\n/**\n * Icon\n * @class Icon\n * @param {Graphics} graphics - Graphics instance\n * @extends {Component}\n * @ignore\n */\nclass Icon extends Component {\n constructor(graphics) {\n super(componentNames.ICON, graphics);\n\n /**\n * Default icon color\n * @type {string}\n */\n this._oColor = '#000000';\n\n /**\n * Path value of each icon type\n * @type {Object}\n */\n this._pathMap = pathMap;\n\n /**\n * Type of the drawing icon\n * @type {string}\n * @private\n */\n this._type = null;\n\n /**\n * Color of the drawing icon\n * @type {string}\n * @private\n */\n this._iconColor = null;\n\n /**\n * Event handler list\n * @type {Object}\n * @private\n */\n this._handlers = {\n mousedown: this._onFabricMouseDown.bind(this),\n mousemove: this._onFabricMouseMove.bind(this),\n mouseup: this._onFabricMouseUp.bind(this),\n };\n }\n\n /**\n * Set states of the current drawing shape\n * @ignore\n * @param {string} type - Icon type ('arrow', 'cancel', custom icon name)\n * @param {string} iconColor - Icon foreground color\n */\n setStates(type, iconColor) {\n this._type = type;\n this._iconColor = iconColor;\n }\n\n /**\n * Start to draw the icon on canvas\n * @ignore\n */\n start() {\n const canvas = this.getCanvas();\n canvas.selection = false;\n canvas.on('mouse:down', this._handlers.mousedown);\n }\n\n /**\n * End to draw the icon on canvas\n * @ignore\n */\n end() {\n const canvas = this.getCanvas();\n\n canvas.selection = true;\n canvas.off({\n 'mouse:down': this._handlers.mousedown,\n });\n }\n\n /**\n * Add icon\n * @param {string} type - Icon type\n * @param {Object} options - Icon options\n * @param {string} [options.fill] - Icon foreground color\n * @param {string} [options.left] - Icon x position\n * @param {string} [options.top] - Icon y position\n * @returns {Promise}\n */\n add(type, options) {\n return new Promise((resolve, reject) => {\n const canvas = this.getCanvas();\n const path = this._pathMap[type];\n const selectionStyle = fObjectOptions.SELECTION_STYLE;\n const icon = path ? this._createIcon(path) : null;\n this._icon = icon;\n\n if (!icon) {\n reject(rejectMessages.invalidParameters);\n }\n\n icon.set(\n snippet.extend(\n {\n type: 'icon',\n fill: this._oColor,\n },\n selectionStyle,\n options,\n this.graphics.controlStyle\n )\n );\n\n canvas.add(icon).setActiveObject(icon);\n\n resolve(this.graphics.createObjectProperties(icon));\n });\n }\n\n /**\n * Register icon paths\n * @param {{key: string, value: string}} pathInfos - Path infos\n */\n registerPaths(pathInfos) {\n snippet.forEach(\n pathInfos,\n (path, type) => {\n this._pathMap[type] = path;\n },\n this\n );\n }\n\n /**\n * Set icon object color\n * @param {string} color - Color to set\n * @param {fabric.Path}[obj] - Current activated path object\n */\n setColor(color, obj) {\n this._oColor = color;\n\n if (obj && obj.get('type') === 'icon') {\n obj.set({ fill: this._oColor });\n this.getCanvas().renderAll();\n }\n }\n\n /**\n * Get icon color\n * @param {fabric.Path}[obj] - Current activated path object\n * @returns {string} color\n */\n getColor(obj) {\n return obj.fill;\n }\n\n /**\n * Create icon object\n * @param {string} path - Path value to create icon\n * @returns {fabric.Path} Path object\n */\n _createIcon(path) {\n return new fabric.Path(path);\n }\n\n /**\n * MouseDown event handler on canvas\n * @param {{target: fabric.Object, e: MouseEvent}} fEvent - Fabric event object\n * @private\n */\n _onFabricMouseDown(fEvent) {\n const canvas = this.getCanvas();\n\n this._startPoint = canvas.getPointer(fEvent.e);\n const { x: left, y: top } = this._startPoint;\n\n this.add(this._type, {\n left,\n top,\n fill: this._iconColor,\n }).then(() => {\n this.fire(events.ADD_OBJECT, this.graphics.createObjectProperties(this._icon));\n canvas.on('mouse:move', this._handlers.mousemove);\n canvas.on('mouse:up', this._handlers.mouseup);\n });\n }\n\n /**\n * MouseMove event handler on canvas\n * @param {{target: fabric.Object, e: MouseEvent}} fEvent - Fabric event object\n * @private\n */\n _onFabricMouseMove(fEvent) {\n const canvas = this.getCanvas();\n\n if (!this._icon) {\n return;\n }\n const moveOriginPointer = canvas.getPointer(fEvent.e);\n\n const scaleX = (moveOriginPointer.x - this._startPoint.x) / this._icon.width;\n const scaleY = (moveOriginPointer.y - this._startPoint.y) / this._icon.height;\n\n this._icon.set({\n scaleX: Math.abs(scaleX * 2),\n scaleY: Math.abs(scaleY * 2),\n });\n\n this._icon.setCoords();\n canvas.renderAll();\n }\n\n /**\n * MouseUp event handler on canvas\n * @private\n */\n _onFabricMouseUp() {\n const canvas = this.getCanvas();\n\n this.fire(events.OBJECT_ADDED, this.graphics.createObjectProperties(this._icon));\n\n this._icon = null;\n\n canvas.off('mouse:down', this._handlers.mousedown);\n canvas.off('mouse:move', this._handlers.mousemove);\n canvas.off('mouse:up', this._handlers.mouseup);\n }\n}\n\nexport default Icon;\n","/**\n * @author NHN. FE Development Team \n * @fileoverview Image loader\n */\nimport Component from '@/interface/component';\nimport { Promise } from '@/util';\nimport { componentNames, rejectMessages } from '@/consts';\n\nconst imageOption = {\n padding: 0,\n crossOrigin: 'Anonymous',\n};\n\n/**\n * ImageLoader components\n * @extends {Component}\n * @class ImageLoader\n * @param {Graphics} graphics - Graphics instance\n * @ignore\n */\nclass ImageLoader extends Component {\n constructor(graphics) {\n super(componentNames.IMAGE_LOADER, graphics);\n }\n\n /**\n * Load image from url\n * @param {?string} imageName - File name\n * @param {?(fabric.Image|string)} img - fabric.Image instance or URL of an image\n * @returns {Promise}\n */\n load(imageName, img) {\n let promise;\n\n if (!imageName && !img) {\n // Back to the initial state, not error.\n const canvas = this.getCanvas();\n\n canvas.backgroundImage = null;\n canvas.renderAll();\n\n promise = new Promise((resolve) => {\n this.setCanvasImage('', null);\n resolve();\n });\n } else {\n promise = this._setBackgroundImage(img).then((oImage) => {\n this.setCanvasImage(imageName, oImage);\n this.adjustCanvasDimension();\n\n return oImage;\n });\n }\n\n return promise;\n }\n\n /**\n * Set background image\n * @param {?(fabric.Image|String)} img fabric.Image instance or URL of an image to set background to\n * @returns {Promise}\n * @private\n */\n _setBackgroundImage(img) {\n if (!img) {\n return Promise.reject(rejectMessages.loadImage);\n }\n\n return new Promise((resolve, reject) => {\n const canvas = this.getCanvas();\n\n canvas.setBackgroundImage(\n img,\n () => {\n const oImage = canvas.backgroundImage;\n\n if (oImage && oImage.getElement()) {\n resolve(oImage);\n } else {\n reject(rejectMessages.loadingImageFailed);\n }\n },\n imageOption\n );\n });\n }\n}\n\nexport default ImageLoader;\n","/**\n * @author NHN. FE Development Team \n * @fileoverview Free drawing module, Set brush\n */\nimport snippet from 'tui-code-snippet';\nimport fabric from 'fabric';\nimport Component from '@/interface/component';\nimport ArrowLine from '@/extension/arrowLine';\nimport { eventNames, componentNames, fObjectOptions } from '@/consts';\n\n/**\n * Line\n * @class Line\n * @param {Graphics} graphics - Graphics instance\n * @extends {Component}\n * @ignore\n */\nclass Line extends Component {\n constructor(graphics) {\n super(componentNames.LINE, graphics);\n\n /**\n * Brush width\n * @type {number}\n * @private\n */\n this._width = 12;\n\n /**\n * fabric.Color instance for brush color\n * @type {fabric.Color}\n * @private\n */\n this._oColor = new fabric.Color('rgba(0, 0, 0, 0.5)');\n\n /**\n * Listeners\n * @type {object.}\n * @private\n */\n this._listeners = {\n mousedown: this._onFabricMouseDown.bind(this),\n mousemove: this._onFabricMouseMove.bind(this),\n mouseup: this._onFabricMouseUp.bind(this),\n };\n }\n\n /**\n * Start drawing line mode\n * @param {{width: ?number, color: ?string}} [setting] - Brush width & color\n */\n setHeadOption(setting) {\n const {\n arrowType = {\n head: null,\n tail: null,\n },\n } = setting;\n\n this._arrowType = arrowType;\n }\n\n /**\n * Start drawing line mode\n * @param {{width: ?number, color: ?string}} [setting] - Brush width & color\n */\n start(setting = {}) {\n const canvas = this.getCanvas();\n\n canvas.defaultCursor = 'crosshair';\n canvas.selection = false;\n\n this.setHeadOption(setting);\n this.setBrush(setting);\n\n canvas.forEachObject((obj) => {\n obj.set({\n evented: false,\n });\n });\n\n canvas.on({\n 'mouse:down': this._listeners.mousedown,\n });\n }\n\n /**\n * Set brush\n * @param {{width: ?number, color: ?string}} [setting] - Brush width & color\n */\n setBrush(setting) {\n const brush = this.getCanvas().freeDrawingBrush;\n\n setting = setting || {};\n this._width = setting.width || this._width;\n\n if (setting.color) {\n this._oColor = new fabric.Color(setting.color);\n }\n brush.width = this._width;\n brush.color = this._oColor.toRgba();\n }\n\n /**\n * End drawing line mode\n */\n end() {\n const canvas = this.getCanvas();\n\n canvas.defaultCursor = 'default';\n canvas.selection = true;\n\n canvas.forEachObject((obj) => {\n obj.set({\n evented: true,\n });\n });\n\n canvas.off('mouse:down', this._listeners.mousedown);\n }\n\n /**\n * Mousedown event handler in fabric canvas\n * @param {{target: fabric.Object, e: MouseEvent}} fEvent - Fabric event object\n * @private\n */\n _onFabricMouseDown(fEvent) {\n const canvas = this.getCanvas();\n const { x, y } = canvas.getPointer(fEvent.e);\n const points = [x, y, x, y];\n\n this._line = new ArrowLine(points, {\n stroke: this._oColor.toRgba(),\n strokeWidth: this._width,\n arrowType: this._arrowType,\n evented: false,\n });\n\n this._line.set(fObjectOptions.SELECTION_STYLE);\n\n canvas.add(this._line);\n\n canvas.on({\n 'mouse:move': this._listeners.mousemove,\n 'mouse:up': this._listeners.mouseup,\n });\n\n this.fire(eventNames.ADD_OBJECT, this._createLineEventObjectProperties());\n }\n\n /**\n * Mousemove event handler in fabric canvas\n * @param {{target: fabric.Object, e: MouseEvent}} fEvent - Fabric event object\n * @private\n */\n _onFabricMouseMove(fEvent) {\n const canvas = this.getCanvas();\n const pointer = canvas.getPointer(fEvent.e);\n\n this._line.set({\n x2: pointer.x,\n y2: pointer.y,\n });\n\n this._line.setCoords();\n\n canvas.renderAll();\n }\n\n /**\n * Mouseup event handler in fabric canvas\n * @private\n */\n _onFabricMouseUp() {\n const canvas = this.getCanvas();\n\n this.fire(eventNames.OBJECT_ADDED, this._createLineEventObjectProperties());\n\n this._line = null;\n\n canvas.off({\n 'mouse:move': this._listeners.mousemove,\n 'mouse:up': this._listeners.mouseup,\n });\n }\n\n /**\n * create line event object properties\n * @returns {Object} properties line object\n * @private\n */\n _createLineEventObjectProperties() {\n const params = this.graphics.createObjectProperties(this._line);\n const { x1, x2, y1, y2 } = this._line;\n\n return snippet.extend({}, params, {\n startPosition: {\n x: x1,\n y: y1,\n },\n endPosition: {\n x: x2,\n y: y2,\n },\n });\n }\n}\n\nexport default Line;\n","/**\n * @author NHN. FE Development Team \n * @fileoverview Image rotation module\n */\nimport fabric from 'fabric';\nimport Component from '@/interface/component';\nimport { Promise } from '@/util';\nimport { componentNames } from '@/consts';\n\n/**\n * Image Rotation component\n * @class Rotation\n * @extends {Component}\n * @param {Graphics} graphics - Graphics instance\n * @ignore\n */\nclass Rotation extends Component {\n constructor(graphics) {\n super(componentNames.ROTATION, graphics);\n }\n\n /**\n * Get current angle\n * @returns {Number}\n */\n getCurrentAngle() {\n return this.getCanvasImage().angle;\n }\n\n /**\n * Set angle of the image\n *\n * Do not call \"this.setImageProperties\" for setting angle directly.\n * Before setting angle, The originX,Y of image should be set to center.\n * See \"http://fabricjs.com/docs/fabric.Object.html#setAngle\"\n *\n * @param {number} angle - Angle value\n * @returns {Promise}\n */\n setAngle(angle) {\n const oldAngle = this.getCurrentAngle() % 360; // The angle is lower than 2*PI(===360 degrees)\n\n angle %= 360;\n\n const canvasImage = this.getCanvasImage();\n const oldImageCenter = canvasImage.getCenterPoint();\n canvasImage.set({ angle }).setCoords();\n this.adjustCanvasDimension();\n const newImageCenter = canvasImage.getCenterPoint();\n this._rotateForEachObject(oldImageCenter, newImageCenter, angle - oldAngle);\n\n return Promise.resolve(angle);\n }\n\n /**\n * Rotate for each object\n * @param {fabric.Point} oldImageCenter - Image center point before rotation\n * @param {fabric.Point} newImageCenter - Image center point after rotation\n * @param {number} angleDiff - Image angle difference after rotation\n * @private\n */\n _rotateForEachObject(oldImageCenter, newImageCenter, angleDiff) {\n const canvas = this.getCanvas();\n const centerDiff = {\n x: oldImageCenter.x - newImageCenter.x,\n y: oldImageCenter.y - newImageCenter.y,\n };\n\n canvas.forEachObject((obj) => {\n const objCenter = obj.getCenterPoint();\n const radian = fabric.util.degreesToRadians(angleDiff);\n const newObjCenter = fabric.util.rotatePoint(objCenter, oldImageCenter, radian);\n\n obj.set({\n left: newObjCenter.x - centerDiff.x,\n top: newObjCenter.y - centerDiff.y,\n angle: (obj.angle + angleDiff) % 360,\n });\n obj.setCoords();\n });\n canvas.renderAll();\n }\n\n /**\n * Rotate the image\n * @param {number} additionalAngle - Additional angle\n * @returns {Promise}\n */\n rotate(additionalAngle) {\n const current = this.getCurrentAngle();\n\n return this.setAngle(current + additionalAngle);\n }\n}\n\nexport default Rotation;\n","/**\n * @author NHN. FE Development Team \n * @fileoverview Shape component\n */\nimport { extend } from 'tui-code-snippet';\nimport fabric from 'fabric';\nimport Component from '@/interface/component';\nimport resizeHelper from '@/helper/shapeResizeHelper';\nimport {\n getFillImageFromShape,\n rePositionFilterTypeFillImage,\n reMakePatternImageSource,\n makeFillPatternForFilter,\n makeFilterOptionFromFabricImage,\n resetFillPatternCanvas,\n} from '@/helper/shapeFilterFillHelper';\nimport {\n Promise,\n changeOrigin,\n getCustomProperty,\n getFillTypeFromOption,\n getFillTypeFromObject,\n isShape,\n} from '@/util';\nimport {\n rejectMessages,\n eventNames,\n keyCodes as KEY_CODES,\n componentNames,\n fObjectOptions,\n SHAPE_DEFAULT_OPTIONS,\n SHAPE_FILL_TYPE,\n} from '@/consts';\n\nconst SHAPE_INIT_OPTIONS = extend(\n {\n strokeWidth: 1,\n stroke: '#000000',\n fill: '#ffffff',\n width: 1,\n height: 1,\n rx: 0,\n ry: 0,\n },\n SHAPE_DEFAULT_OPTIONS\n);\nconst DEFAULT_TYPE = 'rect';\nconst DEFAULT_WIDTH = 20;\nconst DEFAULT_HEIGHT = 20;\n\n/**\n * Make fill option\n * @param {Object} options - Options to create the shape\n * @param {Object.Image} canvasImage - canvas background image\n * @param {Function} createStaticCanvas - static canvas creater\n * @returns {Object} - shape option\n * @private\n */\nfunction makeFabricFillOption(options, canvasImage, createStaticCanvas) {\n const fillOption = options.fill;\n const fillType = getFillTypeFromOption(options.fill);\n let fill = fillOption;\n\n if (fillOption.color) {\n fill = fillOption.color;\n }\n\n let extOption = null;\n if (fillType === 'filter') {\n const newStaticCanvas = createStaticCanvas();\n extOption = makeFillPatternForFilter(canvasImage, fillOption.filter, newStaticCanvas);\n } else {\n extOption = { fill };\n }\n\n return extend({}, options, extOption);\n}\n\n/**\n * Shape\n * @class Shape\n * @param {Graphics} graphics - Graphics instance\n * @extends {Component}\n * @ignore\n */\nexport default class Shape extends Component {\n constructor(graphics) {\n super(componentNames.SHAPE, graphics);\n\n /**\n * Object of The drawing shape\n * @type {fabric.Object}\n * @private\n */\n this._shapeObj = null;\n\n /**\n * Type of the drawing shape\n * @type {string}\n * @private\n */\n this._type = DEFAULT_TYPE;\n\n /**\n * Options to draw the shape\n * @type {Object}\n * @private\n */\n this._options = extend({}, SHAPE_INIT_OPTIONS);\n\n /**\n * Whether the shape object is selected or not\n * @type {boolean}\n * @private\n */\n this._isSelected = false;\n\n /**\n * Pointer for drawing shape (x, y)\n * @type {Object}\n * @private\n */\n this._startPoint = {};\n\n /**\n * Using shortcut on drawing shape\n * @type {boolean}\n * @private\n */\n this._withShiftKey = false;\n\n /**\n * Event handler list\n * @type {Object}\n * @private\n */\n this._handlers = {\n mousedown: this._onFabricMouseDown.bind(this),\n mousemove: this._onFabricMouseMove.bind(this),\n mouseup: this._onFabricMouseUp.bind(this),\n keydown: this._onKeyDown.bind(this),\n keyup: this._onKeyUp.bind(this),\n };\n }\n\n /**\n * Start to draw the shape on canvas\n * @ignore\n */\n start() {\n const canvas = this.getCanvas();\n\n this._isSelected = false;\n\n canvas.defaultCursor = 'crosshair';\n canvas.selection = false;\n canvas.uniformScaling = true;\n canvas.on({\n 'mouse:down': this._handlers.mousedown,\n });\n\n fabric.util.addListener(document, 'keydown', this._handlers.keydown);\n fabric.util.addListener(document, 'keyup', this._handlers.keyup);\n }\n\n /**\n * End to draw the shape on canvas\n * @ignore\n */\n end() {\n const canvas = this.getCanvas();\n\n this._isSelected = false;\n\n canvas.defaultCursor = 'default';\n\n canvas.selection = true;\n canvas.uniformScaling = false;\n canvas.off({\n 'mouse:down': this._handlers.mousedown,\n });\n\n fabric.util.removeListener(document, 'keydown', this._handlers.keydown);\n fabric.util.removeListener(document, 'keyup', this._handlers.keyup);\n }\n\n /**\n * Set states of the current drawing shape\n * @ignore\n * @param {string} type - Shape type (ex: 'rect', 'circle')\n * @param {Object} [options] - Shape options\n * @param {(ShapeFillOption | string)} [options.fill] - {@link ShapeFillOption} or\n * Shape foreground color (ex: '#fff', 'transparent')\n * @param {string} [options.stoke] - Shape outline color\n * @param {number} [options.strokeWidth] - Shape outline width\n * @param {number} [options.width] - Width value (When type option is 'rect', this options can use)\n * @param {number} [options.height] - Height value (When type option is 'rect', this options can use)\n * @param {number} [options.rx] - Radius x value (When type option is 'circle', this options can use)\n * @param {number} [options.ry] - Radius y value (When type option is 'circle', this options can use)\n */\n setStates(type, options) {\n this._type = type;\n\n if (options) {\n this._options = extend(this._options, options);\n }\n }\n\n /**\n * Add the shape\n * @ignore\n * @param {string} type - Shape type (ex: 'rect', 'circle')\n * @param {Object} options - Shape options\n * @param {(ShapeFillOption | string)} [options.fill] - ShapeFillOption or Shape foreground color (ex: '#fff', 'transparent') or ShapeFillOption object\n * @param {string} [options.stroke] - Shape outline color\n * @param {number} [options.strokeWidth] - Shape outline width\n * @param {number} [options.width] - Width value (When type option is 'rect', this options can use)\n * @param {number} [options.height] - Height value (When type option is 'rect', this options can use)\n * @param {number} [options.rx] - Radius x value (When type option is 'circle', this options can use)\n * @param {number} [options.ry] - Radius y value (When type option is 'circle', this options can use)\n * @param {number} [options.isRegular] - Whether scaling shape has 1:1 ratio or not\n * @returns {Promise}\n */\n add(type, options) {\n return new Promise((resolve) => {\n const canvas = this.getCanvas();\n const extendOption = this._extendOptions(options);\n\n const shapeObj = this._createInstance(type, extendOption);\n const objectProperties = this.graphics.createObjectProperties(shapeObj);\n\n this._bindEventOnShape(shapeObj);\n\n canvas.add(shapeObj).setActiveObject(shapeObj);\n\n this._resetPositionFillFilter(shapeObj);\n\n resolve(objectProperties);\n });\n }\n\n /**\n * Change the shape\n * @ignore\n * @param {fabric.Object} shapeObj - Selected shape object on canvas\n * @param {Object} options - Shape options\n * @param {(ShapeFillOption | string)} [options.fill] - {@link ShapeFillOption} or\n * Shape foreground color (ex: '#fff', 'transparent')\n * @param {string} [options.stroke] - Shape outline color\n * @param {number} [options.strokeWidth] - Shape outline width\n * @param {number} [options.width] - Width value (When type option is 'rect', this options can use)\n * @param {number} [options.height] - Height value (When type option is 'rect', this options can use)\n * @param {number} [options.rx] - Radius x value (When type option is 'circle', this options can use)\n * @param {number} [options.ry] - Radius y value (When type option is 'circle', this options can use)\n * @param {number} [options.isRegular] - Whether scaling shape has 1:1 ratio or not\n * @returns {Promise}\n */\n change(shapeObj, options) {\n return new Promise((resolve, reject) => {\n if (!isShape(shapeObj)) {\n reject(rejectMessages.unsupportedType);\n }\n const hasFillOption = getFillTypeFromOption(options.fill) === 'filter';\n const { canvasImage, createStaticCanvas } = this.graphics;\n\n shapeObj.set(\n hasFillOption ? makeFabricFillOption(options, canvasImage, createStaticCanvas) : options\n );\n\n if (hasFillOption) {\n this._resetPositionFillFilter(shapeObj);\n }\n\n this.getCanvas().renderAll();\n resolve();\n });\n }\n\n /**\n * make fill property for user event\n * @param {fabric.Object} shapeObj - fabric object\n * @returns {Object}\n */\n makeFillPropertyForUserEvent(shapeObj) {\n const fillType = getFillTypeFromObject(shapeObj);\n const fillProp = {};\n\n if (fillType === SHAPE_FILL_TYPE.FILTER) {\n const fillImage = getFillImageFromShape(shapeObj);\n const filterOption = makeFilterOptionFromFabricImage(fillImage);\n\n fillProp.type = fillType;\n fillProp.filter = filterOption;\n } else {\n fillProp.type = SHAPE_FILL_TYPE.COLOR;\n fillProp.color = shapeObj.fill || 'transparent';\n }\n\n return fillProp;\n }\n\n /**\n * Copy object handling.\n * @param {fabric.Object} shapeObj - Shape object\n * @param {fabric.Object} originalShapeObj - Shape object\n */\n processForCopiedObject(shapeObj, originalShapeObj) {\n this._bindEventOnShape(shapeObj);\n\n if (getFillTypeFromObject(shapeObj) === 'filter') {\n const fillImage = getFillImageFromShape(originalShapeObj);\n const filterOption = makeFilterOptionFromFabricImage(fillImage);\n const newStaticCanvas = this.graphics.createStaticCanvas();\n\n shapeObj.set(\n makeFillPatternForFilter(this.graphics.canvasImage, filterOption, newStaticCanvas)\n );\n this._resetPositionFillFilter(shapeObj);\n }\n }\n\n /**\n * Create the instance of shape\n * @param {string} type - Shape type\n * @param {Object} options - Options to creat the shape\n * @returns {fabric.Object} Shape instance\n * @private\n */\n _createInstance(type, options) {\n let instance;\n\n switch (type) {\n case 'rect':\n instance = new fabric.Rect(options);\n break;\n case 'circle':\n instance = new fabric.Ellipse(\n extend(\n {\n type: 'circle',\n },\n options\n )\n );\n break;\n case 'triangle':\n instance = new fabric.Triangle(options);\n break;\n default:\n instance = {};\n }\n\n return instance;\n }\n\n /**\n * Get the options to create the shape\n * @param {Object} options - Options to creat the shape\n * @returns {Object} Shape options\n * @private\n */\n _extendOptions(options) {\n const selectionStyles = fObjectOptions.SELECTION_STYLE;\n const { canvasImage, createStaticCanvas } = this.graphics;\n\n options = extend({}, SHAPE_INIT_OPTIONS, this._options, selectionStyles, options);\n\n return makeFabricFillOption(options, canvasImage, createStaticCanvas);\n }\n\n /**\n * Bind fabric events on the creating shape object\n * @param {fabric.Object} shapeObj - Shape object\n * @private\n */\n _bindEventOnShape(shapeObj) {\n const self = this;\n const canvas = this.getCanvas();\n\n shapeObj.on({\n added() {\n self._shapeObj = this;\n resizeHelper.setOrigins(self._shapeObj);\n },\n selected() {\n self._isSelected = true;\n self._shapeObj = this;\n canvas.uniformScaling = true;\n canvas.defaultCursor = 'default';\n resizeHelper.setOrigins(self._shapeObj);\n },\n deselected() {\n self._isSelected = false;\n self._shapeObj = null;\n canvas.defaultCursor = 'crosshair';\n canvas.uniformScaling = false;\n },\n modified() {\n const currentObj = self._shapeObj;\n\n resizeHelper.adjustOriginToCenter(currentObj);\n resizeHelper.setOrigins(currentObj);\n },\n modifiedInGroup(activeSelection) {\n self._fillFilterRePositionInGroupSelection(shapeObj, activeSelection);\n },\n moving() {\n self._resetPositionFillFilter(this);\n },\n rotating() {\n self._resetPositionFillFilter(this);\n },\n scaling(fEvent) {\n const pointer = canvas.getPointer(fEvent.e);\n const currentObj = self._shapeObj;\n\n canvas.setCursor('crosshair');\n resizeHelper.resize(currentObj, pointer, true);\n\n self._resetPositionFillFilter(this);\n },\n });\n }\n\n /**\n * MouseDown event handler on canvas\n * @param {{target: fabric.Object, e: MouseEvent}} fEvent - Fabric event object\n * @private\n */\n _onFabricMouseDown(fEvent) {\n if (!fEvent.target) {\n this._isSelected = false;\n this._shapeObj = false;\n }\n\n if (!this._isSelected && !this._shapeObj) {\n const canvas = this.getCanvas();\n this._startPoint = canvas.getPointer(fEvent.e);\n\n canvas.on({\n 'mouse:move': this._handlers.mousemove,\n 'mouse:up': this._handlers.mouseup,\n });\n }\n }\n\n /**\n * MouseDown event handler on canvas\n * @param {{target: fabric.Object, e: MouseEvent}} fEvent - Fabric event object\n * @private\n */\n _onFabricMouseMove(fEvent) {\n const canvas = this.getCanvas();\n const pointer = canvas.getPointer(fEvent.e);\n const startPointX = this._startPoint.x;\n const startPointY = this._startPoint.y;\n const width = startPointX - pointer.x;\n const height = startPointY - pointer.y;\n const shape = this._shapeObj;\n\n if (!shape) {\n this.add(this._type, {\n left: startPointX,\n top: startPointY,\n width,\n height,\n }).then((objectProps) => {\n this.fire(eventNames.ADD_OBJECT, objectProps);\n });\n } else {\n this._shapeObj.set({\n isRegular: this._withShiftKey,\n });\n\n resizeHelper.resize(shape, pointer);\n canvas.renderAll();\n\n this._resetPositionFillFilter(shape);\n }\n }\n\n /**\n * MouseUp event handler on canvas\n * @private\n */\n _onFabricMouseUp() {\n const canvas = this.getCanvas();\n const startPointX = this._startPoint.x;\n const startPointY = this._startPoint.y;\n const shape = this._shapeObj;\n\n if (!shape) {\n this.add(this._type, {\n left: startPointX,\n top: startPointY,\n width: DEFAULT_WIDTH,\n height: DEFAULT_HEIGHT,\n }).then((objectProps) => {\n this.fire(eventNames.ADD_OBJECT, objectProps);\n });\n } else if (shape) {\n resizeHelper.adjustOriginToCenter(shape);\n this.fire(eventNames.OBJECT_ADDED, this.graphics.createObjectProperties(shape));\n }\n\n canvas.off({\n 'mouse:move': this._handlers.mousemove,\n 'mouse:up': this._handlers.mouseup,\n });\n }\n\n /**\n * Keydown event handler on document\n * @param {KeyboardEvent} e - Event object\n * @private\n */\n _onKeyDown(e) {\n if (e.keyCode === KEY_CODES.SHIFT) {\n this._withShiftKey = true;\n\n if (this._shapeObj) {\n this._shapeObj.isRegular = true;\n }\n }\n }\n\n /**\n * Keyup event handler on document\n * @param {KeyboardEvent} e - Event object\n * @private\n */\n _onKeyUp(e) {\n if (e.keyCode === KEY_CODES.SHIFT) {\n this._withShiftKey = false;\n\n if (this._shapeObj) {\n this._shapeObj.isRegular = false;\n }\n }\n }\n\n /**\n * Reset shape position and internal proportions in the filter type fill area.\n * @param {fabric.Object} shapeObj - Shape object\n * @private\n */\n _resetPositionFillFilter(shapeObj) {\n if (getFillTypeFromObject(shapeObj) !== 'filter') {\n return;\n }\n\n const { patternSourceCanvas } = getCustomProperty(shapeObj, 'patternSourceCanvas');\n\n const fillImage = getFillImageFromShape(shapeObj);\n const { originalAngle } = getCustomProperty(fillImage, 'originalAngle');\n\n if (this.graphics.canvasImage.angle !== originalAngle) {\n reMakePatternImageSource(shapeObj, this.graphics.canvasImage);\n }\n const { originX, originY } = shapeObj;\n\n resizeHelper.adjustOriginToCenter(shapeObj);\n\n shapeObj.width *= shapeObj.scaleX;\n shapeObj.height *= shapeObj.scaleY;\n shapeObj.rx *= shapeObj.scaleX;\n shapeObj.ry *= shapeObj.scaleY;\n shapeObj.scaleX = 1;\n shapeObj.scaleY = 1;\n\n rePositionFilterTypeFillImage(shapeObj);\n\n changeOrigin(shapeObj, {\n originX,\n originY,\n });\n\n resetFillPatternCanvas(patternSourceCanvas);\n }\n\n /**\n * Reset filter area position within group selection.\n * @param {fabric.Object} shapeObj - Shape object\n * @param {fabric.ActiveSelection} activeSelection - Shape object\n * @private\n */\n _fillFilterRePositionInGroupSelection(shapeObj, activeSelection) {\n if (activeSelection.scaleX !== 1 || activeSelection.scaleY !== 1) {\n // This is necessary because the group's scale transition state affects the relative size of the fill area.\n // The only way to reset the object transformation scale state to neutral.\n // {@link https://github.com/fabricjs/fabric.js/issues/5372}\n activeSelection.addWithUpdate();\n }\n\n const { angle, left, top } = shapeObj;\n\n activeSelection.realizeTransform(shapeObj);\n this._resetPositionFillFilter(shapeObj);\n\n shapeObj.set({\n angle,\n left,\n top,\n });\n }\n}\n","/**\n * @author NHN. FE Development Team \n * @fileoverview Text module\n */\nimport snippet from 'tui-code-snippet';\nimport fabric from 'fabric';\nimport Component from '@/interface/component';\nimport { Promise } from '@/util';\nimport { componentNames, eventNames as events, fObjectOptions } from '@/consts';\n\nconst defaultStyles = {\n fill: '#000000',\n left: 0,\n top: 0,\n};\nconst resetStyles = {\n fill: '#000000',\n fontStyle: 'normal',\n fontWeight: 'normal',\n textAlign: 'left',\n underline: false,\n};\nconst DBCLICK_TIME = 500;\n\n/**\n * Text\n * @class Text\n * @param {Graphics} graphics - Graphics instance\n * @extends {Component}\n * @ignore\n */\nclass Text extends Component {\n constructor(graphics) {\n super(componentNames.TEXT, graphics);\n\n /**\n * Default text style\n * @type {Object}\n */\n this._defaultStyles = defaultStyles;\n\n /**\n * Selected state\n * @type {boolean}\n */\n this._isSelected = false;\n\n /**\n * Selected text object\n * @type {Object}\n */\n this._selectedObj = {};\n\n /**\n * Editing text object\n * @type {Object}\n */\n this._editingObj = {};\n\n /**\n * Listeners for fabric event\n * @type {Object}\n */\n this._listeners = {\n mousedown: this._onFabricMouseDown.bind(this),\n select: this._onFabricSelect.bind(this),\n selectClear: this._onFabricSelectClear.bind(this),\n scaling: this._onFabricScaling.bind(this),\n textChanged: this._onFabricTextChanged.bind(this),\n };\n\n /**\n * Textarea element for editing\n * @type {HTMLElement}\n */\n this._textarea = null;\n\n /**\n * Ratio of current canvas\n * @type {number}\n */\n this._ratio = 1;\n\n /**\n * Last click time\n * @type {Date}\n */\n this._lastClickTime = new Date().getTime();\n\n /**\n * Text object infos before editing\n * @type {Object}\n */\n this._editingObjInfos = {};\n\n /**\n * Previous state of editing\n * @type {boolean}\n */\n this.isPrevEditing = false;\n }\n\n /**\n * Start input text mode\n */\n start() {\n const canvas = this.getCanvas();\n\n canvas.selection = false;\n canvas.defaultCursor = 'text';\n canvas.on({\n 'mouse:down': this._listeners.mousedown,\n 'selection:created': this._listeners.select,\n 'selection:updated': this._listeners.select,\n 'before:selection:cleared': this._listeners.selectClear,\n 'object:scaling': this._listeners.scaling,\n 'text:changed': this._listeners.textChanged,\n });\n\n canvas.forEachObject((obj) => {\n if (obj.type === 'i-text') {\n this.adjustOriginPosition(obj, 'start');\n }\n });\n\n this.setCanvasRatio();\n }\n\n /**\n * End input text mode\n */\n end() {\n const canvas = this.getCanvas();\n\n canvas.selection = true;\n canvas.defaultCursor = 'default';\n\n canvas.forEachObject((obj) => {\n if (obj.type === 'i-text') {\n if (obj.text === '') {\n canvas.remove(obj);\n } else {\n this.adjustOriginPosition(obj, 'end');\n }\n }\n });\n\n canvas.off({\n 'mouse:down': this._listeners.mousedown,\n 'selection:created': this._listeners.select,\n 'selection:updated': this._listeners.select,\n 'before:selection:cleared': this._listeners.selectClear,\n 'object:selected': this._listeners.select,\n 'object:scaling': this._listeners.scaling,\n 'text:changed': this._listeners.textChanged,\n });\n }\n\n /**\n * Adjust the origin position\n * @param {fabric.Object} text - text object\n * @param {string} editStatus - 'start' or 'end'\n */\n adjustOriginPosition(text, editStatus) {\n let [originX, originY] = ['center', 'center'];\n if (editStatus === 'start') {\n [originX, originY] = ['left', 'top'];\n }\n\n const { x: left, y: top } = text.getPointByOrigin(originX, originY);\n text.set({\n left,\n top,\n originX,\n originY,\n });\n text.setCoords();\n }\n\n /**\n * Add new text on canvas image\n * @param {string} text - Initial input text\n * @param {Object} options - Options for generating text\n * @param {Object} [options.styles] Initial styles\n * @param {string} [options.styles.fill] Color\n * @param {string} [options.styles.fontFamily] Font type for text\n * @param {number} [options.styles.fontSize] Size\n * @param {string} [options.styles.fontStyle] Type of inclination (normal / italic)\n * @param {string} [options.styles.fontWeight] Type of thicker or thinner looking (normal / bold)\n * @param {string} [options.styles.textAlign] Type of text align (left / center / right)\n * @param {string} [options.styles.textDecoration] Type of line (underline / line-through / overline)\n * @param {{x: number, y: number}} [options.position] - Initial position\n * @returns {Promise}\n */\n add(text, options) {\n return new Promise((resolve) => {\n const canvas = this.getCanvas();\n let newText = null;\n let selectionStyle = fObjectOptions.SELECTION_STYLE;\n let styles = this._defaultStyles;\n\n this._setInitPos(options.position);\n\n if (options.styles) {\n styles = snippet.extend(styles, options.styles);\n }\n\n if (!snippet.isExisty(options.autofocus)) {\n options.autofocus = true;\n }\n\n newText = new fabric.IText(text, styles);\n selectionStyle = snippet.extend({}, selectionStyle, {\n originX: 'left',\n originY: 'top',\n });\n\n newText.set(selectionStyle);\n newText.on({\n mouseup: this._onFabricMouseUp.bind(this),\n });\n\n canvas.add(newText);\n\n if (options.autofocus) {\n newText.enterEditing();\n newText.selectAll();\n }\n\n if (!canvas.getActiveObject()) {\n canvas.setActiveObject(newText);\n }\n\n this.isPrevEditing = true;\n resolve(this.graphics.createObjectProperties(newText));\n });\n }\n\n /**\n * Change text of activate object on canvas image\n * @param {Object} activeObj - Current selected text object\n * @param {string} text - Changed text\n * @returns {Promise}\n */\n change(activeObj, text) {\n return new Promise((resolve) => {\n activeObj.set('text', text);\n\n this.getCanvas().renderAll();\n resolve();\n });\n }\n\n /**\n * Set style\n * @param {Object} activeObj - Current selected text object\n * @param {Object} styleObj - Initial styles\n * @param {string} [styleObj.fill] Color\n * @param {string} [styleObj.fontFamily] Font type for text\n * @param {number} [styleObj.fontSize] Size\n * @param {string} [styleObj.fontStyle] Type of inclination (normal / italic)\n * @param {string} [styleObj.fontWeight] Type of thicker or thinner looking (normal / bold)\n * @param {string} [styleObj.textAlign] Type of text align (left / center / right)\n * @param {string} [styleObj.textDecoration] Type of line (underline / line-through / overline)\n * @returns {Promise}\n */\n setStyle(activeObj, styleObj) {\n return new Promise((resolve) => {\n snippet.forEach(\n styleObj,\n (val, key) => {\n if (activeObj[key] === val && key !== 'fontSize') {\n styleObj[key] = resetStyles[key] || '';\n }\n },\n this\n );\n\n if ('textDecoration' in styleObj) {\n snippet.extend(styleObj, this._getTextDecorationAdaptObject(styleObj.textDecoration));\n }\n\n activeObj.set(styleObj);\n\n this.getCanvas().renderAll();\n resolve();\n });\n }\n\n /**\n * Get the text\n * @param {Object} activeObj - Current selected text object\n * @returns {String} text\n */\n getText(activeObj) {\n return activeObj.text;\n }\n\n /**\n * Set infos of the current selected object\n * @param {fabric.Text} obj - Current selected text object\n * @param {boolean} state - State of selecting\n */\n setSelectedInfo(obj, state) {\n this._selectedObj = obj;\n this._isSelected = state;\n }\n\n /**\n * Whether object is selected or not\n * @returns {boolean} State of selecting\n */\n isSelected() {\n return this._isSelected;\n }\n\n /**\n * Get current selected text object\n * @returns {fabric.Text} Current selected text object\n */\n getSelectedObj() {\n return this._selectedObj;\n }\n\n /**\n * Set ratio value of canvas\n */\n setCanvasRatio() {\n const canvasElement = this.getCanvasElement();\n const cssWidth = parseInt(canvasElement.style.maxWidth, 10);\n const originWidth = canvasElement.width;\n\n this._ratio = originWidth / cssWidth;\n }\n\n /**\n * Get ratio value of canvas\n * @returns {number} Ratio value\n */\n getCanvasRatio() {\n return this._ratio;\n }\n\n /**\n * Get text decoration adapt object\n * @param {string} textDecoration - text decoration option string\n * @returns {object} adapt object for override\n */\n _getTextDecorationAdaptObject(textDecoration) {\n return {\n underline: textDecoration === 'underline',\n linethrough: textDecoration === 'line-through',\n overline: textDecoration === 'overline',\n };\n }\n\n /**\n * Set initial position on canvas image\n * @param {{x: number, y: number}} [position] - Selected position\n * @private\n */\n _setInitPos(position) {\n position = position || this.getCanvasImage().getCenterPoint();\n\n this._defaultStyles.left = position.x;\n this._defaultStyles.top = position.y;\n }\n\n /**\n * Input event handler\n * @private\n */\n _onInput() {\n const ratio = this.getCanvasRatio();\n const obj = this._editingObj;\n const textareaStyle = this._textarea.style;\n\n textareaStyle.width = `${Math.ceil(obj.width / ratio)}px`;\n textareaStyle.height = `${Math.ceil(obj.height / ratio)}px`;\n }\n\n /**\n * Keydown event handler\n * @private\n */\n _onKeyDown() {\n const ratio = this.getCanvasRatio();\n const obj = this._editingObj;\n const textareaStyle = this._textarea.style;\n\n setTimeout(() => {\n obj.text(this._textarea.value);\n\n textareaStyle.width = `${Math.ceil(obj.width / ratio)}px`;\n textareaStyle.height = `${Math.ceil(obj.height / ratio)}px`;\n }, 0);\n }\n\n /**\n * Blur event handler\n * @private\n */\n _onBlur() {\n const ratio = this.getCanvasRatio();\n const editingObj = this._editingObj;\n const editingObjInfos = this._editingObjInfos;\n const textContent = this._textarea.value;\n let transWidth = editingObj.width / ratio - editingObjInfos.width / ratio;\n let transHeight = editingObj.height / ratio - editingObjInfos.height / ratio;\n\n if (ratio === 1) {\n transWidth /= 2;\n transHeight /= 2;\n }\n\n this._textarea.style.display = 'none';\n\n editingObj.set({\n left: editingObjInfos.left + transWidth,\n top: editingObjInfos.top + transHeight,\n });\n\n if (textContent.length) {\n this.getCanvas().add(editingObj);\n\n const params = {\n id: snippet.stamp(editingObj),\n type: editingObj.type,\n text: textContent,\n };\n\n this.fire(events.TEXT_CHANGED, params);\n }\n }\n\n /**\n * Scroll event handler\n * @private\n */\n _onScroll() {\n this._textarea.scrollLeft = 0;\n this._textarea.scrollTop = 0;\n }\n\n /**\n * Fabric scaling event handler\n * @param {fabric.Event} fEvent - Current scaling event on selected object\n * @private\n */\n _onFabricScaling(fEvent) {\n const obj = fEvent.target;\n\n obj.fontSize = obj.fontSize * obj.scaleY;\n obj.scaleX = 1;\n obj.scaleY = 1;\n }\n\n /**\n * textChanged event handler\n * @param {{target: fabric.Object}} props - changed text object\n * @private\n */\n _onFabricTextChanged(props) {\n this.fire(events.TEXT_CHANGED, props.target);\n }\n\n /**\n * onSelectClear handler in fabric canvas\n * @param {{target: fabric.Object, e: MouseEvent}} fEvent - Fabric event\n * @private\n */\n _onFabricSelectClear(fEvent) {\n const obj = this.getSelectedObj();\n\n this.isPrevEditing = true;\n\n this.setSelectedInfo(fEvent.target, false);\n\n if (obj) {\n // obj is empty object at initial time, will be set fabric object\n if (obj.text === '') {\n this.getCanvas().remove(obj);\n }\n }\n }\n\n /**\n * onSelect handler in fabric canvas\n * @param {{target: fabric.Object, e: MouseEvent}} fEvent - Fabric event\n * @private\n */\n _onFabricSelect(fEvent) {\n this.isPrevEditing = true;\n\n this.setSelectedInfo(fEvent.target, true);\n }\n\n /**\n * Fabric 'mousedown' event handler\n * @param {fabric.Event} fEvent - Current mousedown event on selected object\n * @private\n */\n _onFabricMouseDown(fEvent) {\n const obj = fEvent.target;\n\n if (obj && !obj.isType('text')) {\n return;\n }\n\n if (this.isPrevEditing) {\n this.isPrevEditing = false;\n\n return;\n }\n\n this._fireAddText(fEvent);\n }\n\n /**\n * Fire 'addText' event if object is not selected.\n * @param {fabric.Event} fEvent - Current mousedown event on selected object\n * @private\n */\n _fireAddText(fEvent) {\n const obj = fEvent.target;\n const e = fEvent.e || {};\n const originPointer = this.getCanvas().getPointer(e);\n\n if (!obj) {\n this.fire(events.ADD_TEXT, {\n originPosition: {\n x: originPointer.x,\n y: originPointer.y,\n },\n clientPosition: {\n x: e.clientX || 0,\n y: e.clientY || 0,\n },\n });\n }\n }\n\n /**\n * Fabric mouseup event handler\n * @param {fabric.Event} fEvent - Current mousedown event on selected object\n * @private\n */\n _onFabricMouseUp(fEvent) {\n const { target } = fEvent;\n const newClickTime = new Date().getTime();\n\n if (this._isDoubleClick(newClickTime) && !target.isEditing) {\n target.enterEditing();\n }\n\n if (target.isEditing) {\n this.fire(events.TEXT_EDITING); // fire editing text event\n }\n\n this._lastClickTime = newClickTime;\n }\n\n /**\n * Get state of firing double click event\n * @param {Date} newClickTime - Current clicked time\n * @returns {boolean} Whether double clicked or not\n * @private\n */\n _isDoubleClick(newClickTime) {\n return newClickTime - this._lastClickTime < DBCLICK_TIME;\n }\n}\n\nexport default Text;\n","/**\n * @author NHN. FE Development Team \n * @fileoverview Image zoom module (start zoom, end zoom)\n */\nimport fabric from 'fabric';\nimport Component from '@/interface/component';\nimport { clamp } from '@/util';\nimport { componentNames, eventNames, keyCodes, zoomModes } from '@/consts';\n\nconst MOUSE_MOVE_THRESHOLD = 10;\nconst DEFAULT_SCROLL_OPTION = {\n left: 0,\n top: 0,\n width: 0,\n height: 0,\n stroke: '#000000',\n strokeWidth: 0,\n fill: '#000000',\n opacity: 0.4,\n evented: false,\n selectable: false,\n hoverCursor: 'auto',\n};\nconst DEFAULT_VERTICAL_SCROLL_RATIO = {\n SIZE: 0.0045,\n MARGIN: 0.003,\n BORDER_RADIUS: 0.003,\n};\nconst DEFAULT_HORIZONTAL_SCROLL_RATIO = {\n SIZE: 0.0066,\n MARGIN: 0.0044,\n BORDER_RADIUS: 0.003,\n};\nconst DEFAULT_ZOOM_LEVEL = 1.0;\n\n/**\n * Zoom components\n * @param {Graphics} graphics - Graphics instance\n * @extends {Component}\n * @class Zoom\n * @ignore\n */\nclass Zoom extends Component {\n constructor(graphics) {\n super(componentNames.ZOOM, graphics);\n\n /**\n * zoomArea\n * @type {?fabric.Rect}\n * @private\n */\n this.zoomArea = null;\n\n /**\n * Start point of zoom area\n * @type {?{x: number, y: number}}\n */\n this._startPoint = null;\n\n /**\n * Center point of every zoom\n * @type {Array.<{prevZoomLevel: number, zoomLevel: number, x: number, y: number}>}\n */\n this._centerPoints = [];\n\n /**\n * Zoom level (default: 100%(1.0), max: 400%(4.0))\n * @type {number}\n */\n this.zoomLevel = DEFAULT_ZOOM_LEVEL;\n\n /**\n * Zoom mode ('normal', 'zoom', 'hand')\n * @type {string}\n */\n this.zoomMode = zoomModes.DEFAULT;\n\n /**\n * Listeners\n * @type {Object.}\n * @private\n */\n this._listeners = {\n startZoom: this._onMouseDownWithZoomMode.bind(this),\n moveZoom: this._onMouseMoveWithZoomMode.bind(this),\n stopZoom: this._onMouseUpWithZoomMode.bind(this),\n startHand: this._onMouseDownWithHandMode.bind(this),\n moveHand: this._onMouseMoveWithHandMode.bind(this),\n stopHand: this._onMouseUpWithHandMode.bind(this),\n zoomChanged: this._changeScrollState.bind(this),\n keydown: this._onKeyDown.bind(this),\n keyup: this._onKeyUp.bind(this),\n };\n\n const canvas = this.getCanvas();\n\n /**\n * Width:Height ratio (ex. width=1.5, height=1 -> aspectRatio=1.5)\n * @private\n */\n this.aspectRatio = canvas.width / canvas.height;\n\n /**\n * vertical scroll bar\n * @type {fabric.Rect}\n * @private\n */\n this._verticalScroll = new fabric.Rect(DEFAULT_SCROLL_OPTION);\n\n /**\n * horizontal scroll bar\n * @type {fabric.Rect}\n * @private\n */\n this._horizontalScroll = new fabric.Rect(DEFAULT_SCROLL_OPTION);\n\n canvas.on(eventNames.ZOOM_CHANGED, this._listeners.zoomChanged);\n\n fabric.util.addListener(document, 'keydown', this._listeners.keydown);\n fabric.util.addListener(document, 'keyup', this._listeners.keyup);\n }\n\n /**\n * Keydown event handler\n * @param {KeyboardEvent} e - Event object\n * @private\n */\n _onKeyDown(e) {\n if (this.withSpace) {\n return;\n }\n\n if (e.keyCode === keyCodes.SPACE) {\n e.preventDefault();\n this.withSpace = true;\n this.startHandMode();\n }\n }\n\n /**\n * Keyup event handler\n * @param {KeyboardEvent} e - Event object\n * @private\n */\n _onKeyUp(e) {\n if (e.keyCode === keyCodes.SPACE) {\n e.preventDefault();\n this.withSpace = false;\n this.endHandMode();\n }\n }\n\n /**\n * Start zoom-in mode\n */\n startZoomInMode() {\n if (this.zoomArea) {\n return;\n }\n this.endHandMode();\n this.zoomMode = zoomModes.ZOOM;\n\n const canvas = this.getCanvas();\n\n this._changeObjectsEventedState(false);\n\n this.zoomArea = new fabric.Rect({\n left: 0,\n top: 0,\n width: 0.5,\n height: 0.5,\n stroke: 'black',\n strokeWidth: 1,\n fill: 'transparent',\n hoverCursor: 'zoom-in',\n });\n\n canvas.discardActiveObject();\n canvas.add(this.zoomArea);\n canvas.on('mouse:down', this._listeners.startZoom);\n canvas.selection = false;\n canvas.defaultCursor = 'zoom-in';\n }\n\n /**\n * End zoom-in mode\n */\n endZoomInMode() {\n this.zoomMode = zoomModes.DEFAULT;\n\n const canvas = this.getCanvas();\n const { startZoom, moveZoom, stopZoom } = this._listeners;\n\n canvas.selection = true;\n canvas.defaultCursor = 'auto';\n canvas.off({\n 'mouse:down': startZoom,\n 'mouse:move': moveZoom,\n 'mouse:up': stopZoom,\n });\n\n this._changeObjectsEventedState(true);\n\n canvas.remove(this.zoomArea);\n this.zoomArea = null;\n }\n\n /**\n * Start zoom drawing mode\n */\n start() {\n this.zoomArea = null;\n this._startPoint = null;\n this._startHandPoint = null;\n }\n\n /**\n * Stop zoom drawing mode\n */\n end() {\n this.endZoomInMode();\n this.endHandMode();\n }\n\n /**\n * Start hand mode\n */\n startHandMode() {\n this.endZoomInMode();\n this.zoomMode = zoomModes.HAND;\n\n const canvas = this.getCanvas();\n\n this._changeObjectsEventedState(false);\n\n canvas.discardActiveObject();\n canvas.off('mouse:down', this._listeners.startHand);\n canvas.on('mouse:down', this._listeners.startHand);\n canvas.selection = false;\n canvas.defaultCursor = 'grab';\n\n canvas.fire(eventNames.HAND_STARTED);\n }\n\n /**\n * Stop hand mode\n */\n endHandMode() {\n this.zoomMode = zoomModes.DEFAULT;\n const canvas = this.getCanvas();\n\n this._changeObjectsEventedState(true);\n\n canvas.off('mouse:down', this._listeners.startHand);\n canvas.selection = true;\n canvas.defaultCursor = 'auto';\n\n this._startHandPoint = null;\n\n canvas.fire(eventNames.HAND_STOPPED);\n }\n\n /**\n * onMousedown handler in fabric canvas\n * @param {{target: fabric.Object, e: MouseEvent}} fEvent - Fabric event\n * @private\n */\n _onMouseDownWithZoomMode({ target, e }) {\n if (target) {\n return;\n }\n\n const canvas = this.getCanvas();\n\n canvas.selection = false;\n\n this._startPoint = canvas.getPointer(e);\n this.zoomArea.set({ width: 0, height: 0 });\n\n const { moveZoom, stopZoom } = this._listeners;\n canvas.on({\n 'mouse:move': moveZoom,\n 'mouse:up': stopZoom,\n });\n }\n\n /**\n * onMousemove handler in fabric canvas\n * @param {{e: MouseEvent}} fEvent - Fabric event\n * @private\n */\n _onMouseMoveWithZoomMode({ e }) {\n const canvas = this.getCanvas();\n const pointer = canvas.getPointer(e);\n const { x, y } = pointer;\n const { zoomArea, _startPoint } = this;\n const deltaX = Math.abs(x - _startPoint.x);\n const deltaY = Math.abs(y - _startPoint.y);\n\n if (deltaX + deltaY > MOUSE_MOVE_THRESHOLD) {\n canvas.remove(zoomArea);\n zoomArea.set(this._calcRectDimensionFromPoint(x, y));\n canvas.add(zoomArea);\n }\n }\n\n /**\n * Get rect dimension setting from Canvas-Mouse-Position(x, y)\n * @param {number} x - Canvas-Mouse-Position x\n * @param {number} y - Canvas-Mouse-Position Y\n * @returns {{left: number, top: number, width: number, height: number}}\n * @private\n */\n _calcRectDimensionFromPoint(x, y) {\n const canvas = this.getCanvas();\n const canvasWidth = canvas.getWidth();\n const canvasHeight = canvas.getHeight();\n const { x: startX, y: startY } = this._startPoint;\n const { min } = Math;\n\n const left = min(startX, x);\n const top = min(startY, y);\n const width = clamp(x, startX, canvasWidth) - left; // (startX <= x(mouse) <= canvasWidth) - left\n const height = clamp(y, startY, canvasHeight) - top; // (startY <= y(mouse) <= canvasHeight) - top\n\n return { left, top, width, height };\n }\n\n /**\n * onMouseup handler in fabric canvas\n * @private\n */\n _onMouseUpWithZoomMode() {\n let { zoomLevel } = this;\n const { zoomArea } = this;\n const { moveZoom, stopZoom } = this._listeners;\n const canvas = this.getCanvas();\n const center = this._getCenterPoint();\n const { x, y } = center;\n\n if (!this._isMaxZoomLevel()) {\n this._centerPoints.push({\n x,\n y,\n prevZoomLevel: zoomLevel,\n zoomLevel: zoomLevel + 1,\n });\n zoomLevel += 1;\n canvas.zoomToPoint({ x, y }, zoomLevel);\n\n this._fireZoomChanged(canvas, zoomLevel);\n\n this.zoomLevel = zoomLevel;\n }\n\n canvas.off({\n 'mouse:move': moveZoom,\n 'mouse:up': stopZoom,\n });\n\n canvas.remove(zoomArea);\n this._startPoint = null;\n }\n\n /**\n * Get center point\n * @returns {{x: number, y: number}}\n * @private\n */\n _getCenterPoint() {\n const { left, top, width, height } = this.zoomArea;\n const { x, y } = this._startPoint;\n const { aspectRatio } = this;\n\n if (width < MOUSE_MOVE_THRESHOLD && height < MOUSE_MOVE_THRESHOLD) {\n return { x, y };\n }\n\n return width > height\n ? { x: left + (aspectRatio * height) / 2, y: top + height / 2 }\n : { x: left + width / 2, y: top + width / aspectRatio / 2 };\n }\n\n /**\n * Zoom the canvas\n * @param {{x: number, y: number}} center - center of zoom\n * @param {?number} zoomLevel - zoom level\n */\n zoom({ x, y }, zoomLevel = this.zoomLevel) {\n const canvas = this.getCanvas();\n const centerPoints = this._centerPoints;\n\n for (let i = centerPoints.length - 1; i >= 0; i -= 1) {\n if (centerPoints[i].zoomLevel < zoomLevel) {\n break;\n }\n\n const { x: prevX, y: prevY, prevZoomLevel } = centerPoints.pop();\n\n canvas.zoomToPoint({ x: prevX, y: prevY }, prevZoomLevel);\n this.zoomLevel = prevZoomLevel;\n }\n\n canvas.zoomToPoint({ x, y }, zoomLevel);\n if (!this._isDefaultZoomLevel(zoomLevel)) {\n this._centerPoints.push({\n x,\n y,\n zoomLevel,\n prevZoomLevel: this.zoomLevel,\n });\n }\n this.zoomLevel = zoomLevel;\n\n this._fireZoomChanged(canvas, zoomLevel);\n }\n\n /**\n * Zoom out one step\n */\n zoomOut() {\n const centerPoints = this._centerPoints;\n\n if (!centerPoints.length) {\n return;\n }\n\n const canvas = this.getCanvas();\n const point = centerPoints.pop();\n const { x, y, prevZoomLevel } = point;\n\n if (this._isDefaultZoomLevel(prevZoomLevel)) {\n canvas.setViewportTransform([1, 0, 0, 1, 0, 0]);\n } else {\n canvas.zoomToPoint({ x, y }, prevZoomLevel);\n }\n\n this.zoomLevel = prevZoomLevel;\n\n this._fireZoomChanged(canvas, this.zoomLevel);\n }\n\n /**\n * Zoom reset\n */\n resetZoom() {\n const canvas = this.getCanvas();\n\n canvas.setViewportTransform([1, 0, 0, 1, 0, 0]);\n\n this.zoomLevel = DEFAULT_ZOOM_LEVEL;\n this._centerPoints = [];\n\n this._fireZoomChanged(canvas, this.zoomLevel);\n }\n\n /**\n * Whether zoom level is max (5.0)\n * @returns {boolean}\n * @private\n */\n _isMaxZoomLevel() {\n return this.zoomLevel >= 5.0;\n }\n\n /**\n * Move point of zoom\n * @param {{x: number, y: number}} delta - move amount\n * @private\n */\n _movePointOfZoom({ x: deltaX, y: deltaY }) {\n const centerPoints = this._centerPoints;\n\n if (!centerPoints.length) {\n return;\n }\n\n const canvas = this.getCanvas();\n const { zoomLevel } = this;\n\n const point = centerPoints.pop();\n const { x: originX, y: originY, prevZoomLevel } = point;\n const x = originX - deltaX;\n const y = originY - deltaY;\n\n canvas.zoomToPoint({ x: originX, y: originY }, prevZoomLevel);\n canvas.zoomToPoint({ x, y }, zoomLevel);\n centerPoints.push({ x, y, prevZoomLevel, zoomLevel });\n\n this._fireZoomChanged(canvas, zoomLevel);\n }\n\n /**\n * onMouseDown handler in fabric canvas\n * @param {{target: fabric.Object, e: MouseEvent}} fEvent - Fabric event\n * @private\n */\n _onMouseDownWithHandMode({ target, e }) {\n if (target) {\n return;\n }\n\n const canvas = this.getCanvas();\n\n if (this.zoomLevel <= DEFAULT_ZOOM_LEVEL) {\n return;\n }\n\n canvas.selection = false;\n\n this._startHandPoint = canvas.getPointer(e);\n\n const { moveHand, stopHand } = this._listeners;\n canvas.on({\n 'mouse:move': moveHand,\n 'mouse:up': stopHand,\n });\n }\n\n /**\n * onMouseMove handler in fabric canvas\n * @param {{e: MouseEvent}} fEvent - Fabric event\n * @private\n */\n _onMouseMoveWithHandMode({ e }) {\n const canvas = this.getCanvas();\n const { x, y } = canvas.getPointer(e);\n const deltaX = x - this._startHandPoint.x;\n const deltaY = y - this._startHandPoint.y;\n\n this._movePointOfZoom({ x: deltaX, y: deltaY });\n }\n\n /**\n * onMouseUp handler in fabric canvas\n * @private\n */\n _onMouseUpWithHandMode() {\n const canvas = this.getCanvas();\n const { moveHand, stopHand } = this._listeners;\n\n canvas.off({\n 'mouse:move': moveHand,\n 'mouse:up': stopHand,\n });\n\n this._startHandPoint = null;\n }\n\n /**\n * onChangeZoom handler in fabric canvas\n * @private\n */\n _changeScrollState({ viewport, zoomLevel }) {\n const canvas = this.getCanvas();\n\n canvas.remove(this._verticalScroll);\n canvas.remove(this._horizontalScroll);\n\n if (this._isDefaultZoomLevel(zoomLevel)) {\n return;\n }\n\n const canvasWidth = canvas.width;\n const canvasHeight = canvas.height;\n\n const { tl, tr, bl } = viewport;\n const viewportWidth = tr.x - tl.x;\n const viewportHeight = bl.y - tl.y;\n\n const horizontalScrollWidth = (viewportWidth * viewportWidth) / canvasWidth;\n const horizontalScrollHeight = viewportHeight * DEFAULT_HORIZONTAL_SCROLL_RATIO.SIZE;\n const horizontalScrollLeft = clamp(\n tl.x + (tl.x / canvasWidth) * viewportWidth,\n tl.x,\n tr.x - horizontalScrollWidth\n );\n const horizontalScrollMargin = viewportHeight * DEFAULT_HORIZONTAL_SCROLL_RATIO.MARGIN;\n const horizontalScrollBorderRadius =\n viewportHeight * DEFAULT_HORIZONTAL_SCROLL_RATIO.BORDER_RADIUS;\n\n this._horizontalScroll.set({\n left: horizontalScrollLeft,\n top: bl.y - horizontalScrollHeight - horizontalScrollMargin,\n width: horizontalScrollWidth,\n height: horizontalScrollHeight,\n rx: horizontalScrollBorderRadius,\n ry: horizontalScrollBorderRadius,\n });\n\n const verticalScrollWidth = viewportWidth * DEFAULT_VERTICAL_SCROLL_RATIO.SIZE;\n const verticalScrollHeight = (viewportHeight * viewportHeight) / canvasHeight;\n const verticalScrollTop = clamp(\n tl.y + (tl.y / canvasHeight) * viewportHeight,\n tr.y,\n bl.y - verticalScrollHeight\n );\n const verticalScrollMargin = viewportWidth * DEFAULT_VERTICAL_SCROLL_RATIO.MARGIN;\n const verticalScrollBorderRadius = viewportWidth * DEFAULT_VERTICAL_SCROLL_RATIO.BORDER_RADIUS;\n\n this._verticalScroll.set({\n left: tr.x - verticalScrollWidth - verticalScrollMargin,\n top: verticalScrollTop,\n width: verticalScrollWidth,\n height: verticalScrollHeight,\n rx: verticalScrollBorderRadius,\n ry: verticalScrollBorderRadius,\n });\n\n this._addScrollBar();\n }\n\n /**\n * Change objects 'evented' state\n * @param {boolean} [evented=true] - objects 'evented' state\n */\n _changeObjectsEventedState(evented = true) {\n const canvas = this.getCanvas();\n\n canvas.forEachObject((obj) => {\n // {@link http://fabricjs.com/docs/fabric.Object.html#evented}\n obj.evented = evented;\n });\n }\n\n /**\n * Add scroll bar and set remove timer\n */\n _addScrollBar() {\n const canvas = this.getCanvas();\n\n canvas.add(this._horizontalScroll);\n canvas.add(this._verticalScroll);\n\n if (this.scrollBarTid) {\n clearTimeout(this.scrollBarTid);\n }\n\n this.scrollBarTid = setTimeout(() => {\n canvas.remove(this._horizontalScroll);\n canvas.remove(this._verticalScroll);\n }, 3000);\n }\n\n /**\n * Check zoom level is default zoom level (1.0)\n * @param {number} zoomLevel - zoom level\n * @returns {boolean} - whether zoom level is 1.0\n */\n _isDefaultZoomLevel(zoomLevel) {\n return zoomLevel === DEFAULT_ZOOM_LEVEL;\n }\n\n /**\n * Fire 'zoomChanged' event\n * @param {fabric.Canvas} canvas - fabric canvas\n * @param {number} zoomLevel - 'zoomChanged' event params\n */\n _fireZoomChanged(canvas, zoomLevel) {\n canvas.fire(eventNames.ZOOM_CHANGED, { viewport: canvas.calcViewportBoundaries(), zoomLevel });\n }\n\n /**\n * Get zoom mode\n */\n get mode() {\n return this.zoomMode;\n }\n}\n\nexport default Zoom;\n","/**\n * @author NHN. FE Development Team \n * @fileoverview Constants\n */\nimport { keyMirror } from '@/util';\n\n/**\n * Help features for zoom\n * @type {Array.}\n */\nexport const ZOOM_HELP_MENUS = ['zoomIn', 'zoomOut', 'hand'];\n\n/**\n * Help features for command\n * @type {Array.}\n */\nexport const COMMAND_HELP_MENUS = ['history', 'undo', 'redo', 'reset'];\n\n/**\n * Help features for delete\n * @type {Array.}\n */\nexport const DELETE_HELP_MENUS = ['delete', 'deleteAll'];\n\n/**\n * Editor help features\n * @type {Array.}\n */\nexport const HELP_MENUS = [...ZOOM_HELP_MENUS, ...COMMAND_HELP_MENUS, ...DELETE_HELP_MENUS];\n\n/**\n * Fill type for shape\n * @type {Object.}\n */\nexport const SHAPE_FILL_TYPE = {\n FILTER: 'filter',\n COLOR: 'color',\n};\n\n/**\n * Shape type list\n * @type {Array.}\n */\nexport const SHAPE_TYPE = ['rect', 'circle', 'triangle'];\n\n/**\n * Object type\n * @type {Object.}\n */\nexport const OBJ_TYPE = {\n CROPZONE: 'cropzone',\n};\n\n/**\n * Filter type map\n * @type {Object.}\n */\nexport const filterType = {\n VINTAGE: 'vintage',\n SEPIA2: 'sepia2',\n REMOVE_COLOR: 'removeColor',\n COLOR_FILTER: 'colorFilter',\n REMOVE_WHITE: 'removeWhite',\n BLEND_COLOR: 'blendColor',\n BLEND: 'blend',\n};\n\n/**\n * Component names\n * @type {Object.}\n */\nexport const componentNames = keyMirror(\n 'IMAGE_LOADER',\n 'CROPPER',\n 'FLIP',\n 'ROTATION',\n 'FREE_DRAWING',\n 'LINE',\n 'TEXT',\n 'ICON',\n 'FILTER',\n 'SHAPE',\n 'ZOOM'\n);\n\n/**\n * Shape default option\n * @type {Object}\n */\nexport const SHAPE_DEFAULT_OPTIONS = {\n lockSkewingX: true,\n lockSkewingY: true,\n bringForward: true,\n isRegular: false,\n};\n\n/**\n * Cropzone default option\n * @type {Object}\n */\nexport const CROPZONE_DEFAULT_OPTIONS = {\n hasRotatingPoint: false,\n hasBorders: false,\n lockScalingFlip: true,\n lockRotation: true,\n lockSkewingX: true,\n lockSkewingY: true,\n};\n\n/**\n * Command names\n * @type {Object.}\n */\nexport const commandNames = {\n CLEAR_OBJECTS: 'clearObjects',\n LOAD_IMAGE: 'loadImage',\n FLIP_IMAGE: 'flip',\n ROTATE_IMAGE: 'rotate',\n ADD_OBJECT: 'addObject',\n REMOVE_OBJECT: 'removeObject',\n APPLY_FILTER: 'applyFilter',\n REMOVE_FILTER: 'removeFilter',\n ADD_ICON: 'addIcon',\n CHANGE_ICON_COLOR: 'changeIconColor',\n ADD_SHAPE: 'addShape',\n CHANGE_SHAPE: 'changeShape',\n ADD_TEXT: 'addText',\n CHANGE_TEXT: 'changeText',\n CHANGE_TEXT_STYLE: 'changeTextStyle',\n ADD_IMAGE_OBJECT: 'addImageObject',\n RESIZE_CANVAS_DIMENSION: 'resizeCanvasDimension',\n SET_OBJECT_PROPERTIES: 'setObjectProperties',\n SET_OBJECT_POSITION: 'setObjectPosition',\n CHANGE_SELECTION: 'changeSelection',\n};\n\n/**\n * Event names\n * @type {Object.}\n */\nexport const eventNames = {\n OBJECT_ACTIVATED: 'objectActivated',\n OBJECT_MOVED: 'objectMoved',\n OBJECT_SCALED: 'objectScaled',\n OBJECT_CREATED: 'objectCreated',\n OBJECT_ROTATED: 'objectRotated',\n OBJECT_ADDED: 'objectAdded',\n OBJECT_MODIFIED: 'objectModified',\n TEXT_EDITING: 'textEditing',\n TEXT_CHANGED: 'textChanged',\n ICON_CREATE_RESIZE: 'iconCreateResize',\n ICON_CREATE_END: 'iconCreateEnd',\n ADD_TEXT: 'addText',\n ADD_OBJECT: 'addObject',\n ADD_OBJECT_AFTER: 'addObjectAfter',\n MOUSE_DOWN: 'mousedown',\n MOUSE_UP: 'mouseup',\n MOUSE_MOVE: 'mousemove',\n // UNDO/REDO Events\n REDO_STACK_CHANGED: 'redoStackChanged',\n UNDO_STACK_CHANGED: 'undoStackChanged',\n SELECTION_CLEARED: 'selectionCleared',\n SELECTION_CREATED: 'selectionCreated',\n EXECUTE_COMMAND: 'executeCommand',\n AFTER_UNDO: 'afterUndo',\n AFTER_REDO: 'afterRedo',\n ZOOM_CHANGED: 'zoomChanged',\n HAND_STARTED: 'handStarted',\n HAND_STOPPED: 'handStopped',\n};\n\n/**\n * History names\n * @type {Object.}\n */\nexport const historyNames = {\n LOAD_IMAGE: 'Load',\n LOAD_MASK_IMAGE: 'Mask',\n ADD_MASK_IMAGE: 'Mask',\n ADD_IMAGE_OBJECT: 'Mask',\n CROP: 'Crop',\n APPLY_FILTER: 'Filter',\n REMOVE_FILTER: 'Filter',\n CHANGE_SHAPE: 'Shape',\n CHANGE_ICON_COLOR: 'Icon',\n ADD_TEXT: 'Text',\n CHANGE_TEXT_STYLE: 'Text',\n REMOVE_OBJECT: 'Delete',\n CLEAR_OBJECTS: 'Delete',\n};\n\n/**\n * Editor states\n * @type {Object.}\n */\nexport const drawingModes = keyMirror(\n 'NORMAL',\n 'CROPPER',\n 'FREE_DRAWING',\n 'LINE_DRAWING',\n 'TEXT',\n 'SHAPE',\n 'ICON',\n 'ZOOM'\n);\n\n/**\n * Menu names with drawing mode\n * @type {Object.}\n */\nexport const drawingMenuNames = {\n TEXT: 'text',\n CROP: 'crop',\n SHAPE: 'shape',\n ZOOM: 'zoom',\n};\n\n/**\n * Zoom modes\n * @type {Object.}\n */\nexport const zoomModes = {\n DEFAULT: 'normal',\n ZOOM: 'zoom',\n HAND: 'hand',\n};\n\n/**\n * Shortcut key values\n * @type {Object.}\n */\nexport const keyCodes = {\n Z: 90,\n Y: 89,\n C: 67,\n V: 86,\n SHIFT: 16,\n BACKSPACE: 8,\n DEL: 46,\n ARROW_DOWN: 40,\n ARROW_UP: 38,\n SPACE: 32,\n};\n\n/**\n * Fabric object options\n * @type {Object.}\n */\nexport const fObjectOptions = {\n SELECTION_STYLE: {\n borderColor: 'red',\n cornerColor: 'green',\n cornerSize: 10,\n originX: 'center',\n originY: 'center',\n transparentCorners: false,\n },\n};\n\n/**\n * Promise reject messages\n * @type {Object.}\n */\nexport const rejectMessages = {\n addedObject: 'The object is already added.',\n flip: 'The flipX and flipY setting values are not changed.',\n invalidDrawingMode: 'This operation is not supported in the drawing mode.',\n invalidParameters: 'Invalid parameters.',\n isLock: 'The executing command state is locked.',\n loadImage: 'The background image is empty.',\n loadingImageFailed: 'Invalid image loaded.',\n noActiveObject: 'There is no active object.',\n noObject: 'The object is not in canvas.',\n redo: 'The promise of redo command is reject.',\n rotation: 'The current angle is same the old angle.',\n undo: 'The promise of undo command is reject.',\n unsupportedOperation: 'Unsupported operation.',\n unsupportedType: 'Unsupported object type.',\n};\n\n/**\n * Default icon menu svg path\n * @type {Object.}\n */\nexport const defaultIconPath = {\n 'icon-arrow': 'M40 12V0l24 24-24 24V36H0V12h40z',\n 'icon-arrow-2': 'M49,32 H3 V22 h46 l-18,-18 h12 l23,23 L43,50 h-12 l18,-18 z ',\n 'icon-arrow-3':\n 'M43.349998,27 L17.354,53 H1.949999 l25.996,-26 L1.949999,1 h15.404 L43.349998,27 z ',\n 'icon-star':\n 'M35,54.557999 l-19.912001,10.468 l3.804,-22.172001 l-16.108,-15.7 l22.26,-3.236 L35,3.746 l9.956,20.172001 l22.26,3.236 l-16.108,15.7 l3.804,22.172001 z ',\n 'icon-star-2':\n 'M17,31.212 l-7.194,4.08 l-4.728,-6.83 l-8.234,0.524 l-1.328,-8.226 l-7.644,-3.14 l2.338,-7.992 l-5.54,-6.18 l5.54,-6.176 l-2.338,-7.994 l7.644,-3.138 l1.328,-8.226 l8.234,0.522 l4.728,-6.83 L17,-24.312 l7.194,-4.08 l4.728,6.83 l8.234,-0.522 l1.328,8.226 l7.644,3.14 l-2.338,7.992 l5.54,6.178 l-5.54,6.178 l2.338,7.992 l-7.644,3.14 l-1.328,8.226 l-8.234,-0.524 l-4.728,6.83 z ',\n 'icon-polygon': 'M3,31 L19,3 h32 l16,28 l-16,28 H19 z ',\n 'icon-location':\n 'M24 62C8 45.503 0 32.837 0 24 0 10.745 10.745 0 24 0s24 10.745 24 24c0 8.837-8 21.503-24 38zm0-28c5.523 0 10-4.477 10-10s-4.477-10-10-10-10 4.477-10 10 4.477 10 10 10z',\n 'icon-heart':\n 'M49.994999,91.349998 l-6.96,-6.333 C18.324001,62.606995 2.01,47.829002 2.01,29.690998 C2.01,14.912998 13.619999,3.299999 28.401001,3.299999 c8.349,0 16.362,5.859 21.594,12 c5.229,-6.141 13.242001,-12 21.591,-12 c14.778,0 26.390999,11.61 26.390999,26.390999 c0,18.138 -16.314001,32.916 -41.025002,55.374001 l-6.96,6.285 z ',\n 'icon-bubble':\n 'M44 48L34 58V48H12C5.373 48 0 42.627 0 36V12C0 5.373 5.373 0 12 0h40c6.627 0 12 5.373 12 12v24c0 6.627-5.373 12-12 12h-8z',\n};\n\nexport const defaultRotateRangeValues = {\n realTimeEvent: true,\n min: -360,\n max: 360,\n value: 0,\n};\n\nexport const defaultDrawRangeValues = {\n min: 5,\n max: 30,\n value: 12,\n};\n\nexport const defaultShapeStrokeValues = {\n realTimeEvent: true,\n min: 2,\n max: 300,\n value: 3,\n};\n\nexport const defaultTextRangeValues = {\n realTimeEvent: true,\n min: 10,\n max: 100,\n value: 50,\n};\n\nexport const defaultFilterRangeValues = {\n tintOpacityRange: {\n realTimeEvent: true,\n min: 0,\n max: 1,\n value: 0.7,\n useDecimal: true,\n },\n removewhiteDistanceRange: {\n realTimeEvent: true,\n min: 0,\n max: 1,\n value: 0.2,\n useDecimal: true,\n },\n brightnessRange: {\n realTimeEvent: true,\n min: -1,\n max: 1,\n value: 0,\n useDecimal: true,\n },\n noiseRange: {\n realTimeEvent: true,\n min: 0,\n max: 1000,\n value: 100,\n },\n pixelateRange: {\n realTimeEvent: true,\n min: 2,\n max: 20,\n value: 4,\n },\n colorfilterThresholdRange: {\n realTimeEvent: true,\n min: 0,\n max: 1,\n value: 0.2,\n useDecimal: true,\n },\n blurFilterRange: {\n value: 0.1,\n },\n};\n\nexport const emptyCropRectValues = {\n LEFT: 0,\n TOP: 0,\n WIDTH: 0.5,\n HEIGHT: 0.5,\n};\n","/**\n * @author NHN. FE Development Team \n * @fileoverview CropperDrawingMode class\n */\nimport DrawingMode from '@/interface/drawingMode';\nimport { drawingModes, componentNames as components } from '@/consts';\n\n/**\n * CropperDrawingMode class\n * @class\n * @ignore\n */\nclass CropperDrawingMode extends DrawingMode {\n constructor() {\n super(drawingModes.CROPPER);\n }\n\n /**\n * start this drawing mode\n * @param {Graphics} graphics - Graphics instance\n * @override\n */\n start(graphics) {\n const cropper = graphics.getComponent(components.CROPPER);\n cropper.start();\n }\n\n /**\n * stop this drawing mode\n * @param {Graphics} graphics - Graphics instance\n * @override\n */\n end(graphics) {\n const cropper = graphics.getComponent(components.CROPPER);\n cropper.end();\n }\n}\n\nexport default CropperDrawingMode;\n","/**\n * @author NHN. FE Development Team \n * @fileoverview FreeDrawingMode class\n */\nimport DrawingMode from '@/interface/drawingMode';\nimport { drawingModes, componentNames as components } from '@/consts';\n\n/**\n * FreeDrawingMode class\n * @class\n * @ignore\n */\nclass FreeDrawingMode extends DrawingMode {\n constructor() {\n super(drawingModes.FREE_DRAWING);\n }\n\n /**\n * start this drawing mode\n * @param {Graphics} graphics - Graphics instance\n * @param {{width: ?number, color: ?string}} [options] - Brush width & color\n * @override\n */\n start(graphics, options) {\n const freeDrawing = graphics.getComponent(components.FREE_DRAWING);\n freeDrawing.start(options);\n }\n\n /**\n * stop this drawing mode\n * @param {Graphics} graphics - Graphics instance\n * @override\n */\n end(graphics) {\n const freeDrawing = graphics.getComponent(components.FREE_DRAWING);\n freeDrawing.end();\n }\n}\n\nexport default FreeDrawingMode;\n","/**\n * @author NHN. FE Development Team \n * @fileoverview IconDrawingMode class\n */\nimport DrawingMode from '@/interface/drawingMode';\nimport { drawingModes, componentNames as components } from '@/consts';\n\n/**\n * IconDrawingMode class\n * @class\n * @ignore\n */\nclass IconDrawingMode extends DrawingMode {\n constructor() {\n super(drawingModes.ICON);\n }\n\n /**\n * start this drawing mode\n * @param {Graphics} graphics - Graphics instance\n * @override\n */\n start(graphics) {\n const icon = graphics.getComponent(components.ICON);\n icon.start();\n }\n\n /**\n * stop this drawing mode\n * @param {Graphics} graphics - Graphics instance\n * @override\n */\n end(graphics) {\n const icon = graphics.getComponent(components.ICON);\n icon.end();\n }\n}\n\nexport default IconDrawingMode;\n","/**\n * @author NHN. FE Development Team \n * @fileoverview LineDrawingMode class\n */\nimport DrawingMode from '@/interface/drawingMode';\nimport { drawingModes, componentNames as components } from '@/consts';\n\n/**\n * LineDrawingMode class\n * @class\n * @ignore\n */\nclass LineDrawingMode extends DrawingMode {\n constructor() {\n super(drawingModes.LINE_DRAWING);\n }\n\n /**\n * start this drawing mode\n * @param {Graphics} graphics - Graphics instance\n * @param {{width: ?number, color: ?string}} [options] - Brush width & color\n * @override\n */\n start(graphics, options) {\n const lineDrawing = graphics.getComponent(components.LINE);\n lineDrawing.start(options);\n }\n\n /**\n * stop this drawing mode\n * @param {Graphics} graphics - Graphics instance\n * @override\n */\n end(graphics) {\n const lineDrawing = graphics.getComponent(components.LINE);\n lineDrawing.end();\n }\n}\n\nexport default LineDrawingMode;\n","/**\n * @author NHN. FE Development Team \n * @fileoverview ShapeDrawingMode class\n */\nimport DrawingMode from '@/interface/drawingMode';\nimport { drawingModes, componentNames as components } from '@/consts';\n\n/**\n * ShapeDrawingMode class\n * @class\n * @ignore\n */\nclass ShapeDrawingMode extends DrawingMode {\n constructor() {\n super(drawingModes.SHAPE);\n }\n\n /**\n * start this drawing mode\n * @param {Graphics} graphics - Graphics instance\n * @override\n */\n start(graphics) {\n const shape = graphics.getComponent(components.SHAPE);\n shape.start();\n }\n\n /**\n * stop this drawing mode\n * @param {Graphics} graphics - Graphics instance\n * @override\n */\n end(graphics) {\n const shape = graphics.getComponent(components.SHAPE);\n shape.end();\n }\n}\n\nexport default ShapeDrawingMode;\n","/**\n * @author NHN. FE Development Team \n * @fileoverview TextDrawingMode class\n */\nimport DrawingMode from '@/interface/drawingMode';\nimport { drawingModes, componentNames as components } from '@/consts';\n\n/**\n * TextDrawingMode class\n * @class\n * @ignore\n */\nclass TextDrawingMode extends DrawingMode {\n constructor() {\n super(drawingModes.TEXT);\n }\n\n /**\n * start this drawing mode\n * @param {Graphics} graphics - Graphics instance\n * @override\n */\n start(graphics) {\n const text = graphics.getComponent(components.TEXT);\n text.start();\n }\n\n /**\n * stop this drawing mode\n * @param {Graphics} graphics - Graphics instance\n * @override\n */\n end(graphics) {\n const text = graphics.getComponent(components.TEXT);\n text.end();\n }\n}\n\nexport default TextDrawingMode;\n","/**\n * @author NHN. FE Development Team \n * @fileoverview ZoomDrawingMode class\n */\nimport DrawingMode from '@/interface/drawingMode';\nimport { drawingModes, componentNames as components } from '@/consts';\n\n/**\n * ZoomDrawingMode class\n * @class\n * @ignore\n */\nclass ZoomDrawingMode extends DrawingMode {\n constructor() {\n super(drawingModes.ZOOM);\n }\n\n /**\n * start this drawing mode\n * @param {Graphics} graphics - Graphics instance\n * @override\n */\n start(graphics) {\n const zoom = graphics.getComponent(components.ZOOM);\n\n zoom.start();\n }\n\n /**\n * stop this drawing mode\n * @param {Graphics} graphics - Graphics instance\n * @override\n */\n end(graphics) {\n const zoom = graphics.getComponent(components.ZOOM);\n\n zoom.end();\n }\n}\n\nexport default ZoomDrawingMode;\n","/**\n * @author NHN. FE Development Team \n * @fileoverview Blur extending fabric.Image.filters.Convolute\n */\nimport fabric from 'fabric';\n\nconst ARROW_ANGLE = 30;\nconst CHEVRON_SIZE_RATIO = 2.7;\nconst TRIANGLE_SIZE_RATIO = 1.7;\nconst RADIAN_CONVERSION_VALUE = 180;\n\nconst ArrowLine = fabric.util.createClass(\n fabric.Line,\n /** @lends Convolute.prototype */ {\n /**\n * Line type\n * @param {String} type\n * @default\n */\n type: 'line',\n\n /**\n * Constructor\n * @param {Array} [points] Array of points\n * @param {Object} [options] Options object\n * @override\n */\n initialize(points, options = {}) {\n this.callSuper('initialize', points, options);\n\n this.arrowType = options.arrowType;\n },\n\n /**\n * Render ArrowLine\n * @private\n * @override\n */\n _render(ctx) {\n const { x1: fromX, y1: fromY, x2: toX, y2: toY } = this.calcLinePoints();\n const linePosition = {\n fromX,\n fromY,\n toX,\n toY,\n };\n this.ctx = ctx;\n ctx.lineWidth = this.strokeWidth;\n\n this._renderBasicLinePath(linePosition);\n this._drawDecoratorPath(linePosition);\n\n this._renderStroke(ctx);\n },\n\n /**\n * Render Basic line path\n * @param {Object} linePosition - line position\n * @param {number} option.fromX - line start position x\n * @param {number} option.fromY - line start position y\n * @param {number} option.toX - line end position x\n * @param {number} option.toY - line end position y\n * @private\n */\n _renderBasicLinePath({ fromX, fromY, toX, toY }) {\n this.ctx.beginPath();\n this.ctx.moveTo(fromX, fromY);\n this.ctx.lineTo(toX, toY);\n },\n\n /**\n * Render Arrow Head\n * @param {Object} linePosition - line position\n * @param {number} option.fromX - line start position x\n * @param {number} option.fromY - line start position y\n * @param {number} option.toX - line end position x\n * @param {number} option.toY - line end position y\n * @private\n */\n _drawDecoratorPath(linePosition) {\n this._drawDecoratorPathType('head', linePosition);\n this._drawDecoratorPathType('tail', linePosition);\n },\n\n /**\n * Render Arrow Head\n * @param {string} type - 'head' or 'tail'\n * @param {Object} linePosition - line position\n * @param {number} option.fromX - line start position x\n * @param {number} option.fromY - line start position y\n * @param {number} option.toX - line end position x\n * @param {number} option.toY - line end position y\n * @private\n */\n _drawDecoratorPathType(type, linePosition) {\n switch (this.arrowType[type]) {\n case 'triangle':\n this._drawTrianglePath(type, linePosition);\n break;\n case 'chevron':\n this._drawChevronPath(type, linePosition);\n break;\n default:\n break;\n }\n },\n\n /**\n * Render Triangle Head\n * @param {string} type - 'head' or 'tail'\n * @param {Object} linePosition - line position\n * @param {number} option.fromX - line start position x\n * @param {number} option.fromY - line start position y\n * @param {number} option.toX - line end position x\n * @param {number} option.toY - line end position y\n * @private\n */\n _drawTrianglePath(type, linePosition) {\n const decorateSize = this.ctx.lineWidth * TRIANGLE_SIZE_RATIO;\n\n this._drawChevronPath(type, linePosition, decorateSize);\n this.ctx.closePath();\n },\n\n /**\n * Render Chevron Head\n * @param {string} type - 'head' or 'tail'\n * @param {Object} linePosition - line position\n * @param {number} option.fromX - line start position x\n * @param {number} option.fromY - line start position y\n * @param {number} option.toX - line end position x\n * @param {number} option.toY - line end position y\n * @param {number} decorateSize - decorate size\n * @private\n */\n _drawChevronPath(type, { fromX, fromY, toX, toY }, decorateSize) {\n const { ctx } = this;\n if (!decorateSize) {\n decorateSize = this.ctx.lineWidth * CHEVRON_SIZE_RATIO;\n }\n\n const [standardX, standardY] = type === 'head' ? [fromX, fromY] : [toX, toY];\n const [compareX, compareY] = type === 'head' ? [toX, toY] : [fromX, fromY];\n\n const angle =\n (Math.atan2(compareY - standardY, compareX - standardX) * RADIAN_CONVERSION_VALUE) /\n Math.PI;\n const rotatedPosition = (changeAngle) =>\n this.getRotatePosition(decorateSize, changeAngle, {\n x: standardX,\n y: standardY,\n });\n\n ctx.moveTo(...rotatedPosition(angle + ARROW_ANGLE));\n ctx.lineTo(standardX, standardY);\n ctx.lineTo(...rotatedPosition(angle - ARROW_ANGLE));\n },\n\n /**\n * return position from change angle.\n * @param {number} distance - change distance\n * @param {number} angle - change angle\n * @param {Object} referencePosition - reference position\n * @returns {Array}\n * @private\n */\n getRotatePosition(distance, angle, referencePosition) {\n const radian = (angle * Math.PI) / RADIAN_CONVERSION_VALUE;\n const { x, y } = referencePosition;\n\n return [distance * Math.cos(radian) + x, distance * Math.sin(radian) + y];\n },\n }\n);\n\nexport default ArrowLine;\n","/**\n * @author NHN. FE Development Team \n * @fileoverview ColorFilter extending fabric.Image.filters.BaseFilter\n */\nimport fabric from 'fabric';\n\n/**\n * ColorFilter object\n * @class ColorFilter\n * @extends {fabric.Image.filters.BaseFilter}\n * @ignore\n */\nconst ColorFilter = fabric.util.createClass(\n fabric.Image.filters.BaseFilter,\n /** @lends BaseFilter.prototype */ {\n /**\n * Filter type\n * @param {String} type\n * @default\n */\n type: 'ColorFilter',\n\n /**\n * Constructor\n * @member fabric.Image.filters.ColorFilter.prototype\n * @param {Object} [options] Options object\n * @param {Number} [options.color='#FFFFFF'] Value of color (0...255)\n * @param {Number} [options.threshold=45] Value of threshold (0...255)\n * @override\n */\n initialize(options) {\n if (!options) {\n options = {};\n }\n this.color = options.color || '#FFFFFF';\n this.threshold = options.threshold || 45;\n this.x = options.x || null;\n this.y = options.y || null;\n },\n\n /**\n * Applies filter to canvas element\n * @param {Object} canvas Canvas object passed by fabric\n */\n // eslint-disable-next-line complexity\n applyTo(canvas) {\n const { canvasEl } = canvas;\n const context = canvasEl.getContext('2d');\n const imageData = context.getImageData(0, 0, canvasEl.width, canvasEl.height);\n const { data } = imageData;\n const { threshold } = this;\n let filterColor = fabric.Color.sourceFromHex(this.color);\n let i, len;\n\n if (this.x && this.y) {\n filterColor = this._getColor(imageData, this.x, this.y);\n }\n\n for (i = 0, len = data.length; i < len; i += 4) {\n if (\n this._isOutsideThreshold(data[i], filterColor[0], threshold) ||\n this._isOutsideThreshold(data[i + 1], filterColor[1], threshold) ||\n this._isOutsideThreshold(data[i + 2], filterColor[2], threshold)\n ) {\n continue;\n }\n data[i] = data[i + 1] = data[i + 2] = data[i + 3] = 0;\n }\n context.putImageData(imageData, 0, 0);\n },\n\n /**\n * Check color if it is within threshold\n * @param {Number} color1 source color\n * @param {Number} color2 filtering color\n * @param {Number} threshold threshold\n * @returns {boolean} true if within threshold or false\n */\n _isOutsideThreshold(color1, color2, threshold) {\n const diff = color1 - color2;\n\n return Math.abs(diff) > threshold;\n },\n\n /**\n * Get color at (x, y)\n * @param {Object} imageData of canvas\n * @param {Number} x left position\n * @param {Number} y top position\n * @returns {Array} color array\n */\n _getColor(imageData, x, y) {\n const color = [0, 0, 0, 0];\n const { data, width } = imageData;\n const bytes = 4;\n const position = (width * y + x) * bytes;\n\n color[0] = data[position];\n color[1] = data[position + 1];\n color[2] = data[position + 2];\n color[3] = data[position + 3];\n\n return color;\n },\n }\n);\n\nexport default ColorFilter;\n","/**\n * @author NHN. FE Development Team \n * @fileoverview Cropzone extending fabric.Rect\n */\nimport snippet from 'tui-code-snippet';\nimport fabric from 'fabric';\nimport { clamp } from '@/util';\nimport { eventNames as events, keyCodes } from '@/consts';\n\nconst CORNER_TYPE_TOP_LEFT = 'tl';\nconst CORNER_TYPE_TOP_RIGHT = 'tr';\nconst CORNER_TYPE_MIDDLE_TOP = 'mt';\nconst CORNER_TYPE_MIDDLE_LEFT = 'ml';\nconst CORNER_TYPE_MIDDLE_RIGHT = 'mr';\nconst CORNER_TYPE_MIDDLE_BOTTOM = 'mb';\nconst CORNER_TYPE_BOTTOM_LEFT = 'bl';\nconst CORNER_TYPE_BOTTOM_RIGHT = 'br';\nconst CORNER_TYPE_LIST = [\n CORNER_TYPE_TOP_LEFT,\n CORNER_TYPE_TOP_RIGHT,\n CORNER_TYPE_MIDDLE_TOP,\n CORNER_TYPE_MIDDLE_LEFT,\n CORNER_TYPE_MIDDLE_RIGHT,\n CORNER_TYPE_MIDDLE_BOTTOM,\n CORNER_TYPE_BOTTOM_LEFT,\n CORNER_TYPE_BOTTOM_RIGHT,\n];\nconst NOOP_FUNCTION = () => {};\n\n/**\n * Align with cropzone ratio\n * @param {string} selectedCorner - selected corner type\n * @returns {{width: number, height: number}}\n * @private\n */\nfunction cornerTypeValid(selectedCorner) {\n return CORNER_TYPE_LIST.indexOf(selectedCorner) >= 0;\n}\n\n/**\n * return scale basis type\n * @param {number} diffX - X distance of the cursor and corner.\n * @param {number} diffY - Y distance of the cursor and corner.\n * @returns {string}\n * @private\n */\nfunction getScaleBasis(diffX, diffY) {\n return diffX > diffY ? 'width' : 'height';\n}\n\n/**\n * Cropzone object\n * Issue: IE7, 8(with excanvas)\n * - Cropzone is a black zone without transparency.\n * @class Cropzone\n * @extends {fabric.Rect}\n * @ignore\n */\nconst Cropzone = fabric.util.createClass(\n fabric.Rect,\n /** @lends Cropzone.prototype */ {\n /**\n * Constructor\n * @param {Object} canvas canvas\n * @param {Object} options Options object\n * @param {Object} extendsOptions object for extends \"options\"\n * @override\n */\n initialize(canvas, options, extendsOptions) {\n options = snippet.extend(options, extendsOptions);\n options.type = 'cropzone';\n\n this.callSuper('initialize', options);\n this._addEventHandler();\n\n this.canvas = canvas;\n this.options = options;\n },\n canvasEventDelegation(eventName) {\n let delegationState = 'unregistered';\n const isRegistered = this.canvasEventTrigger[eventName] !== NOOP_FUNCTION;\n if (isRegistered) {\n delegationState = 'registered';\n } else if ([events.OBJECT_MOVED, events.OBJECT_SCALED].indexOf(eventName) < 0) {\n delegationState = 'none';\n }\n\n return delegationState;\n },\n canvasEventRegister(eventName, eventTrigger) {\n this.canvasEventTrigger[eventName] = eventTrigger;\n },\n _addEventHandler() {\n this.canvasEventTrigger = {\n [events.OBJECT_MOVED]: NOOP_FUNCTION,\n [events.OBJECT_SCALED]: NOOP_FUNCTION,\n };\n this.on({\n moving: this._onMoving.bind(this),\n scaling: this._onScaling.bind(this),\n });\n fabric.util.addListener(document, 'keydown', this._onKeyDown.bind(this));\n fabric.util.addListener(document, 'keyup', this._onKeyUp.bind(this));\n },\n _renderCropzone(ctx) {\n const cropzoneDashLineWidth = 7;\n const cropzoneDashLineOffset = 7;\n\n // Calc original scale\n const originalFlipX = this.flipX ? -1 : 1;\n const originalFlipY = this.flipY ? -1 : 1;\n const originalScaleX = originalFlipX / this.scaleX;\n const originalScaleY = originalFlipY / this.scaleY;\n\n // Set original scale\n ctx.scale(originalScaleX, originalScaleY);\n\n // Render outer rect\n this._fillOuterRect(ctx, 'rgba(0, 0, 0, 0.5)');\n\n if (this.options.lineWidth) {\n this._fillInnerRect(ctx);\n this._strokeBorder(ctx, 'rgb(255, 255, 255)', {\n lineWidth: this.options.lineWidth,\n });\n } else {\n // Black dash line\n this._strokeBorder(ctx, 'rgb(0, 0, 0)', {\n lineDashWidth: cropzoneDashLineWidth,\n });\n\n // White dash line\n this._strokeBorder(ctx, 'rgb(255, 255, 255)', {\n lineDashWidth: cropzoneDashLineWidth,\n lineDashOffset: cropzoneDashLineOffset,\n });\n }\n\n // Reset scale\n ctx.scale(1 / originalScaleX, 1 / originalScaleY);\n },\n\n /**\n * Render Crop-zone\n * @private\n * @override\n */\n _render(ctx) {\n this.callSuper('_render', ctx);\n\n this._renderCropzone(ctx);\n },\n\n /**\n * Cropzone-coordinates with outer rectangle\n *\n * x0 x1 x2 x3\n * y0 +--------------------------+\n * |///////|//////////|///////| // <--- \"Outer-rectangle\"\n * |///////|//////////|///////|\n * y1 +-------+----------+-------+\n * |///////| Cropzone |///////| Cropzone is the \"Inner-rectangle\"\n * |///////| (0, 0) |///////| Center point (0, 0)\n * y2 +-------+----------+-------+\n * |///////|//////////|///////|\n * |///////|//////////|///////|\n * y3 +--------------------------+\n *\n * @typedef {{x: Array, y: Array}} cropzoneCoordinates\n * @ignore\n */\n\n /**\n * Fill outer rectangle\n * @param {CanvasRenderingContext2D} ctx - Context\n * @param {string|CanvasGradient|CanvasPattern} fillStyle - Fill-style\n * @private\n */\n _fillOuterRect(ctx, fillStyle) {\n const { x, y } = this._getCoordinates();\n\n ctx.save();\n ctx.fillStyle = fillStyle;\n ctx.beginPath();\n\n // Outer rectangle\n // Numbers are +/-1 so that overlay edges don't get blurry.\n ctx.moveTo(x[0] - 1, y[0] - 1);\n ctx.lineTo(x[3] + 1, y[0] - 1);\n ctx.lineTo(x[3] + 1, y[3] + 1);\n ctx.lineTo(x[0] - 1, y[3] + 1);\n ctx.lineTo(x[0] - 1, y[0] - 1);\n ctx.closePath();\n\n // Inner rectangle\n ctx.moveTo(x[1], y[1]);\n ctx.lineTo(x[1], y[2]);\n ctx.lineTo(x[2], y[2]);\n ctx.lineTo(x[2], y[1]);\n ctx.lineTo(x[1], y[1]);\n ctx.closePath();\n\n ctx.fill();\n ctx.restore();\n },\n\n /**\n * Draw Inner grid line\n * @param {CanvasRenderingContext2D} ctx - Context\n * @private\n */\n _fillInnerRect(ctx) {\n const { x: outerX, y: outerY } = this._getCoordinates();\n const x = this._caculateInnerPosition(outerX, (outerX[2] - outerX[1]) / 3);\n const y = this._caculateInnerPosition(outerY, (outerY[2] - outerY[1]) / 3);\n\n ctx.save();\n ctx.strokeStyle = 'rgba(255, 255, 255, 0.7)';\n ctx.lineWidth = this.options.lineWidth;\n ctx.beginPath();\n\n ctx.moveTo(x[0], y[1]);\n ctx.lineTo(x[3], y[1]);\n\n ctx.moveTo(x[0], y[2]);\n ctx.lineTo(x[3], y[2]);\n\n ctx.moveTo(x[1], y[0]);\n ctx.lineTo(x[1], y[3]);\n\n ctx.moveTo(x[2], y[0]);\n ctx.lineTo(x[2], y[3]);\n ctx.stroke();\n ctx.closePath();\n\n ctx.restore();\n },\n\n /**\n * Calculate Inner Position\n * @param {Array} outer - outer position\n * @param {number} size - interval for calculate\n * @returns {Array} - inner position\n * @private\n */\n _caculateInnerPosition(outer, size) {\n const position = [];\n position[0] = outer[1];\n position[1] = outer[1] + size;\n position[2] = outer[1] + size * 2;\n position[3] = outer[2];\n\n return position;\n },\n\n /**\n * Get coordinates\n * @returns {cropzoneCoordinates} - {@link cropzoneCoordinates}\n * @private\n */\n _getCoordinates() {\n const { canvas, width, height, left, top } = this;\n const halfWidth = width / 2;\n const halfHeight = height / 2;\n const canvasHeight = canvas.getHeight(); // fabric object\n const canvasWidth = canvas.getWidth(); // fabric object\n\n return {\n x: snippet.map(\n [\n -(halfWidth + left), // x0\n -halfWidth, // x1\n halfWidth, // x2\n halfWidth + (canvasWidth - left - width), // x3\n ],\n Math.ceil\n ),\n y: snippet.map(\n [\n -(halfHeight + top), // y0\n -halfHeight, // y1\n halfHeight, // y2\n halfHeight + (canvasHeight - top - height), // y3\n ],\n Math.ceil\n ),\n };\n },\n\n /**\n * Stroke border\n * @param {CanvasRenderingContext2D} ctx - Context\n * @param {string|CanvasGradient|CanvasPattern} strokeStyle - Stroke-style\n * @param {number} lineDashWidth - Dash width\n * @param {number} [lineDashOffset] - Dash offset\n * @param {number} [lineWidth] - line width\n * @private\n */\n _strokeBorder(ctx, strokeStyle, { lineDashWidth, lineDashOffset, lineWidth }) {\n const halfWidth = this.width / 2;\n const halfHeight = this.height / 2;\n\n ctx.save();\n ctx.strokeStyle = strokeStyle;\n\n if (ctx.setLineDash) {\n ctx.setLineDash([lineDashWidth, lineDashWidth]);\n }\n if (lineDashOffset) {\n ctx.lineDashOffset = lineDashOffset;\n }\n if (lineWidth) {\n ctx.lineWidth = lineWidth;\n }\n\n ctx.beginPath();\n ctx.moveTo(-halfWidth, -halfHeight);\n ctx.lineTo(halfWidth, -halfHeight);\n ctx.lineTo(halfWidth, halfHeight);\n ctx.lineTo(-halfWidth, halfHeight);\n ctx.lineTo(-halfWidth, -halfHeight);\n ctx.stroke();\n\n ctx.restore();\n },\n\n /**\n * onMoving event listener\n * @private\n */\n _onMoving() {\n const { height, width, left, top } = this;\n const maxLeft = this.canvas.getWidth() - width;\n const maxTop = this.canvas.getHeight() - height;\n\n this.left = clamp(left, 0, maxLeft);\n this.top = clamp(top, 0, maxTop);\n\n this.canvasEventTrigger[events.OBJECT_MOVED](this);\n },\n\n /**\n * onScaling event listener\n * @param {{e: MouseEvent}} fEvent - Fabric event\n * @private\n */\n _onScaling(fEvent) {\n const selectedCorner = fEvent.transform.corner;\n const pointer = this.canvas.getPointer(fEvent.e);\n const settings = this._calcScalingSizeFromPointer(pointer, selectedCorner);\n\n // On scaling cropzone,\n // change real width and height and fix scaleFactor to 1\n this.scale(1).set(settings);\n\n this.canvasEventTrigger[events.OBJECT_SCALED](this);\n },\n\n /**\n * Calc scaled size from mouse pointer with selected corner\n * @param {{x: number, y: number}} pointer - Mouse position\n * @param {string} selectedCorner - selected corner type\n * @returns {Object} Having left or(and) top or(and) width or(and) height.\n * @private\n */\n _calcScalingSizeFromPointer(pointer, selectedCorner) {\n const isCornerTypeValid = cornerTypeValid(selectedCorner);\n\n return isCornerTypeValid && this._resizeCropZone(pointer, selectedCorner);\n },\n\n /**\n * Align with cropzone ratio\n * @param {number} width - cropzone width\n * @param {number} height - cropzone height\n * @param {number} maxWidth - limit max width\n * @param {number} maxHeight - limit max height\n * @param {number} scaleTo - cropzone ratio\n * @returns {{width: number, height: number}}\n * @private\n */\n adjustRatioCropzoneSize({ width, height, leftMaker, topMaker, maxWidth, maxHeight, scaleTo }) {\n width = maxWidth ? clamp(width, 1, maxWidth) : width;\n height = maxHeight ? clamp(height, 1, maxHeight) : height;\n\n if (!this.presetRatio) {\n if (this._withShiftKey) {\n // make fixed ratio cropzone\n if (width > height) {\n height = width;\n } else if (height > width) {\n width = height;\n }\n }\n\n return {\n width,\n height,\n left: leftMaker(width),\n top: topMaker(height),\n };\n }\n\n if (scaleTo === 'width') {\n height = width / this.presetRatio;\n } else {\n width = height * this.presetRatio;\n }\n\n const maxScaleFactor = Math.min(maxWidth / width, maxHeight / height);\n if (maxScaleFactor <= 1) {\n [width, height] = [width, height].map((v) => v * maxScaleFactor);\n }\n\n return {\n width,\n height,\n left: leftMaker(width),\n top: topMaker(height),\n };\n },\n\n /**\n * Get dimension last state cropzone\n * @returns {{rectTop: number, rectLeft: number, rectWidth: number, rectHeight: number}}\n * @private\n */\n _getCropzoneRectInfo() {\n const { width: canvasWidth, height: canvasHeight } = this.canvas;\n const {\n top: rectTop,\n left: rectLeft,\n width: rectWidth,\n height: rectHeight,\n } = this.getBoundingRect(false, true);\n\n return {\n rectTop,\n rectLeft,\n rectWidth,\n rectHeight,\n rectRight: rectLeft + rectWidth,\n rectBottom: rectTop + rectHeight,\n canvasWidth,\n canvasHeight,\n };\n },\n\n /**\n * Calc scaling dimension\n * @param {Object} position - Mouse position\n * @param {string} corner - corner type\n * @returns {{left: number, top: number, width: number, height: number}}\n * @private\n */\n _resizeCropZone({ x, y }, corner) {\n const {\n rectWidth,\n rectHeight,\n rectTop,\n rectLeft,\n rectBottom,\n rectRight,\n canvasWidth,\n canvasHeight,\n } = this._getCropzoneRectInfo();\n\n const resizeInfoMap = {\n tl: {\n width: rectRight - x,\n height: rectBottom - y,\n leftMaker: (newWidth) => rectRight - newWidth,\n topMaker: (newHeight) => rectBottom - newHeight,\n maxWidth: rectRight,\n maxHeight: rectBottom,\n scaleTo: getScaleBasis(rectLeft - x, rectTop - y),\n },\n tr: {\n width: x - rectLeft,\n height: rectBottom - y,\n leftMaker: () => rectLeft,\n topMaker: (newHeight) => rectBottom - newHeight,\n maxWidth: canvasWidth - rectLeft,\n maxHeight: rectBottom,\n scaleTo: getScaleBasis(x - rectRight, rectTop - y),\n },\n mt: {\n width: rectWidth,\n height: rectBottom - y,\n leftMaker: () => rectLeft,\n topMaker: (newHeight) => rectBottom - newHeight,\n maxWidth: canvasWidth - rectLeft,\n maxHeight: rectBottom,\n scaleTo: 'height',\n },\n ml: {\n width: rectRight - x,\n height: rectHeight,\n leftMaker: (newWidth) => rectRight - newWidth,\n topMaker: () => rectTop,\n maxWidth: rectRight,\n maxHeight: canvasHeight - rectTop,\n scaleTo: 'width',\n },\n mr: {\n width: x - rectLeft,\n height: rectHeight,\n leftMaker: () => rectLeft,\n topMaker: () => rectTop,\n maxWidth: canvasWidth - rectLeft,\n maxHeight: canvasHeight - rectTop,\n scaleTo: 'width',\n },\n mb: {\n width: rectWidth,\n height: y - rectTop,\n leftMaker: () => rectLeft,\n topMaker: () => rectTop,\n maxWidth: canvasWidth - rectLeft,\n maxHeight: canvasHeight - rectTop,\n scaleTo: 'height',\n },\n bl: {\n width: rectRight - x,\n height: y - rectTop,\n leftMaker: (newWidth) => rectRight - newWidth,\n topMaker: () => rectTop,\n maxWidth: rectRight,\n maxHeight: canvasHeight - rectTop,\n scaleTo: getScaleBasis(rectLeft - x, y - rectBottom),\n },\n br: {\n width: x - rectLeft,\n height: y - rectTop,\n leftMaker: () => rectLeft,\n topMaker: () => rectTop,\n maxWidth: canvasWidth - rectLeft,\n maxHeight: canvasHeight - rectTop,\n scaleTo: getScaleBasis(x - rectRight, y - rectBottom),\n },\n };\n\n return this.adjustRatioCropzoneSize(resizeInfoMap[corner]);\n },\n\n /**\n * Return the whether this cropzone is valid\n * @returns {boolean}\n */\n isValid() {\n return this.left >= 0 && this.top >= 0 && this.width > 0 && this.height > 0;\n },\n\n /**\n * Keydown event handler\n * @param {{number}} keyCode - Event keyCode\n * @private\n */\n _onKeyDown({ keyCode }) {\n if (keyCode === keyCodes.SHIFT) {\n this._withShiftKey = true;\n }\n },\n\n /**\n * Keyup event handler\n * @param {{number}} keyCode - Event keyCode\n * @private\n */\n _onKeyUp({ keyCode }) {\n if (keyCode === keyCodes.SHIFT) {\n this._withShiftKey = false;\n }\n },\n }\n);\n\nexport default Cropzone;\n","/**\n * @author NHN. FE Development Team \n * @fileoverview Emboss extending fabric.Image.filters.Convolute\n */\nimport fabric from 'fabric';\n\n/**\n * Emboss object\n * @class Emboss\n * @extends {fabric.Image.filters.Convolute}\n * @ignore\n */\nconst Emboss = fabric.util.createClass(\n fabric.Image.filters.Convolute,\n /** @lends Convolute.prototype */ {\n /**\n * Filter type\n * @param {String} type\n * @default\n */\n type: 'Emboss',\n\n /**\n * constructor\n * @override\n */\n initialize() {\n this.matrix = [1, 1, 1, 1, 0.7, -1, -1, -1, -1];\n },\n }\n);\n\nexport default Emboss;\n","/**\n * @author NHN. FE Development Team \n * @fileoverview Mask extending fabric.Image.filters.Mask\n */\nimport fabric from 'fabric';\n\n/**\n * Mask object\n * @class Mask\n * @extends {fabric.Image.filters.BlendImage}\n * @ignore\n */\nconst Mask = fabric.util.createClass(\n fabric.Image.filters.BlendImage,\n /** @lends Mask.prototype */ {\n /**\n * Apply filter to canvas element\n * @param {Object} pipelineState - Canvas element to apply filter\n * @override\n */\n applyTo(pipelineState) {\n if (!this.mask) {\n return;\n }\n\n const canvas = pipelineState.canvasEl;\n const { width, height } = canvas;\n const maskCanvasEl = this._createCanvasOfMask(width, height);\n const ctx = canvas.getContext('2d');\n const maskCtx = maskCanvasEl.getContext('2d');\n const imageData = ctx.getImageData(0, 0, width, height);\n\n this._drawMask(maskCtx, canvas, ctx);\n this._mapData(maskCtx, imageData, width, height);\n\n pipelineState.imageData = imageData;\n },\n\n /**\n * Create canvas of mask image\n * @param {number} width - Width of main canvas\n * @param {number} height - Height of main canvas\n * @returns {HTMLElement} Canvas element\n * @private\n */\n _createCanvasOfMask(width, height) {\n const maskCanvasEl = fabric.util.createCanvasElement();\n\n maskCanvasEl.width = width;\n maskCanvasEl.height = height;\n\n return maskCanvasEl;\n },\n\n /**\n * Draw mask image on canvas element\n * @param {Object} maskCtx - Context of mask canvas\n * @private\n */\n _drawMask(maskCtx) {\n const { mask } = this;\n const maskImg = mask.getElement();\n const { angle, left, scaleX, scaleY, top } = mask;\n\n maskCtx.save();\n maskCtx.translate(left, top);\n maskCtx.rotate((angle * Math.PI) / 180);\n maskCtx.scale(scaleX, scaleY);\n maskCtx.drawImage(maskImg, -maskImg.width / 2, -maskImg.height / 2);\n maskCtx.restore();\n },\n\n /**\n * Map mask image data to source image data\n * @param {Object} maskCtx - Context of mask canvas\n * @param {Object} imageData - Data of source image\n * @param {number} width - Width of main canvas\n * @param {number} height - Height of main canvas\n * @private\n */\n _mapData(maskCtx, imageData, width, height) {\n const { data, height: imgHeight, width: imgWidth } = imageData;\n const sourceData = data;\n const len = imgWidth * imgHeight * 4;\n const maskData = maskCtx.getImageData(0, 0, width, height).data;\n\n for (let i = 0; i < len; i += 4) {\n sourceData[i + 3] = maskData[i]; // adjust value of alpha data\n }\n },\n }\n);\n\nexport default Mask;\n","/**\n * @author NHN. FE Development Team \n * @fileoverview Sharpen extending fabric.Image.filters.Convolute\n */\nimport fabric from 'fabric';\n\n/**\n * Sharpen object\n * @class Sharpen\n * @extends {fabric.Image.filters.Convolute}\n * @ignore\n */\nconst Sharpen = fabric.util.createClass(\n fabric.Image.filters.Convolute,\n /** @lends Convolute.prototype */ {\n /**\n * Filter type\n * @param {String} type\n * @default\n */\n type: 'Sharpen',\n\n /**\n * constructor\n * @override\n */\n initialize() {\n this.matrix = [0, -1, 0, -1, 5, -1, 0, -1, 0];\n },\n }\n);\n\nexport default Sharpen;\n","/**\n * @author NHN. FE Development Team \n * @fileoverview Command factory\n */\nimport Command from '@/interface/command';\n\nconst commands = {};\n\n/**\n * Create a command\n * @param {string} name - Command name\n * @param {...*} args - Arguments for creating command\n * @returns {Command}\n * @ignore\n */\nfunction create(name, ...args) {\n const actions = commands[name];\n if (actions) {\n return new Command(actions, args);\n }\n\n return null;\n}\n\n/**\n * Register a command with name as a key\n * @param {Object} command - {name:{string}, execute: {function}, undo: {function}}\n * @param {string} command.name - command name\n * @param {function} command.execute - executable function\n * @param {function} command.undo - undo function\n * @ignore\n */\nfunction register(command) {\n commands[command.name] = command;\n}\n\nexport default {\n create,\n register,\n};\n","/**\n * @author NHN. FE Development Team \n * @fileoverview Error-message factory\n */\nimport snippet from 'tui-code-snippet';\nimport { keyMirror } from '@/util';\n\nconst types = keyMirror('UN_IMPLEMENTATION', 'NO_COMPONENT_NAME');\nconst messages = {\n UN_IMPLEMENTATION: 'Should implement a method: ',\n NO_COMPONENT_NAME: 'Should set a component name',\n};\nconst map = {\n UN_IMPLEMENTATION(methodName) {\n return messages.UN_IMPLEMENTATION + methodName;\n },\n NO_COMPONENT_NAME() {\n return messages.NO_COMPONENT_NAME;\n },\n};\n\nexport default {\n types: snippet.extend({}, types),\n\n create(type, ...args) {\n type = type.toLowerCase();\n const func = map[type];\n\n return func(...args);\n },\n};\n","/**\n * @author NHN. FE Development Team \n * @fileoverview Graphics module\n */\nimport snippet from 'tui-code-snippet';\nimport fabric from 'fabric';\nimport ImageLoader from '@/component/imageLoader';\nimport Cropper from '@/component/cropper';\nimport Flip from '@/component/flip';\nimport Rotation from '@/component/rotation';\nimport FreeDrawing from '@/component/freeDrawing';\nimport Line from '@/component/line';\nimport Text from '@/component/text';\nimport Icon from '@/component/icon';\nimport Filter from '@/component/filter';\nimport Shape from '@/component/shape';\nimport Zoom from '@/component/zoom';\nimport CropperDrawingMode from '@/drawingMode/cropper';\nimport FreeDrawingMode from '@/drawingMode/freeDrawing';\nimport LineDrawingMode from '@/drawingMode/lineDrawing';\nimport ShapeDrawingMode from '@/drawingMode/shape';\nimport TextDrawingMode from '@/drawingMode/text';\nimport IconDrawingMode from '@/drawingMode/icon';\nimport ZoomDrawingMode from '@/drawingMode/zoom';\nimport {\n makeSelectionUndoData,\n makeSelectionUndoDatum,\n setCachedUndoDataForDimension,\n} from '@/helper/selectionModifyHelper';\nimport { getProperties, includes, isShape, Promise } from '@/util';\nimport {\n componentNames as components,\n eventNames as events,\n drawingModes,\n fObjectOptions,\n} from '@/consts';\n\nconst {\n extend,\n stamp,\n isArray,\n isString,\n forEachArray,\n forEachOwnProperties,\n CustomEvents,\n} = snippet;\nconst DEFAULT_CSS_MAX_WIDTH = 1000;\nconst DEFAULT_CSS_MAX_HEIGHT = 800;\nconst EXTRA_PX_FOR_PASTE = 10;\n\nconst cssOnly = {\n cssOnly: true,\n};\nconst backstoreOnly = {\n backstoreOnly: true,\n};\n\n/**\n * Graphics class\n * @class\n * @param {string|HTMLElement} wrapper - Wrapper's element or selector\n * @param {Object} [option] - Canvas max width & height of css\n * @param {number} option.cssMaxWidth - Canvas css-max-width\n * @param {number} option.cssMaxHeight - Canvas css-max-height\n * @ignore\n */\nclass Graphics {\n constructor(element, { cssMaxWidth, cssMaxHeight } = {}) {\n /**\n * Fabric image instance\n * @type {fabric.Image}\n */\n this.canvasImage = null;\n\n /**\n * Max width of canvas elements\n * @type {number}\n */\n this.cssMaxWidth = cssMaxWidth || DEFAULT_CSS_MAX_WIDTH;\n\n /**\n * Max height of canvas elements\n * @type {number}\n */\n this.cssMaxHeight = cssMaxHeight || DEFAULT_CSS_MAX_HEIGHT;\n\n /**\n * cropper Selection Style\n * @type {Object}\n */\n this.cropSelectionStyle = {};\n\n /**\n * target fabric object for copy paste feature\n * @type {fabric.Object}\n * @private\n */\n this.targetObjectForCopyPaste = null;\n\n /**\n * Image name\n * @type {string}\n */\n this.imageName = '';\n\n /**\n * Object Map\n * @type {Object}\n * @private\n */\n this._objects = {};\n\n /**\n * Fabric-Canvas instance\n * @type {fabric.Canvas}\n * @private\n */\n this._canvas = null;\n\n /**\n * Drawing mode\n * @type {string}\n * @private\n */\n this._drawingMode = drawingModes.NORMAL;\n\n /**\n * DrawingMode map\n * @type {Object.}\n * @private\n */\n this._drawingModeMap = {};\n\n /**\n * Component map\n * @type {Object.}\n * @private\n */\n this._componentMap = {};\n\n /**\n * fabric event handlers\n * @type {Object.}\n * @private\n */\n this._handler = {\n onMouseDown: this._onMouseDown.bind(this),\n onObjectAdded: this._onObjectAdded.bind(this),\n onObjectRemoved: this._onObjectRemoved.bind(this),\n onObjectMoved: this._onObjectMoved.bind(this),\n onObjectScaled: this._onObjectScaled.bind(this),\n onObjectModified: this._onObjectModified.bind(this),\n onObjectRotated: this._onObjectRotated.bind(this),\n onObjectSelected: this._onObjectSelected.bind(this),\n onPathCreated: this._onPathCreated.bind(this),\n onSelectionCleared: this._onSelectionCleared.bind(this),\n onSelectionCreated: this._onSelectionCreated.bind(this),\n };\n\n this._setObjectCachingToFalse();\n this._setCanvasElement(element);\n this._createDrawingModeInstances();\n this._createComponents();\n this._attachCanvasEvents();\n }\n\n /**\n * Destroy canvas element\n */\n destroy() {\n const { wrapperEl } = this._canvas;\n\n this._canvas.clear();\n\n wrapperEl.parentNode.removeChild(wrapperEl);\n }\n\n /**\n * Deactivates all objects on canvas\n * @returns {Graphics} this\n */\n deactivateAll() {\n this._canvas.discardActiveObject();\n\n return this;\n }\n\n /**\n * Renders all objects on canvas\n * @returns {Graphics} this\n */\n renderAll() {\n this._canvas.renderAll();\n\n return this;\n }\n\n /**\n * Adds objects on canvas\n * @param {Object|Array} objects - objects\n */\n add(objects) {\n let theArgs = [];\n if (isArray(objects)) {\n theArgs = objects;\n } else {\n theArgs.push(objects);\n }\n\n this._canvas.add(...theArgs);\n }\n\n /**\n * Removes the object or group\n * @param {Object} target - graphics object or group\n * @returns {boolean} true if contains or false\n */\n contains(target) {\n return this._canvas.contains(target);\n }\n\n /**\n * Gets all objects or group\n * @returns {Array} all objects, shallow copy\n */\n getObjects() {\n return this._canvas.getObjects().slice();\n }\n\n /**\n * Get an object by id\n * @param {number} id - object id\n * @returns {fabric.Object} object corresponding id\n */\n getObject(id) {\n return this._objects[id];\n }\n\n /**\n * Removes the object or group\n * @param {Object} target - graphics object or group\n */\n remove(target) {\n this._canvas.remove(target);\n }\n\n /**\n * Removes all object or group\n * @param {boolean} includesBackground - remove the background image or not\n * @returns {Array} all objects array which is removed\n */\n removeAll(includesBackground) {\n const canvas = this._canvas;\n const objects = canvas.getObjects().slice();\n canvas.remove(...this._canvas.getObjects());\n\n if (includesBackground) {\n canvas.clear();\n }\n\n return objects;\n }\n\n /**\n * Removes an object or group by id\n * @param {number} id - object id\n * @returns {Array} removed objects\n */\n removeObjectById(id) {\n const objects = [];\n const canvas = this._canvas;\n const target = this.getObject(id);\n const isValidGroup = target && target.isType('group') && !target.isEmpty();\n\n if (isValidGroup) {\n canvas.discardActiveObject(); // restore states for each objects\n target.forEachObject((obj) => {\n objects.push(obj);\n canvas.remove(obj);\n });\n } else if (canvas.contains(target)) {\n objects.push(target);\n canvas.remove(target);\n }\n\n return objects;\n }\n\n /**\n * Get an id by object instance\n * @param {fabric.Object} object object\n * @returns {number} object id if it exists or null\n */\n getObjectId(object) {\n let key = null;\n for (key in this._objects) {\n if (this._objects.hasOwnProperty(key)) {\n if (object === this._objects[key]) {\n return key;\n }\n }\n }\n\n return null;\n }\n\n /**\n * Gets an active object or group\n * @returns {Object} active object or group instance\n */\n getActiveObject() {\n return this._canvas._activeObject;\n }\n\n /**\n * Returns the object ID to delete the object.\n * @returns {number} object id for remove\n */\n getActiveObjectIdForRemove() {\n const activeObject = this.getActiveObject();\n const { type, left, top } = activeObject;\n const isSelection = type === 'activeSelection';\n\n if (isSelection) {\n const group = new fabric.Group([...activeObject.getObjects()], {\n left,\n top,\n });\n\n return this._addFabricObject(group);\n }\n\n return this.getObjectId(activeObject);\n }\n\n /**\n * Verify that you are ready to erase the object.\n * @returns {boolean} ready for object remove\n */\n isReadyRemoveObject() {\n const activeObject = this.getActiveObject();\n\n return activeObject && !activeObject.isEditing;\n }\n\n /**\n * Gets an active group object\n * @returns {Object} active group object instance\n */\n getActiveObjects() {\n const activeObject = this._canvas._activeObject;\n\n return activeObject && activeObject.type === 'activeSelection' ? activeObject : null;\n }\n\n /**\n * Get Active object Selection from object ids\n * @param {Array.} objects - fabric objects\n * @returns {Object} target - target object group\n */\n getActiveSelectionFromObjects(objects) {\n const canvas = this.getCanvas();\n\n return new fabric.ActiveSelection(objects, { canvas });\n }\n\n /**\n * Activates an object or group\n * @param {Object} target - target object or group\n */\n setActiveObject(target) {\n this._canvas.setActiveObject(target);\n }\n\n /**\n * Set Crop selection style\n * @param {Object} style - Selection styles\n */\n setCropSelectionStyle(style) {\n this.cropSelectionStyle = style;\n }\n\n /**\n * Get component\n * @param {string} name - Component name\n * @returns {Component}\n */\n getComponent(name) {\n return this._componentMap[name];\n }\n\n /**\n * Get current drawing mode\n * @returns {string}\n */\n getDrawingMode() {\n return this._drawingMode;\n }\n\n /**\n * Start a drawing mode. If the current mode is not 'NORMAL', 'stopDrawingMode()' will be called first.\n * @param {String} mode Can be one of 'CROPPER', 'FREE_DRAWING', 'LINE', 'TEXT', 'SHAPE'\n * @param {Object} [option] parameters of drawing mode, it's available with 'FREE_DRAWING', 'LINE_DRAWING'\n * @param {Number} [option.width] brush width\n * @param {String} [option.color] brush color\n * @returns {boolean} true if success or false\n */\n startDrawingMode(mode, option) {\n if (this._isSameDrawingMode(mode)) {\n return true;\n }\n\n // If the current mode is not 'NORMAL', 'stopDrawingMode()' will be called first.\n this.stopDrawingMode();\n\n const drawingModeInstance = this._getDrawingModeInstance(mode);\n if (drawingModeInstance && drawingModeInstance.start) {\n drawingModeInstance.start(this, option);\n\n this._drawingMode = mode;\n }\n\n return !!drawingModeInstance;\n }\n\n /**\n * Stop the current drawing mode and back to the 'NORMAL' mode\n */\n stopDrawingMode() {\n if (this._isSameDrawingMode(drawingModes.NORMAL)) {\n return;\n }\n\n const drawingModeInstance = this._getDrawingModeInstance(this.getDrawingMode());\n if (drawingModeInstance && drawingModeInstance.end) {\n drawingModeInstance.end(this);\n }\n this._drawingMode = drawingModes.NORMAL;\n }\n\n /**\n * Change zoom of canvas\n * @param {{x: number, y: number}} center - center of zoom\n * @param {number} zoomLevel - zoom level\n */\n zoom({ x, y }, zoomLevel) {\n const zoom = this.getComponent(components.ZOOM);\n\n zoom.zoom({ x, y }, zoomLevel);\n }\n\n /**\n * Get zoom mode\n * @returns {string}\n */\n getZoomMode() {\n const zoom = this.getComponent(components.ZOOM);\n\n return zoom.mode;\n }\n\n /**\n * Start zoom-in mode\n */\n startZoomInMode() {\n const zoom = this.getComponent(components.ZOOM);\n\n zoom.startZoomInMode();\n }\n\n /**\n * Stop zoom-in mode\n */\n endZoomInMode() {\n const zoom = this.getComponent(components.ZOOM);\n\n zoom.endZoomInMode();\n }\n\n /**\n * Zoom out one step\n */\n zoomOut() {\n const zoom = this.getComponent(components.ZOOM);\n\n zoom.zoomOut();\n }\n\n /**\n * Start hand mode\n */\n startHandMode() {\n const zoom = this.getComponent(components.ZOOM);\n\n zoom.startHandMode();\n }\n\n /**\n * Stop hand mode\n */\n endHandMode() {\n const zoom = this.getComponent(components.ZOOM);\n\n zoom.endHandMode();\n }\n\n /**\n * Zoom reset\n */\n resetZoom() {\n const zoom = this.getComponent(components.ZOOM);\n\n zoom.resetZoom();\n }\n\n /**\n * To data url from canvas\n * @param {Object} options - options for toDataURL\n * @param {String} [options.format=png] The format of the output image. Either \"jpeg\" or \"png\"\n * @param {Number} [options.quality=1] Quality level (0..1). Only used for jpeg.\n * @param {Number} [options.multiplier=1] Multiplier to scale by\n * @param {Number} [options.left] Cropping left offset. Introduced in fabric v1.2.14\n * @param {Number} [options.top] Cropping top offset. Introduced in fabric v1.2.14\n * @param {Number} [options.width] Cropping width. Introduced in fabric v1.2.14\n * @param {Number} [options.height] Cropping height. Introduced in fabric v1.2.14\n * @returns {string} A DOMString containing the requested data URI.\n */\n toDataURL(options) {\n const cropper = this.getComponent(components.CROPPER);\n cropper.changeVisibility(false);\n\n const dataUrl = this._canvas && this._canvas.toDataURL(options);\n cropper.changeVisibility(true);\n\n return dataUrl;\n }\n\n /**\n * Save image(background) of canvas\n * @param {string} name - Name of image\n * @param {?fabric.Image} canvasImage - Fabric image instance\n */\n setCanvasImage(name, canvasImage) {\n if (canvasImage) {\n stamp(canvasImage);\n }\n this.imageName = name;\n this.canvasImage = canvasImage;\n }\n\n /**\n * Set css max dimension\n * @param {{width: number, height: number}} maxDimension - Max width & Max height\n */\n setCssMaxDimension(maxDimension) {\n this.cssMaxWidth = maxDimension.width || this.cssMaxWidth;\n this.cssMaxHeight = maxDimension.height || this.cssMaxHeight;\n }\n\n /**\n * Adjust canvas dimension with scaling image\n */\n adjustCanvasDimension() {\n const canvasImage = this.canvasImage.scale(1);\n const { width, height } = canvasImage.getBoundingRect();\n const maxDimension = this._calcMaxDimension(width, height);\n\n this.setCanvasCssDimension({\n width: '100%',\n height: '100%', // Set height '' for IE9\n 'max-width': `${maxDimension.width}px`,\n 'max-height': `${maxDimension.height}px`,\n });\n\n this.setCanvasBackstoreDimension({\n width,\n height,\n });\n this._canvas.centerObject(canvasImage);\n }\n\n /**\n * Set canvas dimension - css only\n * {@link http://fabricjs.com/docs/fabric.Canvas.html#setDimensions}\n * @param {Object} dimension - Canvas css dimension\n */\n setCanvasCssDimension(dimension) {\n this._canvas.setDimensions(dimension, cssOnly);\n }\n\n /**\n * Set canvas dimension - backstore only\n * {@link http://fabricjs.com/docs/fabric.Canvas.html#setDimensions}\n * @param {Object} dimension - Canvas backstore dimension\n */\n setCanvasBackstoreDimension(dimension) {\n this._canvas.setDimensions(dimension, backstoreOnly);\n }\n\n /**\n * Set image properties\n * {@link http://fabricjs.com/docs/fabric.Image.html#set}\n * @param {Object} setting - Image properties\n * @param {boolean} [withRendering] - If true, The changed image will be reflected in the canvas\n */\n setImageProperties(setting, withRendering) {\n const { canvasImage } = this;\n\n if (!canvasImage) {\n return;\n }\n\n canvasImage.set(setting).setCoords();\n if (withRendering) {\n this._canvas.renderAll();\n }\n }\n\n /**\n * Returns canvas element of fabric.Canvas[[lower-canvas]]\n * @returns {HTMLCanvasElement}\n */\n getCanvasElement() {\n return this._canvas.getElement();\n }\n\n /**\n * Get fabric.Canvas instance\n * @returns {fabric.Canvas}\n */\n getCanvas() {\n return this._canvas;\n }\n\n /**\n * Get canvasImage (fabric.Image instance)\n * @returns {fabric.Image}\n */\n getCanvasImage() {\n return this.canvasImage;\n }\n\n /**\n * Get image name\n * @returns {string}\n */\n getImageName() {\n return this.imageName;\n }\n\n /**\n * Add image object on canvas\n * @param {string} imgUrl - Image url to make object\n * @returns {Promise}\n */\n addImageObject(imgUrl) {\n const callback = this._callbackAfterLoadingImageObject.bind(this);\n\n return new Promise((resolve) => {\n fabric.Image.fromURL(\n imgUrl,\n (image) => {\n callback(image);\n resolve(this.createObjectProperties(image));\n },\n {\n crossOrigin: 'Anonymous',\n }\n );\n });\n }\n\n /**\n * Get center position of canvas\n * @returns {Object} {left, top}\n */\n getCenter() {\n return this._canvas.getCenter();\n }\n\n /**\n * Get cropped rect\n * @returns {Object} rect\n */\n getCropzoneRect() {\n return this.getComponent(components.CROPPER).getCropzoneRect();\n }\n\n /**\n * Get cropped rect\n * @param {number} [mode] cropzone rect mode\n */\n setCropzoneRect(mode) {\n this.getComponent(components.CROPPER).setCropzoneRect(mode);\n }\n\n /**\n * Get cropped image data\n * @param {Object} cropRect cropzone rect\n * @param {Number} cropRect.left left position\n * @param {Number} cropRect.top top position\n * @param {Number} cropRect.width width\n * @param {Number} cropRect.height height\n * @returns {?{imageName: string, url: string}} cropped Image data\n */\n getCroppedImageData(cropRect) {\n return this.getComponent(components.CROPPER).getCroppedImageData(cropRect);\n }\n\n /**\n * Set brush option\n * @param {Object} option brush option\n * @param {Number} option.width width\n * @param {String} option.color color like 'FFFFFF', 'rgba(0, 0, 0, 0.5)'\n */\n setBrush(option) {\n const drawingMode = this._drawingMode;\n let compName = components.FREE_DRAWING;\n\n if (drawingMode === drawingModes.LINE_DRAWING) {\n compName = components.LINE;\n }\n\n this.getComponent(compName).setBrush(option);\n }\n\n /**\n * Set states of current drawing shape\n * @param {string} type - Shape type (ex: 'rect', 'circle', 'triangle')\n * @param {Object} [options] - Shape options\n * @param {(ShapeFillOption | string)} [options.fill] - {@link ShapeFillOption} or\n * Shape foreground color (ex: '#fff', 'transparent')\n * @param {string} [options.stoke] - Shape outline color\n * @param {number} [options.strokeWidth] - Shape outline width\n * @param {number} [options.width] - Width value (When type option is 'rect', this options can use)\n * @param {number} [options.height] - Height value (When type option is 'rect', this options can use)\n * @param {number} [options.rx] - Radius x value (When type option is 'circle', this options can use)\n * @param {number} [options.ry] - Radius y value (When type option is 'circle', this options can use)\n * @param {number} [options.isRegular] - Whether resizing shape has 1:1 ratio or not\n */\n setDrawingShape(type, options) {\n this.getComponent(components.SHAPE).setStates(type, options);\n }\n\n /**\n * Set style of current drawing icon\n * @param {string} type - icon type (ex: 'icon-arrow', 'icon-star')\n * @param {Object} [iconColor] - Icon color\n */\n setIconStyle(type, iconColor) {\n this.getComponent(components.ICON).setStates(type, iconColor);\n }\n\n /**\n * Register icon paths\n * @param {Object} pathInfos - Path infos\n * @param {string} pathInfos.key - key\n * @param {string} pathInfos.value - value\n */\n registerPaths(pathInfos) {\n this.getComponent(components.ICON).registerPaths(pathInfos);\n }\n\n /**\n * Change cursor style\n * @param {string} cursorType - cursor type\n */\n changeCursor(cursorType) {\n const canvas = this.getCanvas();\n canvas.defaultCursor = cursorType;\n canvas.renderAll();\n }\n\n /**\n * Whether it has the filter or not\n * @param {string} type - Filter type\n * @returns {boolean} true if it has the filter\n */\n hasFilter(type) {\n return this.getComponent(components.FILTER).hasFilter(type);\n }\n\n /**\n * Set selection style of fabric object by init option\n * @param {Object} styles - Selection styles\n */\n setSelectionStyle(styles) {\n extend(fObjectOptions.SELECTION_STYLE, styles);\n }\n\n /**\n * Set object properties\n * @param {number} id - object id\n * @param {Object} props - props\n * @param {string} [props.fill] Color\n * @param {string} [props.fontFamily] Font type for text\n * @param {number} [props.fontSize] Size\n * @param {string} [props.fontStyle] Type of inclination (normal / italic)\n * @param {string} [props.fontWeight] Type of thicker or thinner looking (normal / bold)\n * @param {string} [props.textAlign] Type of text align (left / center / right)\n * @param {string} [props.textDecoration] Type of line (underline / line-through / overline)\n * @returns {Object} applied properties\n */\n setObjectProperties(id, props) {\n const object = this.getObject(id);\n const clone = extend({}, props);\n\n object.set(clone);\n\n object.setCoords();\n\n this.getCanvas().renderAll();\n\n return clone;\n }\n\n /**\n * Get object properties corresponding key\n * @param {number} id - object id\n * @param {Array|ObjectProps|string} keys - property's key\n * @returns {Object} properties\n */\n getObjectProperties(id, keys) {\n const object = this.getObject(id);\n const props = {};\n\n if (isString(keys)) {\n props[keys] = object[keys];\n } else if (isArray(keys)) {\n forEachArray(keys, (value) => {\n props[value] = object[value];\n });\n } else {\n forEachOwnProperties(keys, (value, key) => {\n props[key] = object[key];\n });\n }\n\n return props;\n }\n\n /**\n * Get object position by originX, originY\n * @param {number} id - object id\n * @param {string} originX - can be 'left', 'center', 'right'\n * @param {string} originY - can be 'top', 'center', 'bottom'\n * @returns {Object} {{x:number, y: number}} position by origin if id is valid, or null\n */\n getObjectPosition(id, originX, originY) {\n const targetObj = this.getObject(id);\n if (!targetObj) {\n return null;\n }\n\n return targetObj.getPointByOrigin(originX, originY);\n }\n\n /**\n * Set object position by originX, originY\n * @param {number} id - object id\n * @param {Object} posInfo - position object\n * @param {number} posInfo.x - x position\n * @param {number} posInfo.y - y position\n * @param {string} posInfo.originX - can be 'left', 'center', 'right'\n * @param {string} posInfo.originY - can be 'top', 'center', 'bottom'\n * @returns {boolean} true if target id is valid or false\n */\n setObjectPosition(id, posInfo) {\n const targetObj = this.getObject(id);\n const { x, y, originX, originY } = posInfo;\n if (!targetObj) {\n return false;\n }\n\n const targetOrigin = targetObj.getPointByOrigin(originX, originY);\n const centerOrigin = targetObj.getPointByOrigin('center', 'center');\n const diffX = centerOrigin.x - targetOrigin.x;\n const diffY = centerOrigin.y - targetOrigin.y;\n\n targetObj.set({\n left: x + diffX,\n top: y + diffY,\n });\n\n targetObj.setCoords();\n\n return true;\n }\n\n /**\n * Get the canvas size\n * @returns {Object} {{width: number, height: number}} image size\n */\n getCanvasSize() {\n const image = this.getCanvasImage();\n\n return {\n width: image ? image.width : 0,\n height: image ? image.height : 0,\n };\n }\n\n /**\n * Create fabric static canvas\n * @returns {Object} {{width: number, height: number}} image size\n */\n createStaticCanvas() {\n const staticCanvas = new fabric.StaticCanvas();\n\n staticCanvas.set({\n enableRetinaScaling: false,\n });\n\n return staticCanvas;\n }\n\n /**\n * Get a DrawingMode instance\n * @param {string} modeName - DrawingMode Class Name\n * @returns {DrawingMode} DrawingMode instance\n * @private\n */\n _getDrawingModeInstance(modeName) {\n return this._drawingModeMap[modeName];\n }\n\n /**\n * Set object caching to false. This brought many bugs when draw Shape & cropzone\n * @see http://fabricjs.com/fabric-object-caching\n * @private\n */\n _setObjectCachingToFalse() {\n fabric.Object.prototype.objectCaching = false;\n }\n\n /**\n * Set canvas element to fabric.Canvas\n * @param {Element|string} element - Wrapper or canvas element or selector\n * @private\n */\n _setCanvasElement(element) {\n let selectedElement;\n let canvasElement;\n\n if (element.nodeType) {\n selectedElement = element;\n } else {\n selectedElement = document.querySelector(element);\n }\n\n if (selectedElement.nodeName.toUpperCase() !== 'CANVAS') {\n canvasElement = document.createElement('canvas');\n selectedElement.appendChild(canvasElement);\n }\n\n this._canvas = new fabric.Canvas(canvasElement, {\n containerClass: 'tui-image-editor-canvas-container',\n enableRetinaScaling: false,\n });\n }\n\n /**\n * Creates DrawingMode instances\n * @private\n */\n _createDrawingModeInstances() {\n this._register(this._drawingModeMap, new CropperDrawingMode());\n this._register(this._drawingModeMap, new FreeDrawingMode());\n this._register(this._drawingModeMap, new LineDrawingMode());\n this._register(this._drawingModeMap, new ShapeDrawingMode());\n this._register(this._drawingModeMap, new TextDrawingMode());\n this._register(this._drawingModeMap, new IconDrawingMode());\n this._register(this._drawingModeMap, new ZoomDrawingMode());\n }\n\n /**\n * Create components\n * @private\n */\n _createComponents() {\n this._register(this._componentMap, new ImageLoader(this));\n this._register(this._componentMap, new Cropper(this));\n this._register(this._componentMap, new Flip(this));\n this._register(this._componentMap, new Rotation(this));\n this._register(this._componentMap, new FreeDrawing(this));\n this._register(this._componentMap, new Line(this));\n this._register(this._componentMap, new Text(this));\n this._register(this._componentMap, new Icon(this));\n this._register(this._componentMap, new Filter(this));\n this._register(this._componentMap, new Shape(this));\n this._register(this._componentMap, new Zoom(this));\n }\n\n /**\n * Register component\n * @param {Object} map - map object\n * @param {Object} module - module which has getName method\n * @private\n */\n _register(map, module) {\n map[module.getName()] = module;\n }\n\n /**\n * Get the current drawing mode is same with given mode\n * @param {string} mode drawing mode\n * @returns {boolean} true if same or false\n */\n _isSameDrawingMode(mode) {\n return this.getDrawingMode() === mode;\n }\n\n /**\n * Calculate max dimension of canvas\n * The css-max dimension is dynamically decided with maintaining image ratio\n * The css-max dimension is lower than canvas dimension (attribute of canvas, not css)\n * @param {number} width - Canvas width\n * @param {number} height - Canvas height\n * @returns {{width: number, height: number}} - Max width & Max height\n * @private\n */\n _calcMaxDimension(width, height) {\n const wScaleFactor = this.cssMaxWidth / width;\n const hScaleFactor = this.cssMaxHeight / height;\n let cssMaxWidth = Math.min(width, this.cssMaxWidth);\n let cssMaxHeight = Math.min(height, this.cssMaxHeight);\n\n if (wScaleFactor < 1 && wScaleFactor < hScaleFactor) {\n cssMaxWidth = width * wScaleFactor;\n cssMaxHeight = height * wScaleFactor;\n } else if (hScaleFactor < 1 && hScaleFactor < wScaleFactor) {\n cssMaxWidth = width * hScaleFactor;\n cssMaxHeight = height * hScaleFactor;\n }\n\n return {\n width: Math.floor(cssMaxWidth),\n height: Math.floor(cssMaxHeight),\n };\n }\n\n /**\n * Callback function after loading image\n * @param {fabric.Image} obj - Fabric image object\n * @private\n */\n _callbackAfterLoadingImageObject(obj) {\n const centerPos = this.getCanvasImage().getCenterPoint();\n\n obj.set(fObjectOptions.SELECTION_STYLE);\n obj.set({\n left: centerPos.x,\n top: centerPos.y,\n crossOrigin: 'Anonymous',\n });\n\n this.getCanvas().add(obj).setActiveObject(obj);\n }\n\n /**\n * Attach canvas's events\n */\n _attachCanvasEvents() {\n const canvas = this._canvas;\n const handler = this._handler;\n canvas.on({\n 'mouse:down': handler.onMouseDown,\n 'object:added': handler.onObjectAdded,\n 'object:removed': handler.onObjectRemoved,\n 'object:moving': handler.onObjectMoved,\n 'object:scaling': handler.onObjectScaled,\n 'object:modified': handler.onObjectModified,\n 'object:rotating': handler.onObjectRotated,\n 'path:created': handler.onPathCreated,\n 'selection:cleared': handler.onSelectionCleared,\n 'selection:created': handler.onSelectionCreated,\n 'selection:updated': handler.onObjectSelected,\n });\n }\n\n /**\n * \"mouse:down\" canvas event handler\n * @param {{target: fabric.Object, e: MouseEvent}} fEvent - Fabric event\n * @private\n */\n _onMouseDown(fEvent) {\n const { e: event, target } = fEvent;\n const originPointer = this._canvas.getPointer(event);\n\n if (target) {\n const { type } = target;\n const undoData = makeSelectionUndoData(target, (item) =>\n makeSelectionUndoDatum(this.getObjectId(item), item, type === 'activeSelection')\n );\n\n setCachedUndoDataForDimension(undoData);\n }\n\n this.fire(events.MOUSE_DOWN, event, originPointer);\n }\n\n /**\n * \"object:added\" canvas event handler\n * @param {{target: fabric.Object, e: MouseEvent}} fEvent - Fabric event\n * @private\n */\n _onObjectAdded(fEvent) {\n const obj = fEvent.target;\n if (obj.isType('cropzone')) {\n return;\n }\n\n this._addFabricObject(obj);\n }\n\n /**\n * \"object:removed\" canvas event handler\n * @param {{target: fabric.Object, e: MouseEvent}} fEvent - Fabric event\n * @private\n */\n _onObjectRemoved(fEvent) {\n const obj = fEvent.target;\n\n this._removeFabricObject(stamp(obj));\n }\n\n /**\n * \"object:moving\" canvas event handler\n * @param {{target: fabric.Object, e: MouseEvent}} fEvent - Fabric event\n * @private\n */\n _onObjectMoved(fEvent) {\n this._lazyFire(\n events.OBJECT_MOVED,\n (object) => this.createObjectProperties(object),\n fEvent.target\n );\n }\n\n /**\n * \"object:scaling\" canvas event handler\n * @param {{target: fabric.Object, e: MouseEvent}} fEvent - Fabric event\n * @private\n */\n _onObjectScaled(fEvent) {\n this._lazyFire(\n events.OBJECT_SCALED,\n (object) => this.createObjectProperties(object),\n fEvent.target\n );\n }\n\n /**\n * \"object:modified\" canvas event handler\n * @param {{target: fabric.Object, e: MouseEvent}} fEvent - Fabric event\n * @private\n */\n _onObjectModified(fEvent) {\n const { target } = fEvent;\n if (target.type === 'activeSelection') {\n const items = target.getObjects();\n\n items.forEach((item) => item.fire('modifiedInGroup', target));\n }\n\n this.fire(events.OBJECT_MODIFIED, target, this.getObjectId(target));\n }\n\n /**\n * \"object:rotating\" canvas event handler\n * @param {{target: fabric.Object, e: MouseEvent}} fEvent - Fabric event\n * @private\n */\n _onObjectRotated(fEvent) {\n this._lazyFire(\n events.OBJECT_ROTATED,\n (object) => this.createObjectProperties(object),\n fEvent.target\n );\n }\n\n /**\n * Lazy event emitter\n * @param {string} eventName - event name\n * @param {Function} paramsMaker - make param function\n * @param {Object} [target] - Object of the event owner.\n * @private\n */\n _lazyFire(eventName, paramsMaker, target) {\n const existEventDelegation = target && target.canvasEventDelegation;\n const delegationState = existEventDelegation ? target.canvasEventDelegation(eventName) : 'none';\n\n if (delegationState === 'unregistered') {\n target.canvasEventRegister(eventName, (object) => {\n this.fire(eventName, paramsMaker(object));\n });\n }\n\n if (delegationState === 'none') {\n this.fire(eventName, paramsMaker(target));\n }\n }\n\n /**\n * \"object:selected\" canvas event handler\n * @param {{target: fabric.Object, e: MouseEvent}} fEvent - Fabric event\n * @private\n */\n _onObjectSelected(fEvent) {\n const { target } = fEvent;\n const params = this.createObjectProperties(target);\n\n this.fire(events.OBJECT_ACTIVATED, params);\n }\n\n /**\n * \"path:created\" canvas event handler\n * @param {{path: fabric.Path}} obj - Path object\n * @private\n */\n _onPathCreated(obj) {\n const { x: left, y: top } = obj.path.getCenterPoint();\n obj.path.set(\n extend(\n {\n left,\n top,\n },\n fObjectOptions.SELECTION_STYLE\n )\n );\n\n const params = this.createObjectProperties(obj.path);\n\n this.fire(events.ADD_OBJECT, params);\n }\n\n /**\n * \"selction:cleared\" canvas event handler\n * @private\n */\n _onSelectionCleared() {\n this.fire(events.SELECTION_CLEARED);\n }\n\n /**\n * \"selction:created\" canvas event handler\n * @param {{target: fabric.Object, e: MouseEvent}} fEvent - Fabric event\n * @private\n */\n _onSelectionCreated(fEvent) {\n const { target } = fEvent;\n const params = this.createObjectProperties(target);\n\n this.fire(events.OBJECT_ACTIVATED, params);\n this.fire(events.SELECTION_CREATED, fEvent.target);\n }\n\n /**\n * Canvas discard selection all\n */\n discardSelection() {\n this._canvas.discardActiveObject();\n this._canvas.renderAll();\n }\n\n /**\n * Canvas Selectable status change\n * @param {boolean} selectable - expect status\n */\n changeSelectableAll(selectable) {\n this._canvas.forEachObject((obj) => {\n obj.selectable = selectable;\n obj.hoverCursor = selectable ? 'move' : 'crosshair';\n });\n }\n\n /**\n * Return object's properties\n * @param {fabric.Object} obj - fabric object\n * @returns {Object} properties object\n */\n createObjectProperties(obj) {\n const predefinedKeys = [\n 'left',\n 'top',\n 'width',\n 'height',\n 'fill',\n 'stroke',\n 'strokeWidth',\n 'opacity',\n 'angle',\n ];\n const props = {\n id: stamp(obj),\n type: obj.type,\n };\n\n extend(props, getProperties(obj, predefinedKeys));\n\n if (includes(['i-text', 'text'], obj.type)) {\n extend(props, this._createTextProperties(obj, props));\n } else if (includes(['rect', 'triangle', 'circle'], obj.type)) {\n const shapeComp = this.getComponent(components.SHAPE);\n extend(props, {\n fill: shapeComp.makeFillPropertyForUserEvent(obj),\n });\n }\n\n return props;\n }\n\n /**\n * Get text object's properties\n * @param {fabric.Object} obj - fabric text object\n * @param {Object} props - properties\n * @returns {Object} properties object\n */\n _createTextProperties(obj) {\n const predefinedKeys = [\n 'text',\n 'fontFamily',\n 'fontSize',\n 'fontStyle',\n 'textAlign',\n 'textDecoration',\n 'fontWeight',\n ];\n const props = {};\n extend(props, getProperties(obj, predefinedKeys));\n\n return props;\n }\n\n /**\n * Add object array by id\n * @param {fabric.Object} obj - fabric object\n * @returns {number} object id\n */\n _addFabricObject(obj) {\n const id = stamp(obj);\n this._objects[id] = obj;\n\n return id;\n }\n\n /**\n * Remove an object in array yb id\n * @param {number} id - object id\n */\n _removeFabricObject(id) {\n delete this._objects[id];\n }\n\n /**\n * Reset targetObjectForCopyPaste value from activeObject\n */\n resetTargetObjectForCopyPaste() {\n const activeObject = this.getActiveObject();\n\n if (activeObject) {\n this.targetObjectForCopyPaste = activeObject;\n }\n }\n\n /**\n * Paste fabric object\n * @returns {Promise}\n */\n pasteObject() {\n if (!this.targetObjectForCopyPaste) {\n return Promise.resolve([]);\n }\n\n const targetObject = this.targetObjectForCopyPaste;\n const isGroupSelect = targetObject.type === 'activeSelection';\n const targetObjects = isGroupSelect ? targetObject.getObjects() : [targetObject];\n let newTargetObject = null;\n\n this.discardSelection();\n\n return this._cloneObject(targetObjects).then((addedObjects) => {\n if (addedObjects.length > 1) {\n newTargetObject = this.getActiveSelectionFromObjects(addedObjects);\n } else {\n [newTargetObject] = addedObjects;\n }\n this.targetObjectForCopyPaste = newTargetObject;\n this.setActiveObject(newTargetObject);\n });\n }\n\n /**\n * Clone object\n * @param {fabric.Object} targetObjects - fabric object\n * @returns {Promise}\n * @private\n */\n _cloneObject(targetObjects) {\n const addedObjects = snippet.map(targetObjects, (targetObject) =>\n this._cloneObjectItem(targetObject)\n );\n\n return Promise.all(addedObjects);\n }\n\n /**\n * Clone object one item\n * @param {fabric.Object} targetObject - fabric object\n * @returns {Promise}\n * @private\n */\n _cloneObjectItem(targetObject) {\n return this._copyFabricObjectForPaste(targetObject).then((clonedObject) => {\n const objectProperties = this.createObjectProperties(clonedObject);\n this.add(clonedObject);\n\n this.fire(events.ADD_OBJECT, objectProperties);\n\n return clonedObject;\n });\n }\n\n /**\n * Copy fabric object with Changed position for copy and paste\n * @param {fabric.Object} targetObject - fabric object\n * @returns {Promise}\n * @private\n */\n _copyFabricObjectForPaste(targetObject) {\n const addExtraPx = (value, isReverse) =>\n isReverse ? value - EXTRA_PX_FOR_PASTE : value + EXTRA_PX_FOR_PASTE;\n\n return this._copyFabricObject(targetObject).then((clonedObject) => {\n const { left, top, width, height } = clonedObject;\n const { width: canvasWidth, height: canvasHeight } = this.getCanvasSize();\n const rightEdge = left + width / 2;\n const bottomEdge = top + height / 2;\n\n clonedObject.set(\n snippet.extend(\n {\n left: addExtraPx(left, rightEdge + EXTRA_PX_FOR_PASTE > canvasWidth),\n top: addExtraPx(top, bottomEdge + EXTRA_PX_FOR_PASTE > canvasHeight),\n },\n fObjectOptions.SELECTION_STYLE\n )\n );\n\n return clonedObject;\n });\n }\n\n /**\n * Copy fabric object\n * @param {fabric.Object} targetObject - fabric object\n * @returns {Promise}\n * @private\n */\n _copyFabricObject(targetObject) {\n return new Promise((resolve) => {\n targetObject.clone((cloned) => {\n const shapeComp = this.getComponent(components.SHAPE);\n if (isShape(cloned)) {\n shapeComp.processForCopiedObject(cloned, targetObject);\n }\n\n resolve(cloned);\n });\n });\n }\n}\n\nCustomEvents.mixin(Graphics);\n\nexport default Graphics;\n","/*\n imagetracer.js version 1.2.4\n Simple raster image tracer and vectorizer written in JavaScript.\n andras@jankovics.net\n*/\n\n/*\n The Unlicense / PUBLIC DOMAIN\n This is free and unencumbered software released into the public domain.\n Anyone is free to copy, modify, publish, use, compile, sell, or\n distribute this software, either in source code form or as a compiled\n binary, for any purpose, commercial or non-commercial, and by any\n means.\n In jurisdictions that recognize copyright laws, the author or authors\n of this software dedicate any and all copyright interest in the\n software to the public domain. We make this dedication for the benefit\n of the public at large and to the detriment of our heirs and\n successors. We intend this dedication to be an overt act of\n relinquishment in perpetuity of all present and future rights to this\n software under copyright law.\n THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\n EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\n MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.\n IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR\n OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,\n ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR\n OTHER DEALINGS IN THE SOFTWARE.\n For more information, please refer to http://unlicense.org/\n*/\nexport default class ImageTracer {\n static tracerDefaultOption() {\n return {\n pathomit: 100,\n ltres: 0.1,\n qtres: 1,\n\n scale: 1,\n strokewidth: 5,\n viewbox: false,\n linefilter: true,\n desc: false,\n rightangleenhance: false,\n pal: [\n {\n r: 0,\n g: 0,\n b: 0,\n a: 255,\n },\n {\n r: 255,\n g: 255,\n b: 255,\n a: 255,\n },\n ],\n };\n }\n /* eslint-disable */\n constructor() {\n this.versionnumber = '1.2.4';\n this.optionpresets = {\n default: {\n corsenabled: false,\n ltres: 1,\n qtres: 1,\n pathomit: 8,\n rightangleenhance: true,\n colorsampling: 2,\n numberofcolors: 16,\n mincolorratio: 0,\n colorquantcycles: 3,\n layering: 0,\n strokewidth: 1,\n linefilter: false,\n scale: 1,\n roundcoords: 1,\n viewbox: false,\n desc: false,\n lcpr: 0,\n qcpr: 0,\n blurradius: 0,\n blurdelta: 20,\n },\n posterized1: {\n colorsampling: 0,\n numberofcolors: 2,\n },\n posterized2: {\n numberofcolors: 4,\n blurradius: 5,\n },\n curvy: {\n ltres: 0.01,\n linefilter: true,\n rightangleenhance: false,\n },\n sharp: { qtres: 0.01, linefilter: false },\n detailed: { pathomit: 0, roundcoords: 2, ltres: 0.5, qtres: 0.5, numberofcolors: 64 },\n smoothed: { blurradius: 5, blurdelta: 64 },\n grayscale: { colorsampling: 0, colorquantcycles: 1, numberofcolors: 7 },\n fixedpalette: { colorsampling: 0, colorquantcycles: 1, numberofcolors: 27 },\n randomsampling1: { colorsampling: 1, numberofcolors: 8 },\n randomsampling2: { colorsampling: 1, numberofcolors: 64 },\n artistic1: {\n colorsampling: 0,\n colorquantcycles: 1,\n pathomit: 0,\n blurradius: 5,\n blurdelta: 64,\n ltres: 0.01,\n linefilter: true,\n numberofcolors: 16,\n strokewidth: 2,\n },\n artistic2: {\n qtres: 0.01,\n colorsampling: 0,\n colorquantcycles: 1,\n numberofcolors: 4,\n strokewidth: 0,\n },\n artistic3: { qtres: 10, ltres: 10, numberofcolors: 8 },\n artistic4: {\n qtres: 10,\n ltres: 10,\n numberofcolors: 64,\n blurradius: 5,\n blurdelta: 256,\n strokewidth: 2,\n },\n posterized3: {\n ltres: 1,\n qtres: 1,\n pathomit: 20,\n rightangleenhance: true,\n colorsampling: 0,\n numberofcolors: 3,\n mincolorratio: 0,\n colorquantcycles: 3,\n blurradius: 3,\n blurdelta: 20,\n strokewidth: 0,\n linefilter: false,\n roundcoords: 1,\n pal: [\n { r: 0, g: 0, b: 100, a: 255 },\n { r: 255, g: 255, b: 255, a: 255 },\n ],\n },\n };\n\n this.pathscan_combined_lookup = [\n [\n [-1, -1, -1, -1],\n [-1, -1, -1, -1],\n [-1, -1, -1, -1],\n [-1, -1, -1, -1],\n ],\n [\n [0, 1, 0, -1],\n [-1, -1, -1, -1],\n [-1, -1, -1, -1],\n [0, 2, -1, 0],\n ],\n [\n [-1, -1, -1, -1],\n [-1, -1, -1, -1],\n [0, 1, 0, -1],\n [0, 0, 1, 0],\n ],\n [\n [0, 0, 1, 0],\n [-1, -1, -1, -1],\n [0, 2, -1, 0],\n [-1, -1, -1, -1],\n ],\n [\n [-1, -1, -1, -1],\n [0, 0, 1, 0],\n [0, 3, 0, 1],\n [-1, -1, -1, -1],\n ],\n [\n [13, 3, 0, 1],\n [13, 2, -1, 0],\n [7, 1, 0, -1],\n [7, 0, 1, 0],\n ],\n [\n [-1, -1, -1, -1],\n [0, 1, 0, -1],\n [-1, -1, -1, -1],\n [0, 3, 0, 1],\n ],\n [\n [0, 3, 0, 1],\n [0, 2, -1, 0],\n [-1, -1, -1, -1],\n [-1, -1, -1, -1],\n ],\n [\n [0, 3, 0, 1],\n [0, 2, -1, 0],\n [-1, -1, -1, -1],\n [-1, -1, -1, -1],\n ],\n [\n [-1, -1, -1, -1],\n [0, 1, 0, -1],\n [-1, -1, -1, -1],\n [0, 3, 0, 1],\n ],\n [\n [11, 1, 0, -1],\n [14, 0, 1, 0],\n [14, 3, 0, 1],\n [11, 2, -1, 0],\n ],\n [\n [-1, -1, -1, -1],\n [0, 0, 1, 0],\n [0, 3, 0, 1],\n [-1, -1, -1, -1],\n ],\n [\n [0, 0, 1, 0],\n [-1, -1, -1, -1],\n [0, 2, -1, 0],\n [-1, -1, -1, -1],\n ],\n [\n [-1, -1, -1, -1],\n [-1, -1, -1, -1],\n [0, 1, 0, -1],\n [0, 0, 1, 0],\n ],\n [\n [0, 1, 0, -1],\n [-1, -1, -1, -1],\n [-1, -1, -1, -1],\n [0, 2, -1, 0],\n ],\n [\n [-1, -1, -1, -1],\n [-1, -1, -1, -1],\n [-1, -1, -1, -1],\n [-1, -1, -1, -1],\n ],\n ];\n\n this.gks = [\n [0.27901, 0.44198, 0.27901],\n [0.135336, 0.228569, 0.272192, 0.228569, 0.135336],\n [0.086776, 0.136394, 0.178908, 0.195843, 0.178908, 0.136394, 0.086776],\n [0.063327, 0.093095, 0.122589, 0.144599, 0.152781, 0.144599, 0.122589, 0.093095, 0.063327],\n [\n 0.049692,\n 0.069304,\n 0.089767,\n 0.107988,\n 0.120651,\n 0.125194,\n 0.120651,\n 0.107988,\n 0.089767,\n 0.069304,\n 0.049692,\n ],\n ];\n\n this.specpalette = [\n { r: 0, g: 0, b: 0, a: 255 },\n { r: 128, g: 128, b: 128, a: 255 },\n { r: 0, g: 0, b: 128, a: 255 },\n { r: 64, g: 64, b: 128, a: 255 },\n { r: 192, g: 192, b: 192, a: 255 },\n { r: 255, g: 255, b: 255, a: 255 },\n { r: 128, g: 128, b: 192, a: 255 },\n { r: 0, g: 0, b: 192, a: 255 },\n { r: 128, g: 0, b: 0, a: 255 },\n { r: 128, g: 64, b: 64, a: 255 },\n { r: 128, g: 0, b: 128, a: 255 },\n { r: 168, g: 168, b: 168, a: 255 },\n { r: 192, g: 128, b: 128, a: 255 },\n { r: 192, g: 0, b: 0, a: 255 },\n { r: 255, g: 255, b: 255, a: 255 },\n { r: 0, g: 128, b: 0, a: 255 },\n ];\n }\n\n imageToSVG(url, callback, options) {\n options = this.checkoptions(options);\n this.loadImage(\n url,\n (canvas) => {\n callback(this.imagedataToSVG(this.getImgdata(canvas), options));\n },\n options\n );\n }\n\n imagedataToSVG(imgd, options) {\n options = this.checkoptions(options);\n const td = this.imagedataToTracedata(imgd, options);\n\n return this.getsvgstring(td, options);\n }\n\n imageToTracedata(url, callback, options) {\n options = this.checkoptions(options);\n this.loadImage(\n url,\n (canvas) => {\n callback(this.imagedataToTracedata(this.getImgdata(canvas), options));\n },\n options\n );\n }\n\n imagedataToTracedata(imgd, options) {\n options = this.checkoptions(options);\n const ii = this.colorquantization(imgd, options);\n let tracedata;\n if (options.layering === 0) {\n tracedata = {\n layers: [],\n palette: ii.palette,\n width: ii.array[0].length - 2,\n height: ii.array.length - 2,\n };\n\n for (let colornum = 0; colornum < ii.palette.length; colornum += 1) {\n const tracedlayer = this.batchtracepaths(\n this.internodes(\n this.pathscan(this.layeringstep(ii, colornum), options.pathomit),\n options\n ),\n options.ltres,\n options.qtres\n );\n tracedata.layers.push(tracedlayer);\n }\n } else {\n const ls = this.layering(ii);\n if (options.layercontainerid) {\n this.drawLayers(ls, this.specpalette, options.scale, options.layercontainerid);\n }\n const bps = this.batchpathscan(ls, options.pathomit);\n const bis = this.batchinternodes(bps, options);\n tracedata = {\n layers: this.batchtracelayers(bis, options.ltres, options.qtres),\n palette: ii.palette,\n width: imgd.width,\n height: imgd.height,\n };\n }\n\n return tracedata;\n }\n\n checkoptions(options) {\n options = options || {};\n if (typeof options === 'string') {\n options = options.toLowerCase();\n if (this.optionpresets[options]) {\n options = this.optionpresets[options];\n } else {\n options = {};\n }\n }\n const ok = Object.keys(this.optionpresets['default']);\n for (let k = 0; k < ok.length; k += 1) {\n if (!options.hasOwnProperty(ok[k])) {\n options[ok[k]] = this.optionpresets['default'][ok[k]];\n }\n }\n\n return options;\n }\n\n colorquantization(imgd, options) {\n const arr = [];\n let idx = 0;\n let cd;\n let cdl;\n let ci;\n const paletteacc = [];\n const pixelnum = imgd.width * imgd.height;\n let i;\n let j;\n let k;\n let cnt;\n let palette;\n\n for (j = 0; j < imgd.height + 2; j += 1) {\n arr[j] = [];\n for (i = 0; i < imgd.width + 2; i += 1) {\n arr[j][i] = -1;\n }\n }\n if (options.pal) {\n palette = options.pal;\n } else if (options.colorsampling === 0) {\n palette = this.generatepalette(options.numberofcolors);\n } else if (options.colorsampling === 1) {\n palette = this.samplepalette(options.numberofcolors, imgd);\n } else {\n palette = this.samplepalette2(options.numberofcolors, imgd);\n }\n if (options.blurradius > 0) {\n imgd = this.blur(imgd, options.blurradius, options.blurdelta);\n }\n for (cnt = 0; cnt < options.colorquantcycles; cnt += 1) {\n if (cnt > 0) {\n for (k = 0; k < palette.length; k += 1) {\n if (paletteacc[k].n > 0) {\n palette[k] = {\n r: Math.floor(paletteacc[k].r / paletteacc[k].n),\n g: Math.floor(paletteacc[k].g / paletteacc[k].n),\n b: Math.floor(paletteacc[k].b / paletteacc[k].n),\n a: Math.floor(paletteacc[k].a / paletteacc[k].n),\n };\n }\n\n if (\n paletteacc[k].n / pixelnum < options.mincolorratio &&\n cnt < options.colorquantcycles - 1\n ) {\n palette[k] = {\n r: Math.floor(Math.random() * 255),\n g: Math.floor(Math.random() * 255),\n b: Math.floor(Math.random() * 255),\n a: Math.floor(Math.random() * 255),\n };\n }\n }\n }\n\n for (i = 0; i < palette.length; i += 1) {\n paletteacc[i] = { r: 0, g: 0, b: 0, a: 0, n: 0 };\n }\n\n for (j = 0; j < imgd.height; j += 1) {\n for (i = 0; i < imgd.width; i += 1) {\n idx = (j * imgd.width + i) * 4;\n\n ci = 0;\n cdl = 1024;\n for (k = 0; k < palette.length; k += 1) {\n cd =\n Math.abs(palette[k].r - imgd.data[idx]) +\n Math.abs(palette[k].g - imgd.data[idx + 1]) +\n Math.abs(palette[k].b - imgd.data[idx + 2]) +\n Math.abs(palette[k].a - imgd.data[idx + 3]);\n\n if (cd < cdl) {\n cdl = cd;\n ci = k;\n }\n }\n\n paletteacc[ci].r += imgd.data[idx];\n paletteacc[ci].g += imgd.data[idx + 1];\n paletteacc[ci].b += imgd.data[idx + 2];\n paletteacc[ci].a += imgd.data[idx + 3];\n paletteacc[ci].n += 1;\n\n arr[j + 1][i + 1] = ci;\n }\n }\n }\n\n return { array: arr, palette };\n }\n\n samplepalette(numberofcolors, imgd) {\n let idx;\n const palette = [];\n for (let i = 0; i < numberofcolors; i += 1) {\n idx = Math.floor((Math.random() * imgd.data.length) / 4) * 4;\n palette.push({\n r: imgd.data[idx],\n g: imgd.data[idx + 1],\n b: imgd.data[idx + 2],\n a: imgd.data[idx + 3],\n });\n }\n\n return palette;\n }\n\n samplepalette2(numberofcolors, imgd) {\n let idx;\n const palette = [];\n const ni = Math.ceil(Math.sqrt(numberofcolors));\n const nj = Math.ceil(numberofcolors / ni);\n const vx = imgd.width / (ni + 1);\n const vy = imgd.height / (nj + 1);\n for (let j = 0; j < nj; j += 1) {\n for (let i = 0; i < ni; i += 1) {\n if (palette.length === numberofcolors) {\n break;\n } else {\n idx = Math.floor((j + 1) * vy * imgd.width + (i + 1) * vx) * 4;\n palette.push({\n r: imgd.data[idx],\n g: imgd.data[idx + 1],\n b: imgd.data[idx + 2],\n a: imgd.data[idx + 3],\n });\n }\n }\n }\n\n return palette;\n }\n\n generatepalette(numberofcolors) {\n const palette = [];\n let rcnt;\n let gcnt;\n let bcnt;\n if (numberofcolors < 8) {\n const graystep = Math.floor(255 / (numberofcolors - 1));\n for (let i = 0; i < numberofcolors; i += 1) {\n palette.push({ r: i * graystep, g: i * graystep, b: i * graystep, a: 255 });\n }\n } else {\n const colorqnum = Math.floor(Math.pow(numberofcolors, 1 / 3));\n const colorstep = Math.floor(255 / (colorqnum - 1));\n const rndnum = numberofcolors - colorqnum * colorqnum * colorqnum;\n for (rcnt = 0; rcnt < colorqnum; rcnt += 1) {\n for (gcnt = 0; gcnt < colorqnum; gcnt += 1) {\n for (bcnt = 0; bcnt < colorqnum; bcnt += 1) {\n palette.push({ r: rcnt * colorstep, g: gcnt * colorstep, b: bcnt * colorstep, a: 255 });\n }\n }\n }\n for (rcnt = 0; rcnt < rndnum; rcnt += 1) {\n palette.push({\n r: Math.floor(Math.random() * 255),\n g: Math.floor(Math.random() * 255),\n b: Math.floor(Math.random() * 255),\n a: Math.floor(Math.random() * 255),\n });\n }\n }\n\n return palette;\n }\n\n layering(ii) {\n const layers = [];\n let val = 0;\n const ah = ii.array.length;\n const aw = ii.array[0].length;\n let n1;\n let n2;\n let n3;\n let n4;\n let n5;\n let n6;\n let n7;\n let n8;\n let i;\n let j;\n let k;\n for (k = 0; k < ii.palette.length; k += 1) {\n layers[k] = [];\n for (j = 0; j < ah; j += 1) {\n layers[k][j] = [];\n for (i = 0; i < aw; i += 1) {\n layers[k][j][i] = 0;\n }\n }\n }\n for (j = 1; j < ah - 1; j += 1) {\n for (i = 1; i < aw - 1; i += 1) {\n val = ii.array[j][i];\n\n n1 = ii.array[j - 1][i - 1] === val ? 1 : 0;\n n2 = ii.array[j - 1][i] === val ? 1 : 0;\n n3 = ii.array[j - 1][i + 1] === val ? 1 : 0;\n n4 = ii.array[j][i - 1] === val ? 1 : 0;\n n5 = ii.array[j][i + 1] === val ? 1 : 0;\n n6 = ii.array[j + 1][i - 1] === val ? 1 : 0;\n n7 = ii.array[j + 1][i] === val ? 1 : 0;\n n8 = ii.array[j + 1][i + 1] === val ? 1 : 0;\n\n layers[val][j + 1][i + 1] = 1 + n5 * 2 + n8 * 4 + n7 * 8;\n if (!n4) {\n layers[val][j + 1][i] = 0 + 2 + n7 * 4 + n6 * 8;\n }\n if (!n2) {\n layers[val][j][i + 1] = 0 + n3 * 2 + n5 * 4 + 8;\n }\n if (!n1) {\n layers[val][j][i] = 0 + n2 * 2 + 4 + n4 * 8;\n }\n }\n }\n\n return layers;\n }\n\n layeringstep(ii, cnum) {\n const layer = [];\n const ah = ii.array.length;\n const aw = ii.array[0].length;\n let i;\n let j;\n for (j = 0; j < ah; j += 1) {\n layer[j] = [];\n for (i = 0; i < aw; i += 1) {\n layer[j][i] = 0;\n }\n }\n for (j = 1; j < ah; j += 1) {\n for (i = 1; i < aw; i += 1) {\n layer[j][i] =\n (ii.array[j - 1][i - 1] === cnum ? 1 : 0) +\n (ii.array[j - 1][i] === cnum ? 2 : 0) +\n (ii.array[j][i - 1] === cnum ? 8 : 0) +\n (ii.array[j][i] === cnum ? 4 : 0);\n }\n }\n\n return layer;\n }\n\n pathscan(arr, pathomit) {\n const paths = [];\n let pacnt = 0;\n let pcnt = 0;\n let px = 0;\n let py = 0;\n const w = arr[0].length;\n const h = arr.length;\n let dir = 0;\n let pathfinished = true;\n let holepath = false;\n let lookuprow;\n for (let j = 0; j < h; j += 1) {\n for (let i = 0; i < w; i += 1) {\n if (arr[j][i] === 4 || arr[j][i] === 11) {\n px = i;\n py = j;\n paths[pacnt] = {};\n paths[pacnt].points = [];\n paths[pacnt].boundingbox = [px, py, px, py];\n paths[pacnt].holechildren = [];\n pathfinished = false;\n pcnt = 0;\n holepath = arr[j][i] === 11;\n dir = 1;\n\n while (!pathfinished) {\n paths[pacnt].points[pcnt] = {};\n paths[pacnt].points[pcnt].x = px - 1;\n paths[pacnt].points[pcnt].y = py - 1;\n paths[pacnt].points[pcnt].t = arr[py][px];\n\n if (px - 1 < paths[pacnt].boundingbox[0]) {\n paths[pacnt].boundingbox[0] = px - 1;\n }\n if (px - 1 > paths[pacnt].boundingbox[2]) {\n paths[pacnt].boundingbox[2] = px - 1;\n }\n if (py - 1 < paths[pacnt].boundingbox[1]) {\n paths[pacnt].boundingbox[1] = py - 1;\n }\n if (py - 1 > paths[pacnt].boundingbox[3]) {\n paths[pacnt].boundingbox[3] = py - 1;\n }\n\n lookuprow = this.pathscan_combined_lookup[arr[py][px]][dir];\n arr[py][px] = lookuprow[0];\n dir = lookuprow[1];\n px += lookuprow[2];\n py += lookuprow[3];\n\n if (px - 1 === paths[pacnt].points[0].x && py - 1 === paths[pacnt].points[0].y) {\n pathfinished = true;\n\n if (paths[pacnt].points.length < pathomit) {\n paths.pop();\n } else {\n paths[pacnt].isholepath = !!holepath;\n\n if (holepath) {\n let parentidx = 0,\n parentbbox = [-1, -1, w + 1, h + 1];\n for (let parentcnt = 0; parentcnt < pacnt; parentcnt++) {\n if (\n !paths[parentcnt].isholepath &&\n this.boundingboxincludes(\n paths[parentcnt].boundingbox,\n paths[pacnt].boundingbox\n ) &&\n this.boundingboxincludes(parentbbox, paths[parentcnt].boundingbox)\n ) {\n parentidx = parentcnt;\n parentbbox = paths[parentcnt].boundingbox;\n }\n }\n paths[parentidx].holechildren.push(pacnt);\n }\n pacnt += 1;\n }\n }\n pcnt += 1;\n }\n }\n }\n }\n\n return paths;\n }\n\n boundingboxincludes(parentbbox, childbbox) {\n return (\n parentbbox[0] < childbbox[0] &&\n parentbbox[1] < childbbox[1] &&\n parentbbox[2] > childbbox[2] &&\n parentbbox[3] > childbbox[3]\n );\n }\n\n batchpathscan(layers, pathomit) {\n const bpaths = [];\n for (const k in layers) {\n if (!layers.hasOwnProperty(k)) {\n continue;\n }\n bpaths[k] = this.pathscan(layers[k], pathomit);\n }\n\n return bpaths;\n }\n\n internodes(paths, options) {\n const ins = [];\n let palen = 0;\n let nextidx = 0;\n let nextidx2 = 0;\n let previdx = 0;\n let previdx2 = 0;\n let pacnt;\n let pcnt;\n for (pacnt = 0; pacnt < paths.length; pacnt += 1) {\n ins[pacnt] = {};\n ins[pacnt].points = [];\n ins[pacnt].boundingbox = paths[pacnt].boundingbox;\n ins[pacnt].holechildren = paths[pacnt].holechildren;\n ins[pacnt].isholepath = paths[pacnt].isholepath;\n palen = paths[pacnt].points.length;\n\n for (pcnt = 0; pcnt < palen; pcnt += 1) {\n nextidx = (pcnt + 1) % palen;\n nextidx2 = (pcnt + 2) % palen;\n previdx = (pcnt - 1 + palen) % palen;\n previdx2 = (pcnt - 2 + palen) % palen;\n\n if (\n options.rightangleenhance &&\n this.testrightangle(paths[pacnt], previdx2, previdx, pcnt, nextidx, nextidx2)\n ) {\n if (ins[pacnt].points.length > 0) {\n ins[pacnt].points[ins[pacnt].points.length - 1].linesegment = this.getdirection(\n ins[pacnt].points[ins[pacnt].points.length - 1].x,\n ins[pacnt].points[ins[pacnt].points.length - 1].y,\n paths[pacnt].points[pcnt].x,\n paths[pacnt].points[pcnt].y\n );\n }\n\n ins[pacnt].points.push({\n x: paths[pacnt].points[pcnt].x,\n y: paths[pacnt].points[pcnt].y,\n linesegment: this.getdirection(\n paths[pacnt].points[pcnt].x,\n paths[pacnt].points[pcnt].y,\n (paths[pacnt].points[pcnt].x + paths[pacnt].points[nextidx].x) / 2,\n (paths[pacnt].points[pcnt].y + paths[pacnt].points[nextidx].y) / 2\n ),\n });\n }\n\n ins[pacnt].points.push({\n x: (paths[pacnt].points[pcnt].x + paths[pacnt].points[nextidx].x) / 2,\n y: (paths[pacnt].points[pcnt].y + paths[pacnt].points[nextidx].y) / 2,\n linesegment: this.getdirection(\n (paths[pacnt].points[pcnt].x + paths[pacnt].points[nextidx].x) / 2,\n (paths[pacnt].points[pcnt].y + paths[pacnt].points[nextidx].y) / 2,\n (paths[pacnt].points[nextidx].x + paths[pacnt].points[nextidx2].x) / 2,\n (paths[pacnt].points[nextidx].y + paths[pacnt].points[nextidx2].y) / 2\n ),\n });\n }\n }\n\n return ins;\n }\n\n testrightangle(path, idx1, idx2, idx3, idx4, idx5) {\n return (\n (path.points[idx3].x === path.points[idx1].x &&\n path.points[idx3].x === path.points[idx2].x &&\n path.points[idx3].y === path.points[idx4].y &&\n path.points[idx3].y === path.points[idx5].y) ||\n (path.points[idx3].y === path.points[idx1].y &&\n path.points[idx3].y === path.points[idx2].y &&\n path.points[idx3].x === path.points[idx4].x &&\n path.points[idx3].x === path.points[idx5].x)\n );\n }\n\n getdirection(x1, y1, x2, y2) {\n let val = 8;\n if (x1 < x2) {\n if (y1 < y2) {\n val = 1;\n } else if (y1 > y2) {\n val = 7;\n } else {\n val = 0;\n }\n } else if (x1 > x2) {\n if (y1 < y2) {\n val = 3;\n } else if (y1 > y2) {\n val = 5;\n } else {\n val = 4;\n }\n } else if (y1 < y2) {\n val = 2;\n } else if (y1 > y2) {\n val = 6;\n } else {\n val = 8;\n }\n\n return val;\n }\n\n batchinternodes(bpaths, options) {\n const binternodes = [];\n for (const k in bpaths) {\n if (!bpaths.hasOwnProperty(k)) {\n continue;\n }\n binternodes[k] = this.internodes(bpaths[k], options);\n }\n\n return binternodes;\n }\n\n tracepath(path, ltres, qtres) {\n let pcnt = 0;\n let segtype1;\n let segtype2;\n let seqend;\n const smp = {};\n smp.segments = [];\n smp.boundingbox = path.boundingbox;\n smp.holechildren = path.holechildren;\n smp.isholepath = path.isholepath;\n\n while (pcnt < path.points.length) {\n segtype1 = path.points[pcnt].linesegment;\n segtype2 = -1;\n seqend = pcnt + 1;\n while (\n (path.points[seqend].linesegment === segtype1 ||\n path.points[seqend].linesegment === segtype2 ||\n segtype2 === -1) &&\n seqend < path.points.length - 1\n ) {\n if (path.points[seqend].linesegment !== segtype1 && segtype2 === -1) {\n segtype2 = path.points[seqend].linesegment;\n }\n seqend += 1;\n }\n if (seqend === path.points.length - 1) {\n seqend = 0;\n }\n\n smp.segments = smp.segments.concat(this.fitseq(path, ltres, qtres, pcnt, seqend));\n\n if (seqend > 0) {\n pcnt = seqend;\n } else {\n pcnt = path.points.length;\n }\n }\n\n return smp;\n }\n\n fitseq(path, ltres, qtres, seqstart, seqend) {\n if (seqend > path.points.length || seqend < 0) {\n return [];\n }\n let errorpoint = seqstart,\n errorval = 0,\n curvepass = true,\n px,\n py,\n dist2;\n let tl = seqend - seqstart;\n if (tl < 0) {\n tl += path.points.length;\n }\n let vx = (path.points[seqend].x - path.points[seqstart].x) / tl,\n vy = (path.points[seqend].y - path.points[seqstart].y) / tl;\n let pcnt = (seqstart + 1) % path.points.length,\n pl;\n while (pcnt != seqend) {\n pl = pcnt - seqstart;\n if (pl < 0) {\n pl += path.points.length;\n }\n px = path.points[seqstart].x + vx * pl;\n py = path.points[seqstart].y + vy * pl;\n dist2 =\n (path.points[pcnt].x - px) * (path.points[pcnt].x - px) +\n (path.points[pcnt].y - py) * (path.points[pcnt].y - py);\n if (dist2 > ltres) {\n curvepass = false;\n }\n if (dist2 > errorval) {\n errorpoint = pcnt;\n errorval = dist2;\n }\n pcnt = (pcnt + 1) % path.points.length;\n }\n if (curvepass) {\n return [\n {\n type: 'L',\n x1: path.points[seqstart].x,\n y1: path.points[seqstart].y,\n x2: path.points[seqend].x,\n y2: path.points[seqend].y,\n },\n ];\n }\n const fitpoint = errorpoint;\n curvepass = true;\n errorval = 0;\n let t = (fitpoint - seqstart) / tl,\n t1 = (1 - t) * (1 - t),\n t2 = 2 * (1 - t) * t,\n t3 = t * t;\n let cpx =\n (t1 * path.points[seqstart].x + t3 * path.points[seqend].x - path.points[fitpoint].x) / -t2,\n cpy =\n (t1 * path.points[seqstart].y + t3 * path.points[seqend].y - path.points[fitpoint].y) / -t2;\n pcnt = seqstart + 1;\n while (pcnt != seqend) {\n t = (pcnt - seqstart) / tl;\n t1 = (1 - t) * (1 - t);\n t2 = 2 * (1 - t) * t;\n t3 = t * t;\n px = t1 * path.points[seqstart].x + t2 * cpx + t3 * path.points[seqend].x;\n py = t1 * path.points[seqstart].y + t2 * cpy + t3 * path.points[seqend].y;\n dist2 =\n (path.points[pcnt].x - px) * (path.points[pcnt].x - px) +\n (path.points[pcnt].y - py) * (path.points[pcnt].y - py);\n if (dist2 > qtres) {\n curvepass = false;\n }\n if (dist2 > errorval) {\n errorpoint = pcnt;\n errorval = dist2;\n }\n pcnt = (pcnt + 1) % path.points.length;\n }\n if (curvepass) {\n return [\n {\n type: 'Q',\n x1: path.points[seqstart].x,\n y1: path.points[seqstart].y,\n x2: cpx,\n y2: cpy,\n x3: path.points[seqend].x,\n y3: path.points[seqend].y,\n },\n ];\n }\n const splitpoint = fitpoint;\n\n return this.fitseq(path, ltres, qtres, seqstart, splitpoint).concat(\n this.fitseq(path, ltres, qtres, splitpoint, seqend)\n );\n }\n\n batchtracepaths(internodepaths, ltres, qtres) {\n const btracedpaths = [];\n for (const k in internodepaths) {\n if (!internodepaths.hasOwnProperty(k)) {\n continue;\n }\n btracedpaths.push(this.tracepath(internodepaths[k], ltres, qtres));\n }\n\n return btracedpaths;\n }\n\n batchtracelayers(binternodes, ltres, qtres) {\n const btbis = [];\n for (const k in binternodes) {\n if (!binternodes.hasOwnProperty(k)) {\n continue;\n }\n btbis[k] = this.batchtracepaths(binternodes[k], ltres, qtres);\n }\n\n return btbis;\n }\n\n roundtodec(val, places) {\n return Number(val.toFixed(places));\n }\n\n svgpathstring(tracedata, lnum, pathnum, options) {\n let layer = tracedata.layers[lnum],\n smp = layer[pathnum],\n str = '',\n pcnt;\n if (options.linefilter && smp.segments.length < 3) {\n return str;\n }\n str = `= 0; pcnt--) {\n str += `${hsmp.segments[pcnt].type} `;\n if (hsmp.segments[pcnt].hasOwnProperty('x3')) {\n str += `${hsmp.segments[pcnt].x2 * options.scale} ${\n hsmp.segments[pcnt].y2 * options.scale\n } `;\n }\n str += `${hsmp.segments[pcnt].x1 * options.scale} ${\n hsmp.segments[pcnt].y1 * options.scale\n } `;\n }\n } else {\n if (hsmp.segments[hsmp.segments.length - 1].hasOwnProperty('x3')) {\n str += `M ${this.roundtodec(\n hsmp.segments[hsmp.segments.length - 1].x3 * options.scale\n )} ${this.roundtodec(hsmp.segments[hsmp.segments.length - 1].y3 * options.scale)} `;\n } else {\n str += `M ${this.roundtodec(\n hsmp.segments[hsmp.segments.length - 1].x2 * options.scale\n )} ${this.roundtodec(hsmp.segments[hsmp.segments.length - 1].y2 * options.scale)} `;\n }\n for (pcnt = hsmp.segments.length - 1; pcnt >= 0; pcnt--) {\n str += `${hsmp.segments[pcnt].type} `;\n if (hsmp.segments[pcnt].hasOwnProperty('x3')) {\n str += `${this.roundtodec(hsmp.segments[pcnt].x2 * options.scale)} ${this.roundtodec(\n hsmp.segments[pcnt].y2 * options.scale\n )} `;\n }\n str += `${this.roundtodec(hsmp.segments[pcnt].x1 * options.scale)} ${this.roundtodec(\n hsmp.segments[pcnt].y1 * options.scale\n )} `;\n }\n }\n str += 'Z ';\n }\n str += '\" />';\n if (options.lcpr || options.qcpr) {\n for (pcnt = 0; pcnt < smp.segments.length; pcnt++) {\n if (smp.segments[pcnt].hasOwnProperty('x3') && options.qcpr) {\n str += ``;\n str += ``;\n str += ``;\n str += ``;\n }\n if (!smp.segments[pcnt].hasOwnProperty('x3') && options.lcpr) {\n str += ``;\n }\n }\n\n for (var hcnt = 0; hcnt < smp.holechildren.length; hcnt++) {\n var hsmp = layer[smp.holechildren[hcnt]];\n for (pcnt = 0; pcnt < hsmp.segments.length; pcnt++) {\n if (hsmp.segments[pcnt].hasOwnProperty('x3') && options.qcpr) {\n str += ``;\n str += ``;\n str += ``;\n str += ``;\n }\n if (!hsmp.segments[pcnt].hasOwnProperty('x3') && options.lcpr) {\n str += ``;\n }\n }\n }\n }\n\n return str;\n }\n\n getsvgstring(tracedata, options) {\n options = this.checkoptions(options);\n const w = tracedata.width * options.scale;\n const h = tracedata.height * options.scale;\n\n let svgstr = ``;\n for (let lcnt = 0; lcnt < tracedata.layers.length; lcnt += 1) {\n for (let pcnt = 0; pcnt < tracedata.layers[lcnt].length; pcnt += 1) {\n if (!tracedata.layers[lcnt][pcnt].isholepath) {\n svgstr += this.svgpathstring(tracedata, lcnt, pcnt, options);\n }\n }\n }\n svgstr += '';\n\n return svgstr;\n }\n\n compareNumbers(a, b) {\n return a - b;\n }\n\n torgbastr(c) {\n return `rgba(${c.r},${c.g},${c.b},${c.a})`;\n }\n\n tosvgcolorstr(c, options) {\n return `fill=\"rgb(${c.r},${c.g},${c.b})\" stroke=\"rgb(${c.r},${c.g},${c.b})\" stroke-width=\"${\n options.strokewidth\n }\" opacity=\"${c.a / 255.0}\" `;\n }\n\n appendSVGString(svgstr, parentid) {\n let div;\n if (parentid) {\n div = document.getElementById(parentid);\n if (!div) {\n div = document.createElement('div');\n div.id = parentid;\n document.body.appendChild(div);\n }\n } else {\n div = document.createElement('div');\n document.body.appendChild(div);\n }\n div.innerHTML += svgstr;\n }\n\n blur(imgd, radius, delta) {\n let i, j, k, d, idx, racc, gacc, bacc, aacc, wacc;\n const imgd2 = { width: imgd.width, height: imgd.height, data: [] };\n radius = Math.floor(radius);\n if (radius < 1) {\n return imgd;\n }\n if (radius > 5) {\n radius = 5;\n }\n delta = Math.abs(delta);\n if (delta > 1024) {\n delta = 1024;\n }\n const thisgk = this.gks[radius - 1];\n for (j = 0; j < imgd.height; j++) {\n for (i = 0; i < imgd.width; i++) {\n racc = 0;\n gacc = 0;\n bacc = 0;\n aacc = 0;\n wacc = 0;\n\n for (k = -radius; k < radius + 1; k++) {\n if (i + k > 0 && i + k < imgd.width) {\n idx = (j * imgd.width + i + k) * 4;\n racc += imgd.data[idx] * thisgk[k + radius];\n gacc += imgd.data[idx + 1] * thisgk[k + radius];\n bacc += imgd.data[idx + 2] * thisgk[k + radius];\n aacc += imgd.data[idx + 3] * thisgk[k + radius];\n wacc += thisgk[k + radius];\n }\n }\n\n idx = (j * imgd.width + i) * 4;\n imgd2.data[idx] = Math.floor(racc / wacc);\n imgd2.data[idx + 1] = Math.floor(gacc / wacc);\n imgd2.data[idx + 2] = Math.floor(bacc / wacc);\n imgd2.data[idx + 3] = Math.floor(aacc / wacc);\n }\n }\n const himgd = new Uint8ClampedArray(imgd2.data);\n for (j = 0; j < imgd.height; j++) {\n for (i = 0; i < imgd.width; i++) {\n racc = 0;\n gacc = 0;\n bacc = 0;\n aacc = 0;\n wacc = 0;\n\n for (k = -radius; k < radius + 1; k++) {\n if (j + k > 0 && j + k < imgd.height) {\n idx = ((j + k) * imgd.width + i) * 4;\n racc += himgd[idx] * thisgk[k + radius];\n gacc += himgd[idx + 1] * thisgk[k + radius];\n bacc += himgd[idx + 2] * thisgk[k + radius];\n aacc += himgd[idx + 3] * thisgk[k + radius];\n wacc += thisgk[k + radius];\n }\n }\n\n idx = (j * imgd.width + i) * 4;\n imgd2.data[idx] = Math.floor(racc / wacc);\n imgd2.data[idx + 1] = Math.floor(gacc / wacc);\n imgd2.data[idx + 2] = Math.floor(bacc / wacc);\n imgd2.data[idx + 3] = Math.floor(aacc / wacc);\n }\n }\n for (j = 0; j < imgd.height; j++) {\n for (i = 0; i < imgd.width; i++) {\n idx = (j * imgd.width + i) * 4;\n\n d =\n Math.abs(imgd2.data[idx] - imgd.data[idx]) +\n Math.abs(imgd2.data[idx + 1] - imgd.data[idx + 1]) +\n Math.abs(imgd2.data[idx + 2] - imgd.data[idx + 2]) +\n Math.abs(imgd2.data[idx + 3] - imgd.data[idx + 3]);\n\n if (d > delta) {\n imgd2.data[idx] = imgd.data[idx];\n imgd2.data[idx + 1] = imgd.data[idx + 1];\n imgd2.data[idx + 2] = imgd.data[idx + 2];\n imgd2.data[idx + 3] = imgd.data[idx + 3];\n }\n }\n }\n\n return imgd2;\n }\n\n loadImage(url, callback, options) {\n const img = new Image();\n if (options && options.corsenabled) {\n img.crossOrigin = 'Anonymous';\n }\n img.src = url;\n img.onload = function () {\n const canvas = document.createElement('canvas');\n canvas.width = img.width;\n canvas.height = img.height;\n const context = canvas.getContext('2d');\n context.drawImage(img, 0, 0);\n callback(canvas);\n };\n }\n\n getImgdata(canvas) {\n const context = canvas.getContext('2d');\n\n return context.getImageData(0, 0, canvas.width, canvas.height);\n }\n\n drawLayers(layers, palette, scale, parentid) {\n scale = scale || 1;\n let w, h, i, j, k;\n let div;\n if (parentid) {\n div = document.getElementById(parentid);\n if (!div) {\n div = document.createElement('div');\n div.id = parentid;\n document.body.appendChild(div);\n }\n } else {\n div = document.createElement('div');\n document.body.appendChild(div);\n }\n for (k in layers) {\n if (!layers.hasOwnProperty(k)) {\n continue;\n }\n\n w = layers[k][0].length;\n h = layers[k].length;\n\n const canvas = document.createElement('canvas');\n canvas.width = w * scale;\n canvas.height = h * scale;\n const context = canvas.getContext('2d');\n\n for (j = 0; j < h; j += 1) {\n for (i = 0; i < w; i += 1) {\n context.fillStyle = this.torgbastr(palette[layers[k][j][i] % palette.length]);\n context.fillRect(i * scale, j * scale, scale, scale);\n }\n }\n\n div.appendChild(canvas);\n }\n }\n}\n","/**\n * @author NHN. FE Development Team \n * @fileoverview Selection modification helper\n */\n\nimport { extend } from 'tui-code-snippet';\n\n/**\n * Cached selection's info\n * @type {Array}\n * @private\n */\nlet cachedUndoDataForChangeDimension = null;\n\n/**\n * Set cached undo data\n * @param {Array} undoData - selection object\n * @private\n */\nexport function setCachedUndoDataForDimension(undoData) {\n cachedUndoDataForChangeDimension = undoData;\n}\n\n/**\n * Get cached undo data\n * @returns {Object} cached undo data\n * @private\n */\nexport function getCachedUndoDataForDimension() {\n return cachedUndoDataForChangeDimension;\n}\n\n/**\n * Make undo data\n * @param {fabric.Object} obj - selection object\n * @param {Function} undoDatumMaker - make undo datum\n * @returns {Array} undoData\n * @private\n */\nexport function makeSelectionUndoData(obj, undoDatumMaker) {\n let undoData;\n\n if (obj.type === 'activeSelection') {\n undoData = obj.getObjects().map((item) => {\n const { angle, left, top, scaleX, scaleY, width, height } = item;\n\n obj.realizeTransform(item);\n const result = undoDatumMaker(item);\n\n item.set({\n angle,\n left,\n top,\n width,\n height,\n scaleX,\n scaleY,\n });\n\n return result;\n });\n } else {\n undoData = [undoDatumMaker(obj)];\n }\n\n return undoData;\n}\n\n/**\n * Make undo datum\n * @param {number} id - object id\n * @param {fabric.Object} obj - selection object\n * @param {boolean} isSelection - whether or not object is selection\n * @returns {Object} undo datum\n * @private\n */\nexport function makeSelectionUndoDatum(id, obj, isSelection) {\n return isSelection\n ? {\n id,\n width: obj.width,\n height: obj.height,\n top: obj.top,\n left: obj.left,\n angle: obj.angle,\n scaleX: obj.scaleX,\n scaleY: obj.scaleY,\n }\n : extend({ id }, obj);\n}\n","/**\n * @author NHN. FE Development Team \n * @fileoverview Shape resize helper\n */\nimport { forEach, map, extend } from 'tui-code-snippet';\nimport resizeHelper from '@/helper/shapeResizeHelper';\nimport { capitalizeString, flipObject, setCustomProperty, getCustomProperty } from '@/util';\n\nconst FILTER_OPTION_MAP = {\n pixelate: 'blocksize',\n blur: 'blur',\n};\nconst POSITION_DIMENSION_MAP = {\n x: 'width',\n y: 'height',\n};\n\nconst FILTER_NAME_VALUE_MAP = flipObject(FILTER_OPTION_MAP);\n\n/**\n * Cached canvas image element for fill image\n * @type {boolean}\n * @private\n */\nlet cachedCanvasImageElement = null;\n\n/**\n * Get background image of fill\n * @param {fabric.Object} shapeObj - Shape object\n * @returns {fabric.Image}\n * @private\n */\nexport function getFillImageFromShape(shapeObj) {\n const { patternSourceCanvas } = getCustomProperty(shapeObj, 'patternSourceCanvas');\n const [fillImage] = patternSourceCanvas.getObjects();\n\n return fillImage;\n}\n\n/**\n * Reset the image position in the filter type fill area.\n * @param {fabric.Object} shapeObj - Shape object\n * @private\n */\nexport function rePositionFilterTypeFillImage(shapeObj) {\n const { angle, flipX, flipY } = shapeObj;\n const fillImage = getFillImageFromShape(shapeObj);\n const rotatedShapeCornerDimension = getRotatedDimension(shapeObj);\n const { right, bottom } = rotatedShapeCornerDimension;\n let { width, height } = rotatedShapeCornerDimension;\n const diffLeft = (width - shapeObj.width) / 2;\n const diffTop = (height - shapeObj.height) / 2;\n const cropX = shapeObj.left - shapeObj.width / 2 - diffLeft;\n const cropY = shapeObj.top - shapeObj.height / 2 - diffTop;\n let left = width / 2 - diffLeft;\n let top = height / 2 - diffTop;\n const fillImageMaxSize = Math.max(width, height) + Math.max(diffLeft, diffTop);\n\n [left, top, width, height] = calculateFillImageDimensionOutsideCanvas({\n shapeObj,\n left,\n top,\n width,\n height,\n cropX,\n cropY,\n flipX,\n flipY,\n right,\n bottom,\n });\n\n fillImage.set({\n angle: flipX === flipY ? -angle : angle,\n left,\n top,\n width,\n height,\n cropX,\n cropY,\n flipX,\n flipY,\n });\n\n setCustomProperty(fillImage, { fillImageMaxSize });\n}\n\n/**\n * Make filter option from fabric image\n * @param {fabric.Image} imageObject - fabric image object\n * @returns {object}\n */\nexport function makeFilterOptionFromFabricImage(imageObject) {\n return map(imageObject.filters, (filter) => {\n const [key] = Object.keys(filter);\n\n return {\n [FILTER_NAME_VALUE_MAP[key]]: filter[key],\n };\n });\n}\n\n/**\n * Calculate fill image position and size for out of Canvas\n * @param {Object} options - options for position dimension calculate\n * @param {fabric.Object} shapeObj - shape object\n * @param {number} left - original left position\n * @param {number} top - original top position\n * @param {number} width - image width\n * @param {number} height - image height\n * @param {number} cropX - image cropX\n * @param {number} cropY - image cropY\n * @param {boolean} flipX - shape flipX\n * @param {boolean} flipY - shape flipY\n * @returns {Object}\n */\nfunction calculateFillImageDimensionOutsideCanvas({\n shapeObj,\n left,\n top,\n width,\n height,\n cropX,\n cropY,\n flipX,\n flipY,\n right,\n bottom,\n}) {\n const overflowAreaPositionFixer = (type, outDistance, imageLeft, imageTop) =>\n calculateDistanceOverflowPart({\n type,\n outDistance,\n shapeObj,\n flipX,\n flipY,\n left: imageLeft,\n top: imageTop,\n });\n const [originalWidth, originalHeight] = [width, height];\n\n [left, top, width, height] = calculateDimensionLeftTopEdge(overflowAreaPositionFixer, {\n left,\n top,\n width,\n height,\n cropX,\n cropY,\n });\n\n [left, top, width, height] = calculateDimensionRightBottomEdge(overflowAreaPositionFixer, {\n left,\n top,\n insideCanvasRealImageWidth: width,\n insideCanvasRealImageHeight: height,\n right,\n bottom,\n cropX,\n cropY,\n originalWidth,\n originalHeight,\n });\n\n return [left, top, width, height];\n}\n\n/**\n * Calculate fill image position and size for for right bottom edge\n * @param {Function} overflowAreaPositionFixer - position fixer\n * @param {Object} options - options for position dimension calculate\n * @param {fabric.Object} shapeObj - shape object\n * @param {number} left - original left position\n * @param {number} top - original top position\n * @param {number} width - image width\n * @param {number} height - image height\n * @param {number} right - image right\n * @param {number} bottom - image bottom\n * @param {number} cropX - image cropX\n * @param {number} cropY - image cropY\n * @param {boolean} originalWidth - image original width\n * @param {boolean} originalHeight - image original height\n * @returns {Object}\n */\nfunction calculateDimensionRightBottomEdge(\n overflowAreaPositionFixer,\n {\n left,\n top,\n insideCanvasRealImageWidth,\n insideCanvasRealImageHeight,\n right,\n bottom,\n cropX,\n cropY,\n originalWidth,\n originalHeight,\n }\n) {\n let [width, height] = [insideCanvasRealImageWidth, insideCanvasRealImageHeight];\n const { width: canvasWidth, height: canvasHeight } = cachedCanvasImageElement;\n\n if (right > canvasWidth && cropX > 0) {\n width = originalWidth - Math.abs(right - canvasWidth);\n }\n if (bottom > canvasHeight && cropY > 0) {\n height = originalHeight - Math.abs(bottom - canvasHeight);\n }\n\n const diff = {\n x: (insideCanvasRealImageWidth - width) / 2,\n y: (insideCanvasRealImageHeight - height) / 2,\n };\n\n forEach(['x', 'y'], (type) => {\n const cropDistance2 = diff[type];\n if (cropDistance2 > 0) {\n [left, top] = overflowAreaPositionFixer(type, cropDistance2, left, top);\n }\n });\n\n return [left, top, width, height];\n}\n\n/**\n * Calculate fill image position and size for for left top\n * @param {Function} overflowAreaPositionFixer - position fixer\n * @param {Object} options - options for position dimension calculate\n * @param {fabric.Object} shapeObj - shape object\n * @param {number} left - original left position\n * @param {number} top - original top position\n * @param {number} width - image width\n * @param {number} height - image height\n * @param {number} cropX - image cropX\n * @param {number} cropY - image cropY\n * @returns {Object}\n */\nfunction calculateDimensionLeftTopEdge(\n overflowAreaPositionFixer,\n { left, top, width, height, cropX, cropY }\n) {\n const dimension = {\n width,\n height,\n };\n\n forEach(['x', 'y'], (type) => {\n const cropDistance = type === 'x' ? cropX : cropY;\n const compareSize = dimension[POSITION_DIMENSION_MAP[type]];\n const standardSize = cachedCanvasImageElement[POSITION_DIMENSION_MAP[type]];\n\n if (compareSize > standardSize) {\n const outDistance = (compareSize - standardSize) / 2;\n\n dimension[POSITION_DIMENSION_MAP[type]] = standardSize;\n [left, top] = overflowAreaPositionFixer(type, outDistance, left, top);\n }\n if (cropDistance < 0) {\n [left, top] = overflowAreaPositionFixer(type, cropDistance, left, top);\n }\n });\n\n return [left, top, dimension.width, dimension.height];\n}\n\n/**\n * Make fill property of dynamic pattern type\n * @param {fabric.Image} canvasImage - canvas background image\n * @param {Array} filterOption - filter option\n * @param {fabric.StaticCanvas} patternSourceCanvas - fabric static canvas\n * @returns {Object}\n */\nexport function makeFillPatternForFilter(canvasImage, filterOption, patternSourceCanvas) {\n const copiedCanvasElement = getCachedCanvasImageElement(canvasImage);\n const fillImage = makeFillImage(copiedCanvasElement, canvasImage.angle, filterOption);\n patternSourceCanvas.add(fillImage);\n\n const fabricProperty = {\n fill: new fabric.Pattern({\n source: patternSourceCanvas.getElement(),\n repeat: 'no-repeat',\n }),\n };\n\n setCustomProperty(fabricProperty, { patternSourceCanvas });\n\n return fabricProperty;\n}\n\n/**\n * Reset fill pattern canvas\n * @param {fabric.StaticCanvas} patternSourceCanvas - fabric static canvas\n */\nexport function resetFillPatternCanvas(patternSourceCanvas) {\n const [innerImage] = patternSourceCanvas.getObjects();\n let { fillImageMaxSize } = getCustomProperty(innerImage, 'fillImageMaxSize');\n fillImageMaxSize = Math.max(1, fillImageMaxSize);\n\n patternSourceCanvas.setDimensions({\n width: fillImageMaxSize,\n height: fillImageMaxSize,\n });\n patternSourceCanvas.renderAll();\n}\n\n/**\n * Remake filter pattern image source\n * @param {fabric.Object} shapeObj - Shape object\n * @param {fabric.Image} canvasImage - canvas background image\n */\nexport function reMakePatternImageSource(shapeObj, canvasImage) {\n const { patternSourceCanvas } = getCustomProperty(shapeObj, 'patternSourceCanvas');\n const [fillImage] = patternSourceCanvas.getObjects();\n const filterOption = makeFilterOptionFromFabricImage(fillImage);\n\n patternSourceCanvas.remove(fillImage);\n\n const copiedCanvasElement = getCachedCanvasImageElement(canvasImage, true);\n const newFillImage = makeFillImage(copiedCanvasElement, canvasImage.angle, filterOption);\n\n patternSourceCanvas.add(newFillImage);\n}\n\n/**\n * Calculate a point line outside the canvas.\n * @param {fabric.Image} canvasImage - canvas background image\n * @param {boolean} reset - default is false\n * @returns {HTMLImageElement}\n */\nexport function getCachedCanvasImageElement(canvasImage, reset = false) {\n if (!cachedCanvasImageElement || reset) {\n cachedCanvasImageElement = canvasImage.toCanvasElement();\n }\n\n return cachedCanvasImageElement;\n}\n\n/**\n * Calculate fill image position for out of Canvas\n * @param {string} type - 'x' or 'y'\n * @param {fabric.Object} shapeObj - shape object\n * @param {number} outDistance - distance away\n * @param {number} left - original left position\n * @param {number} top - original top position\n * @returns {Array}\n */\nfunction calculateDistanceOverflowPart({ type, shapeObj, outDistance, left, top, flipX, flipY }) {\n const shapePointNavigation = getShapeEdgePoint(shapeObj);\n const shapeNeighborPointNavigation = [\n [1, 2],\n [0, 3],\n [0, 3],\n [1, 2],\n ];\n const linePointsOutsideCanvas = calculateLinePointsOutsideCanvas(\n type,\n shapePointNavigation,\n shapeNeighborPointNavigation\n );\n const reatAngles = calculateLineAngleOfOutsideCanvas(\n type,\n shapePointNavigation,\n linePointsOutsideCanvas\n );\n const { startPointIndex } = linePointsOutsideCanvas;\n const diffPosition = getReversePositionForFlip({\n outDistance,\n startPointIndex,\n flipX,\n flipY,\n reatAngles,\n });\n\n return [left + diffPosition.left, top + diffPosition.top];\n}\n\n/**\n * Calculate fill image position for out of Canvas\n * @param {number} outDistance - distance away\n * @param {boolean} flipX - flip x statux\n * @param {boolean} flipY - flip y statux\n * @param {Array} reatAngles - Line angle of the rectangle vertex.\n * @returns {Object} diffPosition\n */\nfunction getReversePositionForFlip({ outDistance, startPointIndex, flipX, flipY, reatAngles }) {\n const rotationChangePoint1 = outDistance * Math.cos((reatAngles[0] * Math.PI) / 180);\n const rotationChangePoint2 = outDistance * Math.cos((reatAngles[1] * Math.PI) / 180);\n const isForward = startPointIndex === 2 || startPointIndex === 3;\n const diffPosition = {\n top: isForward ? rotationChangePoint1 : rotationChangePoint2,\n left: isForward ? rotationChangePoint2 : rotationChangePoint1,\n };\n\n if (isReverseLeftPositionForFlip(startPointIndex, flipX, flipY)) {\n diffPosition.left = diffPosition.left * -1;\n }\n if (isReverseTopPositionForFlip(startPointIndex, flipX, flipY)) {\n diffPosition.top = diffPosition.top * -1;\n }\n\n return diffPosition;\n}\n\n/**\n * Calculate a point line outside the canvas.\n * @param {string} type - 'x' or 'y'\n * @param {Array} shapePointNavigation - shape edge positions\n * @param {Object} shapePointNavigation.lefttop - left top position\n * @param {Object} shapePointNavigation.righttop - right top position\n * @param {Object} shapePointNavigation.leftbottom - lefttop position\n * @param {Object} shapePointNavigation.rightbottom - rightbottom position\n * @param {Array} shapeNeighborPointNavigation - Array to find adjacent edges.\n * @returns {Object}\n */\nfunction calculateLinePointsOutsideCanvas(\n type,\n shapePointNavigation,\n shapeNeighborPointNavigation\n) {\n let minimumPoint = 0;\n let minimumPointIndex = 0;\n forEach(shapePointNavigation, (point, index) => {\n if (point[type] < minimumPoint) {\n minimumPoint = point[type];\n minimumPointIndex = index;\n }\n });\n\n const [endPointIndex1, endPointIndex2] = shapeNeighborPointNavigation[minimumPointIndex];\n\n return {\n startPointIndex: minimumPointIndex,\n endPointIndex1,\n endPointIndex2,\n };\n}\n\n/**\n * Calculate a point line outside the canvas.\n * @param {string} type - 'x' or 'y'\n * @param {Array} shapePointNavigation - shape edge positions\n * @param {object} shapePointNavigation.lefttop - left top position\n * @param {object} shapePointNavigation.righttop - right top position\n * @param {object} shapePointNavigation.leftbottom - lefttop position\n * @param {object} shapePointNavigation.rightbottom - rightbottom position\n * @param {Object} linePointsOfOneVertexIndex - Line point of one vertex\n * @param {Object} linePointsOfOneVertexIndex.startPoint - start point index\n * @param {Object} linePointsOfOneVertexIndex.endPointIndex1 - end point index\n * @param {Object} linePointsOfOneVertexIndex.endPointIndex2 - end point index\n * @returns {Object}\n */\nfunction calculateLineAngleOfOutsideCanvas(type, shapePointNavigation, linePointsOfOneVertexIndex) {\n const { startPointIndex, endPointIndex1, endPointIndex2 } = linePointsOfOneVertexIndex;\n const horizontalVerticalAngle = type === 'x' ? 180 : 270;\n\n return map([endPointIndex1, endPointIndex2], (pointIndex) => {\n const startPoint = shapePointNavigation[startPointIndex];\n const endPoint = shapePointNavigation[pointIndex];\n const diffY = startPoint.y - endPoint.y;\n const diffX = startPoint.x - endPoint.x;\n\n return (Math.atan2(diffY, diffX) * 180) / Math.PI - horizontalVerticalAngle;\n });\n}\n\n/* eslint-disable complexity */\n/**\n * Calculate a point line outside the canvas for horizontal.\n * @param {number} startPointIndex - start point index\n * @param {boolean} flipX - flip x statux\n * @param {boolean} flipY - flip y statux\n * @returns {boolean} flipY - flip y statux\n */\nfunction isReverseLeftPositionForFlip(startPointIndex, flipX, flipY) {\n return (\n (((!flipX && flipY) || (!flipX && !flipY)) && startPointIndex === 0) ||\n (((flipX && flipY) || (flipX && !flipY)) && startPointIndex === 1) ||\n (((!flipX && !flipY) || (!flipX && flipY)) && startPointIndex === 2) ||\n (((flipX && !flipY) || (flipX && flipY)) && startPointIndex === 3)\n );\n}\n/* eslint-enable complexity */\n\n/* eslint-disable complexity */\n/**\n * Calculate a point line outside the canvas for vertical.\n * @param {number} startPointIndex - start point index\n * @param {boolean} flipX - flip x statux\n * @param {boolean} flipY - flip y statux\n * @returns {boolean} flipY - flip y statux\n */\nfunction isReverseTopPositionForFlip(startPointIndex, flipX, flipY) {\n return (\n (((flipX && !flipY) || (!flipX && !flipY)) && startPointIndex === 0) ||\n (((!flipX && !flipY) || (flipX && !flipY)) && startPointIndex === 1) ||\n (((flipX && flipY) || (!flipX && flipY)) && startPointIndex === 2) ||\n (((!flipX && flipY) || (flipX && flipY)) && startPointIndex === 3)\n );\n}\n/* eslint-enable complexity */\n\n/**\n * Shape edge points\n * @param {fabric.Object} shapeObj - Selected shape object on canvas\n * @returns {Array} shapeEdgePoint - shape edge positions\n */\nfunction getShapeEdgePoint(shapeObj) {\n return [\n shapeObj.getPointByOrigin('left', 'top'),\n shapeObj.getPointByOrigin('right', 'top'),\n shapeObj.getPointByOrigin('left', 'bottom'),\n shapeObj.getPointByOrigin('right', 'bottom'),\n ];\n}\n\n/**\n * Rotated shape dimension\n * @param {fabric.Object} shapeObj - Shape object\n * @returns {Object} Rotated shape dimension\n */\nfunction getRotatedDimension(shapeObj) {\n const [\n { x: ax, y: ay },\n { x: bx, y: by },\n { x: cx, y: cy },\n { x: dx, y: dy },\n ] = getShapeEdgePoint(shapeObj);\n\n const left = Math.min(ax, bx, cx, dx);\n const top = Math.min(ay, by, cy, dy);\n const right = Math.max(ax, bx, cx, dx);\n const bottom = Math.max(ay, by, cy, dy);\n\n return {\n left,\n top,\n right,\n bottom,\n width: right - left,\n height: bottom - top,\n };\n}\n\n/**\n * Make fill image\n * @param {HTMLImageElement} copiedCanvasElement - html image element\n * @param {number} currentCanvasImageAngle - current canvas angle\n * @param {Array} filterOption - filter option\n * @returns {fabric.Image}\n * @private\n */\nfunction makeFillImage(copiedCanvasElement, currentCanvasImageAngle, filterOption) {\n const fillImage = new fabric.Image(copiedCanvasElement);\n\n forEach(extend({}, ...filterOption), (value, key) => {\n const fabricFilterClassName = capitalizeString(key);\n const filter = new fabric.Image.filters[fabricFilterClassName]({\n [FILTER_OPTION_MAP[key]]: value,\n });\n fillImage.filters.push(filter);\n });\n fillImage.applyFilters();\n\n setCustomProperty(fillImage, {\n originalAngle: currentCanvasImageAngle,\n fillImageMaxSize: Math.max(fillImage.width, fillImage.height),\n });\n resizeHelper.adjustOriginToCenter(fillImage);\n\n return fillImage;\n}\n","/**\n * @author NHN. FE Development Team \n * @fileoverview Shape resize helper\n */\nconst DIVISOR = {\n rect: 1,\n circle: 2,\n triangle: 1,\n};\nconst DIMENSION_KEYS = {\n rect: {\n w: 'width',\n h: 'height',\n },\n circle: {\n w: 'rx',\n h: 'ry',\n },\n triangle: {\n w: 'width',\n h: 'height',\n },\n};\n\n/**\n * Set the start point value to the shape object\n * @param {fabric.Object} shape - Shape object\n * @ignore\n */\nfunction setStartPoint(shape) {\n const { originX, originY } = shape;\n const originKey = originX.substring(0, 1) + originY.substring(0, 1);\n\n shape.startPoint = shape.origins[originKey];\n}\n\n/**\n * Get the positions of ratated origin by the pointer value\n * @param {{x: number, y: number}} origin - Origin value\n * @param {{x: number, y: number}} pointer - Pointer value\n * @param {number} angle - Rotating angle\n * @returns {Object} Postions of origin\n * @ignore\n */\nfunction getPositionsOfRotatedOrigin(origin, pointer, angle) {\n const sx = origin.x;\n const sy = origin.y;\n const px = pointer.x;\n const py = pointer.y;\n const r = (angle * Math.PI) / 180;\n const rx = (px - sx) * Math.cos(r) - (py - sy) * Math.sin(r) + sx;\n const ry = (px - sx) * Math.sin(r) + (py - sy) * Math.cos(r) + sy;\n\n return {\n originX: sx > rx ? 'right' : 'left',\n originY: sy > ry ? 'bottom' : 'top',\n };\n}\n\n/**\n * Whether the shape has the center origin or not\n * @param {fabric.Object} shape - Shape object\n * @returns {boolean} State\n * @ignore\n */\nfunction hasCenterOrigin(shape) {\n return shape.originX === 'center' && shape.originY === 'center';\n}\n\n/**\n * Adjust the origin of shape by the start point\n * @param {{x: number, y: number}} pointer - Pointer value\n * @param {fabric.Object} shape - Shape object\n * @ignore\n */\nfunction adjustOriginByStartPoint(pointer, shape) {\n const centerPoint = shape.getPointByOrigin('center', 'center');\n const angle = -shape.angle;\n const originPositions = getPositionsOfRotatedOrigin(centerPoint, pointer, angle);\n const { originX, originY } = originPositions;\n const origin = shape.getPointByOrigin(originX, originY);\n const left = shape.left - (centerPoint.x - origin.x);\n const top = shape.top - (centerPoint.y - origin.y);\n\n shape.set({\n originX,\n originY,\n left,\n top,\n });\n\n shape.setCoords();\n}\n\n/**\n * Adjust the origin of shape by the moving pointer value\n * @param {{x: number, y: number}} pointer - Pointer value\n * @param {fabric.Object} shape - Shape object\n * @ignore\n */\nfunction adjustOriginByMovingPointer(pointer, shape) {\n const origin = shape.startPoint;\n const angle = -shape.angle;\n const originPositions = getPositionsOfRotatedOrigin(origin, pointer, angle);\n const { originX, originY } = originPositions;\n\n shape.setPositionByOrigin(origin, originX, originY);\n shape.setCoords();\n}\n\n/**\n * Adjust the dimension of shape on firing scaling event\n * @param {fabric.Object} shape - Shape object\n * @ignore\n */\nfunction adjustDimensionOnScaling(shape) {\n const { type, scaleX, scaleY } = shape;\n const dimensionKeys = DIMENSION_KEYS[type];\n let width = shape[dimensionKeys.w] * scaleX;\n let height = shape[dimensionKeys.h] * scaleY;\n\n if (shape.isRegular) {\n const maxScale = Math.max(scaleX, scaleY);\n\n width = shape[dimensionKeys.w] * maxScale;\n height = shape[dimensionKeys.h] * maxScale;\n }\n\n const options = {\n hasControls: false,\n hasBorders: false,\n scaleX: 1,\n scaleY: 1,\n };\n\n options[dimensionKeys.w] = width;\n options[dimensionKeys.h] = height;\n\n shape.set(options);\n}\n\n/**\n * Adjust the dimension of shape on firing mouse move event\n * @param {{x: number, y: number}} pointer - Pointer value\n * @param {fabric.Object} shape - Shape object\n * @ignore\n */\nfunction adjustDimensionOnMouseMove(pointer, shape) {\n const { type, strokeWidth, startPoint: origin } = shape;\n const divisor = DIVISOR[type];\n const dimensionKeys = DIMENSION_KEYS[type];\n const isTriangle = !!(shape.type === 'triangle');\n const options = {};\n let width = Math.abs(origin.x - pointer.x) / divisor;\n let height = Math.abs(origin.y - pointer.y) / divisor;\n\n if (width > strokeWidth) {\n width -= strokeWidth / divisor;\n }\n\n if (height > strokeWidth) {\n height -= strokeWidth / divisor;\n }\n\n if (shape.isRegular) {\n width = height = Math.max(width, height);\n\n if (isTriangle) {\n height = (Math.sqrt(3) / 2) * width;\n }\n }\n\n options[dimensionKeys.w] = width;\n options[dimensionKeys.h] = height;\n\n shape.set(options);\n}\n\nmodule.exports = {\n /**\n * Set each origin value to shape\n * @param {fabric.Object} shape - Shape object\n */\n setOrigins(shape) {\n const leftTopPoint = shape.getPointByOrigin('left', 'top');\n const rightTopPoint = shape.getPointByOrigin('right', 'top');\n const rightBottomPoint = shape.getPointByOrigin('right', 'bottom');\n const leftBottomPoint = shape.getPointByOrigin('left', 'bottom');\n\n shape.origins = {\n lt: leftTopPoint,\n rt: rightTopPoint,\n rb: rightBottomPoint,\n lb: leftBottomPoint,\n };\n },\n\n /**\n * Resize the shape\n * @param {fabric.Object} shape - Shape object\n * @param {{x: number, y: number}} pointer - Mouse pointer values on canvas\n * @param {boolean} isScaling - Whether the resizing action is scaling or not\n */\n resize(shape, pointer, isScaling) {\n if (hasCenterOrigin(shape)) {\n adjustOriginByStartPoint(pointer, shape);\n setStartPoint(shape);\n }\n\n if (isScaling) {\n adjustDimensionOnScaling(shape, pointer);\n } else {\n adjustDimensionOnMouseMove(pointer, shape);\n }\n\n adjustOriginByMovingPointer(pointer, shape);\n },\n\n /**\n * Adjust the origin position of shape to center\n * @param {fabric.Object} shape - Shape object\n */\n adjustOriginToCenter(shape) {\n const centerPoint = shape.getPointByOrigin('center', 'center');\n const { originX, originY } = shape;\n const origin = shape.getPointByOrigin(originX, originY);\n const left = shape.left + (centerPoint.x - origin.x);\n const top = shape.top + (centerPoint.y - origin.y);\n\n shape.set({\n hasControls: true,\n hasBorders: true,\n originX: 'center',\n originY: 'center',\n left,\n top,\n });\n\n shape.setCoords(); // For left, top properties\n },\n};\n","/**\n * @author NHN. FE Development Team \n * @fileoverview Image-editor application class\n */\nimport snippet from 'tui-code-snippet';\nimport Invoker from '@/invoker';\nimport UI from '@/ui';\nimport action from '@/action';\nimport commandFactory from '@/factory/command';\nimport Graphics from '@/graphics';\nimport { makeSelectionUndoData, makeSelectionUndoDatum } from '@/helper/selectionModifyHelper';\nimport { sendHostName, Promise, getObjectType } from '@/util';\nimport {\n eventNames as events,\n commandNames as commands,\n keyCodes,\n rejectMessages,\n OBJ_TYPE,\n} from '@/consts';\n\nconst { isUndefined, forEach, CustomEvents } = snippet;\n\nconst {\n MOUSE_DOWN,\n OBJECT_MOVED,\n OBJECT_SCALED,\n OBJECT_ACTIVATED,\n OBJECT_ROTATED,\n OBJECT_ADDED,\n OBJECT_MODIFIED,\n ADD_TEXT,\n ADD_OBJECT,\n TEXT_EDITING,\n TEXT_CHANGED,\n ICON_CREATE_RESIZE,\n ICON_CREATE_END,\n SELECTION_CLEARED,\n SELECTION_CREATED,\n ADD_OBJECT_AFTER,\n} = events;\n\n/**\n * Image filter result\n * @typedef {object} FilterResult\n * @property {string} type - filter type like 'mask', 'Grayscale' and so on\n * @property {string} action - action type like 'add', 'remove'\n */\n\n/**\n * Flip status\n * @typedef {object} FlipStatus\n * @property {boolean} flipX - x axis\n * @property {boolean} flipY - y axis\n * @property {Number} angle - angle\n */\n/**\n * Rotation status\n * @typedef {Number} RotateStatus\n * @property {Number} angle - angle\n */\n\n/**\n * Old and new Size\n * @typedef {object} SizeChange\n * @property {Number} oldWidth - old width\n * @property {Number} oldHeight - old height\n * @property {Number} newWidth - new width\n * @property {Number} newHeight - new height\n */\n\n/**\n * @typedef {string} ErrorMsg - {string} error message\n */\n\n/**\n * @typedef {object} ObjectProps - graphics object properties\n * @property {number} id - object id\n * @property {string} type - object type\n * @property {string} text - text content\n * @property {(string | number)} left - Left\n * @property {(string | number)} top - Top\n * @property {(string | number)} width - Width\n * @property {(string | number)} height - Height\n * @property {string} fill - Color\n * @property {string} stroke - Stroke\n * @property {(string | number)} strokeWidth - StrokeWidth\n * @property {string} fontFamily - Font type for text\n * @property {number} fontSize - Font Size\n * @property {string} fontStyle - Type of inclination (normal / italic)\n * @property {string} fontWeight - Type of thicker or thinner looking (normal / bold)\n * @property {string} textAlign - Type of text align (left / center / right)\n * @property {string} textDecoration - Type of line (underline / line-through / overline)\n */\n\n/**\n * Shape filter option\n * @typedef {object.} ShapeFilterOption\n */\n\n/**\n * Shape filter option\n * @typedef {object} ShapeFillOption - fill option of shape\n * @property {string} type - fill type ('color' or 'filter')\n * @property {Array.} [filter] - {@link ShapeFilterOption} List.\n * only applies to filter types\n * (ex: \\[\\{pixelate: 20\\}, \\{blur: 0.3\\}\\])\n * @property {string} [color] - Shape foreground color (ex: '#fff', 'transparent')\n */\n\n/**\n * Image editor\n * @class\n * @param {string|HTMLElement} wrapper - Wrapper's element or selector\n * @param {Object} [options] - Canvas max width & height of css\n * @param {number} [options.includeUI] - Use the provided UI\n * @param {Object} [options.includeUI.loadImage] - Basic editing image\n * @param {string} options.includeUI.loadImage.path - image path\n * @param {string} options.includeUI.loadImage.name - image name\n * @param {Object} [options.includeUI.theme] - Theme object\n * @param {Array} [options.includeUI.menu] - It can be selected when only specific menu is used, Default values are \\['crop', 'flip', 'rotate', 'draw', 'shape', 'icon', 'text', 'mask', 'filter'\\].\n * @param {string} [options.includeUI.initMenu] - The first menu to be selected and started.\n * @param {Object} [options.includeUI.uiSize] - ui size of editor\n * @param {string} options.includeUI.uiSize.width - width of ui\n * @param {string} options.includeUI.uiSize.height - height of ui\n * @param {string} [options.includeUI.menuBarPosition=bottom] - Menu bar position('top', 'bottom', 'left', 'right')\n * @param {number} options.cssMaxWidth - Canvas css-max-width\n * @param {number} options.cssMaxHeight - Canvas css-max-height\n * @param {Object} [options.selectionStyle] - selection style\n * @param {string} [options.selectionStyle.cornerStyle] - selection corner style\n * @param {number} [options.selectionStyle.cornerSize] - selection corner size\n * @param {string} [options.selectionStyle.cornerColor] - selection corner color\n * @param {string} [options.selectionStyle.cornerStrokeColor] = selection corner stroke color\n * @param {boolean} [options.selectionStyle.transparentCorners] - selection corner transparent\n * @param {number} [options.selectionStyle.lineWidth] - selection line width\n * @param {string} [options.selectionStyle.borderColor] - selection border color\n * @param {number} [options.selectionStyle.rotatingPointOffset] - selection rotating point length\n * @param {Boolean} [options.usageStatistics=true] - Let us know the hostname. If you don't want to send the hostname, please set to false.\n * @example\n * var ImageEditor = require('tui-image-editor');\n * var blackTheme = require('./js/theme/black-theme.js');\n * var instance = new ImageEditor(document.querySelector('#tui-image-editor'), {\n * includeUI: {\n * loadImage: {\n * path: 'img/sampleImage.jpg',\n * name: 'SampleImage'\n * },\n * theme: blackTheme, // or whiteTheme\n * menu: ['shape', 'filter'],\n * initMenu: 'filter',\n * uiSize: {\n * width: '1000px',\n * height: '700px'\n * },\n * menuBarPosition: 'bottom'\n * },\n * cssMaxWidth: 700,\n * cssMaxHeight: 500,\n * selectionStyle: {\n * cornerSize: 20,\n * rotatingPointOffset: 70\n * }\n * });\n */\nclass ImageEditor {\n constructor(wrapper, options) {\n options = snippet.extend(\n {\n includeUI: false,\n usageStatistics: true,\n },\n options\n );\n\n this.mode = null;\n\n this.activeObjectId = null;\n\n /**\n * UI instance\n * @type {Ui}\n */\n if (options.includeUI) {\n const UIOption = options.includeUI;\n UIOption.usageStatistics = options.usageStatistics;\n\n this.ui = new UI(wrapper, UIOption, this.getActions());\n options = this.ui.setUiDefaultSelectionStyle(options);\n }\n\n /**\n * Invoker\n * @type {Invoker}\n * @private\n */\n this._invoker = new Invoker();\n\n /**\n * Graphics instance\n * @type {Graphics}\n * @private\n */\n this._graphics = new Graphics(this.ui ? this.ui.getEditorArea() : wrapper, {\n cssMaxWidth: options.cssMaxWidth,\n cssMaxHeight: options.cssMaxHeight,\n });\n\n /**\n * Event handler list\n * @type {Object}\n * @private\n */\n this._handlers = {\n keydown: this._onKeyDown.bind(this),\n mousedown: this._onMouseDown.bind(this),\n objectActivated: this._onObjectActivated.bind(this),\n objectMoved: this._onObjectMoved.bind(this),\n objectScaled: this._onObjectScaled.bind(this),\n objectRotated: this._onObjectRotated.bind(this),\n objectAdded: this._onObjectAdded.bind(this),\n objectModified: this._onObjectModified.bind(this),\n createdPath: this._onCreatedPath,\n addText: this._onAddText.bind(this),\n addObject: this._onAddObject.bind(this),\n textEditing: this._onTextEditing.bind(this),\n textChanged: this._onTextChanged.bind(this),\n iconCreateResize: this._onIconCreateResize.bind(this),\n iconCreateEnd: this._onIconCreateEnd.bind(this),\n selectionCleared: this._selectionCleared.bind(this),\n selectionCreated: this._selectionCreated.bind(this),\n };\n\n this._attachInvokerEvents();\n this._attachGraphicsEvents();\n this._attachDomEvents();\n this._setSelectionStyle(options.selectionStyle, {\n applyCropSelectionStyle: options.applyCropSelectionStyle,\n applyGroupSelectionStyle: options.applyGroupSelectionStyle,\n });\n\n if (options.usageStatistics) {\n sendHostName();\n }\n\n if (this.ui) {\n this.ui.initCanvas();\n this.setReAction();\n }\n fabric.enableGLFiltering = false;\n }\n\n /**\n * Set selection style by init option\n * @param {Object} selectionStyle - Selection styles\n * @param {Object} applyTargets - Selection apply targets\n * @param {boolean} applyCropSelectionStyle - whether apply with crop selection style or not\n * @param {boolean} applyGroupSelectionStyle - whether apply with group selection style or not\n * @private\n */\n _setSelectionStyle(selectionStyle, { applyCropSelectionStyle, applyGroupSelectionStyle }) {\n if (selectionStyle) {\n this._graphics.setSelectionStyle(selectionStyle);\n }\n\n if (applyCropSelectionStyle) {\n this._graphics.setCropSelectionStyle(selectionStyle);\n }\n\n if (applyGroupSelectionStyle) {\n this.on('selectionCreated', (eventTarget) => {\n if (eventTarget.type === 'activeSelection') {\n eventTarget.set(selectionStyle);\n }\n });\n }\n }\n\n /**\n * Attach invoker events\n * @private\n */\n _attachInvokerEvents() {\n const {\n UNDO_STACK_CHANGED,\n REDO_STACK_CHANGED,\n EXECUTE_COMMAND,\n AFTER_UNDO,\n AFTER_REDO,\n HAND_STARTED,\n HAND_STOPPED,\n } = events;\n\n /**\n * Undo stack changed event\n * @event ImageEditor#undoStackChanged\n * @param {Number} length - undo stack length\n * @example\n * imageEditor.on('undoStackChanged', function(length) {\n * console.log(length);\n * });\n */\n this._invoker.on(UNDO_STACK_CHANGED, this.fire.bind(this, UNDO_STACK_CHANGED));\n /**\n * Redo stack changed event\n * @event ImageEditor#redoStackChanged\n * @param {Number} length - redo stack length\n * @example\n * imageEditor.on('redoStackChanged', function(length) {\n * console.log(length);\n * });\n */\n this._invoker.on(REDO_STACK_CHANGED, this.fire.bind(this, REDO_STACK_CHANGED));\n\n if (this.ui) {\n const canvas = this._graphics.getCanvas();\n\n this._invoker.on(EXECUTE_COMMAND, (command) => this.ui.fire(EXECUTE_COMMAND, command));\n this._invoker.on(AFTER_UNDO, (command) => this.ui.fire(AFTER_UNDO, command));\n this._invoker.on(AFTER_REDO, (command) => this.ui.fire(AFTER_REDO, command));\n\n canvas.on(HAND_STARTED, () => this.ui.fire(HAND_STARTED));\n canvas.on(HAND_STOPPED, () => this.ui.fire(HAND_STOPPED));\n }\n }\n\n /**\n * Attach canvas events\n * @private\n */\n _attachGraphicsEvents() {\n this._graphics.on({\n [MOUSE_DOWN]: this._handlers.mousedown,\n [OBJECT_MOVED]: this._handlers.objectMoved,\n [OBJECT_SCALED]: this._handlers.objectScaled,\n [OBJECT_ROTATED]: this._handlers.objectRotated,\n [OBJECT_ACTIVATED]: this._handlers.objectActivated,\n [OBJECT_ADDED]: this._handlers.objectAdded,\n [OBJECT_MODIFIED]: this._handlers.objectModified,\n [ADD_TEXT]: this._handlers.addText,\n [ADD_OBJECT]: this._handlers.addObject,\n [TEXT_EDITING]: this._handlers.textEditing,\n [TEXT_CHANGED]: this._handlers.textChanged,\n [ICON_CREATE_RESIZE]: this._handlers.iconCreateResize,\n [ICON_CREATE_END]: this._handlers.iconCreateEnd,\n [SELECTION_CLEARED]: this._handlers.selectionCleared,\n [SELECTION_CREATED]: this._handlers.selectionCreated,\n });\n }\n\n /**\n * Attach dom events\n * @private\n */\n _attachDomEvents() {\n // ImageEditor supports IE 9 higher\n document.addEventListener('keydown', this._handlers.keydown);\n }\n\n /**\n * Detach dom events\n * @private\n */\n _detachDomEvents() {\n // ImageEditor supports IE 9 higher\n document.removeEventListener('keydown', this._handlers.keydown);\n }\n\n /**\n * Keydown event handler\n * @param {KeyboardEvent} e - Event object\n * @private\n */\n /* eslint-disable complexity */\n _onKeyDown(e) {\n const { ctrlKey, keyCode, metaKey } = e;\n const isModifierKey = ctrlKey || metaKey;\n\n if (isModifierKey) {\n if (keyCode === keyCodes.C) {\n this._graphics.resetTargetObjectForCopyPaste();\n } else if (keyCode === keyCodes.V) {\n this._graphics.pasteObject();\n this.clearRedoStack();\n } else if (keyCode === keyCodes.Z) {\n // There is no error message on shortcut when it's empty\n this.undo()['catch'](() => {});\n } else if (keyCode === keyCodes.Y) {\n // There is no error message on shortcut when it's empty\n this.redo()['catch'](() => {});\n }\n }\n\n const isDeleteKey = keyCode === keyCodes.BACKSPACE || keyCode === keyCodes.DEL;\n const isRemoveReady = this._graphics.isReadyRemoveObject();\n\n if (isRemoveReady && isDeleteKey) {\n e.preventDefault();\n this.removeActiveObject();\n }\n }\n\n /**\n * Remove Active Object\n */\n removeActiveObject() {\n const activeObjectId = this._graphics.getActiveObjectIdForRemove();\n\n this.removeObject(activeObjectId);\n }\n\n /**\n * mouse down event handler\n * @param {Event} event - mouse down event\n * @param {Object} originPointer - origin pointer\n * @param {Number} originPointer.x x position\n * @param {Number} originPointer.y y position\n * @private\n */\n _onMouseDown(event, originPointer) {\n /**\n * The mouse down event with position x, y on canvas\n * @event ImageEditor#mousedown\n * @param {Object} event - browser mouse event object\n * @param {Object} originPointer origin pointer\n * @param {Number} originPointer.x x position\n * @param {Number} originPointer.y y position\n * @example\n * imageEditor.on('mousedown', function(event, originPointer) {\n * console.log(event);\n * console.log(originPointer);\n * if (imageEditor.hasFilter('colorFilter')) {\n * imageEditor.applyFilter('colorFilter', {\n * x: parseInt(originPointer.x, 10),\n * y: parseInt(originPointer.y, 10)\n * });\n * }\n * });\n */\n\n this.fire(events.MOUSE_DOWN, event, originPointer);\n }\n\n /**\n * Add a 'addObject' command\n * @param {Object} obj - Fabric object\n * @private\n */\n _pushAddObjectCommand(obj) {\n const command = commandFactory.create(commands.ADD_OBJECT, this._graphics, obj);\n this._invoker.pushUndoStack(command);\n }\n\n /**\n * Add a 'changeSelection' command\n * @param {fabric.Object} obj - selection object\n * @private\n */\n _pushModifyObjectCommand(obj) {\n const { type } = obj;\n const props = makeSelectionUndoData(obj, (item) =>\n makeSelectionUndoDatum(this._graphics.getObjectId(item), item, type === 'activeSelection')\n );\n const command = commandFactory.create(commands.CHANGE_SELECTION, this._graphics, props);\n command.execute(this._graphics, props);\n\n this._invoker.pushUndoStack(command);\n }\n\n /**\n * 'objectActivated' event handler\n * @param {ObjectProps} props - object properties\n * @private\n */\n _onObjectActivated(props) {\n /**\n * The event when object is selected(aka activated).\n * @event ImageEditor#objectActivated\n * @param {ObjectProps} objectProps - object properties\n * @example\n * imageEditor.on('objectActivated', function(props) {\n * console.log(props);\n * console.log(props.type);\n * console.log(props.id);\n * });\n */\n this.fire(events.OBJECT_ACTIVATED, props);\n }\n\n /**\n * 'objectMoved' event handler\n * @param {ObjectProps} props - object properties\n * @private\n */\n _onObjectMoved(props) {\n /**\n * The event when object is moved\n * @event ImageEditor#objectMoved\n * @param {ObjectProps} props - object properties\n * @example\n * imageEditor.on('objectMoved', function(props) {\n * console.log(props);\n * console.log(props.type);\n * });\n */\n this.fire(events.OBJECT_MOVED, props);\n }\n\n /**\n * 'objectScaled' event handler\n * @param {ObjectProps} props - object properties\n * @private\n */\n _onObjectScaled(props) {\n /**\n * The event when scale factor is changed\n * @event ImageEditor#objectScaled\n * @param {ObjectProps} props - object properties\n * @example\n * imageEditor.on('objectScaled', function(props) {\n * console.log(props);\n * console.log(props.type);\n * });\n */\n this.fire(events.OBJECT_SCALED, props);\n }\n\n /**\n * 'objectRotated' event handler\n * @param {ObjectProps} props - object properties\n * @private\n */\n _onObjectRotated(props) {\n /**\n * The event when object angle is changed\n * @event ImageEditor#objectRotated\n * @param {ObjectProps} props - object properties\n * @example\n * imageEditor.on('objectRotated', function(props) {\n * console.log(props);\n * console.log(props.type);\n * });\n */\n this.fire(events.OBJECT_ROTATED, props);\n }\n\n /**\n * Get current drawing mode\n * @returns {string}\n * @example\n * // Image editor drawing mode\n * //\n * // NORMAL: 'NORMAL'\n * // CROPPER: 'CROPPER'\n * // FREE_DRAWING: 'FREE_DRAWING'\n * // LINE_DRAWING: 'LINE_DRAWING'\n * // TEXT: 'TEXT'\n * //\n * if (imageEditor.getDrawingMode() === 'FREE_DRAWING') {\n * imageEditor.stopDrawingMode();\n * }\n */\n getDrawingMode() {\n return this._graphics.getDrawingMode();\n }\n\n /**\n * Clear all objects\n * @returns {Promise}\n * @example\n * imageEditor.clearObjects();\n */\n clearObjects() {\n return this.execute(commands.CLEAR_OBJECTS);\n }\n\n /**\n * Deactivate all objects\n * @example\n * imageEditor.deactivateAll();\n */\n deactivateAll() {\n this._graphics.deactivateAll();\n this._graphics.renderAll();\n }\n\n /**\n * discard selction\n * @example\n * imageEditor.discardSelection();\n */\n discardSelection() {\n this._graphics.discardSelection();\n }\n\n /**\n * selectable status change\n * @param {boolean} selectable - selectable status\n * @example\n * imageEditor.changeSelectableAll(false); // or true\n */\n changeSelectableAll(selectable) {\n this._graphics.changeSelectableAll(selectable);\n }\n\n /**\n * Init history\n */\n _initHistory() {\n if (this.ui) {\n this.ui.initHistory();\n }\n }\n\n /**\n * Clear history\n */\n _clearHistory() {\n if (this.ui) {\n this.ui.clearHistory();\n }\n }\n\n /**\n * Invoke command\n * @param {String} commandName - Command name\n * @param {...*} args - Arguments for creating command\n * @returns {Promise}\n * @private\n */\n execute(commandName, ...args) {\n // Inject an Graphics instance as first parameter\n const theArgs = [this._graphics].concat(args);\n\n return this._invoker.execute(commandName, ...theArgs);\n }\n\n /**\n * Invoke command\n * @param {String} commandName - Command name\n * @param {...*} args - Arguments for creating command\n * @returns {Promise}\n * @private\n */\n executeSilent(commandName, ...args) {\n // Inject an Graphics instance as first parameter\n const theArgs = [this._graphics].concat(args);\n\n return this._invoker.executeSilent(commandName, ...theArgs);\n }\n\n /**\n * Undo\n * @param {number} [iterationCount=1] - Iteration count of undo\n * @returns {Promise}\n * @example\n * imageEditor.undo();\n */\n undo(iterationCount = 1) {\n let promise = Promise.resolve();\n\n for (let i = 0; i < iterationCount; i += 1) {\n promise = promise.then(() => this._invoker.undo());\n }\n\n return promise;\n }\n\n /**\n * Redo\n * @param {number} [iterationCount=1] - Iteration count of redo\n * @returns {Promise}\n * @example\n * imageEditor.redo();\n */\n redo(iterationCount = 1) {\n let promise = Promise.resolve();\n\n for (let i = 0; i < iterationCount; i += 1) {\n promise = promise.then(() => this._invoker.redo());\n }\n\n return promise;\n }\n\n /**\n * Zoom\n * @param {number} x - x axis of center point for zoom\n * @param {number} y - y axis of center point for zoom\n * @param {number} zoomLevel - level of zoom(1.0 ~ 5.0)\n */\n zoom({ x, y, zoomLevel }) {\n this._graphics.zoom({ x, y }, zoomLevel);\n }\n\n /**\n * Reset zoom. Change zoom level to 1.0\n */\n resetZoom() {\n this._graphics.resetZoom();\n }\n\n /**\n * Load image from file\n * @param {File} imgFile - Image file\n * @param {string} [imageName] - imageName\n * @returns {Promise}\n * @example\n * imageEditor.loadImageFromFile(file).then(result => {\n * console.log('old : ' + result.oldWidth + ', ' + result.oldHeight);\n * console.log('new : ' + result.newWidth + ', ' + result.newHeight);\n * });\n */\n loadImageFromFile(imgFile, imageName) {\n if (!imgFile) {\n return Promise.reject(rejectMessages.invalidParameters);\n }\n\n const imgUrl = URL.createObjectURL(imgFile);\n imageName = imageName || imgFile.name;\n\n return this.loadImageFromURL(imgUrl, imageName).then((value) => {\n URL.revokeObjectURL(imgFile);\n\n return value;\n });\n }\n\n /**\n * Load image from url\n * @param {string} url - File url\n * @param {string} imageName - imageName\n * @returns {Promise}\n * @example\n * imageEditor.loadImageFromURL('http://url/testImage.png', 'lena').then(result => {\n * console.log('old : ' + result.oldWidth + ', ' + result.oldHeight);\n * console.log('new : ' + result.newWidth + ', ' + result.newHeight);\n * });\n */\n loadImageFromURL(url, imageName) {\n if (!imageName || !url) {\n return Promise.reject(rejectMessages.invalidParameters);\n }\n\n return this.execute(commands.LOAD_IMAGE, imageName, url);\n }\n\n /**\n * Add image object on canvas\n * @param {string} imgUrl - Image url to make object\n * @returns {Promise}\n * @example\n * imageEditor.addImageObject('path/fileName.jpg').then(objectProps => {\n * console.log(ojectProps.id);\n * });\n */\n addImageObject(imgUrl) {\n if (!imgUrl) {\n return Promise.reject(rejectMessages.invalidParameters);\n }\n\n return this.execute(commands.ADD_IMAGE_OBJECT, imgUrl);\n }\n\n /**\n * Start a drawing mode. If the current mode is not 'NORMAL', 'stopDrawingMode()' will be called first.\n * @param {String} mode Can be one of 'CROPPER', 'FREE_DRAWING', 'LINE_DRAWING', 'TEXT', 'SHAPE'\n * @param {Object} [option] parameters of drawing mode, it's available with 'FREE_DRAWING', 'LINE_DRAWING'\n * @param {Number} [option.width] brush width\n * @param {String} [option.color] brush color\n * @param {Object} [option.arrowType] arrow decorate\n * @param {string} [option.arrowType.tail] arrow decorate for tail. 'chevron' or 'triangle'\n * @param {string} [option.arrowType.head] arrow decorate for head. 'chevron' or 'triangle'\n * @returns {boolean} true if success or false\n * @example\n * imageEditor.startDrawingMode('FREE_DRAWING', {\n * width: 10,\n * color: 'rgba(255,0,0,0.5)'\n * });\n * imageEditor.startDrawingMode('LINE_DRAWING', {\n * width: 10,\n * color: 'rgba(255,0,0,0.5)',\n * arrowType: {\n * tail: 'chevron' // triangle\n * }\n * });\n *\n */\n startDrawingMode(mode, option) {\n return this._graphics.startDrawingMode(mode, option);\n }\n\n /**\n * Stop the current drawing mode and back to the 'NORMAL' mode\n * @example\n * imageEditor.stopDrawingMode();\n */\n stopDrawingMode() {\n this._graphics.stopDrawingMode();\n }\n\n /**\n * Crop this image with rect\n * @param {Object} rect crop rect\n * @param {Number} rect.left left position\n * @param {Number} rect.top top position\n * @param {Number} rect.width width\n * @param {Number} rect.height height\n * @returns {Promise}\n * @example\n * imageEditor.crop(imageEditor.getCropzoneRect());\n */\n crop(rect) {\n const data = this._graphics.getCroppedImageData(rect);\n if (!data) {\n return Promise.reject(rejectMessages.invalidParameters);\n }\n\n return this.loadImageFromURL(data.url, data.imageName);\n }\n\n /**\n * Get the cropping rect\n * @returns {Object} {{left: number, top: number, width: number, height: number}} rect\n */\n getCropzoneRect() {\n return this._graphics.getCropzoneRect();\n }\n\n /**\n * Set the cropping rect\n * @param {number} [mode] crop rect mode [1, 1.5, 1.3333333333333333, 1.25, 1.7777777777777777]\n */\n setCropzoneRect(mode) {\n this._graphics.setCropzoneRect(mode);\n }\n\n /**\n * Flip\n * @returns {Promise}\n * @param {string} type - 'flipX' or 'flipY' or 'reset'\n * @returns {Promise}\n * @private\n */\n _flip(type) {\n return this.execute(commands.FLIP_IMAGE, type);\n }\n\n /**\n * Flip x\n * @returns {Promise}\n * @example\n * imageEditor.flipX().then((status => {\n * console.log('flipX: ', status.flipX);\n * console.log('flipY: ', status.flipY);\n * console.log('angle: ', status.angle);\n * }).catch(message => {\n * console.log('error: ', message);\n * });\n */\n flipX() {\n return this._flip('flipX');\n }\n\n /**\n * Flip y\n * @returns {Promise}\n * @example\n * imageEditor.flipY().then(status => {\n * console.log('flipX: ', status.flipX);\n * console.log('flipY: ', status.flipY);\n * console.log('angle: ', status.angle);\n * }).catch(message => {\n * console.log('error: ', message);\n * });\n */\n flipY() {\n return this._flip('flipY');\n }\n\n /**\n * Reset flip\n * @returns {Promise}\n * @example\n * imageEditor.resetFlip().then(status => {\n * console.log('flipX: ', status.flipX);\n * console.log('flipY: ', status.flipY);\n * console.log('angle: ', status.angle);\n * }).catch(message => {\n * console.log('error: ', message);\n * });;\n */\n resetFlip() {\n return this._flip('reset');\n }\n\n /**\n * @param {string} type - 'rotate' or 'setAngle'\n * @param {number} angle - angle value (degree)\n * @param {boolean} isSilent - is silent execution or not\n * @returns {Promise}\n * @private\n */\n _rotate(type, angle, isSilent) {\n let result = null;\n\n if (isSilent) {\n result = this.executeSilent(commands.ROTATE_IMAGE, type, angle);\n } else {\n result = this.execute(commands.ROTATE_IMAGE, type, angle);\n }\n\n return result;\n }\n\n /**\n * Rotate image\n * @returns {Promise}\n * @param {number} angle - Additional angle to rotate image\n * @param {boolean} isSilent - is silent execution or not\n * @returns {Promise}\n * @example\n * imageEditor.rotate(10); // angle = 10\n * imageEditor.rotate(10); // angle = 20\n * imageEditor.rotate(5); // angle = 5\n * imageEditor.rotate(-95); // angle = -90\n * imageEditor.rotate(10).then(status => {\n * console.log('angle: ', status.angle);\n * })).catch(message => {\n * console.log('error: ', message);\n * });\n */\n rotate(angle, isSilent) {\n return this._rotate('rotate', angle, isSilent);\n }\n\n /**\n * Set angle\n * @param {number} angle - Angle of image\n * @param {boolean} isSilent - is silent execution or not\n * @returns {Promise}\n * @example\n * imageEditor.setAngle(10); // angle = 10\n * imageEditor.rotate(10); // angle = 20\n * imageEditor.setAngle(5); // angle = 5\n * imageEditor.rotate(50); // angle = 55\n * imageEditor.setAngle(-40); // angle = -40\n * imageEditor.setAngle(10).then(status => {\n * console.log('angle: ', status.angle);\n * })).catch(message => {\n * console.log('error: ', message);\n * });\n */\n setAngle(angle, isSilent) {\n return this._rotate('setAngle', angle, isSilent);\n }\n\n /**\n * Set drawing brush\n * @param {Object} option brush option\n * @param {Number} option.width width\n * @param {String} option.color color like 'FFFFFF', 'rgba(0, 0, 0, 0.5)'\n * @example\n * imageEditor.startDrawingMode('FREE_DRAWING');\n * imageEditor.setBrush({\n * width: 12,\n * color: 'rgba(0, 0, 0, 0.5)'\n * });\n * imageEditor.setBrush({\n * width: 8,\n * color: 'FFFFFF'\n * });\n */\n setBrush(option) {\n this._graphics.setBrush(option);\n }\n\n /**\n * Set states of current drawing shape\n * @param {string} type - Shape type (ex: 'rect', 'circle', 'triangle')\n * @param {Object} [options] - Shape options\n * @param {(ShapeFillOption | string)} [options.fill] - {@link ShapeFillOption} or\n * Shape foreground color (ex: '#fff', 'transparent')\n * @param {string} [options.stoke] - Shape outline color\n * @param {number} [options.strokeWidth] - Shape outline width\n * @param {number} [options.width] - Width value (When type option is 'rect', this options can use)\n * @param {number} [options.height] - Height value (When type option is 'rect', this options can use)\n * @param {number} [options.rx] - Radius x value (When type option is 'circle', this options can use)\n * @param {number} [options.ry] - Radius y value (When type option is 'circle', this options can use)\n * @param {number} [options.isRegular] - Whether resizing shape has 1:1 ratio or not\n * @example\n * imageEditor.setDrawingShape('rect', {\n * fill: 'red',\n * width: 100,\n * height: 200\n * });\n * @example\n * imageEditor.setDrawingShape('rect', {\n * fill: {\n * type: 'filter',\n * filter: [{blur: 0.3}, {pixelate: 20}]\n * },\n * width: 100,\n * height: 200\n * });\n * @example\n * imageEditor.setDrawingShape('circle', {\n * fill: 'transparent',\n * stroke: 'blue',\n * strokeWidth: 3,\n * rx: 10,\n * ry: 100\n * });\n * @example\n * imageEditor.setDrawingShape('triangle', { // When resizing, the shape keep the 1:1 ratio\n * width: 1,\n * height: 1,\n * isRegular: true\n * });\n * @example\n * imageEditor.setDrawingShape('circle', { // When resizing, the shape keep the 1:1 ratio\n * rx: 10,\n * ry: 10,\n * isRegular: true\n * });\n */\n setDrawingShape(type, options) {\n this._graphics.setDrawingShape(type, options);\n }\n\n setDrawingIcon(type, iconColor) {\n this._graphics.setIconStyle(type, iconColor);\n }\n\n /**\n * Add shape\n * @param {string} type - Shape type (ex: 'rect', 'circle', 'triangle')\n * @param {Object} options - Shape options\n * @param {(ShapeFillOption | string)} [options.fill] - {@link ShapeFillOption} or\n * Shape foreground color (ex: '#fff', 'transparent')\n * @param {string} [options.stroke] - Shape outline color\n * @param {number} [options.strokeWidth] - Shape outline width\n * @param {number} [options.width] - Width value (When type option is 'rect', this options can use)\n * @param {number} [options.height] - Height value (When type option is 'rect', this options can use)\n * @param {number} [options.rx] - Radius x value (When type option is 'circle', this options can use)\n * @param {number} [options.ry] - Radius y value (When type option is 'circle', this options can use)\n * @param {number} [options.left] - Shape x position\n * @param {number} [options.top] - Shape y position\n * @param {boolean} [options.isRegular] - Whether resizing shape has 1:1 ratio or not\n * @returns {Promise}\n * @example\n * imageEditor.addShape('rect', {\n * fill: 'red',\n * stroke: 'blue',\n * strokeWidth: 3,\n * width: 100,\n * height: 200,\n * left: 10,\n * top: 10,\n * isRegular: true\n * });\n * @example\n * imageEditor.addShape('circle', {\n * fill: 'red',\n * stroke: 'blue',\n * strokeWidth: 3,\n * rx: 10,\n * ry: 100,\n * isRegular: false\n * }).then(objectProps => {\n * console.log(objectProps.id);\n * });\n * @example\n * imageEditor.addShape('rect', {\n * fill: {\n * type: 'filter',\n * filter: [{blur: 0.3}, {pixelate: 20}]\n * },\n * stroke: 'blue',\n * strokeWidth: 3,\n * rx: 10,\n * ry: 100,\n * isRegular: false\n * }).then(objectProps => {\n * console.log(objectProps.id);\n * });\n */\n addShape(type, options) {\n options = options || {};\n\n this._setPositions(options);\n\n return this.execute(commands.ADD_SHAPE, type, options);\n }\n\n /**\n * Change shape\n * @param {number} id - object id\n * @param {Object} options - Shape options\n * @param {(ShapeFillOption | string)} [options.fill] - {@link ShapeFillOption} or\n * Shape foreground color (ex: '#fff', 'transparent')\n * @param {string} [options.stroke] - Shape outline color\n * @param {number} [options.strokeWidth] - Shape outline width\n * @param {number} [options.width] - Width value (When type option is 'rect', this options can use)\n * @param {number} [options.height] - Height value (When type option is 'rect', this options can use)\n * @param {number} [options.rx] - Radius x value (When type option is 'circle', this options can use)\n * @param {number} [options.ry] - Radius y value (When type option is 'circle', this options can use)\n * @param {boolean} [options.isRegular] - Whether resizing shape has 1:1 ratio or not\n * @param {boolean} isSilent - is silent execution or not\n * @returns {Promise}\n * @example\n * // call after selecting shape object on canvas\n * imageEditor.changeShape(id, { // change rectagle or triangle\n * fill: 'red',\n * stroke: 'blue',\n * strokeWidth: 3,\n * width: 100,\n * height: 200\n * });\n * @example\n * // call after selecting shape object on canvas\n * imageEditor.changeShape(id, { // change circle\n * fill: 'red',\n * stroke: 'blue',\n * strokeWidth: 3,\n * rx: 10,\n * ry: 100\n * });\n */\n changeShape(id, options, isSilent) {\n const executeMethodName = isSilent ? 'executeSilent' : 'execute';\n\n return this[executeMethodName](commands.CHANGE_SHAPE, id, options);\n }\n\n /**\n * Add text on image\n * @param {string} text - Initial input text\n * @param {Object} [options] Options for generating text\n * @param {Object} [options.styles] Initial styles\n * @param {string} [options.styles.fill] Color\n * @param {string} [options.styles.fontFamily] Font type for text\n * @param {number} [options.styles.fontSize] Size\n * @param {string} [options.styles.fontStyle] Type of inclination (normal / italic)\n * @param {string} [options.styles.fontWeight] Type of thicker or thinner looking (normal / bold)\n * @param {string} [options.styles.textAlign] Type of text align (left / center / right)\n * @param {string} [options.styles.textDecoration] Type of line (underline / line-through / overline)\n * @param {{x: number, y: number}} [options.position] - Initial position\n * @param {boolean} [options.autofocus] - text autofocus, default is true\n * @returns {Promise}\n * @example\n * imageEditor.addText('init text');\n * @example\n * imageEditor.addText('init text', {\n * styles: {\n * fill: '#000',\n * fontSize: 20,\n * fontWeight: 'bold'\n * },\n * position: {\n * x: 10,\n * y: 10\n * }\n * }).then(objectProps => {\n * console.log(objectProps.id);\n * });\n */\n addText(text, options) {\n text = text || '';\n options = options || {};\n\n return this.execute(commands.ADD_TEXT, text, options);\n }\n\n /**\n * Change contents of selected text object on image\n * @param {number} id - object id\n * @param {string} text - Changing text\n * @returns {Promise}\n * @example\n * imageEditor.changeText(id, 'change text');\n */\n changeText(id, text) {\n text = text || '';\n\n return this.execute(commands.CHANGE_TEXT, id, text);\n }\n\n /**\n * Set style\n * @param {number} id - object id\n * @param {Object} styleObj - text styles\n * @param {string} [styleObj.fill] Color\n * @param {string} [styleObj.fontFamily] Font type for text\n * @param {number} [styleObj.fontSize] Size\n * @param {string} [styleObj.fontStyle] Type of inclination (normal / italic)\n * @param {string} [styleObj.fontWeight] Type of thicker or thinner looking (normal / bold)\n * @param {string} [styleObj.textAlign] Type of text align (left / center / right)\n * @param {string} [styleObj.textDecoration] Type of line (underline / line-through / overline)\n * @param {boolean} isSilent - is silent execution or not\n * @returns {Promise}\n * @example\n * imageEditor.changeTextStyle(id, {\n * fontStyle: 'italic'\n * });\n */\n changeTextStyle(id, styleObj, isSilent) {\n const executeMethodName = isSilent ? 'executeSilent' : 'execute';\n\n return this[executeMethodName](commands.CHANGE_TEXT_STYLE, id, styleObj);\n }\n\n /**\n * change text mode\n * @param {string} type - change type\n * @private\n */\n _changeActivateMode(type) {\n if (type !== 'ICON' && this.getDrawingMode() !== type) {\n this.startDrawingMode(type);\n }\n }\n\n /**\n * 'textChanged' event handler\n * @param {Object} target - changed text object\n * @private\n */\n _onTextChanged(target) {\n this.fire(events.TEXT_CHANGED, target);\n }\n\n /**\n * 'iconCreateResize' event handler\n * @param {Object} originPointer origin pointer\n * @param {Number} originPointer.x x position\n * @param {Number} originPointer.y y position\n * @private\n */\n _onIconCreateResize(originPointer) {\n this.fire(events.ICON_CREATE_RESIZE, originPointer);\n }\n\n /**\n * 'iconCreateEnd' event handler\n * @param {Object} originPointer origin pointer\n * @param {Number} originPointer.x x position\n * @param {Number} originPointer.y y position\n * @private\n */\n _onIconCreateEnd(originPointer) {\n this.fire(events.ICON_CREATE_END, originPointer);\n }\n\n /**\n * 'textEditing' event handler\n * @private\n */\n _onTextEditing() {\n /**\n * The event which starts to edit text object\n * @event ImageEditor#textEditing\n * @example\n * imageEditor.on('textEditing', function() {\n * console.log('text editing');\n * });\n */\n\n this.fire(events.TEXT_EDITING);\n }\n\n /**\n * Mousedown event handler in case of 'TEXT' drawing mode\n * @param {fabric.Event} event - Current mousedown event object\n * @private\n */\n _onAddText(event) {\n /**\n * The event when 'TEXT' drawing mode is enabled and click non-object area.\n * @event ImageEditor#addText\n * @param {Object} pos\n * @param {Object} pos.originPosition - Current position on origin canvas\n * @param {Number} pos.originPosition.x - x\n * @param {Number} pos.originPosition.y - y\n * @param {Object} pos.clientPosition - Current position on client area\n * @param {Number} pos.clientPosition.x - x\n * @param {Number} pos.clientPosition.y - y\n * @example\n * imageEditor.on('addText', function(pos) {\n * console.log('text position on canvas: ' + pos.originPosition);\n * console.log('text position on brwoser: ' + pos.clientPosition);\n * });\n */\n\n this.fire(events.ADD_TEXT, {\n originPosition: event.originPosition,\n clientPosition: event.clientPosition,\n });\n }\n\n /**\n * 'addObject' event handler\n * @param {Object} objectProps added object properties\n * @private\n */\n _onAddObject(objectProps) {\n const obj = this._graphics.getObject(objectProps.id);\n this._invoker.fire(events.EXECUTE_COMMAND, getObjectType(obj.type));\n this._pushAddObjectCommand(obj);\n }\n\n /**\n * 'objectAdded' event handler\n * @param {Object} objectProps added object properties\n * @private\n */\n _onObjectAdded(objectProps) {\n /**\n * The event when object added\n * @event ImageEditor#objectAdded\n * @param {ObjectProps} props - object properties\n * @example\n * imageEditor.on('objectAdded', function(props) {\n * console.log(props);\n * });\n */\n this.fire(OBJECT_ADDED, objectProps);\n\n /**\n * The event when object added (deprecated)\n * @event ImageEditor#addObjectAfter\n * @param {ObjectProps} props - object properties\n * @deprecated\n */\n this.fire(ADD_OBJECT_AFTER, objectProps);\n }\n\n /**\n * 'objectModified' event handler\n * @param {fabric.Object} obj - selection object\n * @private\n */\n _onObjectModified(obj) {\n if (obj.type !== OBJ_TYPE.CROPZONE) {\n this._invoker.fire(events.EXECUTE_COMMAND, getObjectType(obj.type));\n this._pushModifyObjectCommand(obj);\n }\n }\n\n /**\n * 'selectionCleared' event handler\n * @private\n */\n _selectionCleared() {\n this.fire(SELECTION_CLEARED);\n }\n\n /**\n * 'selectionCreated' event handler\n * @param {Object} eventTarget - Fabric object\n * @private\n */\n _selectionCreated(eventTarget) {\n this.fire(SELECTION_CREATED, eventTarget);\n }\n\n /**\n * Register custom icons\n * @param {{iconType: string, pathValue: string}} infos - Infos to register icons\n * @example\n * imageEditor.registerIcons({\n * customIcon: 'M 0 0 L 20 20 L 10 10 Z',\n * customArrow: 'M 60 0 L 120 60 H 90 L 75 45 V 180 H 45 V 45 L 30 60 H 0 Z'\n * });\n */\n registerIcons(infos) {\n this._graphics.registerPaths(infos);\n }\n\n /**\n * Change canvas cursor type\n * @param {string} cursorType - cursor type\n * @example\n * imageEditor.changeCursor('crosshair');\n */\n changeCursor(cursorType) {\n this._graphics.changeCursor(cursorType);\n }\n\n /**\n * Add icon on canvas\n * @param {string} type - Icon type ('arrow', 'cancel', custom icon name)\n * @param {Object} options - Icon options\n * @param {string} [options.fill] - Icon foreground color\n * @param {number} [options.left] - Icon x position\n * @param {number} [options.top] - Icon y position\n * @returns {Promise}\n * @example\n * imageEditor.addIcon('arrow'); // The position is center on canvas\n * @example\n * imageEditor.addIcon('arrow', {\n * left: 100,\n * top: 100\n * }).then(objectProps => {\n * console.log(objectProps.id);\n * });\n */\n addIcon(type, options) {\n options = options || {};\n\n this._setPositions(options);\n\n return this.execute(commands.ADD_ICON, type, options);\n }\n\n /**\n * Change icon color\n * @param {number} id - object id\n * @param {string} color - Color for icon\n * @returns {Promise}\n * @example\n * imageEditor.changeIconColor(id, '#000000');\n */\n changeIconColor(id, color) {\n return this.execute(commands.CHANGE_ICON_COLOR, id, color);\n }\n\n /**\n * Remove an object or group by id\n * @param {number} id - object id\n * @returns {Promise}\n * @example\n * imageEditor.removeObject(id);\n */\n removeObject(id) {\n const { type } = this._graphics.getObject(id);\n\n return this.execute(commands.REMOVE_OBJECT, id, getObjectType(type));\n }\n\n /**\n * Whether it has the filter or not\n * @param {string} type - Filter type\n * @returns {boolean} true if it has the filter\n */\n hasFilter(type) {\n return this._graphics.hasFilter(type);\n }\n\n /**\n * Remove filter on canvas image\n * @param {string} type - Filter type\n * @returns {Promise}\n * @example\n * imageEditor.removeFilter('Grayscale').then(obj => {\n * console.log('filterType: ', obj.type);\n * console.log('actType: ', obj.action);\n * }).catch(message => {\n * console.log('error: ', message);\n * });\n */\n removeFilter(type) {\n return this.execute(commands.REMOVE_FILTER, type);\n }\n\n /**\n * Apply filter on canvas image\n * @param {string} type - Filter type\n * @param {object} options - Options to apply filter\n * @param {boolean} isSilent - is silent execution or not\n * @returns {Promise}\n * @example\n * imageEditor.applyFilter('Grayscale');\n * @example\n * imageEditor.applyFilter('mask', {maskObjId: id}).then(obj => {\n * console.log('filterType: ', obj.type);\n * console.log('actType: ', obj.action);\n * }).catch(message => {\n * console.log('error: ', message);\n * });;\n */\n applyFilter(type, options, isSilent) {\n const executeMethodName = isSilent ? 'executeSilent' : 'execute';\n\n return this[executeMethodName](commands.APPLY_FILTER, type, options);\n }\n\n /**\n * Get data url\n * @param {Object} options - options for toDataURL\n * @param {String} [options.format=png] The format of the output image. Either \"jpeg\" or \"png\"\n * @param {Number} [options.quality=1] Quality level (0..1). Only used for jpeg.\n * @param {Number} [options.multiplier=1] Multiplier to scale by\n * @param {Number} [options.left] Cropping left offset. Introduced in fabric v1.2.14\n * @param {Number} [options.top] Cropping top offset. Introduced in fabric v1.2.14\n * @param {Number} [options.width] Cropping width. Introduced in fabric v1.2.14\n * @param {Number} [options.height] Cropping height. Introduced in fabric v1.2.14\n * @returns {string} A DOMString containing the requested data URI\n * @example\n * imgEl.src = imageEditor.toDataURL();\n *\n * imageEditor.loadImageFromURL(imageEditor.toDataURL(), 'FilterImage').then(() => {\n * imageEditor.addImageObject(imgUrl);\n * });\n */\n toDataURL(options) {\n return this._graphics.toDataURL(options);\n }\n\n /**\n * Get image name\n * @returns {string} image name\n * @example\n * console.log(imageEditor.getImageName());\n */\n getImageName() {\n return this._graphics.getImageName();\n }\n\n /**\n * Clear undoStack\n * @example\n * imageEditor.clearUndoStack();\n */\n clearUndoStack() {\n this._invoker.clearUndoStack();\n }\n\n /**\n * Clear redoStack\n * @example\n * imageEditor.clearRedoStack();\n */\n clearRedoStack() {\n this._invoker.clearRedoStack();\n }\n\n /**\n * Whehter the undo stack is empty or not\n * @returns {boolean}\n * imageEditor.isEmptyUndoStack();\n */\n isEmptyUndoStack() {\n return this._invoker.isEmptyUndoStack();\n }\n\n /**\n * Whehter the redo stack is empty or not\n * @returns {boolean}\n * imageEditor.isEmptyRedoStack();\n */\n isEmptyRedoStack() {\n return this._invoker.isEmptyRedoStack();\n }\n\n /**\n * Resize canvas dimension\n * @param {{width: number, height: number}} dimension - Max width & height\n * @returns {Promise}\n */\n resizeCanvasDimension(dimension) {\n if (!dimension) {\n return Promise.reject(rejectMessages.invalidParameters);\n }\n\n return this.execute(commands.RESIZE_CANVAS_DIMENSION, dimension);\n }\n\n /**\n * Destroy\n */\n destroy() {\n this.stopDrawingMode();\n this._detachDomEvents();\n this._graphics.destroy();\n this._graphics = null;\n\n if (this.ui) {\n this.ui.destroy();\n }\n\n forEach(\n this,\n (value, key) => {\n this[key] = null;\n },\n this\n );\n }\n\n /**\n * Set position\n * @param {Object} options - Position options (left or top)\n * @private\n */\n _setPositions(options) {\n const centerPosition = this._graphics.getCenter();\n\n if (isUndefined(options.left)) {\n options.left = centerPosition.left;\n }\n\n if (isUndefined(options.top)) {\n options.top = centerPosition.top;\n }\n }\n\n /**\n * Set properties of active object\n * @param {number} id - object id\n * @param {Object} keyValue - key & value\n * @returns {Promise}\n * @example\n * imageEditor.setObjectProperties(id, {\n * left:100,\n * top:100,\n * width: 200,\n * height: 200,\n * opacity: 0.5\n * });\n */\n setObjectProperties(id, keyValue) {\n return this.execute(commands.SET_OBJECT_PROPERTIES, id, keyValue);\n }\n\n /**\n * Set properties of active object, Do not leave an invoke history.\n * @param {number} id - object id\n * @param {Object} keyValue - key & value\n * @example\n * imageEditor.setObjectPropertiesQuietly(id, {\n * left:100,\n * top:100,\n * width: 200,\n * height: 200,\n * opacity: 0.5\n * });\n */\n setObjectPropertiesQuietly(id, keyValue) {\n this._graphics.setObjectProperties(id, keyValue);\n }\n\n /**\n * Get properties of active object corresponding key\n * @param {number} id - object id\n * @param {Array|ObjectProps|string} keys - property's key\n * @returns {ObjectProps} properties if id is valid or null\n * @example\n * var props = imageEditor.getObjectProperties(id, 'left');\n * console.log(props);\n * @example\n * var props = imageEditor.getObjectProperties(id, ['left', 'top', 'width', 'height']);\n * console.log(props);\n * @example\n * var props = imageEditor.getObjectProperties(id, {\n * left: null,\n * top: null,\n * width: null,\n * height: null,\n * opacity: null\n * });\n * console.log(props);\n */\n getObjectProperties(id, keys) {\n const object = this._graphics.getObject(id);\n if (!object) {\n return null;\n }\n\n return this._graphics.getObjectProperties(id, keys);\n }\n\n /**\n * Get the canvas size\n * @returns {Object} {{width: number, height: number}} canvas size\n * @example\n * var canvasSize = imageEditor.getCanvasSize();\n * console.log(canvasSize.width);\n * console.height(canvasSize.height);\n */\n getCanvasSize() {\n return this._graphics.getCanvasSize();\n }\n\n /**\n * Get object position by originX, originY\n * @param {number} id - object id\n * @param {string} originX - can be 'left', 'center', 'right'\n * @param {string} originY - can be 'top', 'center', 'bottom'\n * @returns {Object} {{x:number, y: number}} position by origin if id is valid, or null\n * @example\n * var position = imageEditor.getObjectPosition(id, 'left', 'top');\n * console.log(position);\n */\n getObjectPosition(id, originX, originY) {\n return this._graphics.getObjectPosition(id, originX, originY);\n }\n\n /**\n * Set object position by originX, originY\n * @param {number} id - object id\n * @param {Object} posInfo - position object\n * @param {number} posInfo.x - x position\n * @param {number} posInfo.y - y position\n * @param {string} posInfo.originX - can be 'left', 'center', 'right'\n * @param {string} posInfo.originY - can be 'top', 'center', 'bottom'\n * @returns {Promise}\n * @example\n * // align the object to 'left', 'top'\n * imageEditor.setObjectPosition(id, {\n * x: 0,\n * y: 0,\n * originX: 'left',\n * originY: 'top'\n * });\n * @example\n * // align the object to 'right', 'top'\n * var canvasSize = imageEditor.getCanvasSize();\n * imageEditor.setObjectPosition(id, {\n * x: canvasSize.width,\n * y: 0,\n * originX: 'right',\n * originY: 'top'\n * });\n * @example\n * // align the object to 'left', 'bottom'\n * var canvasSize = imageEditor.getCanvasSize();\n * imageEditor.setObjectPosition(id, {\n * x: 0,\n * y: canvasSize.height,\n * originX: 'left',\n * originY: 'bottom'\n * });\n * @example\n * // align the object to 'right', 'bottom'\n * var canvasSize = imageEditor.getCanvasSize();\n * imageEditor.setObjectPosition(id, {\n * x: canvasSize.width,\n * y: canvasSize.height,\n * originX: 'right',\n * originY: 'bottom'\n * });\n */\n setObjectPosition(id, posInfo) {\n return this.execute(commands.SET_OBJECT_POSITION, id, posInfo);\n }\n}\n\naction.mixin(ImageEditor);\nCustomEvents.mixin(ImageEditor);\n\nexport default ImageEditor;\n","/**\n * @author NHN. FE Development Team \n * @fileoverview Command interface\n */\nimport snippet from 'tui-code-snippet';\nimport errorMessage from '@/factory/errorMessage';\n\nconst createMessage = errorMessage.create;\nconst errorTypes = errorMessage.types;\n\n/**\n * Command class\n * @class\n * @param {{name:function, execute: function, undo: function,\n * executeCallback: function, undoCallback: function}} actions - Command actions\n * @param {Array} args - passing arguments on execute, undo\n * @ignore\n */\nclass Command {\n constructor(actions, args) {\n /**\n * command name\n * @type {string}\n */\n this.name = actions.name;\n\n /**\n * arguments\n * @type {Array}\n */\n this.args = args;\n\n /**\n * Execute function\n * @type {function}\n */\n this.execute = actions.execute;\n\n /**\n * Undo function\n * @type {function}\n */\n this.undo = actions.undo;\n\n /**\n * executeCallback\n * @type {function}\n */\n this.executeCallback = actions.executeCallback || null;\n\n /**\n * undoCallback\n * @type {function}\n */\n this.undoCallback = actions.undoCallback || null;\n\n /**\n * data for undo\n * @type {Object}\n */\n this.undoData = {};\n }\n\n /**\n * Execute action\n * @param {Object.} compMap - Components injection\n * @abstract\n */\n execute() {\n throw new Error(createMessage(errorTypes.UN_IMPLEMENTATION, 'execute'));\n }\n\n /**\n * Undo action\n * @param {Object.} compMap - Components injection\n * @abstract\n */\n undo() {\n throw new Error(createMessage(errorTypes.UN_IMPLEMENTATION, 'undo'));\n }\n\n /**\n * command for redo if undoData exists\n * @returns {boolean} isRedo\n */\n get isRedo() {\n return Object.keys(this.undoData).length > 0;\n }\n\n /**\n * Set undoData action\n * @param {Object} undoData - maked undo data\n * @param {Object} cachedUndoDataForSilent - cached undo data\n * @param {boolean} isSilent - is silent execution or not\n * @returns {Object} cachedUndoDataForSilent\n */\n setUndoData(undoData, cachedUndoDataForSilent, isSilent) {\n if (cachedUndoDataForSilent) {\n undoData = cachedUndoDataForSilent;\n }\n\n if (!isSilent) {\n snippet.extend(this.undoData, undoData);\n cachedUndoDataForSilent = null;\n } else if (!cachedUndoDataForSilent) {\n cachedUndoDataForSilent = undoData;\n }\n\n return cachedUndoDataForSilent;\n }\n\n /**\n * Attach execute callabck\n * @param {function} callback - Callback after execution\n * @returns {Command} this\n */\n setExecuteCallback(callback) {\n this.executeCallback = callback;\n\n return this;\n }\n\n /**\n * Attach undo callback\n * @param {function} callback - Callback after undo\n * @returns {Command} this\n */\n setUndoCallback(callback) {\n this.undoCallback = callback;\n\n return this;\n }\n}\n\nexport default Command;\n","/**\n * @author NHN. FE Development Team \n * @fileoverview Component interface\n */\n\n/**\n * Component interface\n * @class\n * @param {string} name - component name\n * @param {Graphics} graphics - Graphics instance\n * @ignore\n */\nclass Component {\n constructor(name, graphics) {\n /**\n * Component name\n * @type {string}\n */\n this.name = name;\n\n /**\n * Graphics instance\n * @type {Graphics}\n */\n this.graphics = graphics;\n }\n\n /**\n * Fire Graphics event\n * @returns {Object} return value\n */\n fire(...args) {\n const context = this.graphics;\n\n return this.graphics.fire.apply(context, args);\n }\n\n /**\n * Save image(background) of canvas\n * @param {string} name - Name of image\n * @param {fabric.Image} oImage - Fabric image instance\n */\n setCanvasImage(name, oImage) {\n this.graphics.setCanvasImage(name, oImage);\n }\n\n /**\n * Returns canvas element of fabric.Canvas[[lower-canvas]]\n * @returns {HTMLCanvasElement}\n */\n getCanvasElement() {\n return this.graphics.getCanvasElement();\n }\n\n /**\n * Get fabric.Canvas instance\n * @returns {fabric.Canvas}\n */\n getCanvas() {\n return this.graphics.getCanvas();\n }\n\n /**\n * Get canvasImage (fabric.Image instance)\n * @returns {fabric.Image}\n */\n getCanvasImage() {\n return this.graphics.getCanvasImage();\n }\n\n /**\n * Get image name\n * @returns {string}\n */\n getImageName() {\n return this.graphics.getImageName();\n }\n\n /**\n * Get image editor\n * @returns {ImageEditor}\n */\n getEditor() {\n return this.graphics.getEditor();\n }\n\n /**\n * Return component name\n * @returns {string}\n */\n getName() {\n return this.name;\n }\n\n /**\n * Set image properties\n * @param {Object} setting - Image properties\n * @param {boolean} [withRendering] - If true, The changed image will be reflected in the canvas\n */\n setImageProperties(setting, withRendering) {\n this.graphics.setImageProperties(setting, withRendering);\n }\n\n /**\n * Set canvas dimension - css only\n * @param {Object} dimension - Canvas css dimension\n */\n setCanvasCssDimension(dimension) {\n this.graphics.setCanvasCssDimension(dimension);\n }\n\n /**\n * Set canvas dimension - css only\n * @param {Object} dimension - Canvas backstore dimension\n */\n setCanvasBackstoreDimension(dimension) {\n this.graphics.setCanvasBackstoreDimension(dimension);\n }\n\n /**\n * Adjust canvas dimension with scaling image\n */\n adjustCanvasDimension() {\n this.graphics.adjustCanvasDimension();\n }\n}\n\nexport default Component;\n","/**\n * @author NHN. FE Development Team \n * @fileoverview DrawingMode interface\n */\nimport errorMessage from '@/factory/errorMessage';\n\nconst createMessage = errorMessage.create;\nconst errorTypes = errorMessage.types;\n\n/**\n * DrawingMode interface\n * @class\n * @param {string} name - drawing mode name\n * @ignore\n */\nclass DrawingMode {\n constructor(name) {\n /**\n * the name of drawing mode\n * @type {string}\n */\n this.name = name;\n }\n\n /**\n * Get this drawing mode name;\n * @returns {string} drawing mode name\n */\n getName() {\n return this.name;\n }\n\n /**\n * start this drawing mode\n * @param {Object} options - drawing mode options\n * @abstract\n */\n start() {\n throw new Error(createMessage(errorTypes.UN_IMPLEMENTATION, 'start'));\n }\n\n /**\n * stop this drawing mode\n * @abstract\n */\n end() {\n throw new Error(createMessage(errorTypes.UN_IMPLEMENTATION, 'stop'));\n }\n}\n\nexport default DrawingMode;\n","/**\n * @author NHN. FE Development Team \n * @fileoverview Invoker - invoke commands\n */\nimport snippet from 'tui-code-snippet';\nimport commandFactory from '@/factory/command';\nimport { Promise } from '@/util';\nimport { eventNames, rejectMessages } from '@/consts';\n\nconst { isFunction, isString, CustomEvents } = snippet;\n\n/**\n * Invoker\n * @class\n * @ignore\n */\nclass Invoker {\n constructor() {\n /**\n * Undo stack\n * @type {Array.}\n * @private\n */\n this._undoStack = [];\n\n /**\n * Redo stack\n * @type {Array.}\n * @private\n */\n this._redoStack = [];\n\n /**\n * Lock-flag for executing command\n * @type {boolean}\n * @private\n */\n this._isLocked = false;\n\n this._isSilent = false;\n }\n\n /**\n * Invoke command execution\n * @param {Command} command - Command\n * @param {boolean} [isRedo=false] - check if command is redo\n * @returns {Promise}\n * @private\n */\n _invokeExecution(command, isRedo = false) {\n this.lock();\n\n let { args } = command;\n if (!args) {\n args = [];\n }\n\n return command\n .execute(...args)\n .then((value) => {\n if (!this._isSilent) {\n this.pushUndoStack(command);\n\n this.fire(isRedo ? eventNames.AFTER_REDO : eventNames.EXECUTE_COMMAND, command);\n }\n this.unlock();\n if (isFunction(command.executeCallback)) {\n command.executeCallback(value);\n }\n\n return value;\n })\n ['catch']((message) => {\n this.unlock();\n\n return Promise.reject(message);\n });\n }\n\n /**\n * Invoke command undo\n * @param {Command} command - Command\n * @returns {Promise}\n * @private\n */\n _invokeUndo(command) {\n this.lock();\n\n let { args } = command;\n if (!args) {\n args = [];\n }\n\n return command\n .undo(...args)\n .then((value) => {\n this.pushRedoStack(command);\n this.fire(eventNames.AFTER_UNDO, command);\n this.unlock();\n if (isFunction(command.undoCallback)) {\n command.undoCallback(value);\n }\n\n return value;\n })\n ['catch']((message) => {\n this.unlock();\n\n return Promise.reject(message);\n });\n }\n\n /**\n * fire REDO_STACK_CHANGED event\n * @private\n */\n _fireRedoStackChanged() {\n this.fire(eventNames.REDO_STACK_CHANGED, this._redoStack.length);\n }\n\n /**\n * fire UNDO_STACK_CHANGED event\n * @private\n */\n _fireUndoStackChanged() {\n this.fire(eventNames.UNDO_STACK_CHANGED, this._undoStack.length);\n }\n\n /**\n * Lock this invoker\n */\n lock() {\n this._isLocked = true;\n }\n\n /**\n * Unlock this invoker\n */\n unlock() {\n this._isLocked = false;\n }\n\n executeSilent(...args) {\n this._isSilent = true;\n\n return this.execute(...args, this._isSilent).then(() => {\n this._isSilent = false;\n });\n }\n\n /**\n * Invoke command\n * Store the command to the undoStack\n * Clear the redoStack\n * @param {String} commandName - Command name\n * @param {...*} args - Arguments for creating command\n * @returns {Promise}\n */\n execute(...args) {\n if (this._isLocked) {\n return Promise.reject(rejectMessages.isLock);\n }\n\n let [command] = args;\n if (isString(command)) {\n command = commandFactory.create(...args);\n }\n\n return this._invokeExecution(command).then((value) => {\n this.clearRedoStack();\n\n return value;\n });\n }\n\n /**\n * Undo command\n * @returns {Promise}\n */\n undo() {\n let command = this._undoStack.pop();\n let promise;\n let message = '';\n\n if (command && this._isLocked) {\n this.pushUndoStack(command, true);\n command = null;\n }\n if (command) {\n if (this.isEmptyUndoStack()) {\n this._fireUndoStackChanged();\n }\n promise = this._invokeUndo(command);\n } else {\n message = rejectMessages.undo;\n if (this._isLocked) {\n message = `${message} Because ${rejectMessages.isLock}`;\n }\n promise = Promise.reject(message);\n }\n\n return promise;\n }\n\n /**\n * Redo command\n * @returns {Promise}\n */\n redo() {\n let command = this._redoStack.pop();\n let promise;\n let message = '';\n\n if (command && this._isLocked) {\n this.pushRedoStack(command, true);\n command = null;\n }\n if (command) {\n if (this.isEmptyRedoStack()) {\n this._fireRedoStackChanged();\n }\n promise = this._invokeExecution(command, true);\n } else {\n message = rejectMessages.redo;\n if (this._isLocked) {\n message = `${message} Because ${rejectMessages.isLock}`;\n }\n promise = Promise.reject(message);\n }\n\n return promise;\n }\n\n /**\n * Push undo stack\n * @param {Command} command - command\n * @param {boolean} [isSilent] - Fire event or not\n */\n pushUndoStack(command, isSilent) {\n this._undoStack.push(command);\n if (!isSilent) {\n this._fireUndoStackChanged();\n }\n }\n\n /**\n * Push redo stack\n * @param {Command} command - command\n * @param {boolean} [isSilent] - Fire event or not\n */\n pushRedoStack(command, isSilent) {\n this._redoStack.push(command);\n if (!isSilent) {\n this._fireRedoStackChanged();\n }\n }\n\n /**\n * Return whether the redoStack is empty\n * @returns {boolean}\n */\n isEmptyRedoStack() {\n return this._redoStack.length === 0;\n }\n\n /**\n * Return whether the undoStack is empty\n * @returns {boolean}\n */\n isEmptyUndoStack() {\n return this._undoStack.length === 0;\n }\n\n /**\n * Clear undoStack\n */\n clearUndoStack() {\n if (!this.isEmptyUndoStack()) {\n this._undoStack = [];\n this._fireUndoStackChanged();\n }\n }\n\n /**\n * Clear redoStack\n */\n clearRedoStack() {\n if (!this.isEmptyRedoStack()) {\n this._redoStack = [];\n this._fireRedoStackChanged();\n }\n }\n}\n\nCustomEvents.mixin(Invoker);\n\nexport default Invoker;\n","// https://developer.mozilla.org/en-US/docs/Web/API/Element/closest\n// Any copyright is dedicated to the Public Domain. http://creativecommons.org/publicdomain/zero/1.0/if (!Element.prototype.matches)\nElement.prototype.matches =\n Element.prototype.msMatchesSelector || Element.prototype.webkitMatchesSelector;\n\nif (!Element.prototype.closest)\n Element.prototype.closest = function (s) {\n var el = this;\n if (!document.documentElement.contains(el)) return null;\n do {\n if (el.matches(s)) return el;\n el = el.parentElement || el.parentNode;\n } while (el !== null && el.nodeType === 1);\n return null;\n };\n\n/*\n * classList.js: Cross-browser full element.classList implementation.\n * 1.1.20170427\n *\n * By Eli Grey, http://eligrey.com\n * License: Dedicated to the public domain.\n * See https://github.com/eligrey/classList.js/blob/master/LICENSE.md\n */\n\n/*global self, document, DOMException */\n\n/*! @source http://purl.eligrey.com/github/classList.js/blob/master/classList.js */\n\nif ('document' in window.self) {\n // Full polyfill for browsers with no classList support\n // Including IE < Edge missing SVGElement.classList\n if (\n !('classList' in document.createElement('_')) ||\n (document.createElementNS &&\n !('classList' in document.createElementNS('http://www.w3.org/2000/svg', 'g')))\n ) {\n (function (view) {\n 'use strict';\n\n if (!('Element' in view)) return;\n\n var classListProp = 'classList',\n protoProp = 'prototype',\n elemCtrProto = view.Element[protoProp],\n objCtr = Object,\n strTrim =\n String[protoProp].trim ||\n function () {\n return this.replace(/^\\s+|\\s+$/g, '');\n },\n arrIndexOf =\n Array[protoProp].indexOf ||\n function (item) {\n var i = 0,\n len = this.length;\n for (; i < len; i++) {\n if (i in this && this[i] === item) {\n return i;\n }\n }\n return -1;\n },\n // Vendors: please allow content code to instantiate DOMExceptions\n DOMEx = function (type, message) {\n this.name = type;\n this.code = DOMException[type];\n this.message = message;\n },\n checkTokenAndGetIndex = function (classList, token) {\n if (token === '') {\n throw new DOMEx('SYNTAX_ERR', 'An invalid or illegal string was specified');\n }\n if (/\\s/.test(token)) {\n throw new DOMEx('INVALID_CHARACTER_ERR', 'String contains an invalid character');\n }\n return arrIndexOf.call(classList, token);\n },\n ClassList = function (elem) {\n var trimmedClasses = strTrim.call(elem.getAttribute('class') || ''),\n classes = trimmedClasses ? trimmedClasses.split(/\\s+/) : [],\n i = 0,\n len = classes.length;\n for (; i < len; i++) {\n this.push(classes[i]);\n }\n this._updateClassName = function () {\n elem.setAttribute('class', this.toString());\n };\n },\n classListProto = (ClassList[protoProp] = []),\n classListGetter = function () {\n return new ClassList(this);\n };\n // Most DOMException implementations don't allow calling DOMException's toString()\n // on non-DOMExceptions. Error's toString() is sufficient here.\n DOMEx[protoProp] = Error[protoProp];\n classListProto.item = function (i) {\n return this[i] || null;\n };\n classListProto.contains = function (token) {\n token += '';\n return checkTokenAndGetIndex(this, token) !== -1;\n };\n classListProto.add = function () {\n var tokens = arguments,\n i = 0,\n l = tokens.length,\n token,\n updated = false;\n do {\n token = tokens[i] + '';\n if (checkTokenAndGetIndex(this, token) === -1) {\n this.push(token);\n updated = true;\n }\n } while (++i < l);\n\n if (updated) {\n this._updateClassName();\n }\n };\n classListProto.remove = function () {\n var tokens = arguments,\n i = 0,\n l = tokens.length,\n token,\n updated = false,\n index;\n do {\n token = tokens[i] + '';\n index = checkTokenAndGetIndex(this, token);\n while (index !== -1) {\n this.splice(index, 1);\n updated = true;\n index = checkTokenAndGetIndex(this, token);\n }\n } while (++i < l);\n\n if (updated) {\n this._updateClassName();\n }\n };\n classListProto.toggle = function (token, force) {\n token += '';\n\n var result = this.contains(token),\n method = result ? force !== true && 'remove' : force !== false && 'add';\n if (method) {\n this[method](token);\n }\n\n if (force === true || force === false) {\n return force;\n } else {\n return !result;\n }\n };\n classListProto.toString = function () {\n return this.join(' ');\n };\n\n if (objCtr.defineProperty) {\n var classListPropDesc = {\n get: classListGetter,\n enumerable: true,\n configurable: true,\n };\n try {\n objCtr.defineProperty(elemCtrProto, classListProp, classListPropDesc);\n } catch (ex) {\n // IE 8 doesn't support enumerable:true\n // adding undefined to fight this issue https://github.com/eligrey/classList.js/issues/36\n // modernie IE8-MSW7 machine has IE8 8.0.6001.18702 and is affected\n if (ex.number === undefined || ex.number === -0x7ff5ec54) {\n classListPropDesc.enumerable = false;\n objCtr.defineProperty(elemCtrProto, classListProp, classListPropDesc);\n }\n }\n } else if (objCtr[protoProp].__defineGetter__) {\n elemCtrProto.__defineGetter__(classListProp, classListGetter);\n }\n })(window.self);\n }\n\n // There is full or partial native classList support, so just check if we need\n // to normalize the add/remove and toggle APIs.\n\n (function () {\n 'use strict';\n\n var testElement = document.createElement('_');\n\n testElement.classList.add('c1', 'c2');\n\n // Polyfill for IE 10/11 and Firefox <26, where classList.add and\n // classList.remove exist but support only one argument at a time.\n if (!testElement.classList.contains('c2')) {\n var createMethod = function (method) {\n var original = DOMTokenList.prototype[method];\n\n DOMTokenList.prototype[method] = function (token) {\n var i,\n len = arguments.length;\n\n for (i = 0; i < len; i++) {\n token = arguments[i];\n original.call(this, token);\n }\n };\n };\n createMethod('add');\n createMethod('remove');\n }\n\n testElement.classList.toggle('c3', false);\n\n // Polyfill for IE 10 and Firefox <24, where classList.toggle does not\n // support the second argument.\n if (testElement.classList.contains('c3')) {\n var _toggle = DOMTokenList.prototype.toggle;\n\n DOMTokenList.prototype.toggle = function (token, force) {\n if (1 in arguments && !this.contains(token) === !force) {\n return force;\n } else {\n return _toggle.call(this, token);\n }\n };\n }\n\n testElement = null;\n })();\n}\n\n/*!\n * @copyright Copyright (c) 2017 IcoMoon.io\n * @license Licensed under MIT license\n * See https://github.com/Keyamoon/svgxuse\n * @version 1.2.6\n */\n/*jslint browser: true */\n/*global XDomainRequest, MutationObserver, window */\n(function () {\n 'use strict';\n if (typeof window !== 'undefined' && window.addEventListener) {\n var cache = Object.create(null); // holds xhr objects to prevent multiple requests\n var checkUseElems;\n var tid; // timeout id\n var debouncedCheck = function () {\n clearTimeout(tid);\n tid = setTimeout(checkUseElems, 100);\n };\n var unobserveChanges = function () {\n return;\n };\n var observeChanges = function () {\n var observer;\n window.addEventListener('resize', debouncedCheck, false);\n window.addEventListener('orientationchange', debouncedCheck, false);\n if (window.MutationObserver) {\n observer = new MutationObserver(debouncedCheck);\n observer.observe(document.documentElement, {\n childList: true,\n subtree: true,\n attributes: true,\n });\n unobserveChanges = function () {\n try {\n observer.disconnect();\n window.removeEventListener('resize', debouncedCheck, false);\n window.removeEventListener('orientationchange', debouncedCheck, false);\n } catch (ignore) {}\n };\n } else {\n document.documentElement.addEventListener('DOMSubtreeModified', debouncedCheck, false);\n unobserveChanges = function () {\n document.documentElement.removeEventListener('DOMSubtreeModified', debouncedCheck, false);\n window.removeEventListener('resize', debouncedCheck, false);\n window.removeEventListener('orientationchange', debouncedCheck, false);\n };\n }\n };\n var createRequest = function (url) {\n // In IE 9, cross origin requests can only be sent using XDomainRequest.\n // XDomainRequest would fail if CORS headers are not set.\n // Therefore, XDomainRequest should only be used with cross origin requests.\n function getOrigin(loc) {\n var a;\n if (loc.protocol !== undefined) {\n a = loc;\n } else {\n a = document.createElement('a');\n a.href = loc;\n }\n return a.protocol.replace(/:/g, '') + a.host;\n }\n var Request;\n var origin;\n var origin2;\n if (window.XMLHttpRequest) {\n Request = new XMLHttpRequest();\n origin = getOrigin(location);\n origin2 = getOrigin(url);\n if (Request.withCredentials === undefined && origin2 !== '' && origin2 !== origin) {\n Request = XDomainRequest || undefined;\n } else {\n Request = XMLHttpRequest;\n }\n }\n return Request;\n };\n var xlinkNS = 'http://www.w3.org/1999/xlink';\n checkUseElems = function () {\n var base;\n var bcr;\n var fallback = ''; // optional fallback URL in case no base path to SVG file was given and no symbol definition was found.\n var hash;\n var href;\n var i;\n var inProgressCount = 0;\n var isHidden;\n var Request;\n var url;\n var uses;\n var xhr;\n function observeIfDone() {\n // If done with making changes, start watching for chagnes in DOM again\n inProgressCount -= 1;\n if (inProgressCount === 0) {\n // if all xhrs were resolved\n unobserveChanges(); // make sure to remove old handlers\n observeChanges(); // watch for changes to DOM\n }\n }\n function attrUpdateFunc(spec) {\n return function () {\n if (cache[spec.base] !== true) {\n spec.useEl.setAttributeNS(xlinkNS, 'xlink:href', '#' + spec.hash);\n if (spec.useEl.hasAttribute('href')) {\n spec.useEl.setAttribute('href', '#' + spec.hash);\n }\n }\n };\n }\n function onloadFunc(xhr) {\n return function () {\n var body = document.body;\n var x = document.createElement('x');\n var svg;\n xhr.onload = null;\n x.innerHTML = xhr.responseText;\n svg = x.getElementsByTagName('svg')[0];\n if (svg) {\n svg.setAttribute('aria-hidden', 'true');\n svg.style.position = 'absolute';\n svg.style.width = 0;\n svg.style.height = 0;\n svg.style.overflow = 'hidden';\n body.insertBefore(svg, body.firstChild);\n }\n observeIfDone();\n };\n }\n function onErrorTimeout(xhr) {\n return function () {\n xhr.onerror = null;\n xhr.ontimeout = null;\n observeIfDone();\n };\n }\n unobserveChanges(); // stop watching for changes to DOM\n // find all use elements\n uses = document.getElementsByTagName('use');\n for (i = 0; i < uses.length; i += 1) {\n try {\n bcr = uses[i].getBoundingClientRect();\n } catch (ignore) {\n // failed to get bounding rectangle of the use element\n bcr = false;\n }\n href =\n uses[i].getAttribute('href') ||\n uses[i].getAttributeNS(xlinkNS, 'href') ||\n uses[i].getAttribute('xlink:href');\n if (href && href.split) {\n url = href.split('#');\n } else {\n url = ['', ''];\n }\n base = url[0];\n hash = url[1];\n isHidden = bcr && bcr.left === 0 && bcr.right === 0 && bcr.top === 0 && bcr.bottom === 0;\n if (bcr && bcr.width === 0 && bcr.height === 0 && !isHidden) {\n // the use element is empty\n // if there is a reference to an external SVG, try to fetch it\n // use the optional fallback URL if there is no reference to an external SVG\n if (fallback && !base.length && hash && !document.getElementById(hash)) {\n base = fallback;\n }\n if (uses[i].hasAttribute('href')) {\n uses[i].setAttributeNS(xlinkNS, 'xlink:href', href);\n }\n if (base.length) {\n // schedule updating xlink:href\n xhr = cache[base];\n if (xhr !== true) {\n // true signifies that prepending the SVG was not required\n setTimeout(\n attrUpdateFunc({\n useEl: uses[i],\n base: base,\n hash: hash,\n }),\n 0\n );\n }\n if (xhr === undefined) {\n Request = createRequest(base);\n if (Request !== undefined) {\n xhr = new Request();\n cache[base] = xhr;\n xhr.onload = onloadFunc(xhr);\n xhr.onerror = onErrorTimeout(xhr);\n xhr.ontimeout = onErrorTimeout(xhr);\n xhr.open('GET', base);\n xhr.send();\n inProgressCount += 1;\n }\n }\n }\n } else {\n if (!isHidden) {\n if (cache[base] === undefined) {\n // remember this URL if the use element was not empty and no request was sent\n cache[base] = true;\n } else if (cache[base].onload) {\n // if it turns out that prepending the SVG is not necessary,\n // abort the in-progress xhr.\n cache[base].abort();\n delete cache[base].onload;\n cache[base] = true;\n }\n } else if (base.length && cache[base]) {\n setTimeout(\n attrUpdateFunc({\n useEl: uses[i],\n base: base,\n hash: hash,\n }),\n 0\n );\n }\n }\n }\n uses = '';\n inProgressCount += 1;\n observeIfDone();\n };\n var winLoad;\n winLoad = function () {\n window.removeEventListener('load', winLoad, false); // to prevent memory leaks\n tid = setTimeout(checkUseElems, 0);\n };\n if (document.readyState !== 'complete') {\n // The load event fires when all resources have finished loading, which allows detecting whether SVG use elements are empty.\n window.addEventListener('load', winLoad, false);\n } else {\n // No need to add a listener if the document is already loaded, initialize immediately.\n winLoad();\n }\n }\n})();\n","import snippet from 'tui-code-snippet';\nimport { getSelector, assignmentForDestroy, cls, getHistoryTitle, isSilentCommand } from '@/util';\nimport {\n ZOOM_HELP_MENUS,\n COMMAND_HELP_MENUS,\n DELETE_HELP_MENUS,\n eventNames,\n HELP_MENUS,\n} from '@/consts';\nimport mainContainer from '@/ui/template/mainContainer';\nimport controls from '@/ui/template/controls';\n\nimport Theme from '@/ui/theme/theme';\nimport Shape from '@/ui/shape';\nimport Crop from '@/ui/crop';\nimport Flip from '@/ui/flip';\nimport Rotate from '@/ui/rotate';\nimport Text from '@/ui/text';\nimport Mask from '@/ui/mask';\nimport Icon from '@/ui/icon';\nimport Draw from '@/ui/draw';\nimport Filter from '@/ui/filter';\nimport History from '@/ui/history';\nimport Locale from '@/ui/locale/locale';\n\nconst SUB_UI_COMPONENT = {\n Shape,\n Crop,\n Flip,\n Rotate,\n Text,\n Mask,\n Icon,\n Draw,\n Filter,\n};\n\nconst { CustomEvents } = snippet;\n\nconst BI_EXPRESSION_MINSIZE_WHEN_TOP_POSITION = '1300';\nconst HISTORY_MENU = 'history';\nconst HISTORY_PANEL_CLASS_NAME = 'tie-panel-history';\n\nconst CLASS_NAME_ON = 'on';\nconst ZOOM_BUTTON_TYPE = {\n ZOOM_IN: 'zoomIn',\n HAND: 'hand',\n};\n\n/**\n * Default UI Class\n * @class\n * @param {string|HTMLElement} element - Wrapper's element or selector\n * @param {Object} [options] - Ui setting options\n * @param {number} options.loadImage - Init default load image\n * @param {number} options.initMenu - Init start menu\n * @param {Boolean} [options.menuBarPosition=bottom] - Let\n * @param {Boolean} [options.applyCropSelectionStyle=false] - Let\n * @param {Boolean} [options.usageStatistics=false] - Use statistics or not\n * @param {Object} [options.uiSize] - ui size of editor\n * @param {string} options.uiSize.width - width of ui\n * @param {string} options.uiSize.height - height of ui\n * @param {Object} actions - ui action instance\n */\nclass Ui {\n constructor(element, options, actions) {\n this.options = this._initializeOption(options);\n this._actions = actions;\n this.submenu = false;\n this.imageSize = {};\n this.uiSize = {};\n this._locale = new Locale(this.options.locale);\n this.theme = new Theme(this.options.theme);\n this.eventHandler = {};\n this._submenuChangeTransection = false;\n this._selectedElement = null;\n this._mainElement = null;\n this._editorElementWrap = null;\n this._editorElement = null;\n this._menuBarElement = null;\n this._subMenuElement = null;\n this._makeUiElement(element);\n this._setUiSize();\n this._initMenuEvent = false;\n\n this._makeSubMenu();\n\n this._attachHistoryEvent();\n this._attachZoomEvent();\n }\n\n /**\n * Destroys the instance.\n */\n destroy() {\n this._removeUiEvent();\n this._destroyAllMenu();\n this._selectedElement.innerHTML = '';\n\n assignmentForDestroy(this);\n }\n\n /**\n * Set Default Selection for includeUI\n * @param {Object} option - imageEditor options\n * @returns {Object} - extends selectionStyle option\n * @ignore\n */\n setUiDefaultSelectionStyle(option) {\n return snippet.extend(\n {\n applyCropSelectionStyle: true,\n applyGroupSelectionStyle: true,\n selectionStyle: {\n cornerStyle: 'circle',\n cornerSize: 16,\n cornerColor: '#fff',\n cornerStrokeColor: '#fff',\n transparentCorners: false,\n lineWidth: 2,\n borderColor: '#fff',\n },\n },\n option\n );\n }\n\n /**\n * Change editor size\n * @param {Object} resizeInfo - ui & image size info\n * @param {Object} [resizeInfo.uiSize] - image size dimension\n * @param {string} resizeInfo.uiSize.width - ui width\n * @param {string} resizeInfo.uiSize.height - ui height\n * @param {Object} [resizeInfo.imageSize] - image size dimension\n * @param {Number} resizeInfo.imageSize.oldWidth - old width\n * @param {Number} resizeInfo.imageSize.oldHeight - old height\n * @param {Number} resizeInfo.imageSize.newWidth - new width\n * @param {Number} resizeInfo.imageSize.newHeight - new height\n * @example\n * // Change the image size and ui size, and change the affected ui state together.\n * imageEditor.ui.resizeEditor({\n * imageSize: {oldWidth: 100, oldHeight: 100, newWidth: 700, newHeight: 700},\n * uiSize: {width: 1000, height: 1000}\n * });\n * @example\n * // Apply the ui state while preserving the previous attribute (for example, if responsive Ui)\n * imageEditor.ui.resizeEditor();\n */\n resizeEditor({ uiSize, imageSize = this.imageSize } = {}) {\n if (imageSize !== this.imageSize) {\n this.imageSize = imageSize;\n }\n if (uiSize) {\n this._setUiSize(uiSize);\n }\n\n const { width, height } = this._getCanvasMaxDimension();\n const editorElementStyle = this._editorElement.style;\n const { menuBarPosition } = this.options;\n\n editorElementStyle.height = `${height}px`;\n editorElementStyle.width = `${width}px`;\n\n this._setEditorPosition(menuBarPosition);\n\n this._editorElementWrap.style.bottom = `0px`;\n this._editorElementWrap.style.top = `0px`;\n this._editorElementWrap.style.left = `0px`;\n this._editorElementWrap.style.width = `100%`;\n\n const selectElementClassList = this._selectedElement.classList;\n\n if (\n menuBarPosition === 'top' &&\n this._selectedElement.offsetWidth < BI_EXPRESSION_MINSIZE_WHEN_TOP_POSITION\n ) {\n selectElementClassList.add('tui-image-editor-top-optimization');\n } else {\n selectElementClassList.remove('tui-image-editor-top-optimization');\n }\n }\n\n /**\n * Toggle zoom button status\n * @param {string} type - type of zoom button\n */\n toggleZoomButtonStatus(type) {\n const targetClassList = this._buttonElements[type].classList;\n\n targetClassList.toggle(CLASS_NAME_ON);\n\n if (type === ZOOM_BUTTON_TYPE.ZOOM_IN) {\n this._buttonElements[ZOOM_BUTTON_TYPE.HAND].classList.remove(CLASS_NAME_ON);\n } else {\n this._buttonElements[ZOOM_BUTTON_TYPE.ZOOM_IN].classList.remove(CLASS_NAME_ON);\n }\n }\n\n /**\n * Turn off zoom-in button status\n */\n offZoomInButtonStatus() {\n const zoomInClassList = this._buttonElements[ZOOM_BUTTON_TYPE.ZOOM_IN].classList;\n\n zoomInClassList.remove(CLASS_NAME_ON);\n }\n\n /**\n * Change hand button status\n * @param {boolean} enabled - status to change\n */\n changeHandButtonStatus(enabled) {\n const handClassList = this._buttonElements[ZOOM_BUTTON_TYPE.HAND].classList;\n\n handClassList[enabled ? 'add' : 'remove'](CLASS_NAME_ON);\n }\n\n /**\n * Change help button status\n * @param {string} buttonType - target button type\n * @param {Boolean} enableStatus - enabled status\n * @ignore\n */\n changeHelpButtonEnabled(buttonType, enableStatus) {\n const buttonClassList = this._buttonElements[buttonType].classList;\n\n buttonClassList[enableStatus ? 'add' : 'remove']('enabled');\n }\n\n /**\n * Change delete button status\n * @param {Object} [options] - Ui setting options\n * @param {object} [options.loadImage] - Init default load image\n * @param {string} [options.initMenu] - Init start menu\n * @param {string} [options.menuBarPosition=bottom] - Let\n * @param {boolean} [options.applyCropSelectionStyle=false] - Let\n * @param {boolean} [options.usageStatistics=false] - Send statistics ping or not\n * @returns {Object} initialize option\n * @private\n */\n _initializeOption(options) {\n return snippet.extend(\n {\n loadImage: {\n path: '',\n name: '',\n },\n locale: {},\n menuIconPath: '',\n menu: ['crop', 'flip', 'rotate', 'draw', 'shape', 'icon', 'text', 'mask', 'filter'],\n initMenu: '',\n uiSize: {\n width: '100%',\n height: '100%',\n },\n menuBarPosition: 'bottom',\n },\n options\n );\n }\n\n /**\n * Set ui container size\n * @param {Object} uiSize - ui dimension\n * @param {string} uiSize.width - css width property\n * @param {string} uiSize.height - css height property\n * @private\n */\n _setUiSize(uiSize = this.options.uiSize) {\n const elementDimension = this._selectedElement.style;\n elementDimension.width = uiSize.width;\n elementDimension.height = uiSize.height;\n }\n\n /**\n * Make submenu dom element\n * @private\n */\n _makeSubMenu() {\n snippet.forEach(this.options.menu, (menuName) => {\n const SubComponentClass =\n SUB_UI_COMPONENT[menuName.replace(/^[a-z]/, ($0) => $0.toUpperCase())];\n\n // make menu element\n this._makeMenuElement(menuName);\n\n // menu btn element\n this._buttonElements[menuName] = this._menuBarElement.querySelector(`.tie-btn-${menuName}`);\n\n // submenu ui instance\n this[menuName] = new SubComponentClass(this._subMenuElement, {\n locale: this._locale,\n makeSvgIcon: this.theme.makeMenSvgIconSet.bind(this.theme),\n menuBarPosition: this.options.menuBarPosition,\n usageStatistics: this.options.usageStatistics,\n });\n });\n }\n\n /**\n * Attach history event\n * @private\n */\n _attachHistoryEvent() {\n this.on(eventNames.EXECUTE_COMMAND, this._addHistory.bind(this));\n this.on(eventNames.AFTER_UNDO, this._selectPrevHistory.bind(this));\n this.on(eventNames.AFTER_REDO, this._selectNextHistory.bind(this));\n }\n\n /**\n * Attach zoom event\n * @private\n */\n _attachZoomEvent() {\n this.on(eventNames.HAND_STARTED, () => {\n this.offZoomInButtonStatus();\n this.changeHandButtonStatus(true);\n });\n this.on(eventNames.HAND_STOPPED, () => this.changeHandButtonStatus(false));\n }\n\n /**\n * Make primary ui dom element\n * @param {string|HTMLElement} element - Wrapper's element or selector\n * @private\n */\n _makeUiElement(element) {\n let selectedElement;\n\n window.snippet = snippet;\n\n if (element.nodeType) {\n selectedElement = element;\n } else {\n selectedElement = document.querySelector(element);\n }\n const selector = getSelector(selectedElement);\n\n selectedElement.classList.add('tui-image-editor-container');\n selectedElement.innerHTML =\n controls({\n locale: this._locale,\n biImage: this.theme.getStyle('common.bi'),\n loadButtonStyle: this.theme.getStyle('loadButton'),\n downloadButtonStyle: this.theme.getStyle('downloadButton'),\n menuBarPosition: this.options.menuBarPosition,\n }) +\n mainContainer({\n locale: this._locale,\n biImage: this.theme.getStyle('common.bi'),\n commonStyle: this.theme.getStyle('common'),\n headerStyle: this.theme.getStyle('header'),\n loadButtonStyle: this.theme.getStyle('loadButton'),\n downloadButtonStyle: this.theme.getStyle('downloadButton'),\n submenuStyle: this.theme.getStyle('submenu'),\n });\n\n this._selectedElement = selectedElement;\n this._selectedElement.classList.add(this.options.menuBarPosition);\n\n this._mainElement = selector('.tui-image-editor-main');\n this._editorElementWrap = selector('.tui-image-editor-wrap');\n this._editorElement = selector('.tui-image-editor');\n this._helpMenuBarElement = selector('.tui-image-editor-help-menu');\n this._menuBarElement = selector('.tui-image-editor-menu');\n this._subMenuElement = selector('.tui-image-editor-submenu');\n this._buttonElements = {\n download: this._selectedElement.querySelectorAll('.tui-image-editor-download-btn'),\n load: this._selectedElement.querySelectorAll('.tui-image-editor-load-btn'),\n };\n\n this._addHelpMenus();\n\n this._historyMenu = new History(this._buttonElements[HISTORY_MENU], {\n locale: this._locale,\n makeSvgIcon: this.theme.makeMenSvgIconSet.bind(this.theme),\n });\n\n this._activateZoomMenus();\n }\n\n /**\n * Activate help menus for zoom.\n * @private\n */\n _activateZoomMenus() {\n snippet.forEach(ZOOM_HELP_MENUS, (menu) => {\n this.changeHelpButtonEnabled(menu, true);\n });\n }\n\n /**\n * make array for help menu output, including partitions.\n * @returns {Array}\n * @private\n */\n _makeHelpMenuWithPartition() {\n return [...ZOOM_HELP_MENUS, '', ...COMMAND_HELP_MENUS, '', ...DELETE_HELP_MENUS];\n }\n\n /**\n * Add help menu\n * @private\n */\n _addHelpMenus() {\n const helpMenuWithPartition = this._makeHelpMenuWithPartition();\n\n snippet.forEach(helpMenuWithPartition, (menuName) => {\n if (!menuName) {\n this._makeMenuPartitionElement();\n } else {\n this._makeMenuElement(menuName, ['normal', 'disabled', 'hover'], 'help');\n\n this._buttonElements[menuName] = this._helpMenuBarElement.querySelector(\n `.tie-btn-${menuName}`\n );\n }\n });\n }\n\n /**\n * Make menu partition element\n * @private\n */\n _makeMenuPartitionElement() {\n const partitionElement = document.createElement('li');\n const partitionInnerElement = document.createElement('div');\n partitionElement.className = cls('item');\n partitionInnerElement.className = cls('icpartition');\n partitionElement.appendChild(partitionInnerElement);\n\n this._helpMenuBarElement.appendChild(partitionElement);\n }\n\n /**\n * Make menu button element\n * @param {string} menuName - menu name\n * @param {Array} useIconTypes - Possible values are \\['normal', 'active', 'hover', 'disabled'\\]\n * @param {string} menuType - 'normal' or 'help'\n * @private\n */\n _makeMenuElement(menuName, useIconTypes = ['normal', 'active', 'hover'], menuType = 'normal') {\n const btnElement = document.createElement('li');\n const menuItemHtml = this.theme.makeMenSvgIconSet(useIconTypes, menuName);\n\n this._addTooltipAttribute(btnElement, menuName);\n btnElement.className = `tie-btn-${menuName} ${cls('item')} ${menuType}`;\n btnElement.innerHTML = menuItemHtml;\n\n if (menuType === 'normal') {\n this._menuBarElement.appendChild(btnElement);\n } else {\n this._helpMenuBarElement.appendChild(btnElement);\n }\n }\n\n /**\n * Add help action event\n * @private\n */\n _addHelpActionEvent() {\n snippet.forEach(HELP_MENUS, (helpName) => {\n this.eventHandler[helpName] = (event) => this._actions.main[helpName](event);\n this._buttonElements[helpName].addEventListener('click', this.eventHandler[helpName]);\n });\n }\n\n /**\n * Remove help action event\n * @private\n */\n _removeHelpActionEvent() {\n snippet.forEach(HELP_MENUS, (helpName) => {\n this._buttonElements[helpName].removeEventListener('click', this.eventHandler[helpName]);\n });\n }\n\n /**\n * Add history\n * @param {Command|string} command - command or command name\n */\n _addHistory(command) {\n if (!isSilentCommand(command)) {\n const historyTitle =\n typeof command === 'string' ? { name: command } : getHistoryTitle(command);\n\n this._historyMenu.add(historyTitle);\n }\n }\n\n /**\n * Init history\n */\n initHistory() {\n this._historyMenu.init();\n }\n\n /**\n * Clear history\n */\n clearHistory() {\n this._historyMenu.clear();\n }\n\n /**\n * Select prev history\n */\n _selectPrevHistory() {\n this._historyMenu.prev();\n }\n\n /**\n * Select next history\n */\n _selectNextHistory() {\n this._historyMenu.next();\n }\n\n /**\n * Toggle history menu\n * @param {object} event - event object\n */\n toggleHistoryMenu(event) {\n const { target } = event;\n const item = target.closest(`.${HISTORY_PANEL_CLASS_NAME}`);\n\n if (item) {\n return;\n }\n\n const historyButtonClassList = this._buttonElements[HISTORY_MENU].classList;\n\n historyButtonClassList.toggle('opened');\n }\n\n /**\n * Add attribute for menu tooltip\n * @param {HTMLElement} element - menu element\n * @param {string} tooltipName - tooltipName\n * @private\n */\n _addTooltipAttribute(element, tooltipName) {\n element.setAttribute(\n 'tooltip-content',\n this._locale.localize(tooltipName.replace(/^[a-z]/g, ($0) => $0.toUpperCase()))\n );\n }\n\n /**\n * Add download event\n * @private\n */\n _addDownloadEvent() {\n this.eventHandler.download = () => this._actions.main.download();\n snippet.forEach(this._buttonElements.download, (element) => {\n element.addEventListener('click', this.eventHandler.download);\n });\n }\n\n _removeDownloadEvent() {\n snippet.forEach(this._buttonElements.download, (element) => {\n element.removeEventListener('click', this.eventHandler.download);\n });\n }\n\n /**\n * Add load event\n * @private\n */\n _addLoadEvent() {\n this.eventHandler.loadImage = (event) => this._actions.main.load(event.target.files[0]);\n\n snippet.forEach(this._buttonElements.load, (element) => {\n element.addEventListener('change', this.eventHandler.loadImage);\n });\n }\n\n /**\n * Remove load event\n * @private\n */\n _removeLoadEvent() {\n snippet.forEach(this._buttonElements.load, (element) => {\n element.removeEventListener('change', this.eventHandler.loadImage);\n });\n }\n\n /**\n * Add menu event\n * @param {string} menuName - menu name\n * @private\n */\n _addMainMenuEvent(menuName) {\n this.eventHandler[menuName] = () => this.changeMenu(menuName);\n this._buttonElements[menuName].addEventListener('click', this.eventHandler[menuName]);\n }\n\n /**\n * Add menu event\n * @param {string} menuName - menu name\n * @private\n */\n _addSubMenuEvent(menuName) {\n this[menuName].addEvent(this._actions[menuName]);\n }\n\n /**\n * Add menu event\n * @private\n */\n _addMenuEvent() {\n snippet.forEach(this.options.menu, (menuName) => {\n this._addMainMenuEvent(menuName);\n this._addSubMenuEvent(menuName);\n });\n }\n\n /**\n * Remove menu event\n * @private\n */\n _removeMainMenuEvent() {\n snippet.forEach(this.options.menu, (menuName) => {\n this._buttonElements[menuName].removeEventListener('click', this.eventHandler[menuName]);\n });\n }\n\n /**\n * Get editor area element\n * @returns {HTMLElement} editor area html element\n * @ignore\n */\n getEditorArea() {\n return this._editorElement;\n }\n\n /**\n * Add event for menu items\n * @ignore\n */\n activeMenuEvent() {\n if (this._initMenuEvent) {\n return;\n }\n\n this._addHelpActionEvent();\n this._addDownloadEvent();\n this._addMenuEvent();\n this._initMenu();\n this._historyMenu.addEvent(this._actions.history);\n this._initMenuEvent = true;\n }\n\n /**\n * Remove ui event\n * @private\n */\n _removeUiEvent() {\n this._removeHelpActionEvent();\n this._removeDownloadEvent();\n this._removeLoadEvent();\n this._removeMainMenuEvent();\n this._historyMenu.removeEvent();\n }\n\n /**\n * Destroy all menu instance\n * @private\n */\n _destroyAllMenu() {\n snippet.forEach(this.options.menu, (menuName) => {\n this[menuName].destroy();\n });\n\n this._historyMenu.destroy();\n }\n\n /**\n * Init canvas\n * @ignore\n */\n initCanvas() {\n const loadImageInfo = this._getLoadImage();\n if (loadImageInfo.path) {\n this._actions.main.initLoadImage(loadImageInfo.path, loadImageInfo.name).then(() => {\n this.activeMenuEvent();\n });\n }\n\n this._addLoadEvent();\n\n const gridVisual = document.createElement('div');\n\n gridVisual.className = cls('grid-visual');\n const grid = `\n \n \n \n
`;\n gridVisual.innerHTML = grid;\n this._editorContainerElement = this._editorElement.querySelector(\n '.tui-image-editor-canvas-container'\n );\n this._editorContainerElement.appendChild(gridVisual);\n }\n\n /**\n * get editor area element\n * @returns {Object} load image option\n * @private\n */\n _getLoadImage() {\n return this.options.loadImage;\n }\n\n /**\n * change menu\n * @param {string} menuName - menu name\n * @param {boolean} toggle - whether toogle or not\n * @param {boolean} discardSelection - discard selection\n * @ignore\n */\n changeMenu(menuName, toggle = true, discardSelection = true) {\n if (!this._submenuChangeTransection) {\n this._submenuChangeTransection = true;\n this._changeMenu(menuName, toggle, discardSelection);\n this._submenuChangeTransection = false;\n }\n }\n\n /**\n * change menu\n * @param {string} menuName - menu name\n * @param {boolean} toggle - whether toggle or not\n * @param {boolean} discardSelection - discard selection\n * @private\n */\n _changeMenu(menuName, toggle, discardSelection) {\n if (this.submenu) {\n this._buttonElements[this.submenu].classList.remove('active');\n this._mainElement.classList.remove(`tui-image-editor-menu-${this.submenu}`);\n if (discardSelection) {\n this._actions.main.discardSelection();\n }\n this._actions.main.changeSelectableAll(true);\n this[this.submenu].changeStandbyMode();\n }\n\n if (this.submenu === menuName && toggle) {\n this.submenu = null;\n } else {\n this._buttonElements[menuName].classList.add('active');\n this._mainElement.classList.add(`tui-image-editor-menu-${menuName}`);\n this.submenu = menuName;\n this[this.submenu].changeStartMode();\n }\n\n this.resizeEditor();\n }\n\n /**\n * Init menu\n * @private\n */\n _initMenu() {\n if (this.options.initMenu) {\n const evt = document.createEvent('MouseEvents');\n evt.initEvent('click', true, false);\n this._buttonElements[this.options.initMenu].dispatchEvent(evt);\n }\n\n if (this.icon) {\n this.icon.registerDefaultIcon();\n }\n }\n\n /**\n * Get canvas max Dimension\n * @returns {Object} - width & height of editor\n * @private\n */\n _getCanvasMaxDimension() {\n const { maxWidth, maxHeight } = this._editorContainerElement.style;\n const width = parseFloat(maxWidth);\n const height = parseFloat(maxHeight);\n\n return {\n width,\n height,\n };\n }\n\n /**\n * Set editor position\n * @param {string} menuBarPosition - top or right or bottom or left\n * @private\n */\n // eslint-disable-next-line complexity\n _setEditorPosition(menuBarPosition) {\n const { width, height } = this._getCanvasMaxDimension();\n const editorElementStyle = this._editorElement.style;\n let top = 0;\n let left = 0;\n\n if (this.submenu) {\n if (menuBarPosition === 'bottom') {\n if (height > this._editorElementWrap.scrollHeight - 150) {\n top = (height - this._editorElementWrap.scrollHeight) / 2;\n } else {\n top = (150 / 2) * -1;\n }\n } else if (menuBarPosition === 'top') {\n if (height > this._editorElementWrap.offsetHeight - 150) {\n top = 150 / 2 - (height - (this._editorElementWrap.offsetHeight - 150)) / 2;\n } else {\n top = 150 / 2;\n }\n } else if (menuBarPosition === 'left') {\n if (width > this._editorElementWrap.offsetWidth - 248) {\n left = 248 / 2 - (width - (this._editorElementWrap.offsetWidth - 248)) / 2;\n } else {\n left = 248 / 2;\n }\n } else if (menuBarPosition === 'right') {\n if (width > this._editorElementWrap.scrollWidth - 248) {\n left = (width - this._editorElementWrap.scrollWidth) / 2;\n } else {\n left = (248 / 2) * -1;\n }\n }\n }\n editorElementStyle.top = `${top}px`;\n editorElementStyle.left = `${left}px`;\n }\n}\n\nCustomEvents.mixin(Ui);\n\nexport default Ui;\n","import snippet from 'tui-code-snippet';\nimport Submenu from '@/ui/submenuBase';\nimport templateHtml from '@/ui/template/submenu/crop';\nimport { assignmentForDestroy } from '@/util';\n\n/**\n * Crop ui class\n * @class\n * @ignore\n */\nclass Crop extends Submenu {\n constructor(subMenuElement, { locale, makeSvgIcon, menuBarPosition, usageStatistics }) {\n super(subMenuElement, {\n locale,\n name: 'crop',\n makeSvgIcon,\n menuBarPosition,\n templateHtml,\n usageStatistics,\n });\n\n this.status = 'active';\n\n this._els = {\n apply: this.selector('.tie-crop-button .apply'),\n cancel: this.selector('.tie-crop-button .cancel'),\n preset: this.selector('.tie-crop-preset-button'),\n };\n\n this.defaultPresetButton = this._els.preset.querySelector('.preset-none');\n }\n\n /**\n * Destroys the instance.\n */\n destroy() {\n this._removeEvent();\n\n assignmentForDestroy(this);\n }\n\n /**\n * Add event for crop\n * @param {Object} actions - actions for crop\n * @param {Function} actions.crop - crop action\n * @param {Function} actions.cancel - cancel action\n * @param {Function} actions.preset - draw rectzone at a predefined ratio\n */\n addEvent(actions) {\n const apply = this._applyEventHandler.bind(this);\n const cancel = this._cancelEventHandler.bind(this);\n const cropzonePreset = this._cropzonePresetEventHandler.bind(this);\n\n this.eventHandler = {\n apply,\n cancel,\n cropzonePreset,\n };\n\n this.actions = actions;\n this._els.apply.addEventListener('click', apply);\n this._els.cancel.addEventListener('click', cancel);\n this._els.preset.addEventListener('click', cropzonePreset);\n }\n\n /**\n * Remove event\n * @private\n */\n _removeEvent() {\n this._els.apply.removeEventListener('click', this.eventHandler.apply);\n this._els.cancel.removeEventListener('click', this.eventHandler.cancel);\n this._els.preset.removeEventListener('click', this.eventHandler.cropzonePreset);\n }\n\n _applyEventHandler() {\n this.actions.crop();\n this._els.apply.classList.remove('active');\n }\n\n _cancelEventHandler() {\n this.actions.cancel();\n this._els.apply.classList.remove('active');\n }\n\n _cropzonePresetEventHandler(event) {\n const button = event.target.closest('.tui-image-editor-button.preset');\n if (button) {\n const [presetType] = button.className.match(/preset-[^\\s]+/);\n\n this._setPresetButtonActive(button);\n this.actions.preset(presetType);\n }\n }\n\n /**\n * Executed when the menu starts.\n */\n changeStartMode() {\n this.actions.modeChange('crop');\n }\n\n /**\n * Returns the menu to its default state.\n */\n changeStandbyMode() {\n this.actions.stopDrawingMode();\n this._setPresetButtonActive();\n }\n\n /**\n * Change apply button status\n * @param {Boolean} enableStatus - apply button status\n */\n changeApplyButtonStatus(enableStatus) {\n if (enableStatus) {\n this._els.apply.classList.add('active');\n } else {\n this._els.apply.classList.remove('active');\n }\n }\n\n /**\n * Set preset button to active status\n * @param {HTMLElement} button - event target element\n * @private\n */\n _setPresetButtonActive(button = this.defaultPresetButton) {\n snippet.forEach([].slice.call(this._els.preset.querySelectorAll('.preset')), (presetButton) => {\n presetButton.classList.remove('active');\n });\n\n if (button) {\n button.classList.add('active');\n }\n }\n}\n\nexport default Crop;\n","import Colorpicker from '@/ui/tools/colorpicker';\nimport Range from '@/ui/tools/range';\nimport Submenu from '@/ui/submenuBase';\nimport templateHtml from '@/ui/template/submenu/draw';\nimport { assignmentForDestroy, getRgb } from '@/util';\nimport { defaultDrawRangeValues } from '@/consts';\n\nconst DRAW_OPACITY = 0.7;\n\n/**\n * Draw ui class\n * @class\n * @ignore\n */\nclass Draw extends Submenu {\n constructor(subMenuElement, { locale, makeSvgIcon, menuBarPosition, usageStatistics }) {\n super(subMenuElement, {\n locale,\n name: 'draw',\n makeSvgIcon,\n menuBarPosition,\n templateHtml,\n usageStatistics,\n });\n\n this._els = {\n lineSelectButton: this.selector('.tie-draw-line-select-button'),\n drawColorPicker: new Colorpicker(\n this.selector('.tie-draw-color'),\n '#00a9ff',\n this.toggleDirection,\n this.usageStatistics\n ),\n drawRange: new Range(\n {\n slider: this.selector('.tie-draw-range'),\n input: this.selector('.tie-draw-range-value'),\n },\n defaultDrawRangeValues\n ),\n };\n\n this.type = null;\n this.color = this._els.drawColorPicker.color;\n this.width = this._els.drawRange.value;\n }\n\n /**\n * Destroys the instance.\n */\n destroy() {\n this._removeEvent();\n this._els.drawColorPicker.destroy();\n this._els.drawRange.destroy();\n\n assignmentForDestroy(this);\n }\n\n /**\n * Add event for draw\n * @param {Object} actions - actions for crop\n * @param {Function} actions.setDrawMode - set draw mode\n */\n addEvent(actions) {\n this.eventHandler.changeDrawType = this._changeDrawType.bind(this);\n\n this.actions = actions;\n this._els.lineSelectButton.addEventListener('click', this.eventHandler.changeDrawType);\n this._els.drawColorPicker.on('change', this._changeDrawColor.bind(this));\n this._els.drawRange.on('change', this._changeDrawRange.bind(this));\n }\n\n /**\n * Remove event\n * @private\n */\n _removeEvent() {\n this._els.lineSelectButton.removeEventListener('click', this.eventHandler.changeDrawType);\n this._els.drawColorPicker.off();\n this._els.drawRange.off();\n }\n\n /**\n * set draw mode - action runner\n */\n setDrawMode() {\n this.actions.setDrawMode(this.type, {\n width: this.width,\n color: getRgb(this.color, DRAW_OPACITY),\n });\n }\n\n /**\n * Returns the menu to its default state.\n */\n changeStandbyMode() {\n this.type = null;\n this.actions.stopDrawingMode();\n this.actions.changeSelectableAll(true);\n this._els.lineSelectButton.classList.remove('free');\n this._els.lineSelectButton.classList.remove('line');\n }\n\n /**\n * Executed when the menu starts.\n */\n changeStartMode() {\n this.type = 'free';\n this._els.lineSelectButton.classList.add('free');\n this.setDrawMode();\n }\n\n /**\n * Change draw type event\n * @param {object} event - line select event\n * @private\n */\n _changeDrawType(event) {\n const button = event.target.closest('.tui-image-editor-button');\n if (button) {\n const lineType = this.getButtonType(button, ['free', 'line']);\n this.actions.discardSelection();\n\n if (this.type === lineType) {\n this.changeStandbyMode();\n\n return;\n }\n\n this.changeStandbyMode();\n this.type = lineType;\n this._els.lineSelectButton.classList.add(lineType);\n this.setDrawMode();\n }\n }\n\n /**\n * Change drawing color\n * @param {string} color - select drawing color\n * @private\n */\n _changeDrawColor(color) {\n this.color = color || 'transparent';\n if (!this.type) {\n this.changeStartMode();\n } else {\n this.setDrawMode();\n }\n }\n\n /**\n * Change drawing Range\n * @param {number} value - select drawing range\n * @private\n */\n _changeDrawRange(value) {\n this.width = value;\n if (!this.type) {\n this.changeStartMode();\n } else {\n this.setDrawMode();\n }\n }\n}\n\nexport default Draw;\n","import snippet from 'tui-code-snippet';\nimport Colorpicker from '@/ui/tools/colorpicker';\nimport Range from '@/ui/tools/range';\nimport Submenu from '@/ui/submenuBase';\nimport templateHtml from '@/ui/template/submenu/filter';\nimport { toInteger, toCamelCase, assignmentForDestroy } from '@/util';\nimport { defaultFilterRangeValues as FILTER_RANGE } from '@/consts';\n\nconst PICKER_CONTROL_HEIGHT = '130px';\nconst BLEND_OPTIONS = ['add', 'diff', 'subtract', 'multiply', 'screen', 'lighten', 'darken'];\nconst FILTER_OPTIONS = [\n 'grayscale',\n 'invert',\n 'sepia',\n 'vintage',\n 'blur',\n 'sharpen',\n 'emboss',\n 'remove-white',\n 'brightness',\n 'noise',\n 'pixelate',\n 'color-filter',\n 'tint',\n 'multiply',\n 'blend',\n];\nconst filterNameMap = {\n grayscale: 'grayscale',\n invert: 'invert',\n sepia: 'sepia',\n blur: 'blur',\n sharpen: 'sharpen',\n emboss: 'emboss',\n removeWhite: 'removeColor',\n brightness: 'brightness',\n contrast: 'contrast',\n saturation: 'saturation',\n vintage: 'vintage',\n polaroid: 'polaroid',\n noise: 'noise',\n pixelate: 'pixelate',\n colorFilter: 'removeColor',\n tint: 'blendColor',\n multiply: 'blendColor',\n blend: 'blendColor',\n hue: 'hue',\n gamma: 'gamma',\n};\nconst RANGE_INSTANCE_NAMES = [\n 'removewhiteDistanceRange',\n 'colorfilterThresholdRange',\n 'pixelateRange',\n 'noiseRange',\n 'brightnessRange',\n 'tintOpacity',\n];\nconst COLORPICKER_INSTANCE_NAMES = ['filterBlendColor', 'filterMultiplyColor', 'filterTintColor'];\n\n/**\n * Filter ui class\n * @class\n * @ignore\n */\nclass Filter extends Submenu {\n constructor(subMenuElement, { locale, menuBarPosition, usageStatistics }) {\n super(subMenuElement, {\n locale,\n name: 'filter',\n menuBarPosition,\n templateHtml,\n usageStatistics,\n });\n\n this.selectBoxShow = false;\n\n this.checkedMap = {};\n this._makeControlElement();\n }\n\n /**\n * Destroys the instance.\n */\n destroy() {\n this._removeEvent();\n this._destroyToolInstance();\n\n assignmentForDestroy(this);\n }\n\n /**\n * Remove event for filter\n */\n _removeEvent() {\n snippet.forEach(FILTER_OPTIONS, (filter) => {\n const filterCheckElement = this.selector(`.tie-${filter}`);\n const filterNameCamelCase = toCamelCase(filter);\n\n filterCheckElement.removeEventListener('change', this.eventHandler[filterNameCamelCase]);\n });\n\n snippet.forEach([...RANGE_INSTANCE_NAMES, ...COLORPICKER_INSTANCE_NAMES], (instanceName) => {\n this._els[instanceName].off();\n });\n\n this._els.blendType.removeEventListener('change', this.eventHandler.changeBlendFilter);\n this._els.blendType.removeEventListener('click', this.eventHandler.changeBlendFilter);\n }\n\n _destroyToolInstance() {\n snippet.forEach([...RANGE_INSTANCE_NAMES, ...COLORPICKER_INSTANCE_NAMES], (instanceName) => {\n this._els[instanceName].destroy();\n });\n }\n\n /**\n * Add event for filter\n * @param {Object} actions - actions for crop\n * @param {Function} actions.applyFilter - apply filter option\n */\n addEvent({ applyFilter }) {\n const changeFilterState = (filterName) =>\n this._changeFilterState.bind(this, applyFilter, filterName);\n const changeFilterStateForRange = (filterName) => (value, isLast) =>\n this._changeFilterState(applyFilter, filterName, isLast);\n\n this.eventHandler = {\n changeBlendFilter: changeFilterState('blend'),\n blandTypeClick: (event) => event.stopPropagation(),\n };\n\n snippet.forEach(FILTER_OPTIONS, (filter) => {\n const filterCheckElement = this.selector(`.tie-${filter}`);\n const filterNameCamelCase = toCamelCase(filter);\n this.checkedMap[filterNameCamelCase] = filterCheckElement;\n this.eventHandler[filterNameCamelCase] = changeFilterState(filterNameCamelCase);\n\n filterCheckElement.addEventListener('change', this.eventHandler[filterNameCamelCase]);\n });\n\n this._els.removewhiteDistanceRange.on('change', changeFilterStateForRange('removeWhite'));\n this._els.colorfilterThresholdRange.on('change', changeFilterStateForRange('colorFilter'));\n this._els.pixelateRange.on('change', changeFilterStateForRange('pixelate'));\n this._els.noiseRange.on('change', changeFilterStateForRange('noise'));\n this._els.brightnessRange.on('change', changeFilterStateForRange('brightness'));\n\n this._els.filterBlendColor.on('change', this.eventHandler.changeBlendFilter);\n this._els.filterMultiplyColor.on('change', changeFilterState('multiply'));\n this._els.filterTintColor.on('change', changeFilterState('tint'));\n this._els.tintOpacity.on('change', changeFilterStateForRange('tint'));\n this._els.filterMultiplyColor.on('changeShow', this.colorPickerChangeShow.bind(this));\n this._els.filterTintColor.on('changeShow', this.colorPickerChangeShow.bind(this));\n this._els.filterBlendColor.on('changeShow', this.colorPickerChangeShow.bind(this));\n\n this._els.blendType.addEventListener('change', this.eventHandler.changeBlendFilter);\n this._els.blendType.addEventListener('click', this.eventHandler.blandTypeClick);\n }\n\n /**\n * Set filter for undo changed\n * @param {Object} changedFilterInfos - changed command infos\n * @param {string} type - filter type\n * @param {string} action - add or remove\n * @param {Object} options - filter options\n */\n setFilterState(changedFilterInfos) {\n const { type, options, action } = changedFilterInfos;\n const filterName = this._getFilterNameFromOptions(type, options);\n const isRemove = action === 'remove';\n\n if (!isRemove) {\n this._setFilterState(filterName, options);\n }\n\n this.checkedMap[filterName].checked = !isRemove;\n }\n\n /**\n * Set filter for undo changed\n * @param {string} filterName - filter name\n * @param {Object} options - filter options\n * @private\n */\n // eslint-disable-next-line complexity\n _setFilterState(filterName, options) {\n if (filterName === 'colorFilter') {\n this._els.colorfilterThresholdRange.value = options.distance;\n } else if (filterName === 'removeWhite') {\n this._els.removewhiteDistanceRange.value = options.distance;\n } else if (filterName === 'pixelate') {\n this._els.pixelateRange.value = options.blocksize;\n } else if (filterName === 'brightness') {\n this._els.brightnessRange.value = options.brightness;\n } else if (filterName === 'noise') {\n this._els.noiseRange.value = options.noise;\n } else if (filterName === 'tint') {\n this._els.tintOpacity.value = options.alpha;\n this._els.filterTintColor.color = options.color;\n } else if (filterName === 'blend') {\n this._els.filterBlendColor.color = options.color;\n } else if (filterName === 'multiply') {\n this._els.filterMultiplyColor.color = options.color;\n }\n }\n\n /**\n * Get filter name\n * @param {string} type - filter type\n * @param {Object} options - filter options\n * @returns {string} filter name\n * @private\n */\n _getFilterNameFromOptions(type, options) {\n let filterName = type;\n\n if (type === 'removeColor') {\n filterName = snippet.isExisty(options.useAlpha) ? 'removeWhite' : 'colorFilter';\n } else if (type === 'blendColor') {\n filterName = {\n add: 'blend',\n multiply: 'multiply',\n tint: 'tint',\n }[options.mode];\n }\n\n return filterName;\n }\n\n /**\n * Add event for filter\n * @param {Function} applyFilter - actions for firter\n * @param {string} filterName - filter name\n * @param {boolean} [isLast] - Is last change\n */\n _changeFilterState(applyFilter, filterName, isLast = true) {\n const apply = this.checkedMap[filterName].checked;\n const type = filterNameMap[filterName];\n\n const checkboxGroup = this.checkedMap[filterName].closest('.tui-image-editor-checkbox-group');\n if (checkboxGroup) {\n if (apply) {\n checkboxGroup.classList.remove('tui-image-editor-disabled');\n } else {\n checkboxGroup.classList.add('tui-image-editor-disabled');\n }\n }\n applyFilter(apply, type, this._getFilterOption(filterName), !isLast);\n }\n\n /**\n * Get filter option\n * @param {String} type - filter type\n * @returns {Object} filter option object\n * @private\n */\n // eslint-disable-next-line complexity\n _getFilterOption(type) {\n const option = {};\n switch (type) {\n case 'removeWhite':\n option.color = '#FFFFFF';\n option.useAlpha = false;\n option.distance = parseFloat(this._els.removewhiteDistanceRange.value);\n break;\n case 'colorFilter':\n option.color = '#FFFFFF';\n option.distance = parseFloat(this._els.colorfilterThresholdRange.value);\n break;\n case 'pixelate':\n option.blocksize = toInteger(this._els.pixelateRange.value);\n break;\n case 'noise':\n option.noise = toInteger(this._els.noiseRange.value);\n break;\n case 'brightness':\n option.brightness = parseFloat(this._els.brightnessRange.value);\n break;\n case 'blend':\n option.mode = 'add';\n option.color = this._els.filterBlendColor.color;\n option.mode = this._els.blendType.value;\n break;\n case 'multiply':\n option.mode = 'multiply';\n option.color = this._els.filterMultiplyColor.color;\n break;\n case 'tint':\n option.mode = 'tint';\n option.color = this._els.filterTintColor.color;\n option.alpha = this._els.tintOpacity.value;\n break;\n case 'blur':\n option.blur = this._els.blurRange.value;\n break;\n default:\n break;\n }\n\n return option;\n }\n\n /**\n * Make submenu range and colorpicker control\n * @private\n */\n _makeControlElement() {\n this._els = {\n removewhiteDistanceRange: new Range(\n { slider: this.selector('.tie-removewhite-distance-range') },\n FILTER_RANGE.removewhiteDistanceRange\n ),\n brightnessRange: new Range(\n { slider: this.selector('.tie-brightness-range') },\n FILTER_RANGE.brightnessRange\n ),\n noiseRange: new Range({ slider: this.selector('.tie-noise-range') }, FILTER_RANGE.noiseRange),\n pixelateRange: new Range(\n { slider: this.selector('.tie-pixelate-range') },\n FILTER_RANGE.pixelateRange\n ),\n colorfilterThresholdRange: new Range(\n { slider: this.selector('.tie-colorfilter-threshold-range') },\n FILTER_RANGE.colorfilterThresholdRange\n ),\n filterTintColor: new Colorpicker(\n this.selector('.tie-filter-tint-color'),\n '#03bd9e',\n this.toggleDirection,\n this.usageStatistics\n ),\n filterMultiplyColor: new Colorpicker(\n this.selector('.tie-filter-multiply-color'),\n '#515ce6',\n this.toggleDirection,\n this.usageStatistics\n ),\n filterBlendColor: new Colorpicker(\n this.selector('.tie-filter-blend-color'),\n '#ffbb3b',\n this.toggleDirection,\n this.usageStatistics\n ),\n blurRange: FILTER_RANGE.blurFilterRange,\n };\n\n this._els.tintOpacity = this._pickerWithRange(this._els.filterTintColor.pickerControl);\n this._els.blendType = this._pickerWithSelectbox(this._els.filterBlendColor.pickerControl);\n\n this.colorPickerControls.push(this._els.filterTintColor);\n this.colorPickerControls.push(this._els.filterMultiplyColor);\n this.colorPickerControls.push(this._els.filterBlendColor);\n }\n\n /**\n * Make submenu control for picker & range mixin\n * @param {HTMLElement} pickerControl - pickerControl dom element\n * @returns {Range}\n * @private\n */\n _pickerWithRange(pickerControl) {\n const rangeWrap = document.createElement('div');\n const rangeLabel = document.createElement('label');\n const slider = document.createElement('div');\n\n slider.id = 'tie-filter-tint-opacity';\n rangeLabel.innerHTML = 'Opacity';\n rangeWrap.appendChild(rangeLabel);\n rangeWrap.appendChild(slider);\n pickerControl.appendChild(rangeWrap);\n pickerControl.style.height = PICKER_CONTROL_HEIGHT;\n\n return new Range({ slider }, FILTER_RANGE.tintOpacityRange);\n }\n\n /**\n * Make submenu control for picker & selectbox\n * @param {HTMLElement} pickerControl - pickerControl dom element\n * @returns {HTMLElement}\n * @private\n */\n _pickerWithSelectbox(pickerControl) {\n const selectlistWrap = document.createElement('div');\n const selectlist = document.createElement('select');\n const optionlist = document.createElement('ul');\n\n selectlistWrap.className = 'tui-image-editor-selectlist-wrap';\n optionlist.className = 'tui-image-editor-selectlist';\n\n selectlistWrap.appendChild(selectlist);\n selectlistWrap.appendChild(optionlist);\n\n this._makeSelectOptionList(selectlist);\n\n pickerControl.appendChild(selectlistWrap);\n pickerControl.style.height = PICKER_CONTROL_HEIGHT;\n\n this._drawSelectOptionList(selectlist, optionlist);\n this._pickerWithSelectboxForAddEvent(selectlist, optionlist);\n\n return selectlist;\n }\n\n /**\n * Make selectbox option list custom style\n * @param {HTMLElement} selectlist - selectbox element\n * @param {HTMLElement} optionlist - custom option list item element\n * @private\n */\n _drawSelectOptionList(selectlist, optionlist) {\n const options = selectlist.querySelectorAll('option');\n snippet.forEach(options, (option) => {\n const optionElement = document.createElement('li');\n optionElement.innerHTML = option.innerHTML;\n optionElement.setAttribute('data-item', option.value);\n optionlist.appendChild(optionElement);\n });\n }\n\n /**\n * custom selectbox custom event\n * @param {HTMLElement} selectlist - selectbox element\n * @param {HTMLElement} optionlist - custom option list item element\n * @private\n */\n _pickerWithSelectboxForAddEvent(selectlist, optionlist) {\n optionlist.addEventListener('click', (event) => {\n const optionValue = event.target.getAttribute('data-item');\n const fireEvent = document.createEvent('HTMLEvents');\n\n selectlist.querySelector(`[value=\"${optionValue}\"]`).selected = true;\n fireEvent.initEvent('change', true, true);\n\n selectlist.dispatchEvent(fireEvent);\n\n this.selectBoxShow = false;\n optionlist.style.display = 'none';\n });\n\n selectlist.addEventListener('mousedown', (event) => {\n event.preventDefault();\n this.selectBoxShow = !this.selectBoxShow;\n optionlist.style.display = this.selectBoxShow ? 'block' : 'none';\n optionlist.setAttribute('data-selectitem', selectlist.value);\n optionlist.querySelector(`[data-item='${selectlist.value}']`).classList.add('active');\n });\n }\n\n /**\n * Make option list for select control\n * @param {HTMLElement} selectlist - blend option select list element\n * @private\n */\n _makeSelectOptionList(selectlist) {\n snippet.forEach(BLEND_OPTIONS, (option) => {\n const selectOption = document.createElement('option');\n selectOption.setAttribute('value', option);\n selectOption.innerHTML = option.replace(/^[a-z]/, ($0) => $0.toUpperCase());\n selectlist.appendChild(selectOption);\n });\n }\n}\n\nexport default Filter;\n","import snippet from 'tui-code-snippet';\nimport Submenu from '@/ui/submenuBase';\nimport templateHtml from '@/ui/template/submenu/flip';\nimport { assignmentForDestroy } from '@/util';\n\n/**\n * Flip ui class\n * @class\n * @ignore\n */\nclass Flip extends Submenu {\n constructor(subMenuElement, { locale, makeSvgIcon, menuBarPosition, usageStatistics }) {\n super(subMenuElement, {\n locale,\n name: 'flip',\n makeSvgIcon,\n menuBarPosition,\n templateHtml,\n usageStatistics,\n });\n this.flipStatus = false;\n\n this._els = {\n flipButton: this.selector('.tie-flip-button'),\n };\n }\n\n /**\n * Destroys the instance.\n */\n destroy() {\n this._removeEvent();\n\n assignmentForDestroy(this);\n }\n\n /**\n * Add event for flip\n * @param {Object} actions - actions for flip\n * @param {Function} actions.flip - flip action\n */\n addEvent(actions) {\n this.eventHandler.changeFlip = this._changeFlip.bind(this);\n this._actions = actions;\n this._els.flipButton.addEventListener('click', this.eventHandler.changeFlip);\n }\n\n /**\n * Remove event\n * @private\n */\n _removeEvent() {\n this._els.flipButton.removeEventListener('click', this.eventHandler.changeFlip);\n }\n\n /**\n * change Flip status\n * @param {object} event - change event\n * @private\n */\n _changeFlip(event) {\n const button = event.target.closest('.tui-image-editor-button');\n if (button) {\n const flipType = this.getButtonType(button, ['flipX', 'flipY', 'resetFlip']);\n if (!this.flipStatus && flipType === 'resetFlip') {\n return;\n }\n\n this._actions.flip(flipType).then((flipStatus) => {\n const flipClassList = this._els.flipButton.classList;\n this.flipStatus = false;\n\n flipClassList.remove('resetFlip');\n snippet.forEach(['flipX', 'flipY'], (type) => {\n flipClassList.remove(type);\n if (flipStatus[type]) {\n flipClassList.add(type);\n flipClassList.add('resetFlip');\n this.flipStatus = true;\n }\n });\n });\n }\n }\n}\n\nexport default Flip;\n","import Panel from '@/ui/panelMenu';\nimport templateHtml from '@/ui/template/submenu/history';\nimport { assignmentForDestroy } from '@/util';\n\nconst historyClassName = 'history-item';\nconst selectedClassName = 'selected-item';\nconst disabledClassName = 'disabled-item';\n\n/**\n * History ui class\n * @class\n * @ignore\n */\nclass History extends Panel {\n constructor(menuElement, { locale, makeSvgIcon }) {\n super(menuElement, { name: 'history' });\n menuElement.classList.add('enabled');\n\n this.locale = locale;\n this.makeSvgIcon = makeSvgIcon;\n this._eventHandler = {};\n this._historyIndex = this.getListLength();\n }\n\n /**\n * Add history\n * @param {string} name - name of history\n * @param {?string} detail - detail information of history\n */\n add({ name, detail }) {\n if (this._hasDisabledItem()) {\n this.deleteListItemElement(this._historyIndex + 1, this.getListLength());\n }\n\n const html = templateHtml({ locale: this.locale, makeSvgIcon: this.makeSvgIcon, name, detail });\n const item = this.makeListItemElement(html);\n\n this.pushListItemElement(item);\n this._historyIndex = this.getListLength() - 1;\n this._selectItem(this._historyIndex);\n }\n\n /**\n * Init history\n */\n init() {\n this.deleteListItemElement(1, this.getListLength());\n this._historyIndex = 0;\n this._selectItem(this._historyIndex);\n }\n\n /**\n * Clear history\n */\n clear() {\n this.deleteListItemElement(0, this.getListLength());\n this._historyIndex = -1;\n }\n\n /**\n * Select previous history of current selected history\n */\n prev() {\n this._historyIndex -= 1;\n this._selectItem(this._historyIndex);\n }\n\n /**\n * Select next history of current selected history\n */\n next() {\n this._historyIndex += 1;\n this._selectItem(this._historyIndex);\n }\n\n /**\n * Whether history menu has disabled item\n * @returns {boolean}\n */\n _hasDisabledItem() {\n return this.getListLength() - 1 > this._historyIndex;\n }\n\n /**\n * Add history menu event\n * @private\n */\n _addHistoryEventListener() {\n this._eventHandler.history = (event) => this._clickHistoryItem(event);\n this.listElement.addEventListener('click', this._eventHandler.history);\n }\n\n /**\n * Remove history menu event\n * @private\n */\n _removeHistoryEventListener() {\n this.listElement.removeEventListener('click', this._eventHandler.history);\n }\n\n /**\n * onClick history menu event listener\n * @param {object} event - event object\n * @private\n */\n _clickHistoryItem(event) {\n const { target } = event;\n const item = target.closest(`.${historyClassName}`);\n\n if (!item) {\n return;\n }\n\n const index = Number.parseInt(item.getAttribute('data-index'), 10);\n\n if (index !== this._historyIndex) {\n const count = Math.abs(index - this._historyIndex);\n\n if (index < this._historyIndex) {\n this._actions.undo(count);\n } else {\n this._actions.redo(count);\n }\n }\n }\n\n /**\n * Change item's state to selected state\n * @param {number} index - index of selected item\n */\n _selectItem(index) {\n for (let i = 0; i < this.getListLength(); i += 1) {\n this.removeClass(i, selectedClassName);\n this.removeClass(i, disabledClassName);\n if (i > index) {\n this.addClass(i, disabledClassName);\n }\n }\n this.addClass(index, selectedClassName);\n }\n\n /**\n * Destroys the instance.\n */\n destroy() {\n this.removeEvent();\n\n assignmentForDestroy(this);\n }\n\n /**\n * Add event for history\n * @param {Object} actions - actions for crop\n * @param {Function} actions.undo - undo action\n * @param {Function} actions.redo - redo action\n */\n addEvent(actions) {\n this._actions = actions;\n this._addHistoryEventListener();\n }\n\n /**\n * Remove event\n * @private\n */\n removeEvent() {\n this._removeHistoryEventListener();\n }\n}\n\nexport default History;\n","import snippet from 'tui-code-snippet';\nimport Colorpicker from '@/ui/tools/colorpicker';\nimport Submenu from '@/ui/submenuBase';\nimport templateHtml from '@/ui/template/submenu/icon';\nimport { isSupportFileApi, assignmentForDestroy } from '@/util';\nimport { defaultIconPath } from '@/consts';\n\n/**\n * Icon ui class\n * @class\n * @ignore\n */\nclass Icon extends Submenu {\n constructor(subMenuElement, { locale, makeSvgIcon, menuBarPosition, usageStatistics }) {\n super(subMenuElement, {\n locale,\n name: 'icon',\n makeSvgIcon,\n menuBarPosition,\n templateHtml,\n usageStatistics,\n });\n\n this.iconType = null;\n this._iconMap = {};\n\n this._els = {\n registerIconButton: this.selector('.tie-icon-image-file'),\n addIconButton: this.selector('.tie-icon-add-button'),\n iconColorpicker: new Colorpicker(\n this.selector('.tie-icon-color'),\n '#ffbb3b',\n this.toggleDirection,\n this.usageStatistics\n ),\n };\n }\n\n /**\n * Destroys the instance.\n */\n destroy() {\n this._removeEvent();\n this._els.iconColorpicker.destroy();\n\n assignmentForDestroy(this);\n }\n\n /**\n * Add event for icon\n * @param {Object} actions - actions for icon\n * @param {Function} actions.registerCustomIcon - register icon\n * @param {Function} actions.addIcon - add icon\n * @param {Function} actions.changeColor - change icon color\n */\n addEvent(actions) {\n const registerIcon = this._registerIconHandler.bind(this);\n const addIcon = this._addIconHandler.bind(this);\n\n this.eventHandler = {\n registerIcon,\n addIcon,\n };\n\n this.actions = actions;\n this._els.iconColorpicker.on('change', this._changeColorHandler.bind(this));\n this._els.registerIconButton.addEventListener('change', registerIcon);\n this._els.addIconButton.addEventListener('click', addIcon);\n }\n\n /**\n * Remove event\n * @private\n */\n _removeEvent() {\n this._els.iconColorpicker.off();\n this._els.registerIconButton.removeEventListener('change', this.eventHandler.registerIcon);\n this._els.addIconButton.removeEventListener('click', this.eventHandler.addIcon);\n }\n\n /**\n * Clear icon type\n */\n clearIconType() {\n this._els.addIconButton.classList.remove(this.iconType);\n this.iconType = null;\n }\n\n /**\n * Register default icon\n */\n registerDefaultIcon() {\n snippet.forEach(defaultIconPath, (path, type) => {\n this.actions.registerDefaultIcons(type, path);\n });\n }\n\n /**\n * Set icon picker color\n * @param {string} iconColor - rgb color string\n */\n setIconPickerColor(iconColor) {\n this._els.iconColorpicker.color = iconColor;\n }\n\n /**\n * Returns the menu to its default state.\n */\n changeStandbyMode() {\n this.clearIconType();\n this.actions.cancelAddIcon();\n }\n\n /**\n * Change icon color\n * @param {string} color - color for change\n * @private\n */\n _changeColorHandler(color) {\n color = color || 'transparent';\n this.actions.changeColor(color);\n }\n\n /**\n * Change icon color\n * @param {object} event - add button event object\n * @private\n */\n _addIconHandler(event) {\n const button = event.target.closest('.tui-image-editor-button');\n\n if (button) {\n const iconType = button.getAttribute('data-icontype');\n const iconColor = this._els.iconColorpicker.color;\n this.actions.discardSelection();\n this.actions.changeSelectableAll(false);\n this._els.addIconButton.classList.remove(this.iconType);\n this._els.addIconButton.classList.add(iconType);\n\n if (this.iconType === iconType) {\n this.changeStandbyMode();\n } else {\n this.actions.addIcon(iconType, iconColor);\n this.iconType = iconType;\n }\n }\n }\n\n /**\n * register icon\n * @param {object} event - file change event object\n * @private\n */\n _registerIconHandler(event) {\n let imgUrl;\n\n if (!isSupportFileApi) {\n alert('This browser does not support file-api');\n }\n\n const [file] = event.target.files;\n\n if (file) {\n imgUrl = URL.createObjectURL(file);\n this.actions.registerCustomIcon(imgUrl, file);\n }\n }\n}\n\nexport default Icon;\n","/**\n * Translate messages\n */\nclass Locale {\n /**\n * @constructor\n * @param {Object} locale - Locale object for initialise\n */\n constructor(locale) {\n this._locale = locale;\n }\n\n /**\n * localize message\n * @param {string} message - message who will be localized\n * @returns {string}\n */\n localize(message) {\n return this._locale[message] || message;\n }\n}\n\nexport default Locale;\n","import Submenu from '@/ui/submenuBase';\nimport templateHtml from '@/ui/template/submenu/mask';\nimport { assignmentForDestroy, isSupportFileApi } from '@/util';\n\n/**\n * Mask ui class\n * @class\n * @ignore\n */\nclass Mask extends Submenu {\n constructor(subMenuElement, { locale, makeSvgIcon, menuBarPosition, usageStatistics }) {\n super(subMenuElement, {\n locale,\n name: 'mask',\n makeSvgIcon,\n menuBarPosition,\n templateHtml,\n usageStatistics,\n });\n\n this._els = {\n applyButton: this.selector('.tie-mask-apply'),\n maskImageButton: this.selector('.tie-mask-image-file'),\n };\n }\n\n /**\n * Destroys the instance.\n */\n destroy() {\n this._removeEvent();\n\n assignmentForDestroy(this);\n }\n\n /**\n * Add event for mask\n * @param {Object} actions - actions for crop\n * @param {Function} actions.loadImageFromURL - load image action\n * @param {Function} actions.applyFilter - apply filter action\n */\n addEvent(actions) {\n const loadMaskFile = this._loadMaskFile.bind(this);\n const applyMask = this._applyMask.bind(this);\n\n this.eventHandler = {\n loadMaskFile,\n applyMask,\n };\n\n this.actions = actions;\n this._els.maskImageButton.addEventListener('change', loadMaskFile);\n this._els.applyButton.addEventListener('click', applyMask);\n }\n\n /**\n * Remove event\n * @private\n */\n _removeEvent() {\n this._els.maskImageButton.removeEventListener('change', this.eventHandler.loadMaskFile);\n this._els.applyButton.removeEventListener('click', this.eventHandler.applyMask);\n }\n\n /**\n * Apply mask\n * @private\n */\n _applyMask() {\n this.actions.applyFilter();\n this._els.applyButton.classList.remove('active');\n }\n\n /**\n * Load mask file\n * @param {object} event - File change event object\n * @private\n */\n _loadMaskFile(event) {\n let imgUrl;\n\n if (!isSupportFileApi()) {\n alert('This browser does not support file-api');\n }\n\n const [file] = event.target.files;\n\n if (file) {\n imgUrl = URL.createObjectURL(file);\n this.actions.loadImageFromURL(imgUrl, file);\n this._els.applyButton.classList.add('active');\n }\n }\n}\n\nexport default Mask;\n","/**\n * Menu Panel Class\n * @class\n * @ignore\n */\n\nclass Panel {\n /**\n * @param {HTMLElement} menuElement - menu dom element\n * @param {Object} options - menu options\n * @param {string} options.name - name of panel menu\n */\n constructor(menuElement, { name }) {\n this.name = name;\n this.items = [];\n\n this.panelElement = this._makePanelElement();\n this.listElement = this._makeListElement();\n\n this.panelElement.appendChild(this.listElement);\n menuElement.appendChild(this.panelElement);\n }\n\n /**\n * Make Panel element\n * @returns {HTMLElement}\n */\n _makePanelElement() {\n const panel = document.createElement('div');\n\n panel.className = `tie-panel-${this.name}`;\n\n return panel;\n }\n\n /**\n * Make list element\n * @returns {HTMLElement} list element\n * @private\n */\n _makeListElement() {\n const list = document.createElement('ol');\n\n list.className = `${this.name}-list`;\n\n return list;\n }\n\n /**\n * Make list item element\n * @param {string} html - history list item html\n * @returns {HTMLElement} list item element\n */\n makeListItemElement(html) {\n const listItem = document.createElement('li');\n\n listItem.innerHTML = html;\n listItem.className = `${this.name}-item`;\n listItem.setAttribute('data-index', this.items.length);\n\n return listItem;\n }\n\n /**\n * Push list item element\n * @param {HTMLElement} item - list item element to add to the list\n */\n pushListItemElement(item) {\n this.listElement.appendChild(item);\n this.listElement.scrollTop += item.offsetHeight;\n this.items.push(item);\n }\n\n /**\n * Delete list item element\n * @param {number} start - start index to delete\n * @param {number} end - end index to delete\n */\n deleteListItemElement(start, end) {\n const { items } = this;\n\n for (let i = start; i < end; i += 1) {\n this.listElement.removeChild(items[i]);\n }\n items.splice(start, end - start + 1);\n }\n\n /**\n * Get list's length\n * @returns {number}\n */\n getListLength() {\n return this.items.length;\n }\n\n /**\n * Add class name of item\n * @param {number} index - index of item\n * @param {string} className - class name to add\n */\n addClass(index, className) {\n if (this.items[index]) {\n this.items[index].classList.add(className);\n }\n }\n\n /**\n * Remove class name of item\n * @param {number} index - index of item\n * @param {string} className - class name to remove\n */\n removeClass(index, className) {\n if (this.items[index]) {\n this.items[index].classList.remove(className);\n }\n }\n\n /**\n * Toggle class name of item\n * @param {number} index - index of item\n * @param {string} className - class name to remove\n */\n toggleClass(index, className) {\n if (this.items[index]) {\n this.items[index].classList.toggle(className);\n }\n }\n}\n\nexport default Panel;\n","import Range from '@/ui/tools/range';\nimport Submenu from '@/ui/submenuBase';\nimport templateHtml from '@/ui/template/submenu/rotate';\nimport { toInteger, assignmentForDestroy } from '@/util';\nimport { defaultRotateRangeValues } from '@/consts';\n\nconst CLOCKWISE = 30;\nconst COUNTERCLOCKWISE = -30;\n\n/**\n * Rotate ui class\n * @class\n * @ignore\n */\nclass Rotate extends Submenu {\n constructor(subMenuElement, { locale, makeSvgIcon, menuBarPosition, usageStatistics }) {\n super(subMenuElement, {\n locale,\n name: 'rotate',\n makeSvgIcon,\n menuBarPosition,\n templateHtml,\n usageStatistics,\n });\n this._value = 0;\n\n this._els = {\n rotateButton: this.selector('.tie-rotate-button'),\n rotateRange: new Range(\n {\n slider: this.selector('.tie-rotate-range'),\n input: this.selector('.tie-rotate-range-value'),\n },\n defaultRotateRangeValues\n ),\n };\n }\n\n /**\n * Destroys the instance.\n */\n destroy() {\n this._removeEvent();\n this._els.rotateRange.destroy();\n\n assignmentForDestroy(this);\n }\n\n setRangeBarAngle(type, angle) {\n let resultAngle = angle;\n\n if (type === 'rotate') {\n resultAngle = parseInt(this._els.rotateRange.value, 10) + angle;\n }\n\n this._setRangeBarRatio(resultAngle);\n }\n\n _setRangeBarRatio(angle) {\n this._els.rotateRange.value = angle;\n }\n\n /**\n * Add event for rotate\n * @param {Object} actions - actions for crop\n * @param {Function} actions.rotate - rotate action\n * @param {Function} actions.setAngle - set angle action\n */\n addEvent(actions) {\n this.eventHandler.rotationAngleChanged = this._changeRotateForButton.bind(this);\n\n // {rotate, setAngle}\n this.actions = actions;\n this._els.rotateButton.addEventListener('click', this.eventHandler.rotationAngleChanged);\n this._els.rotateRange.on('change', this._changeRotateForRange.bind(this));\n }\n\n /**\n * Remove event\n * @private\n */\n _removeEvent() {\n this._els.rotateButton.removeEventListener('click', this.eventHandler.rotationAngleChanged);\n this._els.rotateRange.off();\n }\n\n /**\n * Change rotate for range\n * @param {number} value - angle value\n * @param {boolean} isLast - Is last change\n * @private\n */\n _changeRotateForRange(value, isLast) {\n const angle = toInteger(value);\n this.actions.setAngle(angle, !isLast);\n this._value = angle;\n }\n\n /**\n * Change rotate for button\n * @param {object} event - add button event object\n * @private\n */\n _changeRotateForButton(event) {\n const button = event.target.closest('.tui-image-editor-button');\n const angle = this._els.rotateRange.value;\n\n if (button) {\n const rotateType = this.getButtonType(button, ['counterclockwise', 'clockwise']);\n const rotateAngle = {\n clockwise: CLOCKWISE,\n counterclockwise: COUNTERCLOCKWISE,\n }[rotateType];\n const newAngle = parseInt(angle, 10) + rotateAngle;\n const isRotatable = newAngle >= -360 && newAngle <= 360;\n if (isRotatable) {\n this.actions.rotate(rotateAngle);\n }\n }\n }\n}\n\nexport default Rotate;\n","import Colorpicker from '@/ui/tools/colorpicker';\nimport Range from '@/ui/tools/range';\nimport Submenu from '@/ui/submenuBase';\nimport templateHtml from '@/ui/template/submenu/shape';\nimport { toInteger, assignmentForDestroy } from '@/util';\nimport { defaultShapeStrokeValues } from '@/consts';\n\nconst SHAPE_DEFAULT_OPTION = {\n stroke: '#ffbb3b',\n fill: '',\n strokeWidth: 3,\n};\n\n/**\n * Shape ui class\n * @class\n * @ignore\n */\nclass Shape extends Submenu {\n constructor(subMenuElement, { locale, makeSvgIcon, menuBarPosition, usageStatistics }) {\n super(subMenuElement, {\n locale,\n name: 'shape',\n makeSvgIcon,\n menuBarPosition,\n templateHtml,\n usageStatistics,\n });\n this.type = null;\n this.options = SHAPE_DEFAULT_OPTION;\n\n this._els = {\n shapeSelectButton: this.selector('.tie-shape-button'),\n shapeColorButton: this.selector('.tie-shape-color-button'),\n strokeRange: new Range(\n {\n slider: this.selector('.tie-stroke-range'),\n input: this.selector('.tie-stroke-range-value'),\n },\n defaultShapeStrokeValues\n ),\n fillColorpicker: new Colorpicker(\n this.selector('.tie-color-fill'),\n '',\n this.toggleDirection,\n this.usageStatistics\n ),\n strokeColorpicker: new Colorpicker(\n this.selector('.tie-color-stroke'),\n '#ffbb3b',\n this.toggleDirection,\n this.usageStatistics\n ),\n };\n\n this.colorPickerControls.push(this._els.fillColorpicker);\n this.colorPickerControls.push(this._els.strokeColorpicker);\n }\n\n /**\n * Destroys the instance.\n */\n destroy() {\n this._removeEvent();\n this._els.strokeRange.destroy();\n this._els.fillColorpicker.destroy();\n this._els.strokeColorpicker.destroy();\n\n assignmentForDestroy(this);\n }\n\n /**\n * Add event for shape\n * @param {Object} actions - actions for shape\n * @param {Function} actions.changeShape - change shape mode\n * @param {Function} actions.setDrawingShape - set drawing shape\n */\n addEvent(actions) {\n this.eventHandler.shapeTypeSelected = this._changeShapeHandler.bind(this);\n this.actions = actions;\n\n this._els.shapeSelectButton.addEventListener('click', this.eventHandler.shapeTypeSelected);\n this._els.strokeRange.on('change', this._changeStrokeRangeHandler.bind(this));\n this._els.fillColorpicker.on('change', this._changeFillColorHandler.bind(this));\n this._els.strokeColorpicker.on('change', this._changeStrokeColorHandler.bind(this));\n this._els.fillColorpicker.on('changeShow', this.colorPickerChangeShow.bind(this));\n this._els.strokeColorpicker.on('changeShow', this.colorPickerChangeShow.bind(this));\n }\n\n /**\n * Remove event\n * @private\n */\n _removeEvent() {\n this._els.shapeSelectButton.removeEventListener('click', this.eventHandler.shapeTypeSelected);\n this._els.strokeRange.off();\n this._els.fillColorpicker.off();\n this._els.strokeColorpicker.off();\n }\n\n /**\n * Set Shape status\n * @param {Object} options - options of shape status\n * @param {string} strokeWidth - stroke width\n * @param {string} strokeColor - stroke color\n * @param {string} fillColor - fill color\n */\n setShapeStatus({ strokeWidth, strokeColor, fillColor }) {\n this._els.strokeRange.value = strokeWidth;\n this._els.strokeColorpicker.color = strokeColor;\n this._els.fillColorpicker.color = fillColor;\n this.options.stroke = strokeColor;\n this.options.fill = fillColor;\n this.options.strokeWidth = strokeWidth;\n\n this.actions.setDrawingShape(this.type, { strokeWidth });\n }\n\n /**\n * Executed when the menu starts.\n */\n changeStartMode() {\n this.actions.stopDrawingMode();\n }\n\n /**\n * Returns the menu to its default state.\n */\n changeStandbyMode() {\n this.type = null;\n this.actions.changeSelectableAll(true);\n this._els.shapeSelectButton.classList.remove('circle');\n this._els.shapeSelectButton.classList.remove('triangle');\n this._els.shapeSelectButton.classList.remove('rect');\n }\n\n /**\n * set range stroke max value\n * @param {number} maxValue - expect max value for change\n */\n setMaxStrokeValue(maxValue) {\n let strokeMaxValue = maxValue;\n if (strokeMaxValue <= 0) {\n strokeMaxValue = defaultShapeStrokeValues.max;\n }\n this._els.strokeRange.max = strokeMaxValue;\n }\n\n /**\n * Set stroke value\n * @param {number} value - expect value for strokeRange change\n */\n setStrokeValue(value) {\n this._els.strokeRange.value = value;\n this._els.strokeRange.trigger('change');\n }\n\n /**\n * Get stroke value\n * @returns {number} - stroke range value\n */\n getStrokeValue() {\n return this._els.strokeRange.value;\n }\n\n /**\n * Change icon color\n * @param {object} event - add button event object\n * @private\n */\n _changeShapeHandler(event) {\n const button = event.target.closest('.tui-image-editor-button');\n if (button) {\n this.actions.stopDrawingMode();\n this.actions.discardSelection();\n const shapeType = this.getButtonType(button, ['circle', 'triangle', 'rect']);\n\n if (this.type === shapeType) {\n this.changeStandbyMode();\n\n return;\n }\n this.changeStandbyMode();\n this.type = shapeType;\n event.currentTarget.classList.add(shapeType);\n this.actions.changeSelectableAll(false);\n this.actions.modeChange('shape');\n }\n }\n\n /**\n * Change stroke range\n * @param {number} value - stroke range value\n * @param {boolean} isLast - Is last change\n * @private\n */\n _changeStrokeRangeHandler(value, isLast) {\n this.options.strokeWidth = toInteger(value);\n this.actions.changeShape(\n {\n strokeWidth: value,\n },\n !isLast\n );\n\n this.actions.setDrawingShape(this.type, this.options);\n }\n\n /**\n * Change shape color\n * @param {string} color - fill color\n * @private\n */\n _changeFillColorHandler(color) {\n color = color || 'transparent';\n this.options.fill = color;\n this.actions.changeShape({\n fill: color,\n });\n }\n\n /**\n * Change shape stroke color\n * @param {string} color - fill color\n * @private\n */\n _changeStrokeColorHandler(color) {\n color = color || 'transparent';\n this.options.stroke = color;\n this.actions.changeShape({\n stroke: color,\n });\n }\n}\n\nexport default Shape;\n","/**\n * Submenu Base Class\n * @class\n * @ignore\n */\nclass Submenu {\n /**\n * @param {HTMLElement} subMenuElement - submenu dom element\n * @param {Locale} locale - translate text\n * @param {string} name - name of sub menu\n * @param {Object} iconStyle - style of icon\n * @param {string} menuBarPosition - position of menu\n * @param {*} templateHtml - template for SubMenuElement\n * @param {boolean} [usageStatistics=false] - template for SubMenuElement\n */\n constructor(\n subMenuElement,\n { locale, name, makeSvgIcon, menuBarPosition, templateHtml, usageStatistics }\n ) {\n this.subMenuElement = subMenuElement;\n this.menuBarPosition = menuBarPosition;\n this.toggleDirection = menuBarPosition === 'top' ? 'down' : 'up';\n this.colorPickerControls = [];\n this.usageStatistics = usageStatistics;\n this.eventHandler = {};\n this._makeSubMenuElement({\n locale,\n name,\n makeSvgIcon,\n templateHtml,\n });\n }\n\n /**\n * editor dom ui query selector\n * @param {string} selectName - query selector string name\n * @returns {HTMLElement}\n */\n selector(selectName) {\n return this.subMenuElement.querySelector(selectName);\n }\n\n /**\n * change show state change for colorpicker instance\n * @param {Colorpicker} occurredControl - target Colorpicker Instance\n */\n colorPickerChangeShow(occurredControl) {\n this.colorPickerControls.forEach((pickerControl) => {\n if (occurredControl !== pickerControl) {\n pickerControl.hide();\n }\n });\n }\n\n /**\n * Get button type\n * @param {HTMLElement} button - event target element\n * @param {array} buttonNames - Array of button names\n * @returns {string} - button type\n */\n getButtonType(button, buttonNames) {\n return button.className.match(RegExp(`(${buttonNames.join('|')})`))[0];\n }\n\n /**\n * Get button type\n * @param {HTMLElement} target - event target element\n * @param {string} removeClass - remove class name\n * @param {string} addClass - add class name\n */\n changeClass(target, removeClass, addClass) {\n target.classList.remove(removeClass);\n target.classList.add(addClass);\n }\n\n /**\n * Interface method whose implementation is optional.\n * Returns the menu to its default state.\n */\n changeStandbyMode() {}\n\n /**\n * Interface method whose implementation is optional.\n * Executed when the menu starts.\n */\n changeStartMode() {}\n\n /**\n * Make submenu dom element\n * @param {Locale} locale - translate text\n * @param {string} name - submenu name\n * @param {Object} iconStyle - icon style\n * @param {*} templateHtml - template for SubMenuElement\n * @private\n */\n _makeSubMenuElement({ locale, name, iconStyle, makeSvgIcon, templateHtml }) {\n const iconSubMenu = document.createElement('div');\n iconSubMenu.className = `tui-image-editor-menu-${name}`;\n iconSubMenu.innerHTML = templateHtml({\n locale,\n iconStyle,\n makeSvgIcon,\n });\n\n this.subMenuElement.appendChild(iconSubMenu);\n }\n}\n\nexport default Submenu;\n","import { getHelpMenuBarPosition } from '@/util';\n\nexport default ({ locale, biImage, loadButtonStyle, downloadButtonStyle, menuBarPosition }) => `\n
    \n
    \n
    \n \n
    \n
      \n\n
      \n
      \n ${locale.localize('Load')}\n \n
      \n \n
      \n
      \n`;\n","export default ({\n locale,\n biImage,\n commonStyle,\n headerStyle,\n loadButtonStyle,\n downloadButtonStyle,\n submenuStyle,\n}) => `\n
      \n
      \n
      \n \n
      \n
      \n
      \n ${locale.localize('Load')}\n \n
      \n \n
      \n
      \n
      \n
      \n
      \n
      \n
      \n
      \n
      \n
      \n
      \n
      \n
      \n
      \n
      \n`;\n","export default ({\n subMenuLabelActive,\n subMenuLabelNormal,\n subMenuRangeTitle,\n submenuPartitionVertical,\n submenuPartitionHorizontal,\n submenuCheckbox,\n submenuRangePointer,\n submenuRangeValue,\n submenuColorpickerTitle,\n submenuColorpickerButton,\n submenuRangeBar,\n submenuRangeSubbar,\n submenuDisabledRangePointer,\n submenuDisabledRangeBar,\n submenuDisabledRangeSubbar,\n submenuIconSize,\n menuIconSize,\n biSize,\n menuIconStyle,\n submenuIconStyle,\n}) => `\n .tie-icon-add-button.icon-bubble .tui-image-editor-button[data-icontype=\"icon-bubble\"] label,\n .tie-icon-add-button.icon-heart .tui-image-editor-button[data-icontype=\"icon-heart\"] label,\n .tie-icon-add-button.icon-location .tui-image-editor-button[data-icontype=\"icon-location\"] label,\n .tie-icon-add-button.icon-polygon .tui-image-editor-button[data-icontype=\"icon-polygon\"] label,\n .tie-icon-add-button.icon-star .tui-image-editor-button[data-icontype=\"icon-star\"] label,\n .tie-icon-add-button.icon-star-2 .tui-image-editor-button[data-icontype=\"icon-star-2\"] label,\n .tie-icon-add-button.icon-arrow-3 .tui-image-editor-button[data-icontype=\"icon-arrow-3\"] label,\n .tie-icon-add-button.icon-arrow-2 .tui-image-editor-button[data-icontype=\"icon-arrow-2\"] label,\n .tie-icon-add-button.icon-arrow .tui-image-editor-button[data-icontype=\"icon-arrow\"] label,\n .tie-icon-add-button.icon-bubble .tui-image-editor-button[data-icontype=\"icon-bubble\"] label,\n .tie-draw-line-select-button.line .tui-image-editor-button.line label,\n .tie-draw-line-select-button.free .tui-image-editor-button.free label,\n .tie-flip-button.flipX .tui-image-editor-button.flipX label,\n .tie-flip-button.flipY .tui-image-editor-button.flipY label,\n .tie-flip-button.resetFlip .tui-image-editor-button.resetFlip label,\n .tie-crop-button .tui-image-editor-button.apply.active label,\n .tie-crop-preset-button .tui-image-editor-button.preset.active label,\n .tie-shape-button.rect .tui-image-editor-button.rect label,\n .tie-shape-button.circle .tui-image-editor-button.circle label,\n .tie-shape-button.triangle .tui-image-editor-button.triangle label,\n .tie-text-effect-button .tui-image-editor-button.active label,\n .tie-text-align-button.left .tui-image-editor-button.left label,\n .tie-text-align-button.center .tui-image-editor-button.center label,\n .tie-text-align-button.right .tui-image-editor-button.right label,\n .tie-mask-apply.apply.active .tui-image-editor-button.apply label,\n .tui-image-editor-container .tui-image-editor-submenu .tui-image-editor-button:hover > label,\n .tui-image-editor-container .tui-image-editor-checkbox label > span {\n ${subMenuLabelActive}\n }\n .tui-image-editor-container .tui-image-editor-submenu .tui-image-editor-button > label,\n .tui-image-editor-container .tui-image-editor-range-wrap.tui-image-editor-newline.short label,\n .tui-image-editor-container .tui-image-editor-range-wrap.tui-image-editor-newline.short label > span {\n ${subMenuLabelNormal}\n }\n .tui-image-editor-container .tui-image-editor-range-wrap label > span {\n ${subMenuRangeTitle}\n }\n .tui-image-editor-container .tui-image-editor-partition > div {\n ${submenuPartitionVertical}\n }\n .tui-image-editor-container.left .tui-image-editor-submenu .tui-image-editor-partition > div,\n .tui-image-editor-container.right .tui-image-editor-submenu .tui-image-editor-partition > div {\n ${submenuPartitionHorizontal}\n }\n .tui-image-editor-container .tui-image-editor-checkbox label > span:before {\n ${submenuCheckbox}\n }\n .tui-image-editor-container .tui-image-editor-checkbox label > input:checked + span:before {\n border: 0;\n }\n .tui-image-editor-container .tui-image-editor-virtual-range-pointer {\n ${submenuRangePointer}\n }\n .tui-image-editor-container .tui-image-editor-virtual-range-bar {\n ${submenuRangeBar}\n }\n .tui-image-editor-container .tui-image-editor-virtual-range-subbar {\n ${submenuRangeSubbar}\n }\n .tui-image-editor-container .tui-image-editor-disabled .tui-image-editor-virtual-range-pointer {\n ${submenuDisabledRangePointer}\n }\n .tui-image-editor-container .tui-image-editor-disabled .tui-image-editor-virtual-range-subbar {\n ${submenuDisabledRangeSubbar}\n }\n .tui-image-editor-container .tui-image-editor-disabled .tui-image-editor-virtual-range-bar {\n ${submenuDisabledRangeBar}\n }\n .tui-image-editor-container .tui-image-editor-range-value {\n ${submenuRangeValue}\n }\n .tui-image-editor-container .tui-image-editor-submenu .tui-image-editor-button .color-picker-value + label {\n ${submenuColorpickerTitle}\n }\n .tui-image-editor-container .tui-image-editor-submenu .tui-image-editor-button .color-picker-value {\n ${submenuColorpickerButton}\n }\n .tui-image-editor-container .svg_ic-menu {\n ${menuIconSize}\n }\n .tui-image-editor-container .svg_ic-submenu {\n ${submenuIconSize}\n }\n .tui-image-editor-container .tui-image-editor-controls-logo > img,\n .tui-image-editor-container .tui-image-editor-header-logo > img {\n ${biSize}\n }\n .tui-image-editor-menu use.normal.use-default,\n .tui-image-editor-help-menu use.normal.use-default {\n fill-rule: evenodd;\n fill: ${menuIconStyle.normal.color};\n stroke: ${menuIconStyle.normal.color};\n }\n .tui-image-editor-menu use.active.use-default,\n .tui-image-editor-help-menu use.active.use-default {\n fill-rule: evenodd;\n fill: ${menuIconStyle.active.color};\n stroke: ${menuIconStyle.active.color};\n }\n .tui-image-editor-menu use.hover.use-default,\n .tui-image-editor-help-menu use.hover.use-default {\n fill-rule: evenodd;\n fill: ${menuIconStyle.hover.color};\n stroke: ${menuIconStyle.hover.color};\n }\n .tui-image-editor-menu use.disabled.use-default,\n .tui-image-editor-help-menu use.disabled.use-default {\n fill-rule: evenodd;\n fill: ${menuIconStyle.disabled.color};\n stroke: ${menuIconStyle.disabled.color};\n }\n .tui-image-editor-submenu use.normal.use-default {\n fill-rule: evenodd;\n fill: ${submenuIconStyle.normal.color};\n stroke: ${submenuIconStyle.normal.color};\n }\n .tui-image-editor-submenu use.active.use-default {\n fill-rule: evenodd;\n fill: ${submenuIconStyle.active.color};\n stroke: ${submenuIconStyle.active.color};\n }\n`;\n","/**\n * @param {Object} submenuInfo - submenu info for make template\n * @param {Locale} locale - Translate text\n * @param {Function} makeSvgIcon - svg icon generator\n * @returns {string}\n */\nexport default ({ locale, makeSvgIcon }) => `\n
        \n
      • \n
        \n
        \n ${makeSvgIcon(['normal', 'active'], 'shape-rectangle', true)}\n
        \n \n
        \n
        \n
        \n ${makeSvgIcon(['normal', 'active'], 'crop', true)}\n
        \n \n
        \n
        \n
        \n ${makeSvgIcon(['normal', 'active'], 'crop', true)}\n
        \n \n
        \n
        \n
        \n ${makeSvgIcon(['normal', 'active'], 'crop', true)}\n
        \n \n
        \n
        \n
        \n ${makeSvgIcon(['normal', 'active'], 'crop', true)}\n
        \n \n
        \n
        \n
        \n ${makeSvgIcon(['normal', 'active'], 'crop', true)}\n
        \n \n
        \n
        \n
        \n ${makeSvgIcon(['normal', 'active'], 'crop', true)}\n
        \n \n
        \n
      • \n
      • \n
      • \n
      • \n
        \n
      • \n
      • \n
        \n ${makeSvgIcon(['normal', 'active'], 'apply')}\n \n
        \n
        \n ${makeSvgIcon(['normal', 'active'], 'cancel')}\n \n
        \n
      • \n
      \n`;\n","/**\n * @param {Object} submenuInfo - submenu info for make template\n * @param {Locale} locale - Translate text\n * @param {Function} makeSvgIcon - svg icon generator\n * @returns {string}\n */\nexport default ({ locale, makeSvgIcon }) => `\n
        \n
      • \n
        \n
        \n ${makeSvgIcon(['normal', 'active'], 'draw-free', true)}\n
        \n \n
        \n
        \n
        \n ${makeSvgIcon(['normal', 'active'], 'draw-line', true)}\n
        \n \n
        \n
      • \n
      • \n
        \n
      • \n
      • \n
        \n
      • \n
      • \n
        \n
      • \n
      • \n \n
        \n \n
      • \n
      \n`;\n","/**\n * @param {Locale} locale - Translate text\n * @returns {string}\n */\nexport default ({ locale }) => `\n
        \n
      • \n
        \n
        \n \n
        \n
        \n \n
        \n
        \n \n
        \n
        \n \n
        \n
        \n \n
        \n
        \n \n
        \n
        \n \n
        \n
        \n
      • \n
      • \n
        \n
      • \n
      • \n
        \n
        \n
        \n \n
        \n
        \n
        \n \n
        \n
        \n
        \n
        \n
        \n \n
        \n
        \n
        \n
        \n
        \n
        \n
        \n \n
        \n
        \n
        \n
        \n
        \n
      • \n
      • \n
        \n
      • \n
      • \n
        \n
        \n \n
        \n
        \n
        \n
        \n
        \n
        \n
        \n
        \n \n
        \n
        \n
        \n \n
        \n
        \n
        \n
      • \n
      • \n
        \n
      • \n
      • \n
        \n
        \n
        \n \n
        \n
        \n
        \n
        \n
        \n \n
        \n
        \n
        \n
        \n
        \n \n
        \n
        \n
      • \n
      \n`;\n","/**\n * @param {Object} submenuInfo - submenu info for make template\n * @param {Locale} locale - Translate text\n * @param {Function} makeSvgIcon - svg icon generator\n * @returns {string}\n */\nexport default ({ locale, makeSvgIcon }) => `\n
        \n
      • \n
        \n
        \n ${makeSvgIcon(['normal', 'active'], 'flip-x', true)}\n
        \n \n
        \n
        \n
        \n ${makeSvgIcon(['normal', 'active'], 'flip-y', true)}\n
        \n \n
        \n
      • \n
      • \n
        \n
      • \n
      • \n
        \n
        \n ${makeSvgIcon(['normal', 'active'], 'flip-reset', true)}\n
        \n \n
        \n
      • \n
      \n`;\n","/**\n * @param {Object} submenuInfo - submenu info for make template\n * @param {Locale} locale - Translate text\n * @param {Function} makeSvgIcon - svg icon generator\n * @param {string} name - history name\n * @param {string} detail - history detail information\n * @returns {string}\n */\nexport default ({ locale, makeSvgIcon, name, detail }) => `\n
      \n
      \n ${makeSvgIcon(['normal', 'active'], `history-${name.toLowerCase()}`, true)}\n
      \n \n ${locale.localize(name)}\n ${detail ? `(${locale.localize(detail)})` : ''}\n \n
      \n ${makeSvgIcon(['normal'], 'history-check', true)}\n
      \n
      \n`;\n","/**\n * @param {Object} submenuInfo - submenu info for make template\n * @param {Locale} locale - Translate text\n * @param {Function} makeSvgIcon - svg icon generator\n * @returns {string}\n */\nexport default ({ locale, makeSvgIcon }) => `\n
        \n
      • \n
        \n
        \n ${makeSvgIcon(['normal', 'active'], 'icon-arrow', true)}\n
        \n \n
        \n
        \n
        \n ${makeSvgIcon(['normal', 'active'], 'icon-arrow-2', true)}\n
        \n \n
        \n
        \n
        \n ${makeSvgIcon(['normal', 'active'], 'icon-arrow-3', true)}\n
        \n \n
        \n
        \n
        \n ${makeSvgIcon(['normal', 'active'], 'icon-star', true)}\n
        \n \n
        \n
        \n
        \n ${makeSvgIcon(['normal', 'active'], 'icon-star-2', true)}\n
        \n \n
        \n\n
        \n
        \n ${makeSvgIcon(['normal', 'active'], 'icon-polygon', true)}\n
        \n \n
        \n\n
        \n
        \n ${makeSvgIcon(['normal', 'active'], 'icon-location', true)}\n
        \n \n
        \n\n
        \n
        \n ${makeSvgIcon(['normal', 'active'], 'icon-heart', true)}\n
        \n \n
        \n\n
        \n
        \n ${makeSvgIcon(['normal', 'active'], 'icon-bubble', true)}\n
        \n \n
        \n
      • \n
      • \n
        \n
      • \n
      • \n
        \n
        \n \n ${makeSvgIcon(['normal', 'active'], 'icon-load', true)}\n
        \n \n
        \n
      • \n
      • \n
        \n
      • \n
      • \n
        \n
      • \n
      \n`;\n","/**\n * @param {Object} submenuInfo - submenu info for make template\n * @param {Locale} locale - Translate text\n * @param {Function} makeSvgIcon - svg icon generator\n * @returns {string}\n */\nexport default ({ locale, makeSvgIcon }) => `\n
        \n
      • \n
        \n
        \n \n ${makeSvgIcon(['normal', 'active'], 'mask-load', true)}\n
        \n \n
        \n
      • \n
      • \n
        \n
      • \n
      • \n
        \n ${makeSvgIcon(['normal', 'active'], 'apply')}\n \n
        \n
      • \n
      \n`;\n","/**\n * @param {Object} submenuInfo - submenu info for make template\n * @param {Locale} locale - Translate text\n * @param {Function} makeSvgIcon - svg icon generator\n * @returns {string}\n */\nexport default ({ locale, makeSvgIcon }) => `\n
        \n
      • \n
        \n
        \n ${makeSvgIcon(['normal', 'active'], 'rotate-clockwise', true)}\n
        \n \n
        \n
        \n
        \n ${makeSvgIcon(['normal', 'active'], 'rotate-counterclockwise', true)}\n
        \n \n
        \n
      • \n
      • \n
        \n
      • \n
      • \n \n
        \n \n
      • \n
      \n`;\n","/**\n * @param {Object} submenuInfo - submenu info for make template\n * @param {Locale} locale - Translate text\n * @param {Function} makeSvgIcon - svg icon generator\n * @returns {string}\n */\nexport default ({ locale, makeSvgIcon }) => `\n
        \n
      • \n
        \n
        \n ${makeSvgIcon(['normal', 'active'], 'shape-rectangle', true)}\n
        \n \n
        \n
        \n
        \n ${makeSvgIcon(['normal', 'active'], 'shape-circle', true)}\n
        \n \n
        \n
        \n
        \n ${makeSvgIcon(['normal', 'active'], 'shape-triangle', true)}\n
        \n \n
        \n
      • \n
      • \n
        \n
      • \n
      • \n
        \n
        \n
      • \n
      • \n
        \n
      • \n
      • \n \n
        \n \n
      • \n
      \n`;\n","/**\n * @param {Object} submenuInfo - submenu info for make template\n * @param {Locale} locale - Translate text\n * @param {Function} makeSvgIcon - svg icon generator\n * @returns {string}\n */\nexport default ({ locale, makeSvgIcon }) => `\n
        \n
      • \n
        \n
        \n ${makeSvgIcon(['normal', 'active'], 'text-bold', true)}\n
        \n \n
        \n
        \n
        \n ${makeSvgIcon(['normal', 'active'], 'text-italic', true)}\n
        \n \n
        \n
        \n
        \n ${makeSvgIcon(['normal', 'active'], 'text-underline', true)}\n
        \n \n
        \n
      • \n
      • \n
        \n
      • \n
      • \n
        \n
        \n ${makeSvgIcon(['normal', 'active'], 'text-align-left', true)}\n
        \n \n
        \n
        \n
        \n ${makeSvgIcon(['normal', 'active'], 'text-align-center', true)}\n
        \n \n
        \n
        \n
        \n ${makeSvgIcon(['normal', 'active'], 'text-align-right', true)}\n
        \n \n
        \n
      • \n
      • \n
        \n
      • \n
      • \n
        \n
      • \n
      • \n
        \n
      • \n
      • \n \n
        \n \n
      • \n
      \n`;\n","import Range from '@/ui/tools/range';\nimport Colorpicker from '@/ui/tools/colorpicker';\nimport Submenu from '@/ui/submenuBase';\nimport templateHtml from '@/ui/template/submenu/text';\nimport { assignmentForDestroy } from '@/util';\nimport { defaultTextRangeValues } from '@/consts';\n\n/**\n * Crop ui class\n * @class\n * @ignore\n */\nexport default class Text extends Submenu {\n constructor(subMenuElement, { locale, makeSvgIcon, menuBarPosition, usageStatistics }) {\n super(subMenuElement, {\n locale,\n name: 'text',\n makeSvgIcon,\n menuBarPosition,\n templateHtml,\n usageStatistics,\n });\n this.effect = {\n bold: false,\n italic: false,\n underline: false,\n };\n this.align = 'left';\n this._els = {\n textEffectButton: this.selector('.tie-text-effect-button'),\n textAlignButton: this.selector('.tie-text-align-button'),\n textColorpicker: new Colorpicker(\n this.selector('.tie-text-color'),\n '#ffbb3b',\n this.toggleDirection,\n this.usageStatistics\n ),\n textRange: new Range(\n {\n slider: this.selector('.tie-text-range'),\n input: this.selector('.tie-text-range-value'),\n },\n defaultTextRangeValues\n ),\n };\n }\n\n /**\n * Destroys the instance.\n */\n destroy() {\n this._removeEvent();\n this._els.textColorpicker.destroy();\n this._els.textRange.destroy();\n\n assignmentForDestroy(this);\n }\n\n /**\n * Add event for text\n * @param {Object} actions - actions for text\n * @param {Function} actions.changeTextStyle - change text style\n */\n addEvent(actions) {\n const setTextEffect = this._setTextEffectHandler.bind(this);\n const setTextAlign = this._setTextAlignHandler.bind(this);\n\n this.eventHandler = {\n setTextEffect,\n setTextAlign,\n };\n\n this.actions = actions;\n this._els.textEffectButton.addEventListener('click', setTextEffect);\n this._els.textAlignButton.addEventListener('click', setTextAlign);\n this._els.textRange.on('change', this._changeTextRnageHandler.bind(this));\n this._els.textColorpicker.on('change', this._changeColorHandler.bind(this));\n }\n\n /**\n * Remove event\n * @private\n */\n _removeEvent() {\n const { setTextEffect, setTextAlign } = this.eventHandler;\n\n this._els.textEffectButton.removeEventListener('click', setTextEffect);\n this._els.textAlignButton.removeEventListener('click', setTextAlign);\n this._els.textRange.off();\n this._els.textColorpicker.off();\n }\n\n /**\n * Returns the menu to its default state.\n */\n changeStandbyMode() {\n this.actions.stopDrawingMode();\n }\n\n /**\n * Executed when the menu starts.\n */\n changeStartMode() {\n this.actions.modeChange('text');\n }\n\n set textColor(color) {\n this._els.textColorpicker.color = color;\n }\n\n /**\n * Get text color\n * @returns {string} - text color\n */\n get textColor() {\n return this._els.textColorpicker.color;\n }\n\n /**\n * Get text size\n * @returns {string} - text size\n */\n get fontSize() {\n return this._els.textRange.value;\n }\n\n /**\n * Set text size\n * @param {Number} value - text size\n */\n set fontSize(value) {\n this._els.textRange.value = value;\n }\n\n /**\n * get font style\n * @returns {string} - font style\n */\n get fontStyle() {\n return this.effect.italic ? 'italic' : 'normal';\n }\n\n /**\n * get font weight\n * @returns {string} - font weight\n */\n get fontWeight() {\n return this.effect.bold ? 'bold' : 'normal';\n }\n\n /**\n * get text underline text underline\n * @returns {boolean} - true or false\n */\n get underline() {\n return this.effect.underline;\n }\n\n setTextStyleStateOnAction(textStyle = {}) {\n const { fill, fontSize, fontStyle, fontWeight, textDecoration, textAlign } = textStyle;\n\n this.textColor = fill;\n this.fontSize = fontSize;\n this.setEffectState('italic', fontStyle);\n this.setEffectState('bold', fontWeight);\n this.setEffectState('underline', textDecoration);\n this.setAlignState(textAlign);\n }\n\n setEffectState(effectName, value) {\n const effectValue = value === 'italic' || value === 'bold' || value === 'underline';\n const button = this._els.textEffectButton.querySelector(\n `.tui-image-editor-button.${effectName}`\n );\n\n this.effect[effectName] = effectValue;\n\n button.classList[effectValue ? 'add' : 'remove']('active');\n }\n\n setAlignState(value) {\n const button = this._els.textAlignButton;\n button.classList.remove(this.align);\n button.classList.add(value);\n this.align = value;\n }\n\n /**\n * text effect set handler\n * @param {object} event - add button event object\n * @private\n */\n _setTextEffectHandler(event) {\n const button = event.target.closest('.tui-image-editor-button');\n if (button) {\n const [styleType] = button.className.match(/(bold|italic|underline)/);\n const styleObj = {\n bold: { fontWeight: 'bold' },\n italic: { fontStyle: 'italic' },\n underline: { textDecoration: 'underline' },\n }[styleType];\n\n this.effect[styleType] = !this.effect[styleType];\n button.classList.toggle('active');\n this.actions.changeTextStyle(styleObj);\n }\n }\n\n /**\n * text effect set handler\n * @param {object} event - add button event object\n * @private\n */\n _setTextAlignHandler(event) {\n const button = event.target.closest('.tui-image-editor-button');\n if (button) {\n const styleType = this.getButtonType(button, ['left', 'center', 'right']);\n\n event.currentTarget.classList.remove(this.align);\n if (this.align !== styleType) {\n event.currentTarget.classList.add(styleType);\n }\n this.actions.changeTextStyle({ textAlign: styleType });\n\n this.align = styleType;\n }\n }\n\n /**\n * text align set handler\n * @param {number} value - range value\n * @param {boolean} isLast - Is last change\n * @private\n */\n _changeTextRnageHandler(value, isLast) {\n this.actions.changeTextStyle(\n {\n fontSize: value,\n },\n !isLast\n );\n }\n\n /**\n * change color handler\n * @param {string} color - change color string\n * @private\n */\n _changeColorHandler(color) {\n color = color || 'transparent';\n this.actions.changeTextStyle({\n fill: color,\n });\n }\n}\n","/**\n * @author NHN. FE Development Team \n * @fileoverview The standard theme\n */\n\n/**\n * Full configuration for theme.
      \n * @typedef {object} themeConfig\n * @property {string} common.bi.image - Brand icon image\n * @property {string} common.bisize.width - Icon image width\n * @property {string} common.bisize.height - Icon Image Height\n * @property {string} common.backgroundImage - Background image\n * @property {string} common.backgroundColor - Background color\n * @property {string} common.border - Full area border style\n * @property {string} header.backgroundImage - header area background\n * @property {string} header.backgroundColor - header area background color\n * @property {string} header.border - header area border style\n * @property {string} loadButton.backgroundColor - load button background color\n * @property {string} loadButton.border - load button border style\n * @property {string} loadButton.color - load button foreground color\n * @property {string} loadButton.fontFamily - load button font type\n * @property {string} loadButton.fontSize - load button font size\n * @property {string} downloadButton.backgroundColor - download button background color\n * @property {string} downloadButton.border - download button border style\n * @property {string} downloadButton.color - download button foreground color\n * @property {string} downloadButton.fontFamily - download button font type\n * @property {string} downloadButton.fontSize - download button font size\n * @property {string} menu.normalIcon.color - Menu normal color for default icon\n * @property {string} menu.normalIcon.path - Menu normal icon svg bundle file path\n * @property {string} menu.normalIcon.name - Menu normal icon svg bundle name\n * @property {string} menu.activeIcon.color - Menu active color for default icon\n * @property {string} menu.activeIcon.path - Menu active icon svg bundle file path\n * @property {string} menu.activeIcon.name - Menu active icon svg bundle name\n * @property {string} menu.disabled.color - Menu disabled color for default icon\n * @property {string} menu.disabled.path - Menu disabled icon svg bundle file path\n * @property {string} menu.disabled.name - Menu disabled icon svg bundle name\n * @property {string} menu.hover.color - Menu default icon hover color\n * @property {string} menu.hover.path - Menu hover icon svg bundle file path\n * @property {string} menu.hover.name - Menu hover icon svg bundle name\n * @property {string} menu.iconSize.width - Menu icon Size Width\n * @property {string} menu.iconSize.height - Menu Icon Size Height\n * @property {string} submenu.backgroundColor - Sub-menu area background color\n * @property {string} submenu.partition.color - Submenu partition line color\n * @property {string} submenu.normalIcon.color - Submenu normal color for default icon\n * @property {string} submenu.normalIcon.path - Submenu default icon svg bundle file path\n * @property {string} submenu.normalIcon.name - Submenu default icon svg bundle name\n * @property {string} submenu.activeIcon.color - Submenu active color for default icon\n * @property {string} submenu.activeIcon.path - Submenu active icon svg bundle file path\n * @property {string} submenu.activeIcon.name - Submenu active icon svg bundle name\n * @property {string} submenu.iconSize.width - Submenu icon Size Width\n * @property {string} submenu.iconSize.height - Submenu Icon Size Height\n * @property {string} submenu.normalLabel.color - Submenu default label color\n * @property {string} submenu.normalLabel.fontWeight - Sub Menu Default Label Font Thickness\n * @property {string} submenu.activeLabel.color - Submenu active label color\n * @property {string} submenu.activeLabel.fontWeight - Submenu active label Font thickness\n * @property {string} checkbox.border - Checkbox border style\n * @property {string} checkbox.backgroundColor - Checkbox background color\n * @property {string} range.pointer.color - range control pointer color\n * @property {string} range.bar.color - range control bar color\n * @property {string} range.subbar.color - range control subbar color\n * @property {string} range.value.color - range number box font color\n * @property {string} range.value.fontWeight - range number box font thickness\n * @property {string} range.value.fontSize - range number box font size\n * @property {string} range.value.border - range number box border style\n * @property {string} range.value.backgroundColor - range number box background color\n * @property {string} range.title.color - range title font color\n * @property {string} range.title.fontWeight - range title font weight\n * @property {string} colorpicker.button.border - colorpicker button border style\n * @property {string} colorpicker.title.color - colorpicker button title font color\n * @example\n // default keys and styles\n var customTheme = {\n 'common.bi.image': 'https://uicdn.toast.com/toastui/img/tui-image-editor-bi.png',\n 'common.bisize.width': '251px',\n 'common.bisize.height': '21px',\n 'common.backgroundImage': 'none',\n 'common.backgroundColor': '#1e1e1e',\n 'common.border': '0px',\n\n // header\n 'header.backgroundImage': 'none',\n 'header.backgroundColor': 'transparent',\n 'header.border': '0px',\n\n // load button\n 'loadButton.backgroundColor': '#fff',\n 'loadButton.border': '1px solid #ddd',\n 'loadButton.color': '#222',\n 'loadButton.fontFamily': 'NotoSans, sans-serif',\n 'loadButton.fontSize': '12px',\n\n // download button\n 'downloadButton.backgroundColor': '#fdba3b',\n 'downloadButton.border': '1px solid #fdba3b',\n 'downloadButton.color': '#fff',\n 'downloadButton.fontFamily': 'NotoSans, sans-serif',\n 'downloadButton.fontSize': '12px',\n\n // icons default\n 'menu.normalIcon.color': '#8a8a8a',\n 'menu.activeIcon.color': '#555555',\n 'menu.disabledIcon.color': '#434343',\n 'menu.hoverIcon.color': '#e9e9e9',\n 'submenu.normalIcon.color': '#8a8a8a',\n 'submenu.activeIcon.color': '#e9e9e9',\n\n 'menu.iconSize.width': '24px',\n 'menu.iconSize.height': '24px',\n 'submenu.iconSize.width': '32px',\n 'submenu.iconSize.height': '32px',\n\n // submenu primary color\n 'submenu.backgroundColor': '#1e1e1e',\n 'submenu.partition.color': '#858585',\n\n // submenu labels\n 'submenu.normalLabel.color': '#858585',\n 'submenu.normalLabel.fontWeight': 'lighter',\n 'submenu.activeLabel.color': '#fff',\n 'submenu.activeLabel.fontWeight': 'lighter',\n\n // checkbox style\n 'checkbox.border': '1px solid #ccc',\n 'checkbox.backgroundColor': '#fff',\n\n // rango style\n 'range.pointer.color': '#fff',\n 'range.bar.color': '#666',\n 'range.subbar.color': '#d1d1d1',\n\n 'range.disabledPointer.color': '#414141',\n 'range.disabledBar.color': '#282828',\n 'range.disabledSubbar.color': '#414141',\n\n 'range.value.color': '#fff',\n 'range.value.fontWeight': 'lighter',\n 'range.value.fontSize': '11px',\n 'range.value.border': '1px solid #353535',\n 'range.value.backgroundColor': '#151515',\n 'range.title.color': '#fff',\n 'range.title.fontWeight': 'lighter',\n\n // colorpicker style\n 'colorpicker.button.border': '1px solid #1e1e1e',\n 'colorpicker.title.color': '#fff'\n};\n */\nexport default {\n 'common.bi.image': 'https://uicdn.toast.com/toastui/img/tui-image-editor-bi.png',\n 'common.bisize.width': '251px',\n 'common.bisize.height': '21px',\n 'common.backgroundImage': 'none',\n 'common.backgroundColor': '#1e1e1e',\n 'common.border': '0px',\n\n // header\n 'header.backgroundImage': 'none',\n 'header.backgroundColor': 'transparent',\n 'header.border': '0px',\n\n // load button\n 'loadButton.backgroundColor': '#fff',\n 'loadButton.border': '1px solid #ddd',\n 'loadButton.color': '#222',\n 'loadButton.fontFamily': \"'Noto Sans', sans-serif\",\n 'loadButton.fontSize': '12px',\n\n // download button\n 'downloadButton.backgroundColor': '#fdba3b',\n 'downloadButton.border': '1px solid #fdba3b',\n 'downloadButton.color': '#fff',\n 'downloadButton.fontFamily': \"'Noto Sans', sans-serif\",\n 'downloadButton.fontSize': '12px',\n\n // main icons\n 'menu.normalIcon.color': '#8a8a8a',\n 'menu.activeIcon.color': '#555555',\n 'menu.disabledIcon.color': '#434343',\n 'menu.hoverIcon.color': '#e9e9e9',\n\n // submenu icons\n 'submenu.normalIcon.color': '#8a8a8a',\n 'submenu.activeIcon.color': '#e9e9e9',\n\n 'menu.iconSize.width': '24px',\n 'menu.iconSize.height': '24px',\n\n 'submenu.iconSize.width': '32px',\n 'submenu.iconSize.height': '32px',\n\n // submenu primary color\n 'submenu.backgroundColor': '#1e1e1e',\n 'submenu.partition.color': '#3c3c3c',\n\n // submenu labels\n 'submenu.normalLabel.color': '#8a8a8a',\n 'submenu.normalLabel.fontWeight': 'lighter',\n 'submenu.activeLabel.color': '#fff',\n 'submenu.activeLabel.fontWeight': 'lighter',\n\n // checkbox style\n 'checkbox.border': '0px',\n 'checkbox.backgroundColor': '#fff',\n\n // range style\n 'range.pointer.color': '#fff',\n 'range.bar.color': '#666',\n 'range.subbar.color': '#d1d1d1',\n\n 'range.disabledPointer.color': '#414141',\n 'range.disabledBar.color': '#282828',\n 'range.disabledSubbar.color': '#414141',\n\n 'range.value.color': '#fff',\n 'range.value.fontWeight': 'lighter',\n 'range.value.fontSize': '11px',\n 'range.value.border': '1px solid #353535',\n 'range.value.backgroundColor': '#151515',\n 'range.title.color': '#fff',\n 'range.title.fontWeight': 'lighter',\n\n // colorpicker style\n 'colorpicker.button.border': '1px solid #1e1e1e',\n 'colorpicker.title.color': '#fff',\n};\n","import { extend, forEach, map } from 'tui-code-snippet';\nimport style from '@/ui/template/style';\nimport standardTheme from '@/ui/theme/standard';\nimport icon from '@svg/default.svg';\nimport { styleLoad } from '@/util';\n\n/**\n * Theme manager\n * @class\n * @param {Object} customTheme - custom theme\n * @ignore\n */\nclass Theme {\n constructor(customTheme) {\n this.styles = this._changeToObject(extend({}, standardTheme, customTheme));\n styleLoad(this._styleMaker());\n\n this._loadDefaultSvgIcon();\n }\n\n /**\n * Get a Style cssText or StyleObject\n * @param {string} type - style type\n * @returns {string|object} - cssText or StyleObject\n */\n // eslint-disable-next-line complexity\n getStyle(type) {\n let result = null;\n const firstProperty = type.replace(/\\..+$/, '');\n const option = this.styles[type];\n switch (type) {\n case 'common.bi':\n result = this.styles[type].image;\n break;\n case 'menu.icon':\n result = {\n active: this.styles[`${firstProperty}.activeIcon`],\n normal: this.styles[`${firstProperty}.normalIcon`],\n hover: this.styles[`${firstProperty}.hoverIcon`],\n disabled: this.styles[`${firstProperty}.disabledIcon`],\n };\n break;\n case 'submenu.icon':\n result = {\n active: this.styles[`${firstProperty}.activeIcon`],\n normal: this.styles[`${firstProperty}.normalIcon`],\n };\n break;\n case 'submenu.label':\n result = {\n active: this._makeCssText(this.styles[`${firstProperty}.activeLabel`]),\n normal: this._makeCssText(this.styles[`${firstProperty}.normalLabel`]),\n };\n break;\n case 'submenu.partition':\n result = {\n vertical: this._makeCssText(\n extend({}, option, { borderLeft: `1px solid ${option.color}` })\n ),\n horizontal: this._makeCssText(\n extend({}, option, { borderBottom: `1px solid ${option.color}` })\n ),\n };\n break;\n\n case 'range.disabledPointer':\n case 'range.disabledBar':\n case 'range.disabledSubbar':\n case 'range.pointer':\n case 'range.bar':\n case 'range.subbar':\n option.backgroundColor = option.color;\n result = this._makeCssText(option);\n break;\n default:\n result = this._makeCssText(option);\n break;\n }\n\n return result;\n }\n\n /**\n * Make css resource\n * @returns {string} - serialized css text\n * @private\n */\n _styleMaker() {\n const submenuLabelStyle = this.getStyle('submenu.label');\n const submenuPartitionStyle = this.getStyle('submenu.partition');\n\n return style({\n subMenuLabelActive: submenuLabelStyle.active,\n subMenuLabelNormal: submenuLabelStyle.normal,\n submenuPartitionVertical: submenuPartitionStyle.vertical,\n submenuPartitionHorizontal: submenuPartitionStyle.horizontal,\n biSize: this.getStyle('common.bisize'),\n subMenuRangeTitle: this.getStyle('range.title'),\n submenuRangePointer: this.getStyle('range.pointer'),\n submenuRangeBar: this.getStyle('range.bar'),\n submenuRangeSubbar: this.getStyle('range.subbar'),\n\n submenuDisabledRangePointer: this.getStyle('range.disabledPointer'),\n submenuDisabledRangeBar: this.getStyle('range.disabledBar'),\n submenuDisabledRangeSubbar: this.getStyle('range.disabledSubbar'),\n\n submenuRangeValue: this.getStyle('range.value'),\n submenuColorpickerTitle: this.getStyle('colorpicker.title'),\n submenuColorpickerButton: this.getStyle('colorpicker.button'),\n submenuCheckbox: this.getStyle('checkbox'),\n menuIconSize: this.getStyle('menu.iconSize'),\n submenuIconSize: this.getStyle('submenu.iconSize'),\n menuIconStyle: this.getStyle('menu.icon'),\n submenuIconStyle: this.getStyle('submenu.icon'),\n });\n }\n\n /**\n * Change to low dimensional object.\n * @param {object} styleOptions - style object of user interface\n * @returns {object} low level object for style apply\n * @private\n */\n _changeToObject(styleOptions) {\n const styleObject = {};\n forEach(styleOptions, (value, key) => {\n const keyExplode = key.match(/^(.+)\\.([a-z]+)$/i);\n const [, property, subProperty] = keyExplode;\n\n if (!styleObject[property]) {\n styleObject[property] = {};\n }\n styleObject[property][subProperty] = value;\n });\n\n return styleObject;\n }\n\n /**\n * Style object to Csstext serialize\n * @param {object} styleObject - style object\n * @returns {string} - css text string\n * @private\n */\n _makeCssText(styleObject) {\n const converterStack = [];\n\n forEach(styleObject, (value, key) => {\n if (['backgroundImage'].indexOf(key) > -1 && value !== 'none') {\n value = `url(${value})`;\n }\n\n converterStack.push(`${this._toUnderScore(key)}: ${value}`);\n });\n\n return converterStack.join(';');\n }\n\n /**\n * Camel key string to Underscore string\n * @param {string} targetString - change target\n * @returns {string}\n * @private\n */\n _toUnderScore(targetString) {\n return targetString.replace(/([A-Z])/g, ($0, $1) => `-${$1.toLowerCase()}`);\n }\n\n /**\n * Load default svg icon\n * @private\n */\n _loadDefaultSvgIcon() {\n if (!document.getElementById('tui-image-editor-svg-default-icons')) {\n const parser = new DOMParser();\n const dom = parser.parseFromString(icon, 'text/xml');\n\n document.body.appendChild(dom.documentElement);\n }\n }\n\n /**\n * Make className for svg icon\n * @param {string} iconType - normal' or 'active' or 'hover' or 'disabled\n * @param {boolean} isSubmenu - submenu icon or not.\n * @returns {string}\n * @private\n */\n _makeIconClassName(iconType, isSubmenu) {\n const iconStyleInfo = isSubmenu ? this.getStyle('submenu.icon') : this.getStyle('menu.icon');\n const { path, name } = iconStyleInfo[iconType];\n\n return path && name ? iconType : `${iconType} use-default`;\n }\n\n /**\n * Make svg use link path name\n * @param {string} iconType - normal' or 'active' or 'hover' or 'disabled\n * @param {boolean} isSubmenu - submenu icon or not.\n * @returns {string}\n * @private\n */\n _makeSvgIconPrefix(iconType, isSubmenu) {\n const iconStyleInfo = isSubmenu ? this.getStyle('submenu.icon') : this.getStyle('menu.icon');\n const { path, name } = iconStyleInfo[iconType];\n\n return path && name ? `${path}#${name}-` : '#';\n }\n\n /**\n * Make svg use link path name\n * @param {Array.} useIconTypes - normal' or 'active' or 'hover' or 'disabled\n * @param {string} menuName - menu name\n * @param {boolean} isSubmenu - submenu icon or not.\n * @returns {string}\n * @private\n */\n _makeSvgItem(useIconTypes, menuName, isSubmenu) {\n return map(useIconTypes, (iconType) => {\n const svgIconPrefix = this._makeSvgIconPrefix(iconType, isSubmenu);\n const iconName = this._toUnderScore(menuName);\n const svgIconClassName = this._makeIconClassName(iconType, isSubmenu);\n\n return ``;\n }).join('');\n }\n\n /**\n * Make svg icon set\n * @param {Array.} useIconTypes - normal' or 'active' or 'hover' or 'disabled\n * @param {string} menuName - menu name\n * @param {boolean} isSubmenu - submenu icon or not.\n * @returns {string}\n */\n makeMenSvgIconSet(useIconTypes, menuName, isSubmenu = false) {\n return `${this._makeSvgItem(\n useIconTypes,\n menuName,\n isSubmenu\n )}`;\n }\n}\n\nexport default Theme;\n","import snippet from 'tui-code-snippet';\nimport tuiColorPicker from 'tui-color-picker';\n\nconst PICKER_COLOR = [\n '#000000',\n '#2a2a2a',\n '#545454',\n '#7e7e7e',\n '#a8a8a8',\n '#d2d2d2',\n '#ffffff',\n '',\n '#ff4040',\n '#ff6518',\n '#ffbb3b',\n '#03bd9e',\n '#00a9ff',\n '#515ce6',\n '#9e5fff',\n '#ff5583',\n];\n\n/**\n * Colorpicker control class\n * @class\n * @ignore\n */\nclass Colorpicker {\n constructor(\n colorpickerElement,\n defaultColor = '#7e7e7e',\n toggleDirection = 'up',\n usageStatistics\n ) {\n this.colorpickerElement = colorpickerElement;\n this.usageStatistics = usageStatistics;\n\n this._show = false;\n\n this._colorpickerElement = colorpickerElement;\n this._toggleDirection = toggleDirection;\n this._makePickerButtonElement(defaultColor);\n this._makePickerLayerElement(colorpickerElement, colorpickerElement.getAttribute('title'));\n this._color = defaultColor;\n this.picker = tuiColorPicker.create({\n container: this.pickerElement,\n preset: PICKER_COLOR,\n color: defaultColor,\n usageStatistics: this.usageStatistics,\n });\n\n this._addEvent();\n }\n\n /**\n * Destroys the instance.\n */\n destroy() {\n this._removeEvent();\n this.picker.destroy();\n this.colorpickerElement.innerHTML = '';\n snippet.forEach(this, (value, key) => {\n this[key] = null;\n });\n }\n\n /**\n * Get color\n * @returns {Number} color value\n */\n get color() {\n return this._color;\n }\n\n /**\n * Set color\n * @param {string} color color value\n */\n set color(color) {\n this._color = color;\n this._changeColorElement(color);\n }\n\n /**\n * Change color element\n * @param {string} color color value\n * #private\n */\n _changeColorElement(color) {\n if (color) {\n this.colorElement.classList.remove('transparent');\n this.colorElement.style.backgroundColor = color;\n } else {\n this.colorElement.style.backgroundColor = '#fff';\n this.colorElement.classList.add('transparent');\n }\n }\n\n /**\n * Make picker button element\n * @param {string} defaultColor color value\n * @private\n */\n _makePickerButtonElement(defaultColor) {\n this.colorpickerElement.classList.add('tui-image-editor-button');\n\n this.colorElement = document.createElement('div');\n this.colorElement.className = 'color-picker-value';\n if (defaultColor) {\n this.colorElement.style.backgroundColor = defaultColor;\n } else {\n this.colorElement.classList.add('transparent');\n }\n }\n\n /**\n * Make picker layer element\n * @param {HTMLElement} colorpickerElement color picker element\n * @param {string} title picker title\n * @private\n */\n _makePickerLayerElement(colorpickerElement, title) {\n const label = document.createElement('label');\n const triangle = document.createElement('div');\n\n this.pickerControl = document.createElement('div');\n this.pickerControl.className = 'color-picker-control';\n\n this.pickerElement = document.createElement('div');\n this.pickerElement.className = 'color-picker';\n\n label.innerHTML = title;\n triangle.className = 'triangle';\n\n this.pickerControl.appendChild(this.pickerElement);\n this.pickerControl.appendChild(triangle);\n\n colorpickerElement.appendChild(this.pickerControl);\n colorpickerElement.appendChild(this.colorElement);\n colorpickerElement.appendChild(label);\n }\n\n /**\n * Add event\n * @private\n */\n _addEvent() {\n this.picker.on('selectColor', (value) => {\n this._changeColorElement(value.color);\n this._color = value.color;\n this.fire('change', value.color);\n });\n\n this.eventHandler = {\n pickerToggle: this._pickerToggleEventHandler.bind(this),\n pickerHide: () => this.hide(),\n };\n\n this.colorpickerElement.addEventListener('click', this.eventHandler.pickerToggle);\n document.body.addEventListener('click', this.eventHandler.pickerHide);\n }\n\n /**\n * Remove event\n * @private\n */\n _removeEvent() {\n this.colorpickerElement.removeEventListener('click', this.eventHandler.pickerToggle);\n document.body.removeEventListener('click', this.eventHandler.pickerHide);\n this.picker.off();\n }\n\n /**\n * Picker toggle event handler\n * @param {object} event - change event\n * @private\n */\n _pickerToggleEventHandler(event) {\n const { target } = event;\n const isInPickerControl = target && this._isElementInColorPickerControl(target);\n\n if (!isInPickerControl || (isInPickerControl && this._isPaletteButton(target))) {\n this._show = !this._show;\n this.pickerControl.style.display = this._show ? 'block' : 'none';\n this._setPickerControlPosition();\n this.fire('changeShow', this);\n }\n event.stopPropagation();\n }\n\n /**\n * Check hex input or not\n * @param {Element} target - Event target element\n * @returns {boolean}\n * @private\n */\n _isPaletteButton(target) {\n return target.className === 'tui-colorpicker-palette-button';\n }\n\n /**\n * Check given element is in pickerControl element\n * @param {Element} element - element to check\n * @returns {boolean}\n * @private\n */\n _isElementInColorPickerControl(element) {\n let parentNode = element;\n\n while (parentNode !== document.body) {\n if (!parentNode) {\n break;\n }\n\n if (parentNode === this.pickerControl) {\n return true;\n }\n\n parentNode = parentNode.parentNode;\n }\n\n return false;\n }\n\n hide() {\n this._show = false;\n this.pickerControl.style.display = 'none';\n }\n\n /**\n * Set picker control position\n * @private\n */\n _setPickerControlPosition() {\n const controlStyle = this.pickerControl.style;\n const halfPickerWidth = this._colorpickerElement.clientWidth / 2 + 2;\n const left = this.pickerControl.offsetWidth / 2 - halfPickerWidth;\n let top = (this.pickerControl.offsetHeight + 10) * -1;\n\n if (this._toggleDirection === 'down') {\n top = 30;\n }\n\n controlStyle.top = `${top}px`;\n controlStyle.left = `-${left}px`;\n }\n}\n\nsnippet.CustomEvents.mixin(Colorpicker);\nexport default Colorpicker;\n","import snippet from 'tui-code-snippet';\nimport { toInteger, clamp } from '@/util';\nimport { keyCodes } from '@/consts';\n\nconst INPUT_FILTER_REGEXP = /(-?)([0-9]*)[^0-9]*([0-9]*)/g;\n\n/**\n * Range control class\n * @class\n * @ignore\n */\nclass Range {\n /**\n * @constructor\n * @extends {View}\n * @param {Object} rangeElements - Html resources for creating sliders\n * @param {HTMLElement} rangeElements.slider - b\n * @param {HTMLElement} [rangeElements.input] - c\n * @param {Object} options - Slider make options\n * @param {number} options.min - min value\n * @param {number} options.max - max value\n * @param {number} options.value - default value\n * @param {number} [options.useDecimal] - Decimal point processing.\n * @param {boolean} [options.realTimeEvent] - Reflect live events.\n */\n constructor(rangeElements, options = {}) {\n this._value = options.value || 0;\n\n this.rangeElement = rangeElements.slider;\n this.rangeInputElement = rangeElements.input;\n\n this._drawRangeElement();\n\n this.rangeWidth = this._getRangeWidth();\n this._min = options.min || 0;\n this._max = options.max || 100;\n this._useDecimal = options.useDecimal;\n this._absMax = this._min * -1 + this._max;\n this.realTimeEvent = options.realTimeEvent || false;\n\n this.eventHandler = {\n startChangingSlide: this._startChangingSlide.bind(this),\n stopChangingSlide: this._stopChangingSlide.bind(this),\n changeSlide: this._changeSlide.bind(this),\n changeSlideFinally: this._changeSlideFinally.bind(this),\n changeInput: this._changeValueWithInput.bind(this, false),\n changeInputFinally: this._changeValueWithInput.bind(this, true),\n changeInputWithArrow: this._changeValueWithInputKeyEvent.bind(this),\n };\n\n this._addClickEvent();\n this._addDragEvent();\n this._addInputEvent();\n this.value = options.value;\n this.trigger('change');\n }\n\n /**\n * Destroys the instance.\n */\n destroy() {\n this._removeClickEvent();\n this._removeDragEvent();\n this._removeInputEvent();\n this.rangeElement.innerHTML = '';\n snippet.forEach(this, (value, key) => {\n this[key] = null;\n });\n }\n\n /**\n * Set range max value and re position cursor\n * @param {number} maxValue - max value\n */\n set max(maxValue) {\n this._max = maxValue;\n this._absMax = this._min * -1 + this._max;\n this.value = this._value;\n }\n\n get max() {\n return this._max;\n }\n\n /**\n * Get range value\n * @returns {Number} range value\n */\n get value() {\n return this._value;\n }\n\n /**\n * Set range value\n * @param {Number} value range value\n */\n set value(value) {\n value = this._useDecimal ? value : toInteger(value);\n\n const absValue = value - this._min;\n let leftPosition = (absValue * this.rangeWidth) / this._absMax;\n\n if (this.rangeWidth < leftPosition) {\n leftPosition = this.rangeWidth;\n }\n\n this.pointer.style.left = `${leftPosition}px`;\n this.subbar.style.right = `${this.rangeWidth - leftPosition}px`;\n\n this._value = value;\n if (this.rangeInputElement) {\n this.rangeInputElement.value = value;\n }\n }\n\n /**\n * event trigger\n * @param {string} type - type\n */\n trigger(type) {\n this.fire(type, this._value);\n }\n\n /**\n * Calculate slider width\n * @returns {number} - slider width\n */\n _getRangeWidth() {\n const getElementWidth = (element) => toInteger(window.getComputedStyle(element, null).width);\n\n return getElementWidth(this.rangeElement) - getElementWidth(this.pointer);\n }\n\n /**\n * Make range element\n * @private\n */\n _drawRangeElement() {\n this.rangeElement.classList.add('tui-image-editor-range');\n\n this.bar = document.createElement('div');\n this.bar.className = 'tui-image-editor-virtual-range-bar';\n\n this.subbar = document.createElement('div');\n this.subbar.className = 'tui-image-editor-virtual-range-subbar';\n\n this.pointer = document.createElement('div');\n this.pointer.className = 'tui-image-editor-virtual-range-pointer';\n\n this.bar.appendChild(this.subbar);\n this.bar.appendChild(this.pointer);\n this.rangeElement.appendChild(this.bar);\n }\n\n /**\n * Add range input editing event\n * @private\n */\n _addInputEvent() {\n if (this.rangeInputElement) {\n this.rangeInputElement.addEventListener('keydown', this.eventHandler.changeInputWithArrow);\n this.rangeInputElement.addEventListener('keyup', this.eventHandler.changeInput);\n this.rangeInputElement.addEventListener('blur', this.eventHandler.changeInputFinally);\n }\n }\n\n /**\n * Remove range input editing event\n * @private\n */\n _removeInputEvent() {\n if (this.rangeInputElement) {\n this.rangeInputElement.removeEventListener('keydown', this.eventHandler.changeInputWithArrow);\n this.rangeInputElement.removeEventListener('keyup', this.eventHandler.changeInput);\n this.rangeInputElement.removeEventListener('blur', this.eventHandler.changeInputFinally);\n }\n }\n\n /**\n * change angle event\n * @param {object} event - key event\n * @private\n */\n _changeValueWithInputKeyEvent(event) {\n const { keyCode, target } = event;\n\n if ([keyCodes.ARROW_UP, keyCodes.ARROW_DOWN].indexOf(keyCode) < 0) {\n return;\n }\n\n let value = Number(target.value);\n\n value = this._valueUpDownForKeyEvent(value, keyCode);\n\n const unChanged = value < this._min || value > this._max;\n\n if (!unChanged) {\n const clampValue = clamp(value, this._min, this.max);\n this.value = clampValue;\n this.fire('change', clampValue, false);\n }\n }\n\n /**\n * value up down for input\n * @param {number} value - original value number\n * @param {number} keyCode - input event key code\n * @returns {number} value - changed value\n * @private\n */\n _valueUpDownForKeyEvent(value, keyCode) {\n const step = this._useDecimal ? 0.1 : 1;\n\n if (keyCode === keyCodes.ARROW_UP) {\n value += step;\n } else if (keyCode === keyCodes.ARROW_DOWN) {\n value -= step;\n }\n\n return value;\n }\n\n /**\n * change angle event\n * @param {boolean} isLast - Is last change\n * @param {object} event - key event\n * @private\n */\n _changeValueWithInput(isLast, event) {\n const { keyCode, target } = event;\n\n if ([keyCodes.ARROW_UP, keyCodes.ARROW_DOWN].indexOf(keyCode) >= 0) {\n return;\n }\n\n const stringValue = this._filterForInputText(target.value);\n const waitForChange = !stringValue || isNaN(stringValue);\n target.value = stringValue;\n\n if (!waitForChange) {\n let value = this._useDecimal ? Number(stringValue) : toInteger(stringValue);\n value = clamp(value, this._min, this.max);\n\n this.value = value;\n this.fire('change', value, isLast);\n }\n }\n\n /**\n * Add Range click event\n * @private\n */\n _addClickEvent() {\n this.rangeElement.addEventListener('click', this.eventHandler.changeSlideFinally);\n }\n\n /**\n * Remove Range click event\n * @private\n */\n _removeClickEvent() {\n this.rangeElement.removeEventListener('click', this.eventHandler.changeSlideFinally);\n }\n\n /**\n * Add Range drag event\n * @private\n */\n _addDragEvent() {\n this.pointer.addEventListener('mousedown', this.eventHandler.startChangingSlide);\n }\n\n /**\n * Remove Range drag event\n * @private\n */\n _removeDragEvent() {\n this.pointer.removeEventListener('mousedown', this.eventHandler.startChangingSlide);\n }\n\n /**\n * change angle event\n * @param {object} event - change event\n * @private\n */\n _changeSlide(event) {\n const changePosition = event.screenX;\n const diffPosition = changePosition - this.firstPosition;\n let touchPx = this.firstLeft + diffPosition;\n touchPx = touchPx > this.rangeWidth ? this.rangeWidth : touchPx;\n touchPx = touchPx < 0 ? 0 : touchPx;\n\n this.pointer.style.left = `${touchPx}px`;\n this.subbar.style.right = `${this.rangeWidth - touchPx}px`;\n\n const ratio = touchPx / this.rangeWidth;\n const resultValue = this._absMax * ratio + this._min;\n const value = this._useDecimal ? resultValue : toInteger(resultValue);\n const isValueChanged = this.value !== value;\n\n if (isValueChanged) {\n this.value = value;\n if (this.realTimeEvent) {\n this.fire('change', this._value, false);\n }\n }\n }\n\n _changeSlideFinally(event) {\n event.stopPropagation();\n if (event.target.className !== 'tui-image-editor-range') {\n return;\n }\n const touchPx = event.offsetX;\n const ratio = touchPx / this.rangeWidth;\n const value = this._absMax * ratio + this._min;\n this.pointer.style.left = `${ratio * this.rangeWidth}px`;\n this.subbar.style.right = `${(1 - ratio) * this.rangeWidth}px`;\n this.value = value;\n\n this.fire('change', value, true);\n }\n\n _startChangingSlide(event) {\n this.firstPosition = event.screenX;\n this.firstLeft = toInteger(this.pointer.style.left) || 0;\n\n document.addEventListener('mousemove', this.eventHandler.changeSlide);\n document.addEventListener('mouseup', this.eventHandler.stopChangingSlide);\n }\n\n /**\n * stop change angle event\n * @private\n */\n _stopChangingSlide() {\n this.fire('change', this._value, true);\n\n document.removeEventListener('mousemove', this.eventHandler.changeSlide);\n document.removeEventListener('mouseup', this.eventHandler.stopChangingSlide);\n }\n\n /**\n * Unnecessary string filtering.\n * @param {string} inputValue - origin string of input\n * @returns {string} filtered string\n * @private\n */\n _filterForInputText(inputValue) {\n return inputValue.replace(INPUT_FILTER_REGEXP, '$1$2$3');\n }\n}\n\nsnippet.CustomEvents.mixin(Range);\n\nexport default Range;\n","/**\n * @author NHN. FE Development Team \n * @fileoverview Util\n */\nimport { forEach, sendHostname, extend, isString, pick, inArray } from 'tui-code-snippet';\nimport Promise from 'core-js-pure/features/promise';\nimport {\n commandNames,\n filterType,\n historyNames,\n SHAPE_FILL_TYPE,\n SHAPE_TYPE,\n emptyCropRectValues,\n} from '@/consts';\n\nconst FLOATING_POINT_DIGIT = 2;\nconst CSS_PREFIX = 'tui-image-editor-';\nconst { min, max } = Math;\nlet hostnameSent = false;\n\n/**\n * Export Promise Class (for simplified module path)\n * @returns {Promise} promise class\n */\nexport { Promise };\n\n/**\n * Clamp value\n * @param {number} value - Value\n * @param {number} minValue - Minimum value\n * @param {number} maxValue - Maximum value\n * @returns {number} clamped value\n */\nexport function clamp(value, minValue, maxValue) {\n if (minValue > maxValue) {\n [minValue, maxValue] = [maxValue, minValue];\n }\n\n return max(minValue, min(value, maxValue));\n}\n\n/**\n * Make key-value object from arguments\n * @returns {object.}\n */\nexport function keyMirror(...args) {\n const obj = {};\n\n forEach(args, (key) => {\n obj[key] = key;\n });\n\n return obj;\n}\n\n/**\n * Make CSSText\n * @param {Object} styleObj - Style info object\n * @returns {string} Connected string of style\n */\nexport function makeStyleText(styleObj) {\n let styleStr = '';\n\n forEach(styleObj, (value, prop) => {\n styleStr += `${prop}: ${value};`;\n });\n\n return styleStr;\n}\n\n/**\n * Get object's properties\n * @param {Object} obj - object\n * @param {Array} keys - keys\n * @returns {Object} properties object\n */\nexport function getProperties(obj, keys) {\n const props = {};\n const { length } = keys;\n let i = 0;\n let key;\n\n for (i = 0; i < length; i += 1) {\n key = keys[i];\n props[key] = obj[key];\n }\n\n return props;\n}\n\n/**\n * ParseInt simpliment\n * @param {number} value - Value\n * @returns {number}\n */\nexport function toInteger(value) {\n return parseInt(value, 10);\n}\n\n/**\n * String to camelcase string\n * @param {string} targetString - change target\n * @returns {string}\n * @private\n */\nexport function toCamelCase(targetString) {\n return targetString.replace(/-([a-z])/g, ($0, $1) => $1.toUpperCase());\n}\n\n/**\n * Check browser file api support\n * @returns {boolean}\n * @private\n */\nexport function isSupportFileApi() {\n return !!(window.File && window.FileList && window.FileReader);\n}\n\n/**\n * hex to rgb\n * @param {string} color - hex color\n * @param {string} alpha - color alpha value\n * @returns {string} rgb expression\n */\nexport function getRgb(color, alpha) {\n if (color.length === 4) {\n color = `${color}${color.slice(1, 4)}`;\n }\n const r = parseInt(color.slice(1, 3), 16);\n const g = parseInt(color.slice(3, 5), 16);\n const b = parseInt(color.slice(5, 7), 16);\n const a = alpha || 1;\n\n return `rgba(${r}, ${g}, ${b}, ${a})`;\n}\n\n/**\n * send hostname\n */\nexport function sendHostName() {\n if (hostnameSent) {\n return;\n }\n hostnameSent = true;\n\n sendHostname('image-editor', 'UA-129999381-1');\n}\n\n/**\n * Apply css resource\n * @param {string} styleBuffer - serialized css text\n * @param {string} tagId - style tag id\n */\nexport function styleLoad(styleBuffer, tagId) {\n const [head] = document.getElementsByTagName('head');\n const linkElement = document.createElement('link');\n const styleData = encodeURIComponent(styleBuffer);\n if (tagId) {\n linkElement.id = tagId;\n // linkElement.id = 'tui-image-editor-theme-style';\n }\n linkElement.setAttribute('rel', 'stylesheet');\n linkElement.setAttribute('type', 'text/css');\n linkElement.setAttribute('href', `data:text/css;charset=UTF-8,${styleData}`);\n head.appendChild(linkElement);\n}\n\n/**\n * Get selector\n * @param {HTMLElement} targetElement - target element\n * @returns {Function} selector\n */\nexport function getSelector(targetElement) {\n return (str) => targetElement.querySelector(str);\n}\n\n/**\n * Change base64 to blob\n * @param {String} data - base64 string data\n * @returns {Blob} Blob Data\n */\nexport function base64ToBlob(data) {\n const rImageType = /data:(image\\/.+);base64,/;\n let mimeString = '';\n let raw, uInt8Array, i;\n\n raw = data.replace(rImageType, (header, imageType) => {\n mimeString = imageType;\n\n return '';\n });\n\n raw = atob(raw);\n const rawLength = raw.length;\n uInt8Array = new Uint8Array(rawLength); // eslint-disable-line\n\n for (i = 0; i < rawLength; i += 1) {\n uInt8Array[i] = raw.charCodeAt(i);\n }\n\n return new Blob([uInt8Array], { type: mimeString });\n}\n\n/**\n * Fix floating point diff.\n * @param {number} value - original value\n * @returns {number} fixed value\n */\nexport function fixFloatingPoint(value) {\n return Number(value.toFixed(FLOATING_POINT_DIGIT));\n}\n\n/**\n * Assignment for destroying objects.\n * @param {Object} targetObject - object to be removed.\n */\nexport function assignmentForDestroy(targetObject) {\n forEach(targetObject, (value, key) => {\n targetObject[key] = null;\n });\n}\n\n/**\n * Make class name for ui\n * @param {String} str - main string of className\n * @param {String} prefix - prefix string of className\n * @returns {String} class name\n */\nexport function cls(str = '', prefix = '') {\n if (str.charAt(0) === '.') {\n return `.${CSS_PREFIX}${prefix}${str.slice(1)}`;\n }\n\n return `${CSS_PREFIX}${prefix}${str}`;\n}\n\n/**\n * Change object origin\n * @param {fabric.Object} fObject - fabric object\n * @param {Object} origin - origin of fabric object\n * @param {string} originX - horizontal basis.\n * @param {string} originY - vertical basis.\n */\nexport function changeOrigin(fObject, origin) {\n const { originX, originY } = origin;\n const { x: left, y: top } = fObject.getPointByOrigin(originX, originY);\n\n fObject.set({\n left,\n top,\n originX,\n originY,\n });\n\n fObject.setCoords();\n}\n\n/**\n * Object key value flip\n * @param {Object} targetObject - The data object of the key value.\n * @returns {Object}\n */\nexport function flipObject(targetObject) {\n const result = {};\n\n Object.keys(targetObject).forEach((key) => {\n result[targetObject[key]] = key;\n });\n\n return result;\n}\n\n/**\n * Set custom properties\n * @param {Object} targetObject - target object\n * @param {Object} props - custom props object\n */\nexport function setCustomProperty(targetObject, props) {\n targetObject.customProps = targetObject.customProps || {};\n extend(targetObject.customProps, props);\n}\n\n/**\n * Get custom property\n * @param {fabric.Object} fObject - fabric object\n * @param {Array|string} propNames - prop name array\n * @returns {object | number | string}\n */\nexport function getCustomProperty(fObject, propNames) {\n const resultObject = {};\n if (isString(propNames)) {\n propNames = [propNames];\n }\n forEach(propNames, (propName) => {\n resultObject[propName] = fObject.customProps[propName];\n });\n\n return resultObject;\n}\n\n/**\n * Capitalize string\n * @param {string} targetString - target string\n * @returns {string}\n */\nexport function capitalizeString(targetString) {\n return targetString.charAt(0).toUpperCase() + targetString.slice(1);\n}\n\n/**\n * Array includes check\n * @param {Array} targetArray - target array\n * @param {string|number} compareValue - compare value\n * @returns {boolean}\n */\nexport function includes(targetArray, compareValue) {\n return targetArray.indexOf(compareValue) >= 0;\n}\n\n/**\n * Get fill type\n * @param {Object | string} fillOption - shape fill option\n * @returns {string} 'color' or 'filter'\n */\nexport function getFillTypeFromOption(fillOption = {}) {\n return pick(fillOption, 'type') || SHAPE_FILL_TYPE.COLOR;\n}\n\n/**\n * Get fill type of shape type object\n * @param {fabric.Object} shapeObj - fabric object\n * @returns {string} 'transparent' or 'color' or 'filter'\n */\nexport function getFillTypeFromObject(shapeObj) {\n const { fill = {} } = shapeObj;\n if (fill.source) {\n return SHAPE_FILL_TYPE.FILTER;\n }\n\n return SHAPE_FILL_TYPE.COLOR;\n}\n\n/**\n * Check if the object is a shape object.\n * @param {fabric.Object} obj - fabric object\n * @returns {boolean}\n */\nexport function isShape(obj) {\n return inArray(obj.get('type'), SHAPE_TYPE) >= 0;\n}\n\n/**\n * Get object type\n * @param {string} type - fabric object type\n * @returns {string} type of object (ex: shape, icon, ...)\n */\nexport function getObjectType(type) {\n if (includes(SHAPE_TYPE, type)) {\n return 'Shape';\n }\n\n switch (type) {\n case 'i-text':\n return 'Text';\n case 'path':\n case 'line':\n return 'Draw';\n case 'activeSelection':\n return 'Group';\n default:\n return toStartOfCapital(type);\n }\n}\n\n/**\n * Get filter type\n * @param {string} type - fabric filter type\n * @param {object} [options] - filter type options\n * @param {boolean} [options.useAlpha=true] - usage of alpha(true is 'color filter', false is 'remove white')\n * @param {string} [options.mode] - mode of blendColor\n * @returns {string} type of filter (ex: sepia, blur, ...)\n */\nfunction getFilterType(type, { useAlpha = true, mode } = {}) {\n const {\n VINTAGE,\n REMOVE_COLOR,\n BLEND_COLOR,\n SEPIA2,\n COLOR_FILTER,\n REMOVE_WHITE,\n BLEND,\n } = filterType;\n\n let filterName;\n\n switch (type) {\n case VINTAGE:\n filterName = SEPIA2;\n break;\n case REMOVE_COLOR:\n filterName = useAlpha ? COLOR_FILTER : REMOVE_WHITE;\n break;\n case BLEND_COLOR:\n filterName = mode === 'add' ? BLEND : mode;\n break;\n default:\n filterName = type;\n }\n\n return toStartOfCapital(filterName);\n}\n\n/**\n * Check if command is silent command\n * @param {Command|string} command - command or command name\n * @returns {boolean}\n */\nexport function isSilentCommand(command) {\n const { LOAD_IMAGE } = commandNames;\n\n return typeof command === 'string' ? LOAD_IMAGE === command : LOAD_IMAGE === command.name;\n}\n\n/**\n * Get command name\n * @param {Command|string} command - command or command name\n * @returns {{name: string, ?detail: string}}\n */\n// eslint-disable-next-line complexity, require-jsdoc\nexport function getHistoryTitle(command) {\n const {\n FLIP_IMAGE,\n ROTATE_IMAGE,\n ADD_TEXT,\n APPLY_FILTER,\n REMOVE_FILTER,\n CHANGE_SHAPE,\n CHANGE_ICON_COLOR,\n CHANGE_TEXT_STYLE,\n CLEAR_OBJECTS,\n ADD_IMAGE_OBJECT,\n REMOVE_OBJECT,\n } = commandNames;\n const { name, args } = command;\n let historyInfo;\n\n switch (name) {\n case FLIP_IMAGE:\n historyInfo = { name, detail: args[1] === 'reset' ? args[1] : args[1].slice(4) };\n break;\n case ROTATE_IMAGE:\n historyInfo = { name, detail: args[2] };\n break;\n case APPLY_FILTER:\n historyInfo = { name: historyNames.APPLY_FILTER, detail: getFilterType(args[1], args[2]) };\n break;\n case REMOVE_FILTER:\n historyInfo = { name: historyNames.REMOVE_FILTER, detail: 'Remove' };\n break;\n case CHANGE_SHAPE:\n historyInfo = { name: historyNames.CHANGE_SHAPE, detail: 'Change' };\n break;\n case CHANGE_ICON_COLOR:\n historyInfo = { name: historyNames.CHANGE_ICON_COLOR, detail: 'Change' };\n break;\n case CHANGE_TEXT_STYLE:\n historyInfo = { name: historyNames.CHANGE_TEXT_STYLE, detail: 'Change' };\n break;\n case REMOVE_OBJECT:\n historyInfo = { name: historyNames.REMOVE_OBJECT, detail: args[2] };\n break;\n case CLEAR_OBJECTS:\n historyInfo = { name: historyNames.CLEAR_OBJECTS, detail: 'All' };\n break;\n case ADD_IMAGE_OBJECT:\n historyInfo = { name: historyNames.ADD_IMAGE_OBJECT, detail: 'Add' };\n break;\n case ADD_TEXT:\n historyInfo = { name: historyNames.ADD_TEXT };\n break;\n\n default:\n historyInfo = { name };\n break;\n }\n\n if (args[1] === 'mask') {\n historyInfo = { name: historyNames.LOAD_MASK_IMAGE, detail: 'Apply' };\n }\n\n return historyInfo;\n}\n\n/**\n * Get help menubar position(opposite of menubar)\n * @param {string} position - position of menubar\n * @returns {string} position of help menubar\n */\nexport function getHelpMenuBarPosition(position) {\n if (position === 'top') {\n return 'bottom';\n }\n if (position === 'left') {\n return 'right';\n }\n if (position === 'right') {\n return 'left';\n }\n\n return 'top';\n}\n\n/**\n * Change to capital start letter\n * @param {string} str - string to change\n * @returns {string}\n */\nfunction toStartOfCapital(str) {\n return str.replace(/[a-z]/, (first) => first.toUpperCase());\n}\n\n/**\n * Check if cropRect is Empty.\n * @param {Object} cropRect - cropRect object\n * @param {Number} cropRect.left - cropRect left position value\n * @param {Number} cropRect.top - cropRect top position value\n * @param {Number} cropRect.width - cropRect width value\n * @param {Number} cropRect.height - cropRect height value\n * @returns {boolean}\n */\nexport function isEmptyCropzone(cropRect) {\n const { left, top, width, height } = cropRect;\n const { LEFT, TOP, WIDTH, HEIGHT } = emptyCropRectValues;\n\n return left === LEFT && top === TOP && width === WIDTH && height === HEIGHT;\n}\n","module.exports = \"\"","module.exports = __WEBPACK_EXTERNAL_MODULE_fabric__;","module.exports = __WEBPACK_EXTERNAL_MODULE_tui_code_snippet__;","module.exports = __WEBPACK_EXTERNAL_MODULE_tui_color_picker__;"],"sourceRoot":""} \ No newline at end of file +{"version":3,"sources":["webpack://tui.ImageEditor/webpack/universalModuleDefinition","webpack://tui.ImageEditor/webpack/bootstrap","webpack://tui.ImageEditor/./node_modules/core-js-pure/es/promise/index.js","webpack://tui.ImageEditor/./node_modules/core-js-pure/features/promise/index.js","webpack://tui.ImageEditor/./node_modules/core-js-pure/internals/a-function.js","webpack://tui.ImageEditor/./node_modules/core-js-pure/internals/a-possible-prototype.js","webpack://tui.ImageEditor/./node_modules/core-js-pure/internals/add-to-unscopables.js","webpack://tui.ImageEditor/./node_modules/core-js-pure/internals/an-instance.js","webpack://tui.ImageEditor/./node_modules/core-js-pure/internals/an-object.js","webpack://tui.ImageEditor/./node_modules/core-js-pure/internals/array-includes.js","webpack://tui.ImageEditor/./node_modules/core-js-pure/internals/call-with-safe-iteration-closing.js","webpack://tui.ImageEditor/./node_modules/core-js-pure/internals/check-correctness-of-iteration.js","webpack://tui.ImageEditor/./node_modules/core-js-pure/internals/classof-raw.js","webpack://tui.ImageEditor/./node_modules/core-js-pure/internals/classof.js","webpack://tui.ImageEditor/./node_modules/core-js-pure/internals/correct-prototype-getter.js","webpack://tui.ImageEditor/./node_modules/core-js-pure/internals/create-iterator-constructor.js","webpack://tui.ImageEditor/./node_modules/core-js-pure/internals/create-non-enumerable-property.js","webpack://tui.ImageEditor/./node_modules/core-js-pure/internals/create-property-descriptor.js","webpack://tui.ImageEditor/./node_modules/core-js-pure/internals/define-iterator.js","webpack://tui.ImageEditor/./node_modules/core-js-pure/internals/descriptors.js","webpack://tui.ImageEditor/./node_modules/core-js-pure/internals/document-create-element.js","webpack://tui.ImageEditor/./node_modules/core-js-pure/internals/dom-iterables.js","webpack://tui.ImageEditor/./node_modules/core-js-pure/internals/engine-is-ios.js","webpack://tui.ImageEditor/./node_modules/core-js-pure/internals/engine-user-agent.js","webpack://tui.ImageEditor/./node_modules/core-js-pure/internals/engine-v8-version.js","webpack://tui.ImageEditor/./node_modules/core-js-pure/internals/enum-bug-keys.js","webpack://tui.ImageEditor/./node_modules/core-js-pure/internals/export.js","webpack://tui.ImageEditor/./node_modules/core-js-pure/internals/fails.js","webpack://tui.ImageEditor/./node_modules/core-js-pure/internals/function-bind-context.js","webpack://tui.ImageEditor/./node_modules/core-js-pure/internals/get-built-in.js","webpack://tui.ImageEditor/./node_modules/core-js-pure/internals/get-iterator-method.js","webpack://tui.ImageEditor/./node_modules/core-js-pure/internals/global.js","webpack://tui.ImageEditor/./node_modules/core-js-pure/internals/has.js","webpack://tui.ImageEditor/./node_modules/core-js-pure/internals/hidden-keys.js","webpack://tui.ImageEditor/./node_modules/core-js-pure/internals/host-report-errors.js","webpack://tui.ImageEditor/./node_modules/core-js-pure/internals/html.js","webpack://tui.ImageEditor/./node_modules/core-js-pure/internals/ie8-dom-define.js","webpack://tui.ImageEditor/./node_modules/core-js-pure/internals/indexed-object.js","webpack://tui.ImageEditor/./node_modules/core-js-pure/internals/inspect-source.js","webpack://tui.ImageEditor/./node_modules/core-js-pure/internals/internal-state.js","webpack://tui.ImageEditor/./node_modules/core-js-pure/internals/is-array-iterator-method.js","webpack://tui.ImageEditor/./node_modules/core-js-pure/internals/is-forced.js","webpack://tui.ImageEditor/./node_modules/core-js-pure/internals/is-object.js","webpack://tui.ImageEditor/./node_modules/core-js-pure/internals/is-pure.js","webpack://tui.ImageEditor/./node_modules/core-js-pure/internals/iterate.js","webpack://tui.ImageEditor/./node_modules/core-js-pure/internals/iterators-core.js","webpack://tui.ImageEditor/./node_modules/core-js-pure/internals/iterators.js","webpack://tui.ImageEditor/./node_modules/core-js-pure/internals/microtask.js","webpack://tui.ImageEditor/./node_modules/core-js-pure/internals/native-promise-constructor.js","webpack://tui.ImageEditor/./node_modules/core-js-pure/internals/native-symbol.js","webpack://tui.ImageEditor/./node_modules/core-js-pure/internals/native-weak-map.js","webpack://tui.ImageEditor/./node_modules/core-js-pure/internals/new-promise-capability.js","webpack://tui.ImageEditor/./node_modules/core-js-pure/internals/object-create.js","webpack://tui.ImageEditor/./node_modules/core-js-pure/internals/object-define-properties.js","webpack://tui.ImageEditor/./node_modules/core-js-pure/internals/object-define-property.js","webpack://tui.ImageEditor/./node_modules/core-js-pure/internals/object-get-own-property-descriptor.js","webpack://tui.ImageEditor/./node_modules/core-js-pure/internals/object-get-prototype-of.js","webpack://tui.ImageEditor/./node_modules/core-js-pure/internals/object-keys-internal.js","webpack://tui.ImageEditor/./node_modules/core-js-pure/internals/object-keys.js","webpack://tui.ImageEditor/./node_modules/core-js-pure/internals/object-property-is-enumerable.js","webpack://tui.ImageEditor/./node_modules/core-js-pure/internals/object-set-prototype-of.js","webpack://tui.ImageEditor/./node_modules/core-js-pure/internals/object-to-string.js","webpack://tui.ImageEditor/./node_modules/core-js-pure/internals/path.js","webpack://tui.ImageEditor/./node_modules/core-js-pure/internals/perform.js","webpack://tui.ImageEditor/./node_modules/core-js-pure/internals/promise-resolve.js","webpack://tui.ImageEditor/./node_modules/core-js-pure/internals/redefine-all.js","webpack://tui.ImageEditor/./node_modules/core-js-pure/internals/redefine.js","webpack://tui.ImageEditor/./node_modules/core-js-pure/internals/require-object-coercible.js","webpack://tui.ImageEditor/./node_modules/core-js-pure/internals/set-global.js","webpack://tui.ImageEditor/./node_modules/core-js-pure/internals/set-species.js","webpack://tui.ImageEditor/./node_modules/core-js-pure/internals/set-to-string-tag.js","webpack://tui.ImageEditor/./node_modules/core-js-pure/internals/shared-key.js","webpack://tui.ImageEditor/./node_modules/core-js-pure/internals/shared-store.js","webpack://tui.ImageEditor/./node_modules/core-js-pure/internals/shared.js","webpack://tui.ImageEditor/./node_modules/core-js-pure/internals/species-constructor.js","webpack://tui.ImageEditor/./node_modules/core-js-pure/internals/string-multibyte.js","webpack://tui.ImageEditor/./node_modules/core-js-pure/internals/task.js","webpack://tui.ImageEditor/./node_modules/core-js-pure/internals/to-absolute-index.js","webpack://tui.ImageEditor/./node_modules/core-js-pure/internals/to-indexed-object.js","webpack://tui.ImageEditor/./node_modules/core-js-pure/internals/to-integer.js","webpack://tui.ImageEditor/./node_modules/core-js-pure/internals/to-length.js","webpack://tui.ImageEditor/./node_modules/core-js-pure/internals/to-object.js","webpack://tui.ImageEditor/./node_modules/core-js-pure/internals/to-primitive.js","webpack://tui.ImageEditor/./node_modules/core-js-pure/internals/to-string-tag-support.js","webpack://tui.ImageEditor/./node_modules/core-js-pure/internals/uid.js","webpack://tui.ImageEditor/./node_modules/core-js-pure/internals/use-symbol-as-uid.js","webpack://tui.ImageEditor/./node_modules/core-js-pure/internals/well-known-symbol.js","webpack://tui.ImageEditor/./node_modules/core-js-pure/modules/es.array.iterator.js","webpack://tui.ImageEditor/./node_modules/core-js-pure/modules/es.object.to-string.js","webpack://tui.ImageEditor/./node_modules/core-js-pure/modules/es.promise.all-settled.js","webpack://tui.ImageEditor/./node_modules/core-js-pure/modules/es.promise.finally.js","webpack://tui.ImageEditor/./node_modules/core-js-pure/modules/es.promise.js","webpack://tui.ImageEditor/./node_modules/core-js-pure/modules/es.string.iterator.js","webpack://tui.ImageEditor/./node_modules/core-js-pure/modules/esnext.aggregate-error.js","webpack://tui.ImageEditor/./node_modules/core-js-pure/modules/esnext.promise.all-settled.js","webpack://tui.ImageEditor/./node_modules/core-js-pure/modules/esnext.promise.any.js","webpack://tui.ImageEditor/./node_modules/core-js-pure/modules/esnext.promise.try.js","webpack://tui.ImageEditor/./node_modules/core-js-pure/modules/web.dom-collections.iterator.js","webpack://tui.ImageEditor/(webpack)/buildin/global.js","webpack://tui.ImageEditor/./src/css/index.styl","webpack://tui.ImageEditor/./src/index.js","webpack://tui.ImageEditor/./src/js/action.js","webpack://tui.ImageEditor/./src/js/command/addIcon.js","webpack://tui.ImageEditor/./src/js/command/addImageObject.js","webpack://tui.ImageEditor/./src/js/command/addObject.js","webpack://tui.ImageEditor/./src/js/command/addShape.js","webpack://tui.ImageEditor/./src/js/command/addText.js","webpack://tui.ImageEditor/./src/js/command/applyFilter.js","webpack://tui.ImageEditor/./src/js/command/changeIconColor.js","webpack://tui.ImageEditor/./src/js/command/changeSelection.js","webpack://tui.ImageEditor/./src/js/command/changeShape.js","webpack://tui.ImageEditor/./src/js/command/changeText.js","webpack://tui.ImageEditor/./src/js/command/changeTextStyle.js","webpack://tui.ImageEditor/./src/js/command/clearObjects.js","webpack://tui.ImageEditor/./src/js/command/flip.js","webpack://tui.ImageEditor/./src/js/command/loadImage.js","webpack://tui.ImageEditor/./src/js/command/removeFilter.js","webpack://tui.ImageEditor/./src/js/command/removeObject.js","webpack://tui.ImageEditor/./src/js/command/resizeCanvasDimension.js","webpack://tui.ImageEditor/./src/js/command/rotate.js","webpack://tui.ImageEditor/./src/js/command/setObjectPosition.js","webpack://tui.ImageEditor/./src/js/command/setObjectProperties.js","webpack://tui.ImageEditor/./src/js/component/cropper.js","webpack://tui.ImageEditor/./src/js/component/filter.js","webpack://tui.ImageEditor/./src/js/component/flip.js","webpack://tui.ImageEditor/./src/js/component/freeDrawing.js","webpack://tui.ImageEditor/./src/js/component/icon.js","webpack://tui.ImageEditor/./src/js/component/imageLoader.js","webpack://tui.ImageEditor/./src/js/component/line.js","webpack://tui.ImageEditor/./src/js/component/rotation.js","webpack://tui.ImageEditor/./src/js/component/shape.js","webpack://tui.ImageEditor/./src/js/component/text.js","webpack://tui.ImageEditor/./src/js/component/zoom.js","webpack://tui.ImageEditor/./src/js/consts.js","webpack://tui.ImageEditor/./src/js/drawingMode/cropper.js","webpack://tui.ImageEditor/./src/js/drawingMode/freeDrawing.js","webpack://tui.ImageEditor/./src/js/drawingMode/icon.js","webpack://tui.ImageEditor/./src/js/drawingMode/lineDrawing.js","webpack://tui.ImageEditor/./src/js/drawingMode/shape.js","webpack://tui.ImageEditor/./src/js/drawingMode/text.js","webpack://tui.ImageEditor/./src/js/drawingMode/zoom.js","webpack://tui.ImageEditor/./src/js/extension/arrowLine.js","webpack://tui.ImageEditor/./src/js/extension/colorFilter.js","webpack://tui.ImageEditor/./src/js/extension/cropzone.js","webpack://tui.ImageEditor/./src/js/extension/emboss.js","webpack://tui.ImageEditor/./src/js/extension/mask.js","webpack://tui.ImageEditor/./src/js/extension/sharpen.js","webpack://tui.ImageEditor/./src/js/factory/command.js","webpack://tui.ImageEditor/./src/js/factory/errorMessage.js","webpack://tui.ImageEditor/./src/js/graphics.js","webpack://tui.ImageEditor/./src/js/helper/imagetracer.js","webpack://tui.ImageEditor/./src/js/helper/selectionModifyHelper.js","webpack://tui.ImageEditor/./src/js/helper/shapeFilterFillHelper.js","webpack://tui.ImageEditor/./src/js/helper/shapeResizeHelper.js","webpack://tui.ImageEditor/./src/js/imageEditor.js","webpack://tui.ImageEditor/./src/js/interface/command.js","webpack://tui.ImageEditor/./src/js/interface/component.js","webpack://tui.ImageEditor/./src/js/interface/drawingMode.js","webpack://tui.ImageEditor/./src/js/invoker.js","webpack://tui.ImageEditor/./src/js/polyfill.js","webpack://tui.ImageEditor/./src/js/ui.js","webpack://tui.ImageEditor/./src/js/ui/crop.js","webpack://tui.ImageEditor/./src/js/ui/draw.js","webpack://tui.ImageEditor/./src/js/ui/filter.js","webpack://tui.ImageEditor/./src/js/ui/flip.js","webpack://tui.ImageEditor/./src/js/ui/history.js","webpack://tui.ImageEditor/./src/js/ui/icon.js","webpack://tui.ImageEditor/./src/js/ui/locale/locale.js","webpack://tui.ImageEditor/./src/js/ui/mask.js","webpack://tui.ImageEditor/./src/js/ui/panelMenu.js","webpack://tui.ImageEditor/./src/js/ui/rotate.js","webpack://tui.ImageEditor/./src/js/ui/shape.js","webpack://tui.ImageEditor/./src/js/ui/submenuBase.js","webpack://tui.ImageEditor/./src/js/ui/template/controls.js","webpack://tui.ImageEditor/./src/js/ui/template/mainContainer.js","webpack://tui.ImageEditor/./src/js/ui/template/style.js","webpack://tui.ImageEditor/./src/js/ui/template/submenu/crop.js","webpack://tui.ImageEditor/./src/js/ui/template/submenu/draw.js","webpack://tui.ImageEditor/./src/js/ui/template/submenu/filter.js","webpack://tui.ImageEditor/./src/js/ui/template/submenu/flip.js","webpack://tui.ImageEditor/./src/js/ui/template/submenu/history.js","webpack://tui.ImageEditor/./src/js/ui/template/submenu/icon.js","webpack://tui.ImageEditor/./src/js/ui/template/submenu/mask.js","webpack://tui.ImageEditor/./src/js/ui/template/submenu/rotate.js","webpack://tui.ImageEditor/./src/js/ui/template/submenu/shape.js","webpack://tui.ImageEditor/./src/js/ui/template/submenu/text.js","webpack://tui.ImageEditor/./src/js/ui/text.js","webpack://tui.ImageEditor/./src/js/ui/theme/standard.js","webpack://tui.ImageEditor/./src/js/ui/theme/theme.js","webpack://tui.ImageEditor/./src/js/ui/tools/colorpicker.js","webpack://tui.ImageEditor/./src/js/ui/tools/range.js","webpack://tui.ImageEditor/./src/js/util.js","webpack://tui.ImageEditor/./src/svg/default.svg","webpack://tui.ImageEditor/external {\"commonjs\":[\"fabric\",\"fabric\"],\"commonjs2\":[\"fabric\",\"fabric\"],\"amd\":\"fabric\",\"root\":\"fabric\"}","webpack://tui.ImageEditor/external {\"commonjs\":\"tui-code-snippet\",\"commonjs2\":\"tui-code-snippet\",\"amd\":\"tui-code-snippet\",\"root\":[\"tui\",\"util\"]}","webpack://tui.ImageEditor/external {\"commonjs\":\"tui-color-picker\",\"commonjs2\":\"tui-color-picker\",\"amd\":\"tui-color-picker\",\"root\":[\"tui\",\"colorPicker\"]}"],"names":["module","exports","ImageEditor","getActions","main","_mainAction","shape","_shapeAction","crop","_cropAction","flip","_flipAction","rotate","_rotateAction","text","_textAction","mask","_maskAction","draw","_drawAction","icon","_iconAction","filter","_filterAction","history","_historyAction","exitCropOnAction","ui","submenu","stopDrawingMode","changeMenu","setAngleRangeBarOnAction","angle","setRangeBarAngle","setFilterStateRangeBarOnAction","filterOptions","setFilterState","onEndUndoRedo","result","toggleZoomMode","zoomMode","_graphics","getZoomMode","zoomModes","ZOOM","startDrawingMode","drawingModes","startZoomInMode","endZoomInMode","toggleHandMode","HAND","startHandMode","endHandMode","initLoadImage","imagePath","imageName","loadImageFromURL","then","sizeValue","initializeImgUrl","resizeEditor","imageSize","clearUndoStack","_invoker","fire","eventNames","EXECUTE_COMMAND","historyNames","LOAD_IMAGE","undo","isEmptyUndoStack","deactivateAll","redo","isEmptyRedoStack","reset","_initHistory","delete","changeHelpButtonEnabled","removeActiveObject","activeObjectId","deleteAll","clearObjects","load","file","alert","URL","createObjectURL","loadImageFromFile","activeMenuEvent","_clearHistory","message","Promise","reject","download","dataURL","toDataURL","getImageName","blob","type","w","window","saveAs","split","pop","open","document","body","innerHTML","event","toggleHistoryMenu","zoomIn","toggleZoomButtonStatus","zoomOut","hand","offZoomInButtonStatus","_commonAction","changeColor","color","changeIconColor","addIcon","iconType","iconColor","setDrawingIcon","cancelAddIcon","clearIconType","changeSelectableAll","changeCursor","registerDefaultIcons","path","iconObj","registerIcons","registerCustomIcon","imgUrl","imagetracer","Imagetracer","imageToSVG","svgstr","match","svgPath","name","left","top","tracerDefaultOption","setDrawMode","settings","setColor","setBrush","addImageObject","revokeObjectURL","LOAD_MASK_IMAGE","applyFilter","maskObjId","changeTextStyle","styleObj","isSilent","setAngle","changeShape","changeShapeObject","setDrawingShape","shapeType","cropRect","getCropzoneRect","CROP","cancel","preset","presetType","setCropzoneRect","changeApplyButtonStatus","flipType","applying","options","hasFilter","removeFilter","setReAction","on","undoStackChanged","length","redoStackChanged","objectActivated","obj","id","indexOf","setShapeStatus","strokeColor","stroke","strokeWidth","fillColor","fill","setMaxStrokeValue","Math","min","width","height","changeStandbyMode","setTextStyleStateOnAction","setIconPickerColor","addText","pos","textColor","fontSize","fontStyle","fontWeight","underline","fontFamily","position","originPosition","styles","addObjectAfter","objectScaled","strokeValue","getStrokeValue","setStrokeValue","selectionCleared","count","TEXT","CROPPER","SHAPE","modeChange","menu","drawingMenuNames","_changeActivateMode","bind","discardSelection","mixin","prototype","ICON","componentNames","command","commandNames","ADD_ICON","execute","graphics","iconComp","getComponent","add","objectProps","undoData","object","getObject","remove","resolve","commandFactory","register","ADD_IMAGE_OBJECT","ADD_OBJECT","contains","rejectMessages","addedObject","noObject","ADD_SHAPE","shapeComp","ADD_TEXT","textComp","undoObject","textObject","FILTER","cachedUndoDataForSilent","makeUndoData","prevfilterOption","APPLY_FILTER","filterComp","maskObj","isType","invalidParameters","snippet","extend","isRedo","getOptions","setUndoData","setActiveObject","CHANGE_ICON_COLOR","targetObj","getColor","CHANGE_SELECTION","props","forEach","prop","setObjectProperties","datum","forEachOwnProperties","value","key","CHANGE_SHAPE","change","CHANGE_TEXT","getText","textObj","undoValue","CHANGE_TEXT_STYLE","setStyle","CLEAR_OBJECTS","objects","removeAll","FLIP","FLIP_IMAGE","flipComp","setting","getCurrentSetting","set","IMAGE_LOADER","loader","prevImage","getCanvasImage","prevImageWidth","prevImageHeight","objectItem","evented","image","newImage","oldWidth","oldHeight","newWidth","newHeight","REMOVE_FILTER","REMOVE_OBJECT","removeObjectById","RESIZE_CANVAS_DIMENSION","dimension","size","cssMaxWidth","cssMaxHeight","setCssMaxDimension","adjustCanvasDimension","ROTATION","rotationComp","getCurrentAngle","ROTATE_IMAGE","args","SET_OBJECT_POSITION","posInfo","objectId","getObjectProperties","setObjectPosition","renderAll","SET_OBJECT_PROPERTIES","MOUSE_MOVE_THRESHOLD","DEFAULT_OPTION","presetRatio","Cropper","_cropzone","_startX","_startY","_withShiftKey","_listeners","keydown","_onKeyDown","keyup","_onKeyUp","mousedown","_onFabricMouseDown","mousemove","_onFabricMouseMove","mouseup","_onFabricMouseUp","canvas","getCanvas","forEachObject","Cropzone","cornerSize","cornerColor","CROPZONE_DEFAULT_OPTIONS","cropSelectionStyle","discardActiveObject","selection","defaultCursor","fabric","util","addListener","cropzone","off","removeListener","visible","fEvent","target","coord","getPointer","e","x","y","pointer","abs","_calcRectDimensionFromPoint","canvasWidth","getWidth","canvasHeight","getHeight","startX","startY","listeners","containsCropzone","imageData","url","isValid","_getPresetPropertiesForCropSize","originalWidth","originalHeight","standardSize","getScale","orignalValue","scaleWidth","map","scaleHeight","keyCode","keyCodes","SHIFT","Component","filters","Image","Mask","Sharpen","Emboss","ColorFilter","Filter","sourceImg","_getSourceImage","imgFilter","_getFilter","_createFilter","_changeFilterValues","_apply","action","unsupportedOperation","_removeFilter","callback","push","applyFilters","filterObj","fabricType","_getFabricFilterType","ImageFilter","item","i","charAt","toUpperCase","slice","Flip","canvasImage","flipX","flipY","newSetting","isChangingFlipX","isChangingFlipY","setImageProperties","_invertAngle","_flipObjects","parseFloat","setCoords","current","FreeDrawing","FREE_DRAWING","oColor","Color","isDrawingMode","brush","freeDrawingBrush","toRgba","pathMap","arrow","Icon","_oColor","_pathMap","_type","_iconColor","_handlers","selectionStyle","fObjectOptions","SELECTION_STYLE","_createIcon","_icon","controlStyle","createObjectProperties","pathInfos","get","Path","_startPoint","events","moveOriginPointer","scaleX","scaleY","OBJECT_ADDED","imageOption","padding","crossOrigin","ImageLoader","img","promise","backgroundImage","setCanvasImage","_setBackgroundImage","oImage","loadImage","setBackgroundImage","getElement","loadingImageFailed","Line","LINE","_width","arrowType","head","tail","_arrowType","setHeadOption","points","_line","ArrowLine","_createLineEventObjectProperties","x2","y2","params","x1","y1","startPosition","endPosition","Rotation","oldAngle","oldImageCenter","getCenterPoint","newImageCenter","_rotateForEachObject","angleDiff","centerDiff","objCenter","radian","degreesToRadians","newObjCenter","rotatePoint","additionalAngle","SHAPE_INIT_OPTIONS","rx","ry","SHAPE_DEFAULT_OPTIONS","DEFAULT_TYPE","DEFAULT_WIDTH","DEFAULT_HEIGHT","makeFabricFillOption","createStaticCanvas","fillOption","fillType","extOption","newStaticCanvas","Shape","_shapeObj","_options","_isSelected","uniformScaling","extendOption","_extendOptions","shapeObj","_createInstance","objectProperties","_bindEventOnShape","_resetPositionFillFilter","unsupportedType","hasFillOption","fillProp","SHAPE_FILL_TYPE","fillImage","filterOption","COLOR","originalShapeObj","instance","Rect","Ellipse","Triangle","selectionStyles","self","added","resizeHelper","setOrigins","selected","deselected","modified","currentObj","adjustOriginToCenter","modifiedInGroup","activeSelection","_fillFilterRePositionInGroupSelection","moving","rotating","scaling","setCursor","resize","startPointX","startPointY","isRegular","KEY_CODES","patternSourceCanvas","originalAngle","originX","originY","addWithUpdate","realizeTransform","defaultStyles","resetStyles","textAlign","DBCLICK_TIME","Text","_defaultStyles","_selectedObj","_editingObj","select","_onFabricSelect","selectClear","_onFabricSelectClear","_onFabricScaling","textChanged","_onFabricTextChanged","_textarea","_ratio","_lastClickTime","Date","getTime","_editingObjInfos","isPrevEditing","adjustOriginPosition","setCanvasRatio","editStatus","getPointByOrigin","newText","_setInitPos","isExisty","autofocus","IText","enterEditing","selectAll","getActiveObject","activeObj","val","_getTextDecorationAdaptObject","textDecoration","state","canvasElement","getCanvasElement","cssWidth","parseInt","style","maxWidth","originWidth","linethrough","overline","ratio","getCanvasRatio","textareaStyle","ceil","setTimeout","editingObj","editingObjInfos","textContent","transWidth","transHeight","display","stamp","TEXT_CHANGED","scrollLeft","scrollTop","getSelectedObj","setSelectedInfo","_fireAddText","originPointer","clientPosition","clientX","clientY","newClickTime","_isDoubleClick","isEditing","TEXT_EDITING","DEFAULT_SCROLL_OPTION","opacity","selectable","hoverCursor","DEFAULT_VERTICAL_SCROLL_RATIO","SIZE","MARGIN","BORDER_RADIUS","DEFAULT_HORIZONTAL_SCROLL_RATIO","DEFAULT_ZOOM_LEVEL","ZOOM_CHANGED","OBJECT_MODIFIED","KEY_DOWN","KEY_UP","HAND_STARTED","HAND_STOPPED","Zoom","zoomArea","_centerPoints","zoomLevel","DEFAULT","startZoom","_onMouseDownWithZoomMode","moveZoom","_onMouseMoveWithZoomMode","stopZoom","_onMouseUpWithZoomMode","startHand","_onMouseDownWithHandMode","moveHand","_onMouseMoveWithHandMode","stopHand","_onMouseUpWithHandMode","zoomChanged","_changeScrollState","_startHandModeWithSpaceBar","_endHandModeWithSpaceBar","aspectRatio","_verticalScroll","_horizontalScroll","_startTextEditingHandler","_stopTextEditingHandler","isTextEditing","withSpace","SPACE","preventDefault","_changeObjectsEventedState","_startHandPoint","deltaX","deltaY","center","_getCenterPoint","_isMaxZoomLevel","prevZoomLevel","zoomToPoint","_fireZoomChanged","centerPoints","prevX","prevY","_isDefaultZoomLevel","point","setViewportTransform","_movePointOfZoom","viewport","tl","tr","bl","viewportWidth","viewportHeight","horizontalScrollWidth","horizontalScrollHeight","horizontalScrollLeft","horizontalScrollMargin","horizontalScrollBorderRadius","verticalScrollWidth","verticalScrollHeight","verticalScrollTop","verticalScrollMargin","verticalScrollBorderRadius","_addScrollBar","scrollBarTid","clearTimeout","calcViewportBoundaries","ZOOM_HELP_MENUS","COMMAND_HELP_MENUS","DELETE_HELP_MENUS","HELP_MENUS","SHAPE_TYPE","OBJ_TYPE","CROPZONE","filterType","VINTAGE","SEPIA2","REMOVE_COLOR","COLOR_FILTER","REMOVE_WHITE","BLEND_COLOR","BLEND","lockSkewingX","lockSkewingY","bringForward","hasRotatingPoint","hasBorders","lockScalingFlip","lockRotation","OBJECT_ACTIVATED","OBJECT_MOVED","OBJECT_SCALED","OBJECT_CREATED","OBJECT_ROTATED","ICON_CREATE_RESIZE","ICON_CREATE_END","ADD_OBJECT_AFTER","MOUSE_DOWN","MOUSE_UP","MOUSE_MOVE","REDO_STACK_CHANGED","UNDO_STACK_CHANGED","SELECTION_CLEARED","SELECTION_CREATED","AFTER_UNDO","AFTER_REDO","ADD_MASK_IMAGE","Z","Y","C","V","BACKSPACE","DEL","ARROW_DOWN","ARROW_UP","borderColor","transparentCorners","invalidDrawingMode","isLock","noActiveObject","rotation","defaultIconPath","defaultRotateRangeValues","realTimeEvent","max","defaultDrawRangeValues","defaultShapeStrokeValues","defaultTextRangeValues","defaultFilterRangeValues","tintOpacityRange","useDecimal","removewhiteDistanceRange","brightnessRange","noiseRange","pixelateRange","colorfilterThresholdRange","blurFilterRange","emptyCropRectValues","LEFT","TOP","WIDTH","HEIGHT","CropperDrawingMode","cropper","components","start","end","DrawingMode","FreeDrawingMode","freeDrawing","IconDrawingMode","LineDrawingMode","LINE_DRAWING","lineDrawing","ShapeDrawingMode","TextDrawingMode","ZoomDrawingMode","zoom","ARROW_ANGLE","CHEVRON_SIZE_RATIO","TRIANGLE_SIZE_RATIO","RADIAN_CONVERSION_VALUE","createClass","initialize","callSuper","_render","ctx","calcLinePoints","fromX","fromY","toX","toY","linePosition","lineWidth","_renderBasicLinePath","_drawDecoratorPath","_renderStroke","beginPath","moveTo","lineTo","_drawDecoratorPathType","_drawTrianglePath","_drawChevronPath","decorateSize","closePath","standardX","standardY","compareX","compareY","atan2","PI","rotatedPosition","changeAngle","getRotatePosition","distance","referencePosition","cos","sin","BaseFilter","threshold","applyTo","canvasEl","context","getContext","getImageData","data","filterColor","sourceFromHex","len","_getColor","_isOutsideThreshold","putImageData","color1","color2","diff","bytes","CORNER_TYPE_TOP_LEFT","CORNER_TYPE_TOP_RIGHT","CORNER_TYPE_MIDDLE_TOP","CORNER_TYPE_MIDDLE_LEFT","CORNER_TYPE_MIDDLE_RIGHT","CORNER_TYPE_MIDDLE_BOTTOM","CORNER_TYPE_BOTTOM_LEFT","CORNER_TYPE_BOTTOM_RIGHT","CORNER_TYPE_LIST","NOOP_FUNCTION","cornerTypeValid","selectedCorner","getScaleBasis","diffX","diffY","extendsOptions","_addEventHandler","canvasEventDelegation","eventName","delegationState","isRegistered","canvasEventTrigger","canvasEventRegister","eventTrigger","_onMoving","_onScaling","_renderCropzone","cropzoneDashLineWidth","cropzoneDashLineOffset","originalFlipX","originalFlipY","originalScaleX","originalScaleY","scale","_fillOuterRect","_fillInnerRect","_strokeBorder","lineDashWidth","lineDashOffset","fillStyle","_getCoordinates","save","restore","outerX","outerY","_caculateInnerPosition","strokeStyle","outer","halfWidth","halfHeight","setLineDash","maxLeft","maxTop","transform","corner","_calcScalingSizeFromPointer","isCornerTypeValid","_resizeCropZone","adjustRatioCropzoneSize","leftMaker","topMaker","maxHeight","scaleTo","maxScaleFactor","v","_getCropzoneRectInfo","getBoundingRect","rectTop","rectLeft","rectWidth","rectHeight","rectRight","rectBottom","resizeInfoMap","mt","ml","mr","mb","br","Convolute","matrix","BlendImage","pipelineState","maskCanvasEl","_createCanvasOfMask","maskCtx","_drawMask","_mapData","createCanvasElement","maskImg","translate","drawImage","imgHeight","imgWidth","sourceData","maskData","commands","create","actions","Command","types","messages","UN_IMPLEMENTATION","NO_COMPONENT_NAME","methodName","toLowerCase","func","isArray","isString","forEachArray","CustomEvents","DEFAULT_CSS_MAX_WIDTH","DEFAULT_CSS_MAX_HEIGHT","EXTRA_PX_FOR_PASTE","cssOnly","backstoreOnly","Graphics","element","targetObjectForCopyPaste","_objects","_canvas","_drawingMode","NORMAL","_drawingModeMap","_componentMap","_handler","onMouseDown","_onMouseDown","onObjectAdded","_onObjectAdded","onObjectRemoved","_onObjectRemoved","onObjectMoved","_onObjectMoved","onObjectScaled","_onObjectScaled","onObjectModified","_onObjectModified","onObjectRotated","_onObjectRotated","onObjectSelected","_onObjectSelected","onPathCreated","_onPathCreated","onSelectionCleared","_onSelectionCleared","onSelectionCreated","_onSelectionCreated","_setObjectCachingToFalse","_setCanvasElement","_createDrawingModeInstances","_createComponents","_attachCanvasEvents","wrapperEl","clear","parentNode","removeChild","theArgs","getObjects","includesBackground","isValidGroup","isEmpty","hasOwnProperty","_activeObject","activeObject","isSelection","group","Group","_addFabricObject","getObjectId","ActiveSelection","mode","option","_isSameDrawingMode","drawingModeInstance","_getDrawingModeInstance","getDrawingMode","resetZoom","changeVisibility","dataUrl","maxDimension","_calcMaxDimension","setCanvasCssDimension","setCanvasBackstoreDimension","centerObject","setDimensions","withRendering","_callbackAfterLoadingImageObject","fromURL","getCenter","getCroppedImageData","drawingMode","compName","setStates","registerPaths","cursorType","clone","keys","targetOrigin","centerOrigin","staticCanvas","StaticCanvas","enableRetinaScaling","modeName","Object","objectCaching","selectedElement","nodeType","querySelector","nodeName","createElement","appendChild","Canvas","containerClass","_register","getName","wScaleFactor","hScaleFactor","floor","centerPos","handler","_removeFabricObject","_lazyFire","items","paramsMaker","existEventDelegation","predefinedKeys","_createTextProperties","makeFillPropertyForUserEvent","targetObject","isGroupSelect","targetObjects","newTargetObject","_cloneObject","addedObjects","getActiveSelectionFromObjects","_cloneObjectItem","all","_copyFabricObjectForPaste","clonedObject","addExtraPx","isReverse","_copyFabricObject","getCanvasSize","rightEdge","bottomEdge","cloned","processForCopiedObject","ImageTracer","pathomit","ltres","qtres","strokewidth","viewbox","linefilter","desc","rightangleenhance","pal","r","g","b","a","versionnumber","optionpresets","default","corsenabled","colorsampling","numberofcolors","mincolorratio","colorquantcycles","layering","roundcoords","lcpr","qcpr","blurradius","blurdelta","posterized1","posterized2","curvy","sharp","detailed","smoothed","grayscale","fixedpalette","randomsampling1","randomsampling2","artistic1","artistic2","artistic3","artistic4","posterized3","pathscan_combined_lookup","gks","specpalette","checkoptions","imagedataToSVG","getImgdata","imgd","td","imagedataToTracedata","getsvgstring","ii","colorquantization","tracedata","layers","palette","array","colornum","tracedlayer","batchtracepaths","internodes","pathscan","layeringstep","ls","layercontainerid","drawLayers","bps","batchpathscan","bis","batchinternodes","batchtracelayers","ok","k","arr","idx","cd","cdl","ci","paletteacc","pixelnum","j","cnt","generatepalette","samplepalette","samplepalette2","blur","n","random","ni","sqrt","nj","vx","vy","rcnt","gcnt","bcnt","graystep","colorqnum","pow","colorstep","rndnum","ah","aw","n1","n2","n3","n4","n5","n6","n7","n8","cnum","layer","paths","pacnt","pcnt","px","py","h","dir","pathfinished","holepath","lookuprow","boundingbox","holechildren","t","isholepath","parentidx","parentbbox","parentcnt","boundingboxincludes","childbbox","bpaths","ins","palen","nextidx","nextidx2","previdx","previdx2","testrightangle","linesegment","getdirection","idx1","idx2","idx3","idx4","idx5","binternodes","segtype1","segtype2","seqend","smp","segments","concat","fitseq","seqstart","errorpoint","errorval","curvepass","dist2","pl","fitpoint","t1","t2","t3","cpx","cpy","x3","y3","splitpoint","internodepaths","btracedpaths","tracepath","btbis","places","Number","toFixed","lnum","pathnum","str","tosvgcolorstr","roundtodec","hcnt","hsmp","lcnt","svgpathstring","c","parentid","div","getElementById","radius","delta","d","racc","gacc","bacc","aacc","wacc","imgd2","thisgk","himgd","Uint8ClampedArray","src","onload","torgbastr","fillRect","setCachedUndoDataForDimension","getCachedUndoDataForDimension","makeSelectionUndoData","makeSelectionUndoDatum","cachedUndoDataForChangeDimension","undoDatumMaker","getFillImageFromShape","rePositionFilterTypeFillImage","makeFilterOptionFromFabricImage","makeFillPatternForFilter","resetFillPatternCanvas","reMakePatternImageSource","getCachedCanvasImageElement","FILTER_OPTION_MAP","pixelate","POSITION_DIMENSION_MAP","FILTER_NAME_VALUE_MAP","cachedCanvasImageElement","rotatedShapeCornerDimension","getRotatedDimension","right","bottom","diffLeft","diffTop","cropX","cropY","fillImageMaxSize","calculateFillImageDimensionOutsideCanvas","imageObject","overflowAreaPositionFixer","outDistance","imageLeft","imageTop","calculateDistanceOverflowPart","calculateDimensionLeftTopEdge","calculateDimensionRightBottomEdge","insideCanvasRealImageWidth","insideCanvasRealImageHeight","cropDistance2","cropDistance","compareSize","copiedCanvasElement","makeFillImage","fabricProperty","Pattern","source","repeat","innerImage","newFillImage","toCanvasElement","shapePointNavigation","getShapeEdgePoint","shapeNeighborPointNavigation","linePointsOutsideCanvas","calculateLinePointsOutsideCanvas","reatAngles","calculateLineAngleOfOutsideCanvas","startPointIndex","diffPosition","getReversePositionForFlip","rotationChangePoint1","rotationChangePoint2","isForward","isReverseLeftPositionForFlip","isReverseTopPositionForFlip","minimumPoint","minimumPointIndex","index","endPointIndex1","endPointIndex2","linePointsOfOneVertexIndex","horizontalVerticalAngle","pointIndex","startPoint","endPoint","ax","ay","bx","by","cx","cy","dx","dy","currentCanvasImageAngle","fabricFilterClassName","DIVISOR","rect","circle","triangle","DIMENSION_KEYS","setStartPoint","originKey","substring","origins","getPositionsOfRotatedOrigin","origin","sx","sy","hasCenterOrigin","adjustOriginByStartPoint","centerPoint","originPositions","adjustOriginByMovingPointer","setPositionByOrigin","adjustDimensionOnScaling","dimensionKeys","maxScale","hasControls","adjustDimensionOnMouseMove","divisor","isTriangle","leftTopPoint","rightTopPoint","rightBottomPoint","leftBottomPoint","lt","rt","rb","lb","isScaling","isUndefined","wrapper","includeUI","usageStatistics","UIOption","UI","setUiDefaultSelectionStyle","Invoker","getEditorArea","_onObjectActivated","objectMoved","objectRotated","objectAdded","objectModified","createdPath","_onCreatedPath","_onAddText","addObject","_onAddObject","textEditing","_onTextEditing","_onTextChanged","iconCreateResize","_onIconCreateResize","iconCreateEnd","_onIconCreateEnd","_selectionCleared","selectionCreated","_selectionCreated","_attachInvokerEvents","_attachGraphicsEvents","_attachDomEvents","_setSelectionStyle","applyCropSelectionStyle","applyGroupSelectionStyle","initCanvas","enableGLFiltering","setSelectionStyle","setCropSelectionStyle","eventTarget","addEventListener","removeEventListener","ctrlKey","metaKey","isModifierKey","resetTargetObjectForCopyPaste","pasteObject","clearRedoStack","isDeleteKey","isRemoveReady","isReadyRemoveObject","getActiveObjectIdForRemove","removeObject","pushUndoStack","initHistory","clearHistory","commandName","executeSilent","iterationCount","imgFile","_flip","_rotate","setIconStyle","_setPositions","executeMethodName","_pushAddObjectCommand","_pushModifyObjectCommand","infos","_detachDomEvents","destroy","centerPosition","keyValue","getObjectPosition","createMessage","errorMessage","errorTypes","executeCallback","undoCallback","Error","apply","getEditor","isFunction","_undoStack","_redoStack","_isLocked","_isSilent","lock","unlock","pushRedoStack","_invokeExecution","_fireUndoStackChanged","_invokeUndo","_fireRedoStackChanged","Element","matches","msMatchesSelector","webkitMatchesSelector","closest","s","el","documentElement","parentElement","createElementNS","view","classListProp","protoProp","elemCtrProto","objCtr","strTrim","String","trim","replace","arrIndexOf","Array","DOMEx","code","DOMException","checkTokenAndGetIndex","classList","token","test","call","ClassList","elem","trimmedClasses","getAttribute","classes","_updateClassName","setAttribute","toString","classListProto","classListGetter","tokens","arguments","l","updated","splice","toggle","force","method","join","defineProperty","classListPropDesc","enumerable","configurable","ex","number","undefined","__defineGetter__","testElement","createMethod","original","DOMTokenList","_toggle","cache","checkUseElems","tid","debouncedCheck","unobserveChanges","observeChanges","observer","MutationObserver","observe","childList","subtree","attributes","disconnect","ignore","createRequest","getOrigin","loc","protocol","href","host","Request","origin2","XMLHttpRequest","location","withCredentials","XDomainRequest","xlinkNS","base","bcr","fallback","hash","inProgressCount","isHidden","uses","xhr","observeIfDone","attrUpdateFunc","spec","useEl","setAttributeNS","hasAttribute","onloadFunc","svg","responseText","getElementsByTagName","overflow","insertBefore","firstChild","onErrorTimeout","onerror","ontimeout","getBoundingClientRect","getAttributeNS","send","abort","winLoad","readyState","SUB_UI_COMPONENT","Crop","Rotate","Draw","BI_EXPRESSION_MINSIZE_WHEN_TOP_POSITION","HISTORY_MENU","HISTORY_PANEL_CLASS_NAME","CLASS_NAME_ON","ZOOM_BUTTON_TYPE","ZOOM_IN","Ui","_initializeOption","_actions","uiSize","_locale","Locale","locale","theme","Theme","eventHandler","_submenuChangeTransection","_selectedElement","_mainElement","_editorElementWrap","_editorElement","_menuBarElement","_subMenuElement","_makeUiElement","_setUiSize","_initMenuEvent","_makeSubMenu","_attachHistoryEvent","_attachZoomEvent","_removeUiEvent","_destroyAllMenu","cornerStyle","cornerStrokeColor","_getCanvasMaxDimension","editorElementStyle","menuBarPosition","_setEditorPosition","selectElementClassList","offsetWidth","targetClassList","_buttonElements","zoomInClassList","enabled","handClassList","buttonType","enableStatus","buttonClassList","menuIconPath","initMenu","elementDimension","menuName","SubComponentClass","$0","_makeMenuElement","makeSvgIcon","makeMenSvgIconSet","_addHistory","_selectPrevHistory","_selectNextHistory","changeHandButtonStatus","selector","biImage","getStyle","loadButtonStyle","downloadButtonStyle","commonStyle","headerStyle","submenuStyle","_helpMenuBarElement","querySelectorAll","_addHelpMenus","_historyMenu","History","_activateZoomMenus","helpMenuWithPartition","_makeHelpMenuWithPartition","_makeMenuPartitionElement","partitionElement","partitionInnerElement","className","useIconTypes","menuType","btnElement","menuItemHtml","_addTooltipAttribute","helpName","historyTitle","init","prev","next","historyButtonClassList","tooltipName","localize","files","addEvent","_addMainMenuEvent","_addSubMenuEvent","_addHelpActionEvent","_addDownloadEvent","_addMenuEvent","_initMenu","_removeHelpActionEvent","_removeDownloadEvent","_removeLoadEvent","_removeMainMenuEvent","removeEvent","loadImageInfo","_getLoadImage","_addLoadEvent","gridVisual","grid","_editorContainerElement","_changeMenu","changeStartMode","evt","createEvent","initEvent","dispatchEvent","registerDefaultIcon","scrollHeight","offsetHeight","scrollWidth","subMenuElement","templateHtml","status","_els","defaultPresetButton","_removeEvent","_applyEventHandler","_cancelEventHandler","cropzonePreset","_cropzonePresetEventHandler","button","_setPresetButtonActive","presetButton","Submenu","DRAW_OPACITY","lineSelectButton","drawColorPicker","Colorpicker","toggleDirection","drawRange","Range","slider","input","changeDrawType","_changeDrawType","_changeDrawColor","_changeDrawRange","lineType","getButtonType","PICKER_CONTROL_HEIGHT","BLEND_OPTIONS","FILTER_OPTIONS","filterNameMap","invert","sepia","sharpen","emboss","removeWhite","brightness","contrast","saturation","vintage","polaroid","noise","colorFilter","tint","multiply","blend","hue","gamma","RANGE_INSTANCE_NAMES","COLORPICKER_INSTANCE_NAMES","selectBoxShow","checkedMap","_makeControlElement","_destroyToolInstance","filterCheckElement","filterNameCamelCase","instanceName","blendType","changeBlendFilter","changeFilterState","filterName","_changeFilterState","changeFilterStateForRange","isLast","blandTypeClick","stopPropagation","filterBlendColor","filterMultiplyColor","filterTintColor","tintOpacity","colorPickerChangeShow","changedFilterInfos","_getFilterNameFromOptions","isRemove","_setFilterState","checked","blocksize","alpha","useAlpha","checkboxGroup","_getFilterOption","blurRange","FILTER_RANGE","_pickerWithRange","pickerControl","_pickerWithSelectbox","colorPickerControls","rangeWrap","rangeLabel","selectlistWrap","selectlist","optionlist","_makeSelectOptionList","_drawSelectOptionList","_pickerWithSelectboxForAddEvent","optionElement","optionValue","fireEvent","selectOption","flipStatus","flipButton","changeFlip","_changeFlip","flipClassList","historyClassName","selectedClassName","disabledClassName","menuElement","_eventHandler","_historyIndex","getListLength","detail","_hasDisabledItem","deleteListItemElement","html","makeListItemElement","pushListItemElement","_selectItem","_clickHistoryItem","listElement","removeClass","addClass","_addHistoryEventListener","_removeHistoryEventListener","Panel","_iconMap","registerIconButton","addIconButton","iconColorpicker","registerIcon","_registerIconHandler","_addIconHandler","_changeColorHandler","isSupportFileApi","applyButton","maskImageButton","loadMaskFile","_loadMaskFile","applyMask","_applyMask","panelElement","_makePanelElement","_makeListElement","panel","list","listItem","CLOCKWISE","COUNTERCLOCKWISE","_value","rotateButton","rotateRange","resultAngle","_setRangeBarRatio","rotationAngleChanged","_changeRotateForButton","_changeRotateForRange","rotateType","rotateAngle","clockwise","counterclockwise","newAngle","isRotatable","SHAPE_DEFAULT_OPTION","shapeSelectButton","shapeColorButton","strokeRange","fillColorpicker","strokeColorpicker","shapeTypeSelected","_changeShapeHandler","_changeStrokeRangeHandler","_changeFillColorHandler","_changeStrokeColorHandler","maxValue","strokeMaxValue","trigger","currentTarget","_makeSubMenuElement","selectName","occurredControl","hide","buttonNames","RegExp","iconStyle","iconSubMenu","subMenuLabelActive","subMenuLabelNormal","subMenuRangeTitle","submenuPartitionVertical","submenuPartitionHorizontal","submenuCheckbox","submenuRangePointer","submenuRangeValue","submenuColorpickerTitle","submenuColorpickerButton","submenuRangeBar","submenuRangeSubbar","submenuDisabledRangePointer","submenuDisabledRangeBar","submenuDisabledRangeSubbar","submenuIconSize","menuIconSize","biSize","menuIconStyle","submenuIconStyle","normal","active","hover","disabled","effect","bold","italic","align","textEffectButton","textAlignButton","textColorpicker","textRange","setTextEffect","_setTextEffectHandler","setTextAlign","_setTextAlignHandler","_changeTextRnageHandler","textStyle","setEffectState","setAlignState","effectName","effectValue","styleType","customTheme","_changeToObject","standardTheme","_styleMaker","_loadDefaultSvgIcon","firstProperty","_makeCssText","vertical","borderLeft","horizontal","borderBottom","backgroundColor","submenuLabelStyle","submenuPartitionStyle","styleOptions","styleObject","keyExplode","property","subProperty","converterStack","_toUnderScore","targetString","$1","parser","DOMParser","dom","parseFromString","isSubmenu","iconStyleInfo","svgIconPrefix","_makeSvgIconPrefix","iconName","svgIconClassName","_makeIconClassName","_makeSvgItem","PICKER_COLOR","colorpickerElement","defaultColor","_show","_colorpickerElement","_toggleDirection","_makePickerButtonElement","_makePickerLayerElement","_color","picker","tuiColorPicker","container","pickerElement","_addEvent","colorElement","title","label","_changeColorElement","pickerToggle","_pickerToggleEventHandler","pickerHide","isInPickerControl","_isElementInColorPickerControl","_isPaletteButton","_setPickerControlPosition","halfPickerWidth","clientWidth","INPUT_FILTER_REGEXP","rangeElements","rangeElement","rangeInputElement","_drawRangeElement","rangeWidth","_getRangeWidth","_min","_max","_useDecimal","_absMax","startChangingSlide","_startChangingSlide","stopChangingSlide","_stopChangingSlide","changeSlide","_changeSlide","changeSlideFinally","_changeSlideFinally","changeInput","_changeValueWithInput","changeInputFinally","changeInputWithArrow","_changeValueWithInputKeyEvent","_addClickEvent","_addDragEvent","_addInputEvent","_removeClickEvent","_removeDragEvent","_removeInputEvent","getElementWidth","getComputedStyle","bar","subbar","_valueUpDownForKeyEvent","unChanged","clampValue","step","stringValue","_filterForInputText","waitForChange","isNaN","changePosition","screenX","firstPosition","touchPx","firstLeft","resultValue","isValueChanged","offsetX","inputValue","absValue","leftPosition","clamp","keyMirror","makeStyleText","getProperties","toInteger","toCamelCase","getRgb","sendHostName","styleLoad","getSelector","base64ToBlob","fixFloatingPoint","assignmentForDestroy","cls","changeOrigin","flipObject","setCustomProperty","getCustomProperty","capitalizeString","includes","getFillTypeFromOption","getFillTypeFromObject","isShape","getObjectType","isSilentCommand","getHistoryTitle","getHelpMenuBarPosition","isEmptyCropzone","FLOATING_POINT_DIGIT","CSS_PREFIX","hostnameSent","minValue","styleStr","File","FileList","FileReader","styleBuffer","tagId","linkElement","styleData","encodeURIComponent","targetElement","rImageType","mimeString","raw","uInt8Array","header","imageType","atob","rawLength","Uint8Array","charCodeAt","Blob","prefix","fObject","customProps","propNames","resultObject","propName","targetArray","compareValue","toStartOfCapital","getFilterType","historyInfo","first"],"mappings":";;;;;;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iCAAiC;AACjC,CAAC;AACD,O;QCVA;QACA;;QAEA;QACA;;QAEA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;;QAEA;QACA;;QAEA;QACA;;QAEA;QACA;QACA;;;QAGA;QACA;;QAEA;QACA;;QAEA;QACA;QACA;QACA,0CAA0C,gCAAgC;QAC1E;QACA;;QAEA;QACA;QACA;QACA,wDAAwD,kBAAkB;QAC1E;QACA,iDAAiD,cAAc;QAC/D;;QAEA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA,yCAAyC,iCAAiC;QAC1E,gHAAgH,mBAAmB,EAAE;QACrI;QACA;;QAEA;QACA;QACA;QACA,2BAA2B,0BAA0B,EAAE;QACvD,iCA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AACA;AACA;;;;;;;;;;;;AClCA,gBAAgB,mBAAO,CAAC,kGAAgC;;AAExD;;;;;;;;;;;;ACFA,iBAAiB,mBAAO,CAAC,wFAA2B;;AAEpD;;;;;;;;;;;;ACFA,aAAa,mBAAO,CAAC,4EAAqB;AAC1C,gBAAgB,mBAAO,CAAC,kGAAgC;;AAExD;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,CAAC;AACD;AACA;AACA;AACA;AACA;AACA;;AAEA;;;;;;;;;;;;ACnBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;;ACTa;AACb,aAAa,mBAAO,CAAC,4EAAqB;AAC1C,+BAA+B,mBAAO,CAAC,oIAAiD;AACxF,eAAe,mBAAO,CAAC,kFAAwB;AAC/C,WAAW,mBAAO,CAAC,wEAAmB;AACtC,WAAW,mBAAO,CAAC,0GAAoC;AACvD,kCAAkC,mBAAO,CAAC,4HAA6C;AACvF,UAAU,mBAAO,CAAC,sEAAkB;;AAEpC;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP,KAAK;AACL;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,sFAAsF;;AAEtF,iEAAiE;AACjE;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA,KAAK;;AAEL;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA,+DAA+D;AAC/D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;ACjGA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;;;;;;;;;;;;ACNA,gBAAgB,mBAAO,CAAC,oFAAyB;;AAEjD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAC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kDAAkD;;AAElD;;;;;;;;;;;;ACNA,cAAc,mBAAO,CAAC,8EAAsB;AAC5C,YAAY,mBAAO,CAAC,wFAA2B;;AAE/C;AACA,qEAAqE;AACrE,CAAC;AACD;AACA;AACA;AACA,CAAC;;;;;;;;;;;;ACTD,eAAe,mBAAO,CAAC,kFAAwB;AAC/C,gBAAgB,mBAAO,CAAC,oFAAyB;AACjD,sBAAsB,mBAAO,CAAC,kGAAgC;;AAE9D;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;ACZA,gBAAgB,mBAAO,CAAC,oFAAyB;AACjD,6BAA6B,mBAAO,CAAC,gHAAuC;;AAE5E,sBAAsB,kBAAkB;AACxC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;AC1BA,aAAa,mBAAO,CAAC,4EAAqB;AAC1C,YAAY,mBAAO,CAAC,0EAAoB;AACxC,cAAc,mBAAO,CAAC,sFAA0B;AAChD,WAAW,mBAAO,CAAC,0GAAoC;AACvD,WAAW,mBAAO,CAAC,wEAAmB;AACtC,oBAAoB,mBAAO,CAAC,8GAAsC;AAClE,aAAa,mBAAO,CAAC,0FAA4B;;AAEjD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;A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AACA;AACA;AACA;AACA;AACA;AACA;AACA,sBAAsB,cAAc,eAAe,cAAc;AACjE;AACA;AACA;AACA,qCAAqC,cAAc;AACnD,CAAC;;AAED;AACA,yDAAyD,cAAc;AACvE,CAAC;;AAED;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,oCAAoC;AACpC;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW;AACX;AACA,WAAW;AACX,SAAS;AACT,OAAO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG,eAAe;AAClB;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT,OAAO;AACP;AACA;AACA;AACA;AACA,GAAG;AACH;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,KAAK;AACL,GAAG;AACH;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,uBAAuB;AACvB;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,OAAO;AACP,KAAK;AACL;AACA;AACA;AACA;AACA,GAAG;AACH,6BAA6B,cAAc;AAC3C;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA,KAAK,GAAG,eAAe;;AAEvB;AACA,wCAAwC,+CAA+C;AACvF;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;;AAEA,GAAG,2CAA2C;AAC9C;AACA,CAAC;;AAED;AACA;;AAEA;;AAEA;AACA,GAAG,8CAA8C;AACjD;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;;AAED,GAAG,yDAAyD;AAC5D;AACA;AACA;AACA;AACA;AACA,CAAC;;AAED,GAAG,2DAA2D;AAC9D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT,OAAO;AACP;AACA,KAAK;AACL;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP,KAAK;AACL;AACA;AACA;AACA,CAAC;;;;;;;;;;;;;AC1XY;AACb,aAAa,mBAAO,CAAC,gGAA+B;AACpD,0BAA0B,mBAAO,CAAC,4FAA6B;AAC/D,qBAAqB,mBAAO,CAAC,8FAA8B;;AAE3D;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA,CAAC;AACD;AACA;AACA;AACA;AACA,sCAAsC;AACtC;AACA;AACA,UAAU;AACV,CAAC;;;;;;;;;;;;;AC5BY;AACb,QAAQ,mBAAO,CAAC,4EAAqB;AACrC,kBAAkB,mBAAO,CAAC,sFAA0B;AACpD,qBAAqB,mBAAO,CAAC,8GAAsC;AACnE,qBAAqB,mBAAO,CAAC,8GAAsC;AACnE,aAAa,mBAAO,CAAC,0FAA4B;AACjD,qBAAqB,mBAAO,CAAC,4GAAqC;AAClE,+BAA+B,mBAAO,CAAC,oHAAyC;AAChF,cAAc,mBAAO,CAAC,8EAAsB;AAC5C,kCAAkC,mBAAO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,MAChCpB,IADgC,GACHoB,QADG,CAChCpB,IADgC;AAAA,MAC1BC,GAD0B,GACHmB,QADG,CAC1BnB,GAD0B;AAAA,MACrBkD,KADqB,GACH/B,QADG,CACrB+B,KADqB;AAAA,MACdC,MADc,GACHhC,QADG,CACdgC,MADc;AAAA,MAEhConB,IAFgC,GAEHD,2BAFG,CAEhCC,IAFgC;AAAA,MAE1BC,GAF0B,GAEHF,2BAFG,CAE1BE,GAF0B;AAAA,MAErBC,KAFqB,GAEHH,2BAFG,CAErBG,KAFqB;AAAA,MAEdC,MAFc,GAEHJ,2BAFG,CAEdI,MAFc;;;AAIxC,SAAO3qB,SAASwqB,IAAT,IAAiBvqB,QAAQwqB,GAAzB,IAAgCtnB,UAAUunB,KAA1C,IAAmDtnB,WAAWunB,MAArE;AACD,C;;;;;;;;;;;ACvhBD,2uwB;;;;;;;;;;;ACAA,oD;;;;;;;;;;;ACAA,8D;;;;;;;;;;;ACAA,8D","file":"tui-image-editor.js","sourcesContent":["(function webpackUniversalModuleDefinition(root, factory) {\n\tif(typeof exports === 'object' && typeof module === 'object')\n\t\tmodule.exports = factory(require(\"fabric\")[\"fabric\"], require(\"tui-code-snippet\"), require(\"tui-color-picker\"));\n\telse if(typeof define === 'function' && define.amd)\n\t\tdefine([\"fabric\", \"tui-code-snippet\", \"tui-color-picker\"], factory);\n\telse if(typeof exports === 'object')\n\t\texports[\"ImageEditor\"] = factory(require(\"fabric\")[\"fabric\"], require(\"tui-code-snippet\"), require(\"tui-color-picker\"));\n\telse\n\t\troot[\"tui\"] = root[\"tui\"] || {}, root[\"tui\"][\"ImageEditor\"] = factory(root[\"fabric\"], root[\"tui\"][\"util\"], root[\"tui\"][\"colorPicker\"]);\n})(window, function(__WEBPACK_EXTERNAL_MODULE_fabric__, __WEBPACK_EXTERNAL_MODULE_tui_code_snippet__, __WEBPACK_EXTERNAL_MODULE_tui_color_picker__) {\nreturn "," \t// The module cache\n \tvar installedModules = {};\n\n \t// The require function\n \tfunction __webpack_require__(moduleId) {\n\n \t\t// Check if module is in cache\n \t\tif(installedModules[moduleId]) {\n \t\t\treturn installedModules[moduleId].exports;\n \t\t}\n \t\t// Create a new module (and put it into the cache)\n \t\tvar module = installedModules[moduleId] = {\n \t\t\ti: moduleId,\n \t\t\tl: false,\n \t\t\texports: {}\n \t\t};\n\n \t\t// Execute the module function\n \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n \t\t// Flag the module as loaded\n \t\tmodule.l = true;\n\n \t\t// Return the exports of the module\n \t\treturn module.exports;\n \t}\n\n\n \t// expose the modules object (__webpack_modules__)\n \t__webpack_require__.m = modules;\n\n \t// expose the module cache\n \t__webpack_require__.c = installedModules;\n\n \t// define getter function for harmony exports\n \t__webpack_require__.d = function(exports, name, getter) {\n \t\tif(!__webpack_require__.o(exports, name)) {\n \t\t\tObject.defineProperty(exports, name, { enumerable: true, get: getter });\n \t\t}\n \t};\n\n \t// define __esModule on exports\n \t__webpack_require__.r = function(exports) {\n \t\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n \t\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n \t\t}\n \t\tObject.defineProperty(exports, '__esModule', { value: true });\n \t};\n\n \t// create a fake namespace object\n \t// mode & 1: value is a module id, require it\n \t// mode & 2: merge all properties of value into the ns\n \t// mode & 4: return value when already ns object\n \t// mode & 8|1: behave like require\n \t__webpack_require__.t = function(value, mode) {\n \t\tif(mode & 1) value = __webpack_require__(value);\n \t\tif(mode & 8) return value;\n \t\tif((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;\n \t\tvar ns = Object.create(null);\n \t\t__webpack_require__.r(ns);\n \t\tObject.defineProperty(ns, 'default', { enumerable: true, value: value });\n \t\tif(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));\n \t\treturn ns;\n \t};\n\n \t// getDefaultExport function for compatibility with non-harmony modules\n \t__webpack_require__.n = function(module) {\n \t\tvar getter = module && module.__esModule ?\n \t\t\tfunction getDefault() { return module['default']; } :\n \t\t\tfunction getModuleExports() { return module; };\n \t\t__webpack_require__.d(getter, 'a', getter);\n \t\treturn getter;\n \t};\n\n \t// Object.prototype.hasOwnProperty.call\n \t__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };\n\n \t// __webpack_public_path__\n \t__webpack_require__.p = \"/dist\";\n\n\n \t// Load entry module and return exports\n \treturn __webpack_require__(__webpack_require__.s = \"./src/index.js\");\n","require('../../modules/es.object.to-string');\nrequire('../../modules/es.string.iterator');\nrequire('../../modules/web.dom-collections.iterator');\nrequire('../../modules/es.promise');\nrequire('../../modules/es.promise.all-settled');\nrequire('../../modules/es.promise.finally');\nvar path = require('../../internals/path');\n\nmodule.exports = path.Promise;\n","var parent = require('../../es/promise');\nrequire('../../modules/esnext.aggregate-error');\n// TODO: Remove from `core-js@4`\nrequire('../../modules/esnext.promise.all-settled');\nrequire('../../modules/esnext.promise.try');\nrequire('../../modules/esnext.promise.any');\n\nmodule.exports = parent;\n","module.exports = function (it) {\n if (typeof it != 'function') {\n throw TypeError(String(it) + ' is not a function');\n } return it;\n};\n","var isObject = require('../internals/is-object');\n\nmodule.exports = function (it) {\n if (!isObject(it) && it !== null) {\n throw TypeError(\"Can't set \" + String(it) + ' as a prototype');\n } return it;\n};\n","module.exports = function () { /* empty */ };\n","module.exports = function (it, Constructor, name) {\n if (!(it instanceof Constructor)) {\n throw TypeError('Incorrect ' + (name ? name + ' ' : '') + 'invocation');\n } return it;\n};\n","var isObject = require('../internals/is-object');\n\nmodule.exports = function (it) {\n if (!isObject(it)) {\n throw TypeError(String(it) + ' is not an object');\n } return it;\n};\n","var toIndexedObject = require('../internals/to-indexed-object');\nvar toLength = require('../internals/to-length');\nvar toAbsoluteIndex = require('../internals/to-absolute-index');\n\n// `Array.prototype.{ indexOf, includes }` methods implementation\nvar createMethod = function (IS_INCLUDES) {\n return function ($this, el, fromIndex) {\n var O = toIndexedObject($this);\n var length = toLength(O.length);\n var index = toAbsoluteIndex(fromIndex, length);\n var value;\n // Array#includes uses SameValueZero equality algorithm\n // eslint-disable-next-line no-self-compare\n if (IS_INCLUDES && el != el) while (length > index) {\n value = O[index++];\n // eslint-disable-next-line no-self-compare\n if (value != value) return true;\n // Array#indexOf ignores holes, Array#includes - not\n } else for (;length > index; index++) {\n if ((IS_INCLUDES || index in O) && O[index] === el) return IS_INCLUDES || index || 0;\n } return !IS_INCLUDES && -1;\n };\n};\n\nmodule.exports = {\n // `Array.prototype.includes` method\n // https://tc39.github.io/ecma262/#sec-array.prototype.includes\n includes: createMethod(true),\n // `Array.prototype.indexOf` method\n // https://tc39.github.io/ecma262/#sec-array.prototype.indexof\n indexOf: createMethod(false)\n};\n","var anObject = require('../internals/an-object');\n\n// call something on iterator step with safe closing on error\nmodule.exports = function (iterator, fn, value, ENTRIES) {\n try {\n return ENTRIES ? fn(anObject(value)[0], value[1]) : fn(value);\n // 7.4.6 IteratorClose(iterator, completion)\n } catch (error) {\n var returnMethod = iterator['return'];\n if (returnMethod !== undefined) anObject(returnMethod.call(iterator));\n throw error;\n }\n};\n","var wellKnownSymbol = require('../internals/well-known-symbol');\n\nvar ITERATOR = wellKnownSymbol('iterator');\nvar SAFE_CLOSING = false;\n\ntry {\n var called = 0;\n var iteratorWithReturn = {\n next: function () {\n return { done: !!called++ };\n },\n 'return': function () {\n SAFE_CLOSING = true;\n }\n };\n iteratorWithReturn[ITERATOR] = function () {\n return this;\n };\n // eslint-disable-next-line no-throw-literal\n Array.from(iteratorWithReturn, function () { throw 2; });\n} catch (error) { /* empty */ }\n\nmodule.exports = function (exec, SKIP_CLOSING) {\n if (!SKIP_CLOSING && !SAFE_CLOSING) return false;\n var ITERATION_SUPPORT = false;\n try {\n var object = {};\n object[ITERATOR] = function () {\n return {\n next: function () {\n return { done: ITERATION_SUPPORT = true };\n }\n };\n };\n exec(object);\n } catch (error) { /* empty */ }\n return ITERATION_SUPPORT;\n};\n","var toString = {}.toString;\n\nmodule.exports = function (it) {\n return toString.call(it).slice(8, -1);\n};\n","var TO_STRING_TAG_SUPPORT = require('../internals/to-string-tag-support');\nvar classofRaw = require('../internals/classof-raw');\nvar wellKnownSymbol = require('../internals/well-known-symbol');\n\nvar TO_STRING_TAG = wellKnownSymbol('toStringTag');\n// ES3 wrong here\nvar CORRECT_ARGUMENTS = classofRaw(function () { return arguments; }()) == 'Arguments';\n\n// fallback for IE11 Script Access Denied error\nvar tryGet = function (it, key) {\n try {\n return it[key];\n } catch (error) { /* empty */ }\n};\n\n// getting tag from ES6+ `Object.prototype.toString`\nmodule.exports = TO_STRING_TAG_SUPPORT ? classofRaw : function (it) {\n var O, tag, result;\n return it === undefined ? 'Undefined' : it === null ? 'Null'\n // @@toStringTag case\n : typeof (tag = tryGet(O = Object(it), TO_STRING_TAG)) == 'string' ? tag\n // builtinTag case\n : CORRECT_ARGUMENTS ? classofRaw(O)\n // ES3 arguments fallback\n : (result = classofRaw(O)) == 'Object' && typeof O.callee == 'function' ? 'Arguments' : result;\n};\n","var fails = require('../internals/fails');\n\nmodule.exports = !fails(function () {\n function F() { /* empty */ }\n F.prototype.constructor = null;\n return Object.getPrototypeOf(new F()) !== F.prototype;\n});\n","'use strict';\nvar IteratorPrototype = require('../internals/iterators-core').IteratorPrototype;\nvar create = require('../internals/object-create');\nvar createPropertyDescriptor = require('../internals/create-property-descriptor');\nvar setToStringTag = require('../internals/set-to-string-tag');\nvar Iterators = require('../internals/iterators');\n\nvar returnThis = function () { return this; };\n\nmodule.exports = function (IteratorConstructor, NAME, next) {\n var TO_STRING_TAG = NAME + ' Iterator';\n IteratorConstructor.prototype = create(IteratorPrototype, { next: createPropertyDescriptor(1, next) });\n setToStringTag(IteratorConstructor, TO_STRING_TAG, false, true);\n Iterators[TO_STRING_TAG] = returnThis;\n return IteratorConstructor;\n};\n","var DESCRIPTORS = require('../internals/descriptors');\nvar definePropertyModule = require('../internals/object-define-property');\nvar createPropertyDescriptor = require('../internals/create-property-descriptor');\n\nmodule.exports = DESCRIPTORS ? function (object, key, value) {\n return definePropertyModule.f(object, key, createPropertyDescriptor(1, value));\n} : function (object, key, value) {\n object[key] = value;\n return object;\n};\n","module.exports = function (bitmap, value) {\n return {\n enumerable: !(bitmap & 1),\n configurable: !(bitmap & 2),\n writable: !(bitmap & 4),\n value: value\n };\n};\n","'use strict';\nvar $ = require('../internals/export');\nvar createIteratorConstructor = require('../internals/create-iterator-constructor');\nvar getPrototypeOf = require('../internals/object-get-prototype-of');\nvar setPrototypeOf = require('../internals/object-set-prototype-of');\nvar setToStringTag = require('../internals/set-to-string-tag');\nvar createNonEnumerableProperty = require('../internals/create-non-enumerable-property');\nvar redefine = require('../internals/redefine');\nvar wellKnownSymbol = require('../internals/well-known-symbol');\nvar IS_PURE = require('../internals/is-pure');\nvar Iterators = require('../internals/iterators');\nvar IteratorsCore = require('../internals/iterators-core');\n\nvar IteratorPrototype = IteratorsCore.IteratorPrototype;\nvar BUGGY_SAFARI_ITERATORS = IteratorsCore.BUGGY_SAFARI_ITERATORS;\nvar ITERATOR = wellKnownSymbol('iterator');\nvar KEYS = 'keys';\nvar VALUES = 'values';\nvar ENTRIES = 'entries';\n\nvar returnThis = function () { return this; };\n\nmodule.exports = function (Iterable, NAME, IteratorConstructor, next, DEFAULT, IS_SET, FORCED) {\n createIteratorConstructor(IteratorConstructor, NAME, next);\n\n var getIterationMethod = function (KIND) {\n if (KIND === DEFAULT && defaultIterator) return defaultIterator;\n if (!BUGGY_SAFARI_ITERATORS && KIND in IterablePrototype) return IterablePrototype[KIND];\n switch (KIND) {\n case KEYS: return function keys() { return new IteratorConstructor(this, KIND); };\n case VALUES: return function values() { return new IteratorConstructor(this, KIND); };\n case ENTRIES: return function entries() { return new IteratorConstructor(this, KIND); };\n } return function () { return new IteratorConstructor(this); };\n };\n\n var TO_STRING_TAG = NAME + ' Iterator';\n var INCORRECT_VALUES_NAME = false;\n var IterablePrototype = Iterable.prototype;\n var nativeIterator = IterablePrototype[ITERATOR]\n || IterablePrototype['@@iterator']\n || DEFAULT && IterablePrototype[DEFAULT];\n var defaultIterator = !BUGGY_SAFARI_ITERATORS && nativeIterator || getIterationMethod(DEFAULT);\n var anyNativeIterator = NAME == 'Array' ? IterablePrototype.entries || nativeIterator : nativeIterator;\n var CurrentIteratorPrototype, methods, KEY;\n\n // fix native\n if (anyNativeIterator) {\n CurrentIteratorPrototype = getPrototypeOf(anyNativeIterator.call(new Iterable()));\n if (IteratorPrototype !== Object.prototype && CurrentIteratorPrototype.next) {\n if (!IS_PURE && getPrototypeOf(CurrentIteratorPrototype) !== IteratorPrototype) {\n if (setPrototypeOf) {\n setPrototypeOf(CurrentIteratorPrototype, IteratorPrototype);\n } else if (typeof CurrentIteratorPrototype[ITERATOR] != 'function') {\n createNonEnumerableProperty(CurrentIteratorPrototype, ITERATOR, returnThis);\n }\n }\n // Set @@toStringTag to native iterators\n setToStringTag(CurrentIteratorPrototype, TO_STRING_TAG, true, true);\n if (IS_PURE) Iterators[TO_STRING_TAG] = returnThis;\n }\n }\n\n // fix Array#{values, @@iterator}.name in V8 / FF\n if (DEFAULT == VALUES && nativeIterator && nativeIterator.name !== VALUES) {\n INCORRECT_VALUES_NAME = true;\n defaultIterator = function values() { return nativeIterator.call(this); };\n }\n\n // define iterator\n if ((!IS_PURE || FORCED) && IterablePrototype[ITERATOR] !== defaultIterator) {\n createNonEnumerableProperty(IterablePrototype, ITERATOR, defaultIterator);\n }\n Iterators[NAME] = defaultIterator;\n\n // export additional methods\n if (DEFAULT) {\n methods = {\n values: getIterationMethod(VALUES),\n keys: IS_SET ? defaultIterator : getIterationMethod(KEYS),\n entries: getIterationMethod(ENTRIES)\n };\n if (FORCED) for (KEY in methods) {\n if (BUGGY_SAFARI_ITERATORS || INCORRECT_VALUES_NAME || !(KEY in IterablePrototype)) {\n redefine(IterablePrototype, KEY, methods[KEY]);\n }\n } else $({ target: NAME, proto: true, forced: BUGGY_SAFARI_ITERATORS || INCORRECT_VALUES_NAME }, methods);\n }\n\n return methods;\n};\n","var fails = require('../internals/fails');\n\n// Thank's IE8 for his funny defineProperty\nmodule.exports = !fails(function () {\n return Object.defineProperty({}, 1, { get: function () { return 7; } })[1] != 7;\n});\n","var global = require('../internals/global');\nvar isObject = require('../internals/is-object');\n\nvar document = global.document;\n// typeof document.createElement is 'object' in old IE\nvar EXISTS = isObject(document) && isObject(document.createElement);\n\nmodule.exports = function (it) {\n return EXISTS ? document.createElement(it) : {};\n};\n","// iterable DOM collections\n// flag - `iterable` interface - 'entries', 'keys', 'values', 'forEach' methods\nmodule.exports = {\n CSSRuleList: 0,\n CSSStyleDeclaration: 0,\n CSSValueList: 0,\n ClientRectList: 0,\n DOMRectList: 0,\n DOMStringList: 0,\n DOMTokenList: 1,\n DataTransferItemList: 0,\n FileList: 0,\n HTMLAllCollection: 0,\n HTMLCollection: 0,\n HTMLFormElement: 0,\n HTMLSelectElement: 0,\n MediaList: 0,\n MimeTypeArray: 0,\n NamedNodeMap: 0,\n NodeList: 1,\n PaintRequestList: 0,\n Plugin: 0,\n PluginArray: 0,\n SVGLengthList: 0,\n SVGNumberList: 0,\n SVGPathSegList: 0,\n SVGPointList: 0,\n SVGStringList: 0,\n SVGTransformList: 0,\n SourceBufferList: 0,\n StyleSheetList: 0,\n TextTrackCueList: 0,\n TextTrackList: 0,\n TouchList: 0\n};\n","var userAgent = require('../internals/engine-user-agent');\n\nmodule.exports = /(iphone|ipod|ipad).*applewebkit/i.test(userAgent);\n","var getBuiltIn = require('../internals/get-built-in');\n\nmodule.exports = getBuiltIn('navigator', 'userAgent') || '';\n","var global = require('../internals/global');\nvar userAgent = require('../internals/engine-user-agent');\n\nvar process = global.process;\nvar versions = process && process.versions;\nvar v8 = versions && versions.v8;\nvar match, version;\n\nif (v8) {\n match = v8.split('.');\n version = match[0] + match[1];\n} else if (userAgent) {\n match = userAgent.match(/Edge\\/(\\d+)/);\n if (!match || match[1] >= 74) {\n match = userAgent.match(/Chrome\\/(\\d+)/);\n if (match) version = match[1];\n }\n}\n\nmodule.exports = version && +version;\n","// IE8- don't enum bug keys\nmodule.exports = [\n 'constructor',\n 'hasOwnProperty',\n 'isPrototypeOf',\n 'propertyIsEnumerable',\n 'toLocaleString',\n 'toString',\n 'valueOf'\n];\n","'use strict';\nvar global = require('../internals/global');\nvar getOwnPropertyDescriptor = require('../internals/object-get-own-property-descriptor').f;\nvar isForced = require('../internals/is-forced');\nvar path = require('../internals/path');\nvar bind = require('../internals/function-bind-context');\nvar createNonEnumerableProperty = require('../internals/create-non-enumerable-property');\nvar has = require('../internals/has');\n\nvar wrapConstructor = function (NativeConstructor) {\n var Wrapper = function (a, b, c) {\n if (this instanceof NativeConstructor) {\n switch (arguments.length) {\n case 0: return new NativeConstructor();\n case 1: return new NativeConstructor(a);\n case 2: return new NativeConstructor(a, b);\n } return new NativeConstructor(a, b, c);\n } return NativeConstructor.apply(this, arguments);\n };\n Wrapper.prototype = NativeConstructor.prototype;\n return Wrapper;\n};\n\n/*\n options.target - name of the target object\n options.global - target is the global object\n options.stat - export as static methods of target\n options.proto - export as prototype methods of target\n options.real - real prototype method for the `pure` version\n options.forced - export even if the native feature is available\n options.bind - bind methods to the target, required for the `pure` version\n options.wrap - wrap constructors to preventing global pollution, required for the `pure` version\n options.unsafe - use the simple assignment of property instead of delete + defineProperty\n options.sham - add a flag to not completely full polyfills\n options.enumerable - export as enumerable property\n options.noTargetGet - prevent calling a getter on target\n*/\nmodule.exports = function (options, source) {\n var TARGET = options.target;\n var GLOBAL = options.global;\n var STATIC = options.stat;\n var PROTO = options.proto;\n\n var nativeSource = GLOBAL ? global : STATIC ? global[TARGET] : (global[TARGET] || {}).prototype;\n\n var target = GLOBAL ? path : path[TARGET] || (path[TARGET] = {});\n var targetPrototype = target.prototype;\n\n var FORCED, USE_NATIVE, VIRTUAL_PROTOTYPE;\n var key, sourceProperty, targetProperty, nativeProperty, resultProperty, descriptor;\n\n for (key in source) {\n FORCED = isForced(GLOBAL ? key : TARGET + (STATIC ? '.' : '#') + key, options.forced);\n // contains in native\n USE_NATIVE = !FORCED && nativeSource && has(nativeSource, key);\n\n targetProperty = target[key];\n\n if (USE_NATIVE) if (options.noTargetGet) {\n descriptor = getOwnPropertyDescriptor(nativeSource, key);\n nativeProperty = descriptor && descriptor.value;\n } else nativeProperty = nativeSource[key];\n\n // export native or implementation\n sourceProperty = (USE_NATIVE && nativeProperty) ? nativeProperty : source[key];\n\n if (USE_NATIVE && typeof targetProperty === typeof sourceProperty) continue;\n\n // bind timers to global for call from export context\n if (options.bind && USE_NATIVE) resultProperty = bind(sourceProperty, global);\n // wrap global constructors for prevent changs in this version\n else if (options.wrap && USE_NATIVE) resultProperty = wrapConstructor(sourceProperty);\n // make static versions for prototype methods\n else if (PROTO && typeof sourceProperty == 'function') resultProperty = bind(Function.call, sourceProperty);\n // default case\n else resultProperty = sourceProperty;\n\n // add a flag to not completely full polyfills\n if (options.sham || (sourceProperty && sourceProperty.sham) || (targetProperty && targetProperty.sham)) {\n createNonEnumerableProperty(resultProperty, 'sham', true);\n }\n\n target[key] = resultProperty;\n\n if (PROTO) {\n VIRTUAL_PROTOTYPE = TARGET + 'Prototype';\n if (!has(path, VIRTUAL_PROTOTYPE)) {\n createNonEnumerableProperty(path, VIRTUAL_PROTOTYPE, {});\n }\n // export virtual prototype methods\n path[VIRTUAL_PROTOTYPE][key] = sourceProperty;\n // export real prototype methods\n if (options.real && targetPrototype && !targetPrototype[key]) {\n createNonEnumerableProperty(targetPrototype, key, sourceProperty);\n }\n }\n }\n};\n","module.exports = function (exec) {\n try {\n return !!exec();\n } catch (error) {\n return true;\n }\n};\n","var aFunction = require('../internals/a-function');\n\n// optional / simple context binding\nmodule.exports = function (fn, that, length) {\n aFunction(fn);\n if (that === undefined) return fn;\n switch (length) {\n case 0: return function () {\n return fn.call(that);\n };\n case 1: return function (a) {\n return fn.call(that, a);\n };\n case 2: return function (a, b) {\n return fn.call(that, a, b);\n };\n case 3: return function (a, b, c) {\n return fn.call(that, a, b, c);\n };\n }\n return function (/* ...args */) {\n return fn.apply(that, arguments);\n };\n};\n","var path = require('../internals/path');\nvar global = require('../internals/global');\n\nvar aFunction = function (variable) {\n return typeof variable == 'function' ? variable : undefined;\n};\n\nmodule.exports = function (namespace, method) {\n return arguments.length < 2 ? aFunction(path[namespace]) || aFunction(global[namespace])\n : path[namespace] && path[namespace][method] || global[namespace] && global[namespace][method];\n};\n","var classof = require('../internals/classof');\nvar Iterators = require('../internals/iterators');\nvar wellKnownSymbol = require('../internals/well-known-symbol');\n\nvar ITERATOR = wellKnownSymbol('iterator');\n\nmodule.exports = function (it) {\n if (it != undefined) return it[ITERATOR]\n || it['@@iterator']\n || Iterators[classof(it)];\n};\n","var check = function (it) {\n return it && it.Math == Math && it;\n};\n\n// https://github.com/zloirock/core-js/issues/86#issuecomment-115759028\nmodule.exports =\n // eslint-disable-next-line no-undef\n check(typeof globalThis == 'object' && globalThis) ||\n check(typeof window == 'object' && window) ||\n check(typeof self == 'object' && self) ||\n check(typeof global == 'object' && global) ||\n // eslint-disable-next-line no-new-func\n Function('return this')();\n","var hasOwnProperty = {}.hasOwnProperty;\n\nmodule.exports = function (it, key) {\n return hasOwnProperty.call(it, key);\n};\n","module.exports = {};\n","var global = require('../internals/global');\n\nmodule.exports = function (a, b) {\n var console = global.console;\n if (console && console.error) {\n arguments.length === 1 ? console.error(a) : console.error(a, b);\n }\n};\n","var getBuiltIn = require('../internals/get-built-in');\n\nmodule.exports = getBuiltIn('document', 'documentElement');\n","var DESCRIPTORS = require('../internals/descriptors');\nvar fails = require('../internals/fails');\nvar createElement = require('../internals/document-create-element');\n\n// Thank's IE8 for his funny defineProperty\nmodule.exports = !DESCRIPTORS && !fails(function () {\n return Object.defineProperty(createElement('div'), 'a', {\n get: function () { return 7; }\n }).a != 7;\n});\n","var fails = require('../internals/fails');\nvar classof = require('../internals/classof-raw');\n\nvar split = ''.split;\n\n// fallback for non-array-like ES3 and non-enumerable old V8 strings\nmodule.exports = fails(function () {\n // throws an error in rhino, see https://github.com/mozilla/rhino/issues/346\n // eslint-disable-next-line no-prototype-builtins\n return !Object('z').propertyIsEnumerable(0);\n}) ? function (it) {\n return classof(it) == 'String' ? split.call(it, '') : Object(it);\n} : Object;\n","var store = require('../internals/shared-store');\n\nvar functionToString = Function.toString;\n\n// this helper broken in `3.4.1-3.4.4`, so we can't use `shared` helper\nif (typeof store.inspectSource != 'function') {\n store.inspectSource = function (it) {\n return functionToString.call(it);\n };\n}\n\nmodule.exports = store.inspectSource;\n","var NATIVE_WEAK_MAP = require('../internals/native-weak-map');\nvar global = require('../internals/global');\nvar isObject = require('../internals/is-object');\nvar createNonEnumerableProperty = require('../internals/create-non-enumerable-property');\nvar objectHas = require('../internals/has');\nvar sharedKey = require('../internals/shared-key');\nvar hiddenKeys = require('../internals/hidden-keys');\n\nvar WeakMap = global.WeakMap;\nvar set, get, has;\n\nvar enforce = function (it) {\n return has(it) ? get(it) : set(it, {});\n};\n\nvar getterFor = function (TYPE) {\n return function (it) {\n var state;\n if (!isObject(it) || (state = get(it)).type !== TYPE) {\n throw TypeError('Incompatible receiver, ' + TYPE + ' required');\n } return state;\n };\n};\n\nif (NATIVE_WEAK_MAP) {\n var store = new WeakMap();\n var wmget = store.get;\n var wmhas = store.has;\n var wmset = store.set;\n set = function (it, metadata) {\n wmset.call(store, it, metadata);\n return metadata;\n };\n get = function (it) {\n return wmget.call(store, it) || {};\n };\n has = function (it) {\n return wmhas.call(store, it);\n };\n} else {\n var STATE = sharedKey('state');\n hiddenKeys[STATE] = true;\n set = function (it, metadata) {\n createNonEnumerableProperty(it, STATE, metadata);\n return metadata;\n };\n get = function (it) {\n return objectHas(it, STATE) ? it[STATE] : {};\n };\n has = function (it) {\n return objectHas(it, STATE);\n };\n}\n\nmodule.exports = {\n set: set,\n get: get,\n has: has,\n enforce: enforce,\n getterFor: getterFor\n};\n","var wellKnownSymbol = require('../internals/well-known-symbol');\nvar Iterators = require('../internals/iterators');\n\nvar ITERATOR = wellKnownSymbol('iterator');\nvar ArrayPrototype = Array.prototype;\n\n// check on default Array iterator\nmodule.exports = function (it) {\n return it !== undefined && (Iterators.Array === it || ArrayPrototype[ITERATOR] === it);\n};\n","var fails = require('../internals/fails');\n\nvar replacement = /#|\\.prototype\\./;\n\nvar isForced = function (feature, detection) {\n var value = data[normalize(feature)];\n return value == POLYFILL ? true\n : value == NATIVE ? false\n : typeof detection == 'function' ? fails(detection)\n : !!detection;\n};\n\nvar normalize = isForced.normalize = function (string) {\n return String(string).replace(replacement, '.').toLowerCase();\n};\n\nvar data = isForced.data = {};\nvar NATIVE = isForced.NATIVE = 'N';\nvar POLYFILL = isForced.POLYFILL = 'P';\n\nmodule.exports = isForced;\n","module.exports = function (it) {\n return typeof it === 'object' ? it !== null : typeof it === 'function';\n};\n","module.exports = true;\n","var anObject = require('../internals/an-object');\nvar isArrayIteratorMethod = require('../internals/is-array-iterator-method');\nvar toLength = require('../internals/to-length');\nvar bind = require('../internals/function-bind-context');\nvar getIteratorMethod = require('../internals/get-iterator-method');\nvar callWithSafeIterationClosing = require('../internals/call-with-safe-iteration-closing');\n\nvar Result = function (stopped, result) {\n this.stopped = stopped;\n this.result = result;\n};\n\nvar iterate = module.exports = function (iterable, fn, that, AS_ENTRIES, IS_ITERATOR) {\n var boundFunction = bind(fn, that, AS_ENTRIES ? 2 : 1);\n var iterator, iterFn, index, length, result, next, step;\n\n if (IS_ITERATOR) {\n iterator = iterable;\n } else {\n iterFn = getIteratorMethod(iterable);\n if (typeof iterFn != 'function') throw TypeError('Target is not iterable');\n // optimisation for array iterators\n if (isArrayIteratorMethod(iterFn)) {\n for (index = 0, length = toLength(iterable.length); length > index; index++) {\n result = AS_ENTRIES\n ? boundFunction(anObject(step = iterable[index])[0], step[1])\n : boundFunction(iterable[index]);\n if (result && result instanceof Result) return result;\n } return new Result(false);\n }\n iterator = iterFn.call(iterable);\n }\n\n next = iterator.next;\n while (!(step = next.call(iterator)).done) {\n result = callWithSafeIterationClosing(iterator, boundFunction, step.value, AS_ENTRIES);\n if (typeof result == 'object' && result && result instanceof Result) return result;\n } return new Result(false);\n};\n\niterate.stop = function (result) {\n return new Result(true, result);\n};\n","'use strict';\nvar getPrototypeOf = require('../internals/object-get-prototype-of');\nvar createNonEnumerableProperty = require('../internals/create-non-enumerable-property');\nvar has = require('../internals/has');\nvar wellKnownSymbol = require('../internals/well-known-symbol');\nvar IS_PURE = require('../internals/is-pure');\n\nvar ITERATOR = wellKnownSymbol('iterator');\nvar BUGGY_SAFARI_ITERATORS = false;\n\nvar returnThis = function () { return this; };\n\n// `%IteratorPrototype%` object\n// https://tc39.github.io/ecma262/#sec-%iteratorprototype%-object\nvar IteratorPrototype, PrototypeOfArrayIteratorPrototype, arrayIterator;\n\nif ([].keys) {\n arrayIterator = [].keys();\n // Safari 8 has buggy iterators w/o `next`\n if (!('next' in arrayIterator)) BUGGY_SAFARI_ITERATORS = true;\n else {\n PrototypeOfArrayIteratorPrototype = getPrototypeOf(getPrototypeOf(arrayIterator));\n if (PrototypeOfArrayIteratorPrototype !== Object.prototype) IteratorPrototype = PrototypeOfArrayIteratorPrototype;\n }\n}\n\nif (IteratorPrototype == undefined) IteratorPrototype = {};\n\n// 25.1.2.1.1 %IteratorPrototype%[@@iterator]()\nif (!IS_PURE && !has(IteratorPrototype, ITERATOR)) {\n createNonEnumerableProperty(IteratorPrototype, ITERATOR, returnThis);\n}\n\nmodule.exports = {\n IteratorPrototype: IteratorPrototype,\n BUGGY_SAFARI_ITERATORS: BUGGY_SAFARI_ITERATORS\n};\n","module.exports = {};\n","var global = require('../internals/global');\nvar getOwnPropertyDescriptor = require('../internals/object-get-own-property-descriptor').f;\nvar classof = require('../internals/classof-raw');\nvar macrotask = require('../internals/task').set;\nvar IS_IOS = require('../internals/engine-is-ios');\n\nvar MutationObserver = global.MutationObserver || global.WebKitMutationObserver;\nvar process = global.process;\nvar Promise = global.Promise;\nvar IS_NODE = classof(process) == 'process';\n// Node.js 11 shows ExperimentalWarning on getting `queueMicrotask`\nvar queueMicrotaskDescriptor = getOwnPropertyDescriptor(global, 'queueMicrotask');\nvar queueMicrotask = queueMicrotaskDescriptor && queueMicrotaskDescriptor.value;\n\nvar flush, head, last, notify, toggle, node, promise, then;\n\n// modern engines have queueMicrotask method\nif (!queueMicrotask) {\n flush = function () {\n var parent, fn;\n if (IS_NODE && (parent = process.domain)) parent.exit();\n while (head) {\n fn = head.fn;\n head = head.next;\n try {\n fn();\n } catch (error) {\n if (head) notify();\n else last = undefined;\n throw error;\n }\n } last = undefined;\n if (parent) parent.enter();\n };\n\n // Node.js\n if (IS_NODE) {\n notify = function () {\n process.nextTick(flush);\n };\n // browsers with MutationObserver, except iOS - https://github.com/zloirock/core-js/issues/339\n } else if (MutationObserver && !IS_IOS) {\n toggle = true;\n node = document.createTextNode('');\n new MutationObserver(flush).observe(node, { characterData: true });\n notify = function () {\n node.data = toggle = !toggle;\n };\n // environments with maybe non-completely correct, but existent Promise\n } else if (Promise && Promise.resolve) {\n // Promise.resolve without an argument throws an error in LG WebOS 2\n promise = Promise.resolve(undefined);\n then = promise.then;\n notify = function () {\n then.call(promise, flush);\n };\n // for other environments - macrotask based on:\n // - setImmediate\n // - MessageChannel\n // - window.postMessag\n // - onreadystatechange\n // - setTimeout\n } else {\n notify = function () {\n // strange IE + webpack dev server bug - use .call(global)\n macrotask.call(global, flush);\n };\n }\n}\n\nmodule.exports = queueMicrotask || function (fn) {\n var task = { fn: fn, next: undefined };\n if (last) last.next = task;\n if (!head) {\n head = task;\n notify();\n } last = task;\n};\n","var global = require('../internals/global');\n\nmodule.exports = global.Promise;\n","var fails = require('../internals/fails');\n\nmodule.exports = !!Object.getOwnPropertySymbols && !fails(function () {\n // Chrome 38 Symbol has incorrect toString conversion\n // eslint-disable-next-line no-undef\n return !String(Symbol());\n});\n","var global = require('../internals/global');\nvar inspectSource = require('../internals/inspect-source');\n\nvar WeakMap = global.WeakMap;\n\nmodule.exports = typeof WeakMap === 'function' && /native code/.test(inspectSource(WeakMap));\n","'use strict';\nvar aFunction = require('../internals/a-function');\n\nvar PromiseCapability = function (C) {\n var resolve, reject;\n this.promise = new C(function ($$resolve, $$reject) {\n if (resolve !== undefined || reject !== undefined) throw TypeError('Bad Promise constructor');\n resolve = $$resolve;\n reject = $$reject;\n });\n this.resolve = aFunction(resolve);\n this.reject = aFunction(reject);\n};\n\n// 25.4.1.5 NewPromiseCapability(C)\nmodule.exports.f = function (C) {\n return new PromiseCapability(C);\n};\n","var anObject = require('../internals/an-object');\nvar defineProperties = require('../internals/object-define-properties');\nvar enumBugKeys = require('../internals/enum-bug-keys');\nvar hiddenKeys = require('../internals/hidden-keys');\nvar html = require('../internals/html');\nvar documentCreateElement = require('../internals/document-create-element');\nvar sharedKey = require('../internals/shared-key');\n\nvar GT = '>';\nvar LT = '<';\nvar PROTOTYPE = 'prototype';\nvar SCRIPT = 'script';\nvar IE_PROTO = sharedKey('IE_PROTO');\n\nvar EmptyConstructor = function () { /* empty */ };\n\nvar scriptTag = function (content) {\n return LT + SCRIPT + GT + content + LT + '/' + SCRIPT + GT;\n};\n\n// Create object with fake `null` prototype: use ActiveX Object with cleared prototype\nvar NullProtoObjectViaActiveX = function (activeXDocument) {\n activeXDocument.write(scriptTag(''));\n activeXDocument.close();\n var temp = activeXDocument.parentWindow.Object;\n activeXDocument = null; // avoid memory leak\n return temp;\n};\n\n// Create object with fake `null` prototype: use iframe Object with cleared prototype\nvar NullProtoObjectViaIFrame = function () {\n // Thrash, waste and sodomy: IE GC bug\n var iframe = documentCreateElement('iframe');\n var JS = 'java' + SCRIPT + ':';\n var iframeDocument;\n iframe.style.display = 'none';\n html.appendChild(iframe);\n // https://github.com/zloirock/core-js/issues/475\n iframe.src = String(JS);\n iframeDocument = iframe.contentWindow.document;\n iframeDocument.open();\n iframeDocument.write(scriptTag('document.F=Object'));\n iframeDocument.close();\n return iframeDocument.F;\n};\n\n// Check for document.domain and active x support\n// No need to use active x approach when document.domain is not set\n// see https://github.com/es-shims/es5-shim/issues/150\n// variation of https://github.com/kitcambridge/es5-shim/commit/4f738ac066346\n// avoid IE GC bug\nvar activeXDocument;\nvar NullProtoObject = function () {\n try {\n /* global ActiveXObject */\n activeXDocument = document.domain && new ActiveXObject('htmlfile');\n } catch (error) { /* ignore */ }\n NullProtoObject = activeXDocument ? NullProtoObjectViaActiveX(activeXDocument) : NullProtoObjectViaIFrame();\n var length = enumBugKeys.length;\n while (length--) delete NullProtoObject[PROTOTYPE][enumBugKeys[length]];\n return NullProtoObject();\n};\n\nhiddenKeys[IE_PROTO] = true;\n\n// `Object.create` method\n// https://tc39.github.io/ecma262/#sec-object.create\nmodule.exports = Object.create || function create(O, Properties) {\n var result;\n if (O !== null) {\n EmptyConstructor[PROTOTYPE] = anObject(O);\n result = new EmptyConstructor();\n EmptyConstructor[PROTOTYPE] = null;\n // add \"__proto__\" for Object.getPrototypeOf polyfill\n result[IE_PROTO] = O;\n } else result = NullProtoObject();\n return Properties === undefined ? result : defineProperties(result, Properties);\n};\n","var DESCRIPTORS = require('../internals/descriptors');\nvar definePropertyModule = require('../internals/object-define-property');\nvar anObject = require('../internals/an-object');\nvar objectKeys = require('../internals/object-keys');\n\n// `Object.defineProperties` method\n// https://tc39.github.io/ecma262/#sec-object.defineproperties\nmodule.exports = DESCRIPTORS ? Object.defineProperties : function defineProperties(O, Properties) {\n anObject(O);\n var keys = objectKeys(Properties);\n var length = keys.length;\n var index = 0;\n var key;\n while (length > index) definePropertyModule.f(O, key = keys[index++], Properties[key]);\n return O;\n};\n","var DESCRIPTORS = require('../internals/descriptors');\nvar IE8_DOM_DEFINE = require('../internals/ie8-dom-define');\nvar anObject = require('../internals/an-object');\nvar toPrimitive = require('../internals/to-primitive');\n\nvar nativeDefineProperty = Object.defineProperty;\n\n// `Object.defineProperty` method\n// https://tc39.github.io/ecma262/#sec-object.defineproperty\nexports.f = DESCRIPTORS ? nativeDefineProperty : function defineProperty(O, P, Attributes) {\n anObject(O);\n P = toPrimitive(P, true);\n anObject(Attributes);\n if (IE8_DOM_DEFINE) try {\n return nativeDefineProperty(O, P, Attributes);\n } catch (error) { /* empty */ }\n if ('get' in Attributes || 'set' in Attributes) throw TypeError('Accessors not supported');\n if ('value' in Attributes) O[P] = Attributes.value;\n return O;\n};\n","var DESCRIPTORS = require('../internals/descriptors');\nvar propertyIsEnumerableModule = require('../internals/object-property-is-enumerable');\nvar createPropertyDescriptor = require('../internals/create-property-descriptor');\nvar toIndexedObject = require('../internals/to-indexed-object');\nvar toPrimitive = require('../internals/to-primitive');\nvar has = require('../internals/has');\nvar IE8_DOM_DEFINE = require('../internals/ie8-dom-define');\n\nvar nativeGetOwnPropertyDescriptor = Object.getOwnPropertyDescriptor;\n\n// `Object.getOwnPropertyDescriptor` method\n// https://tc39.github.io/ecma262/#sec-object.getownpropertydescriptor\nexports.f = DESCRIPTORS ? nativeGetOwnPropertyDescriptor : function getOwnPropertyDescriptor(O, P) {\n O = toIndexedObject(O);\n P = toPrimitive(P, true);\n if (IE8_DOM_DEFINE) try {\n return nativeGetOwnPropertyDescriptor(O, P);\n } catch (error) { /* empty */ }\n if (has(O, P)) return createPropertyDescriptor(!propertyIsEnumerableModule.f.call(O, P), O[P]);\n};\n","var has = require('../internals/has');\nvar toObject = require('../internals/to-object');\nvar sharedKey = require('../internals/shared-key');\nvar CORRECT_PROTOTYPE_GETTER = require('../internals/correct-prototype-getter');\n\nvar IE_PROTO = sharedKey('IE_PROTO');\nvar ObjectPrototype = Object.prototype;\n\n// `Object.getPrototypeOf` method\n// https://tc39.github.io/ecma262/#sec-object.getprototypeof\nmodule.exports = CORRECT_PROTOTYPE_GETTER ? Object.getPrototypeOf : function (O) {\n O = toObject(O);\n if (has(O, IE_PROTO)) return O[IE_PROTO];\n if (typeof O.constructor == 'function' && O instanceof O.constructor) {\n return O.constructor.prototype;\n } return O instanceof Object ? ObjectPrototype : null;\n};\n","var has = require('../internals/has');\nvar toIndexedObject = require('../internals/to-indexed-object');\nvar indexOf = require('../internals/array-includes').indexOf;\nvar hiddenKeys = require('../internals/hidden-keys');\n\nmodule.exports = function (object, names) {\n var O = toIndexedObject(object);\n var i = 0;\n var result = [];\n var key;\n for (key in O) !has(hiddenKeys, key) && has(O, key) && result.push(key);\n // Don't enum bug & hidden keys\n while (names.length > i) if (has(O, key = names[i++])) {\n ~indexOf(result, key) || result.push(key);\n }\n return result;\n};\n","var internalObjectKeys = require('../internals/object-keys-internal');\nvar enumBugKeys = require('../internals/enum-bug-keys');\n\n// `Object.keys` method\n// https://tc39.github.io/ecma262/#sec-object.keys\nmodule.exports = Object.keys || function keys(O) {\n return internalObjectKeys(O, enumBugKeys);\n};\n","'use strict';\nvar nativePropertyIsEnumerable = {}.propertyIsEnumerable;\nvar getOwnPropertyDescriptor = Object.getOwnPropertyDescriptor;\n\n// Nashorn ~ JDK8 bug\nvar NASHORN_BUG = getOwnPropertyDescriptor && !nativePropertyIsEnumerable.call({ 1: 2 }, 1);\n\n// `Object.prototype.propertyIsEnumerable` method implementation\n// https://tc39.github.io/ecma262/#sec-object.prototype.propertyisenumerable\nexports.f = NASHORN_BUG ? function propertyIsEnumerable(V) {\n var descriptor = getOwnPropertyDescriptor(this, V);\n return !!descriptor && descriptor.enumerable;\n} : nativePropertyIsEnumerable;\n","var anObject = require('../internals/an-object');\nvar aPossiblePrototype = require('../internals/a-possible-prototype');\n\n// `Object.setPrototypeOf` method\n// https://tc39.github.io/ecma262/#sec-object.setprototypeof\n// Works with __proto__ only. Old v8 can't work with null proto objects.\n/* eslint-disable no-proto */\nmodule.exports = Object.setPrototypeOf || ('__proto__' in {} ? function () {\n var CORRECT_SETTER = false;\n var test = {};\n var setter;\n try {\n setter = Object.getOwnPropertyDescriptor(Object.prototype, '__proto__').set;\n setter.call(test, []);\n CORRECT_SETTER = test instanceof Array;\n } catch (error) { /* empty */ }\n return function setPrototypeOf(O, proto) {\n anObject(O);\n aPossiblePrototype(proto);\n if (CORRECT_SETTER) setter.call(O, proto);\n else O.__proto__ = proto;\n return O;\n };\n}() : undefined);\n","'use strict';\nvar TO_STRING_TAG_SUPPORT = require('../internals/to-string-tag-support');\nvar classof = require('../internals/classof');\n\n// `Object.prototype.toString` method implementation\n// https://tc39.github.io/ecma262/#sec-object.prototype.tostring\nmodule.exports = TO_STRING_TAG_SUPPORT ? {}.toString : function toString() {\n return '[object ' + classof(this) + ']';\n};\n","module.exports = {};\n","module.exports = function (exec) {\n try {\n return { error: false, value: exec() };\n } catch (error) {\n return { error: true, value: error };\n }\n};\n","var anObject = require('../internals/an-object');\nvar isObject = require('../internals/is-object');\nvar newPromiseCapability = require('../internals/new-promise-capability');\n\nmodule.exports = function (C, x) {\n anObject(C);\n if (isObject(x) && x.constructor === C) return x;\n var promiseCapability = newPromiseCapability.f(C);\n var resolve = promiseCapability.resolve;\n resolve(x);\n return promiseCapability.promise;\n};\n","var redefine = require('../internals/redefine');\n\nmodule.exports = function (target, src, options) {\n for (var key in src) {\n if (options && options.unsafe && target[key]) target[key] = src[key];\n else redefine(target, key, src[key], options);\n } return target;\n};\n","var createNonEnumerableProperty = require('../internals/create-non-enumerable-property');\n\nmodule.exports = function (target, key, value, options) {\n if (options && options.enumerable) target[key] = value;\n else createNonEnumerableProperty(target, key, value);\n};\n","// `RequireObjectCoercible` abstract operation\n// https://tc39.github.io/ecma262/#sec-requireobjectcoercible\nmodule.exports = function (it) {\n if (it == undefined) throw TypeError(\"Can't call method on \" + it);\n return it;\n};\n","var global = require('../internals/global');\nvar createNonEnumerableProperty = require('../internals/create-non-enumerable-property');\n\nmodule.exports = function (key, value) {\n try {\n createNonEnumerableProperty(global, key, value);\n } catch (error) {\n global[key] = value;\n } return value;\n};\n","'use strict';\nvar getBuiltIn = require('../internals/get-built-in');\nvar definePropertyModule = require('../internals/object-define-property');\nvar wellKnownSymbol = require('../internals/well-known-symbol');\nvar DESCRIPTORS = require('../internals/descriptors');\n\nvar SPECIES = wellKnownSymbol('species');\n\nmodule.exports = function (CONSTRUCTOR_NAME) {\n var Constructor = getBuiltIn(CONSTRUCTOR_NAME);\n var defineProperty = definePropertyModule.f;\n\n if (DESCRIPTORS && Constructor && !Constructor[SPECIES]) {\n defineProperty(Constructor, SPECIES, {\n configurable: true,\n get: function () { return this; }\n });\n }\n};\n","var TO_STRING_TAG_SUPPORT = require('../internals/to-string-tag-support');\nvar defineProperty = require('../internals/object-define-property').f;\nvar createNonEnumerableProperty = require('../internals/create-non-enumerable-property');\nvar has = require('../internals/has');\nvar toString = require('../internals/object-to-string');\nvar wellKnownSymbol = require('../internals/well-known-symbol');\n\nvar TO_STRING_TAG = wellKnownSymbol('toStringTag');\n\nmodule.exports = function (it, TAG, STATIC, SET_METHOD) {\n if (it) {\n var target = STATIC ? it : it.prototype;\n if (!has(target, TO_STRING_TAG)) {\n defineProperty(target, TO_STRING_TAG, { configurable: true, value: TAG });\n }\n if (SET_METHOD && !TO_STRING_TAG_SUPPORT) {\n createNonEnumerableProperty(target, 'toString', toString);\n }\n }\n};\n","var shared = require('../internals/shared');\nvar uid = require('../internals/uid');\n\nvar keys = shared('keys');\n\nmodule.exports = function (key) {\n return keys[key] || (keys[key] = uid(key));\n};\n","var global = require('../internals/global');\nvar setGlobal = require('../internals/set-global');\n\nvar SHARED = '__core-js_shared__';\nvar store = global[SHARED] || setGlobal(SHARED, {});\n\nmodule.exports = store;\n","var IS_PURE = require('../internals/is-pure');\nvar store = require('../internals/shared-store');\n\n(module.exports = function (key, value) {\n return store[key] || (store[key] = value !== undefined ? value : {});\n})('versions', []).push({\n version: '3.6.4',\n mode: IS_PURE ? 'pure' : 'global',\n copyright: '© 2020 Denis Pushkarev (zloirock.ru)'\n});\n","var anObject = require('../internals/an-object');\nvar aFunction = require('../internals/a-function');\nvar wellKnownSymbol = require('../internals/well-known-symbol');\n\nvar SPECIES = wellKnownSymbol('species');\n\n// `SpeciesConstructor` abstract operation\n// https://tc39.github.io/ecma262/#sec-speciesconstructor\nmodule.exports = function (O, defaultConstructor) {\n var C = anObject(O).constructor;\n var S;\n return C === undefined || (S = anObject(C)[SPECIES]) == undefined ? defaultConstructor : aFunction(S);\n};\n","var toInteger = require('../internals/to-integer');\nvar requireObjectCoercible = require('../internals/require-object-coercible');\n\n// `String.prototype.{ codePointAt, at }` methods implementation\nvar createMethod = function (CONVERT_TO_STRING) {\n return function ($this, pos) {\n var S = String(requireObjectCoercible($this));\n var position = toInteger(pos);\n var size = S.length;\n var first, second;\n if (position < 0 || position >= size) return CONVERT_TO_STRING ? '' : undefined;\n first = S.charCodeAt(position);\n return first < 0xD800 || first > 0xDBFF || position + 1 === size\n || (second = S.charCodeAt(position + 1)) < 0xDC00 || second > 0xDFFF\n ? CONVERT_TO_STRING ? S.charAt(position) : first\n : CONVERT_TO_STRING ? S.slice(position, position + 2) : (first - 0xD800 << 10) + (second - 0xDC00) + 0x10000;\n };\n};\n\nmodule.exports = {\n // `String.prototype.codePointAt` method\n // https://tc39.github.io/ecma262/#sec-string.prototype.codepointat\n codeAt: createMethod(false),\n // `String.prototype.at` method\n // https://github.com/mathiasbynens/String.prototype.at\n charAt: createMethod(true)\n};\n","var global = require('../internals/global');\nvar fails = require('../internals/fails');\nvar classof = require('../internals/classof-raw');\nvar bind = require('../internals/function-bind-context');\nvar html = require('../internals/html');\nvar createElement = require('../internals/document-create-element');\nvar IS_IOS = require('../internals/engine-is-ios');\n\nvar location = global.location;\nvar set = global.setImmediate;\nvar clear = global.clearImmediate;\nvar process = global.process;\nvar MessageChannel = global.MessageChannel;\nvar Dispatch = global.Dispatch;\nvar counter = 0;\nvar queue = {};\nvar ONREADYSTATECHANGE = 'onreadystatechange';\nvar defer, channel, port;\n\nvar run = function (id) {\n // eslint-disable-next-line no-prototype-builtins\n if (queue.hasOwnProperty(id)) {\n var fn = queue[id];\n delete queue[id];\n fn();\n }\n};\n\nvar runner = function (id) {\n return function () {\n run(id);\n };\n};\n\nvar listener = function (event) {\n run(event.data);\n};\n\nvar post = function (id) {\n // old engines have not location.origin\n global.postMessage(id + '', location.protocol + '//' + location.host);\n};\n\n// Node.js 0.9+ & IE10+ has setImmediate, otherwise:\nif (!set || !clear) {\n set = function setImmediate(fn) {\n var args = [];\n var i = 1;\n while (arguments.length > i) args.push(arguments[i++]);\n queue[++counter] = function () {\n // eslint-disable-next-line no-new-func\n (typeof fn == 'function' ? fn : Function(fn)).apply(undefined, args);\n };\n defer(counter);\n return counter;\n };\n clear = function clearImmediate(id) {\n delete queue[id];\n };\n // Node.js 0.8-\n if (classof(process) == 'process') {\n defer = function (id) {\n process.nextTick(runner(id));\n };\n // Sphere (JS game engine) Dispatch API\n } else if (Dispatch && Dispatch.now) {\n defer = function (id) {\n Dispatch.now(runner(id));\n };\n // Browsers with MessageChannel, includes WebWorkers\n // except iOS - https://github.com/zloirock/core-js/issues/624\n } else if (MessageChannel && !IS_IOS) {\n channel = new MessageChannel();\n port = channel.port2;\n channel.port1.onmessage = listener;\n defer = bind(port.postMessage, port, 1);\n // Browsers with postMessage, skip WebWorkers\n // IE8 has postMessage, but it's sync & typeof its postMessage is 'object'\n } else if (global.addEventListener && typeof postMessage == 'function' && !global.importScripts && !fails(post)) {\n defer = post;\n global.addEventListener('message', listener, false);\n // IE8-\n } else if (ONREADYSTATECHANGE in createElement('script')) {\n defer = function (id) {\n html.appendChild(createElement('script'))[ONREADYSTATECHANGE] = function () {\n html.removeChild(this);\n run(id);\n };\n };\n // Rest old browsers\n } else {\n defer = function (id) {\n setTimeout(runner(id), 0);\n };\n }\n}\n\nmodule.exports = {\n set: set,\n clear: clear\n};\n","var toInteger = require('../internals/to-integer');\n\nvar max = Math.max;\nvar min = Math.min;\n\n// Helper for a popular repeating case of the spec:\n// Let integer be ? ToInteger(index).\n// If integer < 0, let result be max((length + integer), 0); else let result be min(integer, length).\nmodule.exports = function (index, length) {\n var integer = toInteger(index);\n return integer < 0 ? max(integer + length, 0) : min(integer, length);\n};\n","// toObject with fallback for non-array-like ES3 strings\nvar IndexedObject = require('../internals/indexed-object');\nvar requireObjectCoercible = require('../internals/require-object-coercible');\n\nmodule.exports = function (it) {\n return IndexedObject(requireObjectCoercible(it));\n};\n","var ceil = Math.ceil;\nvar floor = Math.floor;\n\n// `ToInteger` abstract operation\n// https://tc39.github.io/ecma262/#sec-tointeger\nmodule.exports = function (argument) {\n return isNaN(argument = +argument) ? 0 : (argument > 0 ? floor : ceil)(argument);\n};\n","var toInteger = require('../internals/to-integer');\n\nvar min = Math.min;\n\n// `ToLength` abstract operation\n// https://tc39.github.io/ecma262/#sec-tolength\nmodule.exports = function (argument) {\n return argument > 0 ? min(toInteger(argument), 0x1FFFFFFFFFFFFF) : 0; // 2 ** 53 - 1 == 9007199254740991\n};\n","var requireObjectCoercible = require('../internals/require-object-coercible');\n\n// `ToObject` abstract operation\n// https://tc39.github.io/ecma262/#sec-toobject\nmodule.exports = function (argument) {\n return Object(requireObjectCoercible(argument));\n};\n","var isObject = require('../internals/is-object');\n\n// `ToPrimitive` abstract operation\n// https://tc39.github.io/ecma262/#sec-toprimitive\n// instead of the ES6 spec version, we didn't implement @@toPrimitive case\n// and the second argument - flag - preferred type is a string\nmodule.exports = function (input, PREFERRED_STRING) {\n if (!isObject(input)) return input;\n var fn, val;\n if (PREFERRED_STRING && typeof (fn = input.toString) == 'function' && !isObject(val = fn.call(input))) return val;\n if (typeof (fn = input.valueOf) == 'function' && !isObject(val = fn.call(input))) return val;\n if (!PREFERRED_STRING && typeof (fn = input.toString) == 'function' && !isObject(val = fn.call(input))) return val;\n throw TypeError(\"Can't convert object to primitive value\");\n};\n","var wellKnownSymbol = require('../internals/well-known-symbol');\n\nvar TO_STRING_TAG = wellKnownSymbol('toStringTag');\nvar test = {};\n\ntest[TO_STRING_TAG] = 'z';\n\nmodule.exports = String(test) === '[object z]';\n","var id = 0;\nvar postfix = Math.random();\n\nmodule.exports = function (key) {\n return 'Symbol(' + String(key === undefined ? '' : key) + ')_' + (++id + postfix).toString(36);\n};\n","var NATIVE_SYMBOL = require('../internals/native-symbol');\n\nmodule.exports = NATIVE_SYMBOL\n // eslint-disable-next-line no-undef\n && !Symbol.sham\n // eslint-disable-next-line no-undef\n && typeof Symbol.iterator == 'symbol';\n","var global = require('../internals/global');\nvar shared = require('../internals/shared');\nvar has = require('../internals/has');\nvar uid = require('../internals/uid');\nvar NATIVE_SYMBOL = require('../internals/native-symbol');\nvar USE_SYMBOL_AS_UID = require('../internals/use-symbol-as-uid');\n\nvar WellKnownSymbolsStore = shared('wks');\nvar Symbol = global.Symbol;\nvar createWellKnownSymbol = USE_SYMBOL_AS_UID ? Symbol : Symbol && Symbol.withoutSetter || uid;\n\nmodule.exports = function (name) {\n if (!has(WellKnownSymbolsStore, name)) {\n if (NATIVE_SYMBOL && has(Symbol, name)) WellKnownSymbolsStore[name] = Symbol[name];\n else WellKnownSymbolsStore[name] = createWellKnownSymbol('Symbol.' + name);\n } return WellKnownSymbolsStore[name];\n};\n","'use strict';\nvar toIndexedObject = require('../internals/to-indexed-object');\nvar addToUnscopables = require('../internals/add-to-unscopables');\nvar Iterators = require('../internals/iterators');\nvar InternalStateModule = require('../internals/internal-state');\nvar defineIterator = require('../internals/define-iterator');\n\nvar ARRAY_ITERATOR = 'Array Iterator';\nvar setInternalState = InternalStateModule.set;\nvar getInternalState = InternalStateModule.getterFor(ARRAY_ITERATOR);\n\n// `Array.prototype.entries` method\n// https://tc39.github.io/ecma262/#sec-array.prototype.entries\n// `Array.prototype.keys` method\n// https://tc39.github.io/ecma262/#sec-array.prototype.keys\n// `Array.prototype.values` method\n// https://tc39.github.io/ecma262/#sec-array.prototype.values\n// `Array.prototype[@@iterator]` method\n// https://tc39.github.io/ecma262/#sec-array.prototype-@@iterator\n// `CreateArrayIterator` internal method\n// https://tc39.github.io/ecma262/#sec-createarrayiterator\nmodule.exports = defineIterator(Array, 'Array', function (iterated, kind) {\n setInternalState(this, {\n type: ARRAY_ITERATOR,\n target: toIndexedObject(iterated), // target\n index: 0, // next index\n kind: kind // kind\n });\n// `%ArrayIteratorPrototype%.next` method\n// https://tc39.github.io/ecma262/#sec-%arrayiteratorprototype%.next\n}, function () {\n var state = getInternalState(this);\n var target = state.target;\n var kind = state.kind;\n var index = state.index++;\n if (!target || index >= target.length) {\n state.target = undefined;\n return { value: undefined, done: true };\n }\n if (kind == 'keys') return { value: index, done: false };\n if (kind == 'values') return { value: target[index], done: false };\n return { value: [index, target[index]], done: false };\n}, 'values');\n\n// argumentsList[@@iterator] is %ArrayProto_values%\n// https://tc39.github.io/ecma262/#sec-createunmappedargumentsobject\n// https://tc39.github.io/ecma262/#sec-createmappedargumentsobject\nIterators.Arguments = Iterators.Array;\n\n// https://tc39.github.io/ecma262/#sec-array.prototype-@@unscopables\naddToUnscopables('keys');\naddToUnscopables('values');\naddToUnscopables('entries');\n","// empty\n","'use strict';\nvar $ = require('../internals/export');\nvar aFunction = require('../internals/a-function');\nvar newPromiseCapabilityModule = require('../internals/new-promise-capability');\nvar perform = require('../internals/perform');\nvar iterate = require('../internals/iterate');\n\n// `Promise.allSettled` method\n// https://github.com/tc39/proposal-promise-allSettled\n$({ target: 'Promise', stat: true }, {\n allSettled: function allSettled(iterable) {\n var C = this;\n var capability = newPromiseCapabilityModule.f(C);\n var resolve = capability.resolve;\n var reject = capability.reject;\n var result = perform(function () {\n var promiseResolve = aFunction(C.resolve);\n var values = [];\n var counter = 0;\n var remaining = 1;\n iterate(iterable, function (promise) {\n var index = counter++;\n var alreadyCalled = false;\n values.push(undefined);\n remaining++;\n promiseResolve.call(C, promise).then(function (value) {\n if (alreadyCalled) return;\n alreadyCalled = true;\n values[index] = { status: 'fulfilled', value: value };\n --remaining || resolve(values);\n }, function (e) {\n if (alreadyCalled) return;\n alreadyCalled = true;\n values[index] = { status: 'rejected', reason: e };\n --remaining || resolve(values);\n });\n });\n --remaining || resolve(values);\n });\n if (result.error) reject(result.value);\n return capability.promise;\n }\n});\n","'use strict';\nvar $ = require('../internals/export');\nvar IS_PURE = require('../internals/is-pure');\nvar NativePromise = require('../internals/native-promise-constructor');\nvar fails = require('../internals/fails');\nvar getBuiltIn = require('../internals/get-built-in');\nvar speciesConstructor = require('../internals/species-constructor');\nvar promiseResolve = require('../internals/promise-resolve');\nvar redefine = require('../internals/redefine');\n\n// Safari bug https://bugs.webkit.org/show_bug.cgi?id=200829\nvar NON_GENERIC = !!NativePromise && fails(function () {\n NativePromise.prototype['finally'].call({ then: function () { /* empty */ } }, function () { /* empty */ });\n});\n\n// `Promise.prototype.finally` method\n// https://tc39.github.io/ecma262/#sec-promise.prototype.finally\n$({ target: 'Promise', proto: true, real: true, forced: NON_GENERIC }, {\n 'finally': function (onFinally) {\n var C = speciesConstructor(this, getBuiltIn('Promise'));\n var isFunction = typeof onFinally == 'function';\n return this.then(\n isFunction ? function (x) {\n return promiseResolve(C, onFinally()).then(function () { return x; });\n } : onFinally,\n isFunction ? function (e) {\n return promiseResolve(C, onFinally()).then(function () { throw e; });\n } : onFinally\n );\n }\n});\n\n// patch native Promise.prototype for native async functions\nif (!IS_PURE && typeof NativePromise == 'function' && !NativePromise.prototype['finally']) {\n redefine(NativePromise.prototype, 'finally', getBuiltIn('Promise').prototype['finally']);\n}\n","'use strict';\nvar $ = require('../internals/export');\nvar IS_PURE = require('../internals/is-pure');\nvar global = require('../internals/global');\nvar getBuiltIn = require('../internals/get-built-in');\nvar NativePromise = require('../internals/native-promise-constructor');\nvar redefine = require('../internals/redefine');\nvar redefineAll = require('../internals/redefine-all');\nvar setToStringTag = require('../internals/set-to-string-tag');\nvar setSpecies = require('../internals/set-species');\nvar isObject = require('../internals/is-object');\nvar aFunction = require('../internals/a-function');\nvar anInstance = require('../internals/an-instance');\nvar classof = require('../internals/classof-raw');\nvar inspectSource = require('../internals/inspect-source');\nvar iterate = require('../internals/iterate');\nvar checkCorrectnessOfIteration = require('../internals/check-correctness-of-iteration');\nvar speciesConstructor = require('../internals/species-constructor');\nvar task = require('../internals/task').set;\nvar microtask = require('../internals/microtask');\nvar promiseResolve = require('../internals/promise-resolve');\nvar hostReportErrors = require('../internals/host-report-errors');\nvar newPromiseCapabilityModule = require('../internals/new-promise-capability');\nvar perform = require('../internals/perform');\nvar InternalStateModule = require('../internals/internal-state');\nvar isForced = require('../internals/is-forced');\nvar wellKnownSymbol = require('../internals/well-known-symbol');\nvar V8_VERSION = require('../internals/engine-v8-version');\n\nvar SPECIES = wellKnownSymbol('species');\nvar PROMISE = 'Promise';\nvar getInternalState = InternalStateModule.get;\nvar setInternalState = InternalStateModule.set;\nvar getInternalPromiseState = InternalStateModule.getterFor(PROMISE);\nvar PromiseConstructor = NativePromise;\nvar TypeError = global.TypeError;\nvar document = global.document;\nvar process = global.process;\nvar $fetch = getBuiltIn('fetch');\nvar newPromiseCapability = newPromiseCapabilityModule.f;\nvar newGenericPromiseCapability = newPromiseCapability;\nvar IS_NODE = classof(process) == 'process';\nvar DISPATCH_EVENT = !!(document && document.createEvent && global.dispatchEvent);\nvar UNHANDLED_REJECTION = 'unhandledrejection';\nvar REJECTION_HANDLED = 'rejectionhandled';\nvar PENDING = 0;\nvar FULFILLED = 1;\nvar REJECTED = 2;\nvar HANDLED = 1;\nvar UNHANDLED = 2;\nvar Internal, OwnPromiseCapability, PromiseWrapper, nativeThen;\n\nvar FORCED = isForced(PROMISE, function () {\n var GLOBAL_CORE_JS_PROMISE = inspectSource(PromiseConstructor) !== String(PromiseConstructor);\n if (!GLOBAL_CORE_JS_PROMISE) {\n // V8 6.6 (Node 10 and Chrome 66) have a bug with resolving custom thenables\n // https://bugs.chromium.org/p/chromium/issues/detail?id=830565\n // We can't detect it synchronously, so just check versions\n if (V8_VERSION === 66) return true;\n // Unhandled rejections tracking support, NodeJS Promise without it fails @@species test\n if (!IS_NODE && typeof PromiseRejectionEvent != 'function') return true;\n }\n // We need Promise#finally in the pure version for preventing prototype pollution\n if (IS_PURE && !PromiseConstructor.prototype['finally']) return true;\n // We can't use @@species feature detection in V8 since it causes\n // deoptimization and performance degradation\n // https://github.com/zloirock/core-js/issues/679\n if (V8_VERSION >= 51 && /native code/.test(PromiseConstructor)) return false;\n // Detect correctness of subclassing with @@species support\n var promise = PromiseConstructor.resolve(1);\n var FakePromise = function (exec) {\n exec(function () { /* empty */ }, function () { /* empty */ });\n };\n var constructor = promise.constructor = {};\n constructor[SPECIES] = FakePromise;\n return !(promise.then(function () { /* empty */ }) instanceof FakePromise);\n});\n\nvar INCORRECT_ITERATION = FORCED || !checkCorrectnessOfIteration(function (iterable) {\n PromiseConstructor.all(iterable)['catch'](function () { /* empty */ });\n});\n\n// helpers\nvar isThenable = function (it) {\n var then;\n return isObject(it) && typeof (then = it.then) == 'function' ? then : false;\n};\n\nvar notify = function (promise, state, isReject) {\n if (state.notified) return;\n state.notified = true;\n var chain = state.reactions;\n microtask(function () {\n var value = state.value;\n var ok = state.state == FULFILLED;\n var index = 0;\n // variable length - can't use forEach\n while (chain.length > index) {\n var reaction = chain[index++];\n var handler = ok ? reaction.ok : reaction.fail;\n var resolve = reaction.resolve;\n var reject = reaction.reject;\n var domain = reaction.domain;\n var result, then, exited;\n try {\n if (handler) {\n if (!ok) {\n if (state.rejection === UNHANDLED) onHandleUnhandled(promise, state);\n state.rejection = HANDLED;\n }\n if (handler === true) result = value;\n else {\n if (domain) domain.enter();\n result = handler(value); // can throw\n if (domain) {\n domain.exit();\n exited = true;\n }\n }\n if (result === reaction.promise) {\n reject(TypeError('Promise-chain cycle'));\n } else if (then = isThenable(result)) {\n then.call(result, resolve, reject);\n } else resolve(result);\n } else reject(value);\n } catch (error) {\n if (domain && !exited) domain.exit();\n reject(error);\n }\n }\n state.reactions = [];\n state.notified = false;\n if (isReject && !state.rejection) onUnhandled(promise, state);\n });\n};\n\nvar dispatchEvent = function (name, promise, reason) {\n var event, handler;\n if (DISPATCH_EVENT) {\n event = document.createEvent('Event');\n event.promise = promise;\n event.reason = reason;\n event.initEvent(name, false, true);\n global.dispatchEvent(event);\n } else event = { promise: promise, reason: reason };\n if (handler = global['on' + name]) handler(event);\n else if (name === UNHANDLED_REJECTION) hostReportErrors('Unhandled promise rejection', reason);\n};\n\nvar onUnhandled = function (promise, state) {\n task.call(global, function () {\n var value = state.value;\n var IS_UNHANDLED = isUnhandled(state);\n var result;\n if (IS_UNHANDLED) {\n result = perform(function () {\n if (IS_NODE) {\n process.emit('unhandledRejection', value, promise);\n } else dispatchEvent(UNHANDLED_REJECTION, promise, value);\n });\n // Browsers should not trigger `rejectionHandled` event if it was handled here, NodeJS - should\n state.rejection = IS_NODE || isUnhandled(state) ? UNHANDLED : HANDLED;\n if (result.error) throw result.value;\n }\n });\n};\n\nvar isUnhandled = function (state) {\n return state.rejection !== HANDLED && !state.parent;\n};\n\nvar onHandleUnhandled = function (promise, state) {\n task.call(global, function () {\n if (IS_NODE) {\n process.emit('rejectionHandled', promise);\n } else dispatchEvent(REJECTION_HANDLED, promise, state.value);\n });\n};\n\nvar bind = function (fn, promise, state, unwrap) {\n return function (value) {\n fn(promise, state, value, unwrap);\n };\n};\n\nvar internalReject = function (promise, state, value, unwrap) {\n if (state.done) return;\n state.done = true;\n if (unwrap) state = unwrap;\n state.value = value;\n state.state = REJECTED;\n notify(promise, state, true);\n};\n\nvar internalResolve = function (promise, state, value, unwrap) {\n if (state.done) return;\n state.done = true;\n if (unwrap) state = unwrap;\n try {\n if (promise === value) throw TypeError(\"Promise can't be resolved itself\");\n var then = isThenable(value);\n if (then) {\n microtask(function () {\n var wrapper = { done: false };\n try {\n then.call(value,\n bind(internalResolve, promise, wrapper, state),\n bind(internalReject, promise, wrapper, state)\n );\n } catch (error) {\n internalReject(promise, wrapper, error, state);\n }\n });\n } else {\n state.value = value;\n state.state = FULFILLED;\n notify(promise, state, false);\n }\n } catch (error) {\n internalReject(promise, { done: false }, error, state);\n }\n};\n\n// constructor polyfill\nif (FORCED) {\n // 25.4.3.1 Promise(executor)\n PromiseConstructor = function Promise(executor) {\n anInstance(this, PromiseConstructor, PROMISE);\n aFunction(executor);\n Internal.call(this);\n var state = getInternalState(this);\n try {\n executor(bind(internalResolve, this, state), bind(internalReject, this, state));\n } catch (error) {\n internalReject(this, state, error);\n }\n };\n // eslint-disable-next-line no-unused-vars\n Internal = function Promise(executor) {\n setInternalState(this, {\n type: PROMISE,\n done: false,\n notified: false,\n parent: false,\n reactions: [],\n rejection: false,\n state: PENDING,\n value: undefined\n });\n };\n Internal.prototype = redefineAll(PromiseConstructor.prototype, {\n // `Promise.prototype.then` method\n // https://tc39.github.io/ecma262/#sec-promise.prototype.then\n then: function then(onFulfilled, onRejected) {\n var state = getInternalPromiseState(this);\n var reaction = newPromiseCapability(speciesConstructor(this, PromiseConstructor));\n reaction.ok = typeof onFulfilled == 'function' ? onFulfilled : true;\n reaction.fail = typeof onRejected == 'function' && onRejected;\n reaction.domain = IS_NODE ? process.domain : undefined;\n state.parent = true;\n state.reactions.push(reaction);\n if (state.state != PENDING) notify(this, state, false);\n return reaction.promise;\n },\n // `Promise.prototype.catch` method\n // https://tc39.github.io/ecma262/#sec-promise.prototype.catch\n 'catch': function (onRejected) {\n return this.then(undefined, onRejected);\n }\n });\n OwnPromiseCapability = function () {\n var promise = new Internal();\n var state = getInternalState(promise);\n this.promise = promise;\n this.resolve = bind(internalResolve, promise, state);\n this.reject = bind(internalReject, promise, state);\n };\n newPromiseCapabilityModule.f = newPromiseCapability = function (C) {\n return C === PromiseConstructor || C === PromiseWrapper\n ? new OwnPromiseCapability(C)\n : newGenericPromiseCapability(C);\n };\n\n if (!IS_PURE && typeof NativePromise == 'function') {\n nativeThen = NativePromise.prototype.then;\n\n // wrap native Promise#then for native async functions\n redefine(NativePromise.prototype, 'then', function then(onFulfilled, onRejected) {\n var that = this;\n return new PromiseConstructor(function (resolve, reject) {\n nativeThen.call(that, resolve, reject);\n }).then(onFulfilled, onRejected);\n // https://github.com/zloirock/core-js/issues/640\n }, { unsafe: true });\n\n // wrap fetch result\n if (typeof $fetch == 'function') $({ global: true, enumerable: true, forced: true }, {\n // eslint-disable-next-line no-unused-vars\n fetch: function fetch(input /* , init */) {\n return promiseResolve(PromiseConstructor, $fetch.apply(global, arguments));\n }\n });\n }\n}\n\n$({ global: true, wrap: true, forced: FORCED }, {\n Promise: PromiseConstructor\n});\n\nsetToStringTag(PromiseConstructor, PROMISE, false, true);\nsetSpecies(PROMISE);\n\nPromiseWrapper = getBuiltIn(PROMISE);\n\n// statics\n$({ target: PROMISE, stat: true, forced: FORCED }, {\n // `Promise.reject` method\n // https://tc39.github.io/ecma262/#sec-promise.reject\n reject: function reject(r) {\n var capability = newPromiseCapability(this);\n capability.reject.call(undefined, r);\n return capability.promise;\n }\n});\n\n$({ target: PROMISE, stat: true, forced: IS_PURE || FORCED }, {\n // `Promise.resolve` method\n // https://tc39.github.io/ecma262/#sec-promise.resolve\n resolve: function resolve(x) {\n return promiseResolve(IS_PURE && this === PromiseWrapper ? PromiseConstructor : this, x);\n }\n});\n\n$({ target: PROMISE, stat: true, forced: INCORRECT_ITERATION }, {\n // `Promise.all` method\n // https://tc39.github.io/ecma262/#sec-promise.all\n all: function all(iterable) {\n var C = this;\n var capability = newPromiseCapability(C);\n var resolve = capability.resolve;\n var reject = capability.reject;\n var result = perform(function () {\n var $promiseResolve = aFunction(C.resolve);\n var values = [];\n var counter = 0;\n var remaining = 1;\n iterate(iterable, function (promise) {\n var index = counter++;\n var alreadyCalled = false;\n values.push(undefined);\n remaining++;\n $promiseResolve.call(C, promise).then(function (value) {\n if (alreadyCalled) return;\n alreadyCalled = true;\n values[index] = value;\n --remaining || resolve(values);\n }, reject);\n });\n --remaining || resolve(values);\n });\n if (result.error) reject(result.value);\n return capability.promise;\n },\n // `Promise.race` method\n // https://tc39.github.io/ecma262/#sec-promise.race\n race: function race(iterable) {\n var C = this;\n var capability = newPromiseCapability(C);\n var reject = capability.reject;\n var result = perform(function () {\n var $promiseResolve = aFunction(C.resolve);\n iterate(iterable, function (promise) {\n $promiseResolve.call(C, promise).then(capability.resolve, reject);\n });\n });\n if (result.error) reject(result.value);\n return capability.promise;\n }\n});\n","'use strict';\nvar charAt = require('../internals/string-multibyte').charAt;\nvar InternalStateModule = require('../internals/internal-state');\nvar defineIterator = require('../internals/define-iterator');\n\nvar STRING_ITERATOR = 'String Iterator';\nvar setInternalState = InternalStateModule.set;\nvar getInternalState = InternalStateModule.getterFor(STRING_ITERATOR);\n\n// `String.prototype[@@iterator]` method\n// https://tc39.github.io/ecma262/#sec-string.prototype-@@iterator\ndefineIterator(String, 'String', function (iterated) {\n setInternalState(this, {\n type: STRING_ITERATOR,\n string: String(iterated),\n index: 0\n });\n// `%StringIteratorPrototype%.next` method\n// https://tc39.github.io/ecma262/#sec-%stringiteratorprototype%.next\n}, function next() {\n var state = getInternalState(this);\n var string = state.string;\n var index = state.index;\n var point;\n if (index >= string.length) return { value: undefined, done: true };\n point = charAt(string, index);\n state.index += point.length;\n return { value: point, done: false };\n});\n","'use strict';\nvar $ = require('../internals/export');\nvar DESCRIPTORS = require('../internals/descriptors');\nvar getPrototypeOf = require('../internals/object-get-prototype-of');\nvar setPrototypeOf = require('../internals/object-set-prototype-of');\nvar create = require('../internals/object-create');\nvar defineProperty = require('../internals/object-define-property');\nvar createPropertyDescriptor = require('../internals/create-property-descriptor');\nvar iterate = require('../internals/iterate');\nvar createNonEnumerableProperty = require('../internals/create-non-enumerable-property');\nvar InternalStateModule = require('../internals/internal-state');\n\nvar setInternalState = InternalStateModule.set;\nvar getInternalAggregateErrorState = InternalStateModule.getterFor('AggregateError');\n\nvar $AggregateError = function AggregateError(errors, message) {\n var that = this;\n if (!(that instanceof $AggregateError)) return new $AggregateError(errors, message);\n if (setPrototypeOf) {\n that = setPrototypeOf(new Error(message), getPrototypeOf(that));\n }\n var errorsArray = [];\n iterate(errors, errorsArray.push, errorsArray);\n if (DESCRIPTORS) setInternalState(that, { errors: errorsArray, type: 'AggregateError' });\n else that.errors = errorsArray;\n if (message !== undefined) createNonEnumerableProperty(that, 'message', String(message));\n return that;\n};\n\n$AggregateError.prototype = create(Error.prototype, {\n constructor: createPropertyDescriptor(5, $AggregateError),\n message: createPropertyDescriptor(5, ''),\n name: createPropertyDescriptor(5, 'AggregateError')\n});\n\nif (DESCRIPTORS) defineProperty.f($AggregateError.prototype, 'errors', {\n get: function () {\n return getInternalAggregateErrorState(this).errors;\n },\n configurable: true\n});\n\n$({ global: true }, {\n AggregateError: $AggregateError\n});\n","// TODO: Remove from `core-js@4`\nrequire('./es.promise.all-settled.js');\n","'use strict';\nvar $ = require('../internals/export');\nvar aFunction = require('../internals/a-function');\nvar getBuiltIn = require('../internals/get-built-in');\nvar newPromiseCapabilityModule = require('../internals/new-promise-capability');\nvar perform = require('../internals/perform');\nvar iterate = require('../internals/iterate');\n\nvar PROMISE_ANY_ERROR = 'No one promise resolved';\n\n// `Promise.any` method\n// https://github.com/tc39/proposal-promise-any\n$({ target: 'Promise', stat: true }, {\n any: function any(iterable) {\n var C = this;\n var capability = newPromiseCapabilityModule.f(C);\n var resolve = capability.resolve;\n var reject = capability.reject;\n var result = perform(function () {\n var promiseResolve = aFunction(C.resolve);\n var errors = [];\n var counter = 0;\n var remaining = 1;\n var alreadyResolved = false;\n iterate(iterable, function (promise) {\n var index = counter++;\n var alreadyRejected = false;\n errors.push(undefined);\n remaining++;\n promiseResolve.call(C, promise).then(function (value) {\n if (alreadyRejected || alreadyResolved) return;\n alreadyResolved = true;\n resolve(value);\n }, function (e) {\n if (alreadyRejected || alreadyResolved) return;\n alreadyRejected = true;\n errors[index] = e;\n --remaining || reject(new (getBuiltIn('AggregateError'))(errors, PROMISE_ANY_ERROR));\n });\n });\n --remaining || reject(new (getBuiltIn('AggregateError'))(errors, PROMISE_ANY_ERROR));\n });\n if (result.error) reject(result.value);\n return capability.promise;\n }\n});\n","'use strict';\nvar $ = require('../internals/export');\nvar newPromiseCapabilityModule = require('../internals/new-promise-capability');\nvar perform = require('../internals/perform');\n\n// `Promise.try` method\n// https://github.com/tc39/proposal-promise-try\n$({ target: 'Promise', stat: true }, {\n 'try': function (callbackfn) {\n var promiseCapability = newPromiseCapabilityModule.f(this);\n var result = perform(callbackfn);\n (result.error ? promiseCapability.reject : promiseCapability.resolve)(result.value);\n return promiseCapability.promise;\n }\n});\n","require('./es.array.iterator');\nvar DOMIterables = require('../internals/dom-iterables');\nvar global = require('../internals/global');\nvar classof = require('../internals/classof');\nvar createNonEnumerableProperty = require('../internals/create-non-enumerable-property');\nvar Iterators = require('../internals/iterators');\nvar wellKnownSymbol = require('../internals/well-known-symbol');\n\nvar TO_STRING_TAG = wellKnownSymbol('toStringTag');\n\nfor (var COLLECTION_NAME in DOMIterables) {\n var Collection = global[COLLECTION_NAME];\n var CollectionPrototype = Collection && Collection.prototype;\n if (CollectionPrototype && classof(CollectionPrototype) !== TO_STRING_TAG) {\n createNonEnumerableProperty(CollectionPrototype, TO_STRING_TAG, COLLECTION_NAME);\n }\n Iterators[COLLECTION_NAME] = Iterators.Array;\n}\n","var g;\n\n// This works in non-strict mode\ng = (function() {\n\treturn this;\n})();\n\ntry {\n\t// This works if eval is allowed (see CSP)\n\tg = g || new Function(\"return this\")();\n} catch (e) {\n\t// This works if the window reference is available\n\tif (typeof window === \"object\") g = window;\n}\n\n// g can still be undefined, but nothing to do about it...\n// We return undefined, instead of nothing here, so it's\n// easier to handle this case. if(!global) { ...}\n\nmodule.exports = g;\n","// extracted by mini-css-extract-plugin","import '@/polyfill';\nimport ImageEditor from '@/imageEditor';\nimport '@css/index.styl';\n\n// commands\nimport '@/command/addIcon';\nimport '@/command/addImageObject';\nimport '@/command/addObject';\nimport '@/command/addShape';\nimport '@/command/addText';\nimport '@/command/applyFilter';\nimport '@/command/changeIconColor';\nimport '@/command/changeShape';\nimport '@/command/changeText';\nimport '@/command/changeTextStyle';\nimport '@/command/clearObjects';\nimport '@/command/flip';\nimport '@/command/loadImage';\nimport '@/command/removeFilter';\nimport '@/command/removeObject';\nimport '@/command/resizeCanvasDimension';\nimport '@/command/rotate';\nimport '@/command/setObjectProperties';\nimport '@/command/setObjectPosition';\nimport '@/command/changeSelection';\n\nmodule.exports = ImageEditor;\n","import { extend } from 'tui-code-snippet';\nimport Imagetracer from '@/helper/imagetracer';\nimport { isSupportFileApi, base64ToBlob, toInteger, isEmptyCropzone } from '@/util';\nimport { eventNames, historyNames, drawingModes, drawingMenuNames, zoomModes } from '@/consts';\n\nexport default {\n /**\n * Get ui actions\n * @returns {Object} actions for ui\n * @private\n */\n getActions() {\n return {\n main: this._mainAction(),\n shape: this._shapeAction(),\n crop: this._cropAction(),\n flip: this._flipAction(),\n rotate: this._rotateAction(),\n text: this._textAction(),\n mask: this._maskAction(),\n draw: this._drawAction(),\n icon: this._iconAction(),\n filter: this._filterAction(),\n history: this._historyAction(),\n };\n },\n\n /**\n * Main Action\n * @returns {Object} actions for ui main\n * @private\n */\n _mainAction() {\n const exitCropOnAction = () => {\n if (this.ui.submenu === 'crop') {\n this.stopDrawingMode();\n this.ui.changeMenu('crop');\n }\n };\n const setAngleRangeBarOnAction = (angle) => {\n if (this.ui.submenu === 'rotate') {\n this.ui.rotate.setRangeBarAngle('setAngle', angle);\n }\n };\n const setFilterStateRangeBarOnAction = (filterOptions) => {\n if (this.ui.submenu === 'filter') {\n this.ui.filter.setFilterState(filterOptions);\n }\n };\n const onEndUndoRedo = (result) => {\n setAngleRangeBarOnAction(result);\n setFilterStateRangeBarOnAction(result);\n\n return result;\n };\n const toggleZoomMode = () => {\n const zoomMode = this._graphics.getZoomMode();\n\n this.stopDrawingMode();\n if (zoomMode !== zoomModes.ZOOM) {\n this.startDrawingMode(drawingModes.ZOOM);\n this._graphics.startZoomInMode();\n } else {\n this._graphics.endZoomInMode();\n }\n };\n const toggleHandMode = () => {\n const zoomMode = this._graphics.getZoomMode();\n\n this.stopDrawingMode();\n if (zoomMode !== zoomModes.HAND) {\n this.startDrawingMode(drawingModes.ZOOM);\n this._graphics.startHandMode();\n } else {\n this._graphics.endHandMode();\n }\n };\n\n return extend(\n {\n initLoadImage: (imagePath, imageName) =>\n this.loadImageFromURL(imagePath, imageName).then((sizeValue) => {\n exitCropOnAction();\n this.ui.initializeImgUrl = imagePath;\n this.ui.resizeEditor({ imageSize: sizeValue });\n this.clearUndoStack();\n this._invoker.fire(eventNames.EXECUTE_COMMAND, historyNames.LOAD_IMAGE);\n }),\n undo: () => {\n if (!this.isEmptyUndoStack()) {\n exitCropOnAction();\n this.deactivateAll();\n this.undo().then(onEndUndoRedo);\n }\n },\n redo: () => {\n if (!this.isEmptyRedoStack()) {\n exitCropOnAction();\n this.deactivateAll();\n this.redo().then(onEndUndoRedo);\n }\n },\n reset: () => {\n exitCropOnAction();\n this.loadImageFromURL(this.ui.initializeImgUrl, 'resetImage').then((sizeValue) => {\n exitCropOnAction();\n this.ui.resizeEditor({ imageSize: sizeValue });\n this.clearUndoStack();\n this._initHistory();\n });\n },\n delete: () => {\n this.ui.changeHelpButtonEnabled('delete', false);\n exitCropOnAction();\n this.removeActiveObject();\n this.activeObjectId = null;\n },\n deleteAll: () => {\n exitCropOnAction();\n this.clearObjects();\n this.ui.changeHelpButtonEnabled('delete', false);\n this.ui.changeHelpButtonEnabled('deleteAll', false);\n },\n load: (file) => {\n if (!isSupportFileApi()) {\n alert('This browser does not support file-api');\n }\n\n this.ui.initializeImgUrl = URL.createObjectURL(file);\n this.loadImageFromFile(file)\n .then((sizeValue) => {\n exitCropOnAction();\n this.clearUndoStack();\n this.ui.activeMenuEvent();\n this.ui.resizeEditor({ imageSize: sizeValue });\n this._clearHistory();\n this._invoker.fire(eventNames.EXECUTE_COMMAND, historyNames.LOAD_IMAGE);\n })\n ['catch']((message) => Promise.reject(message));\n },\n download: () => {\n const dataURL = this.toDataURL();\n let imageName = this.getImageName();\n let blob, type, w;\n\n if (isSupportFileApi() && window.saveAs) {\n blob = base64ToBlob(dataURL);\n type = blob.type.split('/')[1];\n if (imageName.split('.').pop() !== type) {\n imageName += `.${type}`;\n }\n saveAs(blob, imageName); // eslint-disable-line\n } else {\n w = window.open();\n w.document.body.innerHTML = ``;\n }\n },\n history: (event) => {\n this.ui.toggleHistoryMenu(event);\n },\n zoomIn: () => {\n this.ui.toggleZoomButtonStatus('zoomIn');\n this.deactivateAll();\n toggleZoomMode();\n },\n zoomOut: () => {\n this._graphics.zoomOut();\n },\n hand: () => {\n this.ui.offZoomInButtonStatus();\n this.ui.toggleZoomButtonStatus('hand');\n this.deactivateAll();\n toggleHandMode();\n },\n },\n this._commonAction()\n );\n },\n\n /**\n * Icon Action\n * @returns {Object} actions for ui icon\n * @private\n */\n _iconAction() {\n return extend(\n {\n changeColor: (color) => {\n if (this.activeObjectId) {\n this.changeIconColor(this.activeObjectId, color);\n }\n },\n addIcon: (iconType, iconColor) => {\n this.startDrawingMode('ICON');\n this.setDrawingIcon(iconType, iconColor);\n },\n cancelAddIcon: () => {\n this.ui.icon.clearIconType();\n this.changeSelectableAll(true);\n this.changeCursor('default');\n this.stopDrawingMode();\n },\n registerDefaultIcons: (type, path) => {\n const iconObj = {};\n iconObj[type] = path;\n this.registerIcons(iconObj);\n },\n registerCustomIcon: (imgUrl, file) => {\n const imagetracer = new Imagetracer();\n imagetracer.imageToSVG(\n imgUrl,\n (svgstr) => {\n const [, svgPath] = svgstr.match(/path[^>]*d=\"([^\"]*)\"/);\n const iconObj = {};\n iconObj[file.name] = svgPath;\n this.registerIcons(iconObj);\n this.addIcon(file.name, {\n left: 100,\n top: 100,\n });\n },\n Imagetracer.tracerDefaultOption()\n );\n },\n },\n this._commonAction()\n );\n },\n\n /**\n * Draw Action\n * @returns {Object} actions for ui draw\n * @private\n */\n _drawAction() {\n return extend(\n {\n setDrawMode: (type, settings) => {\n this.stopDrawingMode();\n if (type === 'free') {\n this.startDrawingMode('FREE_DRAWING', settings);\n } else {\n this.startDrawingMode('LINE_DRAWING', settings);\n }\n },\n setColor: (color) => {\n this.setBrush({\n color,\n });\n },\n },\n this._commonAction()\n );\n },\n\n /**\n * Mask Action\n * @returns {Object} actions for ui mask\n * @private\n */\n _maskAction() {\n return extend(\n {\n loadImageFromURL: (imgUrl, file) => {\n return this.loadImageFromURL(this.toDataURL(), 'FilterImage').then(() => {\n this.addImageObject(imgUrl).then(() => {\n URL.revokeObjectURL(file);\n });\n this._invoker.fire(eventNames.EXECUTE_COMMAND, historyNames.LOAD_MASK_IMAGE);\n });\n },\n applyFilter: () => {\n this.applyFilter('mask', {\n maskObjId: this.activeObjectId,\n });\n },\n },\n this._commonAction()\n );\n },\n\n /**\n * Text Action\n * @returns {Object} actions for ui text\n * @private\n */\n _textAction() {\n return extend(\n {\n changeTextStyle: (styleObj, isSilent) => {\n if (this.activeObjectId) {\n this.changeTextStyle(this.activeObjectId, styleObj, isSilent);\n }\n },\n },\n this._commonAction()\n );\n },\n\n /**\n * Rotate Action\n * @returns {Object} actions for ui rotate\n * @private\n */\n _rotateAction() {\n return extend(\n {\n rotate: (angle, isSilent) => {\n this.rotate(angle, isSilent);\n this.ui.resizeEditor();\n this.ui.rotate.setRangeBarAngle('rotate', angle);\n },\n setAngle: (angle, isSilent) => {\n this.setAngle(angle, isSilent);\n this.ui.resizeEditor();\n this.ui.rotate.setRangeBarAngle('setAngle', angle);\n },\n },\n this._commonAction()\n );\n },\n\n /**\n * Shape Action\n * @returns {Object} actions for ui shape\n * @private\n */\n _shapeAction() {\n return extend(\n {\n changeShape: (changeShapeObject, isSilent) => {\n if (this.activeObjectId) {\n this.changeShape(this.activeObjectId, changeShapeObject, isSilent);\n }\n },\n setDrawingShape: (shapeType) => {\n this.setDrawingShape(shapeType);\n },\n },\n this._commonAction()\n );\n },\n\n /**\n * Crop Action\n * @returns {Object} actions for ui crop\n * @private\n */\n _cropAction() {\n return extend(\n {\n crop: () => {\n const cropRect = this.getCropzoneRect();\n if (cropRect && !isEmptyCropzone(cropRect)) {\n this.crop(cropRect)\n .then(() => {\n this.stopDrawingMode();\n this.ui.resizeEditor();\n this.ui.changeMenu('crop');\n this._invoker.fire(eventNames.EXECUTE_COMMAND, historyNames.CROP);\n })\n ['catch']((message) => Promise.reject(message));\n }\n },\n cancel: () => {\n this.stopDrawingMode();\n this.ui.changeMenu('crop');\n },\n /* eslint-disable */\n preset: (presetType) => {\n switch (presetType) {\n case 'preset-square':\n this.setCropzoneRect(1 / 1);\n break;\n case 'preset-3-2':\n this.setCropzoneRect(3 / 2);\n break;\n case 'preset-4-3':\n this.setCropzoneRect(4 / 3);\n break;\n case 'preset-5-4':\n this.setCropzoneRect(5 / 4);\n break;\n case 'preset-7-5':\n this.setCropzoneRect(7 / 5);\n break;\n case 'preset-16-9':\n this.setCropzoneRect(16 / 9);\n break;\n default:\n this.setCropzoneRect();\n this.ui.crop.changeApplyButtonStatus(false);\n break;\n }\n },\n },\n this._commonAction()\n );\n },\n\n /**\n * Flip Action\n * @returns {Object} actions for ui flip\n * @private\n */\n _flipAction() {\n return extend(\n {\n flip: (flipType) => this[flipType](),\n },\n this._commonAction()\n );\n },\n\n /**\n * Filter Action\n * @returns {Object} actions for ui filter\n * @private\n */\n _filterAction() {\n return extend(\n {\n applyFilter: (applying, type, options, isSilent) => {\n if (applying) {\n this.applyFilter(type, options, isSilent);\n } else if (this.hasFilter(type)) {\n this.removeFilter(type);\n }\n },\n },\n this._commonAction()\n );\n },\n\n /**\n * Image Editor Event Observer\n */\n setReAction() {\n this.on({\n undoStackChanged: (length) => {\n if (length) {\n this.ui.changeHelpButtonEnabled('undo', true);\n this.ui.changeHelpButtonEnabled('reset', true);\n } else {\n this.ui.changeHelpButtonEnabled('undo', false);\n this.ui.changeHelpButtonEnabled('reset', false);\n }\n this.ui.resizeEditor();\n },\n redoStackChanged: (length) => {\n if (length) {\n this.ui.changeHelpButtonEnabled('redo', true);\n } else {\n this.ui.changeHelpButtonEnabled('redo', false);\n }\n this.ui.resizeEditor();\n },\n /* eslint-disable complexity */\n objectActivated: (obj) => {\n this.activeObjectId = obj.id;\n\n this.ui.changeHelpButtonEnabled('delete', true);\n this.ui.changeHelpButtonEnabled('deleteAll', true);\n\n if (obj.type === 'cropzone') {\n this.ui.crop.changeApplyButtonStatus(true);\n } else if (['rect', 'circle', 'triangle'].indexOf(obj.type) > -1) {\n this.stopDrawingMode();\n if (this.ui.submenu !== 'shape') {\n this.ui.changeMenu('shape', false, false);\n }\n this.ui.shape.setShapeStatus({\n strokeColor: obj.stroke,\n strokeWidth: obj.strokeWidth,\n fillColor: obj.fill,\n });\n\n this.ui.shape.setMaxStrokeValue(Math.min(obj.width, obj.height));\n } else if (obj.type === 'path' || obj.type === 'line') {\n if (this.ui.submenu !== 'draw') {\n this.ui.changeMenu('draw', false, false);\n this.ui.draw.changeStandbyMode();\n }\n } else if (['i-text', 'text'].indexOf(obj.type) > -1) {\n if (this.ui.submenu !== 'text') {\n this.ui.changeMenu('text', false, false);\n }\n\n this.ui.text.setTextStyleStateOnAction(obj);\n } else if (obj.type === 'icon') {\n this.stopDrawingMode();\n if (this.ui.submenu !== 'icon') {\n this.ui.changeMenu('icon', false, false);\n }\n this.ui.icon.setIconPickerColor(obj.fill);\n }\n },\n /* eslint-enable complexity */\n addText: (pos) => {\n const { textColor: fill, fontSize, fontStyle, fontWeight, underline } = this.ui.text;\n const fontFamily = 'Noto Sans';\n\n this.addText('Double Click', {\n position: pos.originPosition,\n styles: { fill, fontSize, fontFamily, fontStyle, fontWeight, underline },\n }).then(() => {\n this.changeCursor('default');\n });\n },\n addObjectAfter: (obj) => {\n if (obj.type === 'icon') {\n this.ui.icon.changeStandbyMode();\n } else if (['rect', 'circle', 'triangle'].indexOf(obj.type) > -1) {\n this.ui.shape.setMaxStrokeValue(Math.min(obj.width, obj.height));\n this.ui.shape.changeStandbyMode();\n }\n },\n objectScaled: (obj) => {\n if (['i-text', 'text'].indexOf(obj.type) > -1) {\n this.ui.text.fontSize = toInteger(obj.fontSize);\n } else if (['rect', 'circle', 'triangle'].indexOf(obj.type) >= 0) {\n const { width, height } = obj;\n const strokeValue = this.ui.shape.getStrokeValue();\n\n if (width < strokeValue) {\n this.ui.shape.setStrokeValue(width);\n }\n if (height < strokeValue) {\n this.ui.shape.setStrokeValue(height);\n }\n }\n },\n selectionCleared: () => {\n this.activeObjectId = null;\n if (this.ui.submenu === 'text') {\n this.changeCursor('text');\n } else if (this.ui.submenu !== 'draw' && this.ui.submenu !== 'crop') {\n this.stopDrawingMode();\n }\n },\n });\n },\n\n /**\n * History Action\n * @returns {Object} history actions for ui\n * @private\n */\n _historyAction() {\n return {\n undo: (count) => this.undo(count),\n redo: (count) => this.redo(count),\n };\n },\n\n /**\n * Common Action\n * @returns {Object} common actions for ui\n * @private\n */\n _commonAction() {\n const { TEXT, CROPPER, SHAPE, ZOOM } = drawingModes;\n\n return {\n modeChange: (menu) => {\n switch (menu) {\n case drawingMenuNames.TEXT:\n this._changeActivateMode(TEXT);\n break;\n case drawingMenuNames.CROP:\n this.startDrawingMode(CROPPER);\n break;\n case drawingMenuNames.SHAPE:\n this._changeActivateMode(SHAPE);\n this.setDrawingShape(this.ui.shape.type, this.ui.shape.options);\n break;\n case drawingMenuNames.ZOOM:\n this.startDrawingMode(ZOOM);\n break;\n default:\n break;\n }\n },\n deactivateAll: this.deactivateAll.bind(this),\n changeSelectableAll: this.changeSelectableAll.bind(this),\n discardSelection: this.discardSelection.bind(this),\n stopDrawingMode: this.stopDrawingMode.bind(this),\n };\n },\n\n /**\n * Mixin\n * @param {ImageEditor} ImageEditor instance\n */\n mixin(ImageEditor) {\n extend(ImageEditor.prototype, this);\n },\n};\n","/**\n * @author NHN. FE Development Team \n * @fileoverview Add an icon\n */\nimport commandFactory from '@/factory/command';\nimport { Promise } from '@/util';\nimport { componentNames, commandNames } from '@/consts';\n\nconst { ICON } = componentNames;\n\nconst command = {\n name: commandNames.ADD_ICON,\n\n /**\n * Add an icon\n * @param {Graphics} graphics - Graphics instance\n * @param {string} type - Icon type ('arrow', 'cancel', custom icon name)\n * @param {Object} options - Icon options\n * @param {string} [options.fill] - Icon foreground color\n * @param {string} [options.left] - Icon x position\n * @param {string} [options.top] - Icon y position\n * @returns {Promise}\n */\n execute(graphics, type, options) {\n const iconComp = graphics.getComponent(ICON);\n\n return iconComp.add(type, options).then((objectProps) => {\n this.undoData.object = graphics.getObject(objectProps.id);\n\n return objectProps;\n });\n },\n\n /**\n * @param {Graphics} graphics - Graphics instance\n * @returns {Promise}\n */\n undo(graphics) {\n graphics.remove(this.undoData.object);\n\n return Promise.resolve();\n },\n};\n\ncommandFactory.register(command);\n\nexport default command;\n","/**\n * @author NHN. FE Development Team \n * @fileoverview Add an image object\n */\nimport commandFactory from '@/factory/command';\nimport { Promise } from '@/util';\nimport { commandNames } from '@/consts';\n\nconst command = {\n name: commandNames.ADD_IMAGE_OBJECT,\n\n /**\n * Add an image object\n * @param {Graphics} graphics - Graphics instance\n * @param {string} imgUrl - Image url to make object\n * @returns {Promise}\n */\n execute(graphics, imgUrl) {\n return graphics.addImageObject(imgUrl).then((objectProps) => {\n this.undoData.object = graphics.getObject(objectProps.id);\n\n return objectProps;\n });\n },\n\n /**\n * @param {Graphics} graphics - Graphics instance\n * @returns {Promise}\n */\n undo(graphics) {\n graphics.remove(this.undoData.object);\n\n return Promise.resolve();\n },\n};\n\ncommandFactory.register(command);\n\nexport default command;\n","/**\n * @author NHN. FE Development Team \n * @fileoverview Add an object\n */\nimport commandFactory from '@/factory/command';\nimport { Promise } from '@/util';\nimport { commandNames, rejectMessages } from '@/consts';\n\nconst command = {\n name: commandNames.ADD_OBJECT,\n\n /**\n * Add an object\n * @param {Graphics} graphics - Graphics instance\n * @param {Object} object - Fabric object\n * @returns {Promise}\n */\n execute(graphics, object) {\n return new Promise((resolve, reject) => {\n if (!graphics.contains(object)) {\n graphics.add(object);\n resolve(object);\n } else {\n reject(rejectMessages.addedObject);\n }\n });\n },\n\n /**\n * @param {Graphics} graphics - Graphics instance\n * @param {Object} object - Fabric object\n * @returns {Promise}\n */\n undo(graphics, object) {\n return new Promise((resolve, reject) => {\n if (graphics.contains(object)) {\n graphics.remove(object);\n resolve(object);\n } else {\n reject(rejectMessages.noObject);\n }\n });\n },\n};\n\ncommandFactory.register(command);\n\nexport default command;\n","/**\n * @author NHN. FE Development Team \n * @fileoverview Add a shape\n */\nimport commandFactory from '@/factory/command';\nimport { Promise } from '@/util';\nimport { componentNames, commandNames } from '@/consts';\n\nconst { SHAPE } = componentNames;\n\nconst command = {\n name: commandNames.ADD_SHAPE,\n\n /**\n * Add a shape\n * @param {Graphics} graphics - Graphics instance\n * @param {string} type - Shape type (ex: 'rect', 'circle', 'triangle')\n * @param {Object} options - Shape options\n * @param {string} [options.fill] - Shape foreground color (ex: '#fff', 'transparent')\n * @param {string} [options.stroke] - Shape outline color\n * @param {number} [options.strokeWidth] - Shape outline width\n * @param {number} [options.width] - Width value (When type option is 'rect', this options can use)\n * @param {number} [options.height] - Height value (When type option is 'rect', this options can use)\n * @param {number} [options.rx] - Radius x value (When type option is 'circle', this options can use)\n * @param {number} [options.ry] - Radius y value (When type option is 'circle', this options can use)\n * @param {number} [options.left] - Shape x position\n * @param {number} [options.top] - Shape y position\n * @param {number} [options.isRegular] - Whether resizing shape has 1:1 ratio or not\n * @returns {Promise}\n */\n execute(graphics, type, options) {\n const shapeComp = graphics.getComponent(SHAPE);\n\n return shapeComp.add(type, options).then((objectProps) => {\n const { id } = objectProps;\n\n this.undoData.object = graphics.getObject(id);\n\n return objectProps;\n });\n },\n\n /**\n * @param {Graphics} graphics - Graphics instance\n * @returns {Promise}\n */\n undo(graphics) {\n graphics.remove(this.undoData.object);\n\n return Promise.resolve();\n },\n};\n\ncommandFactory.register(command);\n\nexport default command;\n","/**\n * @author NHN. FE Development Team \n * @fileoverview Add a text object\n */\nimport commandFactory from '@/factory/command';\nimport { Promise } from '@/util';\nimport { componentNames, commandNames, rejectMessages } from '@/consts';\nimport {\n setCachedUndoDataForDimension,\n makeSelectionUndoData,\n makeSelectionUndoDatum,\n} from '@/helper/selectionModifyHelper';\n\nconst { TEXT } = componentNames;\n\nconst command = {\n name: commandNames.ADD_TEXT,\n\n /**\n * Add a text object\n * @param {Graphics} graphics - Graphics instance\n * @param {string} text - Initial input text\n * @param {Object} [options] Options for text styles\n * @param {Object} [options.styles] Initial styles\n * @param {string} [options.styles.fill] Color\n * @param {string} [options.styles.fontFamily] Font type for text\n * @param {number} [options.styles.fontSize] Size\n * @param {string} [options.styles.fontStyle] Type of inclination (normal / italic)\n * @param {string} [options.styles.fontWeight] Type of thicker or thinner looking (normal / bold)\n * @param {string} [options.styles.textAlign] Type of text align (left / center / right)\n * @param {string} [options.styles.textDecoration] Type of line (underline / line-through / overline)\n * @param {{x: number, y: number}} [options.position] - Initial position\n * @returns {Promise}\n */\n execute(graphics, text, options) {\n const textComp = graphics.getComponent(TEXT);\n\n if (this.undoData.object) {\n const undoObject = this.undoData.object;\n\n return new Promise((resolve, reject) => {\n if (!graphics.contains(undoObject)) {\n graphics.add(undoObject);\n resolve(undoObject);\n } else {\n reject(rejectMessages.redo);\n }\n });\n }\n\n return textComp.add(text, options).then((objectProps) => {\n const { id } = objectProps;\n const textObject = graphics.getObject(id);\n\n this.undoData.object = textObject;\n\n setCachedUndoDataForDimension(\n makeSelectionUndoData(textObject, () => makeSelectionUndoDatum(id, textObject, false))\n );\n\n return objectProps;\n });\n },\n\n /**\n * @param {Graphics} graphics - Graphics instance\n * @returns {Promise}\n */\n undo(graphics) {\n graphics.remove(this.undoData.object);\n\n return Promise.resolve();\n },\n};\n\ncommandFactory.register(command);\n\nexport default command;\n","/**\n * @author NHN. FE Development Team \n * @fileoverview Apply a filter into an image\n */\nimport snippet from 'tui-code-snippet';\nimport commandFactory from '@/factory/command';\nimport { componentNames, rejectMessages, commandNames } from '@/consts';\n\nconst { FILTER } = componentNames;\n\n/**\n * Cached data for undo\n * @type {Object}\n */\nlet cachedUndoDataForSilent = null;\n\n/**\n * Make undoData\n * @param {string} type - Filter type\n * @param {Object} prevfilterOption - prev Filter options\n * @param {Object} options - Filter options\n * @returns {object} - undo data\n */\nfunction makeUndoData(type, prevfilterOption, options) {\n const undoData = {};\n\n if (type === 'mask') {\n undoData.object = options.mask;\n }\n\n undoData.options = prevfilterOption;\n\n return undoData;\n}\n\nconst command = {\n name: commandNames.APPLY_FILTER,\n\n /**\n * Apply a filter into an image\n * @param {Graphics} graphics - Graphics instance\n * @param {string} type - Filter type\n * @param {Object} options - Filter options\n * @param {number} options.maskObjId - masking image object id\n * @param {boolean} isSilent - is silent execution or not\n * @returns {Promise}\n */\n execute(graphics, type, options, isSilent) {\n const filterComp = graphics.getComponent(FILTER);\n\n if (type === 'mask') {\n const maskObj = graphics.getObject(options.maskObjId);\n\n if (!(maskObj && maskObj.isType('image'))) {\n return Promise.reject(rejectMessages.invalidParameters);\n }\n\n snippet.extend(options, { mask: maskObj });\n graphics.remove(options.mask);\n }\n if (!this.isRedo) {\n const prevfilterOption = filterComp.getOptions(type);\n const undoData = makeUndoData(type, prevfilterOption, options);\n\n cachedUndoDataForSilent = this.setUndoData(undoData, cachedUndoDataForSilent, isSilent);\n }\n\n return filterComp.add(type, options);\n },\n\n /**\n * @param {Graphics} graphics - Graphics instance\n * @param {string} type - Filter type\n * @returns {Promise}\n */\n undo(graphics, type) {\n const filterComp = graphics.getComponent(FILTER);\n\n if (type === 'mask') {\n const mask = this.undoData.object;\n graphics.add(mask);\n graphics.setActiveObject(mask);\n\n return filterComp.remove(type);\n }\n\n // options changed case\n if (this.undoData.options) {\n return filterComp.add(type, this.undoData.options);\n }\n\n // filter added case\n return filterComp.remove(type);\n },\n};\n\ncommandFactory.register(command);\n\nexport default command;\n","/**\n * @author NHN. FE Development Team \n * @fileoverview Change icon color\n */\nimport commandFactory from '@/factory/command';\nimport { Promise } from '@/util';\nimport { componentNames, rejectMessages, commandNames } from '@/consts';\n\nconst { ICON } = componentNames;\n\nconst command = {\n name: commandNames.CHANGE_ICON_COLOR,\n\n /**\n * Change icon color\n * @param {Graphics} graphics - Graphics instance\n * @param {number} id - object id\n * @param {string} color - Color for icon\n * @returns {Promise}\n */\n execute(graphics, id, color) {\n return new Promise((resolve, reject) => {\n const iconComp = graphics.getComponent(ICON);\n const targetObj = graphics.getObject(id);\n\n if (!targetObj) {\n reject(rejectMessages.noObject);\n }\n\n this.undoData.object = targetObj;\n this.undoData.color = iconComp.getColor(targetObj);\n iconComp.setColor(color, targetObj);\n resolve();\n });\n },\n\n /**\n * @param {Graphics} graphics - Graphics instance\n * @returns {Promise}\n */\n undo(graphics) {\n const iconComp = graphics.getComponent(ICON);\n const { object: icon, color } = this.undoData;\n\n iconComp.setColor(color, icon);\n\n return Promise.resolve();\n },\n};\n\ncommandFactory.register(command);\n\nexport default command;\n","/**\n * @author NHN. FE Development Team \n * @fileoverview change selection\n */\nimport commandFactory from '@/factory/command';\nimport { Promise } from '@/util';\nimport { commandNames } from '@/consts';\nimport { getCachedUndoDataForDimension } from '@/helper/selectionModifyHelper';\n\nconst command = {\n name: commandNames.CHANGE_SELECTION,\n\n execute(graphics, props) {\n if (this.isRedo) {\n props.forEach((prop) => {\n graphics.setObjectProperties(prop.id, prop);\n });\n } else {\n this.undoData = getCachedUndoDataForDimension();\n }\n\n return Promise.resolve();\n },\n\n undo(graphics) {\n this.undoData.forEach((datum) => {\n graphics.setObjectProperties(datum.id, datum);\n });\n\n return Promise.resolve();\n },\n};\n\ncommandFactory.register(command);\n\nexport default command;\n","/**\n * @author NHN. FE Development Team \n * @fileoverview change a shape\n */\nimport snippet from 'tui-code-snippet';\nimport commandFactory from '@/factory/command';\nimport { Promise } from '@/util';\nimport { componentNames, rejectMessages, commandNames } from '@/consts';\n\nconst { SHAPE } = componentNames;\n\n/**\n * Cached data for undo\n * @type {Object}\n */\nlet cachedUndoDataForSilent = null;\n\n/**\n * Make undoData\n * @param {object} options - shape options\n * @param {Component} targetObj - shape component\n * @returns {object} - undo data\n */\nfunction makeUndoData(options, targetObj) {\n const undoData = {\n object: targetObj,\n options: {},\n };\n\n snippet.forEachOwnProperties(options, (value, key) => {\n undoData.options[key] = targetObj[key];\n });\n\n return undoData;\n}\n\nconst command = {\n name: commandNames.CHANGE_SHAPE,\n\n /**\n * Change a shape\n * @param {Graphics} graphics - Graphics instance\n * @param {number} id - object id\n * @param {Object} options - Shape options\n * @param {string} [options.fill] - Shape foreground color (ex: '#fff', 'transparent')\n * @param {string} [options.stroke] - Shape outline color\n * @param {number} [options.strokeWidth] - Shape outline width\n * @param {number} [options.width] - Width value (When type option is 'rect', this options can use)\n * @param {number} [options.height] - Height value (When type option is 'rect', this options can use)\n * @param {number} [options.rx] - Radius x value (When type option is 'circle', this options can use)\n * @param {number} [options.ry] - Radius y value (When type option is 'circle', this options can use)\n * @param {number} [options.left] - Shape x position\n * @param {number} [options.top] - Shape y position\n * @param {number} [options.isRegular] - Whether resizing shape has 1:1 ratio or not\n * @param {boolean} isSilent - is silent execution or not\n * @returns {Promise}\n */\n execute(graphics, id, options, isSilent) {\n const shapeComp = graphics.getComponent(SHAPE);\n const targetObj = graphics.getObject(id);\n\n if (!targetObj) {\n return Promise.reject(rejectMessages.noObject);\n }\n\n if (!this.isRedo) {\n const undoData = makeUndoData(options, targetObj);\n\n cachedUndoDataForSilent = this.setUndoData(undoData, cachedUndoDataForSilent, isSilent);\n }\n\n return shapeComp.change(targetObj, options);\n },\n\n /**\n * @param {Graphics} graphics - Graphics instance\n * @returns {Promise}\n */\n undo(graphics) {\n const shapeComp = graphics.getComponent(SHAPE);\n const { object: shape, options } = this.undoData;\n\n return shapeComp.change(shape, options);\n },\n};\n\ncommandFactory.register(command);\n\nexport default command;\n","/**\n * @author NHN. FE Development Team \n * @fileoverview Change a text\n */\nimport commandFactory from '@/factory/command';\nimport { Promise } from '@/util';\nimport { componentNames, rejectMessages, commandNames } from '@/consts';\n\nconst { TEXT } = componentNames;\n\nconst command = {\n name: commandNames.CHANGE_TEXT,\n\n /**\n * Change a text\n * @param {Graphics} graphics - Graphics instance\n * @param {number} id - object id\n * @param {string} text - Changing text\n * @returns {Promise}\n */\n execute(graphics, id, text) {\n const textComp = graphics.getComponent(TEXT);\n const targetObj = graphics.getObject(id);\n\n if (!targetObj) {\n return Promise.reject(rejectMessages.noObject);\n }\n\n this.undoData.object = targetObj;\n this.undoData.text = textComp.getText(targetObj);\n\n return textComp.change(targetObj, text);\n },\n\n /**\n * @param {Graphics} graphics - Graphics instance\n * @returns {Promise}\n */\n undo(graphics) {\n const textComp = graphics.getComponent(TEXT);\n const { object: textObj, text } = this.undoData;\n\n return textComp.change(textObj, text);\n },\n};\n\ncommandFactory.register(command);\n\nexport default command;\n","/**\n * @author NHN. FE Development Team \n * @fileoverview Change text styles\n */\nimport snippet from 'tui-code-snippet';\nimport commandFactory from '@/factory/command';\nimport { Promise } from '@/util';\nimport { componentNames, rejectMessages, commandNames } from '@/consts';\n\nconst { TEXT } = componentNames;\n\n/**\n * Cached data for undo\n * @type {Object}\n */\nlet cachedUndoDataForSilent = null;\n\n/**\n * Make undoData\n * @param {object} styles - text styles\n * @param {Component} targetObj - text component\n * @returns {object} - undo data\n */\nfunction makeUndoData(styles, targetObj) {\n const undoData = {\n object: targetObj,\n styles: {},\n };\n snippet.forEachOwnProperties(styles, (value, key) => {\n const undoValue = targetObj[key];\n undoData.styles[key] = undoValue;\n });\n\n return undoData;\n}\n\nconst command = {\n name: commandNames.CHANGE_TEXT_STYLE,\n\n /**\n * Change text styles\n * @param {Graphics} graphics - Graphics instance\n * @param {number} id - object id\n * @param {Object} styles - text styles\n * @param {string} [styles.fill] Color\n * @param {string} [styles.fontFamily] Font type for text\n * @param {number} [styles.fontSize] Size\n * @param {string} [styles.fontStyle] Type of inclination (normal / italic)\n * @param {string} [styles.fontWeight] Type of thicker or thinner looking (normal / bold)\n * @param {string} [styles.textAlign] Type of text align (left / center / right)\n * @param {string} [styles.textDecoration] Type of line (underline / line-through / overline)\n * @param {boolean} isSilent - is silent execution or not\n * @returns {Promise}\n */\n execute(graphics, id, styles, isSilent) {\n const textComp = graphics.getComponent(TEXT);\n const targetObj = graphics.getObject(id);\n\n if (!targetObj) {\n return Promise.reject(rejectMessages.noObject);\n }\n if (!this.isRedo) {\n const undoData = makeUndoData(styles, targetObj);\n\n cachedUndoDataForSilent = this.setUndoData(undoData, cachedUndoDataForSilent, isSilent);\n }\n\n return textComp.setStyle(targetObj, styles);\n },\n\n /**\n * @param {Graphics} graphics - Graphics instance\n * @returns {Promise}\n */\n undo(graphics) {\n const textComp = graphics.getComponent(TEXT);\n const { object: textObj, styles } = this.undoData;\n\n return textComp.setStyle(textObj, styles);\n },\n};\n\ncommandFactory.register(command);\n\nexport default command;\n","/**\n * @author NHN. FE Development Team \n * @fileoverview Clear all objects\n */\nimport commandFactory from '@/factory/command';\nimport { Promise } from '@/util';\nimport { commandNames } from '@/consts';\n\nconst command = {\n name: commandNames.CLEAR_OBJECTS,\n\n /**\n * Clear all objects without background (main) image\n * @param {Graphics} graphics - Graphics instance\n * @returns {Promise}\n */\n execute(graphics) {\n return new Promise((resolve) => {\n this.undoData.objects = graphics.removeAll();\n resolve();\n });\n },\n\n /**\n * @param {Graphics} graphics - Graphics instance\n * @returns {Promise}\n * @ignore\n */\n undo(graphics) {\n graphics.add(this.undoData.objects);\n\n return Promise.resolve();\n },\n};\n\ncommandFactory.register(command);\n\nexport default command;\n","/**\n * @author NHN. FE Development Team \n * @fileoverview Flip an image\n */\nimport commandFactory from '@/factory/command';\nimport { componentNames, commandNames } from '@/consts';\n\nconst { FLIP } = componentNames;\n\nconst command = {\n name: commandNames.FLIP_IMAGE,\n\n /**\n * flip an image\n * @param {Graphics} graphics - Graphics instance\n * @param {string} type - 'flipX' or 'flipY' or 'reset'\n * @returns {Promise}\n */\n execute(graphics, type) {\n const flipComp = graphics.getComponent(FLIP);\n\n this.undoData.setting = flipComp.getCurrentSetting();\n\n return flipComp[type]();\n },\n\n /**\n * @param {Graphics} graphics - Graphics instance\n * @returns {Promise}\n */\n undo(graphics) {\n const flipComp = graphics.getComponent(FLIP);\n\n return flipComp.set(this.undoData.setting);\n },\n};\n\ncommandFactory.register(command);\n\nexport default command;\n","/**\n * @author NHN. FE Development Team \n * @fileoverview Load a background (main) image\n */\nimport commandFactory from '@/factory/command';\nimport { componentNames, commandNames } from '@/consts';\n\nconst { IMAGE_LOADER } = componentNames;\n\nconst command = {\n name: commandNames.LOAD_IMAGE,\n\n /**\n * Load a background (main) image\n * @param {Graphics} graphics - Graphics instance\n * @param {string} imageName - Image name\n * @param {string} imgUrl - Image Url\n * @returns {Promise}\n */\n execute(graphics, imageName, imgUrl) {\n const loader = graphics.getComponent(IMAGE_LOADER);\n const prevImage = loader.getCanvasImage();\n const prevImageWidth = prevImage ? prevImage.width : 0;\n const prevImageHeight = prevImage ? prevImage.height : 0;\n const objects = graphics.removeAll(true).filter((objectItem) => objectItem.type !== 'cropzone');\n\n objects.forEach((objectItem) => {\n objectItem.evented = true;\n });\n\n this.undoData = {\n name: loader.getImageName(),\n image: prevImage,\n objects,\n };\n\n return loader.load(imageName, imgUrl).then((newImage) => ({\n oldWidth: prevImageWidth,\n oldHeight: prevImageHeight,\n newWidth: newImage.width,\n newHeight: newImage.height,\n }));\n },\n\n /**\n * @param {Graphics} graphics - Graphics instance\n * @returns {Promise}\n */\n undo(graphics) {\n const loader = graphics.getComponent(IMAGE_LOADER);\n const { objects, name, image } = this.undoData;\n\n graphics.removeAll(true);\n graphics.add(objects);\n\n return loader.load(name, image);\n },\n};\n\ncommandFactory.register(command);\n\nexport default command;\n","/**\n * @author NHN. FE Development Team \n * @fileoverview Remove a filter from an image\n */\nimport commandFactory from '@/factory/command';\nimport { componentNames, commandNames } from '@/consts';\n\nconst { FILTER } = componentNames;\n\nconst command = {\n name: commandNames.REMOVE_FILTER,\n\n /**\n * Remove a filter from an image\n * @param {Graphics} graphics - Graphics instance\n * @param {string} type - Filter type\n * @returns {Promise}\n */\n execute(graphics, type) {\n const filterComp = graphics.getComponent(FILTER);\n\n this.undoData.options = filterComp.getOptions(type);\n\n return filterComp.remove(type);\n },\n\n /**\n * @param {Graphics} graphics - Graphics instance\n * @param {string} type - Filter type\n * @returns {Promise}\n */\n undo(graphics, type) {\n const filterComp = graphics.getComponent(FILTER);\n const { options } = this.undoData;\n\n return filterComp.add(type, options);\n },\n};\n\ncommandFactory.register(command);\n\nexport default command;\n","/**\n * @author NHN. FE Development Team \n * @fileoverview Remove an object\n */\nimport commandFactory from '@/factory/command';\nimport { Promise } from '@/util';\nimport { commandNames, rejectMessages } from '@/consts';\n\nconst command = {\n name: commandNames.REMOVE_OBJECT,\n\n /**\n * Remove an object\n * @param {Graphics} graphics - Graphics instance\n * @param {number} id - object id\n * @returns {Promise}\n */\n execute(graphics, id) {\n return new Promise((resolve, reject) => {\n this.undoData.objects = graphics.removeObjectById(id);\n if (this.undoData.objects.length) {\n resolve();\n } else {\n reject(rejectMessages.noObject);\n }\n });\n },\n\n /**\n * @param {Graphics} graphics - Graphics instance\n * @returns {Promise}\n */\n undo(graphics) {\n graphics.add(this.undoData.objects);\n\n return Promise.resolve();\n },\n};\n\ncommandFactory.register(command);\n\nexport default command;\n","/**\n * @author NHN. FE Development Team \n * @fileoverview Resize a canvas\n */\nimport commandFactory from '@/factory/command';\nimport { Promise } from '@/util';\nimport { commandNames } from '@/consts';\n\nconst command = {\n name: commandNames.RESIZE_CANVAS_DIMENSION,\n\n /**\n * resize the canvas with given dimension\n * @param {Graphics} graphics - Graphics instance\n * @param {{width: number, height: number}} dimension - Max width & height\n * @returns {Promise}\n */\n execute(graphics, dimension) {\n return new Promise((resolve) => {\n this.undoData.size = {\n width: graphics.cssMaxWidth,\n height: graphics.cssMaxHeight,\n };\n\n graphics.setCssMaxDimension(dimension);\n graphics.adjustCanvasDimension();\n resolve();\n });\n },\n\n /**\n * @param {Graphics} graphics - Graphics instance\n * @returns {Promise}\n */\n undo(graphics) {\n graphics.setCssMaxDimension(this.undoData.size);\n graphics.adjustCanvasDimension();\n\n return Promise.resolve();\n },\n};\n\ncommandFactory.register(command);\n\nexport default command;\n","/**\n * @author NHN. FE Development Team \n * @fileoverview Rotate an image\n */\nimport commandFactory from '@/factory/command';\nimport { componentNames, commandNames } from '@/consts';\n\nconst { ROTATION } = componentNames;\n\n/**\n * Cached data for undo\n * @type {Object}\n */\nlet cachedUndoDataForSilent = null;\n\n/**\n * Make undo data\n * @param {Component} rotationComp - rotation component\n * @returns {object} - undodata\n */\nfunction makeUndoData(rotationComp) {\n return {\n angle: rotationComp.getCurrentAngle(),\n };\n}\n\nconst command = {\n name: commandNames.ROTATE_IMAGE,\n\n /**\n * Rotate an image\n * @param {Graphics} graphics - Graphics instance\n * @param {string} type - 'rotate' or 'setAngle'\n * @param {number} angle - angle value (degree)\n * @param {boolean} isSilent - is silent execution or not\n * @returns {Promise}\n */\n execute(graphics, type, angle, isSilent) {\n const rotationComp = graphics.getComponent(ROTATION);\n\n if (!this.isRedo) {\n const undoData = makeUndoData(rotationComp);\n\n cachedUndoDataForSilent = this.setUndoData(undoData, cachedUndoDataForSilent, isSilent);\n }\n\n return rotationComp[type](angle);\n },\n\n /**\n * @param {Graphics} graphics - Graphics instance\n * @returns {Promise}\n */\n undo(graphics) {\n const rotationComp = graphics.getComponent(ROTATION);\n const [, type, angle] = this.args;\n\n if (type === 'setAngle') {\n return rotationComp[type](this.undoData.angle);\n }\n\n return rotationComp.rotate(-angle);\n },\n};\n\ncommandFactory.register(command);\n\nexport default command;\n","/**\n * @author NHN. FE Development Team \n * @fileoverview Set object properties\n */\nimport commandFactory from '@/factory/command';\nimport { Promise } from '@/util';\nimport { commandNames, rejectMessages } from '@/consts';\n\nconst command = {\n name: commandNames.SET_OBJECT_POSITION,\n\n /**\n * Set object properties\n * @param {Graphics} graphics - Graphics instance\n * @param {number} id - object id\n * @param {Object} posInfo - position object\n * @param {number} posInfo.x - x position\n * @param {number} posInfo.y - y position\n * @param {string} posInfo.originX - can be 'left', 'center', 'right'\n * @param {string} posInfo.originY - can be 'top', 'center', 'bottom'\n * @returns {Promise}\n */\n execute(graphics, id, posInfo) {\n const targetObj = graphics.getObject(id);\n\n if (!targetObj) {\n return Promise.reject(rejectMessages.noObject);\n }\n\n this.undoData.objectId = id;\n this.undoData.props = graphics.getObjectProperties(id, ['left', 'top']);\n\n graphics.setObjectPosition(id, posInfo);\n graphics.renderAll();\n\n return Promise.resolve();\n },\n\n /**\n * @param {Graphics} graphics - Graphics instance\n * @returns {Promise}\n */\n undo(graphics) {\n const { objectId, props } = this.undoData;\n\n graphics.setObjectProperties(objectId, props);\n graphics.renderAll();\n\n return Promise.resolve();\n },\n};\n\ncommandFactory.register(command);\n\nexport default command;\n","/**\n * @author NHN. FE Development Team \n * @fileoverview Set object properties\n */\nimport snippet from 'tui-code-snippet';\nimport commandFactory from '@/factory/command';\nimport { Promise } from '@/util';\nimport { commandNames, rejectMessages } from '@/consts';\n\nconst command = {\n name: commandNames.SET_OBJECT_PROPERTIES,\n\n /**\n * Set object properties\n * @param {Graphics} graphics - Graphics instance\n * @param {number} id - object id\n * @param {Object} props - properties\n * @param {string} [props.fill] Color\n * @param {string} [props.fontFamily] Font type for text\n * @param {number} [props.fontSize] Size\n * @param {string} [props.fontStyle] Type of inclination (normal / italic)\n * @param {string} [props.fontWeight] Type of thicker or thinner looking (normal / bold)\n * @param {string} [props.textAlign] Type of text align (left / center / right)\n * @param {string} [props.textDecoration] Type of line (underline / line-through / overline)\n * @returns {Promise}\n */\n execute(graphics, id, props) {\n const targetObj = graphics.getObject(id);\n\n if (!targetObj) {\n return Promise.reject(rejectMessages.noObject);\n }\n\n this.undoData.props = {};\n snippet.forEachOwnProperties(props, (value, key) => {\n this.undoData.props[key] = targetObj[key];\n });\n\n graphics.setObjectProperties(id, props);\n\n return Promise.resolve();\n },\n\n /**\n * @param {Graphics} graphics - Graphics instance\n * @param {number} id - object id\n * @returns {Promise}\n */\n undo(graphics, id) {\n const { props } = this.undoData;\n\n graphics.setObjectProperties(id, props);\n\n return Promise.resolve();\n },\n};\n\ncommandFactory.register(command);\n\nexport default command;\n","/**\n * @author NHN. FE Development Team \n * @fileoverview Image crop module (start cropping, end cropping)\n */\nimport snippet from 'tui-code-snippet';\nimport fabric from 'fabric';\nimport Component from '@/interface/component';\nimport Cropzone from '@/extension/cropzone';\nimport { keyCodes, componentNames, CROPZONE_DEFAULT_OPTIONS } from '@/consts';\nimport { clamp, fixFloatingPoint } from '@/util';\n\nconst MOUSE_MOVE_THRESHOLD = 10;\nconst DEFAULT_OPTION = {\n presetRatio: null,\n top: -10,\n left: -10,\n height: 1,\n width: 1,\n};\n\n/**\n * Cropper components\n * @param {Graphics} graphics - Graphics instance\n * @extends {Component}\n * @class Cropper\n * @ignore\n */\nclass Cropper extends Component {\n constructor(graphics) {\n super(componentNames.CROPPER, graphics);\n\n /**\n * Cropzone\n * @type {Cropzone}\n * @private\n */\n this._cropzone = null;\n\n /**\n * StartX of Cropzone\n * @type {number}\n * @private\n */\n this._startX = null;\n\n /**\n * StartY of Cropzone\n * @type {number}\n * @private\n */\n this._startY = null;\n\n /**\n * State whether shortcut key is pressed or not\n * @type {boolean}\n * @private\n */\n this._withShiftKey = false;\n\n /**\n * Listeners\n * @type {object.}\n * @private\n */\n this._listeners = {\n keydown: this._onKeyDown.bind(this),\n keyup: this._onKeyUp.bind(this),\n mousedown: this._onFabricMouseDown.bind(this),\n mousemove: this._onFabricMouseMove.bind(this),\n mouseup: this._onFabricMouseUp.bind(this),\n };\n }\n\n /**\n * Start cropping\n */\n start() {\n if (this._cropzone) {\n return;\n }\n const canvas = this.getCanvas();\n\n canvas.forEachObject((obj) => {\n // {@link http://fabricjs.com/docs/fabric.Object.html#evented}\n obj.evented = false;\n });\n\n this._cropzone = new Cropzone(\n canvas,\n snippet.extend(\n {\n left: 0,\n top: 0,\n width: 0.5,\n height: 0.5,\n strokeWidth: 0, // {@link https://github.com/kangax/fabric.js/issues/2860}\n cornerSize: 10,\n cornerColor: 'black',\n fill: 'transparent',\n },\n CROPZONE_DEFAULT_OPTIONS,\n this.graphics.cropSelectionStyle\n )\n );\n\n canvas.discardActiveObject();\n canvas.add(this._cropzone);\n canvas.on('mouse:down', this._listeners.mousedown);\n canvas.selection = false;\n canvas.defaultCursor = 'crosshair';\n\n fabric.util.addListener(document, 'keydown', this._listeners.keydown);\n fabric.util.addListener(document, 'keyup', this._listeners.keyup);\n }\n\n /**\n * End cropping\n */\n end() {\n const canvas = this.getCanvas();\n const cropzone = this._cropzone;\n\n if (!cropzone) {\n return;\n }\n canvas.remove(cropzone);\n canvas.selection = true;\n canvas.defaultCursor = 'default';\n canvas.off('mouse:down', this._listeners.mousedown);\n canvas.forEachObject((obj) => {\n obj.evented = true;\n });\n\n this._cropzone = null;\n\n fabric.util.removeListener(document, 'keydown', this._listeners.keydown);\n fabric.util.removeListener(document, 'keyup', this._listeners.keyup);\n }\n\n /**\n * Change cropzone visible\n * @param {boolean} visible - cropzone visible state\n */\n changeVisibility(visible) {\n if (this._cropzone) {\n this._cropzone.set({ visible });\n }\n }\n\n /**\n * onMousedown handler in fabric canvas\n * @param {{target: fabric.Object, e: MouseEvent}} fEvent - Fabric event\n * @private\n */\n _onFabricMouseDown(fEvent) {\n const canvas = this.getCanvas();\n\n if (fEvent.target) {\n return;\n }\n\n canvas.selection = false;\n const coord = canvas.getPointer(fEvent.e);\n\n this._startX = coord.x;\n this._startY = coord.y;\n\n canvas.on({\n 'mouse:move': this._listeners.mousemove,\n 'mouse:up': this._listeners.mouseup,\n });\n }\n\n /**\n * onMousemove handler in fabric canvas\n * @param {{target: fabric.Object, e: MouseEvent}} fEvent - Fabric event\n * @private\n */\n _onFabricMouseMove(fEvent) {\n const canvas = this.getCanvas();\n const pointer = canvas.getPointer(fEvent.e);\n const { x, y } = pointer;\n const cropzone = this._cropzone;\n\n if (Math.abs(x - this._startX) + Math.abs(y - this._startY) > MOUSE_MOVE_THRESHOLD) {\n canvas.remove(cropzone);\n cropzone.set(this._calcRectDimensionFromPoint(x, y));\n\n canvas.add(cropzone);\n canvas.setActiveObject(cropzone);\n }\n }\n\n /**\n * Get rect dimension setting from Canvas-Mouse-Position(x, y)\n * @param {number} x - Canvas-Mouse-Position x\n * @param {number} y - Canvas-Mouse-Position Y\n * @returns {{left: number, top: number, width: number, height: number}}\n * @private\n */\n _calcRectDimensionFromPoint(x, y) {\n const canvas = this.getCanvas();\n const canvasWidth = canvas.getWidth();\n const canvasHeight = canvas.getHeight();\n const startX = this._startX;\n const startY = this._startY;\n let left = clamp(x, 0, startX);\n let top = clamp(y, 0, startY);\n let width = clamp(x, startX, canvasWidth) - left; // (startX <= x(mouse) <= canvasWidth) - left\n let height = clamp(y, startY, canvasHeight) - top; // (startY <= y(mouse) <= canvasHeight) - top\n\n if (this._withShiftKey) {\n // make fixed ratio cropzone\n if (width > height) {\n height = width;\n } else if (height > width) {\n width = height;\n }\n\n if (startX >= x) {\n left = startX - width;\n }\n\n if (startY >= y) {\n top = startY - height;\n }\n }\n\n return {\n left,\n top,\n width,\n height,\n };\n }\n\n /**\n * onMouseup handler in fabric canvas\n * @private\n */\n _onFabricMouseUp() {\n const cropzone = this._cropzone;\n const listeners = this._listeners;\n const canvas = this.getCanvas();\n\n canvas.setActiveObject(cropzone);\n canvas.off({\n 'mouse:move': listeners.mousemove,\n 'mouse:up': listeners.mouseup,\n });\n }\n\n /**\n * Get cropped image data\n * @param {Object} cropRect cropzone rect\n * @param {Number} cropRect.left left position\n * @param {Number} cropRect.top top position\n * @param {Number} cropRect.width width\n * @param {Number} cropRect.height height\n * @returns {?{imageName: string, url: string}} cropped Image data\n */\n getCroppedImageData(cropRect) {\n const canvas = this.getCanvas();\n const containsCropzone = canvas.contains(this._cropzone);\n if (!cropRect) {\n return null;\n }\n\n if (containsCropzone) {\n canvas.remove(this._cropzone);\n }\n\n const imageData = {\n imageName: this.getImageName(),\n url: canvas.toDataURL(cropRect),\n };\n\n if (containsCropzone) {\n canvas.add(this._cropzone);\n }\n\n return imageData;\n }\n\n /**\n * Get cropped rect\n * @returns {Object} rect\n */\n getCropzoneRect() {\n const cropzone = this._cropzone;\n\n if (!cropzone.isValid()) {\n return null;\n }\n\n return {\n left: cropzone.left,\n top: cropzone.top,\n width: cropzone.width,\n height: cropzone.height,\n };\n }\n\n /**\n * Set a cropzone square\n * @param {number} [presetRatio] - preset ratio\n */\n setCropzoneRect(presetRatio) {\n const canvas = this.getCanvas();\n const cropzone = this._cropzone;\n\n canvas.discardActiveObject();\n canvas.selection = false;\n canvas.remove(cropzone);\n\n cropzone.set(presetRatio ? this._getPresetPropertiesForCropSize(presetRatio) : DEFAULT_OPTION);\n\n canvas.add(cropzone);\n canvas.selection = true;\n\n if (presetRatio) {\n canvas.setActiveObject(cropzone);\n }\n }\n\n /**\n * get a cropzone square info\n * @param {number} presetRatio - preset ratio\n * @returns {{presetRatio: number, left: number, top: number, width: number, height: number}}\n * @private\n */\n _getPresetPropertiesForCropSize(presetRatio) {\n const canvas = this.getCanvas();\n const originalWidth = canvas.getWidth();\n const originalHeight = canvas.getHeight();\n\n const standardSize = originalWidth >= originalHeight ? originalWidth : originalHeight;\n const getScale = (value, orignalValue) => (value > orignalValue ? orignalValue / value : 1);\n\n let width = standardSize * presetRatio;\n let height = standardSize;\n\n const scaleWidth = getScale(width, originalWidth);\n [width, height] = snippet.map([width, height], (sizeValue) => sizeValue * scaleWidth);\n\n const scaleHeight = getScale(height, originalHeight);\n [width, height] = snippet.map([width, height], (sizeValue) =>\n fixFloatingPoint(sizeValue * scaleHeight)\n );\n\n return {\n presetRatio,\n top: (originalHeight - height) / 2,\n left: (originalWidth - width) / 2,\n width,\n height,\n };\n }\n\n /**\n * Keydown event handler\n * @param {KeyboardEvent} e - Event object\n * @private\n */\n _onKeyDown(e) {\n if (e.keyCode === keyCodes.SHIFT) {\n this._withShiftKey = true;\n }\n }\n\n /**\n * Keyup event handler\n * @param {KeyboardEvent} e - Event object\n * @private\n */\n _onKeyUp(e) {\n if (e.keyCode === keyCodes.SHIFT) {\n this._withShiftKey = false;\n }\n }\n}\n\nexport default Cropper;\n","/**\n * @author NHN. FE Development Team \n * @fileoverview Add filter module\n */\nimport { isUndefined, extend, forEach, filter } from 'tui-code-snippet';\nimport fabric from 'fabric';\nimport Component from '@/interface/component';\nimport { Promise } from '@/util';\nimport { rejectMessages, componentNames } from '@/consts';\nimport Mask from '@/extension/mask';\nimport Sharpen from '@/extension/sharpen';\nimport Emboss from '@/extension/emboss';\nimport ColorFilter from '@/extension/colorFilter';\n\nconst { filters } = fabric.Image;\n\nfilters.Mask = Mask;\nfilters.Sharpen = Sharpen;\nfilters.Emboss = Emboss;\nfilters.ColorFilter = ColorFilter;\n\n/**\n * Filter\n * @class Filter\n * @param {Graphics} graphics - Graphics instance\n * @extends {Component}\n * @ignore\n */\nclass Filter extends Component {\n constructor(graphics) {\n super(componentNames.FILTER, graphics);\n }\n\n /**\n * Add filter to source image (a specific filter is added on fabric.js)\n * @param {string} type - Filter type\n * @param {Object} [options] - Options of filter\n * @returns {Promise}\n */\n add(type, options) {\n return new Promise((resolve, reject) => {\n const sourceImg = this._getSourceImage();\n const canvas = this.getCanvas();\n let imgFilter = this._getFilter(sourceImg, type);\n if (!imgFilter) {\n imgFilter = this._createFilter(sourceImg, type, options);\n }\n\n if (!imgFilter) {\n reject(rejectMessages.invalidParameters);\n }\n\n this._changeFilterValues(imgFilter, options);\n\n this._apply(sourceImg, () => {\n canvas.renderAll();\n resolve({\n type,\n action: 'add',\n options,\n });\n });\n });\n }\n\n /**\n * Remove filter to source image\n * @param {string} type - Filter type\n * @returns {Promise}\n */\n remove(type) {\n return new Promise((resolve, reject) => {\n const sourceImg = this._getSourceImage();\n const canvas = this.getCanvas();\n const options = this.getOptions(type);\n\n if (!sourceImg.filters.length) {\n reject(rejectMessages.unsupportedOperation);\n }\n\n this._removeFilter(sourceImg, type);\n\n this._apply(sourceImg, () => {\n canvas.renderAll();\n resolve({\n type,\n action: 'remove',\n options,\n });\n });\n });\n }\n\n /**\n * Whether this has the filter or not\n * @param {string} type - Filter type\n * @returns {boolean} true if it has the filter\n */\n hasFilter(type) {\n return !!this._getFilter(this._getSourceImage(), type);\n }\n\n /**\n * Get a filter options\n * @param {string} type - Filter type\n * @returns {Object} filter options or null if there is no that filter\n */\n getOptions(type) {\n const sourceImg = this._getSourceImage();\n const imgFilter = this._getFilter(sourceImg, type);\n if (!imgFilter) {\n return null;\n }\n\n return extend({}, imgFilter.options);\n }\n\n /**\n * Change filter values\n * @param {Object} imgFilter object of filter\n * @param {Object} options object\n * @private\n */\n _changeFilterValues(imgFilter, options) {\n forEach(options, (value, key) => {\n if (!isUndefined(imgFilter[key])) {\n imgFilter[key] = value;\n }\n });\n forEach(imgFilter.options, (value, key) => {\n if (!isUndefined(options[key])) {\n imgFilter.options[key] = options[key];\n }\n });\n }\n\n /**\n * Apply filter\n * @param {fabric.Image} sourceImg - Source image to apply filter\n * @param {function} callback - Executed function after applying filter\n * @private\n */\n _apply(sourceImg, callback) {\n sourceImg.filters.push();\n const result = sourceImg.applyFilters();\n if (result) {\n callback();\n }\n }\n\n /**\n * Get source image on canvas\n * @returns {fabric.Image} Current source image on canvas\n * @private\n */\n _getSourceImage() {\n return this.getCanvasImage();\n }\n\n /**\n * Create filter instance\n * @param {fabric.Image} sourceImg - Source image to apply filter\n * @param {string} type - Filter type\n * @param {Object} [options] - Options of filter\n * @returns {Object} Fabric object of filter\n * @private\n */\n _createFilter(sourceImg, type, options) {\n let filterObj;\n // capitalize first letter for matching with fabric image filter name\n const fabricType = this._getFabricFilterType(type);\n const ImageFilter = fabric.Image.filters[fabricType];\n if (ImageFilter) {\n filterObj = new ImageFilter(options);\n filterObj.options = options;\n sourceImg.filters.push(filterObj);\n }\n\n return filterObj;\n }\n\n /**\n * Get applied filter instance\n * @param {fabric.Image} sourceImg - Source image to apply filter\n * @param {string} type - Filter type\n * @returns {Object} Fabric object of filter\n * @private\n */\n _getFilter(sourceImg, type) {\n let imgFilter = null;\n\n if (sourceImg) {\n const fabricType = this._getFabricFilterType(type);\n const { length } = sourceImg.filters;\n let item, i;\n\n for (i = 0; i < length; i += 1) {\n item = sourceImg.filters[i];\n if (item.type === fabricType) {\n imgFilter = item;\n break;\n }\n }\n }\n\n return imgFilter;\n }\n\n /**\n * Remove applied filter instance\n * @param {fabric.Image} sourceImg - Source image to apply filter\n * @param {string} type - Filter type\n * @private\n */\n _removeFilter(sourceImg, type) {\n const fabricType = this._getFabricFilterType(type);\n sourceImg.filters = filter(sourceImg.filters, (value) => value.type !== fabricType);\n }\n\n /**\n * Change filter class name to fabric's, especially capitalizing first letter\n * @param {string} type - Filter type\n * @example\n * 'grayscale' -> 'Grayscale'\n * @returns {string} Fabric filter class name\n */\n _getFabricFilterType(type) {\n return type.charAt(0).toUpperCase() + type.slice(1);\n }\n}\n\nexport default Filter;\n","/**\n * @author NHN. FE Development Team \n * @fileoverview Image flip module\n */\nimport snippet from 'tui-code-snippet';\nimport Component from '@/interface/component';\nimport { Promise } from '@/util';\nimport { componentNames, rejectMessages } from '@/consts';\n\n/**\n * Flip\n * @class Flip\n * @param {Graphics} graphics - Graphics instance\n * @extends {Component}\n * @ignore\n */\nclass Flip extends Component {\n constructor(graphics) {\n super(componentNames.FLIP, graphics);\n }\n\n /**\n * Get current flip settings\n * @returns {{flipX: Boolean, flipY: Boolean}}\n */\n getCurrentSetting() {\n const canvasImage = this.getCanvasImage();\n\n return {\n flipX: canvasImage.flipX,\n flipY: canvasImage.flipY,\n };\n }\n\n /**\n * Set flipX, flipY\n * @param {{flipX: Boolean, flipY: Boolean}} newSetting - Flip setting\n * @returns {Promise}\n */\n set(newSetting) {\n const setting = this.getCurrentSetting();\n const isChangingFlipX = setting.flipX !== newSetting.flipX;\n const isChangingFlipY = setting.flipY !== newSetting.flipY;\n\n if (!isChangingFlipX && !isChangingFlipY) {\n return Promise.reject(rejectMessages.flip);\n }\n\n snippet.extend(setting, newSetting);\n this.setImageProperties(setting, true);\n this._invertAngle(isChangingFlipX, isChangingFlipY);\n this._flipObjects(isChangingFlipX, isChangingFlipY);\n\n return Promise.resolve({\n flipX: setting.flipX,\n flipY: setting.flipY,\n angle: this.getCanvasImage().angle,\n });\n }\n\n /**\n * Invert image angle for flip\n * @param {boolean} isChangingFlipX - Change flipX\n * @param {boolean} isChangingFlipY - Change flipY\n */\n _invertAngle(isChangingFlipX, isChangingFlipY) {\n const canvasImage = this.getCanvasImage();\n let { angle } = canvasImage;\n\n if (isChangingFlipX) {\n angle *= -1;\n }\n if (isChangingFlipY) {\n angle *= -1;\n }\n canvasImage.rotate(parseFloat(angle)).setCoords(); // parseFloat for -0 to 0\n }\n\n /**\n * Flip objects\n * @param {boolean} isChangingFlipX - Change flipX\n * @param {boolean} isChangingFlipY - Change flipY\n * @private\n */\n _flipObjects(isChangingFlipX, isChangingFlipY) {\n const canvas = this.getCanvas();\n\n if (isChangingFlipX) {\n canvas.forEachObject((obj) => {\n obj\n .set({\n angle: parseFloat(obj.angle * -1), // parseFloat for -0 to 0\n flipX: !obj.flipX,\n left: canvas.width - obj.left,\n })\n .setCoords();\n });\n }\n if (isChangingFlipY) {\n canvas.forEachObject((obj) => {\n obj\n .set({\n angle: parseFloat(obj.angle * -1), // parseFloat for -0 to 0\n flipY: !obj.flipY,\n top: canvas.height - obj.top,\n })\n .setCoords();\n });\n }\n canvas.renderAll();\n }\n\n /**\n * Reset flip settings\n * @returns {Promise}\n */\n reset() {\n return this.set({\n flipX: false,\n flipY: false,\n });\n }\n\n /**\n * Flip x\n * @returns {Promise}\n */\n flipX() {\n const current = this.getCurrentSetting();\n\n return this.set({\n flipX: !current.flipX,\n flipY: current.flipY,\n });\n }\n\n /**\n * Flip y\n * @returns {Promise}\n */\n flipY() {\n const current = this.getCurrentSetting();\n\n return this.set({\n flipX: current.flipX,\n flipY: !current.flipY,\n });\n }\n}\n\nexport default Flip;\n","/**\n * @author NHN. FE Development Team \n * @fileoverview Free drawing module, Set brush\n */\nimport fabric from 'fabric';\nimport Component from '@/interface/component';\nimport { componentNames } from '@/consts';\n\n/**\n * FreeDrawing\n * @class FreeDrawing\n * @param {Graphics} graphics - Graphics instance\n * @extends {Component}\n * @ignore\n */\nclass FreeDrawing extends Component {\n constructor(graphics) {\n super(componentNames.FREE_DRAWING, graphics);\n\n /**\n * Brush width\n * @type {number}\n */\n this.width = 12;\n\n /**\n * fabric.Color instance for brush color\n * @type {fabric.Color}\n */\n this.oColor = new fabric.Color('rgba(0, 0, 0, 0.5)');\n }\n\n /**\n * Start free drawing mode\n * @param {{width: ?number, color: ?string}} [setting] - Brush width & color\n */\n start(setting) {\n const canvas = this.getCanvas();\n\n canvas.isDrawingMode = true;\n this.setBrush(setting);\n }\n\n /**\n * Set brush\n * @param {{width: ?number, color: ?string}} [setting] - Brush width & color\n */\n setBrush(setting) {\n const brush = this.getCanvas().freeDrawingBrush;\n\n setting = setting || {};\n this.width = setting.width || this.width;\n if (setting.color) {\n this.oColor = new fabric.Color(setting.color);\n }\n brush.width = this.width;\n brush.color = this.oColor.toRgba();\n }\n\n /**\n * End free drawing mode\n */\n end() {\n const canvas = this.getCanvas();\n\n canvas.isDrawingMode = false;\n }\n}\n\nexport default FreeDrawing;\n","/**\n * @author NHN. FE Development Team \n * @fileoverview Add icon module\n */\nimport snippet from 'tui-code-snippet';\nimport fabric from 'fabric';\nimport Component from '@/interface/component';\nimport { Promise } from '@/util';\nimport { eventNames as events, rejectMessages, componentNames, fObjectOptions } from '@/consts';\n\nconst pathMap = {\n arrow: 'M 0 90 H 105 V 120 L 160 60 L 105 0 V 30 H 0 Z',\n cancel:\n 'M 0 30 L 30 60 L 0 90 L 30 120 L 60 90 L 90 120 L 120 90 ' +\n 'L 90 60 L 120 30 L 90 0 L 60 30 L 30 0 Z',\n};\n\n/**\n * Icon\n * @class Icon\n * @param {Graphics} graphics - Graphics instance\n * @extends {Component}\n * @ignore\n */\nclass Icon extends Component {\n constructor(graphics) {\n super(componentNames.ICON, graphics);\n\n /**\n * Default icon color\n * @type {string}\n */\n this._oColor = '#000000';\n\n /**\n * Path value of each icon type\n * @type {Object}\n */\n this._pathMap = pathMap;\n\n /**\n * Type of the drawing icon\n * @type {string}\n * @private\n */\n this._type = null;\n\n /**\n * Color of the drawing icon\n * @type {string}\n * @private\n */\n this._iconColor = null;\n\n /**\n * Event handler list\n * @type {Object}\n * @private\n */\n this._handlers = {\n mousedown: this._onFabricMouseDown.bind(this),\n mousemove: this._onFabricMouseMove.bind(this),\n mouseup: this._onFabricMouseUp.bind(this),\n };\n }\n\n /**\n * Set states of the current drawing shape\n * @ignore\n * @param {string} type - Icon type ('arrow', 'cancel', custom icon name)\n * @param {string} iconColor - Icon foreground color\n */\n setStates(type, iconColor) {\n this._type = type;\n this._iconColor = iconColor;\n }\n\n /**\n * Start to draw the icon on canvas\n * @ignore\n */\n start() {\n const canvas = this.getCanvas();\n canvas.selection = false;\n canvas.on('mouse:down', this._handlers.mousedown);\n }\n\n /**\n * End to draw the icon on canvas\n * @ignore\n */\n end() {\n const canvas = this.getCanvas();\n\n canvas.selection = true;\n canvas.off({\n 'mouse:down': this._handlers.mousedown,\n });\n }\n\n /**\n * Add icon\n * @param {string} type - Icon type\n * @param {Object} options - Icon options\n * @param {string} [options.fill] - Icon foreground color\n * @param {string} [options.left] - Icon x position\n * @param {string} [options.top] - Icon y position\n * @returns {Promise}\n */\n add(type, options) {\n return new Promise((resolve, reject) => {\n const canvas = this.getCanvas();\n const path = this._pathMap[type];\n const selectionStyle = fObjectOptions.SELECTION_STYLE;\n const icon = path ? this._createIcon(path) : null;\n this._icon = icon;\n\n if (!icon) {\n reject(rejectMessages.invalidParameters);\n }\n\n icon.set(\n snippet.extend(\n {\n type: 'icon',\n fill: this._oColor,\n },\n selectionStyle,\n options,\n this.graphics.controlStyle\n )\n );\n\n canvas.add(icon).setActiveObject(icon);\n\n resolve(this.graphics.createObjectProperties(icon));\n });\n }\n\n /**\n * Register icon paths\n * @param {{key: string, value: string}} pathInfos - Path infos\n */\n registerPaths(pathInfos) {\n snippet.forEach(\n pathInfos,\n (path, type) => {\n this._pathMap[type] = path;\n },\n this\n );\n }\n\n /**\n * Set icon object color\n * @param {string} color - Color to set\n * @param {fabric.Path}[obj] - Current activated path object\n */\n setColor(color, obj) {\n this._oColor = color;\n\n if (obj && obj.get('type') === 'icon') {\n obj.set({ fill: this._oColor });\n this.getCanvas().renderAll();\n }\n }\n\n /**\n * Get icon color\n * @param {fabric.Path}[obj] - Current activated path object\n * @returns {string} color\n */\n getColor(obj) {\n return obj.fill;\n }\n\n /**\n * Create icon object\n * @param {string} path - Path value to create icon\n * @returns {fabric.Path} Path object\n */\n _createIcon(path) {\n return new fabric.Path(path);\n }\n\n /**\n * MouseDown event handler on canvas\n * @param {{target: fabric.Object, e: MouseEvent}} fEvent - Fabric event object\n * @private\n */\n _onFabricMouseDown(fEvent) {\n const canvas = this.getCanvas();\n\n this._startPoint = canvas.getPointer(fEvent.e);\n const { x: left, y: top } = this._startPoint;\n\n this.add(this._type, {\n left,\n top,\n fill: this._iconColor,\n }).then(() => {\n this.fire(events.ADD_OBJECT, this.graphics.createObjectProperties(this._icon));\n canvas.on('mouse:move', this._handlers.mousemove);\n canvas.on('mouse:up', this._handlers.mouseup);\n });\n }\n\n /**\n * MouseMove event handler on canvas\n * @param {{target: fabric.Object, e: MouseEvent}} fEvent - Fabric event object\n * @private\n */\n _onFabricMouseMove(fEvent) {\n const canvas = this.getCanvas();\n\n if (!this._icon) {\n return;\n }\n const moveOriginPointer = canvas.getPointer(fEvent.e);\n\n const scaleX = (moveOriginPointer.x - this._startPoint.x) / this._icon.width;\n const scaleY = (moveOriginPointer.y - this._startPoint.y) / this._icon.height;\n\n this._icon.set({\n scaleX: Math.abs(scaleX * 2),\n scaleY: Math.abs(scaleY * 2),\n });\n\n this._icon.setCoords();\n canvas.renderAll();\n }\n\n /**\n * MouseUp event handler on canvas\n * @private\n */\n _onFabricMouseUp() {\n const canvas = this.getCanvas();\n\n this.fire(events.OBJECT_ADDED, this.graphics.createObjectProperties(this._icon));\n\n this._icon = null;\n\n canvas.off('mouse:down', this._handlers.mousedown);\n canvas.off('mouse:move', this._handlers.mousemove);\n canvas.off('mouse:up', this._handlers.mouseup);\n }\n}\n\nexport default Icon;\n","/**\n * @author NHN. FE Development Team \n * @fileoverview Image loader\n */\nimport Component from '@/interface/component';\nimport { Promise } from '@/util';\nimport { componentNames, rejectMessages } from '@/consts';\n\nconst imageOption = {\n padding: 0,\n crossOrigin: 'Anonymous',\n};\n\n/**\n * ImageLoader components\n * @extends {Component}\n * @class ImageLoader\n * @param {Graphics} graphics - Graphics instance\n * @ignore\n */\nclass ImageLoader extends Component {\n constructor(graphics) {\n super(componentNames.IMAGE_LOADER, graphics);\n }\n\n /**\n * Load image from url\n * @param {?string} imageName - File name\n * @param {?(fabric.Image|string)} img - fabric.Image instance or URL of an image\n * @returns {Promise}\n */\n load(imageName, img) {\n let promise;\n\n if (!imageName && !img) {\n // Back to the initial state, not error.\n const canvas = this.getCanvas();\n\n canvas.backgroundImage = null;\n canvas.renderAll();\n\n promise = new Promise((resolve) => {\n this.setCanvasImage('', null);\n resolve();\n });\n } else {\n promise = this._setBackgroundImage(img).then((oImage) => {\n this.setCanvasImage(imageName, oImage);\n this.adjustCanvasDimension();\n\n return oImage;\n });\n }\n\n return promise;\n }\n\n /**\n * Set background image\n * @param {?(fabric.Image|String)} img fabric.Image instance or URL of an image to set background to\n * @returns {Promise}\n * @private\n */\n _setBackgroundImage(img) {\n if (!img) {\n return Promise.reject(rejectMessages.loadImage);\n }\n\n return new Promise((resolve, reject) => {\n const canvas = this.getCanvas();\n\n canvas.setBackgroundImage(\n img,\n () => {\n const oImage = canvas.backgroundImage;\n\n if (oImage && oImage.getElement()) {\n resolve(oImage);\n } else {\n reject(rejectMessages.loadingImageFailed);\n }\n },\n imageOption\n );\n });\n }\n}\n\nexport default ImageLoader;\n","/**\n * @author NHN. FE Development Team \n * @fileoverview Free drawing module, Set brush\n */\nimport snippet from 'tui-code-snippet';\nimport fabric from 'fabric';\nimport Component from '@/interface/component';\nimport ArrowLine from '@/extension/arrowLine';\nimport { eventNames, componentNames, fObjectOptions } from '@/consts';\n\n/**\n * Line\n * @class Line\n * @param {Graphics} graphics - Graphics instance\n * @extends {Component}\n * @ignore\n */\nclass Line extends Component {\n constructor(graphics) {\n super(componentNames.LINE, graphics);\n\n /**\n * Brush width\n * @type {number}\n * @private\n */\n this._width = 12;\n\n /**\n * fabric.Color instance for brush color\n * @type {fabric.Color}\n * @private\n */\n this._oColor = new fabric.Color('rgba(0, 0, 0, 0.5)');\n\n /**\n * Listeners\n * @type {object.}\n * @private\n */\n this._listeners = {\n mousedown: this._onFabricMouseDown.bind(this),\n mousemove: this._onFabricMouseMove.bind(this),\n mouseup: this._onFabricMouseUp.bind(this),\n };\n }\n\n /**\n * Start drawing line mode\n * @param {{width: ?number, color: ?string}} [setting] - Brush width & color\n */\n setHeadOption(setting) {\n const {\n arrowType = {\n head: null,\n tail: null,\n },\n } = setting;\n\n this._arrowType = arrowType;\n }\n\n /**\n * Start drawing line mode\n * @param {{width: ?number, color: ?string}} [setting] - Brush width & color\n */\n start(setting = {}) {\n const canvas = this.getCanvas();\n\n canvas.defaultCursor = 'crosshair';\n canvas.selection = false;\n\n this.setHeadOption(setting);\n this.setBrush(setting);\n\n canvas.forEachObject((obj) => {\n obj.set({\n evented: false,\n });\n });\n\n canvas.on({\n 'mouse:down': this._listeners.mousedown,\n });\n }\n\n /**\n * Set brush\n * @param {{width: ?number, color: ?string}} [setting] - Brush width & color\n */\n setBrush(setting) {\n const brush = this.getCanvas().freeDrawingBrush;\n\n setting = setting || {};\n this._width = setting.width || this._width;\n\n if (setting.color) {\n this._oColor = new fabric.Color(setting.color);\n }\n brush.width = this._width;\n brush.color = this._oColor.toRgba();\n }\n\n /**\n * End drawing line mode\n */\n end() {\n const canvas = this.getCanvas();\n\n canvas.defaultCursor = 'default';\n canvas.selection = true;\n\n canvas.forEachObject((obj) => {\n obj.set({\n evented: true,\n });\n });\n\n canvas.off('mouse:down', this._listeners.mousedown);\n }\n\n /**\n * Mousedown event handler in fabric canvas\n * @param {{target: fabric.Object, e: MouseEvent}} fEvent - Fabric event object\n * @private\n */\n _onFabricMouseDown(fEvent) {\n const canvas = this.getCanvas();\n const { x, y } = canvas.getPointer(fEvent.e);\n const points = [x, y, x, y];\n\n this._line = new ArrowLine(points, {\n stroke: this._oColor.toRgba(),\n strokeWidth: this._width,\n arrowType: this._arrowType,\n evented: false,\n });\n\n this._line.set(fObjectOptions.SELECTION_STYLE);\n\n canvas.add(this._line);\n\n canvas.on({\n 'mouse:move': this._listeners.mousemove,\n 'mouse:up': this._listeners.mouseup,\n });\n\n this.fire(eventNames.ADD_OBJECT, this._createLineEventObjectProperties());\n }\n\n /**\n * Mousemove event handler in fabric canvas\n * @param {{target: fabric.Object, e: MouseEvent}} fEvent - Fabric event object\n * @private\n */\n _onFabricMouseMove(fEvent) {\n const canvas = this.getCanvas();\n const pointer = canvas.getPointer(fEvent.e);\n\n this._line.set({\n x2: pointer.x,\n y2: pointer.y,\n });\n\n this._line.setCoords();\n\n canvas.renderAll();\n }\n\n /**\n * Mouseup event handler in fabric canvas\n * @private\n */\n _onFabricMouseUp() {\n const canvas = this.getCanvas();\n\n this.fire(eventNames.OBJECT_ADDED, this._createLineEventObjectProperties());\n\n this._line = null;\n\n canvas.off({\n 'mouse:move': this._listeners.mousemove,\n 'mouse:up': this._listeners.mouseup,\n });\n }\n\n /**\n * create line event object properties\n * @returns {Object} properties line object\n * @private\n */\n _createLineEventObjectProperties() {\n const params = this.graphics.createObjectProperties(this._line);\n const { x1, x2, y1, y2 } = this._line;\n\n return snippet.extend({}, params, {\n startPosition: {\n x: x1,\n y: y1,\n },\n endPosition: {\n x: x2,\n y: y2,\n },\n });\n }\n}\n\nexport default Line;\n","/**\n * @author NHN. FE Development Team \n * @fileoverview Image rotation module\n */\nimport fabric from 'fabric';\nimport Component from '@/interface/component';\nimport { Promise } from '@/util';\nimport { componentNames } from '@/consts';\n\n/**\n * Image Rotation component\n * @class Rotation\n * @extends {Component}\n * @param {Graphics} graphics - Graphics instance\n * @ignore\n */\nclass Rotation extends Component {\n constructor(graphics) {\n super(componentNames.ROTATION, graphics);\n }\n\n /**\n * Get current angle\n * @returns {Number}\n */\n getCurrentAngle() {\n return this.getCanvasImage().angle;\n }\n\n /**\n * Set angle of the image\n *\n * Do not call \"this.setImageProperties\" for setting angle directly.\n * Before setting angle, The originX,Y of image should be set to center.\n * See \"http://fabricjs.com/docs/fabric.Object.html#setAngle\"\n *\n * @param {number} angle - Angle value\n * @returns {Promise}\n */\n setAngle(angle) {\n const oldAngle = this.getCurrentAngle() % 360; // The angle is lower than 2*PI(===360 degrees)\n\n angle %= 360;\n\n const canvasImage = this.getCanvasImage();\n const oldImageCenter = canvasImage.getCenterPoint();\n canvasImage.set({ angle }).setCoords();\n this.adjustCanvasDimension();\n const newImageCenter = canvasImage.getCenterPoint();\n this._rotateForEachObject(oldImageCenter, newImageCenter, angle - oldAngle);\n\n return Promise.resolve(angle);\n }\n\n /**\n * Rotate for each object\n * @param {fabric.Point} oldImageCenter - Image center point before rotation\n * @param {fabric.Point} newImageCenter - Image center point after rotation\n * @param {number} angleDiff - Image angle difference after rotation\n * @private\n */\n _rotateForEachObject(oldImageCenter, newImageCenter, angleDiff) {\n const canvas = this.getCanvas();\n const centerDiff = {\n x: oldImageCenter.x - newImageCenter.x,\n y: oldImageCenter.y - newImageCenter.y,\n };\n\n canvas.forEachObject((obj) => {\n const objCenter = obj.getCenterPoint();\n const radian = fabric.util.degreesToRadians(angleDiff);\n const newObjCenter = fabric.util.rotatePoint(objCenter, oldImageCenter, radian);\n\n obj.set({\n left: newObjCenter.x - centerDiff.x,\n top: newObjCenter.y - centerDiff.y,\n angle: (obj.angle + angleDiff) % 360,\n });\n obj.setCoords();\n });\n canvas.renderAll();\n }\n\n /**\n * Rotate the image\n * @param {number} additionalAngle - Additional angle\n * @returns {Promise}\n */\n rotate(additionalAngle) {\n const current = this.getCurrentAngle();\n\n return this.setAngle(current + additionalAngle);\n }\n}\n\nexport default Rotation;\n","/**\n * @author NHN. FE Development Team \n * @fileoverview Shape component\n */\nimport { extend } from 'tui-code-snippet';\nimport fabric from 'fabric';\nimport Component from '@/interface/component';\nimport resizeHelper from '@/helper/shapeResizeHelper';\nimport {\n getFillImageFromShape,\n rePositionFilterTypeFillImage,\n reMakePatternImageSource,\n makeFillPatternForFilter,\n makeFilterOptionFromFabricImage,\n resetFillPatternCanvas,\n} from '@/helper/shapeFilterFillHelper';\nimport {\n Promise,\n changeOrigin,\n getCustomProperty,\n getFillTypeFromOption,\n getFillTypeFromObject,\n isShape,\n} from '@/util';\nimport {\n rejectMessages,\n eventNames,\n keyCodes as KEY_CODES,\n componentNames,\n fObjectOptions,\n SHAPE_DEFAULT_OPTIONS,\n SHAPE_FILL_TYPE,\n} from '@/consts';\n\nconst SHAPE_INIT_OPTIONS = extend(\n {\n strokeWidth: 1,\n stroke: '#000000',\n fill: '#ffffff',\n width: 1,\n height: 1,\n rx: 0,\n ry: 0,\n },\n SHAPE_DEFAULT_OPTIONS\n);\nconst DEFAULT_TYPE = 'rect';\nconst DEFAULT_WIDTH = 20;\nconst DEFAULT_HEIGHT = 20;\n\n/**\n * Make fill option\n * @param {Object} options - Options to create the shape\n * @param {Object.Image} canvasImage - canvas background image\n * @param {Function} createStaticCanvas - static canvas creater\n * @returns {Object} - shape option\n * @private\n */\nfunction makeFabricFillOption(options, canvasImage, createStaticCanvas) {\n const fillOption = options.fill;\n const fillType = getFillTypeFromOption(options.fill);\n let fill = fillOption;\n\n if (fillOption.color) {\n fill = fillOption.color;\n }\n\n let extOption = null;\n if (fillType === 'filter') {\n const newStaticCanvas = createStaticCanvas();\n extOption = makeFillPatternForFilter(canvasImage, fillOption.filter, newStaticCanvas);\n } else {\n extOption = { fill };\n }\n\n return extend({}, options, extOption);\n}\n\n/**\n * Shape\n * @class Shape\n * @param {Graphics} graphics - Graphics instance\n * @extends {Component}\n * @ignore\n */\nexport default class Shape extends Component {\n constructor(graphics) {\n super(componentNames.SHAPE, graphics);\n\n /**\n * Object of The drawing shape\n * @type {fabric.Object}\n * @private\n */\n this._shapeObj = null;\n\n /**\n * Type of the drawing shape\n * @type {string}\n * @private\n */\n this._type = DEFAULT_TYPE;\n\n /**\n * Options to draw the shape\n * @type {Object}\n * @private\n */\n this._options = extend({}, SHAPE_INIT_OPTIONS);\n\n /**\n * Whether the shape object is selected or not\n * @type {boolean}\n * @private\n */\n this._isSelected = false;\n\n /**\n * Pointer for drawing shape (x, y)\n * @type {Object}\n * @private\n */\n this._startPoint = {};\n\n /**\n * Using shortcut on drawing shape\n * @type {boolean}\n * @private\n */\n this._withShiftKey = false;\n\n /**\n * Event handler list\n * @type {Object}\n * @private\n */\n this._handlers = {\n mousedown: this._onFabricMouseDown.bind(this),\n mousemove: this._onFabricMouseMove.bind(this),\n mouseup: this._onFabricMouseUp.bind(this),\n keydown: this._onKeyDown.bind(this),\n keyup: this._onKeyUp.bind(this),\n };\n }\n\n /**\n * Start to draw the shape on canvas\n * @ignore\n */\n start() {\n const canvas = this.getCanvas();\n\n this._isSelected = false;\n\n canvas.defaultCursor = 'crosshair';\n canvas.selection = false;\n canvas.uniformScaling = true;\n canvas.on({\n 'mouse:down': this._handlers.mousedown,\n });\n\n fabric.util.addListener(document, 'keydown', this._handlers.keydown);\n fabric.util.addListener(document, 'keyup', this._handlers.keyup);\n }\n\n /**\n * End to draw the shape on canvas\n * @ignore\n */\n end() {\n const canvas = this.getCanvas();\n\n this._isSelected = false;\n\n canvas.defaultCursor = 'default';\n\n canvas.selection = true;\n canvas.uniformScaling = false;\n canvas.off({\n 'mouse:down': this._handlers.mousedown,\n });\n\n fabric.util.removeListener(document, 'keydown', this._handlers.keydown);\n fabric.util.removeListener(document, 'keyup', this._handlers.keyup);\n }\n\n /**\n * Set states of the current drawing shape\n * @ignore\n * @param {string} type - Shape type (ex: 'rect', 'circle')\n * @param {Object} [options] - Shape options\n * @param {(ShapeFillOption | string)} [options.fill] - {@link ShapeFillOption} or\n * Shape foreground color (ex: '#fff', 'transparent')\n * @param {string} [options.stoke] - Shape outline color\n * @param {number} [options.strokeWidth] - Shape outline width\n * @param {number} [options.width] - Width value (When type option is 'rect', this options can use)\n * @param {number} [options.height] - Height value (When type option is 'rect', this options can use)\n * @param {number} [options.rx] - Radius x value (When type option is 'circle', this options can use)\n * @param {number} [options.ry] - Radius y value (When type option is 'circle', this options can use)\n */\n setStates(type, options) {\n this._type = type;\n\n if (options) {\n this._options = extend(this._options, options);\n }\n }\n\n /**\n * Add the shape\n * @ignore\n * @param {string} type - Shape type (ex: 'rect', 'circle')\n * @param {Object} options - Shape options\n * @param {(ShapeFillOption | string)} [options.fill] - ShapeFillOption or Shape foreground color (ex: '#fff', 'transparent') or ShapeFillOption object\n * @param {string} [options.stroke] - Shape outline color\n * @param {number} [options.strokeWidth] - Shape outline width\n * @param {number} [options.width] - Width value (When type option is 'rect', this options can use)\n * @param {number} [options.height] - Height value (When type option is 'rect', this options can use)\n * @param {number} [options.rx] - Radius x value (When type option is 'circle', this options can use)\n * @param {number} [options.ry] - Radius y value (When type option is 'circle', this options can use)\n * @param {number} [options.isRegular] - Whether scaling shape has 1:1 ratio or not\n * @returns {Promise}\n */\n add(type, options) {\n return new Promise((resolve) => {\n const canvas = this.getCanvas();\n const extendOption = this._extendOptions(options);\n\n const shapeObj = this._createInstance(type, extendOption);\n const objectProperties = this.graphics.createObjectProperties(shapeObj);\n\n this._bindEventOnShape(shapeObj);\n\n canvas.add(shapeObj).setActiveObject(shapeObj);\n\n this._resetPositionFillFilter(shapeObj);\n\n resolve(objectProperties);\n });\n }\n\n /**\n * Change the shape\n * @ignore\n * @param {fabric.Object} shapeObj - Selected shape object on canvas\n * @param {Object} options - Shape options\n * @param {(ShapeFillOption | string)} [options.fill] - {@link ShapeFillOption} or\n * Shape foreground color (ex: '#fff', 'transparent')\n * @param {string} [options.stroke] - Shape outline color\n * @param {number} [options.strokeWidth] - Shape outline width\n * @param {number} [options.width] - Width value (When type option is 'rect', this options can use)\n * @param {number} [options.height] - Height value (When type option is 'rect', this options can use)\n * @param {number} [options.rx] - Radius x value (When type option is 'circle', this options can use)\n * @param {number} [options.ry] - Radius y value (When type option is 'circle', this options can use)\n * @param {number} [options.isRegular] - Whether scaling shape has 1:1 ratio or not\n * @returns {Promise}\n */\n change(shapeObj, options) {\n return new Promise((resolve, reject) => {\n if (!isShape(shapeObj)) {\n reject(rejectMessages.unsupportedType);\n }\n const hasFillOption = getFillTypeFromOption(options.fill) === 'filter';\n const { canvasImage, createStaticCanvas } = this.graphics;\n\n shapeObj.set(\n hasFillOption ? makeFabricFillOption(options, canvasImage, createStaticCanvas) : options\n );\n\n if (hasFillOption) {\n this._resetPositionFillFilter(shapeObj);\n }\n\n this.getCanvas().renderAll();\n resolve();\n });\n }\n\n /**\n * make fill property for user event\n * @param {fabric.Object} shapeObj - fabric object\n * @returns {Object}\n */\n makeFillPropertyForUserEvent(shapeObj) {\n const fillType = getFillTypeFromObject(shapeObj);\n const fillProp = {};\n\n if (fillType === SHAPE_FILL_TYPE.FILTER) {\n const fillImage = getFillImageFromShape(shapeObj);\n const filterOption = makeFilterOptionFromFabricImage(fillImage);\n\n fillProp.type = fillType;\n fillProp.filter = filterOption;\n } else {\n fillProp.type = SHAPE_FILL_TYPE.COLOR;\n fillProp.color = shapeObj.fill || 'transparent';\n }\n\n return fillProp;\n }\n\n /**\n * Copy object handling.\n * @param {fabric.Object} shapeObj - Shape object\n * @param {fabric.Object} originalShapeObj - Shape object\n */\n processForCopiedObject(shapeObj, originalShapeObj) {\n this._bindEventOnShape(shapeObj);\n\n if (getFillTypeFromObject(shapeObj) === 'filter') {\n const fillImage = getFillImageFromShape(originalShapeObj);\n const filterOption = makeFilterOptionFromFabricImage(fillImage);\n const newStaticCanvas = this.graphics.createStaticCanvas();\n\n shapeObj.set(\n makeFillPatternForFilter(this.graphics.canvasImage, filterOption, newStaticCanvas)\n );\n this._resetPositionFillFilter(shapeObj);\n }\n }\n\n /**\n * Create the instance of shape\n * @param {string} type - Shape type\n * @param {Object} options - Options to creat the shape\n * @returns {fabric.Object} Shape instance\n * @private\n */\n _createInstance(type, options) {\n let instance;\n\n switch (type) {\n case 'rect':\n instance = new fabric.Rect(options);\n break;\n case 'circle':\n instance = new fabric.Ellipse(\n extend(\n {\n type: 'circle',\n },\n options\n )\n );\n break;\n case 'triangle':\n instance = new fabric.Triangle(options);\n break;\n default:\n instance = {};\n }\n\n return instance;\n }\n\n /**\n * Get the options to create the shape\n * @param {Object} options - Options to creat the shape\n * @returns {Object} Shape options\n * @private\n */\n _extendOptions(options) {\n const selectionStyles = fObjectOptions.SELECTION_STYLE;\n const { canvasImage, createStaticCanvas } = this.graphics;\n\n options = extend({}, SHAPE_INIT_OPTIONS, this._options, selectionStyles, options);\n\n return makeFabricFillOption(options, canvasImage, createStaticCanvas);\n }\n\n /**\n * Bind fabric events on the creating shape object\n * @param {fabric.Object} shapeObj - Shape object\n * @private\n */\n _bindEventOnShape(shapeObj) {\n const self = this;\n const canvas = this.getCanvas();\n\n shapeObj.on({\n added() {\n self._shapeObj = this;\n resizeHelper.setOrigins(self._shapeObj);\n },\n selected() {\n self._isSelected = true;\n self._shapeObj = this;\n canvas.uniformScaling = true;\n canvas.defaultCursor = 'default';\n resizeHelper.setOrigins(self._shapeObj);\n },\n deselected() {\n self._isSelected = false;\n self._shapeObj = null;\n canvas.defaultCursor = 'crosshair';\n canvas.uniformScaling = false;\n },\n modified() {\n const currentObj = self._shapeObj;\n\n resizeHelper.adjustOriginToCenter(currentObj);\n resizeHelper.setOrigins(currentObj);\n },\n modifiedInGroup(activeSelection) {\n self._fillFilterRePositionInGroupSelection(shapeObj, activeSelection);\n },\n moving() {\n self._resetPositionFillFilter(this);\n },\n rotating() {\n self._resetPositionFillFilter(this);\n },\n scaling(fEvent) {\n const pointer = canvas.getPointer(fEvent.e);\n const currentObj = self._shapeObj;\n\n canvas.setCursor('crosshair');\n resizeHelper.resize(currentObj, pointer, true);\n\n self._resetPositionFillFilter(this);\n },\n });\n }\n\n /**\n * MouseDown event handler on canvas\n * @param {{target: fabric.Object, e: MouseEvent}} fEvent - Fabric event object\n * @private\n */\n _onFabricMouseDown(fEvent) {\n if (!fEvent.target) {\n this._isSelected = false;\n this._shapeObj = false;\n }\n\n if (!this._isSelected && !this._shapeObj) {\n const canvas = this.getCanvas();\n this._startPoint = canvas.getPointer(fEvent.e);\n\n canvas.on({\n 'mouse:move': this._handlers.mousemove,\n 'mouse:up': this._handlers.mouseup,\n });\n }\n }\n\n /**\n * MouseDown event handler on canvas\n * @param {{target: fabric.Object, e: MouseEvent}} fEvent - Fabric event object\n * @private\n */\n _onFabricMouseMove(fEvent) {\n const canvas = this.getCanvas();\n const pointer = canvas.getPointer(fEvent.e);\n const startPointX = this._startPoint.x;\n const startPointY = this._startPoint.y;\n const width = startPointX - pointer.x;\n const height = startPointY - pointer.y;\n const shape = this._shapeObj;\n\n if (!shape) {\n this.add(this._type, {\n left: startPointX,\n top: startPointY,\n width,\n height,\n }).then((objectProps) => {\n this.fire(eventNames.ADD_OBJECT, objectProps);\n });\n } else {\n this._shapeObj.set({\n isRegular: this._withShiftKey,\n });\n\n resizeHelper.resize(shape, pointer);\n canvas.renderAll();\n\n this._resetPositionFillFilter(shape);\n }\n }\n\n /**\n * MouseUp event handler on canvas\n * @private\n */\n _onFabricMouseUp() {\n const canvas = this.getCanvas();\n const startPointX = this._startPoint.x;\n const startPointY = this._startPoint.y;\n const shape = this._shapeObj;\n\n if (!shape) {\n this.add(this._type, {\n left: startPointX,\n top: startPointY,\n width: DEFAULT_WIDTH,\n height: DEFAULT_HEIGHT,\n }).then((objectProps) => {\n this.fire(eventNames.ADD_OBJECT, objectProps);\n });\n } else if (shape) {\n resizeHelper.adjustOriginToCenter(shape);\n this.fire(eventNames.OBJECT_ADDED, this.graphics.createObjectProperties(shape));\n }\n\n canvas.off({\n 'mouse:move': this._handlers.mousemove,\n 'mouse:up': this._handlers.mouseup,\n });\n }\n\n /**\n * Keydown event handler on document\n * @param {KeyboardEvent} e - Event object\n * @private\n */\n _onKeyDown(e) {\n if (e.keyCode === KEY_CODES.SHIFT) {\n this._withShiftKey = true;\n\n if (this._shapeObj) {\n this._shapeObj.isRegular = true;\n }\n }\n }\n\n /**\n * Keyup event handler on document\n * @param {KeyboardEvent} e - Event object\n * @private\n */\n _onKeyUp(e) {\n if (e.keyCode === KEY_CODES.SHIFT) {\n this._withShiftKey = false;\n\n if (this._shapeObj) {\n this._shapeObj.isRegular = false;\n }\n }\n }\n\n /**\n * Reset shape position and internal proportions in the filter type fill area.\n * @param {fabric.Object} shapeObj - Shape object\n * @private\n */\n _resetPositionFillFilter(shapeObj) {\n if (getFillTypeFromObject(shapeObj) !== 'filter') {\n return;\n }\n\n const { patternSourceCanvas } = getCustomProperty(shapeObj, 'patternSourceCanvas');\n\n const fillImage = getFillImageFromShape(shapeObj);\n const { originalAngle } = getCustomProperty(fillImage, 'originalAngle');\n\n if (this.graphics.canvasImage.angle !== originalAngle) {\n reMakePatternImageSource(shapeObj, this.graphics.canvasImage);\n }\n const { originX, originY } = shapeObj;\n\n resizeHelper.adjustOriginToCenter(shapeObj);\n\n shapeObj.width *= shapeObj.scaleX;\n shapeObj.height *= shapeObj.scaleY;\n shapeObj.rx *= shapeObj.scaleX;\n shapeObj.ry *= shapeObj.scaleY;\n shapeObj.scaleX = 1;\n shapeObj.scaleY = 1;\n\n rePositionFilterTypeFillImage(shapeObj);\n\n changeOrigin(shapeObj, {\n originX,\n originY,\n });\n\n resetFillPatternCanvas(patternSourceCanvas);\n }\n\n /**\n * Reset filter area position within group selection.\n * @param {fabric.Object} shapeObj - Shape object\n * @param {fabric.ActiveSelection} activeSelection - Shape object\n * @private\n */\n _fillFilterRePositionInGroupSelection(shapeObj, activeSelection) {\n if (activeSelection.scaleX !== 1 || activeSelection.scaleY !== 1) {\n // This is necessary because the group's scale transition state affects the relative size of the fill area.\n // The only way to reset the object transformation scale state to neutral.\n // {@link https://github.com/fabricjs/fabric.js/issues/5372}\n activeSelection.addWithUpdate();\n }\n\n const { angle, left, top } = shapeObj;\n\n activeSelection.realizeTransform(shapeObj);\n this._resetPositionFillFilter(shapeObj);\n\n shapeObj.set({\n angle,\n left,\n top,\n });\n }\n}\n","/**\n * @author NHN. FE Development Team \n * @fileoverview Text module\n */\nimport snippet from 'tui-code-snippet';\nimport fabric from 'fabric';\nimport Component from '@/interface/component';\nimport { Promise } from '@/util';\nimport { componentNames, eventNames as events, fObjectOptions } from '@/consts';\n\nconst defaultStyles = {\n fill: '#000000',\n left: 0,\n top: 0,\n};\nconst resetStyles = {\n fill: '#000000',\n fontStyle: 'normal',\n fontWeight: 'normal',\n textAlign: 'left',\n underline: false,\n};\nconst DBCLICK_TIME = 500;\n\n/**\n * Text\n * @class Text\n * @param {Graphics} graphics - Graphics instance\n * @extends {Component}\n * @ignore\n */\nclass Text extends Component {\n constructor(graphics) {\n super(componentNames.TEXT, graphics);\n\n /**\n * Default text style\n * @type {Object}\n */\n this._defaultStyles = defaultStyles;\n\n /**\n * Selected state\n * @type {boolean}\n */\n this._isSelected = false;\n\n /**\n * Selected text object\n * @type {Object}\n */\n this._selectedObj = {};\n\n /**\n * Editing text object\n * @type {Object}\n */\n this._editingObj = {};\n\n /**\n * Listeners for fabric event\n * @type {Object}\n */\n this._listeners = {\n mousedown: this._onFabricMouseDown.bind(this),\n select: this._onFabricSelect.bind(this),\n selectClear: this._onFabricSelectClear.bind(this),\n scaling: this._onFabricScaling.bind(this),\n textChanged: this._onFabricTextChanged.bind(this),\n };\n\n /**\n * Textarea element for editing\n * @type {HTMLElement}\n */\n this._textarea = null;\n\n /**\n * Ratio of current canvas\n * @type {number}\n */\n this._ratio = 1;\n\n /**\n * Last click time\n * @type {Date}\n */\n this._lastClickTime = new Date().getTime();\n\n /**\n * Text object infos before editing\n * @type {Object}\n */\n this._editingObjInfos = {};\n\n /**\n * Previous state of editing\n * @type {boolean}\n */\n this.isPrevEditing = false;\n }\n\n /**\n * Start input text mode\n */\n start() {\n const canvas = this.getCanvas();\n\n canvas.selection = false;\n canvas.defaultCursor = 'text';\n canvas.on({\n 'mouse:down': this._listeners.mousedown,\n 'selection:created': this._listeners.select,\n 'selection:updated': this._listeners.select,\n 'before:selection:cleared': this._listeners.selectClear,\n 'object:scaling': this._listeners.scaling,\n 'text:changed': this._listeners.textChanged,\n });\n\n canvas.forEachObject((obj) => {\n if (obj.type === 'i-text') {\n this.adjustOriginPosition(obj, 'start');\n }\n });\n\n this.setCanvasRatio();\n }\n\n /**\n * End input text mode\n */\n end() {\n const canvas = this.getCanvas();\n\n canvas.selection = true;\n canvas.defaultCursor = 'default';\n\n canvas.forEachObject((obj) => {\n if (obj.type === 'i-text') {\n if (obj.text === '') {\n canvas.remove(obj);\n } else {\n this.adjustOriginPosition(obj, 'end');\n }\n }\n });\n\n canvas.off({\n 'mouse:down': this._listeners.mousedown,\n 'selection:created': this._listeners.select,\n 'selection:updated': this._listeners.select,\n 'before:selection:cleared': this._listeners.selectClear,\n 'object:selected': this._listeners.select,\n 'object:scaling': this._listeners.scaling,\n 'text:changed': this._listeners.textChanged,\n });\n }\n\n /**\n * Adjust the origin position\n * @param {fabric.Object} text - text object\n * @param {string} editStatus - 'start' or 'end'\n */\n adjustOriginPosition(text, editStatus) {\n let [originX, originY] = ['center', 'center'];\n if (editStatus === 'start') {\n [originX, originY] = ['left', 'top'];\n }\n\n const { x: left, y: top } = text.getPointByOrigin(originX, originY);\n text.set({\n left,\n top,\n originX,\n originY,\n });\n text.setCoords();\n }\n\n /**\n * Add new text on canvas image\n * @param {string} text - Initial input text\n * @param {Object} options - Options for generating text\n * @param {Object} [options.styles] Initial styles\n * @param {string} [options.styles.fill] Color\n * @param {string} [options.styles.fontFamily] Font type for text\n * @param {number} [options.styles.fontSize] Size\n * @param {string} [options.styles.fontStyle] Type of inclination (normal / italic)\n * @param {string} [options.styles.fontWeight] Type of thicker or thinner looking (normal / bold)\n * @param {string} [options.styles.textAlign] Type of text align (left / center / right)\n * @param {string} [options.styles.textDecoration] Type of line (underline / line-through / overline)\n * @param {{x: number, y: number}} [options.position] - Initial position\n * @returns {Promise}\n */\n add(text, options) {\n return new Promise((resolve) => {\n const canvas = this.getCanvas();\n let newText = null;\n let selectionStyle = fObjectOptions.SELECTION_STYLE;\n let styles = this._defaultStyles;\n\n this._setInitPos(options.position);\n\n if (options.styles) {\n styles = snippet.extend(styles, options.styles);\n }\n\n if (!snippet.isExisty(options.autofocus)) {\n options.autofocus = true;\n }\n\n newText = new fabric.IText(text, styles);\n selectionStyle = snippet.extend({}, selectionStyle, {\n originX: 'left',\n originY: 'top',\n });\n\n newText.set(selectionStyle);\n newText.on({\n mouseup: this._onFabricMouseUp.bind(this),\n });\n\n canvas.add(newText);\n\n if (options.autofocus) {\n newText.enterEditing();\n newText.selectAll();\n }\n\n if (!canvas.getActiveObject()) {\n canvas.setActiveObject(newText);\n }\n\n this.isPrevEditing = true;\n resolve(this.graphics.createObjectProperties(newText));\n });\n }\n\n /**\n * Change text of activate object on canvas image\n * @param {Object} activeObj - Current selected text object\n * @param {string} text - Changed text\n * @returns {Promise}\n */\n change(activeObj, text) {\n return new Promise((resolve) => {\n activeObj.set('text', text);\n\n this.getCanvas().renderAll();\n resolve();\n });\n }\n\n /**\n * Set style\n * @param {Object} activeObj - Current selected text object\n * @param {Object} styleObj - Initial styles\n * @param {string} [styleObj.fill] Color\n * @param {string} [styleObj.fontFamily] Font type for text\n * @param {number} [styleObj.fontSize] Size\n * @param {string} [styleObj.fontStyle] Type of inclination (normal / italic)\n * @param {string} [styleObj.fontWeight] Type of thicker or thinner looking (normal / bold)\n * @param {string} [styleObj.textAlign] Type of text align (left / center / right)\n * @param {string} [styleObj.textDecoration] Type of line (underline / line-through / overline)\n * @returns {Promise}\n */\n setStyle(activeObj, styleObj) {\n return new Promise((resolve) => {\n snippet.forEach(\n styleObj,\n (val, key) => {\n if (activeObj[key] === val && key !== 'fontSize') {\n styleObj[key] = resetStyles[key] || '';\n }\n },\n this\n );\n\n if ('textDecoration' in styleObj) {\n snippet.extend(styleObj, this._getTextDecorationAdaptObject(styleObj.textDecoration));\n }\n\n activeObj.set(styleObj);\n\n this.getCanvas().renderAll();\n resolve();\n });\n }\n\n /**\n * Get the text\n * @param {Object} activeObj - Current selected text object\n * @returns {String} text\n */\n getText(activeObj) {\n return activeObj.text;\n }\n\n /**\n * Set infos of the current selected object\n * @param {fabric.Text} obj - Current selected text object\n * @param {boolean} state - State of selecting\n */\n setSelectedInfo(obj, state) {\n this._selectedObj = obj;\n this._isSelected = state;\n }\n\n /**\n * Whether object is selected or not\n * @returns {boolean} State of selecting\n */\n isSelected() {\n return this._isSelected;\n }\n\n /**\n * Get current selected text object\n * @returns {fabric.Text} Current selected text object\n */\n getSelectedObj() {\n return this._selectedObj;\n }\n\n /**\n * Set ratio value of canvas\n */\n setCanvasRatio() {\n const canvasElement = this.getCanvasElement();\n const cssWidth = parseInt(canvasElement.style.maxWidth, 10);\n const originWidth = canvasElement.width;\n\n this._ratio = originWidth / cssWidth;\n }\n\n /**\n * Get ratio value of canvas\n * @returns {number} Ratio value\n */\n getCanvasRatio() {\n return this._ratio;\n }\n\n /**\n * Get text decoration adapt object\n * @param {string} textDecoration - text decoration option string\n * @returns {object} adapt object for override\n */\n _getTextDecorationAdaptObject(textDecoration) {\n return {\n underline: textDecoration === 'underline',\n linethrough: textDecoration === 'line-through',\n overline: textDecoration === 'overline',\n };\n }\n\n /**\n * Set initial position on canvas image\n * @param {{x: number, y: number}} [position] - Selected position\n * @private\n */\n _setInitPos(position) {\n position = position || this.getCanvasImage().getCenterPoint();\n\n this._defaultStyles.left = position.x;\n this._defaultStyles.top = position.y;\n }\n\n /**\n * Input event handler\n * @private\n */\n _onInput() {\n const ratio = this.getCanvasRatio();\n const obj = this._editingObj;\n const textareaStyle = this._textarea.style;\n\n textareaStyle.width = `${Math.ceil(obj.width / ratio)}px`;\n textareaStyle.height = `${Math.ceil(obj.height / ratio)}px`;\n }\n\n /**\n * Keydown event handler\n * @private\n */\n _onKeyDown() {\n const ratio = this.getCanvasRatio();\n const obj = this._editingObj;\n const textareaStyle = this._textarea.style;\n\n setTimeout(() => {\n obj.text(this._textarea.value);\n\n textareaStyle.width = `${Math.ceil(obj.width / ratio)}px`;\n textareaStyle.height = `${Math.ceil(obj.height / ratio)}px`;\n }, 0);\n }\n\n /**\n * Blur event handler\n * @private\n */\n _onBlur() {\n const ratio = this.getCanvasRatio();\n const editingObj = this._editingObj;\n const editingObjInfos = this._editingObjInfos;\n const textContent = this._textarea.value;\n let transWidth = editingObj.width / ratio - editingObjInfos.width / ratio;\n let transHeight = editingObj.height / ratio - editingObjInfos.height / ratio;\n\n if (ratio === 1) {\n transWidth /= 2;\n transHeight /= 2;\n }\n\n this._textarea.style.display = 'none';\n\n editingObj.set({\n left: editingObjInfos.left + transWidth,\n top: editingObjInfos.top + transHeight,\n });\n\n if (textContent.length) {\n this.getCanvas().add(editingObj);\n\n const params = {\n id: snippet.stamp(editingObj),\n type: editingObj.type,\n text: textContent,\n };\n\n this.fire(events.TEXT_CHANGED, params);\n }\n }\n\n /**\n * Scroll event handler\n * @private\n */\n _onScroll() {\n this._textarea.scrollLeft = 0;\n this._textarea.scrollTop = 0;\n }\n\n /**\n * Fabric scaling event handler\n * @param {fabric.Event} fEvent - Current scaling event on selected object\n * @private\n */\n _onFabricScaling(fEvent) {\n const obj = fEvent.target;\n\n obj.fontSize = obj.fontSize * obj.scaleY;\n obj.scaleX = 1;\n obj.scaleY = 1;\n }\n\n /**\n * textChanged event handler\n * @param {{target: fabric.Object}} props - changed text object\n * @private\n */\n _onFabricTextChanged(props) {\n this.fire(events.TEXT_CHANGED, props.target);\n }\n\n /**\n * onSelectClear handler in fabric canvas\n * @param {{target: fabric.Object, e: MouseEvent}} fEvent - Fabric event\n * @private\n */\n _onFabricSelectClear(fEvent) {\n const obj = this.getSelectedObj();\n\n this.isPrevEditing = true;\n\n this.setSelectedInfo(fEvent.target, false);\n\n if (obj) {\n // obj is empty object at initial time, will be set fabric object\n if (obj.text === '') {\n this.getCanvas().remove(obj);\n }\n }\n }\n\n /**\n * onSelect handler in fabric canvas\n * @param {{target: fabric.Object, e: MouseEvent}} fEvent - Fabric event\n * @private\n */\n _onFabricSelect(fEvent) {\n this.isPrevEditing = true;\n\n this.setSelectedInfo(fEvent.target, true);\n }\n\n /**\n * Fabric 'mousedown' event handler\n * @param {fabric.Event} fEvent - Current mousedown event on selected object\n * @private\n */\n _onFabricMouseDown(fEvent) {\n const obj = fEvent.target;\n\n if (obj && !obj.isType('text')) {\n return;\n }\n\n if (this.isPrevEditing) {\n this.isPrevEditing = false;\n\n return;\n }\n\n this._fireAddText(fEvent);\n }\n\n /**\n * Fire 'addText' event if object is not selected.\n * @param {fabric.Event} fEvent - Current mousedown event on selected object\n * @private\n */\n _fireAddText(fEvent) {\n const obj = fEvent.target;\n const e = fEvent.e || {};\n const originPointer = this.getCanvas().getPointer(e);\n\n if (!obj) {\n this.fire(events.ADD_TEXT, {\n originPosition: {\n x: originPointer.x,\n y: originPointer.y,\n },\n clientPosition: {\n x: e.clientX || 0,\n y: e.clientY || 0,\n },\n });\n }\n }\n\n /**\n * Fabric mouseup event handler\n * @param {fabric.Event} fEvent - Current mousedown event on selected object\n * @private\n */\n _onFabricMouseUp(fEvent) {\n const { target } = fEvent;\n const newClickTime = new Date().getTime();\n\n if (this._isDoubleClick(newClickTime) && !target.isEditing) {\n target.enterEditing();\n }\n\n if (target.isEditing) {\n this.fire(events.TEXT_EDITING); // fire editing text event\n }\n\n this._lastClickTime = newClickTime;\n }\n\n /**\n * Get state of firing double click event\n * @param {Date} newClickTime - Current clicked time\n * @returns {boolean} Whether double clicked or not\n * @private\n */\n _isDoubleClick(newClickTime) {\n return newClickTime - this._lastClickTime < DBCLICK_TIME;\n }\n}\n\nexport default Text;\n","/**\n * @author NHN. FE Development Team \n * @fileoverview Image zoom module (start zoom, end zoom)\n */\nimport fabric from 'fabric';\nimport Component from '@/interface/component';\nimport { clamp } from '@/util';\nimport { componentNames, eventNames, keyCodes, zoomModes } from '@/consts';\n\nconst MOUSE_MOVE_THRESHOLD = 10;\nconst DEFAULT_SCROLL_OPTION = {\n left: 0,\n top: 0,\n width: 0,\n height: 0,\n stroke: '#000000',\n strokeWidth: 0,\n fill: '#000000',\n opacity: 0.4,\n evented: false,\n selectable: false,\n hoverCursor: 'auto',\n};\nconst DEFAULT_VERTICAL_SCROLL_RATIO = {\n SIZE: 0.0045,\n MARGIN: 0.003,\n BORDER_RADIUS: 0.003,\n};\nconst DEFAULT_HORIZONTAL_SCROLL_RATIO = {\n SIZE: 0.0066,\n MARGIN: 0.0044,\n BORDER_RADIUS: 0.003,\n};\nconst DEFAULT_ZOOM_LEVEL = 1.0;\nconst {\n ZOOM_CHANGED,\n ADD_TEXT,\n TEXT_EDITING,\n OBJECT_MODIFIED,\n KEY_DOWN,\n KEY_UP,\n HAND_STARTED,\n HAND_STOPPED,\n} = eventNames;\n\n/**\n * Zoom components\n * @param {Graphics} graphics - Graphics instance\n * @extends {Component}\n * @class Zoom\n * @ignore\n */\nclass Zoom extends Component {\n constructor(graphics) {\n super(componentNames.ZOOM, graphics);\n\n /**\n * zoomArea\n * @type {?fabric.Rect}\n * @private\n */\n this.zoomArea = null;\n\n /**\n * Start point of zoom area\n * @type {?{x: number, y: number}}\n */\n this._startPoint = null;\n\n /**\n * Center point of every zoom\n * @type {Array.<{prevZoomLevel: number, zoomLevel: number, x: number, y: number}>}\n */\n this._centerPoints = [];\n\n /**\n * Zoom level (default: 100%(1.0), max: 400%(4.0))\n * @type {number}\n */\n this.zoomLevel = DEFAULT_ZOOM_LEVEL;\n\n /**\n * Zoom mode ('normal', 'zoom', 'hand')\n * @type {string}\n */\n this.zoomMode = zoomModes.DEFAULT;\n\n /**\n * Listeners\n * @type {Object.}\n * @private\n */\n this._listeners = {\n startZoom: this._onMouseDownWithZoomMode.bind(this),\n moveZoom: this._onMouseMoveWithZoomMode.bind(this),\n stopZoom: this._onMouseUpWithZoomMode.bind(this),\n startHand: this._onMouseDownWithHandMode.bind(this),\n moveHand: this._onMouseMoveWithHandMode.bind(this),\n stopHand: this._onMouseUpWithHandMode.bind(this),\n zoomChanged: this._changeScrollState.bind(this),\n keydown: this._startHandModeWithSpaceBar.bind(this),\n keyup: this._endHandModeWithSpaceBar.bind(this),\n };\n\n const canvas = this.getCanvas();\n\n /**\n * Width:Height ratio (ex. width=1.5, height=1 -> aspectRatio=1.5)\n * @private\n */\n this.aspectRatio = canvas.width / canvas.height;\n\n /**\n * vertical scroll bar\n * @type {fabric.Rect}\n * @private\n */\n this._verticalScroll = new fabric.Rect(DEFAULT_SCROLL_OPTION);\n\n /**\n * horizontal scroll bar\n * @type {fabric.Rect}\n * @private\n */\n this._horizontalScroll = new fabric.Rect(DEFAULT_SCROLL_OPTION);\n\n canvas.on(ZOOM_CHANGED, this._listeners.zoomChanged);\n\n this.graphics.on(ADD_TEXT, this._startTextEditingHandler.bind(this));\n this.graphics.on(TEXT_EDITING, this._startTextEditingHandler.bind(this));\n this.graphics.on(OBJECT_MODIFIED, this._stopTextEditingHandler.bind(this));\n fabric.util.addListener(document, KEY_DOWN, this._listeners.keydown);\n fabric.util.addListener(document, KEY_UP, this._listeners.keyup);\n }\n\n /**\n * Handler when you started editing text\n * @private\n */\n _startTextEditingHandler() {\n this.isTextEditing = true;\n }\n\n /**\n * Handler when you stopped editing text\n * @private\n */\n _stopTextEditingHandler() {\n this.isTextEditing = false;\n }\n\n /**\n * Handler who turns on hand mode when the space bar is down\n * @param {KeyboardEvent} e - Event object\n * @private\n */\n _startHandModeWithSpaceBar(e) {\n if (this.withSpace || this.isTextEditing) {\n return;\n }\n\n if (e.keyCode === keyCodes.SPACE) {\n e.preventDefault();\n this.withSpace = true;\n this.startHandMode();\n }\n }\n\n /**\n * Handler who turns off hand mode when space bar is up\n * @param {KeyboardEvent} e - Event object\n * @private\n */\n _endHandModeWithSpaceBar(e) {\n if (e.keyCode === keyCodes.SPACE) {\n e.preventDefault();\n this.withSpace = false;\n this.endHandMode();\n }\n }\n\n /**\n * Start zoom-in mode\n */\n startZoomInMode() {\n if (this.zoomArea) {\n return;\n }\n this.endHandMode();\n this.zoomMode = zoomModes.ZOOM;\n\n const canvas = this.getCanvas();\n\n this._changeObjectsEventedState(false);\n\n this.zoomArea = new fabric.Rect({\n left: 0,\n top: 0,\n width: 0.5,\n height: 0.5,\n stroke: 'black',\n strokeWidth: 1,\n fill: 'transparent',\n hoverCursor: 'zoom-in',\n });\n\n canvas.discardActiveObject();\n canvas.add(this.zoomArea);\n canvas.on('mouse:down', this._listeners.startZoom);\n canvas.selection = false;\n canvas.defaultCursor = 'zoom-in';\n }\n\n /**\n * End zoom-in mode\n */\n endZoomInMode() {\n this.zoomMode = zoomModes.DEFAULT;\n\n const canvas = this.getCanvas();\n const { startZoom, moveZoom, stopZoom } = this._listeners;\n\n canvas.selection = true;\n canvas.defaultCursor = 'auto';\n canvas.off({\n 'mouse:down': startZoom,\n 'mouse:move': moveZoom,\n 'mouse:up': stopZoom,\n });\n\n this._changeObjectsEventedState(true);\n\n canvas.remove(this.zoomArea);\n this.zoomArea = null;\n }\n\n /**\n * Start zoom drawing mode\n */\n start() {\n this.zoomArea = null;\n this._startPoint = null;\n this._startHandPoint = null;\n }\n\n /**\n * Stop zoom drawing mode\n */\n end() {\n this.endZoomInMode();\n this.endHandMode();\n }\n\n /**\n * Start hand mode\n */\n startHandMode() {\n this.endZoomInMode();\n this.zoomMode = zoomModes.HAND;\n\n const canvas = this.getCanvas();\n\n this._changeObjectsEventedState(false);\n\n canvas.discardActiveObject();\n canvas.off('mouse:down', this._listeners.startHand);\n canvas.on('mouse:down', this._listeners.startHand);\n canvas.selection = false;\n canvas.defaultCursor = 'grab';\n\n canvas.fire(HAND_STARTED);\n }\n\n /**\n * Stop hand mode\n */\n endHandMode() {\n this.zoomMode = zoomModes.DEFAULT;\n const canvas = this.getCanvas();\n\n this._changeObjectsEventedState(true);\n\n canvas.off('mouse:down', this._listeners.startHand);\n canvas.selection = true;\n canvas.defaultCursor = 'auto';\n\n this._startHandPoint = null;\n\n canvas.fire(HAND_STOPPED);\n }\n\n /**\n * onMousedown handler in fabric canvas\n * @param {{target: fabric.Object, e: MouseEvent}} fEvent - Fabric event\n * @private\n */\n _onMouseDownWithZoomMode({ target, e }) {\n if (target) {\n return;\n }\n\n const canvas = this.getCanvas();\n\n canvas.selection = false;\n\n this._startPoint = canvas.getPointer(e);\n this.zoomArea.set({ width: 0, height: 0 });\n\n const { moveZoom, stopZoom } = this._listeners;\n canvas.on({\n 'mouse:move': moveZoom,\n 'mouse:up': stopZoom,\n });\n }\n\n /**\n * onMousemove handler in fabric canvas\n * @param {{e: MouseEvent}} fEvent - Fabric event\n * @private\n */\n _onMouseMoveWithZoomMode({ e }) {\n const canvas = this.getCanvas();\n const pointer = canvas.getPointer(e);\n const { x, y } = pointer;\n const { zoomArea, _startPoint } = this;\n const deltaX = Math.abs(x - _startPoint.x);\n const deltaY = Math.abs(y - _startPoint.y);\n\n if (deltaX + deltaY > MOUSE_MOVE_THRESHOLD) {\n canvas.remove(zoomArea);\n zoomArea.set(this._calcRectDimensionFromPoint(x, y));\n canvas.add(zoomArea);\n }\n }\n\n /**\n * Get rect dimension setting from Canvas-Mouse-Position(x, y)\n * @param {number} x - Canvas-Mouse-Position x\n * @param {number} y - Canvas-Mouse-Position Y\n * @returns {{left: number, top: number, width: number, height: number}}\n * @private\n */\n _calcRectDimensionFromPoint(x, y) {\n const canvas = this.getCanvas();\n const canvasWidth = canvas.getWidth();\n const canvasHeight = canvas.getHeight();\n const { x: startX, y: startY } = this._startPoint;\n const { min } = Math;\n\n const left = min(startX, x);\n const top = min(startY, y);\n const width = clamp(x, startX, canvasWidth) - left; // (startX <= x(mouse) <= canvasWidth) - left\n const height = clamp(y, startY, canvasHeight) - top; // (startY <= y(mouse) <= canvasHeight) - top\n\n return { left, top, width, height };\n }\n\n /**\n * onMouseup handler in fabric canvas\n * @private\n */\n _onMouseUpWithZoomMode() {\n let { zoomLevel } = this;\n const { zoomArea } = this;\n const { moveZoom, stopZoom } = this._listeners;\n const canvas = this.getCanvas();\n const center = this._getCenterPoint();\n const { x, y } = center;\n\n if (!this._isMaxZoomLevel()) {\n this._centerPoints.push({\n x,\n y,\n prevZoomLevel: zoomLevel,\n zoomLevel: zoomLevel + 1,\n });\n zoomLevel += 1;\n canvas.zoomToPoint({ x, y }, zoomLevel);\n\n this._fireZoomChanged(canvas, zoomLevel);\n\n this.zoomLevel = zoomLevel;\n }\n\n canvas.off({\n 'mouse:move': moveZoom,\n 'mouse:up': stopZoom,\n });\n\n canvas.remove(zoomArea);\n this._startPoint = null;\n }\n\n /**\n * Get center point\n * @returns {{x: number, y: number}}\n * @private\n */\n _getCenterPoint() {\n const { left, top, width, height } = this.zoomArea;\n const { x, y } = this._startPoint;\n const { aspectRatio } = this;\n\n if (width < MOUSE_MOVE_THRESHOLD && height < MOUSE_MOVE_THRESHOLD) {\n return { x, y };\n }\n\n return width > height\n ? { x: left + (aspectRatio * height) / 2, y: top + height / 2 }\n : { x: left + width / 2, y: top + width / aspectRatio / 2 };\n }\n\n /**\n * Zoom the canvas\n * @param {{x: number, y: number}} center - center of zoom\n * @param {?number} zoomLevel - zoom level\n */\n zoom({ x, y }, zoomLevel = this.zoomLevel) {\n const canvas = this.getCanvas();\n const centerPoints = this._centerPoints;\n\n for (let i = centerPoints.length - 1; i >= 0; i -= 1) {\n if (centerPoints[i].zoomLevel < zoomLevel) {\n break;\n }\n\n const { x: prevX, y: prevY, prevZoomLevel } = centerPoints.pop();\n\n canvas.zoomToPoint({ x: prevX, y: prevY }, prevZoomLevel);\n this.zoomLevel = prevZoomLevel;\n }\n\n canvas.zoomToPoint({ x, y }, zoomLevel);\n if (!this._isDefaultZoomLevel(zoomLevel)) {\n this._centerPoints.push({\n x,\n y,\n zoomLevel,\n prevZoomLevel: this.zoomLevel,\n });\n }\n this.zoomLevel = zoomLevel;\n\n this._fireZoomChanged(canvas, zoomLevel);\n }\n\n /**\n * Zoom out one step\n */\n zoomOut() {\n const centerPoints = this._centerPoints;\n\n if (!centerPoints.length) {\n return;\n }\n\n const canvas = this.getCanvas();\n const point = centerPoints.pop();\n const { x, y, prevZoomLevel } = point;\n\n if (this._isDefaultZoomLevel(prevZoomLevel)) {\n canvas.setViewportTransform([1, 0, 0, 1, 0, 0]);\n } else {\n canvas.zoomToPoint({ x, y }, prevZoomLevel);\n }\n\n this.zoomLevel = prevZoomLevel;\n\n this._fireZoomChanged(canvas, this.zoomLevel);\n }\n\n /**\n * Zoom reset\n */\n resetZoom() {\n const canvas = this.getCanvas();\n\n canvas.setViewportTransform([1, 0, 0, 1, 0, 0]);\n\n this.zoomLevel = DEFAULT_ZOOM_LEVEL;\n this._centerPoints = [];\n\n this._fireZoomChanged(canvas, this.zoomLevel);\n }\n\n /**\n * Whether zoom level is max (5.0)\n * @returns {boolean}\n * @private\n */\n _isMaxZoomLevel() {\n return this.zoomLevel >= 5.0;\n }\n\n /**\n * Move point of zoom\n * @param {{x: number, y: number}} delta - move amount\n * @private\n */\n _movePointOfZoom({ x: deltaX, y: deltaY }) {\n const centerPoints = this._centerPoints;\n\n if (!centerPoints.length) {\n return;\n }\n\n const canvas = this.getCanvas();\n const { zoomLevel } = this;\n\n const point = centerPoints.pop();\n const { x: originX, y: originY, prevZoomLevel } = point;\n const x = originX - deltaX;\n const y = originY - deltaY;\n\n canvas.zoomToPoint({ x: originX, y: originY }, prevZoomLevel);\n canvas.zoomToPoint({ x, y }, zoomLevel);\n centerPoints.push({ x, y, prevZoomLevel, zoomLevel });\n\n this._fireZoomChanged(canvas, zoomLevel);\n }\n\n /**\n * onMouseDown handler in fabric canvas\n * @param {{target: fabric.Object, e: MouseEvent}} fEvent - Fabric event\n * @private\n */\n _onMouseDownWithHandMode({ target, e }) {\n if (target) {\n return;\n }\n\n const canvas = this.getCanvas();\n\n if (this.zoomLevel <= DEFAULT_ZOOM_LEVEL) {\n return;\n }\n\n canvas.selection = false;\n\n this._startHandPoint = canvas.getPointer(e);\n\n const { moveHand, stopHand } = this._listeners;\n canvas.on({\n 'mouse:move': moveHand,\n 'mouse:up': stopHand,\n });\n }\n\n /**\n * onMouseMove handler in fabric canvas\n * @param {{e: MouseEvent}} fEvent - Fabric event\n * @private\n */\n _onMouseMoveWithHandMode({ e }) {\n const canvas = this.getCanvas();\n const { x, y } = canvas.getPointer(e);\n const deltaX = x - this._startHandPoint.x;\n const deltaY = y - this._startHandPoint.y;\n\n this._movePointOfZoom({ x: deltaX, y: deltaY });\n }\n\n /**\n * onMouseUp handler in fabric canvas\n * @private\n */\n _onMouseUpWithHandMode() {\n const canvas = this.getCanvas();\n const { moveHand, stopHand } = this._listeners;\n\n canvas.off({\n 'mouse:move': moveHand,\n 'mouse:up': stopHand,\n });\n\n this._startHandPoint = null;\n }\n\n /**\n * onChangeZoom handler in fabric canvas\n * @private\n */\n _changeScrollState({ viewport, zoomLevel }) {\n const canvas = this.getCanvas();\n\n canvas.remove(this._verticalScroll);\n canvas.remove(this._horizontalScroll);\n\n if (this._isDefaultZoomLevel(zoomLevel)) {\n return;\n }\n\n const canvasWidth = canvas.width;\n const canvasHeight = canvas.height;\n\n const { tl, tr, bl } = viewport;\n const viewportWidth = tr.x - tl.x;\n const viewportHeight = bl.y - tl.y;\n\n const horizontalScrollWidth = (viewportWidth * viewportWidth) / canvasWidth;\n const horizontalScrollHeight = viewportHeight * DEFAULT_HORIZONTAL_SCROLL_RATIO.SIZE;\n const horizontalScrollLeft = clamp(\n tl.x + (tl.x / canvasWidth) * viewportWidth,\n tl.x,\n tr.x - horizontalScrollWidth\n );\n const horizontalScrollMargin = viewportHeight * DEFAULT_HORIZONTAL_SCROLL_RATIO.MARGIN;\n const horizontalScrollBorderRadius =\n viewportHeight * DEFAULT_HORIZONTAL_SCROLL_RATIO.BORDER_RADIUS;\n\n this._horizontalScroll.set({\n left: horizontalScrollLeft,\n top: bl.y - horizontalScrollHeight - horizontalScrollMargin,\n width: horizontalScrollWidth,\n height: horizontalScrollHeight,\n rx: horizontalScrollBorderRadius,\n ry: horizontalScrollBorderRadius,\n });\n\n const verticalScrollWidth = viewportWidth * DEFAULT_VERTICAL_SCROLL_RATIO.SIZE;\n const verticalScrollHeight = (viewportHeight * viewportHeight) / canvasHeight;\n const verticalScrollTop = clamp(\n tl.y + (tl.y / canvasHeight) * viewportHeight,\n tr.y,\n bl.y - verticalScrollHeight\n );\n const verticalScrollMargin = viewportWidth * DEFAULT_VERTICAL_SCROLL_RATIO.MARGIN;\n const verticalScrollBorderRadius = viewportWidth * DEFAULT_VERTICAL_SCROLL_RATIO.BORDER_RADIUS;\n\n this._verticalScroll.set({\n left: tr.x - verticalScrollWidth - verticalScrollMargin,\n top: verticalScrollTop,\n width: verticalScrollWidth,\n height: verticalScrollHeight,\n rx: verticalScrollBorderRadius,\n ry: verticalScrollBorderRadius,\n });\n\n this._addScrollBar();\n }\n\n /**\n * Change objects 'evented' state\n * @param {boolean} [evented=true] - objects 'evented' state\n */\n _changeObjectsEventedState(evented = true) {\n const canvas = this.getCanvas();\n\n canvas.forEachObject((obj) => {\n // {@link http://fabricjs.com/docs/fabric.Object.html#evented}\n obj.evented = evented;\n });\n }\n\n /**\n * Add scroll bar and set remove timer\n */\n _addScrollBar() {\n const canvas = this.getCanvas();\n\n canvas.add(this._horizontalScroll);\n canvas.add(this._verticalScroll);\n\n if (this.scrollBarTid) {\n clearTimeout(this.scrollBarTid);\n }\n\n this.scrollBarTid = setTimeout(() => {\n canvas.remove(this._horizontalScroll);\n canvas.remove(this._verticalScroll);\n }, 3000);\n }\n\n /**\n * Check zoom level is default zoom level (1.0)\n * @param {number} zoomLevel - zoom level\n * @returns {boolean} - whether zoom level is 1.0\n */\n _isDefaultZoomLevel(zoomLevel) {\n return zoomLevel === DEFAULT_ZOOM_LEVEL;\n }\n\n /**\n * Fire 'zoomChanged' event\n * @param {fabric.Canvas} canvas - fabric canvas\n * @param {number} zoomLevel - 'zoomChanged' event params\n */\n _fireZoomChanged(canvas, zoomLevel) {\n canvas.fire(ZOOM_CHANGED, { viewport: canvas.calcViewportBoundaries(), zoomLevel });\n }\n\n /**\n * Get zoom mode\n */\n get mode() {\n return this.zoomMode;\n }\n}\n\nexport default Zoom;\n","/**\n * @author NHN. FE Development Team \n * @fileoverview Constants\n */\nimport { keyMirror } from '@/util';\n\n/**\n * Help features for zoom\n * @type {Array.}\n */\nexport const ZOOM_HELP_MENUS = ['zoomIn', 'zoomOut', 'hand'];\n\n/**\n * Help features for command\n * @type {Array.}\n */\nexport const COMMAND_HELP_MENUS = ['history', 'undo', 'redo', 'reset'];\n\n/**\n * Help features for delete\n * @type {Array.}\n */\nexport const DELETE_HELP_MENUS = ['delete', 'deleteAll'];\n\n/**\n * Editor help features\n * @type {Array.}\n */\nexport const HELP_MENUS = [...ZOOM_HELP_MENUS, ...COMMAND_HELP_MENUS, ...DELETE_HELP_MENUS];\n\n/**\n * Fill type for shape\n * @type {Object.}\n */\nexport const SHAPE_FILL_TYPE = {\n FILTER: 'filter',\n COLOR: 'color',\n};\n\n/**\n * Shape type list\n * @type {Array.}\n */\nexport const SHAPE_TYPE = ['rect', 'circle', 'triangle'];\n\n/**\n * Object type\n * @type {Object.}\n */\nexport const OBJ_TYPE = {\n CROPZONE: 'cropzone',\n};\n\n/**\n * Filter type map\n * @type {Object.}\n */\nexport const filterType = {\n VINTAGE: 'vintage',\n SEPIA2: 'sepia2',\n REMOVE_COLOR: 'removeColor',\n COLOR_FILTER: 'colorFilter',\n REMOVE_WHITE: 'removeWhite',\n BLEND_COLOR: 'blendColor',\n BLEND: 'blend',\n};\n\n/**\n * Component names\n * @type {Object.}\n */\nexport const componentNames = keyMirror(\n 'IMAGE_LOADER',\n 'CROPPER',\n 'FLIP',\n 'ROTATION',\n 'FREE_DRAWING',\n 'LINE',\n 'TEXT',\n 'ICON',\n 'FILTER',\n 'SHAPE',\n 'ZOOM'\n);\n\n/**\n * Shape default option\n * @type {Object}\n */\nexport const SHAPE_DEFAULT_OPTIONS = {\n lockSkewingX: true,\n lockSkewingY: true,\n bringForward: true,\n isRegular: false,\n};\n\n/**\n * Cropzone default option\n * @type {Object}\n */\nexport const CROPZONE_DEFAULT_OPTIONS = {\n hasRotatingPoint: false,\n hasBorders: false,\n lockScalingFlip: true,\n lockRotation: true,\n lockSkewingX: true,\n lockSkewingY: true,\n};\n\n/**\n * Command names\n * @type {Object.}\n */\nexport const commandNames = {\n CLEAR_OBJECTS: 'clearObjects',\n LOAD_IMAGE: 'loadImage',\n FLIP_IMAGE: 'flip',\n ROTATE_IMAGE: 'rotate',\n ADD_OBJECT: 'addObject',\n REMOVE_OBJECT: 'removeObject',\n APPLY_FILTER: 'applyFilter',\n REMOVE_FILTER: 'removeFilter',\n ADD_ICON: 'addIcon',\n CHANGE_ICON_COLOR: 'changeIconColor',\n ADD_SHAPE: 'addShape',\n CHANGE_SHAPE: 'changeShape',\n ADD_TEXT: 'addText',\n CHANGE_TEXT: 'changeText',\n CHANGE_TEXT_STYLE: 'changeTextStyle',\n ADD_IMAGE_OBJECT: 'addImageObject',\n RESIZE_CANVAS_DIMENSION: 'resizeCanvasDimension',\n SET_OBJECT_PROPERTIES: 'setObjectProperties',\n SET_OBJECT_POSITION: 'setObjectPosition',\n CHANGE_SELECTION: 'changeSelection',\n};\n\n/**\n * Event names\n * @type {Object.}\n */\nexport const eventNames = {\n OBJECT_ACTIVATED: 'objectActivated',\n OBJECT_MOVED: 'objectMoved',\n OBJECT_SCALED: 'objectScaled',\n OBJECT_CREATED: 'objectCreated',\n OBJECT_ROTATED: 'objectRotated',\n OBJECT_ADDED: 'objectAdded',\n OBJECT_MODIFIED: 'objectModified',\n TEXT_EDITING: 'textEditing',\n TEXT_CHANGED: 'textChanged',\n ICON_CREATE_RESIZE: 'iconCreateResize',\n ICON_CREATE_END: 'iconCreateEnd',\n ADD_TEXT: 'addText',\n ADD_OBJECT: 'addObject',\n ADD_OBJECT_AFTER: 'addObjectAfter',\n MOUSE_DOWN: 'mousedown',\n MOUSE_UP: 'mouseup',\n MOUSE_MOVE: 'mousemove',\n // UNDO/REDO Events\n REDO_STACK_CHANGED: 'redoStackChanged',\n UNDO_STACK_CHANGED: 'undoStackChanged',\n SELECTION_CLEARED: 'selectionCleared',\n SELECTION_CREATED: 'selectionCreated',\n EXECUTE_COMMAND: 'executeCommand',\n AFTER_UNDO: 'afterUndo',\n AFTER_REDO: 'afterRedo',\n ZOOM_CHANGED: 'zoomChanged',\n HAND_STARTED: 'handStarted',\n HAND_STOPPED: 'handStopped',\n KEY_DOWN: 'keydown',\n KEY_UP: 'keyup',\n};\n\n/**\n * History names\n * @type {Object.}\n */\nexport const historyNames = {\n LOAD_IMAGE: 'Load',\n LOAD_MASK_IMAGE: 'Mask',\n ADD_MASK_IMAGE: 'Mask',\n ADD_IMAGE_OBJECT: 'Mask',\n CROP: 'Crop',\n APPLY_FILTER: 'Filter',\n REMOVE_FILTER: 'Filter',\n CHANGE_SHAPE: 'Shape',\n CHANGE_ICON_COLOR: 'Icon',\n ADD_TEXT: 'Text',\n CHANGE_TEXT_STYLE: 'Text',\n REMOVE_OBJECT: 'Delete',\n CLEAR_OBJECTS: 'Delete',\n};\n\n/**\n * Editor states\n * @type {Object.}\n */\nexport const drawingModes = keyMirror(\n 'NORMAL',\n 'CROPPER',\n 'FREE_DRAWING',\n 'LINE_DRAWING',\n 'TEXT',\n 'SHAPE',\n 'ICON',\n 'ZOOM'\n);\n\n/**\n * Menu names with drawing mode\n * @type {Object.}\n */\nexport const drawingMenuNames = {\n TEXT: 'text',\n CROP: 'crop',\n SHAPE: 'shape',\n ZOOM: 'zoom',\n};\n\n/**\n * Zoom modes\n * @type {Object.}\n */\nexport const zoomModes = {\n DEFAULT: 'normal',\n ZOOM: 'zoom',\n HAND: 'hand',\n};\n\n/**\n * Shortcut key values\n * @type {Object.}\n */\nexport const keyCodes = {\n Z: 90,\n Y: 89,\n C: 67,\n V: 86,\n SHIFT: 16,\n BACKSPACE: 8,\n DEL: 46,\n ARROW_DOWN: 40,\n ARROW_UP: 38,\n SPACE: 32,\n};\n\n/**\n * Fabric object options\n * @type {Object.}\n */\nexport const fObjectOptions = {\n SELECTION_STYLE: {\n borderColor: 'red',\n cornerColor: 'green',\n cornerSize: 10,\n originX: 'center',\n originY: 'center',\n transparentCorners: false,\n },\n};\n\n/**\n * Promise reject messages\n * @type {Object.}\n */\nexport const rejectMessages = {\n addedObject: 'The object is already added.',\n flip: 'The flipX and flipY setting values are not changed.',\n invalidDrawingMode: 'This operation is not supported in the drawing mode.',\n invalidParameters: 'Invalid parameters.',\n isLock: 'The executing command state is locked.',\n loadImage: 'The background image is empty.',\n loadingImageFailed: 'Invalid image loaded.',\n noActiveObject: 'There is no active object.',\n noObject: 'The object is not in canvas.',\n redo: 'The promise of redo command is reject.',\n rotation: 'The current angle is same the old angle.',\n undo: 'The promise of undo command is reject.',\n unsupportedOperation: 'Unsupported operation.',\n unsupportedType: 'Unsupported object type.',\n};\n\n/**\n * Default icon menu svg path\n * @type {Object.}\n */\nexport const defaultIconPath = {\n 'icon-arrow': 'M40 12V0l24 24-24 24V36H0V12h40z',\n 'icon-arrow-2': 'M49,32 H3 V22 h46 l-18,-18 h12 l23,23 L43,50 h-12 l18,-18 z ',\n 'icon-arrow-3':\n 'M43.349998,27 L17.354,53 H1.949999 l25.996,-26 L1.949999,1 h15.404 L43.349998,27 z ',\n 'icon-star':\n 'M35,54.557999 l-19.912001,10.468 l3.804,-22.172001 l-16.108,-15.7 l22.26,-3.236 L35,3.746 l9.956,20.172001 l22.26,3.236 l-16.108,15.7 l3.804,22.172001 z ',\n 'icon-star-2':\n 'M17,31.212 l-7.194,4.08 l-4.728,-6.83 l-8.234,0.524 l-1.328,-8.226 l-7.644,-3.14 l2.338,-7.992 l-5.54,-6.18 l5.54,-6.176 l-2.338,-7.994 l7.644,-3.138 l1.328,-8.226 l8.234,0.522 l4.728,-6.83 L17,-24.312 l7.194,-4.08 l4.728,6.83 l8.234,-0.522 l1.328,8.226 l7.644,3.14 l-2.338,7.992 l5.54,6.178 l-5.54,6.178 l2.338,7.992 l-7.644,3.14 l-1.328,8.226 l-8.234,-0.524 l-4.728,6.83 z ',\n 'icon-polygon': 'M3,31 L19,3 h32 l16,28 l-16,28 H19 z ',\n 'icon-location':\n 'M24 62C8 45.503 0 32.837 0 24 0 10.745 10.745 0 24 0s24 10.745 24 24c0 8.837-8 21.503-24 38zm0-28c5.523 0 10-4.477 10-10s-4.477-10-10-10-10 4.477-10 10 4.477 10 10 10z',\n 'icon-heart':\n 'M49.994999,91.349998 l-6.96,-6.333 C18.324001,62.606995 2.01,47.829002 2.01,29.690998 C2.01,14.912998 13.619999,3.299999 28.401001,3.299999 c8.349,0 16.362,5.859 21.594,12 c5.229,-6.141 13.242001,-12 21.591,-12 c14.778,0 26.390999,11.61 26.390999,26.390999 c0,18.138 -16.314001,32.916 -41.025002,55.374001 l-6.96,6.285 z ',\n 'icon-bubble':\n 'M44 48L34 58V48H12C5.373 48 0 42.627 0 36V12C0 5.373 5.373 0 12 0h40c6.627 0 12 5.373 12 12v24c0 6.627-5.373 12-12 12h-8z',\n};\n\nexport const defaultRotateRangeValues = {\n realTimeEvent: true,\n min: -360,\n max: 360,\n value: 0,\n};\n\nexport const defaultDrawRangeValues = {\n min: 5,\n max: 30,\n value: 12,\n};\n\nexport const defaultShapeStrokeValues = {\n realTimeEvent: true,\n min: 2,\n max: 300,\n value: 3,\n};\n\nexport const defaultTextRangeValues = {\n realTimeEvent: true,\n min: 10,\n max: 100,\n value: 50,\n};\n\nexport const defaultFilterRangeValues = {\n tintOpacityRange: {\n realTimeEvent: true,\n min: 0,\n max: 1,\n value: 0.7,\n useDecimal: true,\n },\n removewhiteDistanceRange: {\n realTimeEvent: true,\n min: 0,\n max: 1,\n value: 0.2,\n useDecimal: true,\n },\n brightnessRange: {\n realTimeEvent: true,\n min: -1,\n max: 1,\n value: 0,\n useDecimal: true,\n },\n noiseRange: {\n realTimeEvent: true,\n min: 0,\n max: 1000,\n value: 100,\n },\n pixelateRange: {\n realTimeEvent: true,\n min: 2,\n max: 20,\n value: 4,\n },\n colorfilterThresholdRange: {\n realTimeEvent: true,\n min: 0,\n max: 1,\n value: 0.2,\n useDecimal: true,\n },\n blurFilterRange: {\n value: 0.1,\n },\n};\n\nexport const emptyCropRectValues = {\n LEFT: 0,\n TOP: 0,\n WIDTH: 0.5,\n HEIGHT: 0.5,\n};\n","/**\n * @author NHN. FE Development Team \n * @fileoverview CropperDrawingMode class\n */\nimport DrawingMode from '@/interface/drawingMode';\nimport { drawingModes, componentNames as components } from '@/consts';\n\n/**\n * CropperDrawingMode class\n * @class\n * @ignore\n */\nclass CropperDrawingMode extends DrawingMode {\n constructor() {\n super(drawingModes.CROPPER);\n }\n\n /**\n * start this drawing mode\n * @param {Graphics} graphics - Graphics instance\n * @override\n */\n start(graphics) {\n const cropper = graphics.getComponent(components.CROPPER);\n cropper.start();\n }\n\n /**\n * stop this drawing mode\n * @param {Graphics} graphics - Graphics instance\n * @override\n */\n end(graphics) {\n const cropper = graphics.getComponent(components.CROPPER);\n cropper.end();\n }\n}\n\nexport default CropperDrawingMode;\n","/**\n * @author NHN. FE Development Team \n * @fileoverview FreeDrawingMode class\n */\nimport DrawingMode from '@/interface/drawingMode';\nimport { drawingModes, componentNames as components } from '@/consts';\n\n/**\n * FreeDrawingMode class\n * @class\n * @ignore\n */\nclass FreeDrawingMode extends DrawingMode {\n constructor() {\n super(drawingModes.FREE_DRAWING);\n }\n\n /**\n * start this drawing mode\n * @param {Graphics} graphics - Graphics instance\n * @param {{width: ?number, color: ?string}} [options] - Brush width & color\n * @override\n */\n start(graphics, options) {\n const freeDrawing = graphics.getComponent(components.FREE_DRAWING);\n freeDrawing.start(options);\n }\n\n /**\n * stop this drawing mode\n * @param {Graphics} graphics - Graphics instance\n * @override\n */\n end(graphics) {\n const freeDrawing = graphics.getComponent(components.FREE_DRAWING);\n freeDrawing.end();\n }\n}\n\nexport default FreeDrawingMode;\n","/**\n * @author NHN. FE Development Team \n * @fileoverview IconDrawingMode class\n */\nimport DrawingMode from '@/interface/drawingMode';\nimport { drawingModes, componentNames as components } from '@/consts';\n\n/**\n * IconDrawingMode class\n * @class\n * @ignore\n */\nclass IconDrawingMode extends DrawingMode {\n constructor() {\n super(drawingModes.ICON);\n }\n\n /**\n * start this drawing mode\n * @param {Graphics} graphics - Graphics instance\n * @override\n */\n start(graphics) {\n const icon = graphics.getComponent(components.ICON);\n icon.start();\n }\n\n /**\n * stop this drawing mode\n * @param {Graphics} graphics - Graphics instance\n * @override\n */\n end(graphics) {\n const icon = graphics.getComponent(components.ICON);\n icon.end();\n }\n}\n\nexport default IconDrawingMode;\n","/**\n * @author NHN. FE Development Team \n * @fileoverview LineDrawingMode class\n */\nimport DrawingMode from '@/interface/drawingMode';\nimport { drawingModes, componentNames as components } from '@/consts';\n\n/**\n * LineDrawingMode class\n * @class\n * @ignore\n */\nclass LineDrawingMode extends DrawingMode {\n constructor() {\n super(drawingModes.LINE_DRAWING);\n }\n\n /**\n * start this drawing mode\n * @param {Graphics} graphics - Graphics instance\n * @param {{width: ?number, color: ?string}} [options] - Brush width & color\n * @override\n */\n start(graphics, options) {\n const lineDrawing = graphics.getComponent(components.LINE);\n lineDrawing.start(options);\n }\n\n /**\n * stop this drawing mode\n * @param {Graphics} graphics - Graphics instance\n * @override\n */\n end(graphics) {\n const lineDrawing = graphics.getComponent(components.LINE);\n lineDrawing.end();\n }\n}\n\nexport default LineDrawingMode;\n","/**\n * @author NHN. FE Development Team \n * @fileoverview ShapeDrawingMode class\n */\nimport DrawingMode from '@/interface/drawingMode';\nimport { drawingModes, componentNames as components } from '@/consts';\n\n/**\n * ShapeDrawingMode class\n * @class\n * @ignore\n */\nclass ShapeDrawingMode extends DrawingMode {\n constructor() {\n super(drawingModes.SHAPE);\n }\n\n /**\n * start this drawing mode\n * @param {Graphics} graphics - Graphics instance\n * @override\n */\n start(graphics) {\n const shape = graphics.getComponent(components.SHAPE);\n shape.start();\n }\n\n /**\n * stop this drawing mode\n * @param {Graphics} graphics - Graphics instance\n * @override\n */\n end(graphics) {\n const shape = graphics.getComponent(components.SHAPE);\n shape.end();\n }\n}\n\nexport default ShapeDrawingMode;\n","/**\n * @author NHN. FE Development Team \n * @fileoverview TextDrawingMode class\n */\nimport DrawingMode from '@/interface/drawingMode';\nimport { drawingModes, componentNames as components } from '@/consts';\n\n/**\n * TextDrawingMode class\n * @class\n * @ignore\n */\nclass TextDrawingMode extends DrawingMode {\n constructor() {\n super(drawingModes.TEXT);\n }\n\n /**\n * start this drawing mode\n * @param {Graphics} graphics - Graphics instance\n * @override\n */\n start(graphics) {\n const text = graphics.getComponent(components.TEXT);\n text.start();\n }\n\n /**\n * stop this drawing mode\n * @param {Graphics} graphics - Graphics instance\n * @override\n */\n end(graphics) {\n const text = graphics.getComponent(components.TEXT);\n text.end();\n }\n}\n\nexport default TextDrawingMode;\n","/**\n * @author NHN. FE Development Team \n * @fileoverview ZoomDrawingMode class\n */\nimport DrawingMode from '@/interface/drawingMode';\nimport { drawingModes, componentNames as components } from '@/consts';\n\n/**\n * ZoomDrawingMode class\n * @class\n * @ignore\n */\nclass ZoomDrawingMode extends DrawingMode {\n constructor() {\n super(drawingModes.ZOOM);\n }\n\n /**\n * start this drawing mode\n * @param {Graphics} graphics - Graphics instance\n * @override\n */\n start(graphics) {\n const zoom = graphics.getComponent(components.ZOOM);\n\n zoom.start();\n }\n\n /**\n * stop this drawing mode\n * @param {Graphics} graphics - Graphics instance\n * @override\n */\n end(graphics) {\n const zoom = graphics.getComponent(components.ZOOM);\n\n zoom.end();\n }\n}\n\nexport default ZoomDrawingMode;\n","/**\n * @author NHN. FE Development Team \n * @fileoverview Blur extending fabric.Image.filters.Convolute\n */\nimport fabric from 'fabric';\n\nconst ARROW_ANGLE = 30;\nconst CHEVRON_SIZE_RATIO = 2.7;\nconst TRIANGLE_SIZE_RATIO = 1.7;\nconst RADIAN_CONVERSION_VALUE = 180;\n\nconst ArrowLine = fabric.util.createClass(\n fabric.Line,\n /** @lends Convolute.prototype */ {\n /**\n * Line type\n * @param {String} type\n * @default\n */\n type: 'line',\n\n /**\n * Constructor\n * @param {Array} [points] Array of points\n * @param {Object} [options] Options object\n * @override\n */\n initialize(points, options = {}) {\n this.callSuper('initialize', points, options);\n\n this.arrowType = options.arrowType;\n },\n\n /**\n * Render ArrowLine\n * @private\n * @override\n */\n _render(ctx) {\n const { x1: fromX, y1: fromY, x2: toX, y2: toY } = this.calcLinePoints();\n const linePosition = {\n fromX,\n fromY,\n toX,\n toY,\n };\n this.ctx = ctx;\n ctx.lineWidth = this.strokeWidth;\n\n this._renderBasicLinePath(linePosition);\n this._drawDecoratorPath(linePosition);\n\n this._renderStroke(ctx);\n },\n\n /**\n * Render Basic line path\n * @param {Object} linePosition - line position\n * @param {number} option.fromX - line start position x\n * @param {number} option.fromY - line start position y\n * @param {number} option.toX - line end position x\n * @param {number} option.toY - line end position y\n * @private\n */\n _renderBasicLinePath({ fromX, fromY, toX, toY }) {\n this.ctx.beginPath();\n this.ctx.moveTo(fromX, fromY);\n this.ctx.lineTo(toX, toY);\n },\n\n /**\n * Render Arrow Head\n * @param {Object} linePosition - line position\n * @param {number} option.fromX - line start position x\n * @param {number} option.fromY - line start position y\n * @param {number} option.toX - line end position x\n * @param {number} option.toY - line end position y\n * @private\n */\n _drawDecoratorPath(linePosition) {\n this._drawDecoratorPathType('head', linePosition);\n this._drawDecoratorPathType('tail', linePosition);\n },\n\n /**\n * Render Arrow Head\n * @param {string} type - 'head' or 'tail'\n * @param {Object} linePosition - line position\n * @param {number} option.fromX - line start position x\n * @param {number} option.fromY - line start position y\n * @param {number} option.toX - line end position x\n * @param {number} option.toY - line end position y\n * @private\n */\n _drawDecoratorPathType(type, linePosition) {\n switch (this.arrowType[type]) {\n case 'triangle':\n this._drawTrianglePath(type, linePosition);\n break;\n case 'chevron':\n this._drawChevronPath(type, linePosition);\n break;\n default:\n break;\n }\n },\n\n /**\n * Render Triangle Head\n * @param {string} type - 'head' or 'tail'\n * @param {Object} linePosition - line position\n * @param {number} option.fromX - line start position x\n * @param {number} option.fromY - line start position y\n * @param {number} option.toX - line end position x\n * @param {number} option.toY - line end position y\n * @private\n */\n _drawTrianglePath(type, linePosition) {\n const decorateSize = this.ctx.lineWidth * TRIANGLE_SIZE_RATIO;\n\n this._drawChevronPath(type, linePosition, decorateSize);\n this.ctx.closePath();\n },\n\n /**\n * Render Chevron Head\n * @param {string} type - 'head' or 'tail'\n * @param {Object} linePosition - line position\n * @param {number} option.fromX - line start position x\n * @param {number} option.fromY - line start position y\n * @param {number} option.toX - line end position x\n * @param {number} option.toY - line end position y\n * @param {number} decorateSize - decorate size\n * @private\n */\n _drawChevronPath(type, { fromX, fromY, toX, toY }, decorateSize) {\n const { ctx } = this;\n if (!decorateSize) {\n decorateSize = this.ctx.lineWidth * CHEVRON_SIZE_RATIO;\n }\n\n const [standardX, standardY] = type === 'head' ? [fromX, fromY] : [toX, toY];\n const [compareX, compareY] = type === 'head' ? [toX, toY] : [fromX, fromY];\n\n const angle =\n (Math.atan2(compareY - standardY, compareX - standardX) * RADIAN_CONVERSION_VALUE) /\n Math.PI;\n const rotatedPosition = (changeAngle) =>\n this.getRotatePosition(decorateSize, changeAngle, {\n x: standardX,\n y: standardY,\n });\n\n ctx.moveTo(...rotatedPosition(angle + ARROW_ANGLE));\n ctx.lineTo(standardX, standardY);\n ctx.lineTo(...rotatedPosition(angle - ARROW_ANGLE));\n },\n\n /**\n * return position from change angle.\n * @param {number} distance - change distance\n * @param {number} angle - change angle\n * @param {Object} referencePosition - reference position\n * @returns {Array}\n * @private\n */\n getRotatePosition(distance, angle, referencePosition) {\n const radian = (angle * Math.PI) / RADIAN_CONVERSION_VALUE;\n const { x, y } = referencePosition;\n\n return [distance * Math.cos(radian) + x, distance * Math.sin(radian) + y];\n },\n }\n);\n\nexport default ArrowLine;\n","/**\n * @author NHN. FE Development Team \n * @fileoverview ColorFilter extending fabric.Image.filters.BaseFilter\n */\nimport fabric from 'fabric';\n\n/**\n * ColorFilter object\n * @class ColorFilter\n * @extends {fabric.Image.filters.BaseFilter}\n * @ignore\n */\nconst ColorFilter = fabric.util.createClass(\n fabric.Image.filters.BaseFilter,\n /** @lends BaseFilter.prototype */ {\n /**\n * Filter type\n * @param {String} type\n * @default\n */\n type: 'ColorFilter',\n\n /**\n * Constructor\n * @member fabric.Image.filters.ColorFilter.prototype\n * @param {Object} [options] Options object\n * @param {Number} [options.color='#FFFFFF'] Value of color (0...255)\n * @param {Number} [options.threshold=45] Value of threshold (0...255)\n * @override\n */\n initialize(options) {\n if (!options) {\n options = {};\n }\n this.color = options.color || '#FFFFFF';\n this.threshold = options.threshold || 45;\n this.x = options.x || null;\n this.y = options.y || null;\n },\n\n /**\n * Applies filter to canvas element\n * @param {Object} canvas Canvas object passed by fabric\n */\n // eslint-disable-next-line complexity\n applyTo(canvas) {\n const { canvasEl } = canvas;\n const context = canvasEl.getContext('2d');\n const imageData = context.getImageData(0, 0, canvasEl.width, canvasEl.height);\n const { data } = imageData;\n const { threshold } = this;\n let filterColor = fabric.Color.sourceFromHex(this.color);\n let i, len;\n\n if (this.x && this.y) {\n filterColor = this._getColor(imageData, this.x, this.y);\n }\n\n for (i = 0, len = data.length; i < len; i += 4) {\n if (\n this._isOutsideThreshold(data[i], filterColor[0], threshold) ||\n this._isOutsideThreshold(data[i + 1], filterColor[1], threshold) ||\n this._isOutsideThreshold(data[i + 2], filterColor[2], threshold)\n ) {\n continue;\n }\n data[i] = data[i + 1] = data[i + 2] = data[i + 3] = 0;\n }\n context.putImageData(imageData, 0, 0);\n },\n\n /**\n * Check color if it is within threshold\n * @param {Number} color1 source color\n * @param {Number} color2 filtering color\n * @param {Number} threshold threshold\n * @returns {boolean} true if within threshold or false\n */\n _isOutsideThreshold(color1, color2, threshold) {\n const diff = color1 - color2;\n\n return Math.abs(diff) > threshold;\n },\n\n /**\n * Get color at (x, y)\n * @param {Object} imageData of canvas\n * @param {Number} x left position\n * @param {Number} y top position\n * @returns {Array} color array\n */\n _getColor(imageData, x, y) {\n const color = [0, 0, 0, 0];\n const { data, width } = imageData;\n const bytes = 4;\n const position = (width * y + x) * bytes;\n\n color[0] = data[position];\n color[1] = data[position + 1];\n color[2] = data[position + 2];\n color[3] = data[position + 3];\n\n return color;\n },\n }\n);\n\nexport default ColorFilter;\n","/**\n * @author NHN. FE Development Team \n * @fileoverview Cropzone extending fabric.Rect\n */\nimport snippet from 'tui-code-snippet';\nimport fabric from 'fabric';\nimport { clamp } from '@/util';\nimport { eventNames as events, keyCodes } from '@/consts';\n\nconst CORNER_TYPE_TOP_LEFT = 'tl';\nconst CORNER_TYPE_TOP_RIGHT = 'tr';\nconst CORNER_TYPE_MIDDLE_TOP = 'mt';\nconst CORNER_TYPE_MIDDLE_LEFT = 'ml';\nconst CORNER_TYPE_MIDDLE_RIGHT = 'mr';\nconst CORNER_TYPE_MIDDLE_BOTTOM = 'mb';\nconst CORNER_TYPE_BOTTOM_LEFT = 'bl';\nconst CORNER_TYPE_BOTTOM_RIGHT = 'br';\nconst CORNER_TYPE_LIST = [\n CORNER_TYPE_TOP_LEFT,\n CORNER_TYPE_TOP_RIGHT,\n CORNER_TYPE_MIDDLE_TOP,\n CORNER_TYPE_MIDDLE_LEFT,\n CORNER_TYPE_MIDDLE_RIGHT,\n CORNER_TYPE_MIDDLE_BOTTOM,\n CORNER_TYPE_BOTTOM_LEFT,\n CORNER_TYPE_BOTTOM_RIGHT,\n];\nconst NOOP_FUNCTION = () => {};\n\n/**\n * Align with cropzone ratio\n * @param {string} selectedCorner - selected corner type\n * @returns {{width: number, height: number}}\n * @private\n */\nfunction cornerTypeValid(selectedCorner) {\n return CORNER_TYPE_LIST.indexOf(selectedCorner) >= 0;\n}\n\n/**\n * return scale basis type\n * @param {number} diffX - X distance of the cursor and corner.\n * @param {number} diffY - Y distance of the cursor and corner.\n * @returns {string}\n * @private\n */\nfunction getScaleBasis(diffX, diffY) {\n return diffX > diffY ? 'width' : 'height';\n}\n\n/**\n * Cropzone object\n * Issue: IE7, 8(with excanvas)\n * - Cropzone is a black zone without transparency.\n * @class Cropzone\n * @extends {fabric.Rect}\n * @ignore\n */\nconst Cropzone = fabric.util.createClass(\n fabric.Rect,\n /** @lends Cropzone.prototype */ {\n /**\n * Constructor\n * @param {Object} canvas canvas\n * @param {Object} options Options object\n * @param {Object} extendsOptions object for extends \"options\"\n * @override\n */\n initialize(canvas, options, extendsOptions) {\n options = snippet.extend(options, extendsOptions);\n options.type = 'cropzone';\n\n this.callSuper('initialize', options);\n this._addEventHandler();\n\n this.canvas = canvas;\n this.options = options;\n },\n canvasEventDelegation(eventName) {\n let delegationState = 'unregistered';\n const isRegistered = this.canvasEventTrigger[eventName] !== NOOP_FUNCTION;\n if (isRegistered) {\n delegationState = 'registered';\n } else if ([events.OBJECT_MOVED, events.OBJECT_SCALED].indexOf(eventName) < 0) {\n delegationState = 'none';\n }\n\n return delegationState;\n },\n canvasEventRegister(eventName, eventTrigger) {\n this.canvasEventTrigger[eventName] = eventTrigger;\n },\n _addEventHandler() {\n this.canvasEventTrigger = {\n [events.OBJECT_MOVED]: NOOP_FUNCTION,\n [events.OBJECT_SCALED]: NOOP_FUNCTION,\n };\n this.on({\n moving: this._onMoving.bind(this),\n scaling: this._onScaling.bind(this),\n });\n fabric.util.addListener(document, 'keydown', this._onKeyDown.bind(this));\n fabric.util.addListener(document, 'keyup', this._onKeyUp.bind(this));\n },\n _renderCropzone(ctx) {\n const cropzoneDashLineWidth = 7;\n const cropzoneDashLineOffset = 7;\n\n // Calc original scale\n const originalFlipX = this.flipX ? -1 : 1;\n const originalFlipY = this.flipY ? -1 : 1;\n const originalScaleX = originalFlipX / this.scaleX;\n const originalScaleY = originalFlipY / this.scaleY;\n\n // Set original scale\n ctx.scale(originalScaleX, originalScaleY);\n\n // Render outer rect\n this._fillOuterRect(ctx, 'rgba(0, 0, 0, 0.5)');\n\n if (this.options.lineWidth) {\n this._fillInnerRect(ctx);\n this._strokeBorder(ctx, 'rgb(255, 255, 255)', {\n lineWidth: this.options.lineWidth,\n });\n } else {\n // Black dash line\n this._strokeBorder(ctx, 'rgb(0, 0, 0)', {\n lineDashWidth: cropzoneDashLineWidth,\n });\n\n // White dash line\n this._strokeBorder(ctx, 'rgb(255, 255, 255)', {\n lineDashWidth: cropzoneDashLineWidth,\n lineDashOffset: cropzoneDashLineOffset,\n });\n }\n\n // Reset scale\n ctx.scale(1 / originalScaleX, 1 / originalScaleY);\n },\n\n /**\n * Render Crop-zone\n * @private\n * @override\n */\n _render(ctx) {\n this.callSuper('_render', ctx);\n\n this._renderCropzone(ctx);\n },\n\n /**\n * Cropzone-coordinates with outer rectangle\n *\n * x0 x1 x2 x3\n * y0 +--------------------------+\n * |///////|//////////|///////| // <--- \"Outer-rectangle\"\n * |///////|//////////|///////|\n * y1 +-------+----------+-------+\n * |///////| Cropzone |///////| Cropzone is the \"Inner-rectangle\"\n * |///////| (0, 0) |///////| Center point (0, 0)\n * y2 +-------+----------+-------+\n * |///////|//////////|///////|\n * |///////|//////////|///////|\n * y3 +--------------------------+\n *\n * @typedef {{x: Array, y: Array}} cropzoneCoordinates\n * @ignore\n */\n\n /**\n * Fill outer rectangle\n * @param {CanvasRenderingContext2D} ctx - Context\n * @param {string|CanvasGradient|CanvasPattern} fillStyle - Fill-style\n * @private\n */\n _fillOuterRect(ctx, fillStyle) {\n const { x, y } = this._getCoordinates();\n\n ctx.save();\n ctx.fillStyle = fillStyle;\n ctx.beginPath();\n\n // Outer rectangle\n // Numbers are +/-1 so that overlay edges don't get blurry.\n ctx.moveTo(x[0] - 1, y[0] - 1);\n ctx.lineTo(x[3] + 1, y[0] - 1);\n ctx.lineTo(x[3] + 1, y[3] + 1);\n ctx.lineTo(x[0] - 1, y[3] + 1);\n ctx.lineTo(x[0] - 1, y[0] - 1);\n ctx.closePath();\n\n // Inner rectangle\n ctx.moveTo(x[1], y[1]);\n ctx.lineTo(x[1], y[2]);\n ctx.lineTo(x[2], y[2]);\n ctx.lineTo(x[2], y[1]);\n ctx.lineTo(x[1], y[1]);\n ctx.closePath();\n\n ctx.fill();\n ctx.restore();\n },\n\n /**\n * Draw Inner grid line\n * @param {CanvasRenderingContext2D} ctx - Context\n * @private\n */\n _fillInnerRect(ctx) {\n const { x: outerX, y: outerY } = this._getCoordinates();\n const x = this._caculateInnerPosition(outerX, (outerX[2] - outerX[1]) / 3);\n const y = this._caculateInnerPosition(outerY, (outerY[2] - outerY[1]) / 3);\n\n ctx.save();\n ctx.strokeStyle = 'rgba(255, 255, 255, 0.7)';\n ctx.lineWidth = this.options.lineWidth;\n ctx.beginPath();\n\n ctx.moveTo(x[0], y[1]);\n ctx.lineTo(x[3], y[1]);\n\n ctx.moveTo(x[0], y[2]);\n ctx.lineTo(x[3], y[2]);\n\n ctx.moveTo(x[1], y[0]);\n ctx.lineTo(x[1], y[3]);\n\n ctx.moveTo(x[2], y[0]);\n ctx.lineTo(x[2], y[3]);\n ctx.stroke();\n ctx.closePath();\n\n ctx.restore();\n },\n\n /**\n * Calculate Inner Position\n * @param {Array} outer - outer position\n * @param {number} size - interval for calculate\n * @returns {Array} - inner position\n * @private\n */\n _caculateInnerPosition(outer, size) {\n const position = [];\n position[0] = outer[1];\n position[1] = outer[1] + size;\n position[2] = outer[1] + size * 2;\n position[3] = outer[2];\n\n return position;\n },\n\n /**\n * Get coordinates\n * @returns {cropzoneCoordinates} - {@link cropzoneCoordinates}\n * @private\n */\n _getCoordinates() {\n const { canvas, width, height, left, top } = this;\n const halfWidth = width / 2;\n const halfHeight = height / 2;\n const canvasHeight = canvas.getHeight(); // fabric object\n const canvasWidth = canvas.getWidth(); // fabric object\n\n return {\n x: snippet.map(\n [\n -(halfWidth + left), // x0\n -halfWidth, // x1\n halfWidth, // x2\n halfWidth + (canvasWidth - left - width), // x3\n ],\n Math.ceil\n ),\n y: snippet.map(\n [\n -(halfHeight + top), // y0\n -halfHeight, // y1\n halfHeight, // y2\n halfHeight + (canvasHeight - top - height), // y3\n ],\n Math.ceil\n ),\n };\n },\n\n /**\n * Stroke border\n * @param {CanvasRenderingContext2D} ctx - Context\n * @param {string|CanvasGradient|CanvasPattern} strokeStyle - Stroke-style\n * @param {number} lineDashWidth - Dash width\n * @param {number} [lineDashOffset] - Dash offset\n * @param {number} [lineWidth] - line width\n * @private\n */\n _strokeBorder(ctx, strokeStyle, { lineDashWidth, lineDashOffset, lineWidth }) {\n const halfWidth = this.width / 2;\n const halfHeight = this.height / 2;\n\n ctx.save();\n ctx.strokeStyle = strokeStyle;\n\n if (ctx.setLineDash) {\n ctx.setLineDash([lineDashWidth, lineDashWidth]);\n }\n if (lineDashOffset) {\n ctx.lineDashOffset = lineDashOffset;\n }\n if (lineWidth) {\n ctx.lineWidth = lineWidth;\n }\n\n ctx.beginPath();\n ctx.moveTo(-halfWidth, -halfHeight);\n ctx.lineTo(halfWidth, -halfHeight);\n ctx.lineTo(halfWidth, halfHeight);\n ctx.lineTo(-halfWidth, halfHeight);\n ctx.lineTo(-halfWidth, -halfHeight);\n ctx.stroke();\n\n ctx.restore();\n },\n\n /**\n * onMoving event listener\n * @private\n */\n _onMoving() {\n const { height, width, left, top } = this;\n const maxLeft = this.canvas.getWidth() - width;\n const maxTop = this.canvas.getHeight() - height;\n\n this.left = clamp(left, 0, maxLeft);\n this.top = clamp(top, 0, maxTop);\n\n this.canvasEventTrigger[events.OBJECT_MOVED](this);\n },\n\n /**\n * onScaling event listener\n * @param {{e: MouseEvent}} fEvent - Fabric event\n * @private\n */\n _onScaling(fEvent) {\n const selectedCorner = fEvent.transform.corner;\n const pointer = this.canvas.getPointer(fEvent.e);\n const settings = this._calcScalingSizeFromPointer(pointer, selectedCorner);\n\n // On scaling cropzone,\n // change real width and height and fix scaleFactor to 1\n this.scale(1).set(settings);\n\n this.canvasEventTrigger[events.OBJECT_SCALED](this);\n },\n\n /**\n * Calc scaled size from mouse pointer with selected corner\n * @param {{x: number, y: number}} pointer - Mouse position\n * @param {string} selectedCorner - selected corner type\n * @returns {Object} Having left or(and) top or(and) width or(and) height.\n * @private\n */\n _calcScalingSizeFromPointer(pointer, selectedCorner) {\n const isCornerTypeValid = cornerTypeValid(selectedCorner);\n\n return isCornerTypeValid && this._resizeCropZone(pointer, selectedCorner);\n },\n\n /**\n * Align with cropzone ratio\n * @param {number} width - cropzone width\n * @param {number} height - cropzone height\n * @param {number} maxWidth - limit max width\n * @param {number} maxHeight - limit max height\n * @param {number} scaleTo - cropzone ratio\n * @returns {{width: number, height: number}}\n * @private\n */\n adjustRatioCropzoneSize({ width, height, leftMaker, topMaker, maxWidth, maxHeight, scaleTo }) {\n width = maxWidth ? clamp(width, 1, maxWidth) : width;\n height = maxHeight ? clamp(height, 1, maxHeight) : height;\n\n if (!this.presetRatio) {\n if (this._withShiftKey) {\n // make fixed ratio cropzone\n if (width > height) {\n height = width;\n } else if (height > width) {\n width = height;\n }\n }\n\n return {\n width,\n height,\n left: leftMaker(width),\n top: topMaker(height),\n };\n }\n\n if (scaleTo === 'width') {\n height = width / this.presetRatio;\n } else {\n width = height * this.presetRatio;\n }\n\n const maxScaleFactor = Math.min(maxWidth / width, maxHeight / height);\n if (maxScaleFactor <= 1) {\n [width, height] = [width, height].map((v) => v * maxScaleFactor);\n }\n\n return {\n width,\n height,\n left: leftMaker(width),\n top: topMaker(height),\n };\n },\n\n /**\n * Get dimension last state cropzone\n * @returns {{rectTop: number, rectLeft: number, rectWidth: number, rectHeight: number}}\n * @private\n */\n _getCropzoneRectInfo() {\n const { width: canvasWidth, height: canvasHeight } = this.canvas;\n const {\n top: rectTop,\n left: rectLeft,\n width: rectWidth,\n height: rectHeight,\n } = this.getBoundingRect(false, true);\n\n return {\n rectTop,\n rectLeft,\n rectWidth,\n rectHeight,\n rectRight: rectLeft + rectWidth,\n rectBottom: rectTop + rectHeight,\n canvasWidth,\n canvasHeight,\n };\n },\n\n /**\n * Calc scaling dimension\n * @param {Object} position - Mouse position\n * @param {string} corner - corner type\n * @returns {{left: number, top: number, width: number, height: number}}\n * @private\n */\n _resizeCropZone({ x, y }, corner) {\n const {\n rectWidth,\n rectHeight,\n rectTop,\n rectLeft,\n rectBottom,\n rectRight,\n canvasWidth,\n canvasHeight,\n } = this._getCropzoneRectInfo();\n\n const resizeInfoMap = {\n tl: {\n width: rectRight - x,\n height: rectBottom - y,\n leftMaker: (newWidth) => rectRight - newWidth,\n topMaker: (newHeight) => rectBottom - newHeight,\n maxWidth: rectRight,\n maxHeight: rectBottom,\n scaleTo: getScaleBasis(rectLeft - x, rectTop - y),\n },\n tr: {\n width: x - rectLeft,\n height: rectBottom - y,\n leftMaker: () => rectLeft,\n topMaker: (newHeight) => rectBottom - newHeight,\n maxWidth: canvasWidth - rectLeft,\n maxHeight: rectBottom,\n scaleTo: getScaleBasis(x - rectRight, rectTop - y),\n },\n mt: {\n width: rectWidth,\n height: rectBottom - y,\n leftMaker: () => rectLeft,\n topMaker: (newHeight) => rectBottom - newHeight,\n maxWidth: canvasWidth - rectLeft,\n maxHeight: rectBottom,\n scaleTo: 'height',\n },\n ml: {\n width: rectRight - x,\n height: rectHeight,\n leftMaker: (newWidth) => rectRight - newWidth,\n topMaker: () => rectTop,\n maxWidth: rectRight,\n maxHeight: canvasHeight - rectTop,\n scaleTo: 'width',\n },\n mr: {\n width: x - rectLeft,\n height: rectHeight,\n leftMaker: () => rectLeft,\n topMaker: () => rectTop,\n maxWidth: canvasWidth - rectLeft,\n maxHeight: canvasHeight - rectTop,\n scaleTo: 'width',\n },\n mb: {\n width: rectWidth,\n height: y - rectTop,\n leftMaker: () => rectLeft,\n topMaker: () => rectTop,\n maxWidth: canvasWidth - rectLeft,\n maxHeight: canvasHeight - rectTop,\n scaleTo: 'height',\n },\n bl: {\n width: rectRight - x,\n height: y - rectTop,\n leftMaker: (newWidth) => rectRight - newWidth,\n topMaker: () => rectTop,\n maxWidth: rectRight,\n maxHeight: canvasHeight - rectTop,\n scaleTo: getScaleBasis(rectLeft - x, y - rectBottom),\n },\n br: {\n width: x - rectLeft,\n height: y - rectTop,\n leftMaker: () => rectLeft,\n topMaker: () => rectTop,\n maxWidth: canvasWidth - rectLeft,\n maxHeight: canvasHeight - rectTop,\n scaleTo: getScaleBasis(x - rectRight, y - rectBottom),\n },\n };\n\n return this.adjustRatioCropzoneSize(resizeInfoMap[corner]);\n },\n\n /**\n * Return the whether this cropzone is valid\n * @returns {boolean}\n */\n isValid() {\n return this.left >= 0 && this.top >= 0 && this.width > 0 && this.height > 0;\n },\n\n /**\n * Keydown event handler\n * @param {{number}} keyCode - Event keyCode\n * @private\n */\n _onKeyDown({ keyCode }) {\n if (keyCode === keyCodes.SHIFT) {\n this._withShiftKey = true;\n }\n },\n\n /**\n * Keyup event handler\n * @param {{number}} keyCode - Event keyCode\n * @private\n */\n _onKeyUp({ keyCode }) {\n if (keyCode === keyCodes.SHIFT) {\n this._withShiftKey = false;\n }\n },\n }\n);\n\nexport default Cropzone;\n","/**\n * @author NHN. FE Development Team \n * @fileoverview Emboss extending fabric.Image.filters.Convolute\n */\nimport fabric from 'fabric';\n\n/**\n * Emboss object\n * @class Emboss\n * @extends {fabric.Image.filters.Convolute}\n * @ignore\n */\nconst Emboss = fabric.util.createClass(\n fabric.Image.filters.Convolute,\n /** @lends Convolute.prototype */ {\n /**\n * Filter type\n * @param {String} type\n * @default\n */\n type: 'Emboss',\n\n /**\n * constructor\n * @override\n */\n initialize() {\n this.matrix = [1, 1, 1, 1, 0.7, -1, -1, -1, -1];\n },\n }\n);\n\nexport default Emboss;\n","/**\n * @author NHN. FE Development Team \n * @fileoverview Mask extending fabric.Image.filters.Mask\n */\nimport fabric from 'fabric';\n\n/**\n * Mask object\n * @class Mask\n * @extends {fabric.Image.filters.BlendImage}\n * @ignore\n */\nconst Mask = fabric.util.createClass(\n fabric.Image.filters.BlendImage,\n /** @lends Mask.prototype */ {\n /**\n * Apply filter to canvas element\n * @param {Object} pipelineState - Canvas element to apply filter\n * @override\n */\n applyTo(pipelineState) {\n if (!this.mask) {\n return;\n }\n\n const canvas = pipelineState.canvasEl;\n const { width, height } = canvas;\n const maskCanvasEl = this._createCanvasOfMask(width, height);\n const ctx = canvas.getContext('2d');\n const maskCtx = maskCanvasEl.getContext('2d');\n const imageData = ctx.getImageData(0, 0, width, height);\n\n this._drawMask(maskCtx, canvas, ctx);\n this._mapData(maskCtx, imageData, width, height);\n\n pipelineState.imageData = imageData;\n },\n\n /**\n * Create canvas of mask image\n * @param {number} width - Width of main canvas\n * @param {number} height - Height of main canvas\n * @returns {HTMLElement} Canvas element\n * @private\n */\n _createCanvasOfMask(width, height) {\n const maskCanvasEl = fabric.util.createCanvasElement();\n\n maskCanvasEl.width = width;\n maskCanvasEl.height = height;\n\n return maskCanvasEl;\n },\n\n /**\n * Draw mask image on canvas element\n * @param {Object} maskCtx - Context of mask canvas\n * @private\n */\n _drawMask(maskCtx) {\n const { mask } = this;\n const maskImg = mask.getElement();\n const { angle, left, scaleX, scaleY, top } = mask;\n\n maskCtx.save();\n maskCtx.translate(left, top);\n maskCtx.rotate((angle * Math.PI) / 180);\n maskCtx.scale(scaleX, scaleY);\n maskCtx.drawImage(maskImg, -maskImg.width / 2, -maskImg.height / 2);\n maskCtx.restore();\n },\n\n /**\n * Map mask image data to source image data\n * @param {Object} maskCtx - Context of mask canvas\n * @param {Object} imageData - Data of source image\n * @param {number} width - Width of main canvas\n * @param {number} height - Height of main canvas\n * @private\n */\n _mapData(maskCtx, imageData, width, height) {\n const { data, height: imgHeight, width: imgWidth } = imageData;\n const sourceData = data;\n const len = imgWidth * imgHeight * 4;\n const maskData = maskCtx.getImageData(0, 0, width, height).data;\n\n for (let i = 0; i < len; i += 4) {\n sourceData[i + 3] = maskData[i]; // adjust value of alpha data\n }\n },\n }\n);\n\nexport default Mask;\n","/**\n * @author NHN. FE Development Team \n * @fileoverview Sharpen extending fabric.Image.filters.Convolute\n */\nimport fabric from 'fabric';\n\n/**\n * Sharpen object\n * @class Sharpen\n * @extends {fabric.Image.filters.Convolute}\n * @ignore\n */\nconst Sharpen = fabric.util.createClass(\n fabric.Image.filters.Convolute,\n /** @lends Convolute.prototype */ {\n /**\n * Filter type\n * @param {String} type\n * @default\n */\n type: 'Sharpen',\n\n /**\n * constructor\n * @override\n */\n initialize() {\n this.matrix = [0, -1, 0, -1, 5, -1, 0, -1, 0];\n },\n }\n);\n\nexport default Sharpen;\n","/**\n * @author NHN. FE Development Team \n * @fileoverview Command factory\n */\nimport Command from '@/interface/command';\n\nconst commands = {};\n\n/**\n * Create a command\n * @param {string} name - Command name\n * @param {...*} args - Arguments for creating command\n * @returns {Command}\n * @ignore\n */\nfunction create(name, ...args) {\n const actions = commands[name];\n if (actions) {\n return new Command(actions, args);\n }\n\n return null;\n}\n\n/**\n * Register a command with name as a key\n * @param {Object} command - {name:{string}, execute: {function}, undo: {function}}\n * @param {string} command.name - command name\n * @param {function} command.execute - executable function\n * @param {function} command.undo - undo function\n * @ignore\n */\nfunction register(command) {\n commands[command.name] = command;\n}\n\nexport default {\n create,\n register,\n};\n","/**\n * @author NHN. FE Development Team \n * @fileoverview Error-message factory\n */\nimport snippet from 'tui-code-snippet';\nimport { keyMirror } from '@/util';\n\nconst types = keyMirror('UN_IMPLEMENTATION', 'NO_COMPONENT_NAME');\nconst messages = {\n UN_IMPLEMENTATION: 'Should implement a method: ',\n NO_COMPONENT_NAME: 'Should set a component name',\n};\nconst map = {\n UN_IMPLEMENTATION(methodName) {\n return messages.UN_IMPLEMENTATION + methodName;\n },\n NO_COMPONENT_NAME() {\n return messages.NO_COMPONENT_NAME;\n },\n};\n\nexport default {\n types: snippet.extend({}, types),\n\n create(type, ...args) {\n type = type.toLowerCase();\n const func = map[type];\n\n return func(...args);\n },\n};\n","/**\n * @author NHN. FE Development Team \n * @fileoverview Graphics module\n */\nimport snippet from 'tui-code-snippet';\nimport fabric from 'fabric';\nimport ImageLoader from '@/component/imageLoader';\nimport Cropper from '@/component/cropper';\nimport Flip from '@/component/flip';\nimport Rotation from '@/component/rotation';\nimport FreeDrawing from '@/component/freeDrawing';\nimport Line from '@/component/line';\nimport Text from '@/component/text';\nimport Icon from '@/component/icon';\nimport Filter from '@/component/filter';\nimport Shape from '@/component/shape';\nimport Zoom from '@/component/zoom';\nimport CropperDrawingMode from '@/drawingMode/cropper';\nimport FreeDrawingMode from '@/drawingMode/freeDrawing';\nimport LineDrawingMode from '@/drawingMode/lineDrawing';\nimport ShapeDrawingMode from '@/drawingMode/shape';\nimport TextDrawingMode from '@/drawingMode/text';\nimport IconDrawingMode from '@/drawingMode/icon';\nimport ZoomDrawingMode from '@/drawingMode/zoom';\nimport {\n makeSelectionUndoData,\n makeSelectionUndoDatum,\n setCachedUndoDataForDimension,\n} from '@/helper/selectionModifyHelper';\nimport { getProperties, includes, isShape, Promise } from '@/util';\nimport {\n componentNames as components,\n eventNames as events,\n drawingModes,\n fObjectOptions,\n} from '@/consts';\n\nconst {\n extend,\n stamp,\n isArray,\n isString,\n forEachArray,\n forEachOwnProperties,\n CustomEvents,\n} = snippet;\nconst DEFAULT_CSS_MAX_WIDTH = 1000;\nconst DEFAULT_CSS_MAX_HEIGHT = 800;\nconst EXTRA_PX_FOR_PASTE = 10;\n\nconst cssOnly = {\n cssOnly: true,\n};\nconst backstoreOnly = {\n backstoreOnly: true,\n};\n\n/**\n * Graphics class\n * @class\n * @param {string|HTMLElement} wrapper - Wrapper's element or selector\n * @param {Object} [option] - Canvas max width & height of css\n * @param {number} option.cssMaxWidth - Canvas css-max-width\n * @param {number} option.cssMaxHeight - Canvas css-max-height\n * @ignore\n */\nclass Graphics {\n constructor(element, { cssMaxWidth, cssMaxHeight } = {}) {\n /**\n * Fabric image instance\n * @type {fabric.Image}\n */\n this.canvasImage = null;\n\n /**\n * Max width of canvas elements\n * @type {number}\n */\n this.cssMaxWidth = cssMaxWidth || DEFAULT_CSS_MAX_WIDTH;\n\n /**\n * Max height of canvas elements\n * @type {number}\n */\n this.cssMaxHeight = cssMaxHeight || DEFAULT_CSS_MAX_HEIGHT;\n\n /**\n * cropper Selection Style\n * @type {Object}\n */\n this.cropSelectionStyle = {};\n\n /**\n * target fabric object for copy paste feature\n * @type {fabric.Object}\n * @private\n */\n this.targetObjectForCopyPaste = null;\n\n /**\n * Image name\n * @type {string}\n */\n this.imageName = '';\n\n /**\n * Object Map\n * @type {Object}\n * @private\n */\n this._objects = {};\n\n /**\n * Fabric-Canvas instance\n * @type {fabric.Canvas}\n * @private\n */\n this._canvas = null;\n\n /**\n * Drawing mode\n * @type {string}\n * @private\n */\n this._drawingMode = drawingModes.NORMAL;\n\n /**\n * DrawingMode map\n * @type {Object.}\n * @private\n */\n this._drawingModeMap = {};\n\n /**\n * Component map\n * @type {Object.}\n * @private\n */\n this._componentMap = {};\n\n /**\n * fabric event handlers\n * @type {Object.}\n * @private\n */\n this._handler = {\n onMouseDown: this._onMouseDown.bind(this),\n onObjectAdded: this._onObjectAdded.bind(this),\n onObjectRemoved: this._onObjectRemoved.bind(this),\n onObjectMoved: this._onObjectMoved.bind(this),\n onObjectScaled: this._onObjectScaled.bind(this),\n onObjectModified: this._onObjectModified.bind(this),\n onObjectRotated: this._onObjectRotated.bind(this),\n onObjectSelected: this._onObjectSelected.bind(this),\n onPathCreated: this._onPathCreated.bind(this),\n onSelectionCleared: this._onSelectionCleared.bind(this),\n onSelectionCreated: this._onSelectionCreated.bind(this),\n };\n\n this._setObjectCachingToFalse();\n this._setCanvasElement(element);\n this._createDrawingModeInstances();\n this._createComponents();\n this._attachCanvasEvents();\n }\n\n /**\n * Destroy canvas element\n */\n destroy() {\n const { wrapperEl } = this._canvas;\n\n this._canvas.clear();\n\n wrapperEl.parentNode.removeChild(wrapperEl);\n }\n\n /**\n * Deactivates all objects on canvas\n * @returns {Graphics} this\n */\n deactivateAll() {\n this._canvas.discardActiveObject();\n\n return this;\n }\n\n /**\n * Renders all objects on canvas\n * @returns {Graphics} this\n */\n renderAll() {\n this._canvas.renderAll();\n\n return this;\n }\n\n /**\n * Adds objects on canvas\n * @param {Object|Array} objects - objects\n */\n add(objects) {\n let theArgs = [];\n if (isArray(objects)) {\n theArgs = objects;\n } else {\n theArgs.push(objects);\n }\n\n this._canvas.add(...theArgs);\n }\n\n /**\n * Removes the object or group\n * @param {Object} target - graphics object or group\n * @returns {boolean} true if contains or false\n */\n contains(target) {\n return this._canvas.contains(target);\n }\n\n /**\n * Gets all objects or group\n * @returns {Array} all objects, shallow copy\n */\n getObjects() {\n return this._canvas.getObjects().slice();\n }\n\n /**\n * Get an object by id\n * @param {number} id - object id\n * @returns {fabric.Object} object corresponding id\n */\n getObject(id) {\n return this._objects[id];\n }\n\n /**\n * Removes the object or group\n * @param {Object} target - graphics object or group\n */\n remove(target) {\n this._canvas.remove(target);\n }\n\n /**\n * Removes all object or group\n * @param {boolean} includesBackground - remove the background image or not\n * @returns {Array} all objects array which is removed\n */\n removeAll(includesBackground) {\n const canvas = this._canvas;\n const objects = canvas.getObjects().slice();\n canvas.remove(...this._canvas.getObjects());\n\n if (includesBackground) {\n canvas.clear();\n }\n\n return objects;\n }\n\n /**\n * Removes an object or group by id\n * @param {number} id - object id\n * @returns {Array} removed objects\n */\n removeObjectById(id) {\n const objects = [];\n const canvas = this._canvas;\n const target = this.getObject(id);\n const isValidGroup = target && target.isType('group') && !target.isEmpty();\n\n if (isValidGroup) {\n canvas.discardActiveObject(); // restore states for each objects\n target.forEachObject((obj) => {\n objects.push(obj);\n canvas.remove(obj);\n });\n } else if (canvas.contains(target)) {\n objects.push(target);\n canvas.remove(target);\n }\n\n return objects;\n }\n\n /**\n * Get an id by object instance\n * @param {fabric.Object} object object\n * @returns {number} object id if it exists or null\n */\n getObjectId(object) {\n let key = null;\n for (key in this._objects) {\n if (this._objects.hasOwnProperty(key)) {\n if (object === this._objects[key]) {\n return key;\n }\n }\n }\n\n return null;\n }\n\n /**\n * Gets an active object or group\n * @returns {Object} active object or group instance\n */\n getActiveObject() {\n return this._canvas._activeObject;\n }\n\n /**\n * Returns the object ID to delete the object.\n * @returns {number} object id for remove\n */\n getActiveObjectIdForRemove() {\n const activeObject = this.getActiveObject();\n const { type, left, top } = activeObject;\n const isSelection = type === 'activeSelection';\n\n if (isSelection) {\n const group = new fabric.Group([...activeObject.getObjects()], {\n left,\n top,\n });\n\n return this._addFabricObject(group);\n }\n\n return this.getObjectId(activeObject);\n }\n\n /**\n * Verify that you are ready to erase the object.\n * @returns {boolean} ready for object remove\n */\n isReadyRemoveObject() {\n const activeObject = this.getActiveObject();\n\n return activeObject && !activeObject.isEditing;\n }\n\n /**\n * Gets an active group object\n * @returns {Object} active group object instance\n */\n getActiveObjects() {\n const activeObject = this._canvas._activeObject;\n\n return activeObject && activeObject.type === 'activeSelection' ? activeObject : null;\n }\n\n /**\n * Get Active object Selection from object ids\n * @param {Array.} objects - fabric objects\n * @returns {Object} target - target object group\n */\n getActiveSelectionFromObjects(objects) {\n const canvas = this.getCanvas();\n\n return new fabric.ActiveSelection(objects, { canvas });\n }\n\n /**\n * Activates an object or group\n * @param {Object} target - target object or group\n */\n setActiveObject(target) {\n this._canvas.setActiveObject(target);\n }\n\n /**\n * Set Crop selection style\n * @param {Object} style - Selection styles\n */\n setCropSelectionStyle(style) {\n this.cropSelectionStyle = style;\n }\n\n /**\n * Get component\n * @param {string} name - Component name\n * @returns {Component}\n */\n getComponent(name) {\n return this._componentMap[name];\n }\n\n /**\n * Get current drawing mode\n * @returns {string}\n */\n getDrawingMode() {\n return this._drawingMode;\n }\n\n /**\n * Start a drawing mode. If the current mode is not 'NORMAL', 'stopDrawingMode()' will be called first.\n * @param {String} mode Can be one of 'CROPPER', 'FREE_DRAWING', 'LINE', 'TEXT', 'SHAPE'\n * @param {Object} [option] parameters of drawing mode, it's available with 'FREE_DRAWING', 'LINE_DRAWING'\n * @param {Number} [option.width] brush width\n * @param {String} [option.color] brush color\n * @returns {boolean} true if success or false\n */\n startDrawingMode(mode, option) {\n if (this._isSameDrawingMode(mode)) {\n return true;\n }\n\n // If the current mode is not 'NORMAL', 'stopDrawingMode()' will be called first.\n this.stopDrawingMode();\n\n const drawingModeInstance = this._getDrawingModeInstance(mode);\n if (drawingModeInstance && drawingModeInstance.start) {\n drawingModeInstance.start(this, option);\n\n this._drawingMode = mode;\n }\n\n return !!drawingModeInstance;\n }\n\n /**\n * Stop the current drawing mode and back to the 'NORMAL' mode\n */\n stopDrawingMode() {\n if (this._isSameDrawingMode(drawingModes.NORMAL)) {\n return;\n }\n\n const drawingModeInstance = this._getDrawingModeInstance(this.getDrawingMode());\n if (drawingModeInstance && drawingModeInstance.end) {\n drawingModeInstance.end(this);\n }\n this._drawingMode = drawingModes.NORMAL;\n }\n\n /**\n * Change zoom of canvas\n * @param {{x: number, y: number}} center - center of zoom\n * @param {number} zoomLevel - zoom level\n */\n zoom({ x, y }, zoomLevel) {\n const zoom = this.getComponent(components.ZOOM);\n\n zoom.zoom({ x, y }, zoomLevel);\n }\n\n /**\n * Get zoom mode\n * @returns {string}\n */\n getZoomMode() {\n const zoom = this.getComponent(components.ZOOM);\n\n return zoom.mode;\n }\n\n /**\n * Start zoom-in mode\n */\n startZoomInMode() {\n const zoom = this.getComponent(components.ZOOM);\n\n zoom.startZoomInMode();\n }\n\n /**\n * Stop zoom-in mode\n */\n endZoomInMode() {\n const zoom = this.getComponent(components.ZOOM);\n\n zoom.endZoomInMode();\n }\n\n /**\n * Zoom out one step\n */\n zoomOut() {\n const zoom = this.getComponent(components.ZOOM);\n\n zoom.zoomOut();\n }\n\n /**\n * Start hand mode\n */\n startHandMode() {\n const zoom = this.getComponent(components.ZOOM);\n\n zoom.startHandMode();\n }\n\n /**\n * Stop hand mode\n */\n endHandMode() {\n const zoom = this.getComponent(components.ZOOM);\n\n zoom.endHandMode();\n }\n\n /**\n * Zoom reset\n */\n resetZoom() {\n const zoom = this.getComponent(components.ZOOM);\n\n zoom.resetZoom();\n }\n\n /**\n * To data url from canvas\n * @param {Object} options - options for toDataURL\n * @param {String} [options.format=png] The format of the output image. Either \"jpeg\" or \"png\"\n * @param {Number} [options.quality=1] Quality level (0..1). Only used for jpeg.\n * @param {Number} [options.multiplier=1] Multiplier to scale by\n * @param {Number} [options.left] Cropping left offset. Introduced in fabric v1.2.14\n * @param {Number} [options.top] Cropping top offset. Introduced in fabric v1.2.14\n * @param {Number} [options.width] Cropping width. Introduced in fabric v1.2.14\n * @param {Number} [options.height] Cropping height. Introduced in fabric v1.2.14\n * @returns {string} A DOMString containing the requested data URI.\n */\n toDataURL(options) {\n const cropper = this.getComponent(components.CROPPER);\n cropper.changeVisibility(false);\n\n const dataUrl = this._canvas && this._canvas.toDataURL(options);\n cropper.changeVisibility(true);\n\n return dataUrl;\n }\n\n /**\n * Save image(background) of canvas\n * @param {string} name - Name of image\n * @param {?fabric.Image} canvasImage - Fabric image instance\n */\n setCanvasImage(name, canvasImage) {\n if (canvasImage) {\n stamp(canvasImage);\n }\n this.imageName = name;\n this.canvasImage = canvasImage;\n }\n\n /**\n * Set css max dimension\n * @param {{width: number, height: number}} maxDimension - Max width & Max height\n */\n setCssMaxDimension(maxDimension) {\n this.cssMaxWidth = maxDimension.width || this.cssMaxWidth;\n this.cssMaxHeight = maxDimension.height || this.cssMaxHeight;\n }\n\n /**\n * Adjust canvas dimension with scaling image\n */\n adjustCanvasDimension() {\n const canvasImage = this.canvasImage.scale(1);\n const { width, height } = canvasImage.getBoundingRect();\n const maxDimension = this._calcMaxDimension(width, height);\n\n this.setCanvasCssDimension({\n width: '100%',\n height: '100%', // Set height '' for IE9\n 'max-width': `${maxDimension.width}px`,\n 'max-height': `${maxDimension.height}px`,\n });\n\n this.setCanvasBackstoreDimension({\n width,\n height,\n });\n this._canvas.centerObject(canvasImage);\n }\n\n /**\n * Set canvas dimension - css only\n * {@link http://fabricjs.com/docs/fabric.Canvas.html#setDimensions}\n * @param {Object} dimension - Canvas css dimension\n */\n setCanvasCssDimension(dimension) {\n this._canvas.setDimensions(dimension, cssOnly);\n }\n\n /**\n * Set canvas dimension - backstore only\n * {@link http://fabricjs.com/docs/fabric.Canvas.html#setDimensions}\n * @param {Object} dimension - Canvas backstore dimension\n */\n setCanvasBackstoreDimension(dimension) {\n this._canvas.setDimensions(dimension, backstoreOnly);\n }\n\n /**\n * Set image properties\n * {@link http://fabricjs.com/docs/fabric.Image.html#set}\n * @param {Object} setting - Image properties\n * @param {boolean} [withRendering] - If true, The changed image will be reflected in the canvas\n */\n setImageProperties(setting, withRendering) {\n const { canvasImage } = this;\n\n if (!canvasImage) {\n return;\n }\n\n canvasImage.set(setting).setCoords();\n if (withRendering) {\n this._canvas.renderAll();\n }\n }\n\n /**\n * Returns canvas element of fabric.Canvas[[lower-canvas]]\n * @returns {HTMLCanvasElement}\n */\n getCanvasElement() {\n return this._canvas.getElement();\n }\n\n /**\n * Get fabric.Canvas instance\n * @returns {fabric.Canvas}\n */\n getCanvas() {\n return this._canvas;\n }\n\n /**\n * Get canvasImage (fabric.Image instance)\n * @returns {fabric.Image}\n */\n getCanvasImage() {\n return this.canvasImage;\n }\n\n /**\n * Get image name\n * @returns {string}\n */\n getImageName() {\n return this.imageName;\n }\n\n /**\n * Add image object on canvas\n * @param {string} imgUrl - Image url to make object\n * @returns {Promise}\n */\n addImageObject(imgUrl) {\n const callback = this._callbackAfterLoadingImageObject.bind(this);\n\n return new Promise((resolve) => {\n fabric.Image.fromURL(\n imgUrl,\n (image) => {\n callback(image);\n resolve(this.createObjectProperties(image));\n },\n {\n crossOrigin: 'Anonymous',\n }\n );\n });\n }\n\n /**\n * Get center position of canvas\n * @returns {Object} {left, top}\n */\n getCenter() {\n return this._canvas.getCenter();\n }\n\n /**\n * Get cropped rect\n * @returns {Object} rect\n */\n getCropzoneRect() {\n return this.getComponent(components.CROPPER).getCropzoneRect();\n }\n\n /**\n * Get cropped rect\n * @param {number} [mode] cropzone rect mode\n */\n setCropzoneRect(mode) {\n this.getComponent(components.CROPPER).setCropzoneRect(mode);\n }\n\n /**\n * Get cropped image data\n * @param {Object} cropRect cropzone rect\n * @param {Number} cropRect.left left position\n * @param {Number} cropRect.top top position\n * @param {Number} cropRect.width width\n * @param {Number} cropRect.height height\n * @returns {?{imageName: string, url: string}} cropped Image data\n */\n getCroppedImageData(cropRect) {\n return this.getComponent(components.CROPPER).getCroppedImageData(cropRect);\n }\n\n /**\n * Set brush option\n * @param {Object} option brush option\n * @param {Number} option.width width\n * @param {String} option.color color like 'FFFFFF', 'rgba(0, 0, 0, 0.5)'\n */\n setBrush(option) {\n const drawingMode = this._drawingMode;\n let compName = components.FREE_DRAWING;\n\n if (drawingMode === drawingModes.LINE_DRAWING) {\n compName = components.LINE;\n }\n\n this.getComponent(compName).setBrush(option);\n }\n\n /**\n * Set states of current drawing shape\n * @param {string} type - Shape type (ex: 'rect', 'circle', 'triangle')\n * @param {Object} [options] - Shape options\n * @param {(ShapeFillOption | string)} [options.fill] - {@link ShapeFillOption} or\n * Shape foreground color (ex: '#fff', 'transparent')\n * @param {string} [options.stoke] - Shape outline color\n * @param {number} [options.strokeWidth] - Shape outline width\n * @param {number} [options.width] - Width value (When type option is 'rect', this options can use)\n * @param {number} [options.height] - Height value (When type option is 'rect', this options can use)\n * @param {number} [options.rx] - Radius x value (When type option is 'circle', this options can use)\n * @param {number} [options.ry] - Radius y value (When type option is 'circle', this options can use)\n * @param {number} [options.isRegular] - Whether resizing shape has 1:1 ratio or not\n */\n setDrawingShape(type, options) {\n this.getComponent(components.SHAPE).setStates(type, options);\n }\n\n /**\n * Set style of current drawing icon\n * @param {string} type - icon type (ex: 'icon-arrow', 'icon-star')\n * @param {Object} [iconColor] - Icon color\n */\n setIconStyle(type, iconColor) {\n this.getComponent(components.ICON).setStates(type, iconColor);\n }\n\n /**\n * Register icon paths\n * @param {Object} pathInfos - Path infos\n * @param {string} pathInfos.key - key\n * @param {string} pathInfos.value - value\n */\n registerPaths(pathInfos) {\n this.getComponent(components.ICON).registerPaths(pathInfos);\n }\n\n /**\n * Change cursor style\n * @param {string} cursorType - cursor type\n */\n changeCursor(cursorType) {\n const canvas = this.getCanvas();\n canvas.defaultCursor = cursorType;\n canvas.renderAll();\n }\n\n /**\n * Whether it has the filter or not\n * @param {string} type - Filter type\n * @returns {boolean} true if it has the filter\n */\n hasFilter(type) {\n return this.getComponent(components.FILTER).hasFilter(type);\n }\n\n /**\n * Set selection style of fabric object by init option\n * @param {Object} styles - Selection styles\n */\n setSelectionStyle(styles) {\n extend(fObjectOptions.SELECTION_STYLE, styles);\n }\n\n /**\n * Set object properties\n * @param {number} id - object id\n * @param {Object} props - props\n * @param {string} [props.fill] Color\n * @param {string} [props.fontFamily] Font type for text\n * @param {number} [props.fontSize] Size\n * @param {string} [props.fontStyle] Type of inclination (normal / italic)\n * @param {string} [props.fontWeight] Type of thicker or thinner looking (normal / bold)\n * @param {string} [props.textAlign] Type of text align (left / center / right)\n * @param {string} [props.textDecoration] Type of line (underline / line-through / overline)\n * @returns {Object} applied properties\n */\n setObjectProperties(id, props) {\n const object = this.getObject(id);\n const clone = extend({}, props);\n\n object.set(clone);\n\n object.setCoords();\n\n this.getCanvas().renderAll();\n\n return clone;\n }\n\n /**\n * Get object properties corresponding key\n * @param {number} id - object id\n * @param {Array|ObjectProps|string} keys - property's key\n * @returns {Object} properties\n */\n getObjectProperties(id, keys) {\n const object = this.getObject(id);\n const props = {};\n\n if (isString(keys)) {\n props[keys] = object[keys];\n } else if (isArray(keys)) {\n forEachArray(keys, (value) => {\n props[value] = object[value];\n });\n } else {\n forEachOwnProperties(keys, (value, key) => {\n props[key] = object[key];\n });\n }\n\n return props;\n }\n\n /**\n * Get object position by originX, originY\n * @param {number} id - object id\n * @param {string} originX - can be 'left', 'center', 'right'\n * @param {string} originY - can be 'top', 'center', 'bottom'\n * @returns {Object} {{x:number, y: number}} position by origin if id is valid, or null\n */\n getObjectPosition(id, originX, originY) {\n const targetObj = this.getObject(id);\n if (!targetObj) {\n return null;\n }\n\n return targetObj.getPointByOrigin(originX, originY);\n }\n\n /**\n * Set object position by originX, originY\n * @param {number} id - object id\n * @param {Object} posInfo - position object\n * @param {number} posInfo.x - x position\n * @param {number} posInfo.y - y position\n * @param {string} posInfo.originX - can be 'left', 'center', 'right'\n * @param {string} posInfo.originY - can be 'top', 'center', 'bottom'\n * @returns {boolean} true if target id is valid or false\n */\n setObjectPosition(id, posInfo) {\n const targetObj = this.getObject(id);\n const { x, y, originX, originY } = posInfo;\n if (!targetObj) {\n return false;\n }\n\n const targetOrigin = targetObj.getPointByOrigin(originX, originY);\n const centerOrigin = targetObj.getPointByOrigin('center', 'center');\n const diffX = centerOrigin.x - targetOrigin.x;\n const diffY = centerOrigin.y - targetOrigin.y;\n\n targetObj.set({\n left: x + diffX,\n top: y + diffY,\n });\n\n targetObj.setCoords();\n\n return true;\n }\n\n /**\n * Get the canvas size\n * @returns {Object} {{width: number, height: number}} image size\n */\n getCanvasSize() {\n const image = this.getCanvasImage();\n\n return {\n width: image ? image.width : 0,\n height: image ? image.height : 0,\n };\n }\n\n /**\n * Create fabric static canvas\n * @returns {Object} {{width: number, height: number}} image size\n */\n createStaticCanvas() {\n const staticCanvas = new fabric.StaticCanvas();\n\n staticCanvas.set({\n enableRetinaScaling: false,\n });\n\n return staticCanvas;\n }\n\n /**\n * Get a DrawingMode instance\n * @param {string} modeName - DrawingMode Class Name\n * @returns {DrawingMode} DrawingMode instance\n * @private\n */\n _getDrawingModeInstance(modeName) {\n return this._drawingModeMap[modeName];\n }\n\n /**\n * Set object caching to false. This brought many bugs when draw Shape & cropzone\n * @see http://fabricjs.com/fabric-object-caching\n * @private\n */\n _setObjectCachingToFalse() {\n fabric.Object.prototype.objectCaching = false;\n }\n\n /**\n * Set canvas element to fabric.Canvas\n * @param {Element|string} element - Wrapper or canvas element or selector\n * @private\n */\n _setCanvasElement(element) {\n let selectedElement;\n let canvasElement;\n\n if (element.nodeType) {\n selectedElement = element;\n } else {\n selectedElement = document.querySelector(element);\n }\n\n if (selectedElement.nodeName.toUpperCase() !== 'CANVAS') {\n canvasElement = document.createElement('canvas');\n selectedElement.appendChild(canvasElement);\n }\n\n this._canvas = new fabric.Canvas(canvasElement, {\n containerClass: 'tui-image-editor-canvas-container',\n enableRetinaScaling: false,\n });\n }\n\n /**\n * Creates DrawingMode instances\n * @private\n */\n _createDrawingModeInstances() {\n this._register(this._drawingModeMap, new CropperDrawingMode());\n this._register(this._drawingModeMap, new FreeDrawingMode());\n this._register(this._drawingModeMap, new LineDrawingMode());\n this._register(this._drawingModeMap, new ShapeDrawingMode());\n this._register(this._drawingModeMap, new TextDrawingMode());\n this._register(this._drawingModeMap, new IconDrawingMode());\n this._register(this._drawingModeMap, new ZoomDrawingMode());\n }\n\n /**\n * Create components\n * @private\n */\n _createComponents() {\n this._register(this._componentMap, new ImageLoader(this));\n this._register(this._componentMap, new Cropper(this));\n this._register(this._componentMap, new Flip(this));\n this._register(this._componentMap, new Rotation(this));\n this._register(this._componentMap, new FreeDrawing(this));\n this._register(this._componentMap, new Line(this));\n this._register(this._componentMap, new Text(this));\n this._register(this._componentMap, new Icon(this));\n this._register(this._componentMap, new Filter(this));\n this._register(this._componentMap, new Shape(this));\n this._register(this._componentMap, new Zoom(this));\n }\n\n /**\n * Register component\n * @param {Object} map - map object\n * @param {Object} module - module which has getName method\n * @private\n */\n _register(map, module) {\n map[module.getName()] = module;\n }\n\n /**\n * Get the current drawing mode is same with given mode\n * @param {string} mode drawing mode\n * @returns {boolean} true if same or false\n */\n _isSameDrawingMode(mode) {\n return this.getDrawingMode() === mode;\n }\n\n /**\n * Calculate max dimension of canvas\n * The css-max dimension is dynamically decided with maintaining image ratio\n * The css-max dimension is lower than canvas dimension (attribute of canvas, not css)\n * @param {number} width - Canvas width\n * @param {number} height - Canvas height\n * @returns {{width: number, height: number}} - Max width & Max height\n * @private\n */\n _calcMaxDimension(width, height) {\n const wScaleFactor = this.cssMaxWidth / width;\n const hScaleFactor = this.cssMaxHeight / height;\n let cssMaxWidth = Math.min(width, this.cssMaxWidth);\n let cssMaxHeight = Math.min(height, this.cssMaxHeight);\n\n if (wScaleFactor < 1 && wScaleFactor < hScaleFactor) {\n cssMaxWidth = width * wScaleFactor;\n cssMaxHeight = height * wScaleFactor;\n } else if (hScaleFactor < 1 && hScaleFactor < wScaleFactor) {\n cssMaxWidth = width * hScaleFactor;\n cssMaxHeight = height * hScaleFactor;\n }\n\n return {\n width: Math.floor(cssMaxWidth),\n height: Math.floor(cssMaxHeight),\n };\n }\n\n /**\n * Callback function after loading image\n * @param {fabric.Image} obj - Fabric image object\n * @private\n */\n _callbackAfterLoadingImageObject(obj) {\n const centerPos = this.getCanvasImage().getCenterPoint();\n\n obj.set(fObjectOptions.SELECTION_STYLE);\n obj.set({\n left: centerPos.x,\n top: centerPos.y,\n crossOrigin: 'Anonymous',\n });\n\n this.getCanvas().add(obj).setActiveObject(obj);\n }\n\n /**\n * Attach canvas's events\n */\n _attachCanvasEvents() {\n const canvas = this._canvas;\n const handler = this._handler;\n canvas.on({\n 'mouse:down': handler.onMouseDown,\n 'object:added': handler.onObjectAdded,\n 'object:removed': handler.onObjectRemoved,\n 'object:moving': handler.onObjectMoved,\n 'object:scaling': handler.onObjectScaled,\n 'object:modified': handler.onObjectModified,\n 'object:rotating': handler.onObjectRotated,\n 'path:created': handler.onPathCreated,\n 'selection:cleared': handler.onSelectionCleared,\n 'selection:created': handler.onSelectionCreated,\n 'selection:updated': handler.onObjectSelected,\n });\n }\n\n /**\n * \"mouse:down\" canvas event handler\n * @param {{target: fabric.Object, e: MouseEvent}} fEvent - Fabric event\n * @private\n */\n _onMouseDown(fEvent) {\n const { e: event, target } = fEvent;\n const originPointer = this._canvas.getPointer(event);\n\n if (target) {\n const { type } = target;\n const undoData = makeSelectionUndoData(target, (item) =>\n makeSelectionUndoDatum(this.getObjectId(item), item, type === 'activeSelection')\n );\n\n setCachedUndoDataForDimension(undoData);\n }\n\n this.fire(events.MOUSE_DOWN, event, originPointer);\n }\n\n /**\n * \"object:added\" canvas event handler\n * @param {{target: fabric.Object, e: MouseEvent}} fEvent - Fabric event\n * @private\n */\n _onObjectAdded(fEvent) {\n const obj = fEvent.target;\n if (obj.isType('cropzone')) {\n return;\n }\n\n this._addFabricObject(obj);\n }\n\n /**\n * \"object:removed\" canvas event handler\n * @param {{target: fabric.Object, e: MouseEvent}} fEvent - Fabric event\n * @private\n */\n _onObjectRemoved(fEvent) {\n const obj = fEvent.target;\n\n this._removeFabricObject(stamp(obj));\n }\n\n /**\n * \"object:moving\" canvas event handler\n * @param {{target: fabric.Object, e: MouseEvent}} fEvent - Fabric event\n * @private\n */\n _onObjectMoved(fEvent) {\n this._lazyFire(\n events.OBJECT_MOVED,\n (object) => this.createObjectProperties(object),\n fEvent.target\n );\n }\n\n /**\n * \"object:scaling\" canvas event handler\n * @param {{target: fabric.Object, e: MouseEvent}} fEvent - Fabric event\n * @private\n */\n _onObjectScaled(fEvent) {\n this._lazyFire(\n events.OBJECT_SCALED,\n (object) => this.createObjectProperties(object),\n fEvent.target\n );\n }\n\n /**\n * \"object:modified\" canvas event handler\n * @param {{target: fabric.Object, e: MouseEvent}} fEvent - Fabric event\n * @private\n */\n _onObjectModified(fEvent) {\n const { target } = fEvent;\n if (target.type === 'activeSelection') {\n const items = target.getObjects();\n\n items.forEach((item) => item.fire('modifiedInGroup', target));\n }\n\n this.fire(events.OBJECT_MODIFIED, target, this.getObjectId(target));\n }\n\n /**\n * \"object:rotating\" canvas event handler\n * @param {{target: fabric.Object, e: MouseEvent}} fEvent - Fabric event\n * @private\n */\n _onObjectRotated(fEvent) {\n this._lazyFire(\n events.OBJECT_ROTATED,\n (object) => this.createObjectProperties(object),\n fEvent.target\n );\n }\n\n /**\n * Lazy event emitter\n * @param {string} eventName - event name\n * @param {Function} paramsMaker - make param function\n * @param {Object} [target] - Object of the event owner.\n * @private\n */\n _lazyFire(eventName, paramsMaker, target) {\n const existEventDelegation = target && target.canvasEventDelegation;\n const delegationState = existEventDelegation ? target.canvasEventDelegation(eventName) : 'none';\n\n if (delegationState === 'unregistered') {\n target.canvasEventRegister(eventName, (object) => {\n this.fire(eventName, paramsMaker(object));\n });\n }\n\n if (delegationState === 'none') {\n this.fire(eventName, paramsMaker(target));\n }\n }\n\n /**\n * \"object:selected\" canvas event handler\n * @param {{target: fabric.Object, e: MouseEvent}} fEvent - Fabric event\n * @private\n */\n _onObjectSelected(fEvent) {\n const { target } = fEvent;\n const params = this.createObjectProperties(target);\n\n this.fire(events.OBJECT_ACTIVATED, params);\n }\n\n /**\n * \"path:created\" canvas event handler\n * @param {{path: fabric.Path}} obj - Path object\n * @private\n */\n _onPathCreated(obj) {\n const { x: left, y: top } = obj.path.getCenterPoint();\n obj.path.set(\n extend(\n {\n left,\n top,\n },\n fObjectOptions.SELECTION_STYLE\n )\n );\n\n const params = this.createObjectProperties(obj.path);\n\n this.fire(events.ADD_OBJECT, params);\n }\n\n /**\n * \"selction:cleared\" canvas event handler\n * @private\n */\n _onSelectionCleared() {\n this.fire(events.SELECTION_CLEARED);\n }\n\n /**\n * \"selction:created\" canvas event handler\n * @param {{target: fabric.Object, e: MouseEvent}} fEvent - Fabric event\n * @private\n */\n _onSelectionCreated(fEvent) {\n const { target } = fEvent;\n const params = this.createObjectProperties(target);\n\n this.fire(events.OBJECT_ACTIVATED, params);\n this.fire(events.SELECTION_CREATED, fEvent.target);\n }\n\n /**\n * Canvas discard selection all\n */\n discardSelection() {\n this._canvas.discardActiveObject();\n this._canvas.renderAll();\n }\n\n /**\n * Canvas Selectable status change\n * @param {boolean} selectable - expect status\n */\n changeSelectableAll(selectable) {\n this._canvas.forEachObject((obj) => {\n obj.selectable = selectable;\n obj.hoverCursor = selectable ? 'move' : 'crosshair';\n });\n }\n\n /**\n * Return object's properties\n * @param {fabric.Object} obj - fabric object\n * @returns {Object} properties object\n */\n createObjectProperties(obj) {\n const predefinedKeys = [\n 'left',\n 'top',\n 'width',\n 'height',\n 'fill',\n 'stroke',\n 'strokeWidth',\n 'opacity',\n 'angle',\n ];\n const props = {\n id: stamp(obj),\n type: obj.type,\n };\n\n extend(props, getProperties(obj, predefinedKeys));\n\n if (includes(['i-text', 'text'], obj.type)) {\n extend(props, this._createTextProperties(obj, props));\n } else if (includes(['rect', 'triangle', 'circle'], obj.type)) {\n const shapeComp = this.getComponent(components.SHAPE);\n extend(props, {\n fill: shapeComp.makeFillPropertyForUserEvent(obj),\n });\n }\n\n return props;\n }\n\n /**\n * Get text object's properties\n * @param {fabric.Object} obj - fabric text object\n * @param {Object} props - properties\n * @returns {Object} properties object\n */\n _createTextProperties(obj) {\n const predefinedKeys = [\n 'text',\n 'fontFamily',\n 'fontSize',\n 'fontStyle',\n 'textAlign',\n 'textDecoration',\n 'fontWeight',\n ];\n const props = {};\n extend(props, getProperties(obj, predefinedKeys));\n\n return props;\n }\n\n /**\n * Add object array by id\n * @param {fabric.Object} obj - fabric object\n * @returns {number} object id\n */\n _addFabricObject(obj) {\n const id = stamp(obj);\n this._objects[id] = obj;\n\n return id;\n }\n\n /**\n * Remove an object in array yb id\n * @param {number} id - object id\n */\n _removeFabricObject(id) {\n delete this._objects[id];\n }\n\n /**\n * Reset targetObjectForCopyPaste value from activeObject\n */\n resetTargetObjectForCopyPaste() {\n const activeObject = this.getActiveObject();\n\n if (activeObject) {\n this.targetObjectForCopyPaste = activeObject;\n }\n }\n\n /**\n * Paste fabric object\n * @returns {Promise}\n */\n pasteObject() {\n if (!this.targetObjectForCopyPaste) {\n return Promise.resolve([]);\n }\n\n const targetObject = this.targetObjectForCopyPaste;\n const isGroupSelect = targetObject.type === 'activeSelection';\n const targetObjects = isGroupSelect ? targetObject.getObjects() : [targetObject];\n let newTargetObject = null;\n\n this.discardSelection();\n\n return this._cloneObject(targetObjects).then((addedObjects) => {\n if (addedObjects.length > 1) {\n newTargetObject = this.getActiveSelectionFromObjects(addedObjects);\n } else {\n [newTargetObject] = addedObjects;\n }\n this.targetObjectForCopyPaste = newTargetObject;\n this.setActiveObject(newTargetObject);\n });\n }\n\n /**\n * Clone object\n * @param {fabric.Object} targetObjects - fabric object\n * @returns {Promise}\n * @private\n */\n _cloneObject(targetObjects) {\n const addedObjects = snippet.map(targetObjects, (targetObject) =>\n this._cloneObjectItem(targetObject)\n );\n\n return Promise.all(addedObjects);\n }\n\n /**\n * Clone object one item\n * @param {fabric.Object} targetObject - fabric object\n * @returns {Promise}\n * @private\n */\n _cloneObjectItem(targetObject) {\n return this._copyFabricObjectForPaste(targetObject).then((clonedObject) => {\n const objectProperties = this.createObjectProperties(clonedObject);\n this.add(clonedObject);\n\n this.fire(events.ADD_OBJECT, objectProperties);\n\n return clonedObject;\n });\n }\n\n /**\n * Copy fabric object with Changed position for copy and paste\n * @param {fabric.Object} targetObject - fabric object\n * @returns {Promise}\n * @private\n */\n _copyFabricObjectForPaste(targetObject) {\n const addExtraPx = (value, isReverse) =>\n isReverse ? value - EXTRA_PX_FOR_PASTE : value + EXTRA_PX_FOR_PASTE;\n\n return this._copyFabricObject(targetObject).then((clonedObject) => {\n const { left, top, width, height } = clonedObject;\n const { width: canvasWidth, height: canvasHeight } = this.getCanvasSize();\n const rightEdge = left + width / 2;\n const bottomEdge = top + height / 2;\n\n clonedObject.set(\n snippet.extend(\n {\n left: addExtraPx(left, rightEdge + EXTRA_PX_FOR_PASTE > canvasWidth),\n top: addExtraPx(top, bottomEdge + EXTRA_PX_FOR_PASTE > canvasHeight),\n },\n fObjectOptions.SELECTION_STYLE\n )\n );\n\n return clonedObject;\n });\n }\n\n /**\n * Copy fabric object\n * @param {fabric.Object} targetObject - fabric object\n * @returns {Promise}\n * @private\n */\n _copyFabricObject(targetObject) {\n return new Promise((resolve) => {\n targetObject.clone((cloned) => {\n const shapeComp = this.getComponent(components.SHAPE);\n if (isShape(cloned)) {\n shapeComp.processForCopiedObject(cloned, targetObject);\n }\n\n resolve(cloned);\n });\n });\n }\n}\n\nCustomEvents.mixin(Graphics);\n\nexport default Graphics;\n","/*\n imagetracer.js version 1.2.4\n Simple raster image tracer and vectorizer written in JavaScript.\n andras@jankovics.net\n*/\n\n/*\n The Unlicense / PUBLIC DOMAIN\n This is free and unencumbered software released into the public domain.\n Anyone is free to copy, modify, publish, use, compile, sell, or\n distribute this software, either in source code form or as a compiled\n binary, for any purpose, commercial or non-commercial, and by any\n means.\n In jurisdictions that recognize copyright laws, the author or authors\n of this software dedicate any and all copyright interest in the\n software to the public domain. We make this dedication for the benefit\n of the public at large and to the detriment of our heirs and\n successors. We intend this dedication to be an overt act of\n relinquishment in perpetuity of all present and future rights to this\n software under copyright law.\n THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\n EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\n MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.\n IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR\n OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,\n ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR\n OTHER DEALINGS IN THE SOFTWARE.\n For more information, please refer to http://unlicense.org/\n*/\nexport default class ImageTracer {\n static tracerDefaultOption() {\n return {\n pathomit: 100,\n ltres: 0.1,\n qtres: 1,\n\n scale: 1,\n strokewidth: 5,\n viewbox: false,\n linefilter: true,\n desc: false,\n rightangleenhance: false,\n pal: [\n {\n r: 0,\n g: 0,\n b: 0,\n a: 255,\n },\n {\n r: 255,\n g: 255,\n b: 255,\n a: 255,\n },\n ],\n };\n }\n /* eslint-disable */\n constructor() {\n this.versionnumber = '1.2.4';\n this.optionpresets = {\n default: {\n corsenabled: false,\n ltres: 1,\n qtres: 1,\n pathomit: 8,\n rightangleenhance: true,\n colorsampling: 2,\n numberofcolors: 16,\n mincolorratio: 0,\n colorquantcycles: 3,\n layering: 0,\n strokewidth: 1,\n linefilter: false,\n scale: 1,\n roundcoords: 1,\n viewbox: false,\n desc: false,\n lcpr: 0,\n qcpr: 0,\n blurradius: 0,\n blurdelta: 20,\n },\n posterized1: {\n colorsampling: 0,\n numberofcolors: 2,\n },\n posterized2: {\n numberofcolors: 4,\n blurradius: 5,\n },\n curvy: {\n ltres: 0.01,\n linefilter: true,\n rightangleenhance: false,\n },\n sharp: { qtres: 0.01, linefilter: false },\n detailed: { pathomit: 0, roundcoords: 2, ltres: 0.5, qtres: 0.5, numberofcolors: 64 },\n smoothed: { blurradius: 5, blurdelta: 64 },\n grayscale: { colorsampling: 0, colorquantcycles: 1, numberofcolors: 7 },\n fixedpalette: { colorsampling: 0, colorquantcycles: 1, numberofcolors: 27 },\n randomsampling1: { colorsampling: 1, numberofcolors: 8 },\n randomsampling2: { colorsampling: 1, numberofcolors: 64 },\n artistic1: {\n colorsampling: 0,\n colorquantcycles: 1,\n pathomit: 0,\n blurradius: 5,\n blurdelta: 64,\n ltres: 0.01,\n linefilter: true,\n numberofcolors: 16,\n strokewidth: 2,\n },\n artistic2: {\n qtres: 0.01,\n colorsampling: 0,\n colorquantcycles: 1,\n numberofcolors: 4,\n strokewidth: 0,\n },\n artistic3: { qtres: 10, ltres: 10, numberofcolors: 8 },\n artistic4: {\n qtres: 10,\n ltres: 10,\n numberofcolors: 64,\n blurradius: 5,\n blurdelta: 256,\n strokewidth: 2,\n },\n posterized3: {\n ltres: 1,\n qtres: 1,\n pathomit: 20,\n rightangleenhance: true,\n colorsampling: 0,\n numberofcolors: 3,\n mincolorratio: 0,\n colorquantcycles: 3,\n blurradius: 3,\n blurdelta: 20,\n strokewidth: 0,\n linefilter: false,\n roundcoords: 1,\n pal: [\n { r: 0, g: 0, b: 100, a: 255 },\n { r: 255, g: 255, b: 255, a: 255 },\n ],\n },\n };\n\n this.pathscan_combined_lookup = [\n [\n [-1, -1, -1, -1],\n [-1, -1, -1, -1],\n [-1, -1, -1, -1],\n [-1, -1, -1, -1],\n ],\n [\n [0, 1, 0, -1],\n [-1, -1, -1, -1],\n [-1, -1, -1, -1],\n [0, 2, -1, 0],\n ],\n [\n [-1, -1, -1, -1],\n [-1, -1, -1, -1],\n [0, 1, 0, -1],\n [0, 0, 1, 0],\n ],\n [\n [0, 0, 1, 0],\n [-1, -1, -1, -1],\n [0, 2, -1, 0],\n [-1, -1, -1, -1],\n ],\n [\n [-1, -1, -1, -1],\n [0, 0, 1, 0],\n [0, 3, 0, 1],\n [-1, -1, -1, -1],\n ],\n [\n [13, 3, 0, 1],\n [13, 2, -1, 0],\n [7, 1, 0, -1],\n [7, 0, 1, 0],\n ],\n [\n [-1, -1, -1, -1],\n [0, 1, 0, -1],\n [-1, -1, -1, -1],\n [0, 3, 0, 1],\n ],\n [\n [0, 3, 0, 1],\n [0, 2, -1, 0],\n [-1, -1, -1, -1],\n [-1, -1, -1, -1],\n ],\n [\n [0, 3, 0, 1],\n [0, 2, -1, 0],\n [-1, -1, -1, -1],\n [-1, -1, -1, -1],\n ],\n [\n [-1, -1, -1, -1],\n [0, 1, 0, -1],\n [-1, -1, -1, -1],\n [0, 3, 0, 1],\n ],\n [\n [11, 1, 0, -1],\n [14, 0, 1, 0],\n [14, 3, 0, 1],\n [11, 2, -1, 0],\n ],\n [\n [-1, -1, -1, -1],\n [0, 0, 1, 0],\n [0, 3, 0, 1],\n [-1, -1, -1, -1],\n ],\n [\n [0, 0, 1, 0],\n [-1, -1, -1, -1],\n [0, 2, -1, 0],\n [-1, -1, -1, -1],\n ],\n [\n [-1, -1, -1, -1],\n [-1, -1, -1, -1],\n [0, 1, 0, -1],\n [0, 0, 1, 0],\n ],\n [\n [0, 1, 0, -1],\n [-1, -1, -1, -1],\n [-1, -1, -1, -1],\n [0, 2, -1, 0],\n ],\n [\n [-1, -1, -1, -1],\n [-1, -1, -1, -1],\n [-1, -1, -1, -1],\n [-1, -1, -1, -1],\n ],\n ];\n\n this.gks = [\n [0.27901, 0.44198, 0.27901],\n [0.135336, 0.228569, 0.272192, 0.228569, 0.135336],\n [0.086776, 0.136394, 0.178908, 0.195843, 0.178908, 0.136394, 0.086776],\n [0.063327, 0.093095, 0.122589, 0.144599, 0.152781, 0.144599, 0.122589, 0.093095, 0.063327],\n [\n 0.049692,\n 0.069304,\n 0.089767,\n 0.107988,\n 0.120651,\n 0.125194,\n 0.120651,\n 0.107988,\n 0.089767,\n 0.069304,\n 0.049692,\n ],\n ];\n\n this.specpalette = [\n { r: 0, g: 0, b: 0, a: 255 },\n { r: 128, g: 128, b: 128, a: 255 },\n { r: 0, g: 0, b: 128, a: 255 },\n { r: 64, g: 64, b: 128, a: 255 },\n { r: 192, g: 192, b: 192, a: 255 },\n { r: 255, g: 255, b: 255, a: 255 },\n { r: 128, g: 128, b: 192, a: 255 },\n { r: 0, g: 0, b: 192, a: 255 },\n { r: 128, g: 0, b: 0, a: 255 },\n { r: 128, g: 64, b: 64, a: 255 },\n { r: 128, g: 0, b: 128, a: 255 },\n { r: 168, g: 168, b: 168, a: 255 },\n { r: 192, g: 128, b: 128, a: 255 },\n { r: 192, g: 0, b: 0, a: 255 },\n { r: 255, g: 255, b: 255, a: 255 },\n { r: 0, g: 128, b: 0, a: 255 },\n ];\n }\n\n imageToSVG(url, callback, options) {\n options = this.checkoptions(options);\n this.loadImage(\n url,\n (canvas) => {\n callback(this.imagedataToSVG(this.getImgdata(canvas), options));\n },\n options\n );\n }\n\n imagedataToSVG(imgd, options) {\n options = this.checkoptions(options);\n const td = this.imagedataToTracedata(imgd, options);\n\n return this.getsvgstring(td, options);\n }\n\n imageToTracedata(url, callback, options) {\n options = this.checkoptions(options);\n this.loadImage(\n url,\n (canvas) => {\n callback(this.imagedataToTracedata(this.getImgdata(canvas), options));\n },\n options\n );\n }\n\n imagedataToTracedata(imgd, options) {\n options = this.checkoptions(options);\n const ii = this.colorquantization(imgd, options);\n let tracedata;\n if (options.layering === 0) {\n tracedata = {\n layers: [],\n palette: ii.palette,\n width: ii.array[0].length - 2,\n height: ii.array.length - 2,\n };\n\n for (let colornum = 0; colornum < ii.palette.length; colornum += 1) {\n const tracedlayer = this.batchtracepaths(\n this.internodes(\n this.pathscan(this.layeringstep(ii, colornum), options.pathomit),\n options\n ),\n options.ltres,\n options.qtres\n );\n tracedata.layers.push(tracedlayer);\n }\n } else {\n const ls = this.layering(ii);\n if (options.layercontainerid) {\n this.drawLayers(ls, this.specpalette, options.scale, options.layercontainerid);\n }\n const bps = this.batchpathscan(ls, options.pathomit);\n const bis = this.batchinternodes(bps, options);\n tracedata = {\n layers: this.batchtracelayers(bis, options.ltres, options.qtres),\n palette: ii.palette,\n width: imgd.width,\n height: imgd.height,\n };\n }\n\n return tracedata;\n }\n\n checkoptions(options) {\n options = options || {};\n if (typeof options === 'string') {\n options = options.toLowerCase();\n if (this.optionpresets[options]) {\n options = this.optionpresets[options];\n } else {\n options = {};\n }\n }\n const ok = Object.keys(this.optionpresets['default']);\n for (let k = 0; k < ok.length; k += 1) {\n if (!options.hasOwnProperty(ok[k])) {\n options[ok[k]] = this.optionpresets['default'][ok[k]];\n }\n }\n\n return options;\n }\n\n colorquantization(imgd, options) {\n const arr = [];\n let idx = 0;\n let cd;\n let cdl;\n let ci;\n const paletteacc = [];\n const pixelnum = imgd.width * imgd.height;\n let i;\n let j;\n let k;\n let cnt;\n let palette;\n\n for (j = 0; j < imgd.height + 2; j += 1) {\n arr[j] = [];\n for (i = 0; i < imgd.width + 2; i += 1) {\n arr[j][i] = -1;\n }\n }\n if (options.pal) {\n palette = options.pal;\n } else if (options.colorsampling === 0) {\n palette = this.generatepalette(options.numberofcolors);\n } else if (options.colorsampling === 1) {\n palette = this.samplepalette(options.numberofcolors, imgd);\n } else {\n palette = this.samplepalette2(options.numberofcolors, imgd);\n }\n if (options.blurradius > 0) {\n imgd = this.blur(imgd, options.blurradius, options.blurdelta);\n }\n for (cnt = 0; cnt < options.colorquantcycles; cnt += 1) {\n if (cnt > 0) {\n for (k = 0; k < palette.length; k += 1) {\n if (paletteacc[k].n > 0) {\n palette[k] = {\n r: Math.floor(paletteacc[k].r / paletteacc[k].n),\n g: Math.floor(paletteacc[k].g / paletteacc[k].n),\n b: Math.floor(paletteacc[k].b / paletteacc[k].n),\n a: Math.floor(paletteacc[k].a / paletteacc[k].n),\n };\n }\n\n if (\n paletteacc[k].n / pixelnum < options.mincolorratio &&\n cnt < options.colorquantcycles - 1\n ) {\n palette[k] = {\n r: Math.floor(Math.random() * 255),\n g: Math.floor(Math.random() * 255),\n b: Math.floor(Math.random() * 255),\n a: Math.floor(Math.random() * 255),\n };\n }\n }\n }\n\n for (i = 0; i < palette.length; i += 1) {\n paletteacc[i] = { r: 0, g: 0, b: 0, a: 0, n: 0 };\n }\n\n for (j = 0; j < imgd.height; j += 1) {\n for (i = 0; i < imgd.width; i += 1) {\n idx = (j * imgd.width + i) * 4;\n\n ci = 0;\n cdl = 1024;\n for (k = 0; k < palette.length; k += 1) {\n cd =\n Math.abs(palette[k].r - imgd.data[idx]) +\n Math.abs(palette[k].g - imgd.data[idx + 1]) +\n Math.abs(palette[k].b - imgd.data[idx + 2]) +\n Math.abs(palette[k].a - imgd.data[idx + 3]);\n\n if (cd < cdl) {\n cdl = cd;\n ci = k;\n }\n }\n\n paletteacc[ci].r += imgd.data[idx];\n paletteacc[ci].g += imgd.data[idx + 1];\n paletteacc[ci].b += imgd.data[idx + 2];\n paletteacc[ci].a += imgd.data[idx + 3];\n paletteacc[ci].n += 1;\n\n arr[j + 1][i + 1] = ci;\n }\n }\n }\n\n return { array: arr, palette };\n }\n\n samplepalette(numberofcolors, imgd) {\n let idx;\n const palette = [];\n for (let i = 0; i < numberofcolors; i += 1) {\n idx = Math.floor((Math.random() * imgd.data.length) / 4) * 4;\n palette.push({\n r: imgd.data[idx],\n g: imgd.data[idx + 1],\n b: imgd.data[idx + 2],\n a: imgd.data[idx + 3],\n });\n }\n\n return palette;\n }\n\n samplepalette2(numberofcolors, imgd) {\n let idx;\n const palette = [];\n const ni = Math.ceil(Math.sqrt(numberofcolors));\n const nj = Math.ceil(numberofcolors / ni);\n const vx = imgd.width / (ni + 1);\n const vy = imgd.height / (nj + 1);\n for (let j = 0; j < nj; j += 1) {\n for (let i = 0; i < ni; i += 1) {\n if (palette.length === numberofcolors) {\n break;\n } else {\n idx = Math.floor((j + 1) * vy * imgd.width + (i + 1) * vx) * 4;\n palette.push({\n r: imgd.data[idx],\n g: imgd.data[idx + 1],\n b: imgd.data[idx + 2],\n a: imgd.data[idx + 3],\n });\n }\n }\n }\n\n return palette;\n }\n\n generatepalette(numberofcolors) {\n const palette = [];\n let rcnt;\n let gcnt;\n let bcnt;\n if (numberofcolors < 8) {\n const graystep = Math.floor(255 / (numberofcolors - 1));\n for (let i = 0; i < numberofcolors; i += 1) {\n palette.push({ r: i * graystep, g: i * graystep, b: i * graystep, a: 255 });\n }\n } else {\n const colorqnum = Math.floor(Math.pow(numberofcolors, 1 / 3));\n const colorstep = Math.floor(255 / (colorqnum - 1));\n const rndnum = numberofcolors - colorqnum * colorqnum * colorqnum;\n for (rcnt = 0; rcnt < colorqnum; rcnt += 1) {\n for (gcnt = 0; gcnt < colorqnum; gcnt += 1) {\n for (bcnt = 0; bcnt < colorqnum; bcnt += 1) {\n palette.push({ r: rcnt * colorstep, g: gcnt * colorstep, b: bcnt * colorstep, a: 255 });\n }\n }\n }\n for (rcnt = 0; rcnt < rndnum; rcnt += 1) {\n palette.push({\n r: Math.floor(Math.random() * 255),\n g: Math.floor(Math.random() * 255),\n b: Math.floor(Math.random() * 255),\n a: Math.floor(Math.random() * 255),\n });\n }\n }\n\n return palette;\n }\n\n layering(ii) {\n const layers = [];\n let val = 0;\n const ah = ii.array.length;\n const aw = ii.array[0].length;\n let n1;\n let n2;\n let n3;\n let n4;\n let n5;\n let n6;\n let n7;\n let n8;\n let i;\n let j;\n let k;\n for (k = 0; k < ii.palette.length; k += 1) {\n layers[k] = [];\n for (j = 0; j < ah; j += 1) {\n layers[k][j] = [];\n for (i = 0; i < aw; i += 1) {\n layers[k][j][i] = 0;\n }\n }\n }\n for (j = 1; j < ah - 1; j += 1) {\n for (i = 1; i < aw - 1; i += 1) {\n val = ii.array[j][i];\n\n n1 = ii.array[j - 1][i - 1] === val ? 1 : 0;\n n2 = ii.array[j - 1][i] === val ? 1 : 0;\n n3 = ii.array[j - 1][i + 1] === val ? 1 : 0;\n n4 = ii.array[j][i - 1] === val ? 1 : 0;\n n5 = ii.array[j][i + 1] === val ? 1 : 0;\n n6 = ii.array[j + 1][i - 1] === val ? 1 : 0;\n n7 = ii.array[j + 1][i] === val ? 1 : 0;\n n8 = ii.array[j + 1][i + 1] === val ? 1 : 0;\n\n layers[val][j + 1][i + 1] = 1 + n5 * 2 + n8 * 4 + n7 * 8;\n if (!n4) {\n layers[val][j + 1][i] = 0 + 2 + n7 * 4 + n6 * 8;\n }\n if (!n2) {\n layers[val][j][i + 1] = 0 + n3 * 2 + n5 * 4 + 8;\n }\n if (!n1) {\n layers[val][j][i] = 0 + n2 * 2 + 4 + n4 * 8;\n }\n }\n }\n\n return layers;\n }\n\n layeringstep(ii, cnum) {\n const layer = [];\n const ah = ii.array.length;\n const aw = ii.array[0].length;\n let i;\n let j;\n for (j = 0; j < ah; j += 1) {\n layer[j] = [];\n for (i = 0; i < aw; i += 1) {\n layer[j][i] = 0;\n }\n }\n for (j = 1; j < ah; j += 1) {\n for (i = 1; i < aw; i += 1) {\n layer[j][i] =\n (ii.array[j - 1][i - 1] === cnum ? 1 : 0) +\n (ii.array[j - 1][i] === cnum ? 2 : 0) +\n (ii.array[j][i - 1] === cnum ? 8 : 0) +\n (ii.array[j][i] === cnum ? 4 : 0);\n }\n }\n\n return layer;\n }\n\n pathscan(arr, pathomit) {\n const paths = [];\n let pacnt = 0;\n let pcnt = 0;\n let px = 0;\n let py = 0;\n const w = arr[0].length;\n const h = arr.length;\n let dir = 0;\n let pathfinished = true;\n let holepath = false;\n let lookuprow;\n for (let j = 0; j < h; j += 1) {\n for (let i = 0; i < w; i += 1) {\n if (arr[j][i] === 4 || arr[j][i] === 11) {\n px = i;\n py = j;\n paths[pacnt] = {};\n paths[pacnt].points = [];\n paths[pacnt].boundingbox = [px, py, px, py];\n paths[pacnt].holechildren = [];\n pathfinished = false;\n pcnt = 0;\n holepath = arr[j][i] === 11;\n dir = 1;\n\n while (!pathfinished) {\n paths[pacnt].points[pcnt] = {};\n paths[pacnt].points[pcnt].x = px - 1;\n paths[pacnt].points[pcnt].y = py - 1;\n paths[pacnt].points[pcnt].t = arr[py][px];\n\n if (px - 1 < paths[pacnt].boundingbox[0]) {\n paths[pacnt].boundingbox[0] = px - 1;\n }\n if (px - 1 > paths[pacnt].boundingbox[2]) {\n paths[pacnt].boundingbox[2] = px - 1;\n }\n if (py - 1 < paths[pacnt].boundingbox[1]) {\n paths[pacnt].boundingbox[1] = py - 1;\n }\n if (py - 1 > paths[pacnt].boundingbox[3]) {\n paths[pacnt].boundingbox[3] = py - 1;\n }\n\n lookuprow = this.pathscan_combined_lookup[arr[py][px]][dir];\n arr[py][px] = lookuprow[0];\n dir = lookuprow[1];\n px += lookuprow[2];\n py += lookuprow[3];\n\n if (px - 1 === paths[pacnt].points[0].x && py - 1 === paths[pacnt].points[0].y) {\n pathfinished = true;\n\n if (paths[pacnt].points.length < pathomit) {\n paths.pop();\n } else {\n paths[pacnt].isholepath = !!holepath;\n\n if (holepath) {\n let parentidx = 0,\n parentbbox = [-1, -1, w + 1, h + 1];\n for (let parentcnt = 0; parentcnt < pacnt; parentcnt++) {\n if (\n !paths[parentcnt].isholepath &&\n this.boundingboxincludes(\n paths[parentcnt].boundingbox,\n paths[pacnt].boundingbox\n ) &&\n this.boundingboxincludes(parentbbox, paths[parentcnt].boundingbox)\n ) {\n parentidx = parentcnt;\n parentbbox = paths[parentcnt].boundingbox;\n }\n }\n paths[parentidx].holechildren.push(pacnt);\n }\n pacnt += 1;\n }\n }\n pcnt += 1;\n }\n }\n }\n }\n\n return paths;\n }\n\n boundingboxincludes(parentbbox, childbbox) {\n return (\n parentbbox[0] < childbbox[0] &&\n parentbbox[1] < childbbox[1] &&\n parentbbox[2] > childbbox[2] &&\n parentbbox[3] > childbbox[3]\n );\n }\n\n batchpathscan(layers, pathomit) {\n const bpaths = [];\n for (const k in layers) {\n if (!layers.hasOwnProperty(k)) {\n continue;\n }\n bpaths[k] = this.pathscan(layers[k], pathomit);\n }\n\n return bpaths;\n }\n\n internodes(paths, options) {\n const ins = [];\n let palen = 0;\n let nextidx = 0;\n let nextidx2 = 0;\n let previdx = 0;\n let previdx2 = 0;\n let pacnt;\n let pcnt;\n for (pacnt = 0; pacnt < paths.length; pacnt += 1) {\n ins[pacnt] = {};\n ins[pacnt].points = [];\n ins[pacnt].boundingbox = paths[pacnt].boundingbox;\n ins[pacnt].holechildren = paths[pacnt].holechildren;\n ins[pacnt].isholepath = paths[pacnt].isholepath;\n palen = paths[pacnt].points.length;\n\n for (pcnt = 0; pcnt < palen; pcnt += 1) {\n nextidx = (pcnt + 1) % palen;\n nextidx2 = (pcnt + 2) % palen;\n previdx = (pcnt - 1 + palen) % palen;\n previdx2 = (pcnt - 2 + palen) % palen;\n\n if (\n options.rightangleenhance &&\n this.testrightangle(paths[pacnt], previdx2, previdx, pcnt, nextidx, nextidx2)\n ) {\n if (ins[pacnt].points.length > 0) {\n ins[pacnt].points[ins[pacnt].points.length - 1].linesegment = this.getdirection(\n ins[pacnt].points[ins[pacnt].points.length - 1].x,\n ins[pacnt].points[ins[pacnt].points.length - 1].y,\n paths[pacnt].points[pcnt].x,\n paths[pacnt].points[pcnt].y\n );\n }\n\n ins[pacnt].points.push({\n x: paths[pacnt].points[pcnt].x,\n y: paths[pacnt].points[pcnt].y,\n linesegment: this.getdirection(\n paths[pacnt].points[pcnt].x,\n paths[pacnt].points[pcnt].y,\n (paths[pacnt].points[pcnt].x + paths[pacnt].points[nextidx].x) / 2,\n (paths[pacnt].points[pcnt].y + paths[pacnt].points[nextidx].y) / 2\n ),\n });\n }\n\n ins[pacnt].points.push({\n x: (paths[pacnt].points[pcnt].x + paths[pacnt].points[nextidx].x) / 2,\n y: (paths[pacnt].points[pcnt].y + paths[pacnt].points[nextidx].y) / 2,\n linesegment: this.getdirection(\n (paths[pacnt].points[pcnt].x + paths[pacnt].points[nextidx].x) / 2,\n (paths[pacnt].points[pcnt].y + paths[pacnt].points[nextidx].y) / 2,\n (paths[pacnt].points[nextidx].x + paths[pacnt].points[nextidx2].x) / 2,\n (paths[pacnt].points[nextidx].y + paths[pacnt].points[nextidx2].y) / 2\n ),\n });\n }\n }\n\n return ins;\n }\n\n testrightangle(path, idx1, idx2, idx3, idx4, idx5) {\n return (\n (path.points[idx3].x === path.points[idx1].x &&\n path.points[idx3].x === path.points[idx2].x &&\n path.points[idx3].y === path.points[idx4].y &&\n path.points[idx3].y === path.points[idx5].y) ||\n (path.points[idx3].y === path.points[idx1].y &&\n path.points[idx3].y === path.points[idx2].y &&\n path.points[idx3].x === path.points[idx4].x &&\n path.points[idx3].x === path.points[idx5].x)\n );\n }\n\n getdirection(x1, y1, x2, y2) {\n let val = 8;\n if (x1 < x2) {\n if (y1 < y2) {\n val = 1;\n } else if (y1 > y2) {\n val = 7;\n } else {\n val = 0;\n }\n } else if (x1 > x2) {\n if (y1 < y2) {\n val = 3;\n } else if (y1 > y2) {\n val = 5;\n } else {\n val = 4;\n }\n } else if (y1 < y2) {\n val = 2;\n } else if (y1 > y2) {\n val = 6;\n } else {\n val = 8;\n }\n\n return val;\n }\n\n batchinternodes(bpaths, options) {\n const binternodes = [];\n for (const k in bpaths) {\n if (!bpaths.hasOwnProperty(k)) {\n continue;\n }\n binternodes[k] = this.internodes(bpaths[k], options);\n }\n\n return binternodes;\n }\n\n tracepath(path, ltres, qtres) {\n let pcnt = 0;\n let segtype1;\n let segtype2;\n let seqend;\n const smp = {};\n smp.segments = [];\n smp.boundingbox = path.boundingbox;\n smp.holechildren = path.holechildren;\n smp.isholepath = path.isholepath;\n\n while (pcnt < path.points.length) {\n segtype1 = path.points[pcnt].linesegment;\n segtype2 = -1;\n seqend = pcnt + 1;\n while (\n (path.points[seqend].linesegment === segtype1 ||\n path.points[seqend].linesegment === segtype2 ||\n segtype2 === -1) &&\n seqend < path.points.length - 1\n ) {\n if (path.points[seqend].linesegment !== segtype1 && segtype2 === -1) {\n segtype2 = path.points[seqend].linesegment;\n }\n seqend += 1;\n }\n if (seqend === path.points.length - 1) {\n seqend = 0;\n }\n\n smp.segments = smp.segments.concat(this.fitseq(path, ltres, qtres, pcnt, seqend));\n\n if (seqend > 0) {\n pcnt = seqend;\n } else {\n pcnt = path.points.length;\n }\n }\n\n return smp;\n }\n\n fitseq(path, ltres, qtres, seqstart, seqend) {\n if (seqend > path.points.length || seqend < 0) {\n return [];\n }\n let errorpoint = seqstart,\n errorval = 0,\n curvepass = true,\n px,\n py,\n dist2;\n let tl = seqend - seqstart;\n if (tl < 0) {\n tl += path.points.length;\n }\n let vx = (path.points[seqend].x - path.points[seqstart].x) / tl,\n vy = (path.points[seqend].y - path.points[seqstart].y) / tl;\n let pcnt = (seqstart + 1) % path.points.length,\n pl;\n while (pcnt != seqend) {\n pl = pcnt - seqstart;\n if (pl < 0) {\n pl += path.points.length;\n }\n px = path.points[seqstart].x + vx * pl;\n py = path.points[seqstart].y + vy * pl;\n dist2 =\n (path.points[pcnt].x - px) * (path.points[pcnt].x - px) +\n (path.points[pcnt].y - py) * (path.points[pcnt].y - py);\n if (dist2 > ltres) {\n curvepass = false;\n }\n if (dist2 > errorval) {\n errorpoint = pcnt;\n errorval = dist2;\n }\n pcnt = (pcnt + 1) % path.points.length;\n }\n if (curvepass) {\n return [\n {\n type: 'L',\n x1: path.points[seqstart].x,\n y1: path.points[seqstart].y,\n x2: path.points[seqend].x,\n y2: path.points[seqend].y,\n },\n ];\n }\n const fitpoint = errorpoint;\n curvepass = true;\n errorval = 0;\n let t = (fitpoint - seqstart) / tl,\n t1 = (1 - t) * (1 - t),\n t2 = 2 * (1 - t) * t,\n t3 = t * t;\n let cpx =\n (t1 * path.points[seqstart].x + t3 * path.points[seqend].x - path.points[fitpoint].x) / -t2,\n cpy =\n (t1 * path.points[seqstart].y + t3 * path.points[seqend].y - path.points[fitpoint].y) / -t2;\n pcnt = seqstart + 1;\n while (pcnt != seqend) {\n t = (pcnt - seqstart) / tl;\n t1 = (1 - t) * (1 - t);\n t2 = 2 * (1 - t) * t;\n t3 = t * t;\n px = t1 * path.points[seqstart].x + t2 * cpx + t3 * path.points[seqend].x;\n py = t1 * path.points[seqstart].y + t2 * cpy + t3 * path.points[seqend].y;\n dist2 =\n (path.points[pcnt].x - px) * (path.points[pcnt].x - px) +\n (path.points[pcnt].y - py) * (path.points[pcnt].y - py);\n if (dist2 > qtres) {\n curvepass = false;\n }\n if (dist2 > errorval) {\n errorpoint = pcnt;\n errorval = dist2;\n }\n pcnt = (pcnt + 1) % path.points.length;\n }\n if (curvepass) {\n return [\n {\n type: 'Q',\n x1: path.points[seqstart].x,\n y1: path.points[seqstart].y,\n x2: cpx,\n y2: cpy,\n x3: path.points[seqend].x,\n y3: path.points[seqend].y,\n },\n ];\n }\n const splitpoint = fitpoint;\n\n return this.fitseq(path, ltres, qtres, seqstart, splitpoint).concat(\n this.fitseq(path, ltres, qtres, splitpoint, seqend)\n );\n }\n\n batchtracepaths(internodepaths, ltres, qtres) {\n const btracedpaths = [];\n for (const k in internodepaths) {\n if (!internodepaths.hasOwnProperty(k)) {\n continue;\n }\n btracedpaths.push(this.tracepath(internodepaths[k], ltres, qtres));\n }\n\n return btracedpaths;\n }\n\n batchtracelayers(binternodes, ltres, qtres) {\n const btbis = [];\n for (const k in binternodes) {\n if (!binternodes.hasOwnProperty(k)) {\n continue;\n }\n btbis[k] = this.batchtracepaths(binternodes[k], ltres, qtres);\n }\n\n return btbis;\n }\n\n roundtodec(val, places) {\n return Number(val.toFixed(places));\n }\n\n svgpathstring(tracedata, lnum, pathnum, options) {\n let layer = tracedata.layers[lnum],\n smp = layer[pathnum],\n str = '',\n pcnt;\n if (options.linefilter && smp.segments.length < 3) {\n return str;\n }\n str = `= 0; pcnt--) {\n str += `${hsmp.segments[pcnt].type} `;\n if (hsmp.segments[pcnt].hasOwnProperty('x3')) {\n str += `${hsmp.segments[pcnt].x2 * options.scale} ${\n hsmp.segments[pcnt].y2 * options.scale\n } `;\n }\n str += `${hsmp.segments[pcnt].x1 * options.scale} ${\n hsmp.segments[pcnt].y1 * options.scale\n } `;\n }\n } else {\n if (hsmp.segments[hsmp.segments.length - 1].hasOwnProperty('x3')) {\n str += `M ${this.roundtodec(\n hsmp.segments[hsmp.segments.length - 1].x3 * options.scale\n )} ${this.roundtodec(hsmp.segments[hsmp.segments.length - 1].y3 * options.scale)} `;\n } else {\n str += `M ${this.roundtodec(\n hsmp.segments[hsmp.segments.length - 1].x2 * options.scale\n )} ${this.roundtodec(hsmp.segments[hsmp.segments.length - 1].y2 * options.scale)} `;\n }\n for (pcnt = hsmp.segments.length - 1; pcnt >= 0; pcnt--) {\n str += `${hsmp.segments[pcnt].type} `;\n if (hsmp.segments[pcnt].hasOwnProperty('x3')) {\n str += `${this.roundtodec(hsmp.segments[pcnt].x2 * options.scale)} ${this.roundtodec(\n hsmp.segments[pcnt].y2 * options.scale\n )} `;\n }\n str += `${this.roundtodec(hsmp.segments[pcnt].x1 * options.scale)} ${this.roundtodec(\n hsmp.segments[pcnt].y1 * options.scale\n )} `;\n }\n }\n str += 'Z ';\n }\n str += '\" />';\n if (options.lcpr || options.qcpr) {\n for (pcnt = 0; pcnt < smp.segments.length; pcnt++) {\n if (smp.segments[pcnt].hasOwnProperty('x3') && options.qcpr) {\n str += ``;\n str += ``;\n str += ``;\n str += ``;\n }\n if (!smp.segments[pcnt].hasOwnProperty('x3') && options.lcpr) {\n str += ``;\n }\n }\n\n for (var hcnt = 0; hcnt < smp.holechildren.length; hcnt++) {\n var hsmp = layer[smp.holechildren[hcnt]];\n for (pcnt = 0; pcnt < hsmp.segments.length; pcnt++) {\n if (hsmp.segments[pcnt].hasOwnProperty('x3') && options.qcpr) {\n str += ``;\n str += ``;\n str += ``;\n str += ``;\n }\n if (!hsmp.segments[pcnt].hasOwnProperty('x3') && options.lcpr) {\n str += ``;\n }\n }\n }\n }\n\n return str;\n }\n\n getsvgstring(tracedata, options) {\n options = this.checkoptions(options);\n const w = tracedata.width * options.scale;\n const h = tracedata.height * options.scale;\n\n let svgstr = ``;\n for (let lcnt = 0; lcnt < tracedata.layers.length; lcnt += 1) {\n for (let pcnt = 0; pcnt < tracedata.layers[lcnt].length; pcnt += 1) {\n if (!tracedata.layers[lcnt][pcnt].isholepath) {\n svgstr += this.svgpathstring(tracedata, lcnt, pcnt, options);\n }\n }\n }\n svgstr += '';\n\n return svgstr;\n }\n\n compareNumbers(a, b) {\n return a - b;\n }\n\n torgbastr(c) {\n return `rgba(${c.r},${c.g},${c.b},${c.a})`;\n }\n\n tosvgcolorstr(c, options) {\n return `fill=\"rgb(${c.r},${c.g},${c.b})\" stroke=\"rgb(${c.r},${c.g},${c.b})\" stroke-width=\"${\n options.strokewidth\n }\" opacity=\"${c.a / 255.0}\" `;\n }\n\n appendSVGString(svgstr, parentid) {\n let div;\n if (parentid) {\n div = document.getElementById(parentid);\n if (!div) {\n div = document.createElement('div');\n div.id = parentid;\n document.body.appendChild(div);\n }\n } else {\n div = document.createElement('div');\n document.body.appendChild(div);\n }\n div.innerHTML += svgstr;\n }\n\n blur(imgd, radius, delta) {\n let i, j, k, d, idx, racc, gacc, bacc, aacc, wacc;\n const imgd2 = { width: imgd.width, height: imgd.height, data: [] };\n radius = Math.floor(radius);\n if (radius < 1) {\n return imgd;\n }\n if (radius > 5) {\n radius = 5;\n }\n delta = Math.abs(delta);\n if (delta > 1024) {\n delta = 1024;\n }\n const thisgk = this.gks[radius - 1];\n for (j = 0; j < imgd.height; j++) {\n for (i = 0; i < imgd.width; i++) {\n racc = 0;\n gacc = 0;\n bacc = 0;\n aacc = 0;\n wacc = 0;\n\n for (k = -radius; k < radius + 1; k++) {\n if (i + k > 0 && i + k < imgd.width) {\n idx = (j * imgd.width + i + k) * 4;\n racc += imgd.data[idx] * thisgk[k + radius];\n gacc += imgd.data[idx + 1] * thisgk[k + radius];\n bacc += imgd.data[idx + 2] * thisgk[k + radius];\n aacc += imgd.data[idx + 3] * thisgk[k + radius];\n wacc += thisgk[k + radius];\n }\n }\n\n idx = (j * imgd.width + i) * 4;\n imgd2.data[idx] = Math.floor(racc / wacc);\n imgd2.data[idx + 1] = Math.floor(gacc / wacc);\n imgd2.data[idx + 2] = Math.floor(bacc / wacc);\n imgd2.data[idx + 3] = Math.floor(aacc / wacc);\n }\n }\n const himgd = new Uint8ClampedArray(imgd2.data);\n for (j = 0; j < imgd.height; j++) {\n for (i = 0; i < imgd.width; i++) {\n racc = 0;\n gacc = 0;\n bacc = 0;\n aacc = 0;\n wacc = 0;\n\n for (k = -radius; k < radius + 1; k++) {\n if (j + k > 0 && j + k < imgd.height) {\n idx = ((j + k) * imgd.width + i) * 4;\n racc += himgd[idx] * thisgk[k + radius];\n gacc += himgd[idx + 1] * thisgk[k + radius];\n bacc += himgd[idx + 2] * thisgk[k + radius];\n aacc += himgd[idx + 3] * thisgk[k + radius];\n wacc += thisgk[k + radius];\n }\n }\n\n idx = (j * imgd.width + i) * 4;\n imgd2.data[idx] = Math.floor(racc / wacc);\n imgd2.data[idx + 1] = Math.floor(gacc / wacc);\n imgd2.data[idx + 2] = Math.floor(bacc / wacc);\n imgd2.data[idx + 3] = Math.floor(aacc / wacc);\n }\n }\n for (j = 0; j < imgd.height; j++) {\n for (i = 0; i < imgd.width; i++) {\n idx = (j * imgd.width + i) * 4;\n\n d =\n Math.abs(imgd2.data[idx] - imgd.data[idx]) +\n Math.abs(imgd2.data[idx + 1] - imgd.data[idx + 1]) +\n Math.abs(imgd2.data[idx + 2] - imgd.data[idx + 2]) +\n Math.abs(imgd2.data[idx + 3] - imgd.data[idx + 3]);\n\n if (d > delta) {\n imgd2.data[idx] = imgd.data[idx];\n imgd2.data[idx + 1] = imgd.data[idx + 1];\n imgd2.data[idx + 2] = imgd.data[idx + 2];\n imgd2.data[idx + 3] = imgd.data[idx + 3];\n }\n }\n }\n\n return imgd2;\n }\n\n loadImage(url, callback, options) {\n const img = new Image();\n if (options && options.corsenabled) {\n img.crossOrigin = 'Anonymous';\n }\n img.src = url;\n img.onload = function () {\n const canvas = document.createElement('canvas');\n canvas.width = img.width;\n canvas.height = img.height;\n const context = canvas.getContext('2d');\n context.drawImage(img, 0, 0);\n callback(canvas);\n };\n }\n\n getImgdata(canvas) {\n const context = canvas.getContext('2d');\n\n return context.getImageData(0, 0, canvas.width, canvas.height);\n }\n\n drawLayers(layers, palette, scale, parentid) {\n scale = scale || 1;\n let w, h, i, j, k;\n let div;\n if (parentid) {\n div = document.getElementById(parentid);\n if (!div) {\n div = document.createElement('div');\n div.id = parentid;\n document.body.appendChild(div);\n }\n } else {\n div = document.createElement('div');\n document.body.appendChild(div);\n }\n for (k in layers) {\n if (!layers.hasOwnProperty(k)) {\n continue;\n }\n\n w = layers[k][0].length;\n h = layers[k].length;\n\n const canvas = document.createElement('canvas');\n canvas.width = w * scale;\n canvas.height = h * scale;\n const context = canvas.getContext('2d');\n\n for (j = 0; j < h; j += 1) {\n for (i = 0; i < w; i += 1) {\n context.fillStyle = this.torgbastr(palette[layers[k][j][i] % palette.length]);\n context.fillRect(i * scale, j * scale, scale, scale);\n }\n }\n\n div.appendChild(canvas);\n }\n }\n}\n","/**\n * @author NHN. FE Development Team \n * @fileoverview Selection modification helper\n */\n\nimport { extend } from 'tui-code-snippet';\n\n/**\n * Cached selection's info\n * @type {Array}\n * @private\n */\nlet cachedUndoDataForChangeDimension = null;\n\n/**\n * Set cached undo data\n * @param {Array} undoData - selection object\n * @private\n */\nexport function setCachedUndoDataForDimension(undoData) {\n cachedUndoDataForChangeDimension = undoData;\n}\n\n/**\n * Get cached undo data\n * @returns {Object} cached undo data\n * @private\n */\nexport function getCachedUndoDataForDimension() {\n return cachedUndoDataForChangeDimension;\n}\n\n/**\n * Make undo data\n * @param {fabric.Object} obj - selection object\n * @param {Function} undoDatumMaker - make undo datum\n * @returns {Array} undoData\n * @private\n */\nexport function makeSelectionUndoData(obj, undoDatumMaker) {\n let undoData;\n\n if (obj.type === 'activeSelection') {\n undoData = obj.getObjects().map((item) => {\n const { angle, left, top, scaleX, scaleY, width, height } = item;\n\n obj.realizeTransform(item);\n const result = undoDatumMaker(item);\n\n item.set({\n angle,\n left,\n top,\n width,\n height,\n scaleX,\n scaleY,\n });\n\n return result;\n });\n } else {\n undoData = [undoDatumMaker(obj)];\n }\n\n return undoData;\n}\n\n/**\n * Make undo datum\n * @param {number} id - object id\n * @param {fabric.Object} obj - selection object\n * @param {boolean} isSelection - whether or not object is selection\n * @returns {Object} undo datum\n * @private\n */\nexport function makeSelectionUndoDatum(id, obj, isSelection) {\n return isSelection\n ? {\n id,\n width: obj.width,\n height: obj.height,\n top: obj.top,\n left: obj.left,\n angle: obj.angle,\n scaleX: obj.scaleX,\n scaleY: obj.scaleY,\n }\n : extend({ id }, obj);\n}\n","/**\n * @author NHN. FE Development Team \n * @fileoverview Shape resize helper\n */\nimport { forEach, map, extend } from 'tui-code-snippet';\nimport resizeHelper from '@/helper/shapeResizeHelper';\nimport { capitalizeString, flipObject, setCustomProperty, getCustomProperty } from '@/util';\n\nconst FILTER_OPTION_MAP = {\n pixelate: 'blocksize',\n blur: 'blur',\n};\nconst POSITION_DIMENSION_MAP = {\n x: 'width',\n y: 'height',\n};\n\nconst FILTER_NAME_VALUE_MAP = flipObject(FILTER_OPTION_MAP);\n\n/**\n * Cached canvas image element for fill image\n * @type {boolean}\n * @private\n */\nlet cachedCanvasImageElement = null;\n\n/**\n * Get background image of fill\n * @param {fabric.Object} shapeObj - Shape object\n * @returns {fabric.Image}\n * @private\n */\nexport function getFillImageFromShape(shapeObj) {\n const { patternSourceCanvas } = getCustomProperty(shapeObj, 'patternSourceCanvas');\n const [fillImage] = patternSourceCanvas.getObjects();\n\n return fillImage;\n}\n\n/**\n * Reset the image position in the filter type fill area.\n * @param {fabric.Object} shapeObj - Shape object\n * @private\n */\nexport function rePositionFilterTypeFillImage(shapeObj) {\n const { angle, flipX, flipY } = shapeObj;\n const fillImage = getFillImageFromShape(shapeObj);\n const rotatedShapeCornerDimension = getRotatedDimension(shapeObj);\n const { right, bottom } = rotatedShapeCornerDimension;\n let { width, height } = rotatedShapeCornerDimension;\n const diffLeft = (width - shapeObj.width) / 2;\n const diffTop = (height - shapeObj.height) / 2;\n const cropX = shapeObj.left - shapeObj.width / 2 - diffLeft;\n const cropY = shapeObj.top - shapeObj.height / 2 - diffTop;\n let left = width / 2 - diffLeft;\n let top = height / 2 - diffTop;\n const fillImageMaxSize = Math.max(width, height) + Math.max(diffLeft, diffTop);\n\n [left, top, width, height] = calculateFillImageDimensionOutsideCanvas({\n shapeObj,\n left,\n top,\n width,\n height,\n cropX,\n cropY,\n flipX,\n flipY,\n right,\n bottom,\n });\n\n fillImage.set({\n angle: flipX === flipY ? -angle : angle,\n left,\n top,\n width,\n height,\n cropX,\n cropY,\n flipX,\n flipY,\n });\n\n setCustomProperty(fillImage, { fillImageMaxSize });\n}\n\n/**\n * Make filter option from fabric image\n * @param {fabric.Image} imageObject - fabric image object\n * @returns {object}\n */\nexport function makeFilterOptionFromFabricImage(imageObject) {\n return map(imageObject.filters, (filter) => {\n const [key] = Object.keys(filter);\n\n return {\n [FILTER_NAME_VALUE_MAP[key]]: filter[key],\n };\n });\n}\n\n/**\n * Calculate fill image position and size for out of Canvas\n * @param {Object} options - options for position dimension calculate\n * @param {fabric.Object} shapeObj - shape object\n * @param {number} left - original left position\n * @param {number} top - original top position\n * @param {number} width - image width\n * @param {number} height - image height\n * @param {number} cropX - image cropX\n * @param {number} cropY - image cropY\n * @param {boolean} flipX - shape flipX\n * @param {boolean} flipY - shape flipY\n * @returns {Object}\n */\nfunction calculateFillImageDimensionOutsideCanvas({\n shapeObj,\n left,\n top,\n width,\n height,\n cropX,\n cropY,\n flipX,\n flipY,\n right,\n bottom,\n}) {\n const overflowAreaPositionFixer = (type, outDistance, imageLeft, imageTop) =>\n calculateDistanceOverflowPart({\n type,\n outDistance,\n shapeObj,\n flipX,\n flipY,\n left: imageLeft,\n top: imageTop,\n });\n const [originalWidth, originalHeight] = [width, height];\n\n [left, top, width, height] = calculateDimensionLeftTopEdge(overflowAreaPositionFixer, {\n left,\n top,\n width,\n height,\n cropX,\n cropY,\n });\n\n [left, top, width, height] = calculateDimensionRightBottomEdge(overflowAreaPositionFixer, {\n left,\n top,\n insideCanvasRealImageWidth: width,\n insideCanvasRealImageHeight: height,\n right,\n bottom,\n cropX,\n cropY,\n originalWidth,\n originalHeight,\n });\n\n return [left, top, width, height];\n}\n\n/**\n * Calculate fill image position and size for for right bottom edge\n * @param {Function} overflowAreaPositionFixer - position fixer\n * @param {Object} options - options for position dimension calculate\n * @param {fabric.Object} shapeObj - shape object\n * @param {number} left - original left position\n * @param {number} top - original top position\n * @param {number} width - image width\n * @param {number} height - image height\n * @param {number} right - image right\n * @param {number} bottom - image bottom\n * @param {number} cropX - image cropX\n * @param {number} cropY - image cropY\n * @param {boolean} originalWidth - image original width\n * @param {boolean} originalHeight - image original height\n * @returns {Object}\n */\nfunction calculateDimensionRightBottomEdge(\n overflowAreaPositionFixer,\n {\n left,\n top,\n insideCanvasRealImageWidth,\n insideCanvasRealImageHeight,\n right,\n bottom,\n cropX,\n cropY,\n originalWidth,\n originalHeight,\n }\n) {\n let [width, height] = [insideCanvasRealImageWidth, insideCanvasRealImageHeight];\n const { width: canvasWidth, height: canvasHeight } = cachedCanvasImageElement;\n\n if (right > canvasWidth && cropX > 0) {\n width = originalWidth - Math.abs(right - canvasWidth);\n }\n if (bottom > canvasHeight && cropY > 0) {\n height = originalHeight - Math.abs(bottom - canvasHeight);\n }\n\n const diff = {\n x: (insideCanvasRealImageWidth - width) / 2,\n y: (insideCanvasRealImageHeight - height) / 2,\n };\n\n forEach(['x', 'y'], (type) => {\n const cropDistance2 = diff[type];\n if (cropDistance2 > 0) {\n [left, top] = overflowAreaPositionFixer(type, cropDistance2, left, top);\n }\n });\n\n return [left, top, width, height];\n}\n\n/**\n * Calculate fill image position and size for for left top\n * @param {Function} overflowAreaPositionFixer - position fixer\n * @param {Object} options - options for position dimension calculate\n * @param {fabric.Object} shapeObj - shape object\n * @param {number} left - original left position\n * @param {number} top - original top position\n * @param {number} width - image width\n * @param {number} height - image height\n * @param {number} cropX - image cropX\n * @param {number} cropY - image cropY\n * @returns {Object}\n */\nfunction calculateDimensionLeftTopEdge(\n overflowAreaPositionFixer,\n { left, top, width, height, cropX, cropY }\n) {\n const dimension = {\n width,\n height,\n };\n\n forEach(['x', 'y'], (type) => {\n const cropDistance = type === 'x' ? cropX : cropY;\n const compareSize = dimension[POSITION_DIMENSION_MAP[type]];\n const standardSize = cachedCanvasImageElement[POSITION_DIMENSION_MAP[type]];\n\n if (compareSize > standardSize) {\n const outDistance = (compareSize - standardSize) / 2;\n\n dimension[POSITION_DIMENSION_MAP[type]] = standardSize;\n [left, top] = overflowAreaPositionFixer(type, outDistance, left, top);\n }\n if (cropDistance < 0) {\n [left, top] = overflowAreaPositionFixer(type, cropDistance, left, top);\n }\n });\n\n return [left, top, dimension.width, dimension.height];\n}\n\n/**\n * Make fill property of dynamic pattern type\n * @param {fabric.Image} canvasImage - canvas background image\n * @param {Array} filterOption - filter option\n * @param {fabric.StaticCanvas} patternSourceCanvas - fabric static canvas\n * @returns {Object}\n */\nexport function makeFillPatternForFilter(canvasImage, filterOption, patternSourceCanvas) {\n const copiedCanvasElement = getCachedCanvasImageElement(canvasImage);\n const fillImage = makeFillImage(copiedCanvasElement, canvasImage.angle, filterOption);\n patternSourceCanvas.add(fillImage);\n\n const fabricProperty = {\n fill: new fabric.Pattern({\n source: patternSourceCanvas.getElement(),\n repeat: 'no-repeat',\n }),\n };\n\n setCustomProperty(fabricProperty, { patternSourceCanvas });\n\n return fabricProperty;\n}\n\n/**\n * Reset fill pattern canvas\n * @param {fabric.StaticCanvas} patternSourceCanvas - fabric static canvas\n */\nexport function resetFillPatternCanvas(patternSourceCanvas) {\n const [innerImage] = patternSourceCanvas.getObjects();\n let { fillImageMaxSize } = getCustomProperty(innerImage, 'fillImageMaxSize');\n fillImageMaxSize = Math.max(1, fillImageMaxSize);\n\n patternSourceCanvas.setDimensions({\n width: fillImageMaxSize,\n height: fillImageMaxSize,\n });\n patternSourceCanvas.renderAll();\n}\n\n/**\n * Remake filter pattern image source\n * @param {fabric.Object} shapeObj - Shape object\n * @param {fabric.Image} canvasImage - canvas background image\n */\nexport function reMakePatternImageSource(shapeObj, canvasImage) {\n const { patternSourceCanvas } = getCustomProperty(shapeObj, 'patternSourceCanvas');\n const [fillImage] = patternSourceCanvas.getObjects();\n const filterOption = makeFilterOptionFromFabricImage(fillImage);\n\n patternSourceCanvas.remove(fillImage);\n\n const copiedCanvasElement = getCachedCanvasImageElement(canvasImage, true);\n const newFillImage = makeFillImage(copiedCanvasElement, canvasImage.angle, filterOption);\n\n patternSourceCanvas.add(newFillImage);\n}\n\n/**\n * Calculate a point line outside the canvas.\n * @param {fabric.Image} canvasImage - canvas background image\n * @param {boolean} reset - default is false\n * @returns {HTMLImageElement}\n */\nexport function getCachedCanvasImageElement(canvasImage, reset = false) {\n if (!cachedCanvasImageElement || reset) {\n cachedCanvasImageElement = canvasImage.toCanvasElement();\n }\n\n return cachedCanvasImageElement;\n}\n\n/**\n * Calculate fill image position for out of Canvas\n * @param {string} type - 'x' or 'y'\n * @param {fabric.Object} shapeObj - shape object\n * @param {number} outDistance - distance away\n * @param {number} left - original left position\n * @param {number} top - original top position\n * @returns {Array}\n */\nfunction calculateDistanceOverflowPart({ type, shapeObj, outDistance, left, top, flipX, flipY }) {\n const shapePointNavigation = getShapeEdgePoint(shapeObj);\n const shapeNeighborPointNavigation = [\n [1, 2],\n [0, 3],\n [0, 3],\n [1, 2],\n ];\n const linePointsOutsideCanvas = calculateLinePointsOutsideCanvas(\n type,\n shapePointNavigation,\n shapeNeighborPointNavigation\n );\n const reatAngles = calculateLineAngleOfOutsideCanvas(\n type,\n shapePointNavigation,\n linePointsOutsideCanvas\n );\n const { startPointIndex } = linePointsOutsideCanvas;\n const diffPosition = getReversePositionForFlip({\n outDistance,\n startPointIndex,\n flipX,\n flipY,\n reatAngles,\n });\n\n return [left + diffPosition.left, top + diffPosition.top];\n}\n\n/**\n * Calculate fill image position for out of Canvas\n * @param {number} outDistance - distance away\n * @param {boolean} flipX - flip x statux\n * @param {boolean} flipY - flip y statux\n * @param {Array} reatAngles - Line angle of the rectangle vertex.\n * @returns {Object} diffPosition\n */\nfunction getReversePositionForFlip({ outDistance, startPointIndex, flipX, flipY, reatAngles }) {\n const rotationChangePoint1 = outDistance * Math.cos((reatAngles[0] * Math.PI) / 180);\n const rotationChangePoint2 = outDistance * Math.cos((reatAngles[1] * Math.PI) / 180);\n const isForward = startPointIndex === 2 || startPointIndex === 3;\n const diffPosition = {\n top: isForward ? rotationChangePoint1 : rotationChangePoint2,\n left: isForward ? rotationChangePoint2 : rotationChangePoint1,\n };\n\n if (isReverseLeftPositionForFlip(startPointIndex, flipX, flipY)) {\n diffPosition.left = diffPosition.left * -1;\n }\n if (isReverseTopPositionForFlip(startPointIndex, flipX, flipY)) {\n diffPosition.top = diffPosition.top * -1;\n }\n\n return diffPosition;\n}\n\n/**\n * Calculate a point line outside the canvas.\n * @param {string} type - 'x' or 'y'\n * @param {Array} shapePointNavigation - shape edge positions\n * @param {Object} shapePointNavigation.lefttop - left top position\n * @param {Object} shapePointNavigation.righttop - right top position\n * @param {Object} shapePointNavigation.leftbottom - lefttop position\n * @param {Object} shapePointNavigation.rightbottom - rightbottom position\n * @param {Array} shapeNeighborPointNavigation - Array to find adjacent edges.\n * @returns {Object}\n */\nfunction calculateLinePointsOutsideCanvas(\n type,\n shapePointNavigation,\n shapeNeighborPointNavigation\n) {\n let minimumPoint = 0;\n let minimumPointIndex = 0;\n forEach(shapePointNavigation, (point, index) => {\n if (point[type] < minimumPoint) {\n minimumPoint = point[type];\n minimumPointIndex = index;\n }\n });\n\n const [endPointIndex1, endPointIndex2] = shapeNeighborPointNavigation[minimumPointIndex];\n\n return {\n startPointIndex: minimumPointIndex,\n endPointIndex1,\n endPointIndex2,\n };\n}\n\n/**\n * Calculate a point line outside the canvas.\n * @param {string} type - 'x' or 'y'\n * @param {Array} shapePointNavigation - shape edge positions\n * @param {object} shapePointNavigation.lefttop - left top position\n * @param {object} shapePointNavigation.righttop - right top position\n * @param {object} shapePointNavigation.leftbottom - lefttop position\n * @param {object} shapePointNavigation.rightbottom - rightbottom position\n * @param {Object} linePointsOfOneVertexIndex - Line point of one vertex\n * @param {Object} linePointsOfOneVertexIndex.startPoint - start point index\n * @param {Object} linePointsOfOneVertexIndex.endPointIndex1 - end point index\n * @param {Object} linePointsOfOneVertexIndex.endPointIndex2 - end point index\n * @returns {Object}\n */\nfunction calculateLineAngleOfOutsideCanvas(type, shapePointNavigation, linePointsOfOneVertexIndex) {\n const { startPointIndex, endPointIndex1, endPointIndex2 } = linePointsOfOneVertexIndex;\n const horizontalVerticalAngle = type === 'x' ? 180 : 270;\n\n return map([endPointIndex1, endPointIndex2], (pointIndex) => {\n const startPoint = shapePointNavigation[startPointIndex];\n const endPoint = shapePointNavigation[pointIndex];\n const diffY = startPoint.y - endPoint.y;\n const diffX = startPoint.x - endPoint.x;\n\n return (Math.atan2(diffY, diffX) * 180) / Math.PI - horizontalVerticalAngle;\n });\n}\n\n/* eslint-disable complexity */\n/**\n * Calculate a point line outside the canvas for horizontal.\n * @param {number} startPointIndex - start point index\n * @param {boolean} flipX - flip x statux\n * @param {boolean} flipY - flip y statux\n * @returns {boolean} flipY - flip y statux\n */\nfunction isReverseLeftPositionForFlip(startPointIndex, flipX, flipY) {\n return (\n (((!flipX && flipY) || (!flipX && !flipY)) && startPointIndex === 0) ||\n (((flipX && flipY) || (flipX && !flipY)) && startPointIndex === 1) ||\n (((!flipX && !flipY) || (!flipX && flipY)) && startPointIndex === 2) ||\n (((flipX && !flipY) || (flipX && flipY)) && startPointIndex === 3)\n );\n}\n/* eslint-enable complexity */\n\n/* eslint-disable complexity */\n/**\n * Calculate a point line outside the canvas for vertical.\n * @param {number} startPointIndex - start point index\n * @param {boolean} flipX - flip x statux\n * @param {boolean} flipY - flip y statux\n * @returns {boolean} flipY - flip y statux\n */\nfunction isReverseTopPositionForFlip(startPointIndex, flipX, flipY) {\n return (\n (((flipX && !flipY) || (!flipX && !flipY)) && startPointIndex === 0) ||\n (((!flipX && !flipY) || (flipX && !flipY)) && startPointIndex === 1) ||\n (((flipX && flipY) || (!flipX && flipY)) && startPointIndex === 2) ||\n (((!flipX && flipY) || (flipX && flipY)) && startPointIndex === 3)\n );\n}\n/* eslint-enable complexity */\n\n/**\n * Shape edge points\n * @param {fabric.Object} shapeObj - Selected shape object on canvas\n * @returns {Array} shapeEdgePoint - shape edge positions\n */\nfunction getShapeEdgePoint(shapeObj) {\n return [\n shapeObj.getPointByOrigin('left', 'top'),\n shapeObj.getPointByOrigin('right', 'top'),\n shapeObj.getPointByOrigin('left', 'bottom'),\n shapeObj.getPointByOrigin('right', 'bottom'),\n ];\n}\n\n/**\n * Rotated shape dimension\n * @param {fabric.Object} shapeObj - Shape object\n * @returns {Object} Rotated shape dimension\n */\nfunction getRotatedDimension(shapeObj) {\n const [\n { x: ax, y: ay },\n { x: bx, y: by },\n { x: cx, y: cy },\n { x: dx, y: dy },\n ] = getShapeEdgePoint(shapeObj);\n\n const left = Math.min(ax, bx, cx, dx);\n const top = Math.min(ay, by, cy, dy);\n const right = Math.max(ax, bx, cx, dx);\n const bottom = Math.max(ay, by, cy, dy);\n\n return {\n left,\n top,\n right,\n bottom,\n width: right - left,\n height: bottom - top,\n };\n}\n\n/**\n * Make fill image\n * @param {HTMLImageElement} copiedCanvasElement - html image element\n * @param {number} currentCanvasImageAngle - current canvas angle\n * @param {Array} filterOption - filter option\n * @returns {fabric.Image}\n * @private\n */\nfunction makeFillImage(copiedCanvasElement, currentCanvasImageAngle, filterOption) {\n const fillImage = new fabric.Image(copiedCanvasElement);\n\n forEach(extend({}, ...filterOption), (value, key) => {\n const fabricFilterClassName = capitalizeString(key);\n const filter = new fabric.Image.filters[fabricFilterClassName]({\n [FILTER_OPTION_MAP[key]]: value,\n });\n fillImage.filters.push(filter);\n });\n fillImage.applyFilters();\n\n setCustomProperty(fillImage, {\n originalAngle: currentCanvasImageAngle,\n fillImageMaxSize: Math.max(fillImage.width, fillImage.height),\n });\n resizeHelper.adjustOriginToCenter(fillImage);\n\n return fillImage;\n}\n","/**\n * @author NHN. FE Development Team \n * @fileoverview Shape resize helper\n */\nconst DIVISOR = {\n rect: 1,\n circle: 2,\n triangle: 1,\n};\nconst DIMENSION_KEYS = {\n rect: {\n w: 'width',\n h: 'height',\n },\n circle: {\n w: 'rx',\n h: 'ry',\n },\n triangle: {\n w: 'width',\n h: 'height',\n },\n};\n\n/**\n * Set the start point value to the shape object\n * @param {fabric.Object} shape - Shape object\n * @ignore\n */\nfunction setStartPoint(shape) {\n const { originX, originY } = shape;\n const originKey = originX.substring(0, 1) + originY.substring(0, 1);\n\n shape.startPoint = shape.origins[originKey];\n}\n\n/**\n * Get the positions of ratated origin by the pointer value\n * @param {{x: number, y: number}} origin - Origin value\n * @param {{x: number, y: number}} pointer - Pointer value\n * @param {number} angle - Rotating angle\n * @returns {Object} Postions of origin\n * @ignore\n */\nfunction getPositionsOfRotatedOrigin(origin, pointer, angle) {\n const sx = origin.x;\n const sy = origin.y;\n const px = pointer.x;\n const py = pointer.y;\n const r = (angle * Math.PI) / 180;\n const rx = (px - sx) * Math.cos(r) - (py - sy) * Math.sin(r) + sx;\n const ry = (px - sx) * Math.sin(r) + (py - sy) * Math.cos(r) + sy;\n\n return {\n originX: sx > rx ? 'right' : 'left',\n originY: sy > ry ? 'bottom' : 'top',\n };\n}\n\n/**\n * Whether the shape has the center origin or not\n * @param {fabric.Object} shape - Shape object\n * @returns {boolean} State\n * @ignore\n */\nfunction hasCenterOrigin(shape) {\n return shape.originX === 'center' && shape.originY === 'center';\n}\n\n/**\n * Adjust the origin of shape by the start point\n * @param {{x: number, y: number}} pointer - Pointer value\n * @param {fabric.Object} shape - Shape object\n * @ignore\n */\nfunction adjustOriginByStartPoint(pointer, shape) {\n const centerPoint = shape.getPointByOrigin('center', 'center');\n const angle = -shape.angle;\n const originPositions = getPositionsOfRotatedOrigin(centerPoint, pointer, angle);\n const { originX, originY } = originPositions;\n const origin = shape.getPointByOrigin(originX, originY);\n const left = shape.left - (centerPoint.x - origin.x);\n const top = shape.top - (centerPoint.y - origin.y);\n\n shape.set({\n originX,\n originY,\n left,\n top,\n });\n\n shape.setCoords();\n}\n\n/**\n * Adjust the origin of shape by the moving pointer value\n * @param {{x: number, y: number}} pointer - Pointer value\n * @param {fabric.Object} shape - Shape object\n * @ignore\n */\nfunction adjustOriginByMovingPointer(pointer, shape) {\n const origin = shape.startPoint;\n const angle = -shape.angle;\n const originPositions = getPositionsOfRotatedOrigin(origin, pointer, angle);\n const { originX, originY } = originPositions;\n\n shape.setPositionByOrigin(origin, originX, originY);\n shape.setCoords();\n}\n\n/**\n * Adjust the dimension of shape on firing scaling event\n * @param {fabric.Object} shape - Shape object\n * @ignore\n */\nfunction adjustDimensionOnScaling(shape) {\n const { type, scaleX, scaleY } = shape;\n const dimensionKeys = DIMENSION_KEYS[type];\n let width = shape[dimensionKeys.w] * scaleX;\n let height = shape[dimensionKeys.h] * scaleY;\n\n if (shape.isRegular) {\n const maxScale = Math.max(scaleX, scaleY);\n\n width = shape[dimensionKeys.w] * maxScale;\n height = shape[dimensionKeys.h] * maxScale;\n }\n\n const options = {\n hasControls: false,\n hasBorders: false,\n scaleX: 1,\n scaleY: 1,\n };\n\n options[dimensionKeys.w] = width;\n options[dimensionKeys.h] = height;\n\n shape.set(options);\n}\n\n/**\n * Adjust the dimension of shape on firing mouse move event\n * @param {{x: number, y: number}} pointer - Pointer value\n * @param {fabric.Object} shape - Shape object\n * @ignore\n */\nfunction adjustDimensionOnMouseMove(pointer, shape) {\n const { type, strokeWidth, startPoint: origin } = shape;\n const divisor = DIVISOR[type];\n const dimensionKeys = DIMENSION_KEYS[type];\n const isTriangle = !!(shape.type === 'triangle');\n const options = {};\n let width = Math.abs(origin.x - pointer.x) / divisor;\n let height = Math.abs(origin.y - pointer.y) / divisor;\n\n if (width > strokeWidth) {\n width -= strokeWidth / divisor;\n }\n\n if (height > strokeWidth) {\n height -= strokeWidth / divisor;\n }\n\n if (shape.isRegular) {\n width = height = Math.max(width, height);\n\n if (isTriangle) {\n height = (Math.sqrt(3) / 2) * width;\n }\n }\n\n options[dimensionKeys.w] = width;\n options[dimensionKeys.h] = height;\n\n shape.set(options);\n}\n\nmodule.exports = {\n /**\n * Set each origin value to shape\n * @param {fabric.Object} shape - Shape object\n */\n setOrigins(shape) {\n const leftTopPoint = shape.getPointByOrigin('left', 'top');\n const rightTopPoint = shape.getPointByOrigin('right', 'top');\n const rightBottomPoint = shape.getPointByOrigin('right', 'bottom');\n const leftBottomPoint = shape.getPointByOrigin('left', 'bottom');\n\n shape.origins = {\n lt: leftTopPoint,\n rt: rightTopPoint,\n rb: rightBottomPoint,\n lb: leftBottomPoint,\n };\n },\n\n /**\n * Resize the shape\n * @param {fabric.Object} shape - Shape object\n * @param {{x: number, y: number}} pointer - Mouse pointer values on canvas\n * @param {boolean} isScaling - Whether the resizing action is scaling or not\n */\n resize(shape, pointer, isScaling) {\n if (hasCenterOrigin(shape)) {\n adjustOriginByStartPoint(pointer, shape);\n setStartPoint(shape);\n }\n\n if (isScaling) {\n adjustDimensionOnScaling(shape, pointer);\n } else {\n adjustDimensionOnMouseMove(pointer, shape);\n }\n\n adjustOriginByMovingPointer(pointer, shape);\n },\n\n /**\n * Adjust the origin position of shape to center\n * @param {fabric.Object} shape - Shape object\n */\n adjustOriginToCenter(shape) {\n const centerPoint = shape.getPointByOrigin('center', 'center');\n const { originX, originY } = shape;\n const origin = shape.getPointByOrigin(originX, originY);\n const left = shape.left + (centerPoint.x - origin.x);\n const top = shape.top + (centerPoint.y - origin.y);\n\n shape.set({\n hasControls: true,\n hasBorders: true,\n originX: 'center',\n originY: 'center',\n left,\n top,\n });\n\n shape.setCoords(); // For left, top properties\n },\n};\n","/**\n * @author NHN. FE Development Team \n * @fileoverview Image-editor application class\n */\nimport snippet from 'tui-code-snippet';\nimport Invoker from '@/invoker';\nimport UI from '@/ui';\nimport action from '@/action';\nimport commandFactory from '@/factory/command';\nimport Graphics from '@/graphics';\nimport { makeSelectionUndoData, makeSelectionUndoDatum } from '@/helper/selectionModifyHelper';\nimport { sendHostName, Promise, getObjectType } from '@/util';\nimport {\n eventNames as events,\n commandNames as commands,\n keyCodes,\n rejectMessages,\n OBJ_TYPE,\n} from '@/consts';\n\nconst { isUndefined, forEach, CustomEvents } = snippet;\n\nconst {\n MOUSE_DOWN,\n OBJECT_MOVED,\n OBJECT_SCALED,\n OBJECT_ACTIVATED,\n OBJECT_ROTATED,\n OBJECT_ADDED,\n OBJECT_MODIFIED,\n ADD_TEXT,\n ADD_OBJECT,\n TEXT_EDITING,\n TEXT_CHANGED,\n ICON_CREATE_RESIZE,\n ICON_CREATE_END,\n SELECTION_CLEARED,\n SELECTION_CREATED,\n ADD_OBJECT_AFTER,\n} = events;\n\n/**\n * Image filter result\n * @typedef {object} FilterResult\n * @property {string} type - filter type like 'mask', 'Grayscale' and so on\n * @property {string} action - action type like 'add', 'remove'\n */\n\n/**\n * Flip status\n * @typedef {object} FlipStatus\n * @property {boolean} flipX - x axis\n * @property {boolean} flipY - y axis\n * @property {Number} angle - angle\n */\n/**\n * Rotation status\n * @typedef {Number} RotateStatus\n * @property {Number} angle - angle\n */\n\n/**\n * Old and new Size\n * @typedef {object} SizeChange\n * @property {Number} oldWidth - old width\n * @property {Number} oldHeight - old height\n * @property {Number} newWidth - new width\n * @property {Number} newHeight - new height\n */\n\n/**\n * @typedef {string} ErrorMsg - {string} error message\n */\n\n/**\n * @typedef {object} ObjectProps - graphics object properties\n * @property {number} id - object id\n * @property {string} type - object type\n * @property {string} text - text content\n * @property {(string | number)} left - Left\n * @property {(string | number)} top - Top\n * @property {(string | number)} width - Width\n * @property {(string | number)} height - Height\n * @property {string} fill - Color\n * @property {string} stroke - Stroke\n * @property {(string | number)} strokeWidth - StrokeWidth\n * @property {string} fontFamily - Font type for text\n * @property {number} fontSize - Font Size\n * @property {string} fontStyle - Type of inclination (normal / italic)\n * @property {string} fontWeight - Type of thicker or thinner looking (normal / bold)\n * @property {string} textAlign - Type of text align (left / center / right)\n * @property {string} textDecoration - Type of line (underline / line-through / overline)\n */\n\n/**\n * Shape filter option\n * @typedef {object.} ShapeFilterOption\n */\n\n/**\n * Shape filter option\n * @typedef {object} ShapeFillOption - fill option of shape\n * @property {string} type - fill type ('color' or 'filter')\n * @property {Array.} [filter] - {@link ShapeFilterOption} List.\n * only applies to filter types\n * (ex: \\[\\{pixelate: 20\\}, \\{blur: 0.3\\}\\])\n * @property {string} [color] - Shape foreground color (ex: '#fff', 'transparent')\n */\n\n/**\n * Image editor\n * @class\n * @param {string|HTMLElement} wrapper - Wrapper's element or selector\n * @param {Object} [options] - Canvas max width & height of css\n * @param {number} [options.includeUI] - Use the provided UI\n * @param {Object} [options.includeUI.loadImage] - Basic editing image\n * @param {string} options.includeUI.loadImage.path - image path\n * @param {string} options.includeUI.loadImage.name - image name\n * @param {Object} [options.includeUI.theme] - Theme object\n * @param {Array} [options.includeUI.menu] - It can be selected when only specific menu is used, Default values are \\['crop', 'flip', 'rotate', 'draw', 'shape', 'icon', 'text', 'mask', 'filter'\\].\n * @param {string} [options.includeUI.initMenu] - The first menu to be selected and started.\n * @param {Object} [options.includeUI.uiSize] - ui size of editor\n * @param {string} options.includeUI.uiSize.width - width of ui\n * @param {string} options.includeUI.uiSize.height - height of ui\n * @param {string} [options.includeUI.menuBarPosition=bottom] - Menu bar position('top', 'bottom', 'left', 'right')\n * @param {number} options.cssMaxWidth - Canvas css-max-width\n * @param {number} options.cssMaxHeight - Canvas css-max-height\n * @param {Object} [options.selectionStyle] - selection style\n * @param {string} [options.selectionStyle.cornerStyle] - selection corner style\n * @param {number} [options.selectionStyle.cornerSize] - selection corner size\n * @param {string} [options.selectionStyle.cornerColor] - selection corner color\n * @param {string} [options.selectionStyle.cornerStrokeColor] = selection corner stroke color\n * @param {boolean} [options.selectionStyle.transparentCorners] - selection corner transparent\n * @param {number} [options.selectionStyle.lineWidth] - selection line width\n * @param {string} [options.selectionStyle.borderColor] - selection border color\n * @param {number} [options.selectionStyle.rotatingPointOffset] - selection rotating point length\n * @param {Boolean} [options.usageStatistics=true] - Let us know the hostname. If you don't want to send the hostname, please set to false.\n * @example\n * var ImageEditor = require('tui-image-editor');\n * var blackTheme = require('./js/theme/black-theme.js');\n * var instance = new ImageEditor(document.querySelector('#tui-image-editor'), {\n * includeUI: {\n * loadImage: {\n * path: 'img/sampleImage.jpg',\n * name: 'SampleImage'\n * },\n * theme: blackTheme, // or whiteTheme\n * menu: ['shape', 'filter'],\n * initMenu: 'filter',\n * uiSize: {\n * width: '1000px',\n * height: '700px'\n * },\n * menuBarPosition: 'bottom'\n * },\n * cssMaxWidth: 700,\n * cssMaxHeight: 500,\n * selectionStyle: {\n * cornerSize: 20,\n * rotatingPointOffset: 70\n * }\n * });\n */\nclass ImageEditor {\n constructor(wrapper, options) {\n options = snippet.extend(\n {\n includeUI: false,\n usageStatistics: true,\n },\n options\n );\n\n this.mode = null;\n\n this.activeObjectId = null;\n\n /**\n * UI instance\n * @type {Ui}\n */\n if (options.includeUI) {\n const UIOption = options.includeUI;\n UIOption.usageStatistics = options.usageStatistics;\n\n this.ui = new UI(wrapper, UIOption, this.getActions());\n options = this.ui.setUiDefaultSelectionStyle(options);\n }\n\n /**\n * Invoker\n * @type {Invoker}\n * @private\n */\n this._invoker = new Invoker();\n\n /**\n * Graphics instance\n * @type {Graphics}\n * @private\n */\n this._graphics = new Graphics(this.ui ? this.ui.getEditorArea() : wrapper, {\n cssMaxWidth: options.cssMaxWidth,\n cssMaxHeight: options.cssMaxHeight,\n });\n\n /**\n * Event handler list\n * @type {Object}\n * @private\n */\n this._handlers = {\n keydown: this._onKeyDown.bind(this),\n mousedown: this._onMouseDown.bind(this),\n objectActivated: this._onObjectActivated.bind(this),\n objectMoved: this._onObjectMoved.bind(this),\n objectScaled: this._onObjectScaled.bind(this),\n objectRotated: this._onObjectRotated.bind(this),\n objectAdded: this._onObjectAdded.bind(this),\n objectModified: this._onObjectModified.bind(this),\n createdPath: this._onCreatedPath,\n addText: this._onAddText.bind(this),\n addObject: this._onAddObject.bind(this),\n textEditing: this._onTextEditing.bind(this),\n textChanged: this._onTextChanged.bind(this),\n iconCreateResize: this._onIconCreateResize.bind(this),\n iconCreateEnd: this._onIconCreateEnd.bind(this),\n selectionCleared: this._selectionCleared.bind(this),\n selectionCreated: this._selectionCreated.bind(this),\n };\n\n this._attachInvokerEvents();\n this._attachGraphicsEvents();\n this._attachDomEvents();\n this._setSelectionStyle(options.selectionStyle, {\n applyCropSelectionStyle: options.applyCropSelectionStyle,\n applyGroupSelectionStyle: options.applyGroupSelectionStyle,\n });\n\n if (options.usageStatistics) {\n sendHostName();\n }\n\n if (this.ui) {\n this.ui.initCanvas();\n this.setReAction();\n }\n fabric.enableGLFiltering = false;\n }\n\n /**\n * Set selection style by init option\n * @param {Object} selectionStyle - Selection styles\n * @param {Object} applyTargets - Selection apply targets\n * @param {boolean} applyCropSelectionStyle - whether apply with crop selection style or not\n * @param {boolean} applyGroupSelectionStyle - whether apply with group selection style or not\n * @private\n */\n _setSelectionStyle(selectionStyle, { applyCropSelectionStyle, applyGroupSelectionStyle }) {\n if (selectionStyle) {\n this._graphics.setSelectionStyle(selectionStyle);\n }\n\n if (applyCropSelectionStyle) {\n this._graphics.setCropSelectionStyle(selectionStyle);\n }\n\n if (applyGroupSelectionStyle) {\n this.on('selectionCreated', (eventTarget) => {\n if (eventTarget.type === 'activeSelection') {\n eventTarget.set(selectionStyle);\n }\n });\n }\n }\n\n /**\n * Attach invoker events\n * @private\n */\n _attachInvokerEvents() {\n const {\n UNDO_STACK_CHANGED,\n REDO_STACK_CHANGED,\n EXECUTE_COMMAND,\n AFTER_UNDO,\n AFTER_REDO,\n HAND_STARTED,\n HAND_STOPPED,\n } = events;\n\n /**\n * Undo stack changed event\n * @event ImageEditor#undoStackChanged\n * @param {Number} length - undo stack length\n * @example\n * imageEditor.on('undoStackChanged', function(length) {\n * console.log(length);\n * });\n */\n this._invoker.on(UNDO_STACK_CHANGED, this.fire.bind(this, UNDO_STACK_CHANGED));\n /**\n * Redo stack changed event\n * @event ImageEditor#redoStackChanged\n * @param {Number} length - redo stack length\n * @example\n * imageEditor.on('redoStackChanged', function(length) {\n * console.log(length);\n * });\n */\n this._invoker.on(REDO_STACK_CHANGED, this.fire.bind(this, REDO_STACK_CHANGED));\n\n if (this.ui) {\n const canvas = this._graphics.getCanvas();\n\n this._invoker.on(EXECUTE_COMMAND, (command) => this.ui.fire(EXECUTE_COMMAND, command));\n this._invoker.on(AFTER_UNDO, (command) => this.ui.fire(AFTER_UNDO, command));\n this._invoker.on(AFTER_REDO, (command) => this.ui.fire(AFTER_REDO, command));\n\n canvas.on(HAND_STARTED, () => this.ui.fire(HAND_STARTED));\n canvas.on(HAND_STOPPED, () => this.ui.fire(HAND_STOPPED));\n }\n }\n\n /**\n * Attach canvas events\n * @private\n */\n _attachGraphicsEvents() {\n this._graphics.on({\n [MOUSE_DOWN]: this._handlers.mousedown,\n [OBJECT_MOVED]: this._handlers.objectMoved,\n [OBJECT_SCALED]: this._handlers.objectScaled,\n [OBJECT_ROTATED]: this._handlers.objectRotated,\n [OBJECT_ACTIVATED]: this._handlers.objectActivated,\n [OBJECT_ADDED]: this._handlers.objectAdded,\n [OBJECT_MODIFIED]: this._handlers.objectModified,\n [ADD_TEXT]: this._handlers.addText,\n [ADD_OBJECT]: this._handlers.addObject,\n [TEXT_EDITING]: this._handlers.textEditing,\n [TEXT_CHANGED]: this._handlers.textChanged,\n [ICON_CREATE_RESIZE]: this._handlers.iconCreateResize,\n [ICON_CREATE_END]: this._handlers.iconCreateEnd,\n [SELECTION_CLEARED]: this._handlers.selectionCleared,\n [SELECTION_CREATED]: this._handlers.selectionCreated,\n });\n }\n\n /**\n * Attach dom events\n * @private\n */\n _attachDomEvents() {\n // ImageEditor supports IE 9 higher\n document.addEventListener('keydown', this._handlers.keydown);\n }\n\n /**\n * Detach dom events\n * @private\n */\n _detachDomEvents() {\n // ImageEditor supports IE 9 higher\n document.removeEventListener('keydown', this._handlers.keydown);\n }\n\n /**\n * Keydown event handler\n * @param {KeyboardEvent} e - Event object\n * @private\n */\n /* eslint-disable complexity */\n _onKeyDown(e) {\n const { ctrlKey, keyCode, metaKey } = e;\n const isModifierKey = ctrlKey || metaKey;\n\n if (isModifierKey) {\n if (keyCode === keyCodes.C) {\n this._graphics.resetTargetObjectForCopyPaste();\n } else if (keyCode === keyCodes.V) {\n this._graphics.pasteObject();\n this.clearRedoStack();\n } else if (keyCode === keyCodes.Z) {\n // There is no error message on shortcut when it's empty\n this.undo()['catch'](() => {});\n } else if (keyCode === keyCodes.Y) {\n // There is no error message on shortcut when it's empty\n this.redo()['catch'](() => {});\n }\n }\n\n const isDeleteKey = keyCode === keyCodes.BACKSPACE || keyCode === keyCodes.DEL;\n const isRemoveReady = this._graphics.isReadyRemoveObject();\n\n if (isRemoveReady && isDeleteKey) {\n e.preventDefault();\n this.removeActiveObject();\n }\n }\n\n /**\n * Remove Active Object\n */\n removeActiveObject() {\n const activeObjectId = this._graphics.getActiveObjectIdForRemove();\n\n this.removeObject(activeObjectId);\n }\n\n /**\n * mouse down event handler\n * @param {Event} event - mouse down event\n * @param {Object} originPointer - origin pointer\n * @param {Number} originPointer.x x position\n * @param {Number} originPointer.y y position\n * @private\n */\n _onMouseDown(event, originPointer) {\n /**\n * The mouse down event with position x, y on canvas\n * @event ImageEditor#mousedown\n * @param {Object} event - browser mouse event object\n * @param {Object} originPointer origin pointer\n * @param {Number} originPointer.x x position\n * @param {Number} originPointer.y y position\n * @example\n * imageEditor.on('mousedown', function(event, originPointer) {\n * console.log(event);\n * console.log(originPointer);\n * if (imageEditor.hasFilter('colorFilter')) {\n * imageEditor.applyFilter('colorFilter', {\n * x: parseInt(originPointer.x, 10),\n * y: parseInt(originPointer.y, 10)\n * });\n * }\n * });\n */\n\n this.fire(events.MOUSE_DOWN, event, originPointer);\n }\n\n /**\n * Add a 'addObject' command\n * @param {Object} obj - Fabric object\n * @private\n */\n _pushAddObjectCommand(obj) {\n const command = commandFactory.create(commands.ADD_OBJECT, this._graphics, obj);\n this._invoker.pushUndoStack(command);\n }\n\n /**\n * Add a 'changeSelection' command\n * @param {fabric.Object} obj - selection object\n * @private\n */\n _pushModifyObjectCommand(obj) {\n const { type } = obj;\n const props = makeSelectionUndoData(obj, (item) =>\n makeSelectionUndoDatum(this._graphics.getObjectId(item), item, type === 'activeSelection')\n );\n const command = commandFactory.create(commands.CHANGE_SELECTION, this._graphics, props);\n command.execute(this._graphics, props);\n\n this._invoker.pushUndoStack(command);\n }\n\n /**\n * 'objectActivated' event handler\n * @param {ObjectProps} props - object properties\n * @private\n */\n _onObjectActivated(props) {\n /**\n * The event when object is selected(aka activated).\n * @event ImageEditor#objectActivated\n * @param {ObjectProps} objectProps - object properties\n * @example\n * imageEditor.on('objectActivated', function(props) {\n * console.log(props);\n * console.log(props.type);\n * console.log(props.id);\n * });\n */\n this.fire(events.OBJECT_ACTIVATED, props);\n }\n\n /**\n * 'objectMoved' event handler\n * @param {ObjectProps} props - object properties\n * @private\n */\n _onObjectMoved(props) {\n /**\n * The event when object is moved\n * @event ImageEditor#objectMoved\n * @param {ObjectProps} props - object properties\n * @example\n * imageEditor.on('objectMoved', function(props) {\n * console.log(props);\n * console.log(props.type);\n * });\n */\n this.fire(events.OBJECT_MOVED, props);\n }\n\n /**\n * 'objectScaled' event handler\n * @param {ObjectProps} props - object properties\n * @private\n */\n _onObjectScaled(props) {\n /**\n * The event when scale factor is changed\n * @event ImageEditor#objectScaled\n * @param {ObjectProps} props - object properties\n * @example\n * imageEditor.on('objectScaled', function(props) {\n * console.log(props);\n * console.log(props.type);\n * });\n */\n this.fire(events.OBJECT_SCALED, props);\n }\n\n /**\n * 'objectRotated' event handler\n * @param {ObjectProps} props - object properties\n * @private\n */\n _onObjectRotated(props) {\n /**\n * The event when object angle is changed\n * @event ImageEditor#objectRotated\n * @param {ObjectProps} props - object properties\n * @example\n * imageEditor.on('objectRotated', function(props) {\n * console.log(props);\n * console.log(props.type);\n * });\n */\n this.fire(events.OBJECT_ROTATED, props);\n }\n\n /**\n * Get current drawing mode\n * @returns {string}\n * @example\n * // Image editor drawing mode\n * //\n * // NORMAL: 'NORMAL'\n * // CROPPER: 'CROPPER'\n * // FREE_DRAWING: 'FREE_DRAWING'\n * // LINE_DRAWING: 'LINE_DRAWING'\n * // TEXT: 'TEXT'\n * //\n * if (imageEditor.getDrawingMode() === 'FREE_DRAWING') {\n * imageEditor.stopDrawingMode();\n * }\n */\n getDrawingMode() {\n return this._graphics.getDrawingMode();\n }\n\n /**\n * Clear all objects\n * @returns {Promise}\n * @example\n * imageEditor.clearObjects();\n */\n clearObjects() {\n return this.execute(commands.CLEAR_OBJECTS);\n }\n\n /**\n * Deactivate all objects\n * @example\n * imageEditor.deactivateAll();\n */\n deactivateAll() {\n this._graphics.deactivateAll();\n this._graphics.renderAll();\n }\n\n /**\n * discard selction\n * @example\n * imageEditor.discardSelection();\n */\n discardSelection() {\n this._graphics.discardSelection();\n }\n\n /**\n * selectable status change\n * @param {boolean} selectable - selectable status\n * @example\n * imageEditor.changeSelectableAll(false); // or true\n */\n changeSelectableAll(selectable) {\n this._graphics.changeSelectableAll(selectable);\n }\n\n /**\n * Init history\n */\n _initHistory() {\n if (this.ui) {\n this.ui.initHistory();\n }\n }\n\n /**\n * Clear history\n */\n _clearHistory() {\n if (this.ui) {\n this.ui.clearHistory();\n }\n }\n\n /**\n * Invoke command\n * @param {String} commandName - Command name\n * @param {...*} args - Arguments for creating command\n * @returns {Promise}\n * @private\n */\n execute(commandName, ...args) {\n // Inject an Graphics instance as first parameter\n const theArgs = [this._graphics].concat(args);\n\n return this._invoker.execute(commandName, ...theArgs);\n }\n\n /**\n * Invoke command\n * @param {String} commandName - Command name\n * @param {...*} args - Arguments for creating command\n * @returns {Promise}\n * @private\n */\n executeSilent(commandName, ...args) {\n // Inject an Graphics instance as first parameter\n const theArgs = [this._graphics].concat(args);\n\n return this._invoker.executeSilent(commandName, ...theArgs);\n }\n\n /**\n * Undo\n * @param {number} [iterationCount=1] - Iteration count of undo\n * @returns {Promise}\n * @example\n * imageEditor.undo();\n */\n undo(iterationCount = 1) {\n let promise = Promise.resolve();\n\n for (let i = 0; i < iterationCount; i += 1) {\n promise = promise.then(() => this._invoker.undo());\n }\n\n return promise;\n }\n\n /**\n * Redo\n * @param {number} [iterationCount=1] - Iteration count of redo\n * @returns {Promise}\n * @example\n * imageEditor.redo();\n */\n redo(iterationCount = 1) {\n let promise = Promise.resolve();\n\n for (let i = 0; i < iterationCount; i += 1) {\n promise = promise.then(() => this._invoker.redo());\n }\n\n return promise;\n }\n\n /**\n * Zoom\n * @param {number} x - x axis of center point for zoom\n * @param {number} y - y axis of center point for zoom\n * @param {number} zoomLevel - level of zoom(1.0 ~ 5.0)\n */\n zoom({ x, y, zoomLevel }) {\n this._graphics.zoom({ x, y }, zoomLevel);\n }\n\n /**\n * Reset zoom. Change zoom level to 1.0\n */\n resetZoom() {\n this._graphics.resetZoom();\n }\n\n /**\n * Load image from file\n * @param {File} imgFile - Image file\n * @param {string} [imageName] - imageName\n * @returns {Promise}\n * @example\n * imageEditor.loadImageFromFile(file).then(result => {\n * console.log('old : ' + result.oldWidth + ', ' + result.oldHeight);\n * console.log('new : ' + result.newWidth + ', ' + result.newHeight);\n * });\n */\n loadImageFromFile(imgFile, imageName) {\n if (!imgFile) {\n return Promise.reject(rejectMessages.invalidParameters);\n }\n\n const imgUrl = URL.createObjectURL(imgFile);\n imageName = imageName || imgFile.name;\n\n return this.loadImageFromURL(imgUrl, imageName).then((value) => {\n URL.revokeObjectURL(imgFile);\n\n return value;\n });\n }\n\n /**\n * Load image from url\n * @param {string} url - File url\n * @param {string} imageName - imageName\n * @returns {Promise}\n * @example\n * imageEditor.loadImageFromURL('http://url/testImage.png', 'lena').then(result => {\n * console.log('old : ' + result.oldWidth + ', ' + result.oldHeight);\n * console.log('new : ' + result.newWidth + ', ' + result.newHeight);\n * });\n */\n loadImageFromURL(url, imageName) {\n if (!imageName || !url) {\n return Promise.reject(rejectMessages.invalidParameters);\n }\n\n return this.execute(commands.LOAD_IMAGE, imageName, url);\n }\n\n /**\n * Add image object on canvas\n * @param {string} imgUrl - Image url to make object\n * @returns {Promise}\n * @example\n * imageEditor.addImageObject('path/fileName.jpg').then(objectProps => {\n * console.log(ojectProps.id);\n * });\n */\n addImageObject(imgUrl) {\n if (!imgUrl) {\n return Promise.reject(rejectMessages.invalidParameters);\n }\n\n return this.execute(commands.ADD_IMAGE_OBJECT, imgUrl);\n }\n\n /**\n * Start a drawing mode. If the current mode is not 'NORMAL', 'stopDrawingMode()' will be called first.\n * @param {String} mode Can be one of 'CROPPER', 'FREE_DRAWING', 'LINE_DRAWING', 'TEXT', 'SHAPE'\n * @param {Object} [option] parameters of drawing mode, it's available with 'FREE_DRAWING', 'LINE_DRAWING'\n * @param {Number} [option.width] brush width\n * @param {String} [option.color] brush color\n * @param {Object} [option.arrowType] arrow decorate\n * @param {string} [option.arrowType.tail] arrow decorate for tail. 'chevron' or 'triangle'\n * @param {string} [option.arrowType.head] arrow decorate for head. 'chevron' or 'triangle'\n * @returns {boolean} true if success or false\n * @example\n * imageEditor.startDrawingMode('FREE_DRAWING', {\n * width: 10,\n * color: 'rgba(255,0,0,0.5)'\n * });\n * imageEditor.startDrawingMode('LINE_DRAWING', {\n * width: 10,\n * color: 'rgba(255,0,0,0.5)',\n * arrowType: {\n * tail: 'chevron' // triangle\n * }\n * });\n *\n */\n startDrawingMode(mode, option) {\n return this._graphics.startDrawingMode(mode, option);\n }\n\n /**\n * Stop the current drawing mode and back to the 'NORMAL' mode\n * @example\n * imageEditor.stopDrawingMode();\n */\n stopDrawingMode() {\n this._graphics.stopDrawingMode();\n }\n\n /**\n * Crop this image with rect\n * @param {Object} rect crop rect\n * @param {Number} rect.left left position\n * @param {Number} rect.top top position\n * @param {Number} rect.width width\n * @param {Number} rect.height height\n * @returns {Promise}\n * @example\n * imageEditor.crop(imageEditor.getCropzoneRect());\n */\n crop(rect) {\n const data = this._graphics.getCroppedImageData(rect);\n if (!data) {\n return Promise.reject(rejectMessages.invalidParameters);\n }\n\n return this.loadImageFromURL(data.url, data.imageName);\n }\n\n /**\n * Get the cropping rect\n * @returns {Object} {{left: number, top: number, width: number, height: number}} rect\n */\n getCropzoneRect() {\n return this._graphics.getCropzoneRect();\n }\n\n /**\n * Set the cropping rect\n * @param {number} [mode] crop rect mode [1, 1.5, 1.3333333333333333, 1.25, 1.7777777777777777]\n */\n setCropzoneRect(mode) {\n this._graphics.setCropzoneRect(mode);\n }\n\n /**\n * Flip\n * @returns {Promise}\n * @param {string} type - 'flipX' or 'flipY' or 'reset'\n * @returns {Promise}\n * @private\n */\n _flip(type) {\n return this.execute(commands.FLIP_IMAGE, type);\n }\n\n /**\n * Flip x\n * @returns {Promise}\n * @example\n * imageEditor.flipX().then((status => {\n * console.log('flipX: ', status.flipX);\n * console.log('flipY: ', status.flipY);\n * console.log('angle: ', status.angle);\n * }).catch(message => {\n * console.log('error: ', message);\n * });\n */\n flipX() {\n return this._flip('flipX');\n }\n\n /**\n * Flip y\n * @returns {Promise}\n * @example\n * imageEditor.flipY().then(status => {\n * console.log('flipX: ', status.flipX);\n * console.log('flipY: ', status.flipY);\n * console.log('angle: ', status.angle);\n * }).catch(message => {\n * console.log('error: ', message);\n * });\n */\n flipY() {\n return this._flip('flipY');\n }\n\n /**\n * Reset flip\n * @returns {Promise}\n * @example\n * imageEditor.resetFlip().then(status => {\n * console.log('flipX: ', status.flipX);\n * console.log('flipY: ', status.flipY);\n * console.log('angle: ', status.angle);\n * }).catch(message => {\n * console.log('error: ', message);\n * });;\n */\n resetFlip() {\n return this._flip('reset');\n }\n\n /**\n * @param {string} type - 'rotate' or 'setAngle'\n * @param {number} angle - angle value (degree)\n * @param {boolean} isSilent - is silent execution or not\n * @returns {Promise}\n * @private\n */\n _rotate(type, angle, isSilent) {\n let result = null;\n\n if (isSilent) {\n result = this.executeSilent(commands.ROTATE_IMAGE, type, angle);\n } else {\n result = this.execute(commands.ROTATE_IMAGE, type, angle);\n }\n\n return result;\n }\n\n /**\n * Rotate image\n * @returns {Promise}\n * @param {number} angle - Additional angle to rotate image\n * @param {boolean} isSilent - is silent execution or not\n * @returns {Promise}\n * @example\n * imageEditor.rotate(10); // angle = 10\n * imageEditor.rotate(10); // angle = 20\n * imageEditor.rotate(5); // angle = 5\n * imageEditor.rotate(-95); // angle = -90\n * imageEditor.rotate(10).then(status => {\n * console.log('angle: ', status.angle);\n * })).catch(message => {\n * console.log('error: ', message);\n * });\n */\n rotate(angle, isSilent) {\n return this._rotate('rotate', angle, isSilent);\n }\n\n /**\n * Set angle\n * @param {number} angle - Angle of image\n * @param {boolean} isSilent - is silent execution or not\n * @returns {Promise}\n * @example\n * imageEditor.setAngle(10); // angle = 10\n * imageEditor.rotate(10); // angle = 20\n * imageEditor.setAngle(5); // angle = 5\n * imageEditor.rotate(50); // angle = 55\n * imageEditor.setAngle(-40); // angle = -40\n * imageEditor.setAngle(10).then(status => {\n * console.log('angle: ', status.angle);\n * })).catch(message => {\n * console.log('error: ', message);\n * });\n */\n setAngle(angle, isSilent) {\n return this._rotate('setAngle', angle, isSilent);\n }\n\n /**\n * Set drawing brush\n * @param {Object} option brush option\n * @param {Number} option.width width\n * @param {String} option.color color like 'FFFFFF', 'rgba(0, 0, 0, 0.5)'\n * @example\n * imageEditor.startDrawingMode('FREE_DRAWING');\n * imageEditor.setBrush({\n * width: 12,\n * color: 'rgba(0, 0, 0, 0.5)'\n * });\n * imageEditor.setBrush({\n * width: 8,\n * color: 'FFFFFF'\n * });\n */\n setBrush(option) {\n this._graphics.setBrush(option);\n }\n\n /**\n * Set states of current drawing shape\n * @param {string} type - Shape type (ex: 'rect', 'circle', 'triangle')\n * @param {Object} [options] - Shape options\n * @param {(ShapeFillOption | string)} [options.fill] - {@link ShapeFillOption} or\n * Shape foreground color (ex: '#fff', 'transparent')\n * @param {string} [options.stoke] - Shape outline color\n * @param {number} [options.strokeWidth] - Shape outline width\n * @param {number} [options.width] - Width value (When type option is 'rect', this options can use)\n * @param {number} [options.height] - Height value (When type option is 'rect', this options can use)\n * @param {number} [options.rx] - Radius x value (When type option is 'circle', this options can use)\n * @param {number} [options.ry] - Radius y value (When type option is 'circle', this options can use)\n * @param {number} [options.isRegular] - Whether resizing shape has 1:1 ratio or not\n * @example\n * imageEditor.setDrawingShape('rect', {\n * fill: 'red',\n * width: 100,\n * height: 200\n * });\n * @example\n * imageEditor.setDrawingShape('rect', {\n * fill: {\n * type: 'filter',\n * filter: [{blur: 0.3}, {pixelate: 20}]\n * },\n * width: 100,\n * height: 200\n * });\n * @example\n * imageEditor.setDrawingShape('circle', {\n * fill: 'transparent',\n * stroke: 'blue',\n * strokeWidth: 3,\n * rx: 10,\n * ry: 100\n * });\n * @example\n * imageEditor.setDrawingShape('triangle', { // When resizing, the shape keep the 1:1 ratio\n * width: 1,\n * height: 1,\n * isRegular: true\n * });\n * @example\n * imageEditor.setDrawingShape('circle', { // When resizing, the shape keep the 1:1 ratio\n * rx: 10,\n * ry: 10,\n * isRegular: true\n * });\n */\n setDrawingShape(type, options) {\n this._graphics.setDrawingShape(type, options);\n }\n\n setDrawingIcon(type, iconColor) {\n this._graphics.setIconStyle(type, iconColor);\n }\n\n /**\n * Add shape\n * @param {string} type - Shape type (ex: 'rect', 'circle', 'triangle')\n * @param {Object} options - Shape options\n * @param {(ShapeFillOption | string)} [options.fill] - {@link ShapeFillOption} or\n * Shape foreground color (ex: '#fff', 'transparent')\n * @param {string} [options.stroke] - Shape outline color\n * @param {number} [options.strokeWidth] - Shape outline width\n * @param {number} [options.width] - Width value (When type option is 'rect', this options can use)\n * @param {number} [options.height] - Height value (When type option is 'rect', this options can use)\n * @param {number} [options.rx] - Radius x value (When type option is 'circle', this options can use)\n * @param {number} [options.ry] - Radius y value (When type option is 'circle', this options can use)\n * @param {number} [options.left] - Shape x position\n * @param {number} [options.top] - Shape y position\n * @param {boolean} [options.isRegular] - Whether resizing shape has 1:1 ratio or not\n * @returns {Promise}\n * @example\n * imageEditor.addShape('rect', {\n * fill: 'red',\n * stroke: 'blue',\n * strokeWidth: 3,\n * width: 100,\n * height: 200,\n * left: 10,\n * top: 10,\n * isRegular: true\n * });\n * @example\n * imageEditor.addShape('circle', {\n * fill: 'red',\n * stroke: 'blue',\n * strokeWidth: 3,\n * rx: 10,\n * ry: 100,\n * isRegular: false\n * }).then(objectProps => {\n * console.log(objectProps.id);\n * });\n * @example\n * imageEditor.addShape('rect', {\n * fill: {\n * type: 'filter',\n * filter: [{blur: 0.3}, {pixelate: 20}]\n * },\n * stroke: 'blue',\n * strokeWidth: 3,\n * rx: 10,\n * ry: 100,\n * isRegular: false\n * }).then(objectProps => {\n * console.log(objectProps.id);\n * });\n */\n addShape(type, options) {\n options = options || {};\n\n this._setPositions(options);\n\n return this.execute(commands.ADD_SHAPE, type, options);\n }\n\n /**\n * Change shape\n * @param {number} id - object id\n * @param {Object} options - Shape options\n * @param {(ShapeFillOption | string)} [options.fill] - {@link ShapeFillOption} or\n * Shape foreground color (ex: '#fff', 'transparent')\n * @param {string} [options.stroke] - Shape outline color\n * @param {number} [options.strokeWidth] - Shape outline width\n * @param {number} [options.width] - Width value (When type option is 'rect', this options can use)\n * @param {number} [options.height] - Height value (When type option is 'rect', this options can use)\n * @param {number} [options.rx] - Radius x value (When type option is 'circle', this options can use)\n * @param {number} [options.ry] - Radius y value (When type option is 'circle', this options can use)\n * @param {boolean} [options.isRegular] - Whether resizing shape has 1:1 ratio or not\n * @param {boolean} isSilent - is silent execution or not\n * @returns {Promise}\n * @example\n * // call after selecting shape object on canvas\n * imageEditor.changeShape(id, { // change rectagle or triangle\n * fill: 'red',\n * stroke: 'blue',\n * strokeWidth: 3,\n * width: 100,\n * height: 200\n * });\n * @example\n * // call after selecting shape object on canvas\n * imageEditor.changeShape(id, { // change circle\n * fill: 'red',\n * stroke: 'blue',\n * strokeWidth: 3,\n * rx: 10,\n * ry: 100\n * });\n */\n changeShape(id, options, isSilent) {\n const executeMethodName = isSilent ? 'executeSilent' : 'execute';\n\n return this[executeMethodName](commands.CHANGE_SHAPE, id, options);\n }\n\n /**\n * Add text on image\n * @param {string} text - Initial input text\n * @param {Object} [options] Options for generating text\n * @param {Object} [options.styles] Initial styles\n * @param {string} [options.styles.fill] Color\n * @param {string} [options.styles.fontFamily] Font type for text\n * @param {number} [options.styles.fontSize] Size\n * @param {string} [options.styles.fontStyle] Type of inclination (normal / italic)\n * @param {string} [options.styles.fontWeight] Type of thicker or thinner looking (normal / bold)\n * @param {string} [options.styles.textAlign] Type of text align (left / center / right)\n * @param {string} [options.styles.textDecoration] Type of line (underline / line-through / overline)\n * @param {{x: number, y: number}} [options.position] - Initial position\n * @param {boolean} [options.autofocus] - text autofocus, default is true\n * @returns {Promise}\n * @example\n * imageEditor.addText('init text');\n * @example\n * imageEditor.addText('init text', {\n * styles: {\n * fill: '#000',\n * fontSize: 20,\n * fontWeight: 'bold'\n * },\n * position: {\n * x: 10,\n * y: 10\n * }\n * }).then(objectProps => {\n * console.log(objectProps.id);\n * });\n */\n addText(text, options) {\n text = text || '';\n options = options || {};\n\n return this.execute(commands.ADD_TEXT, text, options);\n }\n\n /**\n * Change contents of selected text object on image\n * @param {number} id - object id\n * @param {string} text - Changing text\n * @returns {Promise}\n * @example\n * imageEditor.changeText(id, 'change text');\n */\n changeText(id, text) {\n text = text || '';\n\n return this.execute(commands.CHANGE_TEXT, id, text);\n }\n\n /**\n * Set style\n * @param {number} id - object id\n * @param {Object} styleObj - text styles\n * @param {string} [styleObj.fill] Color\n * @param {string} [styleObj.fontFamily] Font type for text\n * @param {number} [styleObj.fontSize] Size\n * @param {string} [styleObj.fontStyle] Type of inclination (normal / italic)\n * @param {string} [styleObj.fontWeight] Type of thicker or thinner looking (normal / bold)\n * @param {string} [styleObj.textAlign] Type of text align (left / center / right)\n * @param {string} [styleObj.textDecoration] Type of line (underline / line-through / overline)\n * @param {boolean} isSilent - is silent execution or not\n * @returns {Promise}\n * @example\n * imageEditor.changeTextStyle(id, {\n * fontStyle: 'italic'\n * });\n */\n changeTextStyle(id, styleObj, isSilent) {\n const executeMethodName = isSilent ? 'executeSilent' : 'execute';\n\n return this[executeMethodName](commands.CHANGE_TEXT_STYLE, id, styleObj);\n }\n\n /**\n * change text mode\n * @param {string} type - change type\n * @private\n */\n _changeActivateMode(type) {\n if (type !== 'ICON' && this.getDrawingMode() !== type) {\n this.startDrawingMode(type);\n }\n }\n\n /**\n * 'textChanged' event handler\n * @param {Object} target - changed text object\n * @private\n */\n _onTextChanged(target) {\n this.fire(events.TEXT_CHANGED, target);\n }\n\n /**\n * 'iconCreateResize' event handler\n * @param {Object} originPointer origin pointer\n * @param {Number} originPointer.x x position\n * @param {Number} originPointer.y y position\n * @private\n */\n _onIconCreateResize(originPointer) {\n this.fire(events.ICON_CREATE_RESIZE, originPointer);\n }\n\n /**\n * 'iconCreateEnd' event handler\n * @param {Object} originPointer origin pointer\n * @param {Number} originPointer.x x position\n * @param {Number} originPointer.y y position\n * @private\n */\n _onIconCreateEnd(originPointer) {\n this.fire(events.ICON_CREATE_END, originPointer);\n }\n\n /**\n * 'textEditing' event handler\n * @private\n */\n _onTextEditing() {\n /**\n * The event which starts to edit text object\n * @event ImageEditor#textEditing\n * @example\n * imageEditor.on('textEditing', function() {\n * console.log('text editing');\n * });\n */\n\n this.fire(events.TEXT_EDITING);\n }\n\n /**\n * Mousedown event handler in case of 'TEXT' drawing mode\n * @param {fabric.Event} event - Current mousedown event object\n * @private\n */\n _onAddText(event) {\n /**\n * The event when 'TEXT' drawing mode is enabled and click non-object area.\n * @event ImageEditor#addText\n * @param {Object} pos\n * @param {Object} pos.originPosition - Current position on origin canvas\n * @param {Number} pos.originPosition.x - x\n * @param {Number} pos.originPosition.y - y\n * @param {Object} pos.clientPosition - Current position on client area\n * @param {Number} pos.clientPosition.x - x\n * @param {Number} pos.clientPosition.y - y\n * @example\n * imageEditor.on('addText', function(pos) {\n * console.log('text position on canvas: ' + pos.originPosition);\n * console.log('text position on brwoser: ' + pos.clientPosition);\n * });\n */\n\n this.fire(events.ADD_TEXT, {\n originPosition: event.originPosition,\n clientPosition: event.clientPosition,\n });\n }\n\n /**\n * 'addObject' event handler\n * @param {Object} objectProps added object properties\n * @private\n */\n _onAddObject(objectProps) {\n const obj = this._graphics.getObject(objectProps.id);\n this._invoker.fire(events.EXECUTE_COMMAND, getObjectType(obj.type));\n this._pushAddObjectCommand(obj);\n }\n\n /**\n * 'objectAdded' event handler\n * @param {Object} objectProps added object properties\n * @private\n */\n _onObjectAdded(objectProps) {\n /**\n * The event when object added\n * @event ImageEditor#objectAdded\n * @param {ObjectProps} props - object properties\n * @example\n * imageEditor.on('objectAdded', function(props) {\n * console.log(props);\n * });\n */\n this.fire(OBJECT_ADDED, objectProps);\n\n /**\n * The event when object added (deprecated)\n * @event ImageEditor#addObjectAfter\n * @param {ObjectProps} props - object properties\n * @deprecated\n */\n this.fire(ADD_OBJECT_AFTER, objectProps);\n }\n\n /**\n * 'objectModified' event handler\n * @param {fabric.Object} obj - selection object\n * @private\n */\n _onObjectModified(obj) {\n if (obj.type !== OBJ_TYPE.CROPZONE) {\n this._invoker.fire(events.EXECUTE_COMMAND, getObjectType(obj.type));\n this._pushModifyObjectCommand(obj);\n }\n }\n\n /**\n * 'selectionCleared' event handler\n * @private\n */\n _selectionCleared() {\n this.fire(SELECTION_CLEARED);\n }\n\n /**\n * 'selectionCreated' event handler\n * @param {Object} eventTarget - Fabric object\n * @private\n */\n _selectionCreated(eventTarget) {\n this.fire(SELECTION_CREATED, eventTarget);\n }\n\n /**\n * Register custom icons\n * @param {{iconType: string, pathValue: string}} infos - Infos to register icons\n * @example\n * imageEditor.registerIcons({\n * customIcon: 'M 0 0 L 20 20 L 10 10 Z',\n * customArrow: 'M 60 0 L 120 60 H 90 L 75 45 V 180 H 45 V 45 L 30 60 H 0 Z'\n * });\n */\n registerIcons(infos) {\n this._graphics.registerPaths(infos);\n }\n\n /**\n * Change canvas cursor type\n * @param {string} cursorType - cursor type\n * @example\n * imageEditor.changeCursor('crosshair');\n */\n changeCursor(cursorType) {\n this._graphics.changeCursor(cursorType);\n }\n\n /**\n * Add icon on canvas\n * @param {string} type - Icon type ('arrow', 'cancel', custom icon name)\n * @param {Object} options - Icon options\n * @param {string} [options.fill] - Icon foreground color\n * @param {number} [options.left] - Icon x position\n * @param {number} [options.top] - Icon y position\n * @returns {Promise}\n * @example\n * imageEditor.addIcon('arrow'); // The position is center on canvas\n * @example\n * imageEditor.addIcon('arrow', {\n * left: 100,\n * top: 100\n * }).then(objectProps => {\n * console.log(objectProps.id);\n * });\n */\n addIcon(type, options) {\n options = options || {};\n\n this._setPositions(options);\n\n return this.execute(commands.ADD_ICON, type, options);\n }\n\n /**\n * Change icon color\n * @param {number} id - object id\n * @param {string} color - Color for icon\n * @returns {Promise}\n * @example\n * imageEditor.changeIconColor(id, '#000000');\n */\n changeIconColor(id, color) {\n return this.execute(commands.CHANGE_ICON_COLOR, id, color);\n }\n\n /**\n * Remove an object or group by id\n * @param {number} id - object id\n * @returns {Promise}\n * @example\n * imageEditor.removeObject(id);\n */\n removeObject(id) {\n const { type } = this._graphics.getObject(id);\n\n return this.execute(commands.REMOVE_OBJECT, id, getObjectType(type));\n }\n\n /**\n * Whether it has the filter or not\n * @param {string} type - Filter type\n * @returns {boolean} true if it has the filter\n */\n hasFilter(type) {\n return this._graphics.hasFilter(type);\n }\n\n /**\n * Remove filter on canvas image\n * @param {string} type - Filter type\n * @returns {Promise}\n * @example\n * imageEditor.removeFilter('Grayscale').then(obj => {\n * console.log('filterType: ', obj.type);\n * console.log('actType: ', obj.action);\n * }).catch(message => {\n * console.log('error: ', message);\n * });\n */\n removeFilter(type) {\n return this.execute(commands.REMOVE_FILTER, type);\n }\n\n /**\n * Apply filter on canvas image\n * @param {string} type - Filter type\n * @param {object} options - Options to apply filter\n * @param {boolean} isSilent - is silent execution or not\n * @returns {Promise}\n * @example\n * imageEditor.applyFilter('Grayscale');\n * @example\n * imageEditor.applyFilter('mask', {maskObjId: id}).then(obj => {\n * console.log('filterType: ', obj.type);\n * console.log('actType: ', obj.action);\n * }).catch(message => {\n * console.log('error: ', message);\n * });;\n */\n applyFilter(type, options, isSilent) {\n const executeMethodName = isSilent ? 'executeSilent' : 'execute';\n\n return this[executeMethodName](commands.APPLY_FILTER, type, options);\n }\n\n /**\n * Get data url\n * @param {Object} options - options for toDataURL\n * @param {String} [options.format=png] The format of the output image. Either \"jpeg\" or \"png\"\n * @param {Number} [options.quality=1] Quality level (0..1). Only used for jpeg.\n * @param {Number} [options.multiplier=1] Multiplier to scale by\n * @param {Number} [options.left] Cropping left offset. Introduced in fabric v1.2.14\n * @param {Number} [options.top] Cropping top offset. Introduced in fabric v1.2.14\n * @param {Number} [options.width] Cropping width. Introduced in fabric v1.2.14\n * @param {Number} [options.height] Cropping height. Introduced in fabric v1.2.14\n * @returns {string} A DOMString containing the requested data URI\n * @example\n * imgEl.src = imageEditor.toDataURL();\n *\n * imageEditor.loadImageFromURL(imageEditor.toDataURL(), 'FilterImage').then(() => {\n * imageEditor.addImageObject(imgUrl);\n * });\n */\n toDataURL(options) {\n return this._graphics.toDataURL(options);\n }\n\n /**\n * Get image name\n * @returns {string} image name\n * @example\n * console.log(imageEditor.getImageName());\n */\n getImageName() {\n return this._graphics.getImageName();\n }\n\n /**\n * Clear undoStack\n * @example\n * imageEditor.clearUndoStack();\n */\n clearUndoStack() {\n this._invoker.clearUndoStack();\n }\n\n /**\n * Clear redoStack\n * @example\n * imageEditor.clearRedoStack();\n */\n clearRedoStack() {\n this._invoker.clearRedoStack();\n }\n\n /**\n * Whehter the undo stack is empty or not\n * @returns {boolean}\n * imageEditor.isEmptyUndoStack();\n */\n isEmptyUndoStack() {\n return this._invoker.isEmptyUndoStack();\n }\n\n /**\n * Whehter the redo stack is empty or not\n * @returns {boolean}\n * imageEditor.isEmptyRedoStack();\n */\n isEmptyRedoStack() {\n return this._invoker.isEmptyRedoStack();\n }\n\n /**\n * Resize canvas dimension\n * @param {{width: number, height: number}} dimension - Max width & height\n * @returns {Promise}\n */\n resizeCanvasDimension(dimension) {\n if (!dimension) {\n return Promise.reject(rejectMessages.invalidParameters);\n }\n\n return this.execute(commands.RESIZE_CANVAS_DIMENSION, dimension);\n }\n\n /**\n * Destroy\n */\n destroy() {\n this.stopDrawingMode();\n this._detachDomEvents();\n this._graphics.destroy();\n this._graphics = null;\n\n if (this.ui) {\n this.ui.destroy();\n }\n\n forEach(\n this,\n (value, key) => {\n this[key] = null;\n },\n this\n );\n }\n\n /**\n * Set position\n * @param {Object} options - Position options (left or top)\n * @private\n */\n _setPositions(options) {\n const centerPosition = this._graphics.getCenter();\n\n if (isUndefined(options.left)) {\n options.left = centerPosition.left;\n }\n\n if (isUndefined(options.top)) {\n options.top = centerPosition.top;\n }\n }\n\n /**\n * Set properties of active object\n * @param {number} id - object id\n * @param {Object} keyValue - key & value\n * @returns {Promise}\n * @example\n * imageEditor.setObjectProperties(id, {\n * left:100,\n * top:100,\n * width: 200,\n * height: 200,\n * opacity: 0.5\n * });\n */\n setObjectProperties(id, keyValue) {\n return this.execute(commands.SET_OBJECT_PROPERTIES, id, keyValue);\n }\n\n /**\n * Set properties of active object, Do not leave an invoke history.\n * @param {number} id - object id\n * @param {Object} keyValue - key & value\n * @example\n * imageEditor.setObjectPropertiesQuietly(id, {\n * left:100,\n * top:100,\n * width: 200,\n * height: 200,\n * opacity: 0.5\n * });\n */\n setObjectPropertiesQuietly(id, keyValue) {\n this._graphics.setObjectProperties(id, keyValue);\n }\n\n /**\n * Get properties of active object corresponding key\n * @param {number} id - object id\n * @param {Array|ObjectProps|string} keys - property's key\n * @returns {ObjectProps} properties if id is valid or null\n * @example\n * var props = imageEditor.getObjectProperties(id, 'left');\n * console.log(props);\n * @example\n * var props = imageEditor.getObjectProperties(id, ['left', 'top', 'width', 'height']);\n * console.log(props);\n * @example\n * var props = imageEditor.getObjectProperties(id, {\n * left: null,\n * top: null,\n * width: null,\n * height: null,\n * opacity: null\n * });\n * console.log(props);\n */\n getObjectProperties(id, keys) {\n const object = this._graphics.getObject(id);\n if (!object) {\n return null;\n }\n\n return this._graphics.getObjectProperties(id, keys);\n }\n\n /**\n * Get the canvas size\n * @returns {Object} {{width: number, height: number}} canvas size\n * @example\n * var canvasSize = imageEditor.getCanvasSize();\n * console.log(canvasSize.width);\n * console.height(canvasSize.height);\n */\n getCanvasSize() {\n return this._graphics.getCanvasSize();\n }\n\n /**\n * Get object position by originX, originY\n * @param {number} id - object id\n * @param {string} originX - can be 'left', 'center', 'right'\n * @param {string} originY - can be 'top', 'center', 'bottom'\n * @returns {Object} {{x:number, y: number}} position by origin if id is valid, or null\n * @example\n * var position = imageEditor.getObjectPosition(id, 'left', 'top');\n * console.log(position);\n */\n getObjectPosition(id, originX, originY) {\n return this._graphics.getObjectPosition(id, originX, originY);\n }\n\n /**\n * Set object position by originX, originY\n * @param {number} id - object id\n * @param {Object} posInfo - position object\n * @param {number} posInfo.x - x position\n * @param {number} posInfo.y - y position\n * @param {string} posInfo.originX - can be 'left', 'center', 'right'\n * @param {string} posInfo.originY - can be 'top', 'center', 'bottom'\n * @returns {Promise}\n * @example\n * // align the object to 'left', 'top'\n * imageEditor.setObjectPosition(id, {\n * x: 0,\n * y: 0,\n * originX: 'left',\n * originY: 'top'\n * });\n * @example\n * // align the object to 'right', 'top'\n * var canvasSize = imageEditor.getCanvasSize();\n * imageEditor.setObjectPosition(id, {\n * x: canvasSize.width,\n * y: 0,\n * originX: 'right',\n * originY: 'top'\n * });\n * @example\n * // align the object to 'left', 'bottom'\n * var canvasSize = imageEditor.getCanvasSize();\n * imageEditor.setObjectPosition(id, {\n * x: 0,\n * y: canvasSize.height,\n * originX: 'left',\n * originY: 'bottom'\n * });\n * @example\n * // align the object to 'right', 'bottom'\n * var canvasSize = imageEditor.getCanvasSize();\n * imageEditor.setObjectPosition(id, {\n * x: canvasSize.width,\n * y: canvasSize.height,\n * originX: 'right',\n * originY: 'bottom'\n * });\n */\n setObjectPosition(id, posInfo) {\n return this.execute(commands.SET_OBJECT_POSITION, id, posInfo);\n }\n}\n\naction.mixin(ImageEditor);\nCustomEvents.mixin(ImageEditor);\n\nexport default ImageEditor;\n","/**\n * @author NHN. FE Development Team \n * @fileoverview Command interface\n */\nimport snippet from 'tui-code-snippet';\nimport errorMessage from '@/factory/errorMessage';\n\nconst createMessage = errorMessage.create;\nconst errorTypes = errorMessage.types;\n\n/**\n * Command class\n * @class\n * @param {{name:function, execute: function, undo: function,\n * executeCallback: function, undoCallback: function}} actions - Command actions\n * @param {Array} args - passing arguments on execute, undo\n * @ignore\n */\nclass Command {\n constructor(actions, args) {\n /**\n * command name\n * @type {string}\n */\n this.name = actions.name;\n\n /**\n * arguments\n * @type {Array}\n */\n this.args = args;\n\n /**\n * Execute function\n * @type {function}\n */\n this.execute = actions.execute;\n\n /**\n * Undo function\n * @type {function}\n */\n this.undo = actions.undo;\n\n /**\n * executeCallback\n * @type {function}\n */\n this.executeCallback = actions.executeCallback || null;\n\n /**\n * undoCallback\n * @type {function}\n */\n this.undoCallback = actions.undoCallback || null;\n\n /**\n * data for undo\n * @type {Object}\n */\n this.undoData = {};\n }\n\n /**\n * Execute action\n * @param {Object.} compMap - Components injection\n * @abstract\n */\n execute() {\n throw new Error(createMessage(errorTypes.UN_IMPLEMENTATION, 'execute'));\n }\n\n /**\n * Undo action\n * @param {Object.} compMap - Components injection\n * @abstract\n */\n undo() {\n throw new Error(createMessage(errorTypes.UN_IMPLEMENTATION, 'undo'));\n }\n\n /**\n * command for redo if undoData exists\n * @returns {boolean} isRedo\n */\n get isRedo() {\n return Object.keys(this.undoData).length > 0;\n }\n\n /**\n * Set undoData action\n * @param {Object} undoData - maked undo data\n * @param {Object} cachedUndoDataForSilent - cached undo data\n * @param {boolean} isSilent - is silent execution or not\n * @returns {Object} cachedUndoDataForSilent\n */\n setUndoData(undoData, cachedUndoDataForSilent, isSilent) {\n if (cachedUndoDataForSilent) {\n undoData = cachedUndoDataForSilent;\n }\n\n if (!isSilent) {\n snippet.extend(this.undoData, undoData);\n cachedUndoDataForSilent = null;\n } else if (!cachedUndoDataForSilent) {\n cachedUndoDataForSilent = undoData;\n }\n\n return cachedUndoDataForSilent;\n }\n\n /**\n * Attach execute callabck\n * @param {function} callback - Callback after execution\n * @returns {Command} this\n */\n setExecuteCallback(callback) {\n this.executeCallback = callback;\n\n return this;\n }\n\n /**\n * Attach undo callback\n * @param {function} callback - Callback after undo\n * @returns {Command} this\n */\n setUndoCallback(callback) {\n this.undoCallback = callback;\n\n return this;\n }\n}\n\nexport default Command;\n","/**\n * @author NHN. FE Development Team \n * @fileoverview Component interface\n */\n\n/**\n * Component interface\n * @class\n * @param {string} name - component name\n * @param {Graphics} graphics - Graphics instance\n * @ignore\n */\nclass Component {\n constructor(name, graphics) {\n /**\n * Component name\n * @type {string}\n */\n this.name = name;\n\n /**\n * Graphics instance\n * @type {Graphics}\n */\n this.graphics = graphics;\n }\n\n /**\n * Fire Graphics event\n * @returns {Object} return value\n */\n fire(...args) {\n const context = this.graphics;\n\n return this.graphics.fire.apply(context, args);\n }\n\n /**\n * Save image(background) of canvas\n * @param {string} name - Name of image\n * @param {fabric.Image} oImage - Fabric image instance\n */\n setCanvasImage(name, oImage) {\n this.graphics.setCanvasImage(name, oImage);\n }\n\n /**\n * Returns canvas element of fabric.Canvas[[lower-canvas]]\n * @returns {HTMLCanvasElement}\n */\n getCanvasElement() {\n return this.graphics.getCanvasElement();\n }\n\n /**\n * Get fabric.Canvas instance\n * @returns {fabric.Canvas}\n */\n getCanvas() {\n return this.graphics.getCanvas();\n }\n\n /**\n * Get canvasImage (fabric.Image instance)\n * @returns {fabric.Image}\n */\n getCanvasImage() {\n return this.graphics.getCanvasImage();\n }\n\n /**\n * Get image name\n * @returns {string}\n */\n getImageName() {\n return this.graphics.getImageName();\n }\n\n /**\n * Get image editor\n * @returns {ImageEditor}\n */\n getEditor() {\n return this.graphics.getEditor();\n }\n\n /**\n * Return component name\n * @returns {string}\n */\n getName() {\n return this.name;\n }\n\n /**\n * Set image properties\n * @param {Object} setting - Image properties\n * @param {boolean} [withRendering] - If true, The changed image will be reflected in the canvas\n */\n setImageProperties(setting, withRendering) {\n this.graphics.setImageProperties(setting, withRendering);\n }\n\n /**\n * Set canvas dimension - css only\n * @param {Object} dimension - Canvas css dimension\n */\n setCanvasCssDimension(dimension) {\n this.graphics.setCanvasCssDimension(dimension);\n }\n\n /**\n * Set canvas dimension - css only\n * @param {Object} dimension - Canvas backstore dimension\n */\n setCanvasBackstoreDimension(dimension) {\n this.graphics.setCanvasBackstoreDimension(dimension);\n }\n\n /**\n * Adjust canvas dimension with scaling image\n */\n adjustCanvasDimension() {\n this.graphics.adjustCanvasDimension();\n }\n}\n\nexport default Component;\n","/**\n * @author NHN. FE Development Team \n * @fileoverview DrawingMode interface\n */\nimport errorMessage from '@/factory/errorMessage';\n\nconst createMessage = errorMessage.create;\nconst errorTypes = errorMessage.types;\n\n/**\n * DrawingMode interface\n * @class\n * @param {string} name - drawing mode name\n * @ignore\n */\nclass DrawingMode {\n constructor(name) {\n /**\n * the name of drawing mode\n * @type {string}\n */\n this.name = name;\n }\n\n /**\n * Get this drawing mode name;\n * @returns {string} drawing mode name\n */\n getName() {\n return this.name;\n }\n\n /**\n * start this drawing mode\n * @param {Object} options - drawing mode options\n * @abstract\n */\n start() {\n throw new Error(createMessage(errorTypes.UN_IMPLEMENTATION, 'start'));\n }\n\n /**\n * stop this drawing mode\n * @abstract\n */\n end() {\n throw new Error(createMessage(errorTypes.UN_IMPLEMENTATION, 'stop'));\n }\n}\n\nexport default DrawingMode;\n","/**\n * @author NHN. FE Development Team \n * @fileoverview Invoker - invoke commands\n */\nimport snippet from 'tui-code-snippet';\nimport commandFactory from '@/factory/command';\nimport { Promise } from '@/util';\nimport { eventNames, rejectMessages } from '@/consts';\n\nconst { isFunction, isString, CustomEvents } = snippet;\n\n/**\n * Invoker\n * @class\n * @ignore\n */\nclass Invoker {\n constructor() {\n /**\n * Undo stack\n * @type {Array.}\n * @private\n */\n this._undoStack = [];\n\n /**\n * Redo stack\n * @type {Array.}\n * @private\n */\n this._redoStack = [];\n\n /**\n * Lock-flag for executing command\n * @type {boolean}\n * @private\n */\n this._isLocked = false;\n\n this._isSilent = false;\n }\n\n /**\n * Invoke command execution\n * @param {Command} command - Command\n * @param {boolean} [isRedo=false] - check if command is redo\n * @returns {Promise}\n * @private\n */\n _invokeExecution(command, isRedo = false) {\n this.lock();\n\n let { args } = command;\n if (!args) {\n args = [];\n }\n\n return command\n .execute(...args)\n .then((value) => {\n if (!this._isSilent) {\n this.pushUndoStack(command);\n\n this.fire(isRedo ? eventNames.AFTER_REDO : eventNames.EXECUTE_COMMAND, command);\n }\n this.unlock();\n if (isFunction(command.executeCallback)) {\n command.executeCallback(value);\n }\n\n return value;\n })\n ['catch']((message) => {\n this.unlock();\n\n return Promise.reject(message);\n });\n }\n\n /**\n * Invoke command undo\n * @param {Command} command - Command\n * @returns {Promise}\n * @private\n */\n _invokeUndo(command) {\n this.lock();\n\n let { args } = command;\n if (!args) {\n args = [];\n }\n\n return command\n .undo(...args)\n .then((value) => {\n this.pushRedoStack(command);\n this.fire(eventNames.AFTER_UNDO, command);\n this.unlock();\n if (isFunction(command.undoCallback)) {\n command.undoCallback(value);\n }\n\n return value;\n })\n ['catch']((message) => {\n this.unlock();\n\n return Promise.reject(message);\n });\n }\n\n /**\n * fire REDO_STACK_CHANGED event\n * @private\n */\n _fireRedoStackChanged() {\n this.fire(eventNames.REDO_STACK_CHANGED, this._redoStack.length);\n }\n\n /**\n * fire UNDO_STACK_CHANGED event\n * @private\n */\n _fireUndoStackChanged() {\n this.fire(eventNames.UNDO_STACK_CHANGED, this._undoStack.length);\n }\n\n /**\n * Lock this invoker\n */\n lock() {\n this._isLocked = true;\n }\n\n /**\n * Unlock this invoker\n */\n unlock() {\n this._isLocked = false;\n }\n\n executeSilent(...args) {\n this._isSilent = true;\n\n return this.execute(...args, this._isSilent).then(() => {\n this._isSilent = false;\n });\n }\n\n /**\n * Invoke command\n * Store the command to the undoStack\n * Clear the redoStack\n * @param {String} commandName - Command name\n * @param {...*} args - Arguments for creating command\n * @returns {Promise}\n */\n execute(...args) {\n if (this._isLocked) {\n return Promise.reject(rejectMessages.isLock);\n }\n\n let [command] = args;\n if (isString(command)) {\n command = commandFactory.create(...args);\n }\n\n return this._invokeExecution(command).then((value) => {\n this.clearRedoStack();\n\n return value;\n });\n }\n\n /**\n * Undo command\n * @returns {Promise}\n */\n undo() {\n let command = this._undoStack.pop();\n let promise;\n let message = '';\n\n if (command && this._isLocked) {\n this.pushUndoStack(command, true);\n command = null;\n }\n if (command) {\n if (this.isEmptyUndoStack()) {\n this._fireUndoStackChanged();\n }\n promise = this._invokeUndo(command);\n } else {\n message = rejectMessages.undo;\n if (this._isLocked) {\n message = `${message} Because ${rejectMessages.isLock}`;\n }\n promise = Promise.reject(message);\n }\n\n return promise;\n }\n\n /**\n * Redo command\n * @returns {Promise}\n */\n redo() {\n let command = this._redoStack.pop();\n let promise;\n let message = '';\n\n if (command && this._isLocked) {\n this.pushRedoStack(command, true);\n command = null;\n }\n if (command) {\n if (this.isEmptyRedoStack()) {\n this._fireRedoStackChanged();\n }\n promise = this._invokeExecution(command, true);\n } else {\n message = rejectMessages.redo;\n if (this._isLocked) {\n message = `${message} Because ${rejectMessages.isLock}`;\n }\n promise = Promise.reject(message);\n }\n\n return promise;\n }\n\n /**\n * Push undo stack\n * @param {Command} command - command\n * @param {boolean} [isSilent] - Fire event or not\n */\n pushUndoStack(command, isSilent) {\n this._undoStack.push(command);\n if (!isSilent) {\n this._fireUndoStackChanged();\n }\n }\n\n /**\n * Push redo stack\n * @param {Command} command - command\n * @param {boolean} [isSilent] - Fire event or not\n */\n pushRedoStack(command, isSilent) {\n this._redoStack.push(command);\n if (!isSilent) {\n this._fireRedoStackChanged();\n }\n }\n\n /**\n * Return whether the redoStack is empty\n * @returns {boolean}\n */\n isEmptyRedoStack() {\n return this._redoStack.length === 0;\n }\n\n /**\n * Return whether the undoStack is empty\n * @returns {boolean}\n */\n isEmptyUndoStack() {\n return this._undoStack.length === 0;\n }\n\n /**\n * Clear undoStack\n */\n clearUndoStack() {\n if (!this.isEmptyUndoStack()) {\n this._undoStack = [];\n this._fireUndoStackChanged();\n }\n }\n\n /**\n * Clear redoStack\n */\n clearRedoStack() {\n if (!this.isEmptyRedoStack()) {\n this._redoStack = [];\n this._fireRedoStackChanged();\n }\n }\n}\n\nCustomEvents.mixin(Invoker);\n\nexport default Invoker;\n","// https://developer.mozilla.org/en-US/docs/Web/API/Element/closest\n// Any copyright is dedicated to the Public Domain. http://creativecommons.org/publicdomain/zero/1.0/if (!Element.prototype.matches)\nElement.prototype.matches =\n Element.prototype.msMatchesSelector || Element.prototype.webkitMatchesSelector;\n\nif (!Element.prototype.closest)\n Element.prototype.closest = function (s) {\n var el = this;\n if (!document.documentElement.contains(el)) return null;\n do {\n if (el.matches(s)) return el;\n el = el.parentElement || el.parentNode;\n } while (el !== null && el.nodeType === 1);\n return null;\n };\n\n/*\n * classList.js: Cross-browser full element.classList implementation.\n * 1.1.20170427\n *\n * By Eli Grey, http://eligrey.com\n * License: Dedicated to the public domain.\n * See https://github.com/eligrey/classList.js/blob/master/LICENSE.md\n */\n\n/*global self, document, DOMException */\n\n/*! @source http://purl.eligrey.com/github/classList.js/blob/master/classList.js */\n\nif ('document' in window.self) {\n // Full polyfill for browsers with no classList support\n // Including IE < Edge missing SVGElement.classList\n if (\n !('classList' in document.createElement('_')) ||\n (document.createElementNS &&\n !('classList' in document.createElementNS('http://www.w3.org/2000/svg', 'g')))\n ) {\n (function (view) {\n 'use strict';\n\n if (!('Element' in view)) return;\n\n var classListProp = 'classList',\n protoProp = 'prototype',\n elemCtrProto = view.Element[protoProp],\n objCtr = Object,\n strTrim =\n String[protoProp].trim ||\n function () {\n return this.replace(/^\\s+|\\s+$/g, '');\n },\n arrIndexOf =\n Array[protoProp].indexOf ||\n function (item) {\n var i = 0,\n len = this.length;\n for (; i < len; i++) {\n if (i in this && this[i] === item) {\n return i;\n }\n }\n return -1;\n },\n // Vendors: please allow content code to instantiate DOMExceptions\n DOMEx = function (type, message) {\n this.name = type;\n this.code = DOMException[type];\n this.message = message;\n },\n checkTokenAndGetIndex = function (classList, token) {\n if (token === '') {\n throw new DOMEx('SYNTAX_ERR', 'An invalid or illegal string was specified');\n }\n if (/\\s/.test(token)) {\n throw new DOMEx('INVALID_CHARACTER_ERR', 'String contains an invalid character');\n }\n return arrIndexOf.call(classList, token);\n },\n ClassList = function (elem) {\n var trimmedClasses = strTrim.call(elem.getAttribute('class') || ''),\n classes = trimmedClasses ? trimmedClasses.split(/\\s+/) : [],\n i = 0,\n len = classes.length;\n for (; i < len; i++) {\n this.push(classes[i]);\n }\n this._updateClassName = function () {\n elem.setAttribute('class', this.toString());\n };\n },\n classListProto = (ClassList[protoProp] = []),\n classListGetter = function () {\n return new ClassList(this);\n };\n // Most DOMException implementations don't allow calling DOMException's toString()\n // on non-DOMExceptions. Error's toString() is sufficient here.\n DOMEx[protoProp] = Error[protoProp];\n classListProto.item = function (i) {\n return this[i] || null;\n };\n classListProto.contains = function (token) {\n token += '';\n return checkTokenAndGetIndex(this, token) !== -1;\n };\n classListProto.add = function () {\n var tokens = arguments,\n i = 0,\n l = tokens.length,\n token,\n updated = false;\n do {\n token = tokens[i] + '';\n if (checkTokenAndGetIndex(this, token) === -1) {\n this.push(token);\n updated = true;\n }\n } while (++i < l);\n\n if (updated) {\n this._updateClassName();\n }\n };\n classListProto.remove = function () {\n var tokens = arguments,\n i = 0,\n l = tokens.length,\n token,\n updated = false,\n index;\n do {\n token = tokens[i] + '';\n index = checkTokenAndGetIndex(this, token);\n while (index !== -1) {\n this.splice(index, 1);\n updated = true;\n index = checkTokenAndGetIndex(this, token);\n }\n } while (++i < l);\n\n if (updated) {\n this._updateClassName();\n }\n };\n classListProto.toggle = function (token, force) {\n token += '';\n\n var result = this.contains(token),\n method = result ? force !== true && 'remove' : force !== false && 'add';\n if (method) {\n this[method](token);\n }\n\n if (force === true || force === false) {\n return force;\n } else {\n return !result;\n }\n };\n classListProto.toString = function () {\n return this.join(' ');\n };\n\n if (objCtr.defineProperty) {\n var classListPropDesc = {\n get: classListGetter,\n enumerable: true,\n configurable: true,\n };\n try {\n objCtr.defineProperty(elemCtrProto, classListProp, classListPropDesc);\n } catch (ex) {\n // IE 8 doesn't support enumerable:true\n // adding undefined to fight this issue https://github.com/eligrey/classList.js/issues/36\n // modernie IE8-MSW7 machine has IE8 8.0.6001.18702 and is affected\n if (ex.number === undefined || ex.number === -0x7ff5ec54) {\n classListPropDesc.enumerable = false;\n objCtr.defineProperty(elemCtrProto, classListProp, classListPropDesc);\n }\n }\n } else if (objCtr[protoProp].__defineGetter__) {\n elemCtrProto.__defineGetter__(classListProp, classListGetter);\n }\n })(window.self);\n }\n\n // There is full or partial native classList support, so just check if we need\n // to normalize the add/remove and toggle APIs.\n\n (function () {\n 'use strict';\n\n var testElement = document.createElement('_');\n\n testElement.classList.add('c1', 'c2');\n\n // Polyfill for IE 10/11 and Firefox <26, where classList.add and\n // classList.remove exist but support only one argument at a time.\n if (!testElement.classList.contains('c2')) {\n var createMethod = function (method) {\n var original = DOMTokenList.prototype[method];\n\n DOMTokenList.prototype[method] = function (token) {\n var i,\n len = arguments.length;\n\n for (i = 0; i < len; i++) {\n token = arguments[i];\n original.call(this, token);\n }\n };\n };\n createMethod('add');\n createMethod('remove');\n }\n\n testElement.classList.toggle('c3', false);\n\n // Polyfill for IE 10 and Firefox <24, where classList.toggle does not\n // support the second argument.\n if (testElement.classList.contains('c3')) {\n var _toggle = DOMTokenList.prototype.toggle;\n\n DOMTokenList.prototype.toggle = function (token, force) {\n if (1 in arguments && !this.contains(token) === !force) {\n return force;\n } else {\n return _toggle.call(this, token);\n }\n };\n }\n\n testElement = null;\n })();\n}\n\n/*!\n * @copyright Copyright (c) 2017 IcoMoon.io\n * @license Licensed under MIT license\n * See https://github.com/Keyamoon/svgxuse\n * @version 1.2.6\n */\n/*jslint browser: true */\n/*global XDomainRequest, MutationObserver, window */\n(function () {\n 'use strict';\n if (typeof window !== 'undefined' && window.addEventListener) {\n var cache = Object.create(null); // holds xhr objects to prevent multiple requests\n var checkUseElems;\n var tid; // timeout id\n var debouncedCheck = function () {\n clearTimeout(tid);\n tid = setTimeout(checkUseElems, 100);\n };\n var unobserveChanges = function () {\n return;\n };\n var observeChanges = function () {\n var observer;\n window.addEventListener('resize', debouncedCheck, false);\n window.addEventListener('orientationchange', debouncedCheck, false);\n if (window.MutationObserver) {\n observer = new MutationObserver(debouncedCheck);\n observer.observe(document.documentElement, {\n childList: true,\n subtree: true,\n attributes: true,\n });\n unobserveChanges = function () {\n try {\n observer.disconnect();\n window.removeEventListener('resize', debouncedCheck, false);\n window.removeEventListener('orientationchange', debouncedCheck, false);\n } catch (ignore) {}\n };\n } else {\n document.documentElement.addEventListener('DOMSubtreeModified', debouncedCheck, false);\n unobserveChanges = function () {\n document.documentElement.removeEventListener('DOMSubtreeModified', debouncedCheck, false);\n window.removeEventListener('resize', debouncedCheck, false);\n window.removeEventListener('orientationchange', debouncedCheck, false);\n };\n }\n };\n var createRequest = function (url) {\n // In IE 9, cross origin requests can only be sent using XDomainRequest.\n // XDomainRequest would fail if CORS headers are not set.\n // Therefore, XDomainRequest should only be used with cross origin requests.\n function getOrigin(loc) {\n var a;\n if (loc.protocol !== undefined) {\n a = loc;\n } else {\n a = document.createElement('a');\n a.href = loc;\n }\n return a.protocol.replace(/:/g, '') + a.host;\n }\n var Request;\n var origin;\n var origin2;\n if (window.XMLHttpRequest) {\n Request = new XMLHttpRequest();\n origin = getOrigin(location);\n origin2 = getOrigin(url);\n if (Request.withCredentials === undefined && origin2 !== '' && origin2 !== origin) {\n Request = XDomainRequest || undefined;\n } else {\n Request = XMLHttpRequest;\n }\n }\n return Request;\n };\n var xlinkNS = 'http://www.w3.org/1999/xlink';\n checkUseElems = function () {\n var base;\n var bcr;\n var fallback = ''; // optional fallback URL in case no base path to SVG file was given and no symbol definition was found.\n var hash;\n var href;\n var i;\n var inProgressCount = 0;\n var isHidden;\n var Request;\n var url;\n var uses;\n var xhr;\n function observeIfDone() {\n // If done with making changes, start watching for chagnes in DOM again\n inProgressCount -= 1;\n if (inProgressCount === 0) {\n // if all xhrs were resolved\n unobserveChanges(); // make sure to remove old handlers\n observeChanges(); // watch for changes to DOM\n }\n }\n function attrUpdateFunc(spec) {\n return function () {\n if (cache[spec.base] !== true) {\n spec.useEl.setAttributeNS(xlinkNS, 'xlink:href', '#' + spec.hash);\n if (spec.useEl.hasAttribute('href')) {\n spec.useEl.setAttribute('href', '#' + spec.hash);\n }\n }\n };\n }\n function onloadFunc(xhr) {\n return function () {\n var body = document.body;\n var x = document.createElement('x');\n var svg;\n xhr.onload = null;\n x.innerHTML = xhr.responseText;\n svg = x.getElementsByTagName('svg')[0];\n if (svg) {\n svg.setAttribute('aria-hidden', 'true');\n svg.style.position = 'absolute';\n svg.style.width = 0;\n svg.style.height = 0;\n svg.style.overflow = 'hidden';\n body.insertBefore(svg, body.firstChild);\n }\n observeIfDone();\n };\n }\n function onErrorTimeout(xhr) {\n return function () {\n xhr.onerror = null;\n xhr.ontimeout = null;\n observeIfDone();\n };\n }\n unobserveChanges(); // stop watching for changes to DOM\n // find all use elements\n uses = document.getElementsByTagName('use');\n for (i = 0; i < uses.length; i += 1) {\n try {\n bcr = uses[i].getBoundingClientRect();\n } catch (ignore) {\n // failed to get bounding rectangle of the use element\n bcr = false;\n }\n href =\n uses[i].getAttribute('href') ||\n uses[i].getAttributeNS(xlinkNS, 'href') ||\n uses[i].getAttribute('xlink:href');\n if (href && href.split) {\n url = href.split('#');\n } else {\n url = ['', ''];\n }\n base = url[0];\n hash = url[1];\n isHidden = bcr && bcr.left === 0 && bcr.right === 0 && bcr.top === 0 && bcr.bottom === 0;\n if (bcr && bcr.width === 0 && bcr.height === 0 && !isHidden) {\n // the use element is empty\n // if there is a reference to an external SVG, try to fetch it\n // use the optional fallback URL if there is no reference to an external SVG\n if (fallback && !base.length && hash && !document.getElementById(hash)) {\n base = fallback;\n }\n if (uses[i].hasAttribute('href')) {\n uses[i].setAttributeNS(xlinkNS, 'xlink:href', href);\n }\n if (base.length) {\n // schedule updating xlink:href\n xhr = cache[base];\n if (xhr !== true) {\n // true signifies that prepending the SVG was not required\n setTimeout(\n attrUpdateFunc({\n useEl: uses[i],\n base: base,\n hash: hash,\n }),\n 0\n );\n }\n if (xhr === undefined) {\n Request = createRequest(base);\n if (Request !== undefined) {\n xhr = new Request();\n cache[base] = xhr;\n xhr.onload = onloadFunc(xhr);\n xhr.onerror = onErrorTimeout(xhr);\n xhr.ontimeout = onErrorTimeout(xhr);\n xhr.open('GET', base);\n xhr.send();\n inProgressCount += 1;\n }\n }\n }\n } else {\n if (!isHidden) {\n if (cache[base] === undefined) {\n // remember this URL if the use element was not empty and no request was sent\n cache[base] = true;\n } else if (cache[base].onload) {\n // if it turns out that prepending the SVG is not necessary,\n // abort the in-progress xhr.\n cache[base].abort();\n delete cache[base].onload;\n cache[base] = true;\n }\n } else if (base.length && cache[base]) {\n setTimeout(\n attrUpdateFunc({\n useEl: uses[i],\n base: base,\n hash: hash,\n }),\n 0\n );\n }\n }\n }\n uses = '';\n inProgressCount += 1;\n observeIfDone();\n };\n var winLoad;\n winLoad = function () {\n window.removeEventListener('load', winLoad, false); // to prevent memory leaks\n tid = setTimeout(checkUseElems, 0);\n };\n if (document.readyState !== 'complete') {\n // The load event fires when all resources have finished loading, which allows detecting whether SVG use elements are empty.\n window.addEventListener('load', winLoad, false);\n } else {\n // No need to add a listener if the document is already loaded, initialize immediately.\n winLoad();\n }\n }\n})();\n","import snippet from 'tui-code-snippet';\nimport { getSelector, assignmentForDestroy, cls, getHistoryTitle, isSilentCommand } from '@/util';\nimport {\n ZOOM_HELP_MENUS,\n COMMAND_HELP_MENUS,\n DELETE_HELP_MENUS,\n eventNames,\n HELP_MENUS,\n} from '@/consts';\nimport mainContainer from '@/ui/template/mainContainer';\nimport controls from '@/ui/template/controls';\n\nimport Theme from '@/ui/theme/theme';\nimport Shape from '@/ui/shape';\nimport Crop from '@/ui/crop';\nimport Flip from '@/ui/flip';\nimport Rotate from '@/ui/rotate';\nimport Text from '@/ui/text';\nimport Mask from '@/ui/mask';\nimport Icon from '@/ui/icon';\nimport Draw from '@/ui/draw';\nimport Filter from '@/ui/filter';\nimport History from '@/ui/history';\nimport Locale from '@/ui/locale/locale';\n\nconst SUB_UI_COMPONENT = {\n Shape,\n Crop,\n Flip,\n Rotate,\n Text,\n Mask,\n Icon,\n Draw,\n Filter,\n};\n\nconst { CustomEvents } = snippet;\n\nconst BI_EXPRESSION_MINSIZE_WHEN_TOP_POSITION = '1300';\nconst HISTORY_MENU = 'history';\nconst HISTORY_PANEL_CLASS_NAME = 'tie-panel-history';\n\nconst CLASS_NAME_ON = 'on';\nconst ZOOM_BUTTON_TYPE = {\n ZOOM_IN: 'zoomIn',\n HAND: 'hand',\n};\n\n/**\n * Default UI Class\n * @class\n * @param {string|HTMLElement} element - Wrapper's element or selector\n * @param {Object} [options] - Ui setting options\n * @param {number} options.loadImage - Init default load image\n * @param {number} options.initMenu - Init start menu\n * @param {Boolean} [options.menuBarPosition=bottom] - Let\n * @param {Boolean} [options.applyCropSelectionStyle=false] - Let\n * @param {Boolean} [options.usageStatistics=false] - Use statistics or not\n * @param {Object} [options.uiSize] - ui size of editor\n * @param {string} options.uiSize.width - width of ui\n * @param {string} options.uiSize.height - height of ui\n * @param {Object} actions - ui action instance\n */\nclass Ui {\n constructor(element, options, actions) {\n this.options = this._initializeOption(options);\n this._actions = actions;\n this.submenu = false;\n this.imageSize = {};\n this.uiSize = {};\n this._locale = new Locale(this.options.locale);\n this.theme = new Theme(this.options.theme);\n this.eventHandler = {};\n this._submenuChangeTransection = false;\n this._selectedElement = null;\n this._mainElement = null;\n this._editorElementWrap = null;\n this._editorElement = null;\n this._menuBarElement = null;\n this._subMenuElement = null;\n this._makeUiElement(element);\n this._setUiSize();\n this._initMenuEvent = false;\n\n this._makeSubMenu();\n\n this._attachHistoryEvent();\n this._attachZoomEvent();\n }\n\n /**\n * Destroys the instance.\n */\n destroy() {\n this._removeUiEvent();\n this._destroyAllMenu();\n this._selectedElement.innerHTML = '';\n\n assignmentForDestroy(this);\n }\n\n /**\n * Set Default Selection for includeUI\n * @param {Object} option - imageEditor options\n * @returns {Object} - extends selectionStyle option\n * @ignore\n */\n setUiDefaultSelectionStyle(option) {\n return snippet.extend(\n {\n applyCropSelectionStyle: true,\n applyGroupSelectionStyle: true,\n selectionStyle: {\n cornerStyle: 'circle',\n cornerSize: 16,\n cornerColor: '#fff',\n cornerStrokeColor: '#fff',\n transparentCorners: false,\n lineWidth: 2,\n borderColor: '#fff',\n },\n },\n option\n );\n }\n\n /**\n * Change editor size\n * @param {Object} resizeInfo - ui & image size info\n * @param {Object} [resizeInfo.uiSize] - image size dimension\n * @param {string} resizeInfo.uiSize.width - ui width\n * @param {string} resizeInfo.uiSize.height - ui height\n * @param {Object} [resizeInfo.imageSize] - image size dimension\n * @param {Number} resizeInfo.imageSize.oldWidth - old width\n * @param {Number} resizeInfo.imageSize.oldHeight - old height\n * @param {Number} resizeInfo.imageSize.newWidth - new width\n * @param {Number} resizeInfo.imageSize.newHeight - new height\n * @example\n * // Change the image size and ui size, and change the affected ui state together.\n * imageEditor.ui.resizeEditor({\n * imageSize: {oldWidth: 100, oldHeight: 100, newWidth: 700, newHeight: 700},\n * uiSize: {width: 1000, height: 1000}\n * });\n * @example\n * // Apply the ui state while preserving the previous attribute (for example, if responsive Ui)\n * imageEditor.ui.resizeEditor();\n */\n resizeEditor({ uiSize, imageSize = this.imageSize } = {}) {\n if (imageSize !== this.imageSize) {\n this.imageSize = imageSize;\n }\n if (uiSize) {\n this._setUiSize(uiSize);\n }\n\n const { width, height } = this._getCanvasMaxDimension();\n const editorElementStyle = this._editorElement.style;\n const { menuBarPosition } = this.options;\n\n editorElementStyle.height = `${height}px`;\n editorElementStyle.width = `${width}px`;\n\n this._setEditorPosition(menuBarPosition);\n\n this._editorElementWrap.style.bottom = `0px`;\n this._editorElementWrap.style.top = `0px`;\n this._editorElementWrap.style.left = `0px`;\n this._editorElementWrap.style.width = `100%`;\n\n const selectElementClassList = this._selectedElement.classList;\n\n if (\n menuBarPosition === 'top' &&\n this._selectedElement.offsetWidth < BI_EXPRESSION_MINSIZE_WHEN_TOP_POSITION\n ) {\n selectElementClassList.add('tui-image-editor-top-optimization');\n } else {\n selectElementClassList.remove('tui-image-editor-top-optimization');\n }\n }\n\n /**\n * Toggle zoom button status\n * @param {string} type - type of zoom button\n */\n toggleZoomButtonStatus(type) {\n const targetClassList = this._buttonElements[type].classList;\n\n targetClassList.toggle(CLASS_NAME_ON);\n\n if (type === ZOOM_BUTTON_TYPE.ZOOM_IN) {\n this._buttonElements[ZOOM_BUTTON_TYPE.HAND].classList.remove(CLASS_NAME_ON);\n } else {\n this._buttonElements[ZOOM_BUTTON_TYPE.ZOOM_IN].classList.remove(CLASS_NAME_ON);\n }\n }\n\n /**\n * Turn off zoom-in button status\n */\n offZoomInButtonStatus() {\n const zoomInClassList = this._buttonElements[ZOOM_BUTTON_TYPE.ZOOM_IN].classList;\n\n zoomInClassList.remove(CLASS_NAME_ON);\n }\n\n /**\n * Change hand button status\n * @param {boolean} enabled - status to change\n */\n changeHandButtonStatus(enabled) {\n const handClassList = this._buttonElements[ZOOM_BUTTON_TYPE.HAND].classList;\n\n handClassList[enabled ? 'add' : 'remove'](CLASS_NAME_ON);\n }\n\n /**\n * Change help button status\n * @param {string} buttonType - target button type\n * @param {Boolean} enableStatus - enabled status\n * @ignore\n */\n changeHelpButtonEnabled(buttonType, enableStatus) {\n const buttonClassList = this._buttonElements[buttonType].classList;\n\n buttonClassList[enableStatus ? 'add' : 'remove']('enabled');\n }\n\n /**\n * Change delete button status\n * @param {Object} [options] - Ui setting options\n * @param {object} [options.loadImage] - Init default load image\n * @param {string} [options.initMenu] - Init start menu\n * @param {string} [options.menuBarPosition=bottom] - Let\n * @param {boolean} [options.applyCropSelectionStyle=false] - Let\n * @param {boolean} [options.usageStatistics=false] - Send statistics ping or not\n * @returns {Object} initialize option\n * @private\n */\n _initializeOption(options) {\n return snippet.extend(\n {\n loadImage: {\n path: '',\n name: '',\n },\n locale: {},\n menuIconPath: '',\n menu: ['crop', 'flip', 'rotate', 'draw', 'shape', 'icon', 'text', 'mask', 'filter'],\n initMenu: '',\n uiSize: {\n width: '100%',\n height: '100%',\n },\n menuBarPosition: 'bottom',\n },\n options\n );\n }\n\n /**\n * Set ui container size\n * @param {Object} uiSize - ui dimension\n * @param {string} uiSize.width - css width property\n * @param {string} uiSize.height - css height property\n * @private\n */\n _setUiSize(uiSize = this.options.uiSize) {\n const elementDimension = this._selectedElement.style;\n elementDimension.width = uiSize.width;\n elementDimension.height = uiSize.height;\n }\n\n /**\n * Make submenu dom element\n * @private\n */\n _makeSubMenu() {\n snippet.forEach(this.options.menu, (menuName) => {\n const SubComponentClass =\n SUB_UI_COMPONENT[menuName.replace(/^[a-z]/, ($0) => $0.toUpperCase())];\n\n // make menu element\n this._makeMenuElement(menuName);\n\n // menu btn element\n this._buttonElements[menuName] = this._menuBarElement.querySelector(`.tie-btn-${menuName}`);\n\n // submenu ui instance\n this[menuName] = new SubComponentClass(this._subMenuElement, {\n locale: this._locale,\n makeSvgIcon: this.theme.makeMenSvgIconSet.bind(this.theme),\n menuBarPosition: this.options.menuBarPosition,\n usageStatistics: this.options.usageStatistics,\n });\n });\n }\n\n /**\n * Attach history event\n * @private\n */\n _attachHistoryEvent() {\n this.on(eventNames.EXECUTE_COMMAND, this._addHistory.bind(this));\n this.on(eventNames.AFTER_UNDO, this._selectPrevHistory.bind(this));\n this.on(eventNames.AFTER_REDO, this._selectNextHistory.bind(this));\n }\n\n /**\n * Attach zoom event\n * @private\n */\n _attachZoomEvent() {\n this.on(eventNames.HAND_STARTED, () => {\n this.offZoomInButtonStatus();\n this.changeHandButtonStatus(true);\n });\n this.on(eventNames.HAND_STOPPED, () => this.changeHandButtonStatus(false));\n }\n\n /**\n * Make primary ui dom element\n * @param {string|HTMLElement} element - Wrapper's element or selector\n * @private\n */\n _makeUiElement(element) {\n let selectedElement;\n\n window.snippet = snippet;\n\n if (element.nodeType) {\n selectedElement = element;\n } else {\n selectedElement = document.querySelector(element);\n }\n const selector = getSelector(selectedElement);\n\n selectedElement.classList.add('tui-image-editor-container');\n selectedElement.innerHTML =\n controls({\n locale: this._locale,\n biImage: this.theme.getStyle('common.bi'),\n loadButtonStyle: this.theme.getStyle('loadButton'),\n downloadButtonStyle: this.theme.getStyle('downloadButton'),\n menuBarPosition: this.options.menuBarPosition,\n }) +\n mainContainer({\n locale: this._locale,\n biImage: this.theme.getStyle('common.bi'),\n commonStyle: this.theme.getStyle('common'),\n headerStyle: this.theme.getStyle('header'),\n loadButtonStyle: this.theme.getStyle('loadButton'),\n downloadButtonStyle: this.theme.getStyle('downloadButton'),\n submenuStyle: this.theme.getStyle('submenu'),\n });\n\n this._selectedElement = selectedElement;\n this._selectedElement.classList.add(this.options.menuBarPosition);\n\n this._mainElement = selector('.tui-image-editor-main');\n this._editorElementWrap = selector('.tui-image-editor-wrap');\n this._editorElement = selector('.tui-image-editor');\n this._helpMenuBarElement = selector('.tui-image-editor-help-menu');\n this._menuBarElement = selector('.tui-image-editor-menu');\n this._subMenuElement = selector('.tui-image-editor-submenu');\n this._buttonElements = {\n download: this._selectedElement.querySelectorAll('.tui-image-editor-download-btn'),\n load: this._selectedElement.querySelectorAll('.tui-image-editor-load-btn'),\n };\n\n this._addHelpMenus();\n\n this._historyMenu = new History(this._buttonElements[HISTORY_MENU], {\n locale: this._locale,\n makeSvgIcon: this.theme.makeMenSvgIconSet.bind(this.theme),\n });\n\n this._activateZoomMenus();\n }\n\n /**\n * Activate help menus for zoom.\n * @private\n */\n _activateZoomMenus() {\n snippet.forEach(ZOOM_HELP_MENUS, (menu) => {\n this.changeHelpButtonEnabled(menu, true);\n });\n }\n\n /**\n * make array for help menu output, including partitions.\n * @returns {Array}\n * @private\n */\n _makeHelpMenuWithPartition() {\n return [...ZOOM_HELP_MENUS, '', ...COMMAND_HELP_MENUS, '', ...DELETE_HELP_MENUS];\n }\n\n /**\n * Add help menu\n * @private\n */\n _addHelpMenus() {\n const helpMenuWithPartition = this._makeHelpMenuWithPartition();\n\n snippet.forEach(helpMenuWithPartition, (menuName) => {\n if (!menuName) {\n this._makeMenuPartitionElement();\n } else {\n this._makeMenuElement(menuName, ['normal', 'disabled', 'hover'], 'help');\n\n this._buttonElements[menuName] = this._helpMenuBarElement.querySelector(\n `.tie-btn-${menuName}`\n );\n }\n });\n }\n\n /**\n * Make menu partition element\n * @private\n */\n _makeMenuPartitionElement() {\n const partitionElement = document.createElement('li');\n const partitionInnerElement = document.createElement('div');\n partitionElement.className = cls('item');\n partitionInnerElement.className = cls('icpartition');\n partitionElement.appendChild(partitionInnerElement);\n\n this._helpMenuBarElement.appendChild(partitionElement);\n }\n\n /**\n * Make menu button element\n * @param {string} menuName - menu name\n * @param {Array} useIconTypes - Possible values are \\['normal', 'active', 'hover', 'disabled'\\]\n * @param {string} menuType - 'normal' or 'help'\n * @private\n */\n _makeMenuElement(menuName, useIconTypes = ['normal', 'active', 'hover'], menuType = 'normal') {\n const btnElement = document.createElement('li');\n const menuItemHtml = this.theme.makeMenSvgIconSet(useIconTypes, menuName);\n\n this._addTooltipAttribute(btnElement, menuName);\n btnElement.className = `tie-btn-${menuName} ${cls('item')} ${menuType}`;\n btnElement.innerHTML = menuItemHtml;\n\n if (menuType === 'normal') {\n this._menuBarElement.appendChild(btnElement);\n } else {\n this._helpMenuBarElement.appendChild(btnElement);\n }\n }\n\n /**\n * Add help action event\n * @private\n */\n _addHelpActionEvent() {\n snippet.forEach(HELP_MENUS, (helpName) => {\n this.eventHandler[helpName] = (event) => this._actions.main[helpName](event);\n this._buttonElements[helpName].addEventListener('click', this.eventHandler[helpName]);\n });\n }\n\n /**\n * Remove help action event\n * @private\n */\n _removeHelpActionEvent() {\n snippet.forEach(HELP_MENUS, (helpName) => {\n this._buttonElements[helpName].removeEventListener('click', this.eventHandler[helpName]);\n });\n }\n\n /**\n * Add history\n * @param {Command|string} command - command or command name\n */\n _addHistory(command) {\n if (!isSilentCommand(command)) {\n const historyTitle =\n typeof command === 'string' ? { name: command } : getHistoryTitle(command);\n\n this._historyMenu.add(historyTitle);\n }\n }\n\n /**\n * Init history\n */\n initHistory() {\n this._historyMenu.init();\n }\n\n /**\n * Clear history\n */\n clearHistory() {\n this._historyMenu.clear();\n }\n\n /**\n * Select prev history\n */\n _selectPrevHistory() {\n this._historyMenu.prev();\n }\n\n /**\n * Select next history\n */\n _selectNextHistory() {\n this._historyMenu.next();\n }\n\n /**\n * Toggle history menu\n * @param {object} event - event object\n */\n toggleHistoryMenu(event) {\n const { target } = event;\n const item = target.closest(`.${HISTORY_PANEL_CLASS_NAME}`);\n\n if (item) {\n return;\n }\n\n const historyButtonClassList = this._buttonElements[HISTORY_MENU].classList;\n\n historyButtonClassList.toggle('opened');\n }\n\n /**\n * Add attribute for menu tooltip\n * @param {HTMLElement} element - menu element\n * @param {string} tooltipName - tooltipName\n * @private\n */\n _addTooltipAttribute(element, tooltipName) {\n element.setAttribute(\n 'tooltip-content',\n this._locale.localize(tooltipName.replace(/^[a-z]/g, ($0) => $0.toUpperCase()))\n );\n }\n\n /**\n * Add download event\n * @private\n */\n _addDownloadEvent() {\n this.eventHandler.download = () => this._actions.main.download();\n snippet.forEach(this._buttonElements.download, (element) => {\n element.addEventListener('click', this.eventHandler.download);\n });\n }\n\n _removeDownloadEvent() {\n snippet.forEach(this._buttonElements.download, (element) => {\n element.removeEventListener('click', this.eventHandler.download);\n });\n }\n\n /**\n * Add load event\n * @private\n */\n _addLoadEvent() {\n this.eventHandler.loadImage = (event) => this._actions.main.load(event.target.files[0]);\n\n snippet.forEach(this._buttonElements.load, (element) => {\n element.addEventListener('change', this.eventHandler.loadImage);\n });\n }\n\n /**\n * Remove load event\n * @private\n */\n _removeLoadEvent() {\n snippet.forEach(this._buttonElements.load, (element) => {\n element.removeEventListener('change', this.eventHandler.loadImage);\n });\n }\n\n /**\n * Add menu event\n * @param {string} menuName - menu name\n * @private\n */\n _addMainMenuEvent(menuName) {\n this.eventHandler[menuName] = () => this.changeMenu(menuName);\n this._buttonElements[menuName].addEventListener('click', this.eventHandler[menuName]);\n }\n\n /**\n * Add menu event\n * @param {string} menuName - menu name\n * @private\n */\n _addSubMenuEvent(menuName) {\n this[menuName].addEvent(this._actions[menuName]);\n }\n\n /**\n * Add menu event\n * @private\n */\n _addMenuEvent() {\n snippet.forEach(this.options.menu, (menuName) => {\n this._addMainMenuEvent(menuName);\n this._addSubMenuEvent(menuName);\n });\n }\n\n /**\n * Remove menu event\n * @private\n */\n _removeMainMenuEvent() {\n snippet.forEach(this.options.menu, (menuName) => {\n this._buttonElements[menuName].removeEventListener('click', this.eventHandler[menuName]);\n });\n }\n\n /**\n * Get editor area element\n * @returns {HTMLElement} editor area html element\n * @ignore\n */\n getEditorArea() {\n return this._editorElement;\n }\n\n /**\n * Add event for menu items\n * @ignore\n */\n activeMenuEvent() {\n if (this._initMenuEvent) {\n return;\n }\n\n this._addHelpActionEvent();\n this._addDownloadEvent();\n this._addMenuEvent();\n this._initMenu();\n this._historyMenu.addEvent(this._actions.history);\n this._initMenuEvent = true;\n }\n\n /**\n * Remove ui event\n * @private\n */\n _removeUiEvent() {\n this._removeHelpActionEvent();\n this._removeDownloadEvent();\n this._removeLoadEvent();\n this._removeMainMenuEvent();\n this._historyMenu.removeEvent();\n }\n\n /**\n * Destroy all menu instance\n * @private\n */\n _destroyAllMenu() {\n snippet.forEach(this.options.menu, (menuName) => {\n this[menuName].destroy();\n });\n\n this._historyMenu.destroy();\n }\n\n /**\n * Init canvas\n * @ignore\n */\n initCanvas() {\n const loadImageInfo = this._getLoadImage();\n if (loadImageInfo.path) {\n this._actions.main.initLoadImage(loadImageInfo.path, loadImageInfo.name).then(() => {\n this.activeMenuEvent();\n });\n }\n\n this._addLoadEvent();\n\n const gridVisual = document.createElement('div');\n\n gridVisual.className = cls('grid-visual');\n const grid = `\n \n \n \n
      `;\n gridVisual.innerHTML = grid;\n this._editorContainerElement = this._editorElement.querySelector(\n '.tui-image-editor-canvas-container'\n );\n this._editorContainerElement.appendChild(gridVisual);\n }\n\n /**\n * get editor area element\n * @returns {Object} load image option\n * @private\n */\n _getLoadImage() {\n return this.options.loadImage;\n }\n\n /**\n * change menu\n * @param {string} menuName - menu name\n * @param {boolean} toggle - whether toogle or not\n * @param {boolean} discardSelection - discard selection\n * @ignore\n */\n changeMenu(menuName, toggle = true, discardSelection = true) {\n if (!this._submenuChangeTransection) {\n this._submenuChangeTransection = true;\n this._changeMenu(menuName, toggle, discardSelection);\n this._submenuChangeTransection = false;\n }\n }\n\n /**\n * change menu\n * @param {string} menuName - menu name\n * @param {boolean} toggle - whether toggle or not\n * @param {boolean} discardSelection - discard selection\n * @private\n */\n _changeMenu(menuName, toggle, discardSelection) {\n if (this.submenu) {\n this._buttonElements[this.submenu].classList.remove('active');\n this._mainElement.classList.remove(`tui-image-editor-menu-${this.submenu}`);\n if (discardSelection) {\n this._actions.main.discardSelection();\n }\n this._actions.main.changeSelectableAll(true);\n this[this.submenu].changeStandbyMode();\n }\n\n if (this.submenu === menuName && toggle) {\n this.submenu = null;\n } else {\n this._buttonElements[menuName].classList.add('active');\n this._mainElement.classList.add(`tui-image-editor-menu-${menuName}`);\n this.submenu = menuName;\n this[this.submenu].changeStartMode();\n }\n\n this.resizeEditor();\n }\n\n /**\n * Init menu\n * @private\n */\n _initMenu() {\n if (this.options.initMenu) {\n const evt = document.createEvent('MouseEvents');\n evt.initEvent('click', true, false);\n this._buttonElements[this.options.initMenu].dispatchEvent(evt);\n }\n\n if (this.icon) {\n this.icon.registerDefaultIcon();\n }\n }\n\n /**\n * Get canvas max Dimension\n * @returns {Object} - width & height of editor\n * @private\n */\n _getCanvasMaxDimension() {\n const { maxWidth, maxHeight } = this._editorContainerElement.style;\n const width = parseFloat(maxWidth);\n const height = parseFloat(maxHeight);\n\n return {\n width,\n height,\n };\n }\n\n /**\n * Set editor position\n * @param {string} menuBarPosition - top or right or bottom or left\n * @private\n */\n // eslint-disable-next-line complexity\n _setEditorPosition(menuBarPosition) {\n const { width, height } = this._getCanvasMaxDimension();\n const editorElementStyle = this._editorElement.style;\n let top = 0;\n let left = 0;\n\n if (this.submenu) {\n if (menuBarPosition === 'bottom') {\n if (height > this._editorElementWrap.scrollHeight - 150) {\n top = (height - this._editorElementWrap.scrollHeight) / 2;\n } else {\n top = (150 / 2) * -1;\n }\n } else if (menuBarPosition === 'top') {\n if (height > this._editorElementWrap.offsetHeight - 150) {\n top = 150 / 2 - (height - (this._editorElementWrap.offsetHeight - 150)) / 2;\n } else {\n top = 150 / 2;\n }\n } else if (menuBarPosition === 'left') {\n if (width > this._editorElementWrap.offsetWidth - 248) {\n left = 248 / 2 - (width - (this._editorElementWrap.offsetWidth - 248)) / 2;\n } else {\n left = 248 / 2;\n }\n } else if (menuBarPosition === 'right') {\n if (width > this._editorElementWrap.scrollWidth - 248) {\n left = (width - this._editorElementWrap.scrollWidth) / 2;\n } else {\n left = (248 / 2) * -1;\n }\n }\n }\n editorElementStyle.top = `${top}px`;\n editorElementStyle.left = `${left}px`;\n }\n}\n\nCustomEvents.mixin(Ui);\n\nexport default Ui;\n","import snippet from 'tui-code-snippet';\nimport Submenu from '@/ui/submenuBase';\nimport templateHtml from '@/ui/template/submenu/crop';\nimport { assignmentForDestroy } from '@/util';\n\n/**\n * Crop ui class\n * @class\n * @ignore\n */\nclass Crop extends Submenu {\n constructor(subMenuElement, { locale, makeSvgIcon, menuBarPosition, usageStatistics }) {\n super(subMenuElement, {\n locale,\n name: 'crop',\n makeSvgIcon,\n menuBarPosition,\n templateHtml,\n usageStatistics,\n });\n\n this.status = 'active';\n\n this._els = {\n apply: this.selector('.tie-crop-button .apply'),\n cancel: this.selector('.tie-crop-button .cancel'),\n preset: this.selector('.tie-crop-preset-button'),\n };\n\n this.defaultPresetButton = this._els.preset.querySelector('.preset-none');\n }\n\n /**\n * Destroys the instance.\n */\n destroy() {\n this._removeEvent();\n\n assignmentForDestroy(this);\n }\n\n /**\n * Add event for crop\n * @param {Object} actions - actions for crop\n * @param {Function} actions.crop - crop action\n * @param {Function} actions.cancel - cancel action\n * @param {Function} actions.preset - draw rectzone at a predefined ratio\n */\n addEvent(actions) {\n const apply = this._applyEventHandler.bind(this);\n const cancel = this._cancelEventHandler.bind(this);\n const cropzonePreset = this._cropzonePresetEventHandler.bind(this);\n\n this.eventHandler = {\n apply,\n cancel,\n cropzonePreset,\n };\n\n this.actions = actions;\n this._els.apply.addEventListener('click', apply);\n this._els.cancel.addEventListener('click', cancel);\n this._els.preset.addEventListener('click', cropzonePreset);\n }\n\n /**\n * Remove event\n * @private\n */\n _removeEvent() {\n this._els.apply.removeEventListener('click', this.eventHandler.apply);\n this._els.cancel.removeEventListener('click', this.eventHandler.cancel);\n this._els.preset.removeEventListener('click', this.eventHandler.cropzonePreset);\n }\n\n _applyEventHandler() {\n this.actions.crop();\n this._els.apply.classList.remove('active');\n }\n\n _cancelEventHandler() {\n this.actions.cancel();\n this._els.apply.classList.remove('active');\n }\n\n _cropzonePresetEventHandler(event) {\n const button = event.target.closest('.tui-image-editor-button.preset');\n if (button) {\n const [presetType] = button.className.match(/preset-[^\\s]+/);\n\n this._setPresetButtonActive(button);\n this.actions.preset(presetType);\n }\n }\n\n /**\n * Executed when the menu starts.\n */\n changeStartMode() {\n this.actions.modeChange('crop');\n }\n\n /**\n * Returns the menu to its default state.\n */\n changeStandbyMode() {\n this.actions.stopDrawingMode();\n this._setPresetButtonActive();\n }\n\n /**\n * Change apply button status\n * @param {Boolean} enableStatus - apply button status\n */\n changeApplyButtonStatus(enableStatus) {\n if (enableStatus) {\n this._els.apply.classList.add('active');\n } else {\n this._els.apply.classList.remove('active');\n }\n }\n\n /**\n * Set preset button to active status\n * @param {HTMLElement} button - event target element\n * @private\n */\n _setPresetButtonActive(button = this.defaultPresetButton) {\n snippet.forEach([].slice.call(this._els.preset.querySelectorAll('.preset')), (presetButton) => {\n presetButton.classList.remove('active');\n });\n\n if (button) {\n button.classList.add('active');\n }\n }\n}\n\nexport default Crop;\n","import Colorpicker from '@/ui/tools/colorpicker';\nimport Range from '@/ui/tools/range';\nimport Submenu from '@/ui/submenuBase';\nimport templateHtml from '@/ui/template/submenu/draw';\nimport { assignmentForDestroy, getRgb } from '@/util';\nimport { defaultDrawRangeValues } from '@/consts';\n\nconst DRAW_OPACITY = 0.7;\n\n/**\n * Draw ui class\n * @class\n * @ignore\n */\nclass Draw extends Submenu {\n constructor(subMenuElement, { locale, makeSvgIcon, menuBarPosition, usageStatistics }) {\n super(subMenuElement, {\n locale,\n name: 'draw',\n makeSvgIcon,\n menuBarPosition,\n templateHtml,\n usageStatistics,\n });\n\n this._els = {\n lineSelectButton: this.selector('.tie-draw-line-select-button'),\n drawColorPicker: new Colorpicker(\n this.selector('.tie-draw-color'),\n '#00a9ff',\n this.toggleDirection,\n this.usageStatistics\n ),\n drawRange: new Range(\n {\n slider: this.selector('.tie-draw-range'),\n input: this.selector('.tie-draw-range-value'),\n },\n defaultDrawRangeValues\n ),\n };\n\n this.type = null;\n this.color = this._els.drawColorPicker.color;\n this.width = this._els.drawRange.value;\n }\n\n /**\n * Destroys the instance.\n */\n destroy() {\n this._removeEvent();\n this._els.drawColorPicker.destroy();\n this._els.drawRange.destroy();\n\n assignmentForDestroy(this);\n }\n\n /**\n * Add event for draw\n * @param {Object} actions - actions for crop\n * @param {Function} actions.setDrawMode - set draw mode\n */\n addEvent(actions) {\n this.eventHandler.changeDrawType = this._changeDrawType.bind(this);\n\n this.actions = actions;\n this._els.lineSelectButton.addEventListener('click', this.eventHandler.changeDrawType);\n this._els.drawColorPicker.on('change', this._changeDrawColor.bind(this));\n this._els.drawRange.on('change', this._changeDrawRange.bind(this));\n }\n\n /**\n * Remove event\n * @private\n */\n _removeEvent() {\n this._els.lineSelectButton.removeEventListener('click', this.eventHandler.changeDrawType);\n this._els.drawColorPicker.off();\n this._els.drawRange.off();\n }\n\n /**\n * set draw mode - action runner\n */\n setDrawMode() {\n this.actions.setDrawMode(this.type, {\n width: this.width,\n color: getRgb(this.color, DRAW_OPACITY),\n });\n }\n\n /**\n * Returns the menu to its default state.\n */\n changeStandbyMode() {\n this.type = null;\n this.actions.stopDrawingMode();\n this.actions.changeSelectableAll(true);\n this._els.lineSelectButton.classList.remove('free');\n this._els.lineSelectButton.classList.remove('line');\n }\n\n /**\n * Executed when the menu starts.\n */\n changeStartMode() {\n this.type = 'free';\n this._els.lineSelectButton.classList.add('free');\n this.setDrawMode();\n }\n\n /**\n * Change draw type event\n * @param {object} event - line select event\n * @private\n */\n _changeDrawType(event) {\n const button = event.target.closest('.tui-image-editor-button');\n if (button) {\n const lineType = this.getButtonType(button, ['free', 'line']);\n this.actions.discardSelection();\n\n if (this.type === lineType) {\n this.changeStandbyMode();\n\n return;\n }\n\n this.changeStandbyMode();\n this.type = lineType;\n this._els.lineSelectButton.classList.add(lineType);\n this.setDrawMode();\n }\n }\n\n /**\n * Change drawing color\n * @param {string} color - select drawing color\n * @private\n */\n _changeDrawColor(color) {\n this.color = color || 'transparent';\n if (!this.type) {\n this.changeStartMode();\n } else {\n this.setDrawMode();\n }\n }\n\n /**\n * Change drawing Range\n * @param {number} value - select drawing range\n * @private\n */\n _changeDrawRange(value) {\n this.width = value;\n if (!this.type) {\n this.changeStartMode();\n } else {\n this.setDrawMode();\n }\n }\n}\n\nexport default Draw;\n","import snippet from 'tui-code-snippet';\nimport Colorpicker from '@/ui/tools/colorpicker';\nimport Range from '@/ui/tools/range';\nimport Submenu from '@/ui/submenuBase';\nimport templateHtml from '@/ui/template/submenu/filter';\nimport { toInteger, toCamelCase, assignmentForDestroy } from '@/util';\nimport { defaultFilterRangeValues as FILTER_RANGE } from '@/consts';\n\nconst PICKER_CONTROL_HEIGHT = '130px';\nconst BLEND_OPTIONS = ['add', 'diff', 'subtract', 'multiply', 'screen', 'lighten', 'darken'];\nconst FILTER_OPTIONS = [\n 'grayscale',\n 'invert',\n 'sepia',\n 'vintage',\n 'blur',\n 'sharpen',\n 'emboss',\n 'remove-white',\n 'brightness',\n 'noise',\n 'pixelate',\n 'color-filter',\n 'tint',\n 'multiply',\n 'blend',\n];\nconst filterNameMap = {\n grayscale: 'grayscale',\n invert: 'invert',\n sepia: 'sepia',\n blur: 'blur',\n sharpen: 'sharpen',\n emboss: 'emboss',\n removeWhite: 'removeColor',\n brightness: 'brightness',\n contrast: 'contrast',\n saturation: 'saturation',\n vintage: 'vintage',\n polaroid: 'polaroid',\n noise: 'noise',\n pixelate: 'pixelate',\n colorFilter: 'removeColor',\n tint: 'blendColor',\n multiply: 'blendColor',\n blend: 'blendColor',\n hue: 'hue',\n gamma: 'gamma',\n};\nconst RANGE_INSTANCE_NAMES = [\n 'removewhiteDistanceRange',\n 'colorfilterThresholdRange',\n 'pixelateRange',\n 'noiseRange',\n 'brightnessRange',\n 'tintOpacity',\n];\nconst COLORPICKER_INSTANCE_NAMES = ['filterBlendColor', 'filterMultiplyColor', 'filterTintColor'];\n\n/**\n * Filter ui class\n * @class\n * @ignore\n */\nclass Filter extends Submenu {\n constructor(subMenuElement, { locale, menuBarPosition, usageStatistics }) {\n super(subMenuElement, {\n locale,\n name: 'filter',\n menuBarPosition,\n templateHtml,\n usageStatistics,\n });\n\n this.selectBoxShow = false;\n\n this.checkedMap = {};\n this._makeControlElement();\n }\n\n /**\n * Destroys the instance.\n */\n destroy() {\n this._removeEvent();\n this._destroyToolInstance();\n\n assignmentForDestroy(this);\n }\n\n /**\n * Remove event for filter\n */\n _removeEvent() {\n snippet.forEach(FILTER_OPTIONS, (filter) => {\n const filterCheckElement = this.selector(`.tie-${filter}`);\n const filterNameCamelCase = toCamelCase(filter);\n\n filterCheckElement.removeEventListener('change', this.eventHandler[filterNameCamelCase]);\n });\n\n snippet.forEach([...RANGE_INSTANCE_NAMES, ...COLORPICKER_INSTANCE_NAMES], (instanceName) => {\n this._els[instanceName].off();\n });\n\n this._els.blendType.removeEventListener('change', this.eventHandler.changeBlendFilter);\n this._els.blendType.removeEventListener('click', this.eventHandler.changeBlendFilter);\n }\n\n _destroyToolInstance() {\n snippet.forEach([...RANGE_INSTANCE_NAMES, ...COLORPICKER_INSTANCE_NAMES], (instanceName) => {\n this._els[instanceName].destroy();\n });\n }\n\n /**\n * Add event for filter\n * @param {Object} actions - actions for crop\n * @param {Function} actions.applyFilter - apply filter option\n */\n addEvent({ applyFilter }) {\n const changeFilterState = (filterName) =>\n this._changeFilterState.bind(this, applyFilter, filterName);\n const changeFilterStateForRange = (filterName) => (value, isLast) =>\n this._changeFilterState(applyFilter, filterName, isLast);\n\n this.eventHandler = {\n changeBlendFilter: changeFilterState('blend'),\n blandTypeClick: (event) => event.stopPropagation(),\n };\n\n snippet.forEach(FILTER_OPTIONS, (filter) => {\n const filterCheckElement = this.selector(`.tie-${filter}`);\n const filterNameCamelCase = toCamelCase(filter);\n this.checkedMap[filterNameCamelCase] = filterCheckElement;\n this.eventHandler[filterNameCamelCase] = changeFilterState(filterNameCamelCase);\n\n filterCheckElement.addEventListener('change', this.eventHandler[filterNameCamelCase]);\n });\n\n this._els.removewhiteDistanceRange.on('change', changeFilterStateForRange('removeWhite'));\n this._els.colorfilterThresholdRange.on('change', changeFilterStateForRange('colorFilter'));\n this._els.pixelateRange.on('change', changeFilterStateForRange('pixelate'));\n this._els.noiseRange.on('change', changeFilterStateForRange('noise'));\n this._els.brightnessRange.on('change', changeFilterStateForRange('brightness'));\n\n this._els.filterBlendColor.on('change', this.eventHandler.changeBlendFilter);\n this._els.filterMultiplyColor.on('change', changeFilterState('multiply'));\n this._els.filterTintColor.on('change', changeFilterState('tint'));\n this._els.tintOpacity.on('change', changeFilterStateForRange('tint'));\n this._els.filterMultiplyColor.on('changeShow', this.colorPickerChangeShow.bind(this));\n this._els.filterTintColor.on('changeShow', this.colorPickerChangeShow.bind(this));\n this._els.filterBlendColor.on('changeShow', this.colorPickerChangeShow.bind(this));\n\n this._els.blendType.addEventListener('change', this.eventHandler.changeBlendFilter);\n this._els.blendType.addEventListener('click', this.eventHandler.blandTypeClick);\n }\n\n /**\n * Set filter for undo changed\n * @param {Object} changedFilterInfos - changed command infos\n * @param {string} type - filter type\n * @param {string} action - add or remove\n * @param {Object} options - filter options\n */\n setFilterState(changedFilterInfos) {\n const { type, options, action } = changedFilterInfos;\n const filterName = this._getFilterNameFromOptions(type, options);\n const isRemove = action === 'remove';\n\n if (!isRemove) {\n this._setFilterState(filterName, options);\n }\n\n this.checkedMap[filterName].checked = !isRemove;\n }\n\n /**\n * Set filter for undo changed\n * @param {string} filterName - filter name\n * @param {Object} options - filter options\n * @private\n */\n // eslint-disable-next-line complexity\n _setFilterState(filterName, options) {\n if (filterName === 'colorFilter') {\n this._els.colorfilterThresholdRange.value = options.distance;\n } else if (filterName === 'removeWhite') {\n this._els.removewhiteDistanceRange.value = options.distance;\n } else if (filterName === 'pixelate') {\n this._els.pixelateRange.value = options.blocksize;\n } else if (filterName === 'brightness') {\n this._els.brightnessRange.value = options.brightness;\n } else if (filterName === 'noise') {\n this._els.noiseRange.value = options.noise;\n } else if (filterName === 'tint') {\n this._els.tintOpacity.value = options.alpha;\n this._els.filterTintColor.color = options.color;\n } else if (filterName === 'blend') {\n this._els.filterBlendColor.color = options.color;\n } else if (filterName === 'multiply') {\n this._els.filterMultiplyColor.color = options.color;\n }\n }\n\n /**\n * Get filter name\n * @param {string} type - filter type\n * @param {Object} options - filter options\n * @returns {string} filter name\n * @private\n */\n _getFilterNameFromOptions(type, options) {\n let filterName = type;\n\n if (type === 'removeColor') {\n filterName = snippet.isExisty(options.useAlpha) ? 'removeWhite' : 'colorFilter';\n } else if (type === 'blendColor') {\n filterName = {\n add: 'blend',\n multiply: 'multiply',\n tint: 'tint',\n }[options.mode];\n }\n\n return filterName;\n }\n\n /**\n * Add event for filter\n * @param {Function} applyFilter - actions for firter\n * @param {string} filterName - filter name\n * @param {boolean} [isLast] - Is last change\n */\n _changeFilterState(applyFilter, filterName, isLast = true) {\n const apply = this.checkedMap[filterName].checked;\n const type = filterNameMap[filterName];\n\n const checkboxGroup = this.checkedMap[filterName].closest('.tui-image-editor-checkbox-group');\n if (checkboxGroup) {\n if (apply) {\n checkboxGroup.classList.remove('tui-image-editor-disabled');\n } else {\n checkboxGroup.classList.add('tui-image-editor-disabled');\n }\n }\n applyFilter(apply, type, this._getFilterOption(filterName), !isLast);\n }\n\n /**\n * Get filter option\n * @param {String} type - filter type\n * @returns {Object} filter option object\n * @private\n */\n // eslint-disable-next-line complexity\n _getFilterOption(type) {\n const option = {};\n switch (type) {\n case 'removeWhite':\n option.color = '#FFFFFF';\n option.useAlpha = false;\n option.distance = parseFloat(this._els.removewhiteDistanceRange.value);\n break;\n case 'colorFilter':\n option.color = '#FFFFFF';\n option.distance = parseFloat(this._els.colorfilterThresholdRange.value);\n break;\n case 'pixelate':\n option.blocksize = toInteger(this._els.pixelateRange.value);\n break;\n case 'noise':\n option.noise = toInteger(this._els.noiseRange.value);\n break;\n case 'brightness':\n option.brightness = parseFloat(this._els.brightnessRange.value);\n break;\n case 'blend':\n option.mode = 'add';\n option.color = this._els.filterBlendColor.color;\n option.mode = this._els.blendType.value;\n break;\n case 'multiply':\n option.mode = 'multiply';\n option.color = this._els.filterMultiplyColor.color;\n break;\n case 'tint':\n option.mode = 'tint';\n option.color = this._els.filterTintColor.color;\n option.alpha = this._els.tintOpacity.value;\n break;\n case 'blur':\n option.blur = this._els.blurRange.value;\n break;\n default:\n break;\n }\n\n return option;\n }\n\n /**\n * Make submenu range and colorpicker control\n * @private\n */\n _makeControlElement() {\n this._els = {\n removewhiteDistanceRange: new Range(\n { slider: this.selector('.tie-removewhite-distance-range') },\n FILTER_RANGE.removewhiteDistanceRange\n ),\n brightnessRange: new Range(\n { slider: this.selector('.tie-brightness-range') },\n FILTER_RANGE.brightnessRange\n ),\n noiseRange: new Range({ slider: this.selector('.tie-noise-range') }, FILTER_RANGE.noiseRange),\n pixelateRange: new Range(\n { slider: this.selector('.tie-pixelate-range') },\n FILTER_RANGE.pixelateRange\n ),\n colorfilterThresholdRange: new Range(\n { slider: this.selector('.tie-colorfilter-threshold-range') },\n FILTER_RANGE.colorfilterThresholdRange\n ),\n filterTintColor: new Colorpicker(\n this.selector('.tie-filter-tint-color'),\n '#03bd9e',\n this.toggleDirection,\n this.usageStatistics\n ),\n filterMultiplyColor: new Colorpicker(\n this.selector('.tie-filter-multiply-color'),\n '#515ce6',\n this.toggleDirection,\n this.usageStatistics\n ),\n filterBlendColor: new Colorpicker(\n this.selector('.tie-filter-blend-color'),\n '#ffbb3b',\n this.toggleDirection,\n this.usageStatistics\n ),\n blurRange: FILTER_RANGE.blurFilterRange,\n };\n\n this._els.tintOpacity = this._pickerWithRange(this._els.filterTintColor.pickerControl);\n this._els.blendType = this._pickerWithSelectbox(this._els.filterBlendColor.pickerControl);\n\n this.colorPickerControls.push(this._els.filterTintColor);\n this.colorPickerControls.push(this._els.filterMultiplyColor);\n this.colorPickerControls.push(this._els.filterBlendColor);\n }\n\n /**\n * Make submenu control for picker & range mixin\n * @param {HTMLElement} pickerControl - pickerControl dom element\n * @returns {Range}\n * @private\n */\n _pickerWithRange(pickerControl) {\n const rangeWrap = document.createElement('div');\n const rangeLabel = document.createElement('label');\n const slider = document.createElement('div');\n\n slider.id = 'tie-filter-tint-opacity';\n rangeLabel.innerHTML = 'Opacity';\n rangeWrap.appendChild(rangeLabel);\n rangeWrap.appendChild(slider);\n pickerControl.appendChild(rangeWrap);\n pickerControl.style.height = PICKER_CONTROL_HEIGHT;\n\n return new Range({ slider }, FILTER_RANGE.tintOpacityRange);\n }\n\n /**\n * Make submenu control for picker & selectbox\n * @param {HTMLElement} pickerControl - pickerControl dom element\n * @returns {HTMLElement}\n * @private\n */\n _pickerWithSelectbox(pickerControl) {\n const selectlistWrap = document.createElement('div');\n const selectlist = document.createElement('select');\n const optionlist = document.createElement('ul');\n\n selectlistWrap.className = 'tui-image-editor-selectlist-wrap';\n optionlist.className = 'tui-image-editor-selectlist';\n\n selectlistWrap.appendChild(selectlist);\n selectlistWrap.appendChild(optionlist);\n\n this._makeSelectOptionList(selectlist);\n\n pickerControl.appendChild(selectlistWrap);\n pickerControl.style.height = PICKER_CONTROL_HEIGHT;\n\n this._drawSelectOptionList(selectlist, optionlist);\n this._pickerWithSelectboxForAddEvent(selectlist, optionlist);\n\n return selectlist;\n }\n\n /**\n * Make selectbox option list custom style\n * @param {HTMLElement} selectlist - selectbox element\n * @param {HTMLElement} optionlist - custom option list item element\n * @private\n */\n _drawSelectOptionList(selectlist, optionlist) {\n const options = selectlist.querySelectorAll('option');\n snippet.forEach(options, (option) => {\n const optionElement = document.createElement('li');\n optionElement.innerHTML = option.innerHTML;\n optionElement.setAttribute('data-item', option.value);\n optionlist.appendChild(optionElement);\n });\n }\n\n /**\n * custom selectbox custom event\n * @param {HTMLElement} selectlist - selectbox element\n * @param {HTMLElement} optionlist - custom option list item element\n * @private\n */\n _pickerWithSelectboxForAddEvent(selectlist, optionlist) {\n optionlist.addEventListener('click', (event) => {\n const optionValue = event.target.getAttribute('data-item');\n const fireEvent = document.createEvent('HTMLEvents');\n\n selectlist.querySelector(`[value=\"${optionValue}\"]`).selected = true;\n fireEvent.initEvent('change', true, true);\n\n selectlist.dispatchEvent(fireEvent);\n\n this.selectBoxShow = false;\n optionlist.style.display = 'none';\n });\n\n selectlist.addEventListener('mousedown', (event) => {\n event.preventDefault();\n this.selectBoxShow = !this.selectBoxShow;\n optionlist.style.display = this.selectBoxShow ? 'block' : 'none';\n optionlist.setAttribute('data-selectitem', selectlist.value);\n optionlist.querySelector(`[data-item='${selectlist.value}']`).classList.add('active');\n });\n }\n\n /**\n * Make option list for select control\n * @param {HTMLElement} selectlist - blend option select list element\n * @private\n */\n _makeSelectOptionList(selectlist) {\n snippet.forEach(BLEND_OPTIONS, (option) => {\n const selectOption = document.createElement('option');\n selectOption.setAttribute('value', option);\n selectOption.innerHTML = option.replace(/^[a-z]/, ($0) => $0.toUpperCase());\n selectlist.appendChild(selectOption);\n });\n }\n}\n\nexport default Filter;\n","import snippet from 'tui-code-snippet';\nimport Submenu from '@/ui/submenuBase';\nimport templateHtml from '@/ui/template/submenu/flip';\nimport { assignmentForDestroy } from '@/util';\n\n/**\n * Flip ui class\n * @class\n * @ignore\n */\nclass Flip extends Submenu {\n constructor(subMenuElement, { locale, makeSvgIcon, menuBarPosition, usageStatistics }) {\n super(subMenuElement, {\n locale,\n name: 'flip',\n makeSvgIcon,\n menuBarPosition,\n templateHtml,\n usageStatistics,\n });\n this.flipStatus = false;\n\n this._els = {\n flipButton: this.selector('.tie-flip-button'),\n };\n }\n\n /**\n * Destroys the instance.\n */\n destroy() {\n this._removeEvent();\n\n assignmentForDestroy(this);\n }\n\n /**\n * Add event for flip\n * @param {Object} actions - actions for flip\n * @param {Function} actions.flip - flip action\n */\n addEvent(actions) {\n this.eventHandler.changeFlip = this._changeFlip.bind(this);\n this._actions = actions;\n this._els.flipButton.addEventListener('click', this.eventHandler.changeFlip);\n }\n\n /**\n * Remove event\n * @private\n */\n _removeEvent() {\n this._els.flipButton.removeEventListener('click', this.eventHandler.changeFlip);\n }\n\n /**\n * change Flip status\n * @param {object} event - change event\n * @private\n */\n _changeFlip(event) {\n const button = event.target.closest('.tui-image-editor-button');\n if (button) {\n const flipType = this.getButtonType(button, ['flipX', 'flipY', 'resetFlip']);\n if (!this.flipStatus && flipType === 'resetFlip') {\n return;\n }\n\n this._actions.flip(flipType).then((flipStatus) => {\n const flipClassList = this._els.flipButton.classList;\n this.flipStatus = false;\n\n flipClassList.remove('resetFlip');\n snippet.forEach(['flipX', 'flipY'], (type) => {\n flipClassList.remove(type);\n if (flipStatus[type]) {\n flipClassList.add(type);\n flipClassList.add('resetFlip');\n this.flipStatus = true;\n }\n });\n });\n }\n }\n}\n\nexport default Flip;\n","import Panel from '@/ui/panelMenu';\nimport templateHtml from '@/ui/template/submenu/history';\nimport { assignmentForDestroy } from '@/util';\n\nconst historyClassName = 'history-item';\nconst selectedClassName = 'selected-item';\nconst disabledClassName = 'disabled-item';\n\n/**\n * History ui class\n * @class\n * @ignore\n */\nclass History extends Panel {\n constructor(menuElement, { locale, makeSvgIcon }) {\n super(menuElement, { name: 'history' });\n menuElement.classList.add('enabled');\n\n this.locale = locale;\n this.makeSvgIcon = makeSvgIcon;\n this._eventHandler = {};\n this._historyIndex = this.getListLength();\n }\n\n /**\n * Add history\n * @param {string} name - name of history\n * @param {?string} detail - detail information of history\n */\n add({ name, detail }) {\n if (this._hasDisabledItem()) {\n this.deleteListItemElement(this._historyIndex + 1, this.getListLength());\n }\n\n const html = templateHtml({ locale: this.locale, makeSvgIcon: this.makeSvgIcon, name, detail });\n const item = this.makeListItemElement(html);\n\n this.pushListItemElement(item);\n this._historyIndex = this.getListLength() - 1;\n this._selectItem(this._historyIndex);\n }\n\n /**\n * Init history\n */\n init() {\n this.deleteListItemElement(1, this.getListLength());\n this._historyIndex = 0;\n this._selectItem(this._historyIndex);\n }\n\n /**\n * Clear history\n */\n clear() {\n this.deleteListItemElement(0, this.getListLength());\n this._historyIndex = -1;\n }\n\n /**\n * Select previous history of current selected history\n */\n prev() {\n this._historyIndex -= 1;\n this._selectItem(this._historyIndex);\n }\n\n /**\n * Select next history of current selected history\n */\n next() {\n this._historyIndex += 1;\n this._selectItem(this._historyIndex);\n }\n\n /**\n * Whether history menu has disabled item\n * @returns {boolean}\n */\n _hasDisabledItem() {\n return this.getListLength() - 1 > this._historyIndex;\n }\n\n /**\n * Add history menu event\n * @private\n */\n _addHistoryEventListener() {\n this._eventHandler.history = (event) => this._clickHistoryItem(event);\n this.listElement.addEventListener('click', this._eventHandler.history);\n }\n\n /**\n * Remove history menu event\n * @private\n */\n _removeHistoryEventListener() {\n this.listElement.removeEventListener('click', this._eventHandler.history);\n }\n\n /**\n * onClick history menu event listener\n * @param {object} event - event object\n * @private\n */\n _clickHistoryItem(event) {\n const { target } = event;\n const item = target.closest(`.${historyClassName}`);\n\n if (!item) {\n return;\n }\n\n const index = Number.parseInt(item.getAttribute('data-index'), 10);\n\n if (index !== this._historyIndex) {\n const count = Math.abs(index - this._historyIndex);\n\n if (index < this._historyIndex) {\n this._actions.undo(count);\n } else {\n this._actions.redo(count);\n }\n }\n }\n\n /**\n * Change item's state to selected state\n * @param {number} index - index of selected item\n */\n _selectItem(index) {\n for (let i = 0; i < this.getListLength(); i += 1) {\n this.removeClass(i, selectedClassName);\n this.removeClass(i, disabledClassName);\n if (i > index) {\n this.addClass(i, disabledClassName);\n }\n }\n this.addClass(index, selectedClassName);\n }\n\n /**\n * Destroys the instance.\n */\n destroy() {\n this.removeEvent();\n\n assignmentForDestroy(this);\n }\n\n /**\n * Add event for history\n * @param {Object} actions - actions for crop\n * @param {Function} actions.undo - undo action\n * @param {Function} actions.redo - redo action\n */\n addEvent(actions) {\n this._actions = actions;\n this._addHistoryEventListener();\n }\n\n /**\n * Remove event\n * @private\n */\n removeEvent() {\n this._removeHistoryEventListener();\n }\n}\n\nexport default History;\n","import snippet from 'tui-code-snippet';\nimport Colorpicker from '@/ui/tools/colorpicker';\nimport Submenu from '@/ui/submenuBase';\nimport templateHtml from '@/ui/template/submenu/icon';\nimport { isSupportFileApi, assignmentForDestroy } from '@/util';\nimport { defaultIconPath } from '@/consts';\n\n/**\n * Icon ui class\n * @class\n * @ignore\n */\nclass Icon extends Submenu {\n constructor(subMenuElement, { locale, makeSvgIcon, menuBarPosition, usageStatistics }) {\n super(subMenuElement, {\n locale,\n name: 'icon',\n makeSvgIcon,\n menuBarPosition,\n templateHtml,\n usageStatistics,\n });\n\n this.iconType = null;\n this._iconMap = {};\n\n this._els = {\n registerIconButton: this.selector('.tie-icon-image-file'),\n addIconButton: this.selector('.tie-icon-add-button'),\n iconColorpicker: new Colorpicker(\n this.selector('.tie-icon-color'),\n '#ffbb3b',\n this.toggleDirection,\n this.usageStatistics\n ),\n };\n }\n\n /**\n * Destroys the instance.\n */\n destroy() {\n this._removeEvent();\n this._els.iconColorpicker.destroy();\n\n assignmentForDestroy(this);\n }\n\n /**\n * Add event for icon\n * @param {Object} actions - actions for icon\n * @param {Function} actions.registerCustomIcon - register icon\n * @param {Function} actions.addIcon - add icon\n * @param {Function} actions.changeColor - change icon color\n */\n addEvent(actions) {\n const registerIcon = this._registerIconHandler.bind(this);\n const addIcon = this._addIconHandler.bind(this);\n\n this.eventHandler = {\n registerIcon,\n addIcon,\n };\n\n this.actions = actions;\n this._els.iconColorpicker.on('change', this._changeColorHandler.bind(this));\n this._els.registerIconButton.addEventListener('change', registerIcon);\n this._els.addIconButton.addEventListener('click', addIcon);\n }\n\n /**\n * Remove event\n * @private\n */\n _removeEvent() {\n this._els.iconColorpicker.off();\n this._els.registerIconButton.removeEventListener('change', this.eventHandler.registerIcon);\n this._els.addIconButton.removeEventListener('click', this.eventHandler.addIcon);\n }\n\n /**\n * Clear icon type\n */\n clearIconType() {\n this._els.addIconButton.classList.remove(this.iconType);\n this.iconType = null;\n }\n\n /**\n * Register default icon\n */\n registerDefaultIcon() {\n snippet.forEach(defaultIconPath, (path, type) => {\n this.actions.registerDefaultIcons(type, path);\n });\n }\n\n /**\n * Set icon picker color\n * @param {string} iconColor - rgb color string\n */\n setIconPickerColor(iconColor) {\n this._els.iconColorpicker.color = iconColor;\n }\n\n /**\n * Returns the menu to its default state.\n */\n changeStandbyMode() {\n this.clearIconType();\n this.actions.cancelAddIcon();\n }\n\n /**\n * Change icon color\n * @param {string} color - color for change\n * @private\n */\n _changeColorHandler(color) {\n color = color || 'transparent';\n this.actions.changeColor(color);\n }\n\n /**\n * Change icon color\n * @param {object} event - add button event object\n * @private\n */\n _addIconHandler(event) {\n const button = event.target.closest('.tui-image-editor-button');\n\n if (button) {\n const iconType = button.getAttribute('data-icontype');\n const iconColor = this._els.iconColorpicker.color;\n this.actions.discardSelection();\n this.actions.changeSelectableAll(false);\n this._els.addIconButton.classList.remove(this.iconType);\n this._els.addIconButton.classList.add(iconType);\n\n if (this.iconType === iconType) {\n this.changeStandbyMode();\n } else {\n this.actions.addIcon(iconType, iconColor);\n this.iconType = iconType;\n }\n }\n }\n\n /**\n * register icon\n * @param {object} event - file change event object\n * @private\n */\n _registerIconHandler(event) {\n let imgUrl;\n\n if (!isSupportFileApi) {\n alert('This browser does not support file-api');\n }\n\n const [file] = event.target.files;\n\n if (file) {\n imgUrl = URL.createObjectURL(file);\n this.actions.registerCustomIcon(imgUrl, file);\n }\n }\n}\n\nexport default Icon;\n","/**\n * Translate messages\n */\nclass Locale {\n /**\n * @constructor\n * @param {Object} locale - Locale object for initialise\n */\n constructor(locale) {\n this._locale = locale;\n }\n\n /**\n * localize message\n * @param {string} message - message who will be localized\n * @returns {string}\n */\n localize(message) {\n return this._locale[message] || message;\n }\n}\n\nexport default Locale;\n","import Submenu from '@/ui/submenuBase';\nimport templateHtml from '@/ui/template/submenu/mask';\nimport { assignmentForDestroy, isSupportFileApi } from '@/util';\n\n/**\n * Mask ui class\n * @class\n * @ignore\n */\nclass Mask extends Submenu {\n constructor(subMenuElement, { locale, makeSvgIcon, menuBarPosition, usageStatistics }) {\n super(subMenuElement, {\n locale,\n name: 'mask',\n makeSvgIcon,\n menuBarPosition,\n templateHtml,\n usageStatistics,\n });\n\n this._els = {\n applyButton: this.selector('.tie-mask-apply'),\n maskImageButton: this.selector('.tie-mask-image-file'),\n };\n }\n\n /**\n * Destroys the instance.\n */\n destroy() {\n this._removeEvent();\n\n assignmentForDestroy(this);\n }\n\n /**\n * Add event for mask\n * @param {Object} actions - actions for crop\n * @param {Function} actions.loadImageFromURL - load image action\n * @param {Function} actions.applyFilter - apply filter action\n */\n addEvent(actions) {\n const loadMaskFile = this._loadMaskFile.bind(this);\n const applyMask = this._applyMask.bind(this);\n\n this.eventHandler = {\n loadMaskFile,\n applyMask,\n };\n\n this.actions = actions;\n this._els.maskImageButton.addEventListener('change', loadMaskFile);\n this._els.applyButton.addEventListener('click', applyMask);\n }\n\n /**\n * Remove event\n * @private\n */\n _removeEvent() {\n this._els.maskImageButton.removeEventListener('change', this.eventHandler.loadMaskFile);\n this._els.applyButton.removeEventListener('click', this.eventHandler.applyMask);\n }\n\n /**\n * Apply mask\n * @private\n */\n _applyMask() {\n this.actions.applyFilter();\n this._els.applyButton.classList.remove('active');\n }\n\n /**\n * Load mask file\n * @param {object} event - File change event object\n * @private\n */\n _loadMaskFile(event) {\n let imgUrl;\n\n if (!isSupportFileApi()) {\n alert('This browser does not support file-api');\n }\n\n const [file] = event.target.files;\n\n if (file) {\n imgUrl = URL.createObjectURL(file);\n this.actions.loadImageFromURL(imgUrl, file);\n this._els.applyButton.classList.add('active');\n }\n }\n}\n\nexport default Mask;\n","/**\n * Menu Panel Class\n * @class\n * @ignore\n */\n\nclass Panel {\n /**\n * @param {HTMLElement} menuElement - menu dom element\n * @param {Object} options - menu options\n * @param {string} options.name - name of panel menu\n */\n constructor(menuElement, { name }) {\n this.name = name;\n this.items = [];\n\n this.panelElement = this._makePanelElement();\n this.listElement = this._makeListElement();\n\n this.panelElement.appendChild(this.listElement);\n menuElement.appendChild(this.panelElement);\n }\n\n /**\n * Make Panel element\n * @returns {HTMLElement}\n */\n _makePanelElement() {\n const panel = document.createElement('div');\n\n panel.className = `tie-panel-${this.name}`;\n\n return panel;\n }\n\n /**\n * Make list element\n * @returns {HTMLElement} list element\n * @private\n */\n _makeListElement() {\n const list = document.createElement('ol');\n\n list.className = `${this.name}-list`;\n\n return list;\n }\n\n /**\n * Make list item element\n * @param {string} html - history list item html\n * @returns {HTMLElement} list item element\n */\n makeListItemElement(html) {\n const listItem = document.createElement('li');\n\n listItem.innerHTML = html;\n listItem.className = `${this.name}-item`;\n listItem.setAttribute('data-index', this.items.length);\n\n return listItem;\n }\n\n /**\n * Push list item element\n * @param {HTMLElement} item - list item element to add to the list\n */\n pushListItemElement(item) {\n this.listElement.appendChild(item);\n this.listElement.scrollTop += item.offsetHeight;\n this.items.push(item);\n }\n\n /**\n * Delete list item element\n * @param {number} start - start index to delete\n * @param {number} end - end index to delete\n */\n deleteListItemElement(start, end) {\n const { items } = this;\n\n for (let i = start; i < end; i += 1) {\n this.listElement.removeChild(items[i]);\n }\n items.splice(start, end - start + 1);\n }\n\n /**\n * Get list's length\n * @returns {number}\n */\n getListLength() {\n return this.items.length;\n }\n\n /**\n * Add class name of item\n * @param {number} index - index of item\n * @param {string} className - class name to add\n */\n addClass(index, className) {\n if (this.items[index]) {\n this.items[index].classList.add(className);\n }\n }\n\n /**\n * Remove class name of item\n * @param {number} index - index of item\n * @param {string} className - class name to remove\n */\n removeClass(index, className) {\n if (this.items[index]) {\n this.items[index].classList.remove(className);\n }\n }\n\n /**\n * Toggle class name of item\n * @param {number} index - index of item\n * @param {string} className - class name to remove\n */\n toggleClass(index, className) {\n if (this.items[index]) {\n this.items[index].classList.toggle(className);\n }\n }\n}\n\nexport default Panel;\n","import Range from '@/ui/tools/range';\nimport Submenu from '@/ui/submenuBase';\nimport templateHtml from '@/ui/template/submenu/rotate';\nimport { toInteger, assignmentForDestroy } from '@/util';\nimport { defaultRotateRangeValues } from '@/consts';\n\nconst CLOCKWISE = 30;\nconst COUNTERCLOCKWISE = -30;\n\n/**\n * Rotate ui class\n * @class\n * @ignore\n */\nclass Rotate extends Submenu {\n constructor(subMenuElement, { locale, makeSvgIcon, menuBarPosition, usageStatistics }) {\n super(subMenuElement, {\n locale,\n name: 'rotate',\n makeSvgIcon,\n menuBarPosition,\n templateHtml,\n usageStatistics,\n });\n this._value = 0;\n\n this._els = {\n rotateButton: this.selector('.tie-rotate-button'),\n rotateRange: new Range(\n {\n slider: this.selector('.tie-rotate-range'),\n input: this.selector('.tie-rotate-range-value'),\n },\n defaultRotateRangeValues\n ),\n };\n }\n\n /**\n * Destroys the instance.\n */\n destroy() {\n this._removeEvent();\n this._els.rotateRange.destroy();\n\n assignmentForDestroy(this);\n }\n\n setRangeBarAngle(type, angle) {\n let resultAngle = angle;\n\n if (type === 'rotate') {\n resultAngle = parseInt(this._els.rotateRange.value, 10) + angle;\n }\n\n this._setRangeBarRatio(resultAngle);\n }\n\n _setRangeBarRatio(angle) {\n this._els.rotateRange.value = angle;\n }\n\n /**\n * Add event for rotate\n * @param {Object} actions - actions for crop\n * @param {Function} actions.rotate - rotate action\n * @param {Function} actions.setAngle - set angle action\n */\n addEvent(actions) {\n this.eventHandler.rotationAngleChanged = this._changeRotateForButton.bind(this);\n\n // {rotate, setAngle}\n this.actions = actions;\n this._els.rotateButton.addEventListener('click', this.eventHandler.rotationAngleChanged);\n this._els.rotateRange.on('change', this._changeRotateForRange.bind(this));\n }\n\n /**\n * Remove event\n * @private\n */\n _removeEvent() {\n this._els.rotateButton.removeEventListener('click', this.eventHandler.rotationAngleChanged);\n this._els.rotateRange.off();\n }\n\n /**\n * Change rotate for range\n * @param {number} value - angle value\n * @param {boolean} isLast - Is last change\n * @private\n */\n _changeRotateForRange(value, isLast) {\n const angle = toInteger(value);\n this.actions.setAngle(angle, !isLast);\n this._value = angle;\n }\n\n /**\n * Change rotate for button\n * @param {object} event - add button event object\n * @private\n */\n _changeRotateForButton(event) {\n const button = event.target.closest('.tui-image-editor-button');\n const angle = this._els.rotateRange.value;\n\n if (button) {\n const rotateType = this.getButtonType(button, ['counterclockwise', 'clockwise']);\n const rotateAngle = {\n clockwise: CLOCKWISE,\n counterclockwise: COUNTERCLOCKWISE,\n }[rotateType];\n const newAngle = parseInt(angle, 10) + rotateAngle;\n const isRotatable = newAngle >= -360 && newAngle <= 360;\n if (isRotatable) {\n this.actions.rotate(rotateAngle);\n }\n }\n }\n}\n\nexport default Rotate;\n","import Colorpicker from '@/ui/tools/colorpicker';\nimport Range from '@/ui/tools/range';\nimport Submenu from '@/ui/submenuBase';\nimport templateHtml from '@/ui/template/submenu/shape';\nimport { toInteger, assignmentForDestroy } from '@/util';\nimport { defaultShapeStrokeValues } from '@/consts';\n\nconst SHAPE_DEFAULT_OPTION = {\n stroke: '#ffbb3b',\n fill: '',\n strokeWidth: 3,\n};\n\n/**\n * Shape ui class\n * @class\n * @ignore\n */\nclass Shape extends Submenu {\n constructor(subMenuElement, { locale, makeSvgIcon, menuBarPosition, usageStatistics }) {\n super(subMenuElement, {\n locale,\n name: 'shape',\n makeSvgIcon,\n menuBarPosition,\n templateHtml,\n usageStatistics,\n });\n this.type = null;\n this.options = SHAPE_DEFAULT_OPTION;\n\n this._els = {\n shapeSelectButton: this.selector('.tie-shape-button'),\n shapeColorButton: this.selector('.tie-shape-color-button'),\n strokeRange: new Range(\n {\n slider: this.selector('.tie-stroke-range'),\n input: this.selector('.tie-stroke-range-value'),\n },\n defaultShapeStrokeValues\n ),\n fillColorpicker: new Colorpicker(\n this.selector('.tie-color-fill'),\n '',\n this.toggleDirection,\n this.usageStatistics\n ),\n strokeColorpicker: new Colorpicker(\n this.selector('.tie-color-stroke'),\n '#ffbb3b',\n this.toggleDirection,\n this.usageStatistics\n ),\n };\n\n this.colorPickerControls.push(this._els.fillColorpicker);\n this.colorPickerControls.push(this._els.strokeColorpicker);\n }\n\n /**\n * Destroys the instance.\n */\n destroy() {\n this._removeEvent();\n this._els.strokeRange.destroy();\n this._els.fillColorpicker.destroy();\n this._els.strokeColorpicker.destroy();\n\n assignmentForDestroy(this);\n }\n\n /**\n * Add event for shape\n * @param {Object} actions - actions for shape\n * @param {Function} actions.changeShape - change shape mode\n * @param {Function} actions.setDrawingShape - set drawing shape\n */\n addEvent(actions) {\n this.eventHandler.shapeTypeSelected = this._changeShapeHandler.bind(this);\n this.actions = actions;\n\n this._els.shapeSelectButton.addEventListener('click', this.eventHandler.shapeTypeSelected);\n this._els.strokeRange.on('change', this._changeStrokeRangeHandler.bind(this));\n this._els.fillColorpicker.on('change', this._changeFillColorHandler.bind(this));\n this._els.strokeColorpicker.on('change', this._changeStrokeColorHandler.bind(this));\n this._els.fillColorpicker.on('changeShow', this.colorPickerChangeShow.bind(this));\n this._els.strokeColorpicker.on('changeShow', this.colorPickerChangeShow.bind(this));\n }\n\n /**\n * Remove event\n * @private\n */\n _removeEvent() {\n this._els.shapeSelectButton.removeEventListener('click', this.eventHandler.shapeTypeSelected);\n this._els.strokeRange.off();\n this._els.fillColorpicker.off();\n this._els.strokeColorpicker.off();\n }\n\n /**\n * Set Shape status\n * @param {Object} options - options of shape status\n * @param {string} strokeWidth - stroke width\n * @param {string} strokeColor - stroke color\n * @param {string} fillColor - fill color\n */\n setShapeStatus({ strokeWidth, strokeColor, fillColor }) {\n this._els.strokeRange.value = strokeWidth;\n this._els.strokeColorpicker.color = strokeColor;\n this._els.fillColorpicker.color = fillColor;\n this.options.stroke = strokeColor;\n this.options.fill = fillColor;\n this.options.strokeWidth = strokeWidth;\n\n this.actions.setDrawingShape(this.type, { strokeWidth });\n }\n\n /**\n * Executed when the menu starts.\n */\n changeStartMode() {\n this.actions.stopDrawingMode();\n }\n\n /**\n * Returns the menu to its default state.\n */\n changeStandbyMode() {\n this.type = null;\n this.actions.changeSelectableAll(true);\n this._els.shapeSelectButton.classList.remove('circle');\n this._els.shapeSelectButton.classList.remove('triangle');\n this._els.shapeSelectButton.classList.remove('rect');\n }\n\n /**\n * set range stroke max value\n * @param {number} maxValue - expect max value for change\n */\n setMaxStrokeValue(maxValue) {\n let strokeMaxValue = maxValue;\n if (strokeMaxValue <= 0) {\n strokeMaxValue = defaultShapeStrokeValues.max;\n }\n this._els.strokeRange.max = strokeMaxValue;\n }\n\n /**\n * Set stroke value\n * @param {number} value - expect value for strokeRange change\n */\n setStrokeValue(value) {\n this._els.strokeRange.value = value;\n this._els.strokeRange.trigger('change');\n }\n\n /**\n * Get stroke value\n * @returns {number} - stroke range value\n */\n getStrokeValue() {\n return this._els.strokeRange.value;\n }\n\n /**\n * Change icon color\n * @param {object} event - add button event object\n * @private\n */\n _changeShapeHandler(event) {\n const button = event.target.closest('.tui-image-editor-button');\n if (button) {\n this.actions.stopDrawingMode();\n this.actions.discardSelection();\n const shapeType = this.getButtonType(button, ['circle', 'triangle', 'rect']);\n\n if (this.type === shapeType) {\n this.changeStandbyMode();\n\n return;\n }\n this.changeStandbyMode();\n this.type = shapeType;\n event.currentTarget.classList.add(shapeType);\n this.actions.changeSelectableAll(false);\n this.actions.modeChange('shape');\n }\n }\n\n /**\n * Change stroke range\n * @param {number} value - stroke range value\n * @param {boolean} isLast - Is last change\n * @private\n */\n _changeStrokeRangeHandler(value, isLast) {\n this.options.strokeWidth = toInteger(value);\n this.actions.changeShape(\n {\n strokeWidth: value,\n },\n !isLast\n );\n\n this.actions.setDrawingShape(this.type, this.options);\n }\n\n /**\n * Change shape color\n * @param {string} color - fill color\n * @private\n */\n _changeFillColorHandler(color) {\n color = color || 'transparent';\n this.options.fill = color;\n this.actions.changeShape({\n fill: color,\n });\n }\n\n /**\n * Change shape stroke color\n * @param {string} color - fill color\n * @private\n */\n _changeStrokeColorHandler(color) {\n color = color || 'transparent';\n this.options.stroke = color;\n this.actions.changeShape({\n stroke: color,\n });\n }\n}\n\nexport default Shape;\n","/**\n * Submenu Base Class\n * @class\n * @ignore\n */\nclass Submenu {\n /**\n * @param {HTMLElement} subMenuElement - submenu dom element\n * @param {Locale} locale - translate text\n * @param {string} name - name of sub menu\n * @param {Object} iconStyle - style of icon\n * @param {string} menuBarPosition - position of menu\n * @param {*} templateHtml - template for SubMenuElement\n * @param {boolean} [usageStatistics=false] - template for SubMenuElement\n */\n constructor(\n subMenuElement,\n { locale, name, makeSvgIcon, menuBarPosition, templateHtml, usageStatistics }\n ) {\n this.subMenuElement = subMenuElement;\n this.menuBarPosition = menuBarPosition;\n this.toggleDirection = menuBarPosition === 'top' ? 'down' : 'up';\n this.colorPickerControls = [];\n this.usageStatistics = usageStatistics;\n this.eventHandler = {};\n this._makeSubMenuElement({\n locale,\n name,\n makeSvgIcon,\n templateHtml,\n });\n }\n\n /**\n * editor dom ui query selector\n * @param {string} selectName - query selector string name\n * @returns {HTMLElement}\n */\n selector(selectName) {\n return this.subMenuElement.querySelector(selectName);\n }\n\n /**\n * change show state change for colorpicker instance\n * @param {Colorpicker} occurredControl - target Colorpicker Instance\n */\n colorPickerChangeShow(occurredControl) {\n this.colorPickerControls.forEach((pickerControl) => {\n if (occurredControl !== pickerControl) {\n pickerControl.hide();\n }\n });\n }\n\n /**\n * Get button type\n * @param {HTMLElement} button - event target element\n * @param {array} buttonNames - Array of button names\n * @returns {string} - button type\n */\n getButtonType(button, buttonNames) {\n return button.className.match(RegExp(`(${buttonNames.join('|')})`))[0];\n }\n\n /**\n * Get button type\n * @param {HTMLElement} target - event target element\n * @param {string} removeClass - remove class name\n * @param {string} addClass - add class name\n */\n changeClass(target, removeClass, addClass) {\n target.classList.remove(removeClass);\n target.classList.add(addClass);\n }\n\n /**\n * Interface method whose implementation is optional.\n * Returns the menu to its default state.\n */\n changeStandbyMode() {}\n\n /**\n * Interface method whose implementation is optional.\n * Executed when the menu starts.\n */\n changeStartMode() {}\n\n /**\n * Make submenu dom element\n * @param {Locale} locale - translate text\n * @param {string} name - submenu name\n * @param {Object} iconStyle - icon style\n * @param {*} templateHtml - template for SubMenuElement\n * @private\n */\n _makeSubMenuElement({ locale, name, iconStyle, makeSvgIcon, templateHtml }) {\n const iconSubMenu = document.createElement('div');\n iconSubMenu.className = `tui-image-editor-menu-${name}`;\n iconSubMenu.innerHTML = templateHtml({\n locale,\n iconStyle,\n makeSvgIcon,\n });\n\n this.subMenuElement.appendChild(iconSubMenu);\n }\n}\n\nexport default Submenu;\n","import { getHelpMenuBarPosition } from '@/util';\n\nexport default ({ locale, biImage, loadButtonStyle, downloadButtonStyle, menuBarPosition }) => `\n
        \n
        \n
        \n \n
        \n
          \n\n
          \n
          \n ${locale.localize('Load')}\n \n
          \n \n
          \n
          \n`;\n","export default ({\n locale,\n biImage,\n commonStyle,\n headerStyle,\n loadButtonStyle,\n downloadButtonStyle,\n submenuStyle,\n}) => `\n
          \n
          \n
          \n \n
          \n
          \n
          \n ${locale.localize('Load')}\n \n
          \n \n
          \n
          \n
          \n
          \n
          \n
          \n
          \n
          \n
          \n
          \n
          \n
          \n
          \n
          \n
          \n`;\n","export default ({\n subMenuLabelActive,\n subMenuLabelNormal,\n subMenuRangeTitle,\n submenuPartitionVertical,\n submenuPartitionHorizontal,\n submenuCheckbox,\n submenuRangePointer,\n submenuRangeValue,\n submenuColorpickerTitle,\n submenuColorpickerButton,\n submenuRangeBar,\n submenuRangeSubbar,\n submenuDisabledRangePointer,\n submenuDisabledRangeBar,\n submenuDisabledRangeSubbar,\n submenuIconSize,\n menuIconSize,\n biSize,\n menuIconStyle,\n submenuIconStyle,\n}) => `\n .tie-icon-add-button.icon-bubble .tui-image-editor-button[data-icontype=\"icon-bubble\"] label,\n .tie-icon-add-button.icon-heart .tui-image-editor-button[data-icontype=\"icon-heart\"] label,\n .tie-icon-add-button.icon-location .tui-image-editor-button[data-icontype=\"icon-location\"] label,\n .tie-icon-add-button.icon-polygon .tui-image-editor-button[data-icontype=\"icon-polygon\"] label,\n .tie-icon-add-button.icon-star .tui-image-editor-button[data-icontype=\"icon-star\"] label,\n .tie-icon-add-button.icon-star-2 .tui-image-editor-button[data-icontype=\"icon-star-2\"] label,\n .tie-icon-add-button.icon-arrow-3 .tui-image-editor-button[data-icontype=\"icon-arrow-3\"] label,\n .tie-icon-add-button.icon-arrow-2 .tui-image-editor-button[data-icontype=\"icon-arrow-2\"] label,\n .tie-icon-add-button.icon-arrow .tui-image-editor-button[data-icontype=\"icon-arrow\"] label,\n .tie-icon-add-button.icon-bubble .tui-image-editor-button[data-icontype=\"icon-bubble\"] label,\n .tie-draw-line-select-button.line .tui-image-editor-button.line label,\n .tie-draw-line-select-button.free .tui-image-editor-button.free label,\n .tie-flip-button.flipX .tui-image-editor-button.flipX label,\n .tie-flip-button.flipY .tui-image-editor-button.flipY label,\n .tie-flip-button.resetFlip .tui-image-editor-button.resetFlip label,\n .tie-crop-button .tui-image-editor-button.apply.active label,\n .tie-crop-preset-button .tui-image-editor-button.preset.active label,\n .tie-shape-button.rect .tui-image-editor-button.rect label,\n .tie-shape-button.circle .tui-image-editor-button.circle label,\n .tie-shape-button.triangle .tui-image-editor-button.triangle label,\n .tie-text-effect-button .tui-image-editor-button.active label,\n .tie-text-align-button.left .tui-image-editor-button.left label,\n .tie-text-align-button.center .tui-image-editor-button.center label,\n .tie-text-align-button.right .tui-image-editor-button.right label,\n .tie-mask-apply.apply.active .tui-image-editor-button.apply label,\n .tui-image-editor-container .tui-image-editor-submenu .tui-image-editor-button:hover > label,\n .tui-image-editor-container .tui-image-editor-checkbox label > span {\n ${subMenuLabelActive}\n }\n .tui-image-editor-container .tui-image-editor-submenu .tui-image-editor-button > label,\n .tui-image-editor-container .tui-image-editor-range-wrap.tui-image-editor-newline.short label,\n .tui-image-editor-container .tui-image-editor-range-wrap.tui-image-editor-newline.short label > span {\n ${subMenuLabelNormal}\n }\n .tui-image-editor-container .tui-image-editor-range-wrap label > span {\n ${subMenuRangeTitle}\n }\n .tui-image-editor-container .tui-image-editor-partition > div {\n ${submenuPartitionVertical}\n }\n .tui-image-editor-container.left .tui-image-editor-submenu .tui-image-editor-partition > div,\n .tui-image-editor-container.right .tui-image-editor-submenu .tui-image-editor-partition > div {\n ${submenuPartitionHorizontal}\n }\n .tui-image-editor-container .tui-image-editor-checkbox label > span:before {\n ${submenuCheckbox}\n }\n .tui-image-editor-container .tui-image-editor-checkbox label > input:checked + span:before {\n border: 0;\n }\n .tui-image-editor-container .tui-image-editor-virtual-range-pointer {\n ${submenuRangePointer}\n }\n .tui-image-editor-container .tui-image-editor-virtual-range-bar {\n ${submenuRangeBar}\n }\n .tui-image-editor-container .tui-image-editor-virtual-range-subbar {\n ${submenuRangeSubbar}\n }\n .tui-image-editor-container .tui-image-editor-disabled .tui-image-editor-virtual-range-pointer {\n ${submenuDisabledRangePointer}\n }\n .tui-image-editor-container .tui-image-editor-disabled .tui-image-editor-virtual-range-subbar {\n ${submenuDisabledRangeSubbar}\n }\n .tui-image-editor-container .tui-image-editor-disabled .tui-image-editor-virtual-range-bar {\n ${submenuDisabledRangeBar}\n }\n .tui-image-editor-container .tui-image-editor-range-value {\n ${submenuRangeValue}\n }\n .tui-image-editor-container .tui-image-editor-submenu .tui-image-editor-button .color-picker-value + label {\n ${submenuColorpickerTitle}\n }\n .tui-image-editor-container .tui-image-editor-submenu .tui-image-editor-button .color-picker-value {\n ${submenuColorpickerButton}\n }\n .tui-image-editor-container .svg_ic-menu {\n ${menuIconSize}\n }\n .tui-image-editor-container .svg_ic-submenu {\n ${submenuIconSize}\n }\n .tui-image-editor-container .tui-image-editor-controls-logo > img,\n .tui-image-editor-container .tui-image-editor-header-logo > img {\n ${biSize}\n }\n .tui-image-editor-menu use.normal.use-default,\n .tui-image-editor-help-menu use.normal.use-default {\n fill-rule: evenodd;\n fill: ${menuIconStyle.normal.color};\n stroke: ${menuIconStyle.normal.color};\n }\n .tui-image-editor-menu use.active.use-default,\n .tui-image-editor-help-menu use.active.use-default {\n fill-rule: evenodd;\n fill: ${menuIconStyle.active.color};\n stroke: ${menuIconStyle.active.color};\n }\n .tui-image-editor-menu use.hover.use-default,\n .tui-image-editor-help-menu use.hover.use-default {\n fill-rule: evenodd;\n fill: ${menuIconStyle.hover.color};\n stroke: ${menuIconStyle.hover.color};\n }\n .tui-image-editor-menu use.disabled.use-default,\n .tui-image-editor-help-menu use.disabled.use-default {\n fill-rule: evenodd;\n fill: ${menuIconStyle.disabled.color};\n stroke: ${menuIconStyle.disabled.color};\n }\n .tui-image-editor-submenu use.normal.use-default {\n fill-rule: evenodd;\n fill: ${submenuIconStyle.normal.color};\n stroke: ${submenuIconStyle.normal.color};\n }\n .tui-image-editor-submenu use.active.use-default {\n fill-rule: evenodd;\n fill: ${submenuIconStyle.active.color};\n stroke: ${submenuIconStyle.active.color};\n }\n`;\n","/**\n * @param {Object} submenuInfo - submenu info for make template\n * @param {Locale} locale - Translate text\n * @param {Function} makeSvgIcon - svg icon generator\n * @returns {string}\n */\nexport default ({ locale, makeSvgIcon }) => `\n
            \n
          • \n
            \n
            \n ${makeSvgIcon(['normal', 'active'], 'shape-rectangle', true)}\n
            \n \n
            \n
            \n
            \n ${makeSvgIcon(['normal', 'active'], 'crop', true)}\n
            \n \n
            \n
            \n
            \n ${makeSvgIcon(['normal', 'active'], 'crop', true)}\n
            \n \n
            \n
            \n
            \n ${makeSvgIcon(['normal', 'active'], 'crop', true)}\n
            \n \n
            \n
            \n
            \n ${makeSvgIcon(['normal', 'active'], 'crop', true)}\n
            \n \n
            \n
            \n
            \n ${makeSvgIcon(['normal', 'active'], 'crop', true)}\n
            \n \n
            \n
            \n
            \n ${makeSvgIcon(['normal', 'active'], 'crop', true)}\n
            \n \n
            \n
          • \n
          • \n
          • \n
          • \n
            \n
          • \n
          • \n
            \n ${makeSvgIcon(['normal', 'active'], 'apply')}\n \n
            \n
            \n ${makeSvgIcon(['normal', 'active'], 'cancel')}\n \n
            \n
          • \n
          \n`;\n","/**\n * @param {Object} submenuInfo - submenu info for make template\n * @param {Locale} locale - Translate text\n * @param {Function} makeSvgIcon - svg icon generator\n * @returns {string}\n */\nexport default ({ locale, makeSvgIcon }) => `\n
            \n
          • \n
            \n
            \n ${makeSvgIcon(['normal', 'active'], 'draw-free', true)}\n
            \n \n
            \n
            \n
            \n ${makeSvgIcon(['normal', 'active'], 'draw-line', true)}\n
            \n \n
            \n
          • \n
          • \n
            \n
          • \n
          • \n
            \n
          • \n
          • \n
            \n
          • \n
          • \n \n
            \n \n
          • \n
          \n`;\n","/**\n * @param {Locale} locale - Translate text\n * @returns {string}\n */\nexport default ({ locale }) => `\n
            \n
          • \n
            \n
            \n \n
            \n
            \n \n
            \n
            \n \n
            \n
            \n \n
            \n
            \n \n
            \n
            \n \n
            \n
            \n \n
            \n
            \n
          • \n
          • \n
            \n
          • \n
          • \n
            \n
            \n
            \n \n
            \n
            \n
            \n \n
            \n
            \n
            \n
            \n
            \n \n
            \n
            \n
            \n
            \n
            \n
            \n
            \n \n
            \n
            \n
            \n
            \n
            \n
          • \n
          • \n
            \n
          • \n
          • \n
            \n
            \n \n
            \n
            \n
            \n
            \n
            \n
            \n
            \n
            \n \n
            \n
            \n
            \n \n
            \n
            \n
            \n
          • \n
          • \n
            \n
          • \n
          • \n
            \n
            \n
            \n \n
            \n
            \n
            \n
            \n
            \n \n
            \n
            \n
            \n
            \n
            \n \n
            \n
            \n
          • \n
          \n`;\n","/**\n * @param {Object} submenuInfo - submenu info for make template\n * @param {Locale} locale - Translate text\n * @param {Function} makeSvgIcon - svg icon generator\n * @returns {string}\n */\nexport default ({ locale, makeSvgIcon }) => `\n
            \n
          • \n
            \n
            \n ${makeSvgIcon(['normal', 'active'], 'flip-x', true)}\n
            \n \n
            \n
            \n
            \n ${makeSvgIcon(['normal', 'active'], 'flip-y', true)}\n
            \n \n
            \n
          • \n
          • \n
            \n
          • \n
          • \n
            \n
            \n ${makeSvgIcon(['normal', 'active'], 'flip-reset', true)}\n
            \n \n
            \n
          • \n
          \n`;\n","/**\n * @param {Object} submenuInfo - submenu info for make template\n * @param {Locale} locale - Translate text\n * @param {Function} makeSvgIcon - svg icon generator\n * @param {string} name - history name\n * @param {string} detail - history detail information\n * @returns {string}\n */\nexport default ({ locale, makeSvgIcon, name, detail }) => `\n
          \n
          \n ${makeSvgIcon(['normal', 'active'], `history-${name.toLowerCase()}`, true)}\n
          \n \n ${locale.localize(name)}\n ${detail ? `(${locale.localize(detail)})` : ''}\n \n
          \n ${makeSvgIcon(['normal'], 'history-check', true)}\n
          \n
          \n`;\n","/**\n * @param {Object} submenuInfo - submenu info for make template\n * @param {Locale} locale - Translate text\n * @param {Function} makeSvgIcon - svg icon generator\n * @returns {string}\n */\nexport default ({ locale, makeSvgIcon }) => `\n
            \n
          • \n
            \n
            \n ${makeSvgIcon(['normal', 'active'], 'icon-arrow', true)}\n
            \n \n
            \n
            \n
            \n ${makeSvgIcon(['normal', 'active'], 'icon-arrow-2', true)}\n
            \n \n
            \n
            \n
            \n ${makeSvgIcon(['normal', 'active'], 'icon-arrow-3', true)}\n
            \n \n
            \n
            \n
            \n ${makeSvgIcon(['normal', 'active'], 'icon-star', true)}\n
            \n \n
            \n
            \n
            \n ${makeSvgIcon(['normal', 'active'], 'icon-star-2', true)}\n
            \n \n
            \n\n
            \n
            \n ${makeSvgIcon(['normal', 'active'], 'icon-polygon', true)}\n
            \n \n
            \n\n
            \n
            \n ${makeSvgIcon(['normal', 'active'], 'icon-location', true)}\n
            \n \n
            \n\n
            \n
            \n ${makeSvgIcon(['normal', 'active'], 'icon-heart', true)}\n
            \n \n
            \n\n
            \n
            \n ${makeSvgIcon(['normal', 'active'], 'icon-bubble', true)}\n
            \n \n
            \n
          • \n
          • \n
            \n
          • \n
          • \n
            \n
            \n \n ${makeSvgIcon(['normal', 'active'], 'icon-load', true)}\n
            \n \n
            \n
          • \n
          • \n
            \n
          • \n
          • \n
            \n
          • \n
          \n`;\n","/**\n * @param {Object} submenuInfo - submenu info for make template\n * @param {Locale} locale - Translate text\n * @param {Function} makeSvgIcon - svg icon generator\n * @returns {string}\n */\nexport default ({ locale, makeSvgIcon }) => `\n
            \n
          • \n
            \n
            \n \n ${makeSvgIcon(['normal', 'active'], 'mask-load', true)}\n
            \n \n
            \n
          • \n
          • \n
            \n
          • \n
          • \n
            \n ${makeSvgIcon(['normal', 'active'], 'apply')}\n \n
            \n
          • \n
          \n`;\n","/**\n * @param {Object} submenuInfo - submenu info for make template\n * @param {Locale} locale - Translate text\n * @param {Function} makeSvgIcon - svg icon generator\n * @returns {string}\n */\nexport default ({ locale, makeSvgIcon }) => `\n
            \n
          • \n
            \n
            \n ${makeSvgIcon(['normal', 'active'], 'rotate-clockwise', true)}\n
            \n \n
            \n
            \n
            \n ${makeSvgIcon(['normal', 'active'], 'rotate-counterclockwise', true)}\n
            \n \n
            \n
          • \n
          • \n
            \n
          • \n
          • \n \n
            \n \n
          • \n
          \n`;\n","/**\n * @param {Object} submenuInfo - submenu info for make template\n * @param {Locale} locale - Translate text\n * @param {Function} makeSvgIcon - svg icon generator\n * @returns {string}\n */\nexport default ({ locale, makeSvgIcon }) => `\n
            \n
          • \n
            \n
            \n ${makeSvgIcon(['normal', 'active'], 'shape-rectangle', true)}\n
            \n \n
            \n
            \n
            \n ${makeSvgIcon(['normal', 'active'], 'shape-circle', true)}\n
            \n \n
            \n
            \n
            \n ${makeSvgIcon(['normal', 'active'], 'shape-triangle', true)}\n
            \n \n
            \n
          • \n
          • \n
            \n
          • \n
          • \n
            \n
            \n
          • \n
          • \n
            \n
          • \n
          • \n \n
            \n \n
          • \n
          \n`;\n","/**\n * @param {Object} submenuInfo - submenu info for make template\n * @param {Locale} locale - Translate text\n * @param {Function} makeSvgIcon - svg icon generator\n * @returns {string}\n */\nexport default ({ locale, makeSvgIcon }) => `\n
            \n
          • \n
            \n
            \n ${makeSvgIcon(['normal', 'active'], 'text-bold', true)}\n
            \n \n
            \n
            \n
            \n ${makeSvgIcon(['normal', 'active'], 'text-italic', true)}\n
            \n \n
            \n
            \n
            \n ${makeSvgIcon(['normal', 'active'], 'text-underline', true)}\n
            \n \n
            \n
          • \n
          • \n
            \n
          • \n
          • \n
            \n
            \n ${makeSvgIcon(['normal', 'active'], 'text-align-left', true)}\n
            \n \n
            \n
            \n
            \n ${makeSvgIcon(['normal', 'active'], 'text-align-center', true)}\n
            \n \n
            \n
            \n
            \n ${makeSvgIcon(['normal', 'active'], 'text-align-right', true)}\n
            \n \n
            \n
          • \n
          • \n
            \n
          • \n
          • \n
            \n
          • \n
          • \n
            \n
          • \n
          • \n \n
            \n \n
          • \n
          \n`;\n","import Range from '@/ui/tools/range';\nimport Colorpicker from '@/ui/tools/colorpicker';\nimport Submenu from '@/ui/submenuBase';\nimport templateHtml from '@/ui/template/submenu/text';\nimport { assignmentForDestroy } from '@/util';\nimport { defaultTextRangeValues } from '@/consts';\n\n/**\n * Crop ui class\n * @class\n * @ignore\n */\nexport default class Text extends Submenu {\n constructor(subMenuElement, { locale, makeSvgIcon, menuBarPosition, usageStatistics }) {\n super(subMenuElement, {\n locale,\n name: 'text',\n makeSvgIcon,\n menuBarPosition,\n templateHtml,\n usageStatistics,\n });\n this.effect = {\n bold: false,\n italic: false,\n underline: false,\n };\n this.align = 'left';\n this._els = {\n textEffectButton: this.selector('.tie-text-effect-button'),\n textAlignButton: this.selector('.tie-text-align-button'),\n textColorpicker: new Colorpicker(\n this.selector('.tie-text-color'),\n '#ffbb3b',\n this.toggleDirection,\n this.usageStatistics\n ),\n textRange: new Range(\n {\n slider: this.selector('.tie-text-range'),\n input: this.selector('.tie-text-range-value'),\n },\n defaultTextRangeValues\n ),\n };\n }\n\n /**\n * Destroys the instance.\n */\n destroy() {\n this._removeEvent();\n this._els.textColorpicker.destroy();\n this._els.textRange.destroy();\n\n assignmentForDestroy(this);\n }\n\n /**\n * Add event for text\n * @param {Object} actions - actions for text\n * @param {Function} actions.changeTextStyle - change text style\n */\n addEvent(actions) {\n const setTextEffect = this._setTextEffectHandler.bind(this);\n const setTextAlign = this._setTextAlignHandler.bind(this);\n\n this.eventHandler = {\n setTextEffect,\n setTextAlign,\n };\n\n this.actions = actions;\n this._els.textEffectButton.addEventListener('click', setTextEffect);\n this._els.textAlignButton.addEventListener('click', setTextAlign);\n this._els.textRange.on('change', this._changeTextRnageHandler.bind(this));\n this._els.textColorpicker.on('change', this._changeColorHandler.bind(this));\n }\n\n /**\n * Remove event\n * @private\n */\n _removeEvent() {\n const { setTextEffect, setTextAlign } = this.eventHandler;\n\n this._els.textEffectButton.removeEventListener('click', setTextEffect);\n this._els.textAlignButton.removeEventListener('click', setTextAlign);\n this._els.textRange.off();\n this._els.textColorpicker.off();\n }\n\n /**\n * Returns the menu to its default state.\n */\n changeStandbyMode() {\n this.actions.stopDrawingMode();\n }\n\n /**\n * Executed when the menu starts.\n */\n changeStartMode() {\n this.actions.modeChange('text');\n }\n\n set textColor(color) {\n this._els.textColorpicker.color = color;\n }\n\n /**\n * Get text color\n * @returns {string} - text color\n */\n get textColor() {\n return this._els.textColorpicker.color;\n }\n\n /**\n * Get text size\n * @returns {string} - text size\n */\n get fontSize() {\n return this._els.textRange.value;\n }\n\n /**\n * Set text size\n * @param {Number} value - text size\n */\n set fontSize(value) {\n this._els.textRange.value = value;\n }\n\n /**\n * get font style\n * @returns {string} - font style\n */\n get fontStyle() {\n return this.effect.italic ? 'italic' : 'normal';\n }\n\n /**\n * get font weight\n * @returns {string} - font weight\n */\n get fontWeight() {\n return this.effect.bold ? 'bold' : 'normal';\n }\n\n /**\n * get text underline text underline\n * @returns {boolean} - true or false\n */\n get underline() {\n return this.effect.underline;\n }\n\n setTextStyleStateOnAction(textStyle = {}) {\n const { fill, fontSize, fontStyle, fontWeight, textDecoration, textAlign } = textStyle;\n\n this.textColor = fill;\n this.fontSize = fontSize;\n this.setEffectState('italic', fontStyle);\n this.setEffectState('bold', fontWeight);\n this.setEffectState('underline', textDecoration);\n this.setAlignState(textAlign);\n }\n\n setEffectState(effectName, value) {\n const effectValue = value === 'italic' || value === 'bold' || value === 'underline';\n const button = this._els.textEffectButton.querySelector(\n `.tui-image-editor-button.${effectName}`\n );\n\n this.effect[effectName] = effectValue;\n\n button.classList[effectValue ? 'add' : 'remove']('active');\n }\n\n setAlignState(value) {\n const button = this._els.textAlignButton;\n button.classList.remove(this.align);\n button.classList.add(value);\n this.align = value;\n }\n\n /**\n * text effect set handler\n * @param {object} event - add button event object\n * @private\n */\n _setTextEffectHandler(event) {\n const button = event.target.closest('.tui-image-editor-button');\n if (button) {\n const [styleType] = button.className.match(/(bold|italic|underline)/);\n const styleObj = {\n bold: { fontWeight: 'bold' },\n italic: { fontStyle: 'italic' },\n underline: { textDecoration: 'underline' },\n }[styleType];\n\n this.effect[styleType] = !this.effect[styleType];\n button.classList.toggle('active');\n this.actions.changeTextStyle(styleObj);\n }\n }\n\n /**\n * text effect set handler\n * @param {object} event - add button event object\n * @private\n */\n _setTextAlignHandler(event) {\n const button = event.target.closest('.tui-image-editor-button');\n if (button) {\n const styleType = this.getButtonType(button, ['left', 'center', 'right']);\n\n event.currentTarget.classList.remove(this.align);\n if (this.align !== styleType) {\n event.currentTarget.classList.add(styleType);\n }\n this.actions.changeTextStyle({ textAlign: styleType });\n\n this.align = styleType;\n }\n }\n\n /**\n * text align set handler\n * @param {number} value - range value\n * @param {boolean} isLast - Is last change\n * @private\n */\n _changeTextRnageHandler(value, isLast) {\n this.actions.changeTextStyle(\n {\n fontSize: value,\n },\n !isLast\n );\n }\n\n /**\n * change color handler\n * @param {string} color - change color string\n * @private\n */\n _changeColorHandler(color) {\n color = color || 'transparent';\n this.actions.changeTextStyle({\n fill: color,\n });\n }\n}\n","/**\n * @author NHN. FE Development Team \n * @fileoverview The standard theme\n */\n\n/**\n * Full configuration for theme.
          \n * @typedef {object} themeConfig\n * @property {string} common.bi.image - Brand icon image\n * @property {string} common.bisize.width - Icon image width\n * @property {string} common.bisize.height - Icon Image Height\n * @property {string} common.backgroundImage - Background image\n * @property {string} common.backgroundColor - Background color\n * @property {string} common.border - Full area border style\n * @property {string} header.backgroundImage - header area background\n * @property {string} header.backgroundColor - header area background color\n * @property {string} header.border - header area border style\n * @property {string} loadButton.backgroundColor - load button background color\n * @property {string} loadButton.border - load button border style\n * @property {string} loadButton.color - load button foreground color\n * @property {string} loadButton.fontFamily - load button font type\n * @property {string} loadButton.fontSize - load button font size\n * @property {string} downloadButton.backgroundColor - download button background color\n * @property {string} downloadButton.border - download button border style\n * @property {string} downloadButton.color - download button foreground color\n * @property {string} downloadButton.fontFamily - download button font type\n * @property {string} downloadButton.fontSize - download button font size\n * @property {string} menu.normalIcon.color - Menu normal color for default icon\n * @property {string} menu.normalIcon.path - Menu normal icon svg bundle file path\n * @property {string} menu.normalIcon.name - Menu normal icon svg bundle name\n * @property {string} menu.activeIcon.color - Menu active color for default icon\n * @property {string} menu.activeIcon.path - Menu active icon svg bundle file path\n * @property {string} menu.activeIcon.name - Menu active icon svg bundle name\n * @property {string} menu.disabled.color - Menu disabled color for default icon\n * @property {string} menu.disabled.path - Menu disabled icon svg bundle file path\n * @property {string} menu.disabled.name - Menu disabled icon svg bundle name\n * @property {string} menu.hover.color - Menu default icon hover color\n * @property {string} menu.hover.path - Menu hover icon svg bundle file path\n * @property {string} menu.hover.name - Menu hover icon svg bundle name\n * @property {string} menu.iconSize.width - Menu icon Size Width\n * @property {string} menu.iconSize.height - Menu Icon Size Height\n * @property {string} submenu.backgroundColor - Sub-menu area background color\n * @property {string} submenu.partition.color - Submenu partition line color\n * @property {string} submenu.normalIcon.color - Submenu normal color for default icon\n * @property {string} submenu.normalIcon.path - Submenu default icon svg bundle file path\n * @property {string} submenu.normalIcon.name - Submenu default icon svg bundle name\n * @property {string} submenu.activeIcon.color - Submenu active color for default icon\n * @property {string} submenu.activeIcon.path - Submenu active icon svg bundle file path\n * @property {string} submenu.activeIcon.name - Submenu active icon svg bundle name\n * @property {string} submenu.iconSize.width - Submenu icon Size Width\n * @property {string} submenu.iconSize.height - Submenu Icon Size Height\n * @property {string} submenu.normalLabel.color - Submenu default label color\n * @property {string} submenu.normalLabel.fontWeight - Sub Menu Default Label Font Thickness\n * @property {string} submenu.activeLabel.color - Submenu active label color\n * @property {string} submenu.activeLabel.fontWeight - Submenu active label Font thickness\n * @property {string} checkbox.border - Checkbox border style\n * @property {string} checkbox.backgroundColor - Checkbox background color\n * @property {string} range.pointer.color - range control pointer color\n * @property {string} range.bar.color - range control bar color\n * @property {string} range.subbar.color - range control subbar color\n * @property {string} range.value.color - range number box font color\n * @property {string} range.value.fontWeight - range number box font thickness\n * @property {string} range.value.fontSize - range number box font size\n * @property {string} range.value.border - range number box border style\n * @property {string} range.value.backgroundColor - range number box background color\n * @property {string} range.title.color - range title font color\n * @property {string} range.title.fontWeight - range title font weight\n * @property {string} colorpicker.button.border - colorpicker button border style\n * @property {string} colorpicker.title.color - colorpicker button title font color\n * @example\n // default keys and styles\n var customTheme = {\n 'common.bi.image': 'https://uicdn.toast.com/toastui/img/tui-image-editor-bi.png',\n 'common.bisize.width': '251px',\n 'common.bisize.height': '21px',\n 'common.backgroundImage': 'none',\n 'common.backgroundColor': '#1e1e1e',\n 'common.border': '0px',\n\n // header\n 'header.backgroundImage': 'none',\n 'header.backgroundColor': 'transparent',\n 'header.border': '0px',\n\n // load button\n 'loadButton.backgroundColor': '#fff',\n 'loadButton.border': '1px solid #ddd',\n 'loadButton.color': '#222',\n 'loadButton.fontFamily': 'NotoSans, sans-serif',\n 'loadButton.fontSize': '12px',\n\n // download button\n 'downloadButton.backgroundColor': '#fdba3b',\n 'downloadButton.border': '1px solid #fdba3b',\n 'downloadButton.color': '#fff',\n 'downloadButton.fontFamily': 'NotoSans, sans-serif',\n 'downloadButton.fontSize': '12px',\n\n // icons default\n 'menu.normalIcon.color': '#8a8a8a',\n 'menu.activeIcon.color': '#555555',\n 'menu.disabledIcon.color': '#434343',\n 'menu.hoverIcon.color': '#e9e9e9',\n 'submenu.normalIcon.color': '#8a8a8a',\n 'submenu.activeIcon.color': '#e9e9e9',\n\n 'menu.iconSize.width': '24px',\n 'menu.iconSize.height': '24px',\n 'submenu.iconSize.width': '32px',\n 'submenu.iconSize.height': '32px',\n\n // submenu primary color\n 'submenu.backgroundColor': '#1e1e1e',\n 'submenu.partition.color': '#858585',\n\n // submenu labels\n 'submenu.normalLabel.color': '#858585',\n 'submenu.normalLabel.fontWeight': 'lighter',\n 'submenu.activeLabel.color': '#fff',\n 'submenu.activeLabel.fontWeight': 'lighter',\n\n // checkbox style\n 'checkbox.border': '1px solid #ccc',\n 'checkbox.backgroundColor': '#fff',\n\n // rango style\n 'range.pointer.color': '#fff',\n 'range.bar.color': '#666',\n 'range.subbar.color': '#d1d1d1',\n\n 'range.disabledPointer.color': '#414141',\n 'range.disabledBar.color': '#282828',\n 'range.disabledSubbar.color': '#414141',\n\n 'range.value.color': '#fff',\n 'range.value.fontWeight': 'lighter',\n 'range.value.fontSize': '11px',\n 'range.value.border': '1px solid #353535',\n 'range.value.backgroundColor': '#151515',\n 'range.title.color': '#fff',\n 'range.title.fontWeight': 'lighter',\n\n // colorpicker style\n 'colorpicker.button.border': '1px solid #1e1e1e',\n 'colorpicker.title.color': '#fff'\n};\n */\nexport default {\n 'common.bi.image': 'https://uicdn.toast.com/toastui/img/tui-image-editor-bi.png',\n 'common.bisize.width': '251px',\n 'common.bisize.height': '21px',\n 'common.backgroundImage': 'none',\n 'common.backgroundColor': '#1e1e1e',\n 'common.border': '0px',\n\n // header\n 'header.backgroundImage': 'none',\n 'header.backgroundColor': 'transparent',\n 'header.border': '0px',\n\n // load button\n 'loadButton.backgroundColor': '#fff',\n 'loadButton.border': '1px solid #ddd',\n 'loadButton.color': '#222',\n 'loadButton.fontFamily': \"'Noto Sans', sans-serif\",\n 'loadButton.fontSize': '12px',\n\n // download button\n 'downloadButton.backgroundColor': '#fdba3b',\n 'downloadButton.border': '1px solid #fdba3b',\n 'downloadButton.color': '#fff',\n 'downloadButton.fontFamily': \"'Noto Sans', sans-serif\",\n 'downloadButton.fontSize': '12px',\n\n // main icons\n 'menu.normalIcon.color': '#8a8a8a',\n 'menu.activeIcon.color': '#555555',\n 'menu.disabledIcon.color': '#434343',\n 'menu.hoverIcon.color': '#e9e9e9',\n\n // submenu icons\n 'submenu.normalIcon.color': '#8a8a8a',\n 'submenu.activeIcon.color': '#e9e9e9',\n\n 'menu.iconSize.width': '24px',\n 'menu.iconSize.height': '24px',\n\n 'submenu.iconSize.width': '32px',\n 'submenu.iconSize.height': '32px',\n\n // submenu primary color\n 'submenu.backgroundColor': '#1e1e1e',\n 'submenu.partition.color': '#3c3c3c',\n\n // submenu labels\n 'submenu.normalLabel.color': '#8a8a8a',\n 'submenu.normalLabel.fontWeight': 'lighter',\n 'submenu.activeLabel.color': '#fff',\n 'submenu.activeLabel.fontWeight': 'lighter',\n\n // checkbox style\n 'checkbox.border': '0px',\n 'checkbox.backgroundColor': '#fff',\n\n // range style\n 'range.pointer.color': '#fff',\n 'range.bar.color': '#666',\n 'range.subbar.color': '#d1d1d1',\n\n 'range.disabledPointer.color': '#414141',\n 'range.disabledBar.color': '#282828',\n 'range.disabledSubbar.color': '#414141',\n\n 'range.value.color': '#fff',\n 'range.value.fontWeight': 'lighter',\n 'range.value.fontSize': '11px',\n 'range.value.border': '1px solid #353535',\n 'range.value.backgroundColor': '#151515',\n 'range.title.color': '#fff',\n 'range.title.fontWeight': 'lighter',\n\n // colorpicker style\n 'colorpicker.button.border': '1px solid #1e1e1e',\n 'colorpicker.title.color': '#fff',\n};\n","import { extend, forEach, map } from 'tui-code-snippet';\nimport style from '@/ui/template/style';\nimport standardTheme from '@/ui/theme/standard';\nimport icon from '@svg/default.svg';\nimport { styleLoad } from '@/util';\n\n/**\n * Theme manager\n * @class\n * @param {Object} customTheme - custom theme\n * @ignore\n */\nclass Theme {\n constructor(customTheme) {\n this.styles = this._changeToObject(extend({}, standardTheme, customTheme));\n styleLoad(this._styleMaker());\n\n this._loadDefaultSvgIcon();\n }\n\n /**\n * Get a Style cssText or StyleObject\n * @param {string} type - style type\n * @returns {string|object} - cssText or StyleObject\n */\n // eslint-disable-next-line complexity\n getStyle(type) {\n let result = null;\n const firstProperty = type.replace(/\\..+$/, '');\n const option = this.styles[type];\n switch (type) {\n case 'common.bi':\n result = this.styles[type].image;\n break;\n case 'menu.icon':\n result = {\n active: this.styles[`${firstProperty}.activeIcon`],\n normal: this.styles[`${firstProperty}.normalIcon`],\n hover: this.styles[`${firstProperty}.hoverIcon`],\n disabled: this.styles[`${firstProperty}.disabledIcon`],\n };\n break;\n case 'submenu.icon':\n result = {\n active: this.styles[`${firstProperty}.activeIcon`],\n normal: this.styles[`${firstProperty}.normalIcon`],\n };\n break;\n case 'submenu.label':\n result = {\n active: this._makeCssText(this.styles[`${firstProperty}.activeLabel`]),\n normal: this._makeCssText(this.styles[`${firstProperty}.normalLabel`]),\n };\n break;\n case 'submenu.partition':\n result = {\n vertical: this._makeCssText(\n extend({}, option, { borderLeft: `1px solid ${option.color}` })\n ),\n horizontal: this._makeCssText(\n extend({}, option, { borderBottom: `1px solid ${option.color}` })\n ),\n };\n break;\n\n case 'range.disabledPointer':\n case 'range.disabledBar':\n case 'range.disabledSubbar':\n case 'range.pointer':\n case 'range.bar':\n case 'range.subbar':\n option.backgroundColor = option.color;\n result = this._makeCssText(option);\n break;\n default:\n result = this._makeCssText(option);\n break;\n }\n\n return result;\n }\n\n /**\n * Make css resource\n * @returns {string} - serialized css text\n * @private\n */\n _styleMaker() {\n const submenuLabelStyle = this.getStyle('submenu.label');\n const submenuPartitionStyle = this.getStyle('submenu.partition');\n\n return style({\n subMenuLabelActive: submenuLabelStyle.active,\n subMenuLabelNormal: submenuLabelStyle.normal,\n submenuPartitionVertical: submenuPartitionStyle.vertical,\n submenuPartitionHorizontal: submenuPartitionStyle.horizontal,\n biSize: this.getStyle('common.bisize'),\n subMenuRangeTitle: this.getStyle('range.title'),\n submenuRangePointer: this.getStyle('range.pointer'),\n submenuRangeBar: this.getStyle('range.bar'),\n submenuRangeSubbar: this.getStyle('range.subbar'),\n\n submenuDisabledRangePointer: this.getStyle('range.disabledPointer'),\n submenuDisabledRangeBar: this.getStyle('range.disabledBar'),\n submenuDisabledRangeSubbar: this.getStyle('range.disabledSubbar'),\n\n submenuRangeValue: this.getStyle('range.value'),\n submenuColorpickerTitle: this.getStyle('colorpicker.title'),\n submenuColorpickerButton: this.getStyle('colorpicker.button'),\n submenuCheckbox: this.getStyle('checkbox'),\n menuIconSize: this.getStyle('menu.iconSize'),\n submenuIconSize: this.getStyle('submenu.iconSize'),\n menuIconStyle: this.getStyle('menu.icon'),\n submenuIconStyle: this.getStyle('submenu.icon'),\n });\n }\n\n /**\n * Change to low dimensional object.\n * @param {object} styleOptions - style object of user interface\n * @returns {object} low level object for style apply\n * @private\n */\n _changeToObject(styleOptions) {\n const styleObject = {};\n forEach(styleOptions, (value, key) => {\n const keyExplode = key.match(/^(.+)\\.([a-z]+)$/i);\n const [, property, subProperty] = keyExplode;\n\n if (!styleObject[property]) {\n styleObject[property] = {};\n }\n styleObject[property][subProperty] = value;\n });\n\n return styleObject;\n }\n\n /**\n * Style object to Csstext serialize\n * @param {object} styleObject - style object\n * @returns {string} - css text string\n * @private\n */\n _makeCssText(styleObject) {\n const converterStack = [];\n\n forEach(styleObject, (value, key) => {\n if (['backgroundImage'].indexOf(key) > -1 && value !== 'none') {\n value = `url(${value})`;\n }\n\n converterStack.push(`${this._toUnderScore(key)}: ${value}`);\n });\n\n return converterStack.join(';');\n }\n\n /**\n * Camel key string to Underscore string\n * @param {string} targetString - change target\n * @returns {string}\n * @private\n */\n _toUnderScore(targetString) {\n return targetString.replace(/([A-Z])/g, ($0, $1) => `-${$1.toLowerCase()}`);\n }\n\n /**\n * Load default svg icon\n * @private\n */\n _loadDefaultSvgIcon() {\n if (!document.getElementById('tui-image-editor-svg-default-icons')) {\n const parser = new DOMParser();\n const dom = parser.parseFromString(icon, 'text/xml');\n\n document.body.appendChild(dom.documentElement);\n }\n }\n\n /**\n * Make className for svg icon\n * @param {string} iconType - normal' or 'active' or 'hover' or 'disabled\n * @param {boolean} isSubmenu - submenu icon or not.\n * @returns {string}\n * @private\n */\n _makeIconClassName(iconType, isSubmenu) {\n const iconStyleInfo = isSubmenu ? this.getStyle('submenu.icon') : this.getStyle('menu.icon');\n const { path, name } = iconStyleInfo[iconType];\n\n return path && name ? iconType : `${iconType} use-default`;\n }\n\n /**\n * Make svg use link path name\n * @param {string} iconType - normal' or 'active' or 'hover' or 'disabled\n * @param {boolean} isSubmenu - submenu icon or not.\n * @returns {string}\n * @private\n */\n _makeSvgIconPrefix(iconType, isSubmenu) {\n const iconStyleInfo = isSubmenu ? this.getStyle('submenu.icon') : this.getStyle('menu.icon');\n const { path, name } = iconStyleInfo[iconType];\n\n return path && name ? `${path}#${name}-` : '#';\n }\n\n /**\n * Make svg use link path name\n * @param {Array.} useIconTypes - normal' or 'active' or 'hover' or 'disabled\n * @param {string} menuName - menu name\n * @param {boolean} isSubmenu - submenu icon or not.\n * @returns {string}\n * @private\n */\n _makeSvgItem(useIconTypes, menuName, isSubmenu) {\n return map(useIconTypes, (iconType) => {\n const svgIconPrefix = this._makeSvgIconPrefix(iconType, isSubmenu);\n const iconName = this._toUnderScore(menuName);\n const svgIconClassName = this._makeIconClassName(iconType, isSubmenu);\n\n return ``;\n }).join('');\n }\n\n /**\n * Make svg icon set\n * @param {Array.} useIconTypes - normal' or 'active' or 'hover' or 'disabled\n * @param {string} menuName - menu name\n * @param {boolean} isSubmenu - submenu icon or not.\n * @returns {string}\n */\n makeMenSvgIconSet(useIconTypes, menuName, isSubmenu = false) {\n return `${this._makeSvgItem(\n useIconTypes,\n menuName,\n isSubmenu\n )}`;\n }\n}\n\nexport default Theme;\n","import snippet from 'tui-code-snippet';\nimport tuiColorPicker from 'tui-color-picker';\n\nconst PICKER_COLOR = [\n '#000000',\n '#2a2a2a',\n '#545454',\n '#7e7e7e',\n '#a8a8a8',\n '#d2d2d2',\n '#ffffff',\n '',\n '#ff4040',\n '#ff6518',\n '#ffbb3b',\n '#03bd9e',\n '#00a9ff',\n '#515ce6',\n '#9e5fff',\n '#ff5583',\n];\n\n/**\n * Colorpicker control class\n * @class\n * @ignore\n */\nclass Colorpicker {\n constructor(\n colorpickerElement,\n defaultColor = '#7e7e7e',\n toggleDirection = 'up',\n usageStatistics\n ) {\n this.colorpickerElement = colorpickerElement;\n this.usageStatistics = usageStatistics;\n\n this._show = false;\n\n this._colorpickerElement = colorpickerElement;\n this._toggleDirection = toggleDirection;\n this._makePickerButtonElement(defaultColor);\n this._makePickerLayerElement(colorpickerElement, colorpickerElement.getAttribute('title'));\n this._color = defaultColor;\n this.picker = tuiColorPicker.create({\n container: this.pickerElement,\n preset: PICKER_COLOR,\n color: defaultColor,\n usageStatistics: this.usageStatistics,\n });\n\n this._addEvent();\n }\n\n /**\n * Destroys the instance.\n */\n destroy() {\n this._removeEvent();\n this.picker.destroy();\n this.colorpickerElement.innerHTML = '';\n snippet.forEach(this, (value, key) => {\n this[key] = null;\n });\n }\n\n /**\n * Get color\n * @returns {Number} color value\n */\n get color() {\n return this._color;\n }\n\n /**\n * Set color\n * @param {string} color color value\n */\n set color(color) {\n this._color = color;\n this._changeColorElement(color);\n }\n\n /**\n * Change color element\n * @param {string} color color value\n * #private\n */\n _changeColorElement(color) {\n if (color) {\n this.colorElement.classList.remove('transparent');\n this.colorElement.style.backgroundColor = color;\n } else {\n this.colorElement.style.backgroundColor = '#fff';\n this.colorElement.classList.add('transparent');\n }\n }\n\n /**\n * Make picker button element\n * @param {string} defaultColor color value\n * @private\n */\n _makePickerButtonElement(defaultColor) {\n this.colorpickerElement.classList.add('tui-image-editor-button');\n\n this.colorElement = document.createElement('div');\n this.colorElement.className = 'color-picker-value';\n if (defaultColor) {\n this.colorElement.style.backgroundColor = defaultColor;\n } else {\n this.colorElement.classList.add('transparent');\n }\n }\n\n /**\n * Make picker layer element\n * @param {HTMLElement} colorpickerElement color picker element\n * @param {string} title picker title\n * @private\n */\n _makePickerLayerElement(colorpickerElement, title) {\n const label = document.createElement('label');\n const triangle = document.createElement('div');\n\n this.pickerControl = document.createElement('div');\n this.pickerControl.className = 'color-picker-control';\n\n this.pickerElement = document.createElement('div');\n this.pickerElement.className = 'color-picker';\n\n label.innerHTML = title;\n triangle.className = 'triangle';\n\n this.pickerControl.appendChild(this.pickerElement);\n this.pickerControl.appendChild(triangle);\n\n colorpickerElement.appendChild(this.pickerControl);\n colorpickerElement.appendChild(this.colorElement);\n colorpickerElement.appendChild(label);\n }\n\n /**\n * Add event\n * @private\n */\n _addEvent() {\n this.picker.on('selectColor', (value) => {\n this._changeColorElement(value.color);\n this._color = value.color;\n this.fire('change', value.color);\n });\n\n this.eventHandler = {\n pickerToggle: this._pickerToggleEventHandler.bind(this),\n pickerHide: () => this.hide(),\n };\n\n this.colorpickerElement.addEventListener('click', this.eventHandler.pickerToggle);\n document.body.addEventListener('click', this.eventHandler.pickerHide);\n }\n\n /**\n * Remove event\n * @private\n */\n _removeEvent() {\n this.colorpickerElement.removeEventListener('click', this.eventHandler.pickerToggle);\n document.body.removeEventListener('click', this.eventHandler.pickerHide);\n this.picker.off();\n }\n\n /**\n * Picker toggle event handler\n * @param {object} event - change event\n * @private\n */\n _pickerToggleEventHandler(event) {\n const { target } = event;\n const isInPickerControl = target && this._isElementInColorPickerControl(target);\n\n if (!isInPickerControl || (isInPickerControl && this._isPaletteButton(target))) {\n this._show = !this._show;\n this.pickerControl.style.display = this._show ? 'block' : 'none';\n this._setPickerControlPosition();\n this.fire('changeShow', this);\n }\n event.stopPropagation();\n }\n\n /**\n * Check hex input or not\n * @param {Element} target - Event target element\n * @returns {boolean}\n * @private\n */\n _isPaletteButton(target) {\n return target.className === 'tui-colorpicker-palette-button';\n }\n\n /**\n * Check given element is in pickerControl element\n * @param {Element} element - element to check\n * @returns {boolean}\n * @private\n */\n _isElementInColorPickerControl(element) {\n let parentNode = element;\n\n while (parentNode !== document.body) {\n if (!parentNode) {\n break;\n }\n\n if (parentNode === this.pickerControl) {\n return true;\n }\n\n parentNode = parentNode.parentNode;\n }\n\n return false;\n }\n\n hide() {\n this._show = false;\n this.pickerControl.style.display = 'none';\n }\n\n /**\n * Set picker control position\n * @private\n */\n _setPickerControlPosition() {\n const controlStyle = this.pickerControl.style;\n const halfPickerWidth = this._colorpickerElement.clientWidth / 2 + 2;\n const left = this.pickerControl.offsetWidth / 2 - halfPickerWidth;\n let top = (this.pickerControl.offsetHeight + 10) * -1;\n\n if (this._toggleDirection === 'down') {\n top = 30;\n }\n\n controlStyle.top = `${top}px`;\n controlStyle.left = `-${left}px`;\n }\n}\n\nsnippet.CustomEvents.mixin(Colorpicker);\nexport default Colorpicker;\n","import snippet from 'tui-code-snippet';\nimport { toInteger, clamp } from '@/util';\nimport { keyCodes } from '@/consts';\n\nconst INPUT_FILTER_REGEXP = /(-?)([0-9]*)[^0-9]*([0-9]*)/g;\n\n/**\n * Range control class\n * @class\n * @ignore\n */\nclass Range {\n /**\n * @constructor\n * @extends {View}\n * @param {Object} rangeElements - Html resources for creating sliders\n * @param {HTMLElement} rangeElements.slider - b\n * @param {HTMLElement} [rangeElements.input] - c\n * @param {Object} options - Slider make options\n * @param {number} options.min - min value\n * @param {number} options.max - max value\n * @param {number} options.value - default value\n * @param {number} [options.useDecimal] - Decimal point processing.\n * @param {boolean} [options.realTimeEvent] - Reflect live events.\n */\n constructor(rangeElements, options = {}) {\n this._value = options.value || 0;\n\n this.rangeElement = rangeElements.slider;\n this.rangeInputElement = rangeElements.input;\n\n this._drawRangeElement();\n\n this.rangeWidth = this._getRangeWidth();\n this._min = options.min || 0;\n this._max = options.max || 100;\n this._useDecimal = options.useDecimal;\n this._absMax = this._min * -1 + this._max;\n this.realTimeEvent = options.realTimeEvent || false;\n\n this.eventHandler = {\n startChangingSlide: this._startChangingSlide.bind(this),\n stopChangingSlide: this._stopChangingSlide.bind(this),\n changeSlide: this._changeSlide.bind(this),\n changeSlideFinally: this._changeSlideFinally.bind(this),\n changeInput: this._changeValueWithInput.bind(this, false),\n changeInputFinally: this._changeValueWithInput.bind(this, true),\n changeInputWithArrow: this._changeValueWithInputKeyEvent.bind(this),\n };\n\n this._addClickEvent();\n this._addDragEvent();\n this._addInputEvent();\n this.value = options.value;\n this.trigger('change');\n }\n\n /**\n * Destroys the instance.\n */\n destroy() {\n this._removeClickEvent();\n this._removeDragEvent();\n this._removeInputEvent();\n this.rangeElement.innerHTML = '';\n snippet.forEach(this, (value, key) => {\n this[key] = null;\n });\n }\n\n /**\n * Set range max value and re position cursor\n * @param {number} maxValue - max value\n */\n set max(maxValue) {\n this._max = maxValue;\n this._absMax = this._min * -1 + this._max;\n this.value = this._value;\n }\n\n get max() {\n return this._max;\n }\n\n /**\n * Get range value\n * @returns {Number} range value\n */\n get value() {\n return this._value;\n }\n\n /**\n * Set range value\n * @param {Number} value range value\n */\n set value(value) {\n value = this._useDecimal ? value : toInteger(value);\n\n const absValue = value - this._min;\n let leftPosition = (absValue * this.rangeWidth) / this._absMax;\n\n if (this.rangeWidth < leftPosition) {\n leftPosition = this.rangeWidth;\n }\n\n this.pointer.style.left = `${leftPosition}px`;\n this.subbar.style.right = `${this.rangeWidth - leftPosition}px`;\n\n this._value = value;\n if (this.rangeInputElement) {\n this.rangeInputElement.value = value;\n }\n }\n\n /**\n * event trigger\n * @param {string} type - type\n */\n trigger(type) {\n this.fire(type, this._value);\n }\n\n /**\n * Calculate slider width\n * @returns {number} - slider width\n */\n _getRangeWidth() {\n const getElementWidth = (element) => toInteger(window.getComputedStyle(element, null).width);\n\n return getElementWidth(this.rangeElement) - getElementWidth(this.pointer);\n }\n\n /**\n * Make range element\n * @private\n */\n _drawRangeElement() {\n this.rangeElement.classList.add('tui-image-editor-range');\n\n this.bar = document.createElement('div');\n this.bar.className = 'tui-image-editor-virtual-range-bar';\n\n this.subbar = document.createElement('div');\n this.subbar.className = 'tui-image-editor-virtual-range-subbar';\n\n this.pointer = document.createElement('div');\n this.pointer.className = 'tui-image-editor-virtual-range-pointer';\n\n this.bar.appendChild(this.subbar);\n this.bar.appendChild(this.pointer);\n this.rangeElement.appendChild(this.bar);\n }\n\n /**\n * Add range input editing event\n * @private\n */\n _addInputEvent() {\n if (this.rangeInputElement) {\n this.rangeInputElement.addEventListener('keydown', this.eventHandler.changeInputWithArrow);\n this.rangeInputElement.addEventListener('keyup', this.eventHandler.changeInput);\n this.rangeInputElement.addEventListener('blur', this.eventHandler.changeInputFinally);\n }\n }\n\n /**\n * Remove range input editing event\n * @private\n */\n _removeInputEvent() {\n if (this.rangeInputElement) {\n this.rangeInputElement.removeEventListener('keydown', this.eventHandler.changeInputWithArrow);\n this.rangeInputElement.removeEventListener('keyup', this.eventHandler.changeInput);\n this.rangeInputElement.removeEventListener('blur', this.eventHandler.changeInputFinally);\n }\n }\n\n /**\n * change angle event\n * @param {object} event - key event\n * @private\n */\n _changeValueWithInputKeyEvent(event) {\n const { keyCode, target } = event;\n\n if ([keyCodes.ARROW_UP, keyCodes.ARROW_DOWN].indexOf(keyCode) < 0) {\n return;\n }\n\n let value = Number(target.value);\n\n value = this._valueUpDownForKeyEvent(value, keyCode);\n\n const unChanged = value < this._min || value > this._max;\n\n if (!unChanged) {\n const clampValue = clamp(value, this._min, this.max);\n this.value = clampValue;\n this.fire('change', clampValue, false);\n }\n }\n\n /**\n * value up down for input\n * @param {number} value - original value number\n * @param {number} keyCode - input event key code\n * @returns {number} value - changed value\n * @private\n */\n _valueUpDownForKeyEvent(value, keyCode) {\n const step = this._useDecimal ? 0.1 : 1;\n\n if (keyCode === keyCodes.ARROW_UP) {\n value += step;\n } else if (keyCode === keyCodes.ARROW_DOWN) {\n value -= step;\n }\n\n return value;\n }\n\n /**\n * change angle event\n * @param {boolean} isLast - Is last change\n * @param {object} event - key event\n * @private\n */\n _changeValueWithInput(isLast, event) {\n const { keyCode, target } = event;\n\n if ([keyCodes.ARROW_UP, keyCodes.ARROW_DOWN].indexOf(keyCode) >= 0) {\n return;\n }\n\n const stringValue = this._filterForInputText(target.value);\n const waitForChange = !stringValue || isNaN(stringValue);\n target.value = stringValue;\n\n if (!waitForChange) {\n let value = this._useDecimal ? Number(stringValue) : toInteger(stringValue);\n value = clamp(value, this._min, this.max);\n\n this.value = value;\n this.fire('change', value, isLast);\n }\n }\n\n /**\n * Add Range click event\n * @private\n */\n _addClickEvent() {\n this.rangeElement.addEventListener('click', this.eventHandler.changeSlideFinally);\n }\n\n /**\n * Remove Range click event\n * @private\n */\n _removeClickEvent() {\n this.rangeElement.removeEventListener('click', this.eventHandler.changeSlideFinally);\n }\n\n /**\n * Add Range drag event\n * @private\n */\n _addDragEvent() {\n this.pointer.addEventListener('mousedown', this.eventHandler.startChangingSlide);\n }\n\n /**\n * Remove Range drag event\n * @private\n */\n _removeDragEvent() {\n this.pointer.removeEventListener('mousedown', this.eventHandler.startChangingSlide);\n }\n\n /**\n * change angle event\n * @param {object} event - change event\n * @private\n */\n _changeSlide(event) {\n const changePosition = event.screenX;\n const diffPosition = changePosition - this.firstPosition;\n let touchPx = this.firstLeft + diffPosition;\n touchPx = touchPx > this.rangeWidth ? this.rangeWidth : touchPx;\n touchPx = touchPx < 0 ? 0 : touchPx;\n\n this.pointer.style.left = `${touchPx}px`;\n this.subbar.style.right = `${this.rangeWidth - touchPx}px`;\n\n const ratio = touchPx / this.rangeWidth;\n const resultValue = this._absMax * ratio + this._min;\n const value = this._useDecimal ? resultValue : toInteger(resultValue);\n const isValueChanged = this.value !== value;\n\n if (isValueChanged) {\n this.value = value;\n if (this.realTimeEvent) {\n this.fire('change', this._value, false);\n }\n }\n }\n\n _changeSlideFinally(event) {\n event.stopPropagation();\n if (event.target.className !== 'tui-image-editor-range') {\n return;\n }\n const touchPx = event.offsetX;\n const ratio = touchPx / this.rangeWidth;\n const value = this._absMax * ratio + this._min;\n this.pointer.style.left = `${ratio * this.rangeWidth}px`;\n this.subbar.style.right = `${(1 - ratio) * this.rangeWidth}px`;\n this.value = value;\n\n this.fire('change', value, true);\n }\n\n _startChangingSlide(event) {\n this.firstPosition = event.screenX;\n this.firstLeft = toInteger(this.pointer.style.left) || 0;\n\n document.addEventListener('mousemove', this.eventHandler.changeSlide);\n document.addEventListener('mouseup', this.eventHandler.stopChangingSlide);\n }\n\n /**\n * stop change angle event\n * @private\n */\n _stopChangingSlide() {\n this.fire('change', this._value, true);\n\n document.removeEventListener('mousemove', this.eventHandler.changeSlide);\n document.removeEventListener('mouseup', this.eventHandler.stopChangingSlide);\n }\n\n /**\n * Unnecessary string filtering.\n * @param {string} inputValue - origin string of input\n * @returns {string} filtered string\n * @private\n */\n _filterForInputText(inputValue) {\n return inputValue.replace(INPUT_FILTER_REGEXP, '$1$2$3');\n }\n}\n\nsnippet.CustomEvents.mixin(Range);\n\nexport default Range;\n","/**\n * @author NHN. FE Development Team \n * @fileoverview Util\n */\nimport { forEach, sendHostname, extend, isString, pick, inArray } from 'tui-code-snippet';\nimport Promise from 'core-js-pure/features/promise';\nimport {\n commandNames,\n filterType,\n historyNames,\n SHAPE_FILL_TYPE,\n SHAPE_TYPE,\n emptyCropRectValues,\n} from '@/consts';\n\nconst FLOATING_POINT_DIGIT = 2;\nconst CSS_PREFIX = 'tui-image-editor-';\nconst { min, max } = Math;\nlet hostnameSent = false;\n\n/**\n * Export Promise Class (for simplified module path)\n * @returns {Promise} promise class\n */\nexport { Promise };\n\n/**\n * Clamp value\n * @param {number} value - Value\n * @param {number} minValue - Minimum value\n * @param {number} maxValue - Maximum value\n * @returns {number} clamped value\n */\nexport function clamp(value, minValue, maxValue) {\n if (minValue > maxValue) {\n [minValue, maxValue] = [maxValue, minValue];\n }\n\n return max(minValue, min(value, maxValue));\n}\n\n/**\n * Make key-value object from arguments\n * @returns {object.}\n */\nexport function keyMirror(...args) {\n const obj = {};\n\n forEach(args, (key) => {\n obj[key] = key;\n });\n\n return obj;\n}\n\n/**\n * Make CSSText\n * @param {Object} styleObj - Style info object\n * @returns {string} Connected string of style\n */\nexport function makeStyleText(styleObj) {\n let styleStr = '';\n\n forEach(styleObj, (value, prop) => {\n styleStr += `${prop}: ${value};`;\n });\n\n return styleStr;\n}\n\n/**\n * Get object's properties\n * @param {Object} obj - object\n * @param {Array} keys - keys\n * @returns {Object} properties object\n */\nexport function getProperties(obj, keys) {\n const props = {};\n const { length } = keys;\n let i = 0;\n let key;\n\n for (i = 0; i < length; i += 1) {\n key = keys[i];\n props[key] = obj[key];\n }\n\n return props;\n}\n\n/**\n * ParseInt simpliment\n * @param {number} value - Value\n * @returns {number}\n */\nexport function toInteger(value) {\n return parseInt(value, 10);\n}\n\n/**\n * String to camelcase string\n * @param {string} targetString - change target\n * @returns {string}\n * @private\n */\nexport function toCamelCase(targetString) {\n return targetString.replace(/-([a-z])/g, ($0, $1) => $1.toUpperCase());\n}\n\n/**\n * Check browser file api support\n * @returns {boolean}\n * @private\n */\nexport function isSupportFileApi() {\n return !!(window.File && window.FileList && window.FileReader);\n}\n\n/**\n * hex to rgb\n * @param {string} color - hex color\n * @param {string} alpha - color alpha value\n * @returns {string} rgb expression\n */\nexport function getRgb(color, alpha) {\n if (color.length === 4) {\n color = `${color}${color.slice(1, 4)}`;\n }\n const r = parseInt(color.slice(1, 3), 16);\n const g = parseInt(color.slice(3, 5), 16);\n const b = parseInt(color.slice(5, 7), 16);\n const a = alpha || 1;\n\n return `rgba(${r}, ${g}, ${b}, ${a})`;\n}\n\n/**\n * send hostname\n */\nexport function sendHostName() {\n if (hostnameSent) {\n return;\n }\n hostnameSent = true;\n\n sendHostname('image-editor', 'UA-129999381-1');\n}\n\n/**\n * Apply css resource\n * @param {string} styleBuffer - serialized css text\n * @param {string} tagId - style tag id\n */\nexport function styleLoad(styleBuffer, tagId) {\n const [head] = document.getElementsByTagName('head');\n const linkElement = document.createElement('link');\n const styleData = encodeURIComponent(styleBuffer);\n if (tagId) {\n linkElement.id = tagId;\n // linkElement.id = 'tui-image-editor-theme-style';\n }\n linkElement.setAttribute('rel', 'stylesheet');\n linkElement.setAttribute('type', 'text/css');\n linkElement.setAttribute('href', `data:text/css;charset=UTF-8,${styleData}`);\n head.appendChild(linkElement);\n}\n\n/**\n * Get selector\n * @param {HTMLElement} targetElement - target element\n * @returns {Function} selector\n */\nexport function getSelector(targetElement) {\n return (str) => targetElement.querySelector(str);\n}\n\n/**\n * Change base64 to blob\n * @param {String} data - base64 string data\n * @returns {Blob} Blob Data\n */\nexport function base64ToBlob(data) {\n const rImageType = /data:(image\\/.+);base64,/;\n let mimeString = '';\n let raw, uInt8Array, i;\n\n raw = data.replace(rImageType, (header, imageType) => {\n mimeString = imageType;\n\n return '';\n });\n\n raw = atob(raw);\n const rawLength = raw.length;\n uInt8Array = new Uint8Array(rawLength); // eslint-disable-line\n\n for (i = 0; i < rawLength; i += 1) {\n uInt8Array[i] = raw.charCodeAt(i);\n }\n\n return new Blob([uInt8Array], { type: mimeString });\n}\n\n/**\n * Fix floating point diff.\n * @param {number} value - original value\n * @returns {number} fixed value\n */\nexport function fixFloatingPoint(value) {\n return Number(value.toFixed(FLOATING_POINT_DIGIT));\n}\n\n/**\n * Assignment for destroying objects.\n * @param {Object} targetObject - object to be removed.\n */\nexport function assignmentForDestroy(targetObject) {\n forEach(targetObject, (value, key) => {\n targetObject[key] = null;\n });\n}\n\n/**\n * Make class name for ui\n * @param {String} str - main string of className\n * @param {String} prefix - prefix string of className\n * @returns {String} class name\n */\nexport function cls(str = '', prefix = '') {\n if (str.charAt(0) === '.') {\n return `.${CSS_PREFIX}${prefix}${str.slice(1)}`;\n }\n\n return `${CSS_PREFIX}${prefix}${str}`;\n}\n\n/**\n * Change object origin\n * @param {fabric.Object} fObject - fabric object\n * @param {Object} origin - origin of fabric object\n * @param {string} originX - horizontal basis.\n * @param {string} originY - vertical basis.\n */\nexport function changeOrigin(fObject, origin) {\n const { originX, originY } = origin;\n const { x: left, y: top } = fObject.getPointByOrigin(originX, originY);\n\n fObject.set({\n left,\n top,\n originX,\n originY,\n });\n\n fObject.setCoords();\n}\n\n/**\n * Object key value flip\n * @param {Object} targetObject - The data object of the key value.\n * @returns {Object}\n */\nexport function flipObject(targetObject) {\n const result = {};\n\n Object.keys(targetObject).forEach((key) => {\n result[targetObject[key]] = key;\n });\n\n return result;\n}\n\n/**\n * Set custom properties\n * @param {Object} targetObject - target object\n * @param {Object} props - custom props object\n */\nexport function setCustomProperty(targetObject, props) {\n targetObject.customProps = targetObject.customProps || {};\n extend(targetObject.customProps, props);\n}\n\n/**\n * Get custom property\n * @param {fabric.Object} fObject - fabric object\n * @param {Array|string} propNames - prop name array\n * @returns {object | number | string}\n */\nexport function getCustomProperty(fObject, propNames) {\n const resultObject = {};\n if (isString(propNames)) {\n propNames = [propNames];\n }\n forEach(propNames, (propName) => {\n resultObject[propName] = fObject.customProps[propName];\n });\n\n return resultObject;\n}\n\n/**\n * Capitalize string\n * @param {string} targetString - target string\n * @returns {string}\n */\nexport function capitalizeString(targetString) {\n return targetString.charAt(0).toUpperCase() + targetString.slice(1);\n}\n\n/**\n * Array includes check\n * @param {Array} targetArray - target array\n * @param {string|number} compareValue - compare value\n * @returns {boolean}\n */\nexport function includes(targetArray, compareValue) {\n return targetArray.indexOf(compareValue) >= 0;\n}\n\n/**\n * Get fill type\n * @param {Object | string} fillOption - shape fill option\n * @returns {string} 'color' or 'filter'\n */\nexport function getFillTypeFromOption(fillOption = {}) {\n return pick(fillOption, 'type') || SHAPE_FILL_TYPE.COLOR;\n}\n\n/**\n * Get fill type of shape type object\n * @param {fabric.Object} shapeObj - fabric object\n * @returns {string} 'transparent' or 'color' or 'filter'\n */\nexport function getFillTypeFromObject(shapeObj) {\n const { fill = {} } = shapeObj;\n if (fill.source) {\n return SHAPE_FILL_TYPE.FILTER;\n }\n\n return SHAPE_FILL_TYPE.COLOR;\n}\n\n/**\n * Check if the object is a shape object.\n * @param {fabric.Object} obj - fabric object\n * @returns {boolean}\n */\nexport function isShape(obj) {\n return inArray(obj.get('type'), SHAPE_TYPE) >= 0;\n}\n\n/**\n * Get object type\n * @param {string} type - fabric object type\n * @returns {string} type of object (ex: shape, icon, ...)\n */\nexport function getObjectType(type) {\n if (includes(SHAPE_TYPE, type)) {\n return 'Shape';\n }\n\n switch (type) {\n case 'i-text':\n return 'Text';\n case 'path':\n case 'line':\n return 'Draw';\n case 'activeSelection':\n return 'Group';\n default:\n return toStartOfCapital(type);\n }\n}\n\n/**\n * Get filter type\n * @param {string} type - fabric filter type\n * @param {object} [options] - filter type options\n * @param {boolean} [options.useAlpha=true] - usage of alpha(true is 'color filter', false is 'remove white')\n * @param {string} [options.mode] - mode of blendColor\n * @returns {string} type of filter (ex: sepia, blur, ...)\n */\nfunction getFilterType(type, { useAlpha = true, mode } = {}) {\n const {\n VINTAGE,\n REMOVE_COLOR,\n BLEND_COLOR,\n SEPIA2,\n COLOR_FILTER,\n REMOVE_WHITE,\n BLEND,\n } = filterType;\n\n let filterName;\n\n switch (type) {\n case VINTAGE:\n filterName = SEPIA2;\n break;\n case REMOVE_COLOR:\n filterName = useAlpha ? COLOR_FILTER : REMOVE_WHITE;\n break;\n case BLEND_COLOR:\n filterName = mode === 'add' ? BLEND : mode;\n break;\n default:\n filterName = type;\n }\n\n return toStartOfCapital(filterName);\n}\n\n/**\n * Check if command is silent command\n * @param {Command|string} command - command or command name\n * @returns {boolean}\n */\nexport function isSilentCommand(command) {\n const { LOAD_IMAGE } = commandNames;\n\n return typeof command === 'string' ? LOAD_IMAGE === command : LOAD_IMAGE === command.name;\n}\n\n/**\n * Get command name\n * @param {Command|string} command - command or command name\n * @returns {{name: string, ?detail: string}}\n */\n// eslint-disable-next-line complexity, require-jsdoc\nexport function getHistoryTitle(command) {\n const {\n FLIP_IMAGE,\n ROTATE_IMAGE,\n ADD_TEXT,\n APPLY_FILTER,\n REMOVE_FILTER,\n CHANGE_SHAPE,\n CHANGE_ICON_COLOR,\n CHANGE_TEXT_STYLE,\n CLEAR_OBJECTS,\n ADD_IMAGE_OBJECT,\n REMOVE_OBJECT,\n } = commandNames;\n const { name, args } = command;\n let historyInfo;\n\n switch (name) {\n case FLIP_IMAGE:\n historyInfo = { name, detail: args[1] === 'reset' ? args[1] : args[1].slice(4) };\n break;\n case ROTATE_IMAGE:\n historyInfo = { name, detail: args[2] };\n break;\n case APPLY_FILTER:\n historyInfo = { name: historyNames.APPLY_FILTER, detail: getFilterType(args[1], args[2]) };\n break;\n case REMOVE_FILTER:\n historyInfo = { name: historyNames.REMOVE_FILTER, detail: 'Remove' };\n break;\n case CHANGE_SHAPE:\n historyInfo = { name: historyNames.CHANGE_SHAPE, detail: 'Change' };\n break;\n case CHANGE_ICON_COLOR:\n historyInfo = { name: historyNames.CHANGE_ICON_COLOR, detail: 'Change' };\n break;\n case CHANGE_TEXT_STYLE:\n historyInfo = { name: historyNames.CHANGE_TEXT_STYLE, detail: 'Change' };\n break;\n case REMOVE_OBJECT:\n historyInfo = { name: historyNames.REMOVE_OBJECT, detail: args[2] };\n break;\n case CLEAR_OBJECTS:\n historyInfo = { name: historyNames.CLEAR_OBJECTS, detail: 'All' };\n break;\n case ADD_IMAGE_OBJECT:\n historyInfo = { name: historyNames.ADD_IMAGE_OBJECT, detail: 'Add' };\n break;\n case ADD_TEXT:\n historyInfo = { name: historyNames.ADD_TEXT };\n break;\n\n default:\n historyInfo = { name };\n break;\n }\n\n if (args[1] === 'mask') {\n historyInfo = { name: historyNames.LOAD_MASK_IMAGE, detail: 'Apply' };\n }\n\n return historyInfo;\n}\n\n/**\n * Get help menubar position(opposite of menubar)\n * @param {string} position - position of menubar\n * @returns {string} position of help menubar\n */\nexport function getHelpMenuBarPosition(position) {\n if (position === 'top') {\n return 'bottom';\n }\n if (position === 'left') {\n return 'right';\n }\n if (position === 'right') {\n return 'left';\n }\n\n return 'top';\n}\n\n/**\n * Change to capital start letter\n * @param {string} str - string to change\n * @returns {string}\n */\nfunction toStartOfCapital(str) {\n return str.replace(/[a-z]/, (first) => first.toUpperCase());\n}\n\n/**\n * Check if cropRect is Empty.\n * @param {Object} cropRect - cropRect object\n * @param {Number} cropRect.left - cropRect left position value\n * @param {Number} cropRect.top - cropRect top position value\n * @param {Number} cropRect.width - cropRect width value\n * @param {Number} cropRect.height - cropRect height value\n * @returns {boolean}\n */\nexport function isEmptyCropzone(cropRect) {\n const { left, top, width, height } = cropRect;\n const { LEFT, TOP, WIDTH, HEIGHT } = emptyCropRectValues;\n\n return left === LEFT && top === TOP && width === WIDTH && height === HEIGHT;\n}\n","module.exports = \"\"","module.exports = __WEBPACK_EXTERNAL_MODULE_fabric__;","module.exports = __WEBPACK_EXTERNAL_MODULE_tui_code_snippet__;","module.exports = __WEBPACK_EXTERNAL_MODULE_tui_color_picker__;"],"sourceRoot":""} \ No newline at end of file diff --git a/apps/image-editor/dist/tui-image-editor.min.css b/apps/image-editor/dist/tui-image-editor.min.css index e18ef4059..f4ae9b010 100644 --- a/apps/image-editor/dist/tui-image-editor.min.css +++ b/apps/image-editor/dist/tui-image-editor.min.css @@ -1,6 +1,6 @@ /*! * tui-image-editor.min.js - * @version 3.14.0 + * @version 3.14.1 * @author NHN. FE Development Lab * @license MIT */body>textarea{position:fixed!important}.tui-image-editor-container{margin:0;padding:0;box-sizing:border-box;min-height:300px;height:100%;position:relative;background-color:#282828;overflow:hidden;letter-spacing:.3px}.tui-image-editor-container div,.tui-image-editor-container input,.tui-image-editor-container label,.tui-image-editor-container li,.tui-image-editor-container ul{box-sizing:border-box;margin:0;padding:0;-ms-user-select:none;-moz-user-select:-moz-none;-khtml-user-select:none;-webkit-user-select:none;user-select:none}.tui-image-editor-container .tui-image-editor-header{min-width:533px;position:absolute;background-color:#151515;top:0;width:100%}.tui-image-editor-container .tui-image-editor-controls-buttons,.tui-image-editor-container .tui-image-editor-header-buttons{float:right;margin:8px}.tui-image-editor-container .tui-image-editor-controls-logo,.tui-image-editor-container .tui-image-editor-header-logo{float:left;width:30%;padding:17px}.tui-image-editor-container .tui-image-editor-controls-buttons,.tui-image-editor-container .tui-image-editor-controls-logo{width:270px;height:100%;display:none}.tui-image-editor-container .tui-image-editor-controls-buttons button,.tui-image-editor-container .tui-image-editor-controls-buttons div,.tui-image-editor-container .tui-image-editor-header-buttons button,.tui-image-editor-container .tui-image-editor-header-buttons div{display:inline-block;position:relative;width:120px;height:40px;padding:0;line-height:40px;outline:none;border-radius:20px;border:1px solid #ddd;font-family:Noto Sans,sans-serif;font-size:12px;font-weight:700;cursor:pointer;vertical-align:middle;letter-spacing:.3px;text-align:center}.tui-image-editor-container .tui-image-editor-download-btn{background-color:#fdba3b;border-color:#fdba3b;color:#fff}.tui-image-editor-container .tui-image-editor-load-btn{position:absolute;left:0;right:0;display:inline-block;top:0;bottom:0;width:100%;cursor:pointer;opacity:0}.tui-image-editor-container .tui-image-editor-main-container{position:absolute;width:100%;top:0;bottom:64px}.tui-image-editor-container .tui-image-editor-main{position:absolute;text-align:center;top:64px;bottom:0;right:0;left:0}.tui-image-editor-container .tui-image-editor-wrap{bottom:0;width:100%;overflow:auto}.tui-image-editor-container .tui-image-editor-wrap .tui-image-editor-size-wrap{display:table;width:100%;height:100%}.tui-image-editor-container .tui-image-editor-wrap .tui-image-editor-size-wrap .tui-image-editor-align-wrap{display:table-cell;vertical-align:middle}.tui-image-editor-container .tui-image-editor{position:relative;display:inline-block}.tui-image-editor-container .tui-image-editor-help-menu,.tui-image-editor-container .tui-image-editor-menu{width:auto;list-style:none;padding:0;margin:0 auto;display:table-cell;text-align:center;vertical-align:middle;white-space:nowrap}.tui-image-editor-container .tui-image-editor-help-menu>.tui-image-editor-item,.tui-image-editor-container .tui-image-editor-menu>.tui-image-editor-item{position:relative;display:inline-block;border-radius:2px;padding:7px 8px 3px;cursor:pointer;margin:0 4px}.tui-image-editor-container .tui-image-editor-help-menu>.tui-image-editor-item[tooltip-content]:hover:before,.tui-image-editor-container .tui-image-editor-menu>.tui-image-editor-item[tooltip-content]:hover:before{content:"";position:absolute;display:inline-block;margin:0 auto;width:0;height:0;border-right:7px solid transparent;border-top:7px solid #2f2f2f;border-left:7px solid transparent;left:13px;top:-2px}.tui-image-editor-container .tui-image-editor-help-menu>.tui-image-editor-item[tooltip-content]:hover:after,.tui-image-editor-container .tui-image-editor-menu>.tui-image-editor-item[tooltip-content]:hover:after{content:attr(tooltip-content);position:absolute;display:inline-block;background-color:#2f2f2f;color:#fff;padding:5px 8px;font-size:11px;font-weight:lighter;border-radius:3px;max-height:23px;top:-25px;left:0;min-width:24px}.tui-image-editor-container .tui-image-editor-help-menu>.tui-image-editor-item.active,.tui-image-editor-container .tui-image-editor-menu>.tui-image-editor-item.active{background-color:#fff;transition:all .3s ease}.tui-image-editor-container .tui-image-editor-wrap{position:absolute}.tui-image-editor-container .tui-image-editor-grid-visual{display:none;position:absolute;width:100%;height:100%;border:1px solid hsla(0,0%,100%,.7)}.tui-image-editor-container .tui-image-editor-main.tui-image-editor-menu-flip .tui-image-editor,.tui-image-editor-container .tui-image-editor-main.tui-image-editor-menu-rotate .tui-image-editor{transition:none}.tui-image-editor-container .tui-image-editor-main.tui-image-editor-menu-flip .tui-image-editor-grid-visual,.tui-image-editor-container .tui-image-editor-main.tui-image-editor-menu-rotate .tui-image-editor-grid-visual{display:block}.tui-image-editor-container .tui-image-editor-grid-visual table{width:100%;height:100%;border-collapse:collapse}.tui-image-editor-container .tui-image-editor-grid-visual table td{border:1px solid hsla(0,0%,100%,.3)}.tui-image-editor-container .tui-image-editor-grid-visual table td.dot:before{content:"";position:absolute;box-sizing:border-box;width:10px;height:10px;border:0;box-shadow:0 0 1px 0 rgba(0,0,0,.3);border-radius:100%;background-color:#fff}.tui-image-editor-container .tui-image-editor-grid-visual table td.dot.left-top:before{top:-5px;left:-5px}.tui-image-editor-container .tui-image-editor-grid-visual table td.dot.right-top:before{top:-5px;right:-5px}.tui-image-editor-container .tui-image-editor-grid-visual table td.dot.left-bottom:before{bottom:-5px;left:-5px}.tui-image-editor-container .tui-image-editor-grid-visual table td.dot.right-bottom:before{bottom:-5px;right:-5px}.tui-image-editor-container .tui-image-editor-submenu{display:none;position:absolute;bottom:0;width:100%;height:150px;white-space:nowrap;z-index:2}.tui-image-editor-container .tui-image-editor-submenu .tui-image-editor-button:hover svg>use.active{display:block}.tui-image-editor-container .tui-image-editor-submenu .tui-image-editor-submenu-item li{display:inline-block;vertical-align:top}.tui-image-editor-container .tui-image-editor-submenu .tui-image-editor-submenu-item .tui-image-editor-newline{display:block;margin-top:0}.tui-image-editor-container .tui-image-editor-submenu .tui-image-editor-submenu-item .tui-image-editor-button{position:relative;cursor:pointer;display:inline-block;font-weight:400;font-size:11px;margin:0 9px}.tui-image-editor-container .tui-image-editor-submenu .tui-image-editor-submenu-item .tui-image-editor-button.preset{margin:0 9px 20px 5px}.tui-image-editor-container .tui-image-editor-submenu .tui-image-editor-submenu-item label>span{display:inline-block;cursor:pointer;padding-top:5px;font-family:Noto Sans,sans-serif;font-size:11px}.tui-image-editor-container .tui-image-editor-submenu .tui-image-editor-submenu-item .tui-image-editor-button.apply label,.tui-image-editor-container .tui-image-editor-submenu .tui-image-editor-submenu-item .tui-image-editor-button.cancel label{vertical-align:7px}.tui-image-editor-container .tui-image-editor-submenu>div{display:none;vertical-align:bottom}.tui-image-editor-container .tui-image-editor-submenu .tui-image-editor-submenu-style{opacity:.95;z-index:-1;position:absolute;top:0;bottom:0;left:0;right:0;display:block}.tui-image-editor-container .tui-image-editor-partition>div{width:1px;height:52px;border-left:1px solid #3c3c3c;margin:0 8px}.tui-image-editor-container .tui-image-editor-main.tui-image-editor-menu-filter .tui-image-editor-partition>div{height:108px;margin:0 29px 0 0}.tui-image-editor-container .tui-image-editor-submenu-align{text-align:left;margin-right:30px}.tui-image-editor-container .tui-image-editor-submenu-align label>span{width:55px;white-space:nowrap}.tui-image-editor-container .tui-image-editor-submenu-align:first-child{margin-right:0}.tui-image-editor-container .tui-image-editor-submenu-align:first-child label>span{width:70px}.tui-image-editor-container .tui-image-editor-main.tui-image-editor-menu-crop .tui-image-editor-submenu>div.tui-image-editor-menu-crop,.tui-image-editor-container .tui-image-editor-main.tui-image-editor-menu-draw .tui-image-editor-submenu>div.tui-image-editor-menu-draw,.tui-image-editor-container .tui-image-editor-main.tui-image-editor-menu-filter .tui-image-editor-submenu>div.tui-image-editor-menu-filter,.tui-image-editor-container .tui-image-editor-main.tui-image-editor-menu-flip .tui-image-editor-submenu>div.tui-image-editor-menu-flip,.tui-image-editor-container .tui-image-editor-main.tui-image-editor-menu-icon .tui-image-editor-submenu>div.tui-image-editor-menu-icon,.tui-image-editor-container .tui-image-editor-main.tui-image-editor-menu-mask .tui-image-editor-submenu>div.tui-image-editor-menu-mask,.tui-image-editor-container .tui-image-editor-main.tui-image-editor-menu-rotate .tui-image-editor-submenu>div.tui-image-editor-menu-rotate,.tui-image-editor-container .tui-image-editor-main.tui-image-editor-menu-shape .tui-image-editor-submenu>div.tui-image-editor-menu-shape,.tui-image-editor-container .tui-image-editor-main.tui-image-editor-menu-text .tui-image-editor-submenu>div.tui-image-editor-menu-text,.tui-image-editor-container .tui-image-editor-main.tui-image-editor-menu-zoom .tui-image-editor-submenu>div.tui-image-editor-menu-zoom{display:table-cell}.tui-image-editor-container .tui-image-editor-main.tui-image-editor-menu-crop .tui-image-editor-submenu,.tui-image-editor-container .tui-image-editor-main.tui-image-editor-menu-draw .tui-image-editor-submenu,.tui-image-editor-container .tui-image-editor-main.tui-image-editor-menu-filter .tui-image-editor-submenu,.tui-image-editor-container .tui-image-editor-main.tui-image-editor-menu-flip .tui-image-editor-submenu,.tui-image-editor-container .tui-image-editor-main.tui-image-editor-menu-icon .tui-image-editor-submenu,.tui-image-editor-container .tui-image-editor-main.tui-image-editor-menu-mask .tui-image-editor-submenu,.tui-image-editor-container .tui-image-editor-main.tui-image-editor-menu-rotate .tui-image-editor-submenu,.tui-image-editor-container .tui-image-editor-main.tui-image-editor-menu-shape .tui-image-editor-submenu,.tui-image-editor-container .tui-image-editor-main.tui-image-editor-menu-text .tui-image-editor-submenu,.tui-image-editor-container .tui-image-editor-main.tui-image-editor-menu-zoom .tui-image-editor-submenu{display:table}.tui-image-editor-container .tui-image-editor-help-menu{list-style:none;padding:0;margin:0 auto;text-align:center;vertical-align:middle;border-radius:20px;background-color:hsla(0,0%,100%,.06);z-index:2;position:absolute}.tui-image-editor-container .tui-image-editor-help-menu .tie-panel-history{display:none;background-color:#fff;color:#444;position:absolute;width:196px;height:276px;padding:4px 2px;box-shadow:0 2px 6px 0 rgba(0,0,0,.15);cursor:auto;transform:translateX(calc(-50% + 12px))}.tui-image-editor-container .tui-image-editor-help-menu .tie-panel-history .history-list{height:268px;padding:0;overflow:hidden scroll;list-style:none}.tui-image-editor-container .tui-image-editor-help-menu .tie-panel-history .history-list .history-item{height:24px;font-size:11px;line-height:24px}.tui-image-editor-container .tui-image-editor-help-menu .tie-panel-history .history-list .history-item .tui-image-editor-history-item{position:relative;height:24px;cursor:pointer}.tui-image-editor-container .tui-image-editor-help-menu .tie-panel-history .history-list .history-item .tui-image-editor-history-item svg{width:24px;height:24px}.tui-image-editor-container .tui-image-editor-help-menu .tie-panel-history .history-list .history-item .tui-image-editor-history-item span{display:inline-block;width:128px;height:24px;text-align:left}.tui-image-editor-container .tui-image-editor-help-menu .tie-panel-history .history-list .history-item .tui-image-editor-history-item .history-item-icon{display:inline-block;width:24px;height:24px;position:absolute;top:6px;left:6px}.tui-image-editor-container .tui-image-editor-help-menu .tie-panel-history .history-list .history-item .tui-image-editor-history-item .history-item-checkbox{display:none;width:24px;height:24px;position:absolute;top:5px;right:-6px}.tui-image-editor-container .tui-image-editor-help-menu .tie-panel-history .history-list .history-item.selected-item{background-color:hsla(0,0%,46.7%,.12)}.tui-image-editor-container .tui-image-editor-help-menu .tie-panel-history .history-list .history-item.selected-item .history-item-checkbox{display:inline-block}.tui-image-editor-container .tui-image-editor-help-menu .tie-panel-history .history-list .history-item.disabled-item{color:#333;opacity:.3}.tui-image-editor-container .tui-image-editor-help-menu .opened .tie-panel-history{display:block}.tui-image-editor-container .tui-image-editor-help-menu .opened .tie-panel-history:before{content:"";position:absolute;display:inline-block;margin:0 auto;width:0;height:0}.tui-image-editor-container .filter-color-item{display:inline-block}.tui-image-editor-container .filter-color-item .tui-image-editor-checkbox{display:block}.tui-image-editor-container .tui-image-editor-checkbox-wrap{display:inline-block!important;text-align:left}.tui-image-editor-container .tui-image-editor-checkbox-wrap.fixed-width{width:187px;white-space:normal}.tui-image-editor-container .tui-image-editor-checkbox{display:inline-block;margin:1px 0}.tui-image-editor-container .tui-image-editor-checkbox input{width:14px;height:14px;opacity:0}.tui-image-editor-container .tui-image-editor-checkbox>label>span{color:#fff;height:14px;position:relative}.tui-image-editor-container .tui-image-editor-checkbox>label>span:before,.tui-image-editor-container .tui-image-editor-checkbox input+label:before{content:"";position:absolute;width:14px;height:14px;background-color:#fff;top:6px;left:-19px;display:inline-block;margin:0;text-align:center;font-size:11px;border:0;border-radius:2px;padding-top:1px;box-sizing:border-box}.tui-image-editor-container .tui-image-editor-checkbox input[type=checkbox]:checked+span:before{background-size:cover;background-image:url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAA4AAAAOCAYAAAAfSC3RAAAAAXNSR0IArs4c6QAAAMBJREFUKBWVkjEOwjAMRe2WgZW7IIHEDdhghhuwcQ42rlJugAQS54Cxa5cq1QM5TUpByZfS2j9+dlJVt/tX5ZxbS4ZU9VLkQvSHKTIGRaVJYFmKrBbTCJxE2UgCdDzMZDkHrOV6b95V0US6UmgKodujEZbJg0B0ZgEModO5lrY1TMQf1TpyJGBEjD+E2NPN7ukIUDiF/BfEXgRiGEw8NgkffYGYwCi808fpn/6OvfUfsDr/Vc1IfRf8sKnFVqeiVQfDu0tf/nWH9gAAAABJRU5ErkJggg==")}.tui-image-editor-container .tui-image-editor-selectlist-wrap{position:relative}.tui-image-editor-container .tui-image-editor-selectlist-wrap select{width:100%;height:28px;margin-top:4px;outline:0;border-radius:0;border:1px solid #cbdbdb;background-color:#fff;-webkit-appearance:none;-moz-appearance:none;appearance:none;padding:0 7px 0 10px}.tui-image-editor-container .tui-image-editor-selectlist-wrap .tui-image-editor-selectlist{display:none;position:relative;top:-1px;border:1px solid #ccc;background-color:#fff;border-top:0;padding:4px 0}.tui-image-editor-container .tui-image-editor-selectlist-wrap .tui-image-editor-selectlist li{display:block;text-align:left;padding:7px 10px;font-family:Noto Sans,sans-serif}.tui-image-editor-container .tui-image-editor-selectlist-wrap .tui-image-editor-selectlist li:hover{background-color:rgba(81,92,230,.05)}.tui-image-editor-container .tui-image-editor-selectlist-wrap:before{content:"";position:absolute;display:inline-block;width:14px;height:14px;right:5px;top:10px;background-image:url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAA4AAAAOCAYAAAAfSC3RAAAAAXNSR0IArs4c6QAAAHlJREFUKBVjYBgFOEOAEVkmPDxc89+/f6eAYjzI4kD2FyYmJrOVK1deh4kzwRggGiQBVJCELAZig8SQNYHEmEEEMrh69eo1HR0dfqCYJUickZGxf9WqVf3IakBsFBthklpaWmVA9mEQhrJhUoTp0NBQCRAmrHL4qgAAuu4cWZOZIGsAAAAASUVORK5CYII=");background-size:cover}.tui-image-editor-container .tui-image-editor-selectlist-wrap select::-ms-expand{display:none}.tui-image-editor-container .tui-image-editor-virtual-range-bar .tui-image-editor-disabled,.tui-image-editor-container .tui-image-editor-virtual-range-pointer .tui-image-editor-disabled,.tui-image-editor-container .tui-image-editor-virtual-range-subbar .tui-image-editor-disabled{backbround-color:red}.tui-image-editor-container .tui-image-editor-range{position:relative;top:5px;width:166px;height:17px;display:inline-block}.tui-image-editor-container .tui-image-editor-virtual-range-bar{top:7px;position:absolute;width:100%;height:2px;background-color:#666}.tui-image-editor-container .tui-image-editor-virtual-range-subbar{position:absolute;height:100%;left:0;right:0;background-color:#d1d1d1}.tui-image-editor-container .tui-image-editor-virtual-range-pointer{position:absolute;cursor:pointer;top:-5px;left:0;width:12px;height:12px;background-color:#fff;border-radius:100%}.tui-image-editor-container .tui-image-editor-range-wrap{display:inline-block;margin-left:4px}.tui-image-editor-container .tui-image-editor-range-wrap.short .tui-image-editor-range{width:100px}.tui-image-editor-container .color-picker-control .tui-image-editor-range{width:108px;margin-left:10px}.tui-image-editor-container .color-picker-control .tui-image-editor-virtual-range-pointer{background-color:#333}.tui-image-editor-container .color-picker-control .tui-image-editor-virtual-range-bar{background-color:#ccc}.tui-image-editor-container .color-picker-control .tui-image-editor-virtual-range-subbar{background-color:#606060}.tui-image-editor-container .tui-image-editor-range-wrap.tui-image-editor-newline.short{margin-top:-2px;margin-left:19px}.tui-image-editor-container .tui-image-editor-range-wrap.tui-image-editor-newline.short label{color:#8e8e8e;font-weight:400}.tui-image-editor-container .tui-image-editor-range-wrap label{vertical-align:baseline;font-size:11px;margin-right:7px;color:#fff}.tui-image-editor-container .tui-image-editor-range-value{cursor:default;width:40px;height:24px;outline:none;border-radius:2px;box-shadow:none;border:1px solid #d5d5d5;text-align:center;background-color:#1c1c1c;color:#fff;font-weight:lighter;vertical-align:baseline;font-family:Noto Sans,sans-serif;margin-top:21px;margin-left:4px}.tui-image-editor-container .tui-image-editor-controls{position:absolute;background-color:#151515;width:100%;height:64px;display:table;bottom:0;z-index:2}.tui-image-editor-container .tui-image-editor-icpartition{display:inline-block;background-color:#444;width:1px;height:24px}.tui-image-editor-container.left .tui-image-editor-menu>.tui-image-editor-item[tooltip-content]:before{left:28px;top:11px;border-right:7px solid #2f2f2f;border-top:7px solid transparent;border-bottom:7px solid transparent}.tui-image-editor-container.left .tui-image-editor-menu>.tui-image-editor-item[tooltip-content]:after{top:7px;left:42px;white-space:nowrap}.tui-image-editor-container.left .tui-image-editor-submenu{left:0;height:100%;width:248px}.tui-image-editor-container.left .tui-image-editor-main-container{left:64px;width:calc(100% - 64px);height:100%}.tui-image-editor-container.left .tui-image-editor-controls{width:64px;height:100%;display:table}.tui-image-editor-container.left .tui-image-editor-menu,.tui-image-editor-container.right .tui-image-editor-menu{white-space:inherit}.tui-image-editor-container.left .tui-image-editor-submenu,.tui-image-editor-container.right .tui-image-editor-submenu{white-space:normal}.tui-image-editor-container.left .tui-image-editor-submenu>div,.tui-image-editor-container.right .tui-image-editor-submenu>div{vertical-align:middle}.tui-image-editor-container.left .tui-image-editor-controls li,.tui-image-editor-container.right .tui-image-editor-controls li{display:inline-block;margin:4px auto}.tui-image-editor-container.left .tui-image-editor-icpartition,.tui-image-editor-container.right .tui-image-editor-icpartition{position:relative;top:-7px;width:24px;height:1px}.tui-image-editor-container.left .tui-image-editor-submenu .tui-image-editor-partition,.tui-image-editor-container.right .tui-image-editor-submenu .tui-image-editor-partition{display:block;width:75%;margin:auto}.tui-image-editor-container.left .tui-image-editor-submenu .tui-image-editor-partition>div,.tui-image-editor-container.right .tui-image-editor-submenu .tui-image-editor-partition>div{border-left:0;height:10px;border-bottom:1px solid #3c3c3c;width:100%;margin:0}.tui-image-editor-container.left .tui-image-editor-submenu .tui-image-editor-submenu-align,.tui-image-editor-container.right .tui-image-editor-submenu .tui-image-editor-submenu-align{margin-right:0}.tui-image-editor-container.left .tui-image-editor-submenu .tui-image-editor-submenu-item li,.tui-image-editor-container.right .tui-image-editor-submenu .tui-image-editor-submenu-item li{margin-top:15px}.tui-image-editor-container.left .tui-image-editor-submenu .tui-image-editor-submenu-item .tui-colorpicker-clearfix li,.tui-image-editor-container.right .tui-image-editor-submenu .tui-image-editor-submenu-item .tui-colorpicker-clearfix li{margin-top:0}.tui-image-editor-container.left .tui-image-editor-checkbox-wrap.fixed-width,.tui-image-editor-container.right .tui-image-editor-checkbox-wrap.fixed-width{width:182px;white-space:normal}.tui-image-editor-container.left .tui-image-editor-range-wrap.tui-image-editor-newline label.range,.tui-image-editor-container.right .tui-image-editor-range-wrap.tui-image-editor-newline label.range{display:block;text-align:left;width:75%;margin:auto}.tui-image-editor-container.left .tui-image-editor-range,.tui-image-editor-container.right .tui-image-editor-range{width:136px}.tui-image-editor-container.right .tui-image-editor-menu>.tui-image-editor-item[tooltip-content]:before{left:-3px;top:11px;border-left:7px solid #2f2f2f;border-top:7px solid transparent;border-bottom:7px solid transparent}.tui-image-editor-container.right .tui-image-editor-menu>.tui-image-editor-item[tooltip-content]:after{top:7px;left:unset;right:43px;white-space:nowrap}.tui-image-editor-container.right .tui-image-editor-submenu{right:0;height:100%;width:248px}.tui-image-editor-container.right .tui-image-editor-main-container{right:64px;width:calc(100% - 64px);height:100%}.tui-image-editor-container.right .tui-image-editor-controls{right:0;width:64px;height:100%;display:table}.tui-image-editor-container.bottom .tui-image-editor-submenu .tui-image-editor-partition.only-left-right,.tui-image-editor-container.top .tui-image-editor-submenu .tui-image-editor-partition.only-left-right{display:none}.tui-image-editor-container.bottom .tui-image-editor-submenu>div{padding-bottom:24px}.tui-image-editor-container.top .color-picker-control .triangle{top:-8px;border-right:7px solid transparent;border-top:0;border-left:7px solid transparent;border-bottom:8px solid #fff}.tui-image-editor-container.top .tui-image-editor-size-wrap{height:100%}.tui-image-editor-container.top .tui-image-editor-main-container{bottom:0}.tui-image-editor-container.top .tui-image-editor-menu>.tui-image-editor-item[tooltip-content]:before{left:13px;border-top:0;border-bottom:7px solid #2f2f2f;top:33px}.tui-image-editor-container.top .tui-image-editor-menu>.tui-image-editor-item[tooltip-content]:after{top:38px}.tui-image-editor-container.top .tui-image-editor-submenu{top:0;bottom:auto}.tui-image-editor-container.top .tui-image-editor-submenu>div{padding-top:24px;vertical-align:top}.tui-image-editor-container.top .tui-image-editor-controls-buttons,.tui-image-editor-container.top .tui-image-editor-controls-logo{display:table-cell}.tui-image-editor-container.top .tui-image-editor-main{top:64px;height:calc(100% - 64px)}.tui-image-editor-container.top .tui-image-editor-controls{top:0;bottom:inherit}.tui-image-editor-container .tui-image-editor-help-menu.top{white-space:nowrap;width:506px;height:40px;top:8px;left:50%;transform:translateX(-50%)}.tui-image-editor-container .tui-image-editor-help-menu.top .tie-panel-history{top:45px}.tui-image-editor-container .tui-image-editor-help-menu.top .opened .tie-panel-history:before{border-right:8px solid transparent;border-left:8px solid transparent;border-bottom:8px solid #fff;left:90px;top:-8px}.tui-image-editor-container .tui-image-editor-help-menu.top>.tui-image-editor-item[tooltip-content]:before{left:13px;top:35px;border:7px solid transparent;border-top:none;border-bottom:7px solid #2f2f2f}.tui-image-editor-container .tui-image-editor-help-menu.top>.tui-image-editor-item[tooltip-content]:after{top:41px;left:-4px;white-space:nowrap}.tui-image-editor-container .tui-image-editor-help-menu.top>.tui-image-editor-item[tooltip-content].opened:after,.tui-image-editor-container .tui-image-editor-help-menu.top>.tui-image-editor-item[tooltip-content].opened:before{content:none}.tui-image-editor-container .tui-image-editor-help-menu.bottom{white-space:nowrap;width:506px;height:40px;bottom:8px;left:50%;transform:translateX(-50%)}.tui-image-editor-container .tui-image-editor-help-menu.bottom .tie-panel-history{bottom:45px}.tui-image-editor-container .tui-image-editor-help-menu.bottom .opened .tie-panel-history:before{border-right:8px solid transparent;border-left:8px solid transparent;border-top:8px solid #fff;left:90px;bottom:-8px}.tui-image-editor-container .tui-image-editor-help-menu.bottom>.tui-image-editor-item[tooltip-content]:before{left:13px;top:auto;bottom:36px;border:7px solid transparent;border-top-color:#2f2f2f;border-bottom:none}.tui-image-editor-container .tui-image-editor-help-menu.bottom>.tui-image-editor-item[tooltip-content]:after{top:auto;left:-4px;bottom:41px;white-space:nowrap}.tui-image-editor-container .tui-image-editor-help-menu.bottom>.tui-image-editor-item[tooltip-content].opened:after,.tui-image-editor-container .tui-image-editor-help-menu.bottom>.tui-image-editor-item[tooltip-content].opened:before{content:none}.tui-image-editor-container .tui-image-editor-help-menu.left{white-space:inherit;width:40px;height:506px;left:8px;top:50%;transform:translateY(-50%)}.tui-image-editor-container .tui-image-editor-help-menu.left .tie-panel-history{left:140px;top:-4px}.tui-image-editor-container .tui-image-editor-help-menu.left .opened .tie-panel-history:before{border-top:8px solid transparent;border-bottom:8px solid transparent;border-right:8px solid #fff;left:-8px;top:14px}.tui-image-editor-container .tui-image-editor-help-menu.left .tui-image-editor-item{margin:4px auto;padding:6px 8px}.tui-image-editor-container .tui-image-editor-help-menu.left>.tui-image-editor-item[tooltip-content]:before{left:27px;top:11px;border:7px solid transparent;border-right-color:#2f2f2f;border-left:none}.tui-image-editor-container .tui-image-editor-help-menu.left>.tui-image-editor-item[tooltip-content]:after{top:7px;left:40px;white-space:nowrap}.tui-image-editor-container .tui-image-editor-help-menu.left>.tui-image-editor-item[tooltip-content].opened:after,.tui-image-editor-container .tui-image-editor-help-menu.left>.tui-image-editor-item[tooltip-content].opened:before{content:none}.tui-image-editor-container .tui-image-editor-help-menu.right{white-space:inherit;width:40px;height:506px;right:8px;top:50%;transform:translateY(-50%)}.tui-image-editor-container .tui-image-editor-help-menu.right .tie-panel-history{right:-30px;top:-4px}.tui-image-editor-container .tui-image-editor-help-menu.right .opened .tie-panel-history:before{border-top:8px solid transparent;border-bottom:8px solid transparent;border-left:8px solid #fff;right:-8px;top:14px}.tui-image-editor-container .tui-image-editor-help-menu.right .tui-image-editor-item{margin:4px auto;padding:6px 8px}.tui-image-editor-container .tui-image-editor-help-menu.right>.tui-image-editor-item[tooltip-content]:before{left:-6px;top:11px;border:7px solid transparent;border-right:none;border-left:7px solid #2f2f2f}.tui-image-editor-container .tui-image-editor-help-menu.right>.tui-image-editor-item[tooltip-content]:after{top:7px;left:auto;right:39px;white-space:nowrap}.tui-image-editor-container .tui-image-editor-help-menu.right>.tui-image-editor-item[tooltip-content].opened:after,.tui-image-editor-container .tui-image-editor-help-menu.right>.tui-image-editor-item[tooltip-content].opened:before{content:none}.tui-image-editor-container .tie-icon-add-button .tui-image-editor-button{min-width:42px}.tui-image-editor-container .svg_ic-helpmenu,.tui-image-editor-container .svg_ic-menu{width:24px;height:24px}.tui-image-editor-container .svg_ic-submenu{width:32px;height:32px}.tui-image-editor-container .svg_img-bi{width:257px;height:26px}.tui-image-editor-container .tui-image-editor-controls svg>use,.tui-image-editor-container .tui-image-editor-help-menu svg>use{display:none}.tui-image-editor-container .tui-image-editor-controls .enabled svg:hover>use.hover,.tui-image-editor-container .tui-image-editor-controls .normal svg:hover>use.hover,.tui-image-editor-container .tui-image-editor-help-menu .enabled svg:hover>use.hover,.tui-image-editor-container .tui-image-editor-help-menu .normal svg:hover>use.hover{display:block}.tui-image-editor-container .tui-image-editor-controls .active svg:hover>use.hover,.tui-image-editor-container .tui-image-editor-help-menu .active svg:hover>use.hover{display:none}.tui-image-editor-container .tui-image-editor-controls .active svg>use.active,.tui-image-editor-container .tui-image-editor-controls .enabled svg>use.enabled,.tui-image-editor-container .tui-image-editor-controls .on svg>use.hover,.tui-image-editor-container .tui-image-editor-controls .opened svg>use.hover,.tui-image-editor-container .tui-image-editor-controls svg>use.normal,.tui-image-editor-container .tui-image-editor-help-menu .active svg>use.active,.tui-image-editor-container .tui-image-editor-help-menu .enabled svg>use.enabled,.tui-image-editor-container .tui-image-editor-help-menu .on svg>use.hover,.tui-image-editor-container .tui-image-editor-help-menu .opened svg>use.hover,.tui-image-editor-container .tui-image-editor-help-menu svg>use.normal{display:block}.tui-image-editor-container .tui-image-editor-controls .active svg>use.normal,.tui-image-editor-container .tui-image-editor-controls .enabled svg>use.normal,.tui-image-editor-container .tui-image-editor-help-menu .active svg>use.normal,.tui-image-editor-container .tui-image-editor-help-menu .enabled svg>use.normal{display:none}.tui-image-editor-container .tui-image-editor-controls .help.enabled svg>use.normal,.tui-image-editor-container .tui-image-editor-controls .help svg>use.disabled,.tui-image-editor-container .tui-image-editor-help-menu .help.enabled svg>use.normal,.tui-image-editor-container .tui-image-editor-help-menu .help svg>use.disabled{display:block}.tui-image-editor-container .tui-image-editor-controls .help.enabled svg>use.disabled,.tui-image-editor-container .tui-image-editor-help-menu .help.enabled svg>use.disabled{display:none}.tui-image-editor-container .tui-image-editor-controls:hover{z-index:3}.tui-image-editor-container div.tui-colorpicker-clearfix{width:159px;height:28px;border:1px solid #d5d5d5;border-radius:2px;background-color:#f5f5f5;margin-top:6px;padding:4px 7px}.tui-image-editor-container .tui-colorpicker-palette-hex{width:114px;background-color:#f5f5f5;border:0;font-size:11px;margin-top:2px;font-family:Noto Sans,sans-serif}.tui-image-editor-container .tui-colorpicker-palette-hex[value=""]+.tui-colorpicker-palette-preview,.tui-image-editor-container .tui-colorpicker-palette-hex[value="#ffffff"]+.tui-colorpicker-palette-preview{border:1px solid #ccc}.tui-image-editor-container .tui-colorpicker-palette-hex[value=""]+.tui-colorpicker-palette-preview{background-size:cover;background-image:url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAAAXNSR0IArs4c6QAAAdBJREFUWAnFl0FuwjAQRZ0ukiugHqFSOQNdseuKW3ALzkA4BateICvUGyCxrtRFd4WuunH/TzykaYJrnLEYaTJJsP2+x8GZZCbQrLU5mj7Bn+EP8HvnCObd+R7xBV5lWfaNON4AnsA38E94qLEt+0yiFaBzAV/Bv+Cxxr4co7hKCDpw1q9wLeNYYdlAwyn8TYt8Hme3+8D5ozcTaMCZ68PXa2tnM2sbEcOZAJhrrpl2DAcTOGNjZPSfCdzkw6JrfbiMv+osBe4y9WOedhm4jZfhbENWuxS44H9Wz/xw4WzqLOAqh1+zycgAwzEMzr5k5gaHOa9ULBwuuDkFlHI1Kl4PJ66kgIpnoywOTmRFAYcbwYk9UMApWkD8zAV5ihcwHk4Rx7gl0IFTQL0EFc+CTQ9OZHWH3YhlVJiVpTHbrTGLhTHLZVgff6s9lyBsI9KduSS83oj+34rTwJutmBmCnMsvozRwZqB5GTkBw6/jdPDu69iJ6BYk6eCcfbcgcQIK/MByaaiMqm8rHcjol2TnpWDhyAKSGdA3FrxtJUToX0ODqatetfGE+8tyEUOV8GY5dGRwLP/MBS4RHQr4bT7NRAQjlcOTfZxmv2G+c4hI8nn+Ax5PG/zhI393AAAAAElFTkSuQmCC")}.tui-image-editor-container .tui-colorpicker-palette-preview{border-radius:100%;float:left;width:17px;height:17px;border:0}.tui-image-editor-container .color-picker-control{position:absolute;display:none;z-index:99;width:192px;background-color:#fff;box-shadow:0 3px 22px 6px rgba(0,0,0,.15);padding:16px;border-radius:2px}.tui-image-editor-container .color-picker-control .tui-colorpicker-palette-toggle-slider{display:none}.tui-image-editor-container .color-picker-control .tui-colorpicker-palette-button{border:0;border-radius:100%;margin:2px;background-size:cover;font-size:1px}.tui-image-editor-container .color-picker-control .tui-colorpicker-palette-button[title=""],.tui-image-editor-container .color-picker-control .tui-colorpicker-palette-button[title="#ffffff"]{border:1px solid #ccc}.tui-image-editor-container .color-picker-control .triangle{width:0;height:0;border-right:7px solid transparent;border-top:8px solid #fff;border-left:7px solid transparent;position:absolute;bottom:-8px;left:84px}.tui-image-editor-container .color-picker-control .tui-colorpicker-container,.tui-image-editor-container .color-picker-control .tui-colorpicker-palette-container,.tui-image-editor-container .color-picker-control .tui-colorpicker-palette-container ul{width:100%;height:auto}.tui-image-editor-container .filter-color-item .color-picker-control label{font-color:#333;font-weight:400;margin-right:7pxleft}.tui-image-editor-container .filter-color-item .tui-image-editor-checkbox{margin-top:0}.tui-image-editor-container .filter-color-item .tui-image-editor-checkbox>label:before,.tui-image-editor-container .filter-color-item .tui-image-editor-checkbox input+label:before{left:-16px}.tui-image-editor-container .color-picker{width:100%;height:auto}.tui-image-editor-container .color-picker-value{width:32px;height:32px;border:0;border-radius:100%;margin:auto auto 1px}.tui-image-editor-container .color-picker-value.transparent{border:1px solid #cbcbcb;background-size:cover;background-image:url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAAAXNSR0IArs4c6QAAAdBJREFUWAnFl0FuwjAQRZ0ukiugHqFSOQNdseuKW3ALzkA4BateICvUGyCxrtRFd4WuunH/TzykaYJrnLEYaTJJsP2+x8GZZCbQrLU5mj7Bn+EP8HvnCObd+R7xBV5lWfaNON4AnsA38E94qLEt+0yiFaBzAV/Bv+Cxxr4co7hKCDpw1q9wLeNYYdlAwyn8TYt8Hme3+8D5ozcTaMCZ68PXa2tnM2sbEcOZAJhrrpl2DAcTOGNjZPSfCdzkw6JrfbiMv+osBe4y9WOedhm4jZfhbENWuxS44H9Wz/xw4WzqLOAqh1+zycgAwzEMzr5k5gaHOa9ULBwuuDkFlHI1Kl4PJ66kgIpnoywOTmRFAYcbwYk9UMApWkD8zAV5ihcwHk4Rx7gl0IFTQL0EFc+CTQ9OZHWH3YhlVJiVpTHbrTGLhTHLZVgff6s9lyBsI9KduSS83oj+34rTwJutmBmCnMsvozRwZqB5GTkBw6/jdPDu69iJ6BYk6eCcfbcgcQIK/MByaaiMqm8rHcjol2TnpWDhyAKSGdA3FrxtJUToX0ODqatetfGE+8tyEUOV8GY5dGRwLP/MBS4RHQr4bT7NRAQjlcOTfZxmv2G+c4hI8nn+Ax5PG/zhI393AAAAAElFTkSuQmCC")}.tui-image-editor-container .color-picker-value+label{color:#fff}.tui-image-editor-container .tui-image-editor-submenu svg>use{display:none}.tie-icon-add-button.icon-arrow-2 .tui-image-editor-button[data-icontype=icon-arrow-2] svg>use.active,.tie-icon-add-button.icon-arrow-3 .tui-image-editor-button[data-icontype=icon-arrow-3] svg>use.active,.tie-icon-add-button.icon-arrow .tui-image-editor-button[data-icontype=icon-arrow] svg>use.active,.tie-icon-add-button.icon-bubble .tui-image-editor-button[data-icontype=icon-bubble] svg>use.active,.tie-icon-add-button.icon-heart .tui-image-editor-button[data-icontype=icon-heart] svg>use.active,.tie-icon-add-button.icon-location .tui-image-editor-button[data-icontype=icon-location] svg>use.active,.tie-icon-add-button.icon-polygon .tui-image-editor-button[data-icontype=icon-polygon] svg>use.active,.tie-icon-add-button.icon-star-2 .tui-image-editor-button[data-icontype=icon-star-2] svg>use.active,.tie-icon-add-button.icon-star .tui-image-editor-button[data-icontype=icon-star] svg>use.active,.tui-image-editor-container .tui-image-editor-submenu svg>use.normal{display:block}.tie-draw-line-select-button.free .tui-image-editor-button.free svg>use.normal,.tie-draw-line-select-button.line .tui-image-editor-button.line svg>use.normal{display:none}.tie-draw-line-select-button.free .tui-image-editor-button.free svg>use.active,.tie-draw-line-select-button.line .tui-image-editor-button.line svg>use.active{display:block}.tie-flip-button.flipX .tui-image-editor-button.flipX svg>use.normal,.tie-flip-button.flipY .tui-image-editor-button.flipY svg>use.normal,.tie-flip-button.resetFlip .tui-image-editor-button.resetFlip svg>use.normal{display:none}.tie-flip-button.flipX .tui-image-editor-button.flipX svg>use.active,.tie-flip-button.flipY .tui-image-editor-button.flipY svg>use.active,.tie-flip-button.resetFlip .tui-image-editor-button.resetFlip svg>use.active{display:block}.tie-mask-apply.apply.active .tui-image-editor-button.apply label{color:#fff}.tie-mask-apply.apply.active .tui-image-editor-button.apply svg>use.active{display:block}.tie-crop-button .tui-image-editor-button.apply,.tie-crop-preset-button .tui-image-editor-button.apply{margin-right:24px}.tie-crop-button .tui-image-editor-button.apply.active svg>use.active,.tie-crop-button .tui-image-editor-button.preset.active svg>use.active,.tie-crop-preset-button .tui-image-editor-button.apply.active svg>use.active,.tie-crop-preset-button .tui-image-editor-button.preset.active svg>use.active{display:block}.tie-shape-button.circle .tui-image-editor-button.circle svg>use.normal,.tie-shape-button.rect .tui-image-editor-button.rect svg>use.normal,.tie-shape-button.triangle .tui-image-editor-button.triangle svg>use.normal{display:none}.tie-shape-button.circle .tui-image-editor-button.circle svg>use.active,.tie-shape-button.rect .tui-image-editor-button.rect svg>use.active,.tie-shape-button.triangle .tui-image-editor-button.triangle svg>use.active,.tie-text-align-button.center .tui-image-editor-button.center svg>use.active,.tie-text-align-button.left .tui-image-editor-button.left svg>use.active,.tie-text-align-button.right .tui-image-editor-button.right svg>use.active,.tie-text-effect-button .tui-image-editor-button.active svg>use.active{display:block}.tie-icon-image-file,.tie-mask-image-file{opacity:0;position:absolute;width:100%;height:100%;border:1px solid green;cursor:inherit;left:0;top:0}.tie-zoom-button.flipX .tui-image-editor-button.flipX svg>use.normal,.tie-zoom-button.flipY .tui-image-editor-button.flipY svg>use.normal,.tie-zoom-button.resetFlip .tui-image-editor-button.resetFlip svg>use.normal{display:none}.tie-zoom-button.flipX .tui-image-editor-button.flipX svg>use.active,.tie-zoom-button.flipY .tui-image-editor-button.flipY svg>use.active,.tie-zoom-button.resetFlip .tui-image-editor-button.resetFlip svg>use.active{display:block}.tui-image-editor-container.top.tui-image-editor-top-optimization .tui-image-editor-controls ul{text-align:right}.tui-image-editor-container.top.tui-image-editor-top-optimization .tui-image-editor-controls-logo{display:none} diff --git a/apps/image-editor/dist/tui-image-editor.min.css.map b/apps/image-editor/dist/tui-image-editor.min.css.map index c1e84b244..85f4492da 100644 --- a/apps/image-editor/dist/tui-image-editor.min.css.map +++ b/apps/image-editor/dist/tui-image-editor.min.css.map @@ -1 +1 @@ -{"version":3,"sources":["tui-image-editor.min.css","src/css/main.styl","index.styl","src/css/gridtable.styl","src/css/submenu.styl","src/css/checkbox.styl","src/css/range.styl","src/css/position.styl","src/css/icon.styl","src/css/colorpicker.styl","src/css/buttons.styl","src/css/index.styl"],"names":[],"mappings":"AAAA;;;;;EAKE,CCLF,cACI,wBCCJ,CDEE,4BACE,QAAQ,CACR,SAAS,CACT,qBAAY,CACZ,gBAAY,CACZ,WAAQ,CACR,iBAAU,CACV,wBAAkB,CAClB,eAAU,CACV,mBCAJ,CDEI,kKACE,qBAAY,CACZ,QAAQ,CACR,SAAS,CACT,oBAAiB,CACjB,0BAAkB,CAClB,uBAAoB,CACpB,wBAAqB,CACrB,gBCIN,CDFI,qDAEI,eAAW,CACX,iBAAU,CACV,wBAAkB,CAClB,KAAK,CACL,UCIR,CDHI,4HAEI,WAAO,CACP,UCKR,CDHI,sHAEI,UAAO,CACP,SAAO,CACP,YCKR,CDHI,2HAEI,WAAO,CACP,WAAQ,CACR,YCKR,CDHI,8QAII,oBAAS,CACT,iBAAU,CACV,WAAO,CACP,WAAQ,CACR,SAAS,CACT,gBAAa,CACb,YAAS,CACT,kBAAe,CACf,qBAAQ,CACR,gCAAwB,CACxB,cAAW,CACX,eAAa,CACb,cAAQ,CACR,qBAAgB,CAChB,mBAAgB,CAChB,iBCKR,CDHI,2DACI,wBAAkB,CAClB,oBAAc,CACd,UCKR,CDJI,uDACI,iBAAU,CACV,MAAM,CACN,OAAO,CACP,oBAAS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,iBAAU,CACV,WAAQ,CACR,SPggCZ,CO//BQ,0PAGI,UAAO,CACP,WPigCZ,CO7/BQ,2EACI,eAAY,CACZ,eAAa,CACb,oBP+/BZ,CO9/BQ,0EACI,YPggCZ,CO//BY,oLAEE,UPigCd,COhgCI,0CACI,UAAO,CACP,WPkgCR,COjgCI,gDACI,UAAO,CACP,WAAQ,CACR,QAAQ,CACR,kBAAe,CAEf,oBPmgCR,COlgCQ,4DACI,wBAAQ,CACR,qBAAiB,CACjB,svBPogCZ,COlgCI,sDACI,UPogCR,COlgCI,8DACI,YPogCR,CQjmCI,28BAUI,aRqmCR,CQjmCE,8JAEE,YRmmCJ,CQjmCE,8JAEE,aRmmCJ,CQ5lCI,uNACI,YRgmCR,CQ/lCI,uNACI,aRmmCR,CQ/lCI,kEACI,URimCR,CQhmCI,2EACI,aRkmCR,CQ7lCI,uGACI,iBRgmCR,CQ7lCI,wSACI,aRomCR,CQ5lCI,wNACI,YRgmCR,CQvlCI,ggBAGI,aRimCR,CQhmCA,0CAEI,SAAS,CACT,iBAAU,CACV,UAAO,CACP,WAAQ,CACR,sBAAQ,CACR,cAAQ,CACR,MAAM,CACN,KRkmCJ,CQ1lCQ,uNACI,YR8lCZ,CQ7lCQ,uNACI,aRimCZ,CS/qCM,gGACI,gBTirCV,CShrCM,kGACI,YTkrCV","file":"tui-image-editor.min.css","sourcesContent":["/*!\n * tui-image-editor.min.js\n * @version 3.14.0\n * @author NHN. FE Development Lab \n * @license MIT\n */\nbody > textarea {\n position: fixed !important;\n}\n.tui-image-editor-container {\n margin: 0;\n padding: 0;\n box-sizing: border-box;\n min-height: 300px;\n height: 100%;\n position: relative;\n background-color: #282828;\n overflow: hidden;\n letter-spacing: 0.3px;\n}\n.tui-image-editor-container div,\n.tui-image-editor-container ul,\n.tui-image-editor-container label,\n.tui-image-editor-container input,\n.tui-image-editor-container li {\n box-sizing: border-box;\n margin: 0;\n padding: 0;\n -ms-user-select: none;\n -moz-user-select: -moz-none;\n -khtml-user-select: none;\n -webkit-user-select: none;\n user-select: none;\n}\n.tui-image-editor-container .tui-image-editor-header {\n/* BUTTON AND LOGO */\n min-width: 533px;\n position: absolute;\n background-color: #151515;\n top: 0;\n width: 100%;\n}\n.tui-image-editor-container .tui-image-editor-header-buttons,\n.tui-image-editor-container .tui-image-editor-controls-buttons {\n float: right;\n margin: 8px;\n}\n.tui-image-editor-container .tui-image-editor-header-logo,\n.tui-image-editor-container .tui-image-editor-controls-logo {\n float: left;\n width: 30%;\n padding: 17px;\n}\n.tui-image-editor-container .tui-image-editor-controls-logo,\n.tui-image-editor-container .tui-image-editor-controls-buttons {\n width: 270px;\n height: 100%;\n display: none;\n}\n.tui-image-editor-container .tui-image-editor-header-buttons button,\n.tui-image-editor-container .tui-image-editor-header-buttons div,\n.tui-image-editor-container .tui-image-editor-controls-buttons button,\n.tui-image-editor-container .tui-image-editor-controls-buttons div {\n display: inline-block;\n position: relative;\n width: 120px;\n height: 40px;\n padding: 0;\n line-height: 40px;\n outline: none;\n border-radius: 20px;\n border: 1px solid #ddd;\n font-family: 'Noto Sans', sans-serif;\n font-size: 12px;\n font-weight: bold;\n cursor: pointer;\n vertical-align: middle;\n letter-spacing: 0.3px;\n text-align: center;\n}\n.tui-image-editor-container .tui-image-editor-download-btn {\n background-color: #fdba3b;\n border-color: #fdba3b;\n color: #fff;\n}\n.tui-image-editor-container .tui-image-editor-load-btn {\n position: absolute;\n left: 0;\n right: 0;\n display: inline-block;\n top: 0;\n bottom: 0;\n width: 100%;\n cursor: pointer;\n opacity: 0;\n}\n.tui-image-editor-container .tui-image-editor-main-container {\n position: absolute;\n width: 100%;\n top: 0;\n bottom: 64px;\n}\n.tui-image-editor-container .tui-image-editor-main {\n position: absolute;\n text-align: center;\n top: 64px;\n bottom: 0;\n right: 0;\n left: 0;\n}\n.tui-image-editor-container .tui-image-editor-wrap {\n position: absolute;\n bottom: 0;\n width: 100%;\n overflow: auto;\n}\n.tui-image-editor-container .tui-image-editor-wrap .tui-image-editor-size-wrap {\n display: table;\n width: 100%;\n height: 100%;\n}\n.tui-image-editor-container .tui-image-editor-wrap .tui-image-editor-size-wrap .tui-image-editor-align-wrap {\n display: table-cell;\n vertical-align: middle;\n}\n.tui-image-editor-container .tui-image-editor {\n position: relative;\n display: inline-block;\n}\n.tui-image-editor-container .tui-image-editor-menu,\n.tui-image-editor-container .tui-image-editor-help-menu {\n width: auto;\n list-style: none;\n padding: 0;\n margin: 0 auto;\n display: table-cell;\n text-align: center;\n vertical-align: middle;\n white-space: nowrap;\n}\n.tui-image-editor-container .tui-image-editor-menu > .tui-image-editor-item,\n.tui-image-editor-container .tui-image-editor-help-menu > .tui-image-editor-item {\n position: relative;\n display: inline-block;\n border-radius: 2px;\n padding: 7px 8px 3px 8px;\n cursor: pointer;\n margin: 0 4px;\n}\n.tui-image-editor-container .tui-image-editor-menu > .tui-image-editor-item[tooltip-content]:hover:before,\n.tui-image-editor-container .tui-image-editor-help-menu > .tui-image-editor-item[tooltip-content]:hover:before {\n content: '';\n position: absolute;\n display: inline-block;\n margin: 0 auto 0;\n width: 0;\n height: 0;\n border-right: 7px solid transparent;\n border-top: 7px solid #2f2f2f;\n border-left: 7px solid transparent;\n left: 13px;\n top: -2px;\n}\n.tui-image-editor-container .tui-image-editor-menu > .tui-image-editor-item[tooltip-content]:hover:after,\n.tui-image-editor-container .tui-image-editor-help-menu > .tui-image-editor-item[tooltip-content]:hover:after {\n content: attr(tooltip-content);\n position: absolute;\n display: inline-block;\n background-color: #2f2f2f;\n color: #fff;\n padding: 5px 8px;\n font-size: 11px;\n font-weight: lighter;\n border-radius: 3px;\n max-height: 23px;\n top: -25px;\n left: 0;\n min-width: 24px;\n}\n.tui-image-editor-container .tui-image-editor-menu > .tui-image-editor-item.active,\n.tui-image-editor-container .tui-image-editor-help-menu > .tui-image-editor-item.active {\n background-color: #fff;\n transition: all 0.3s ease;\n}\n.tui-image-editor-container .tui-image-editor-wrap {\n position: absolute;\n}\n.tui-image-editor-container .tui-image-editor-grid-visual {\n display: none;\n position: absolute;\n width: 100%;\n height: 100%;\n border: 1px solid rgba(255,255,255,0.7);\n}\n.tui-image-editor-container .tui-image-editor-main.tui-image-editor-menu-flip .tui-image-editor,\n.tui-image-editor-container .tui-image-editor-main.tui-image-editor-menu-rotate .tui-image-editor {\n transition: none;\n}\n.tui-image-editor-container .tui-image-editor-main.tui-image-editor-menu-flip .tui-image-editor-grid-visual,\n.tui-image-editor-container .tui-image-editor-main.tui-image-editor-menu-rotate .tui-image-editor-grid-visual {\n display: block;\n}\n.tui-image-editor-container .tui-image-editor-grid-visual table {\n width: 100%;\n height: 100%;\n border-collapse: collapse;\n}\n.tui-image-editor-container .tui-image-editor-grid-visual table td {\n border: 1px solid rgba(255,255,255,0.3);\n}\n.tui-image-editor-container .tui-image-editor-grid-visual table td.dot:before {\n content: '';\n position: absolute;\n box-sizing: border-box;\n width: 10px;\n height: 10px;\n border: 0;\n box-shadow: 0 0 1px 0 rgba(0,0,0,0.3);\n border-radius: 100%;\n background-color: #fff;\n}\n.tui-image-editor-container .tui-image-editor-grid-visual table td.dot.left-top:before {\n top: -5px;\n left: -5px;\n}\n.tui-image-editor-container .tui-image-editor-grid-visual table td.dot.right-top:before {\n top: -5px;\n right: -5px;\n}\n.tui-image-editor-container .tui-image-editor-grid-visual table td.dot.left-bottom:before {\n bottom: -5px;\n left: -5px;\n}\n.tui-image-editor-container .tui-image-editor-grid-visual table td.dot.right-bottom:before {\n bottom: -5px;\n right: -5px;\n}\n.tui-image-editor-container .tui-image-editor-submenu {\n display: none;\n position: absolute;\n bottom: 0;\n width: 100%;\n height: 150px;\n white-space: nowrap;\n z-index: 2;\n}\n.tui-image-editor-container .tui-image-editor-submenu .tui-image-editor-button:hover svg > use.active {\n display: block;\n}\n.tui-image-editor-container .tui-image-editor-submenu .tui-image-editor-submenu-item li {\n display: inline-block;\n vertical-align: top;\n}\n.tui-image-editor-container .tui-image-editor-submenu .tui-image-editor-submenu-item .tui-image-editor-newline {\n display: block;\n margin-top: 0;\n}\n.tui-image-editor-container .tui-image-editor-submenu .tui-image-editor-submenu-item .tui-image-editor-button {\n position: relative;\n cursor: pointer;\n display: inline-block;\n font-weight: normal;\n font-size: 11px;\n margin: 0 9px 0 9px;\n}\n.tui-image-editor-container .tui-image-editor-submenu .tui-image-editor-submenu-item .tui-image-editor-button.preset {\n margin: 0 9px 20px 5px;\n}\n.tui-image-editor-container .tui-image-editor-submenu .tui-image-editor-submenu-item label > span {\n display: inline-block;\n cursor: pointer;\n padding-top: 5px;\n font-family: \"Noto Sans\", sans-serif;\n font-size: 11px;\n}\n.tui-image-editor-container .tui-image-editor-submenu .tui-image-editor-submenu-item .tui-image-editor-button.apply label,\n.tui-image-editor-container .tui-image-editor-submenu .tui-image-editor-submenu-item .tui-image-editor-button.cancel label {\n vertical-align: 7px;\n}\n.tui-image-editor-container .tui-image-editor-submenu > div {\n display: none;\n vertical-align: bottom;\n}\n.tui-image-editor-container .tui-image-editor-submenu .tui-image-editor-submenu-style {\n opacity: 0.95;\n z-index: -1;\n position: absolute;\n top: 0;\n bottom: 0;\n left: 0;\n right: 0;\n display: block;\n}\n.tui-image-editor-container .tui-image-editor-partition > div {\n width: 1px;\n height: 52px;\n border-left: 1px solid #3c3c3c;\n margin: 0 8px 0 8px;\n}\n.tui-image-editor-container .tui-image-editor-main.tui-image-editor-menu-filter .tui-image-editor-partition > div {\n height: 108px;\n margin: 0 29px 0 0px;\n}\n.tui-image-editor-container .tui-image-editor-submenu-align {\n text-align: left;\n margin-right: 30px;\n}\n.tui-image-editor-container .tui-image-editor-submenu-align label > span {\n width: 55px;\n white-space: nowrap;\n}\n.tui-image-editor-container .tui-image-editor-submenu-align:first-child {\n margin-right: 0;\n}\n.tui-image-editor-container .tui-image-editor-submenu-align:first-child label > span {\n width: 70px;\n}\n.tui-image-editor-container .tui-image-editor-main.tui-image-editor-menu-crop .tui-image-editor-submenu > div.tui-image-editor-menu-crop,\n.tui-image-editor-container .tui-image-editor-main.tui-image-editor-menu-flip .tui-image-editor-submenu > div.tui-image-editor-menu-flip,\n.tui-image-editor-container .tui-image-editor-main.tui-image-editor-menu-rotate .tui-image-editor-submenu > div.tui-image-editor-menu-rotate,\n.tui-image-editor-container .tui-image-editor-main.tui-image-editor-menu-shape .tui-image-editor-submenu > div.tui-image-editor-menu-shape,\n.tui-image-editor-container .tui-image-editor-main.tui-image-editor-menu-text .tui-image-editor-submenu > div.tui-image-editor-menu-text,\n.tui-image-editor-container .tui-image-editor-main.tui-image-editor-menu-mask .tui-image-editor-submenu > div.tui-image-editor-menu-mask,\n.tui-image-editor-container .tui-image-editor-main.tui-image-editor-menu-icon .tui-image-editor-submenu > div.tui-image-editor-menu-icon,\n.tui-image-editor-container .tui-image-editor-main.tui-image-editor-menu-draw .tui-image-editor-submenu > div.tui-image-editor-menu-draw,\n.tui-image-editor-container .tui-image-editor-main.tui-image-editor-menu-filter .tui-image-editor-submenu > div.tui-image-editor-menu-filter,\n.tui-image-editor-container .tui-image-editor-main.tui-image-editor-menu-zoom .tui-image-editor-submenu > div.tui-image-editor-menu-zoom {\n display: table-cell;\n}\n.tui-image-editor-container .tui-image-editor-main.tui-image-editor-menu-crop .tui-image-editor-submenu,\n.tui-image-editor-container .tui-image-editor-main.tui-image-editor-menu-flip .tui-image-editor-submenu,\n.tui-image-editor-container .tui-image-editor-main.tui-image-editor-menu-rotate .tui-image-editor-submenu,\n.tui-image-editor-container .tui-image-editor-main.tui-image-editor-menu-shape .tui-image-editor-submenu,\n.tui-image-editor-container .tui-image-editor-main.tui-image-editor-menu-text .tui-image-editor-submenu,\n.tui-image-editor-container .tui-image-editor-main.tui-image-editor-menu-mask .tui-image-editor-submenu,\n.tui-image-editor-container .tui-image-editor-main.tui-image-editor-menu-icon .tui-image-editor-submenu,\n.tui-image-editor-container .tui-image-editor-main.tui-image-editor-menu-draw .tui-image-editor-submenu,\n.tui-image-editor-container .tui-image-editor-main.tui-image-editor-menu-filter .tui-image-editor-submenu,\n.tui-image-editor-container .tui-image-editor-main.tui-image-editor-menu-zoom .tui-image-editor-submenu {\n display: table;\n}\n.tui-image-editor-container .tui-image-editor-help-menu {\n list-style: none;\n padding: 0;\n margin: 0 auto;\n text-align: center;\n vertical-align: middle;\n border-radius: 20px;\n background-color: rgba(255,255,255,0.06);\n z-index: 2;\n position: absolute;\n}\n.tui-image-editor-container .tui-image-editor-help-menu .tie-panel-history {\n display: none;\n background-color: #fff;\n color: #444;\n position: absolute;\n width: 196px;\n height: 276px;\n padding: 4px 2px;\n box-shadow: 0 2px 6px 0 rgba(0,0,0,0.15);\n cursor: auto;\n transform: translateX(calc(-50% + 12px));\n}\n.tui-image-editor-container .tui-image-editor-help-menu .tie-panel-history .history-list {\n height: 268px;\n padding: 0;\n overflow: hidden scroll;\n list-style: none;\n}\n.tui-image-editor-container .tui-image-editor-help-menu .tie-panel-history .history-list .history-item {\n height: 24px;\n font-size: 11px;\n line-height: 24px;\n}\n.tui-image-editor-container .tui-image-editor-help-menu .tie-panel-history .history-list .history-item .tui-image-editor-history-item {\n position: relative;\n height: 24px;\n cursor: pointer;\n}\n.tui-image-editor-container .tui-image-editor-help-menu .tie-panel-history .history-list .history-item .tui-image-editor-history-item svg {\n width: 24px;\n height: 24px;\n}\n.tui-image-editor-container .tui-image-editor-help-menu .tie-panel-history .history-list .history-item .tui-image-editor-history-item span {\n display: inline-block;\n width: 128px;\n height: 24px;\n text-align: left;\n}\n.tui-image-editor-container .tui-image-editor-help-menu .tie-panel-history .history-list .history-item .tui-image-editor-history-item .history-item-icon {\n display: inline-block;\n width: 24px;\n height: 24px;\n position: absolute;\n top: 6px;\n left: 6px;\n}\n.tui-image-editor-container .tui-image-editor-help-menu .tie-panel-history .history-list .history-item .tui-image-editor-history-item .history-item-checkbox {\n display: none;\n width: 24px;\n height: 24px;\n position: absolute;\n top: 5px;\n right: -6px;\n}\n.tui-image-editor-container .tui-image-editor-help-menu .tie-panel-history .history-list .history-item.selected-item {\n background-color: rgba(119,119,119,0.12);\n}\n.tui-image-editor-container .tui-image-editor-help-menu .tie-panel-history .history-list .history-item.selected-item .history-item-checkbox {\n display: inline-block;\n}\n.tui-image-editor-container .tui-image-editor-help-menu .tie-panel-history .history-list .history-item.disabled-item {\n color: #333;\n opacity: 0.3;\n}\n.tui-image-editor-container .tui-image-editor-help-menu .opened .tie-panel-history {\n display: block;\n}\n.tui-image-editor-container .tui-image-editor-help-menu .opened .tie-panel-history:before {\n content: '';\n position: absolute;\n display: inline-block;\n margin: 0 auto;\n width: 0;\n height: 0;\n}\n.tui-image-editor-container .filter-color-item {\n display: inline-block;\n}\n.tui-image-editor-container .filter-color-item .tui-image-editor-checkbox {\n display: block;\n}\n.tui-image-editor-container .tui-image-editor-checkbox-wrap {\n display: inline-block !important;\n text-align: left;\n}\n.tui-image-editor-container .tui-image-editor-checkbox-wrap.fixed-width {\n width: 187px;\n white-space: normal;\n}\n.tui-image-editor-container .tui-image-editor-checkbox {\n display: inline-block;\n margin: 1px 0 1px 0;\n}\n.tui-image-editor-container .tui-image-editor-checkbox input {\n width: 14px;\n height: 14px;\n opacity: 0;\n}\n.tui-image-editor-container .tui-image-editor-checkbox > label > span {\n color: #fff;\n height: 14px;\n position: relative;\n}\n.tui-image-editor-container .tui-image-editor-checkbox input + label:before,\n.tui-image-editor-container .tui-image-editor-checkbox > label > span:before {\n content: '';\n position: absolute;\n width: 14px;\n height: 14px;\n background-color: #fff;\n top: 6px;\n left: -19px;\n display: inline-block;\n margin: 0;\n text-align: center;\n font-size: 11px;\n border: 0;\n border-radius: 2px;\n padding-top: 1px;\n box-sizing: border-box;\n}\n.tui-image-editor-container .tui-image-editor-checkbox input[type='checkbox']:checked + span:before {\n background-size: cover;\n background-image: url(\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAA4AAAAOCAYAAAAfSC3RAAAAAXNSR0IArs4c6QAAAMBJREFUKBWVkjEOwjAMRe2WgZW7IIHEDdhghhuwcQ42rlJugAQS54Cxa5cq1QM5TUpByZfS2j9+dlJVt/tX5ZxbS4ZU9VLkQvSHKTIGRaVJYFmKrBbTCJxE2UgCdDzMZDkHrOV6b95V0US6UmgKodujEZbJg0B0ZgEModO5lrY1TMQf1TpyJGBEjD+E2NPN7ukIUDiF/BfEXgRiGEw8NgkffYGYwCi808fpn/6OvfUfsDr/Vc1IfRf8sKnFVqeiVQfDu0tf/nWH9gAAAABJRU5ErkJggg==\");\n}\n.tui-image-editor-container .tui-image-editor-selectlist-wrap {\n position: relative;\n}\n.tui-image-editor-container .tui-image-editor-selectlist-wrap select {\n width: 100%;\n height: 28px;\n margin-top: 4px;\n border: 0;\n outline: 0;\n border-radius: 0;\n border: 1px solid #cbdbdb;\n background-color: #fff;\n -webkit-appearance: none;\n -moz-appearance: none;\n appearance: none;\n padding: 0 7px 0 10px;\n}\n.tui-image-editor-container .tui-image-editor-selectlist-wrap .tui-image-editor-selectlist {\n display: none;\n position: relative;\n top: -1px;\n border: 1px solid #ccc;\n background-color: #fff;\n border-top: 0px;\n padding: 4px 0;\n}\n.tui-image-editor-container .tui-image-editor-selectlist-wrap .tui-image-editor-selectlist li {\n display: block;\n text-align: left;\n padding: 7px 10px;\n font-family: 'Noto Sans', sans-serif;\n}\n.tui-image-editor-container .tui-image-editor-selectlist-wrap .tui-image-editor-selectlist li:hover {\n background-color: rgba(81,92,230,0.05);\n}\n.tui-image-editor-container .tui-image-editor-selectlist-wrap:before {\n content: '';\n position: absolute;\n display: inline-block;\n width: 14px;\n height: 14px;\n right: 5px;\n top: 10px;\n background-image: url(\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAA4AAAAOCAYAAAAfSC3RAAAAAXNSR0IArs4c6QAAAHlJREFUKBVjYBgFOEOAEVkmPDxc89+/f6eAYjzI4kD2FyYmJrOVK1deh4kzwRggGiQBVJCELAZig8SQNYHEmEEEMrh69eo1HR0dfqCYJUickZGxf9WqVf3IakBsFBthklpaWmVA9mEQhrJhUoTp0NBQCRAmrHL4qgAAuu4cWZOZIGsAAAAASUVORK5CYII=\");\n background-size: cover;\n}\n.tui-image-editor-container .tui-image-editor-selectlist-wrap select::-ms-expand {\n display: none;\n}\n.tui-image-editor-container .tui-image-editor-virtual-range-bar .tui-image-editor-disabled,\n.tui-image-editor-container .tui-image-editor-virtual-range-subbar .tui-image-editor-disabled,\n.tui-image-editor-container .tui-image-editor-virtual-range-pointer .tui-image-editor-disabled {\n backbround-color: #f00;\n}\n.tui-image-editor-container .tui-image-editor-range {\n position: relative;\n top: 5px;\n width: 166px;\n height: 17px;\n display: inline-block;\n}\n.tui-image-editor-container .tui-image-editor-virtual-range-bar {\n top: 7px;\n position: absolute;\n width: 100%;\n height: 2px;\n background-color: #666;\n}\n.tui-image-editor-container .tui-image-editor-virtual-range-subbar {\n position: absolute;\n height: 100%;\n left: 0;\n right: 0;\n background-color: #d1d1d1;\n}\n.tui-image-editor-container .tui-image-editor-virtual-range-pointer {\n position: absolute;\n cursor: pointer;\n top: -5px;\n left: 0;\n width: 12px;\n height: 12px;\n background-color: #fff;\n border-radius: 100%;\n}\n.tui-image-editor-container .tui-image-editor-range-wrap {\n display: inline-block;\n margin-left: 4px;\n}\n.tui-image-editor-container .tui-image-editor-range-wrap.short .tui-image-editor-range {\n width: 100px;\n}\n.tui-image-editor-container .color-picker-control .tui-image-editor-range {\n width: 108px;\n margin-left: 10px;\n}\n.tui-image-editor-container .color-picker-control .tui-image-editor-virtual-range-pointer {\n background-color: #333;\n}\n.tui-image-editor-container .color-picker-control .tui-image-editor-virtual-range-bar {\n background-color: #ccc;\n}\n.tui-image-editor-container .color-picker-control .tui-image-editor-virtual-range-subbar {\n background-color: #606060;\n}\n.tui-image-editor-container .tui-image-editor-range-wrap.tui-image-editor-newline.short {\n margin-top: -2px;\n margin-left: 19px;\n}\n.tui-image-editor-container .tui-image-editor-range-wrap.tui-image-editor-newline.short label {\n color: #8e8e8e;\n font-weight: normal;\n}\n.tui-image-editor-container .tui-image-editor-range-wrap label {\n vertical-align: baseline;\n font-size: 11px;\n margin-right: 7px;\n color: #fff;\n}\n.tui-image-editor-container .tui-image-editor-range-value {\n cursor: default;\n width: 40px;\n height: 24px;\n outline: none;\n border-radius: 2px;\n box-shadow: none;\n border: 1px solid #d5d5d5;\n text-align: center;\n background-color: #1c1c1c;\n color: #fff;\n font-weight: lighter;\n vertical-align: baseline;\n font-family: 'Noto Sans', sans-serif;\n margin-top: 21px;\n margin-left: 4px;\n}\n.tui-image-editor-container .tui-image-editor-controls {\n position: absolute;\n background-color: #151515;\n width: 100%;\n height: 64px;\n display: table;\n bottom: 0;\n z-index: 2;\n}\n.tui-image-editor-container .tui-image-editor-icpartition {\n display: inline-block;\n background-color: #444;\n width: 1px;\n height: 24px;\n}\n.tui-image-editor-container.left .tui-image-editor-menu > .tui-image-editor-item[tooltip-content]:before {\n left: 28px;\n top: 11px;\n border-right: 7px solid #2f2f2f;\n border-top: 7px solid transparent;\n border-bottom: 7px solid transparent;\n}\n.tui-image-editor-container.left .tui-image-editor-menu > .tui-image-editor-item[tooltip-content]:after {\n top: 7px;\n left: 42px;\n white-space: nowrap;\n}\n.tui-image-editor-container.left .tui-image-editor-submenu {\n left: 0;\n height: 100%;\n width: 248px;\n}\n.tui-image-editor-container.left .tui-image-editor-main-container {\n left: 64px;\n width: calc(100% - 64px);\n height: 100%;\n}\n.tui-image-editor-container.left .tui-image-editor-controls {\n width: 64px;\n height: 100%;\n display: table;\n}\n.tui-image-editor-container.left .tui-image-editor-menu,\n.tui-image-editor-container.right .tui-image-editor-menu {\n white-space: inherit;\n}\n.tui-image-editor-container.left .tui-image-editor-submenu,\n.tui-image-editor-container.right .tui-image-editor-submenu {\n white-space: normal;\n}\n.tui-image-editor-container.left .tui-image-editor-submenu > div,\n.tui-image-editor-container.right .tui-image-editor-submenu > div {\n vertical-align: middle;\n}\n.tui-image-editor-container.left .tui-image-editor-controls li,\n.tui-image-editor-container.right .tui-image-editor-controls li {\n display: inline-block;\n margin: 4px auto;\n}\n.tui-image-editor-container.left .tui-image-editor-icpartition,\n.tui-image-editor-container.right .tui-image-editor-icpartition {\n position: relative;\n top: -7px;\n width: 24px;\n height: 1px;\n}\n.tui-image-editor-container.left .tui-image-editor-submenu .tui-image-editor-partition,\n.tui-image-editor-container.right .tui-image-editor-submenu .tui-image-editor-partition {\n display: block;\n width: 75%;\n margin: auto;\n}\n.tui-image-editor-container.left .tui-image-editor-submenu .tui-image-editor-partition > div,\n.tui-image-editor-container.right .tui-image-editor-submenu .tui-image-editor-partition > div {\n border-left: 0;\n height: 10px;\n border-bottom: 1px solid #3c3c3c;\n width: 100%;\n margin: 0;\n}\n.tui-image-editor-container.left .tui-image-editor-submenu .tui-image-editor-submenu-align,\n.tui-image-editor-container.right .tui-image-editor-submenu .tui-image-editor-submenu-align {\n margin-right: 0;\n}\n.tui-image-editor-container.left .tui-image-editor-submenu .tui-image-editor-submenu-item li,\n.tui-image-editor-container.right .tui-image-editor-submenu .tui-image-editor-submenu-item li {\n margin-top: 15px;\n}\n.tui-image-editor-container.left .tui-image-editor-submenu .tui-image-editor-submenu-item .tui-colorpicker-clearfix li,\n.tui-image-editor-container.right .tui-image-editor-submenu .tui-image-editor-submenu-item .tui-colorpicker-clearfix li {\n margin-top: 0;\n}\n.tui-image-editor-container.left .tui-image-editor-checkbox-wrap.fixed-width,\n.tui-image-editor-container.right .tui-image-editor-checkbox-wrap.fixed-width {\n width: 182px;\n white-space: normal;\n}\n.tui-image-editor-container.left .tui-image-editor-range-wrap.tui-image-editor-newline label.range,\n.tui-image-editor-container.right .tui-image-editor-range-wrap.tui-image-editor-newline label.range {\n display: block;\n text-align: left;\n width: 75%;\n margin: auto;\n}\n.tui-image-editor-container.left .tui-image-editor-range,\n.tui-image-editor-container.right .tui-image-editor-range {\n width: 136px;\n}\n.tui-image-editor-container.right .tui-image-editor-menu > .tui-image-editor-item[tooltip-content]:before {\n left: -3px;\n top: 11px;\n border-left: 7px solid #2f2f2f;\n border-top: 7px solid transparent;\n border-bottom: 7px solid transparent;\n}\n.tui-image-editor-container.right .tui-image-editor-menu > .tui-image-editor-item[tooltip-content]:after {\n top: 7px;\n left: unset;\n right: 43px;\n white-space: nowrap;\n}\n.tui-image-editor-container.right .tui-image-editor-submenu {\n right: 0;\n height: 100%;\n width: 248px;\n}\n.tui-image-editor-container.right .tui-image-editor-main-container {\n right: 64px;\n width: calc(100% - 64px);\n height: 100%;\n}\n.tui-image-editor-container.right .tui-image-editor-controls {\n right: 0;\n width: 64px;\n height: 100%;\n display: table;\n}\n.tui-image-editor-container.top .tui-image-editor-submenu .tui-image-editor-partition.only-left-right,\n.tui-image-editor-container.bottom .tui-image-editor-submenu .tui-image-editor-partition.only-left-right {\n display: none;\n}\n.tui-image-editor-container.bottom .tui-image-editor-submenu > div {\n padding-bottom: 24px;\n}\n.tui-image-editor-container.top .color-picker-control .triangle {\n top: -8px;\n border-right: 7px solid transparent;\n border-top: 0px;\n border-left: 7px solid transparent;\n border-bottom: 8px solid #fff;\n}\n.tui-image-editor-container.top .tui-image-editor-size-wrap {\n height: 100%;\n}\n.tui-image-editor-container.top .tui-image-editor-main-container {\n bottom: 0;\n}\n.tui-image-editor-container.top .tui-image-editor-menu > .tui-image-editor-item[tooltip-content]:before {\n left: 13px;\n border-top: 0;\n border-bottom: 7px solid #2f2f2f;\n top: 33px;\n}\n.tui-image-editor-container.top .tui-image-editor-menu > .tui-image-editor-item[tooltip-content]:after {\n top: 38px;\n}\n.tui-image-editor-container.top .tui-image-editor-submenu {\n top: 0;\n bottom: auto;\n}\n.tui-image-editor-container.top .tui-image-editor-submenu > div {\n padding-top: 24px;\n vertical-align: top;\n}\n.tui-image-editor-container.top .tui-image-editor-controls-logo {\n display: table-cell;\n}\n.tui-image-editor-container.top .tui-image-editor-controls-buttons {\n display: table-cell;\n}\n.tui-image-editor-container.top .tui-image-editor-main {\n top: 64px;\n height: calc(100% - 64px);\n}\n.tui-image-editor-container.top .tui-image-editor-controls {\n top: 0;\n bottom: inherit;\n}\n.tui-image-editor-container .tui-image-editor-help-menu.top {\n white-space: nowrap;\n width: 506px;\n height: 40px;\n top: 8px;\n left: 50%;\n transform: translateX(-50%);\n}\n.tui-image-editor-container .tui-image-editor-help-menu.top .tie-panel-history {\n top: 45px;\n}\n.tui-image-editor-container .tui-image-editor-help-menu.top .opened .tie-panel-history:before {\n border-right: 8px solid transparent;\n border-left: 8px solid transparent;\n border-bottom: 8px solid #fff;\n left: 90px;\n top: -8px;\n}\n.tui-image-editor-container .tui-image-editor-help-menu.top > .tui-image-editor-item[tooltip-content]:before {\n left: 13px;\n top: 35px;\n border: none;\n border-bottom: 7px solid #2f2f2f;\n border-left: 7px solid transparent;\n border-right: 7px solid transparent;\n}\n.tui-image-editor-container .tui-image-editor-help-menu.top > .tui-image-editor-item[tooltip-content]:after {\n top: 41px;\n left: -4px;\n white-space: nowrap;\n}\n.tui-image-editor-container .tui-image-editor-help-menu.top > .tui-image-editor-item[tooltip-content].opened:before,\n.tui-image-editor-container .tui-image-editor-help-menu.top > .tui-image-editor-item[tooltip-content].opened:after {\n content: none;\n}\n.tui-image-editor-container .tui-image-editor-help-menu.bottom {\n white-space: nowrap;\n width: 506px;\n height: 40px;\n bottom: 8px;\n left: 50%;\n transform: translateX(-50%);\n}\n.tui-image-editor-container .tui-image-editor-help-menu.bottom .tie-panel-history {\n bottom: 45px;\n}\n.tui-image-editor-container .tui-image-editor-help-menu.bottom .opened .tie-panel-history:before {\n border-right: 8px solid transparent;\n border-left: 8px solid transparent;\n border-top: 8px solid #fff;\n left: 90px;\n bottom: -8px;\n}\n.tui-image-editor-container .tui-image-editor-help-menu.bottom > .tui-image-editor-item[tooltip-content]:before {\n left: 13px;\n top: auto;\n bottom: 36px;\n border: none;\n border-top: 7px solid #2f2f2f;\n border-left: 7px solid transparent;\n border-right: 7px solid transparent;\n}\n.tui-image-editor-container .tui-image-editor-help-menu.bottom > .tui-image-editor-item[tooltip-content]:after {\n top: auto;\n left: -4px;\n bottom: 41px;\n white-space: nowrap;\n}\n.tui-image-editor-container .tui-image-editor-help-menu.bottom > .tui-image-editor-item[tooltip-content].opened:before,\n.tui-image-editor-container .tui-image-editor-help-menu.bottom > .tui-image-editor-item[tooltip-content].opened:after {\n content: none;\n}\n.tui-image-editor-container .tui-image-editor-help-menu.left {\n white-space: inherit;\n width: 40px;\n height: 506px;\n left: 8px;\n top: 50%;\n transform: translateY(-50%);\n}\n.tui-image-editor-container .tui-image-editor-help-menu.left .tie-panel-history {\n left: 140px;\n top: -4px;\n}\n.tui-image-editor-container .tui-image-editor-help-menu.left .opened .tie-panel-history:before {\n border-top: 8px solid transparent;\n border-bottom: 8px solid transparent;\n border-right: 8px solid #fff;\n left: -8px;\n top: 14px;\n}\n.tui-image-editor-container .tui-image-editor-help-menu.left .tui-image-editor-item {\n margin: 4px auto;\n padding: 6px 8px;\n}\n.tui-image-editor-container .tui-image-editor-help-menu.left > .tui-image-editor-item[tooltip-content]:before {\n left: 27px;\n top: 11px;\n border: none;\n border-right: 7px solid #2f2f2f;\n border-top: 7px solid transparent;\n border-bottom: 7px solid transparent;\n}\n.tui-image-editor-container .tui-image-editor-help-menu.left > .tui-image-editor-item[tooltip-content]:after {\n top: 7px;\n left: 40px;\n white-space: nowrap;\n}\n.tui-image-editor-container .tui-image-editor-help-menu.left > .tui-image-editor-item[tooltip-content].opened:before,\n.tui-image-editor-container .tui-image-editor-help-menu.left > .tui-image-editor-item[tooltip-content].opened:after {\n content: none;\n}\n.tui-image-editor-container .tui-image-editor-help-menu.right {\n white-space: inherit;\n width: 40px;\n height: 506px;\n right: 8px;\n top: 50%;\n transform: translateY(-50%);\n}\n.tui-image-editor-container .tui-image-editor-help-menu.right .tie-panel-history {\n right: -30px;\n top: -4px;\n}\n.tui-image-editor-container .tui-image-editor-help-menu.right .opened .tie-panel-history:before {\n border-top: 8px solid transparent;\n border-bottom: 8px solid transparent;\n border-left: 8px solid #fff;\n right: -8px;\n top: 14px;\n}\n.tui-image-editor-container .tui-image-editor-help-menu.right .tui-image-editor-item {\n margin: 4px auto;\n padding: 6px 8px;\n}\n.tui-image-editor-container .tui-image-editor-help-menu.right > .tui-image-editor-item[tooltip-content]:before {\n left: -6px;\n top: 11px;\n border: none;\n border-left: 7px solid #2f2f2f;\n border-top: 7px solid transparent;\n border-bottom: 7px solid transparent;\n}\n.tui-image-editor-container .tui-image-editor-help-menu.right > .tui-image-editor-item[tooltip-content]:after {\n top: 7px;\n left: auto;\n right: 39px;\n white-space: nowrap;\n}\n.tui-image-editor-container .tui-image-editor-help-menu.right > .tui-image-editor-item[tooltip-content].opened:before,\n.tui-image-editor-container .tui-image-editor-help-menu.right > .tui-image-editor-item[tooltip-content].opened:after {\n content: none;\n}\n.tui-image-editor-container .tie-icon-add-button .tui-image-editor-button {\n min-width: 42px;\n}\n.tui-image-editor-container .svg_ic-menu,\n.tui-image-editor-container .svg_ic-helpmenu {\n width: 24px;\n height: 24px;\n}\n.tui-image-editor-container .svg_ic-submenu {\n width: 32px;\n height: 32px;\n}\n.tui-image-editor-container .svg_img-bi {\n width: 257px;\n height: 26px;\n}\n.tui-image-editor-container .tui-image-editor-help-menu svg > use,\n.tui-image-editor-container .tui-image-editor-controls svg > use {\n display: none;\n}\n.tui-image-editor-container .tui-image-editor-help-menu .enabled svg:hover > use.hover,\n.tui-image-editor-container .tui-image-editor-controls .enabled svg:hover > use.hover,\n.tui-image-editor-container .tui-image-editor-help-menu .normal svg:hover > use.hover,\n.tui-image-editor-container .tui-image-editor-controls .normal svg:hover > use.hover {\n display: block;\n}\n.tui-image-editor-container .tui-image-editor-help-menu .active svg:hover > use.hover,\n.tui-image-editor-container .tui-image-editor-controls .active svg:hover > use.hover {\n display: none;\n}\n.tui-image-editor-container .tui-image-editor-help-menu .on svg > use.hover,\n.tui-image-editor-container .tui-image-editor-controls .on svg > use.hover,\n.tui-image-editor-container .tui-image-editor-help-menu .opened svg > use.hover,\n.tui-image-editor-container .tui-image-editor-controls .opened svg > use.hover {\n display: block;\n}\n.tui-image-editor-container .tui-image-editor-help-menu svg > use.normal,\n.tui-image-editor-container .tui-image-editor-controls svg > use.normal {\n display: block;\n}\n.tui-image-editor-container .tui-image-editor-help-menu .active svg > use.active,\n.tui-image-editor-container .tui-image-editor-controls .active svg > use.active {\n display: block;\n}\n.tui-image-editor-container .tui-image-editor-help-menu .enabled svg > use.enabled,\n.tui-image-editor-container .tui-image-editor-controls .enabled svg > use.enabled {\n display: block;\n}\n.tui-image-editor-container .tui-image-editor-help-menu .active svg > use.normal,\n.tui-image-editor-container .tui-image-editor-controls .active svg > use.normal,\n.tui-image-editor-container .tui-image-editor-help-menu .enabled svg > use.normal,\n.tui-image-editor-container .tui-image-editor-controls .enabled svg > use.normal {\n display: none;\n}\n.tui-image-editor-container .tui-image-editor-help-menu .help svg > use.disabled,\n.tui-image-editor-container .tui-image-editor-controls .help svg > use.disabled,\n.tui-image-editor-container .tui-image-editor-help-menu .help.enabled svg > use.normal,\n.tui-image-editor-container .tui-image-editor-controls .help.enabled svg > use.normal {\n display: block;\n}\n.tui-image-editor-container .tui-image-editor-help-menu .help.enabled svg > use.disabled,\n.tui-image-editor-container .tui-image-editor-controls .help.enabled svg > use.disabled {\n display: none;\n}\n.tui-image-editor-container .tui-image-editor-controls:hover {\n z-index: 3;\n}\n.tui-image-editor-container div.tui-colorpicker-clearfix {\n width: 159px;\n height: 28px;\n border: 1px solid #d5d5d5;\n border-radius: 2px;\n background-color: #f5f5f5;\n margin-top: 6px;\n padding: 4px 7px 4px 7px;\n}\n.tui-image-editor-container .tui-colorpicker-palette-hex {\n width: 114px;\n background-color: #f5f5f5;\n border: 0;\n font-size: 11px;\n margin-top: 2px;\n font-family: 'Noto Sans', sans-serif;\n}\n.tui-image-editor-container .tui-colorpicker-palette-hex[value='#ffffff'] + .tui-colorpicker-palette-preview,\n.tui-image-editor-container .tui-colorpicker-palette-hex[value=''] + .tui-colorpicker-palette-preview {\n border: 1px solid #ccc;\n}\n.tui-image-editor-container .tui-colorpicker-palette-hex[value=''] + .tui-colorpicker-palette-preview {\n background-size: cover;\n background-image: url(\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAAAXNSR0IArs4c6QAAAdBJREFUWAnFl0FuwjAQRZ0ukiugHqFSOQNdseuKW3ALzkA4BateICvUGyCxrtRFd4WuunH/TzykaYJrnLEYaTJJsP2+x8GZZCbQrLU5mj7Bn+EP8HvnCObd+R7xBV5lWfaNON4AnsA38E94qLEt+0yiFaBzAV/Bv+Cxxr4co7hKCDpw1q9wLeNYYdlAwyn8TYt8Hme3+8D5ozcTaMCZ68PXa2tnM2sbEcOZAJhrrpl2DAcTOGNjZPSfCdzkw6JrfbiMv+osBe4y9WOedhm4jZfhbENWuxS44H9Wz/xw4WzqLOAqh1+zycgAwzEMzr5k5gaHOa9ULBwuuDkFlHI1Kl4PJ66kgIpnoywOTmRFAYcbwYk9UMApWkD8zAV5ihcwHk4Rx7gl0IFTQL0EFc+CTQ9OZHWH3YhlVJiVpTHbrTGLhTHLZVgff6s9lyBsI9KduSS83oj+34rTwJutmBmCnMsvozRwZqB5GTkBw6/jdPDu69iJ6BYk6eCcfbcgcQIK/MByaaiMqm8rHcjol2TnpWDhyAKSGdA3FrxtJUToX0ODqatetfGE+8tyEUOV8GY5dGRwLP/MBS4RHQr4bT7NRAQjlcOTfZxmv2G+c4hI8nn+Ax5PG/zhI393AAAAAElFTkSuQmCC\");\n}\n.tui-image-editor-container .tui-colorpicker-palette-preview {\n border-radius: 100%;\n float: left;\n width: 17px;\n height: 17px;\n border: 0;\n}\n.tui-image-editor-container .color-picker-control {\n position: absolute;\n display: none;\n z-index: 99;\n width: 192px;\n background-color: #fff;\n box-shadow: 0 3px 22px 6px rgba(0,0,0,0.15);\n padding: 16px;\n border-radius: 2px;\n}\n.tui-image-editor-container .color-picker-control .tui-colorpicker-palette-toggle-slider {\n display: none;\n}\n.tui-image-editor-container .color-picker-control .tui-colorpicker-palette-button {\n border: 0;\n border-radius: 100%;\n margin: 2px;\n background-size: cover;\n font-size: 1px;\n}\n.tui-image-editor-container .color-picker-control .tui-colorpicker-palette-button[title='#ffffff'] {\n border: 1px solid #ccc;\n}\n.tui-image-editor-container .color-picker-control .tui-colorpicker-palette-button[title=''] {\n border: 1px solid #ccc;\n}\n.tui-image-editor-container .color-picker-control .triangle {\n width: 0;\n height: 0;\n border-right: 7px solid transparent;\n border-top: 8px solid #fff;\n border-left: 7px solid transparent;\n position: absolute;\n bottom: -8px;\n left: 84px;\n}\n.tui-image-editor-container .color-picker-control .tui-colorpicker-container,\n.tui-image-editor-container .color-picker-control .tui-colorpicker-palette-container ul,\n.tui-image-editor-container .color-picker-control .tui-colorpicker-palette-container {\n width: 100%;\n height: auto;\n}\n.tui-image-editor-container .filter-color-item .color-picker-control label {\n font-color: #333;\n font-weight: normal;\n margin-right: 7pxleft;\n}\n.tui-image-editor-container .filter-color-item .tui-image-editor-checkbox {\n margin-top: 0;\n}\n.tui-image-editor-container .filter-color-item .tui-image-editor-checkbox input + label:before,\n.tui-image-editor-container .filter-color-item .tui-image-editor-checkbox > label:before {\n left: -16px;\n}\n.tui-image-editor-container .color-picker {\n width: 100%;\n height: auto;\n}\n.tui-image-editor-container .color-picker-value {\n width: 32px;\n height: 32px;\n border: 0px;\n border-radius: 100%;\n margin: auto;\n margin-bottom: 1px;\n}\n.tui-image-editor-container .color-picker-value.transparent {\n border: 1px solid #cbcbcb;\n background-size: cover;\n background-image: url(\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAAAXNSR0IArs4c6QAAAdBJREFUWAnFl0FuwjAQRZ0ukiugHqFSOQNdseuKW3ALzkA4BateICvUGyCxrtRFd4WuunH/TzykaYJrnLEYaTJJsP2+x8GZZCbQrLU5mj7Bn+EP8HvnCObd+R7xBV5lWfaNON4AnsA38E94qLEt+0yiFaBzAV/Bv+Cxxr4co7hKCDpw1q9wLeNYYdlAwyn8TYt8Hme3+8D5ozcTaMCZ68PXa2tnM2sbEcOZAJhrrpl2DAcTOGNjZPSfCdzkw6JrfbiMv+osBe4y9WOedhm4jZfhbENWuxS44H9Wz/xw4WzqLOAqh1+zycgAwzEMzr5k5gaHOa9ULBwuuDkFlHI1Kl4PJ66kgIpnoywOTmRFAYcbwYk9UMApWkD8zAV5ihcwHk4Rx7gl0IFTQL0EFc+CTQ9OZHWH3YhlVJiVpTHbrTGLhTHLZVgff6s9lyBsI9KduSS83oj+34rTwJutmBmCnMsvozRwZqB5GTkBw6/jdPDu69iJ6BYk6eCcfbcgcQIK/MByaaiMqm8rHcjol2TnpWDhyAKSGdA3FrxtJUToX0ODqatetfGE+8tyEUOV8GY5dGRwLP/MBS4RHQr4bT7NRAQjlcOTfZxmv2G+c4hI8nn+Ax5PG/zhI393AAAAAElFTkSuQmCC\");\n}\n.tui-image-editor-container .color-picker-value + label {\n color: #fff;\n}\n.tui-image-editor-container .tui-image-editor-submenu svg > use {\n display: none;\n}\n.tui-image-editor-container .tui-image-editor-submenu svg > use.normal {\n display: block;\n}\n.tie-icon-add-button.icon-bubble .tui-image-editor-button[data-icontype=\"icon-bubble\"] svg > use.active,\n.tie-icon-add-button.icon-heart .tui-image-editor-button[data-icontype=\"icon-heart\"] svg > use.active,\n.tie-icon-add-button.icon-location .tui-image-editor-button[data-icontype=\"icon-location\"] svg > use.active,\n.tie-icon-add-button.icon-polygon .tui-image-editor-button[data-icontype=\"icon-polygon\"] svg > use.active,\n.tie-icon-add-button.icon-star .tui-image-editor-button[data-icontype=\"icon-star\"] svg > use.active,\n.tie-icon-add-button.icon-star-2 .tui-image-editor-button[data-icontype=\"icon-star-2\"] svg > use.active,\n.tie-icon-add-button.icon-arrow-3 .tui-image-editor-button[data-icontype=\"icon-arrow-3\"] svg > use.active,\n.tie-icon-add-button.icon-arrow-2 .tui-image-editor-button[data-icontype=\"icon-arrow-2\"] svg > use.active,\n.tie-icon-add-button.icon-arrow .tui-image-editor-button[data-icontype=\"icon-arrow\"] svg > use.active {\n display: block;\n}\n.tie-draw-line-select-button.line .tui-image-editor-button.line svg > use.normal,\n.tie-draw-line-select-button.free .tui-image-editor-button.free svg > use.normal {\n display: none;\n}\n.tie-draw-line-select-button.line .tui-image-editor-button.line svg > use.active,\n.tie-draw-line-select-button.free .tui-image-editor-button.free svg > use.active {\n display: block;\n}\n.tie-flip-button.resetFlip .tui-image-editor-button.resetFlip svg > use.normal,\n.tie-flip-button.flipX .tui-image-editor-button.flipX svg > use.normal,\n.tie-flip-button.flipY .tui-image-editor-button.flipY svg > use.normal {\n display: none;\n}\n.tie-flip-button.resetFlip .tui-image-editor-button.resetFlip svg > use.active,\n.tie-flip-button.flipX .tui-image-editor-button.flipX svg > use.active,\n.tie-flip-button.flipY .tui-image-editor-button.flipY svg > use.active {\n display: block;\n}\n.tie-mask-apply.apply.active .tui-image-editor-button.apply label {\n color: #fff;\n}\n.tie-mask-apply.apply.active .tui-image-editor-button.apply svg > use.active {\n display: block;\n}\n.tie-crop-button .tui-image-editor-button.apply,\n.tie-crop-preset-button .tui-image-editor-button.apply {\n margin-right: 24px;\n}\n.tie-crop-button .tui-image-editor-button.preset.active svg > use.active,\n.tie-crop-preset-button .tui-image-editor-button.preset.active svg > use.active {\n display: block;\n}\n.tie-crop-button .tui-image-editor-button.apply.active svg > use.active,\n.tie-crop-preset-button .tui-image-editor-button.apply.active svg > use.active {\n display: block;\n}\n.tie-shape-button.rect .tui-image-editor-button.rect svg > use.normal,\n.tie-shape-button.circle .tui-image-editor-button.circle svg > use.normal,\n.tie-shape-button.triangle .tui-image-editor-button.triangle svg > use.normal {\n display: none;\n}\n.tie-shape-button.rect .tui-image-editor-button.rect svg > use.active,\n.tie-shape-button.circle .tui-image-editor-button.circle svg > use.active,\n.tie-shape-button.triangle .tui-image-editor-button.triangle svg > use.active {\n display: block;\n}\n.tie-text-effect-button .tui-image-editor-button.active svg > use.active {\n display: block;\n}\n.tie-text-align-button.left .tui-image-editor-button.left svg > use.active,\n.tie-text-align-button.center .tui-image-editor-button.center svg > use.active,\n.tie-text-align-button.right .tui-image-editor-button.right svg > use.active {\n display: block;\n}\n.tie-mask-image-file,\n.tie-icon-image-file {\n opacity: 0;\n position: absolute;\n width: 100%;\n height: 100%;\n border: 1px solid #008000;\n cursor: inherit;\n left: 0;\n top: 0;\n}\n.tie-zoom-button.resetFlip .tui-image-editor-button.resetFlip svg > use.normal,\n.tie-zoom-button.flipX .tui-image-editor-button.flipX svg > use.normal,\n.tie-zoom-button.flipY .tui-image-editor-button.flipY svg > use.normal {\n display: none;\n}\n.tie-zoom-button.resetFlip .tui-image-editor-button.resetFlip svg > use.active,\n.tie-zoom-button.flipX .tui-image-editor-button.flipX svg > use.active,\n.tie-zoom-button.flipY .tui-image-editor-button.flipY svg > use.active {\n display: block;\n}\n.tui-image-editor-container.top.tui-image-editor-top-optimization .tui-image-editor-controls ul {\n text-align: right;\n}\n.tui-image-editor-container.top.tui-image-editor-top-optimization .tui-image-editor-controls-logo {\n display: none;\n}\n/*# sourceMappingURL=src/css/index.css.map */\n","body > textarea\n position: fixed !important;\n\n+prefix-classes(prefix)\n .-container\n margin: 0;\n padding: 0;\n box-sizing: border-box;\n min-height: 300px;\n height: 100%;\n position: relative;\n background-color: #282828;\n overflow: hidden;\n letter-spacing: 0.3px;\n \n div, ul, label, input, li\n box-sizing: border-box;\n margin: 0;\n padding: 0;\n -ms-user-select: none; \n -moz-user-select: -moz-none;\n -khtml-user-select: none;\n -webkit-user-select: none;\n user-select: none;\n \n .-header\n /* BUTTON AND LOGO */\n min-width: 533px;\n position: absolute;\n background-color: #151515;\n top: 0;\n width: 100%;\n .-header-buttons,\n .-controls-buttons\n float: right;\n margin: 8px;\n\n .-header-logo,\n .-controls-logo\n float: left;\n width: 30%;\n padding: 17px;\n\n .-controls-logo,\n .-controls-buttons\n width: 270px;\n height: 100%;\n display: none;\n\n .-header-buttons button,\n .-header-buttons div,\n .-controls-buttons button,\n .-controls-buttons div\n display: inline-block;\n position: relative;\n width: 120px;\n height: 40px;\n padding: 0;\n line-height: 40px;\n outline: none;\n border-radius: 20px;\n border: 1px solid #ddd;\n font-family: 'Noto Sans', sans-serif;\n font-size: 12px;\n font-weight: bold;\n cursor: pointer;\n vertical-align: middle;\n letter-spacing: 0.3px;\n text-align: center;\n\n .-download-btn\n background-color: #fdba3b;\n border-color: #fdba3b;\n color: #fff;\n .-load-btn\n position: absolute;\n left: 0;\n right: 0;\n display: inline-block;\n top: 0;\n bottom: 0;\n width: 100%;\n cursor: pointer;\n opacity: 0;\n .-main-container\n position: absolute;\n width: 100%;\n top: 0;\n bottom: 64px;\n .-main\n position: absolute;\n text-align: center;\n top: 64px;\n bottom: 0;\n right: 0;\n left: 0;\n .-wrap\n position: absolute;\n bottom: 0;\n width: 100%;\n overflow: auto;\n .-size-wrap\n display: table;\n width: 100%;\n height: 100%\n .-align-wrap\n display: table-cell;\n vertical-align: middle;\n .\n position: relative;\n display: inline-block;\n\n\n/* BIG MENU */\n.{prefix}-container\n .{prefix}-menu, .{prefix}-help-menu\n width: auto;\n list-style: none;\n padding: 0;\n margin: 0 auto;\n display: table-cell;\n text-align: center;\n vertical-align: middle;\n white-space: nowrap;\n > .{prefix}-item\n position: relative;\n display: inline-block;\n border-radius: 2px;\n padding: 7px 8px 3px 8px;\n cursor: pointer;\n margin: 0 4px;\n > .{prefix}-item[tooltip-content]:hover\n &:before\n content: '';\n position: absolute;\n display: inline-block;\n margin: 0 auto 0;\n width: 0;\n height: 0;\n border-right: 7px solid transparent;\n border-top: 7px solid #2f2f2f;\n border-left: 7px solid transparent;\n left: 13px;\n top: -2px;\n &:after\n content: attr(tooltip-content);\n position: absolute;\n display: inline-block;\n background-color: #2f2f2f;\n color: #fff;\n padding: 5px 8px;\n font-size: 11px;\n font-weight: lighter;\n border-radius: 3px;\n max-height: 23px;\n top: -25px;\n left: 0;\n min-width: 24px;\n > .{prefix}-item.active\n background-color: #fff;\n transition: all .3s ease;\n .{prefix}-wrap\n position: absolute;\n","body > textarea {\n position: fixed !important;\n}\n.tui-image-editor-container {\n margin: 0;\n padding: 0;\n box-sizing: border-box;\n min-height: 300px;\n height: 100%;\n position: relative;\n background-color: #282828;\n overflow: hidden;\n letter-spacing: 0.3px;\n}\n.tui-image-editor-container div,\n.tui-image-editor-container ul,\n.tui-image-editor-container label,\n.tui-image-editor-container input,\n.tui-image-editor-container li {\n box-sizing: border-box;\n margin: 0;\n padding: 0;\n -ms-user-select: none;\n -moz-user-select: -moz-none;\n -khtml-user-select: none;\n -webkit-user-select: none;\n user-select: none;\n}\n.tui-image-editor-container .tui-image-editor-header {\n/* BUTTON AND LOGO */\n min-width: 533px;\n position: absolute;\n background-color: #151515;\n top: 0;\n width: 100%;\n}\n.tui-image-editor-container .tui-image-editor-header-buttons,\n.tui-image-editor-container .tui-image-editor-controls-buttons {\n float: right;\n margin: 8px;\n}\n.tui-image-editor-container .tui-image-editor-header-logo,\n.tui-image-editor-container .tui-image-editor-controls-logo {\n float: left;\n width: 30%;\n padding: 17px;\n}\n.tui-image-editor-container .tui-image-editor-controls-logo,\n.tui-image-editor-container .tui-image-editor-controls-buttons {\n width: 270px;\n height: 100%;\n display: none;\n}\n.tui-image-editor-container .tui-image-editor-header-buttons button,\n.tui-image-editor-container .tui-image-editor-header-buttons div,\n.tui-image-editor-container .tui-image-editor-controls-buttons button,\n.tui-image-editor-container .tui-image-editor-controls-buttons div {\n display: inline-block;\n position: relative;\n width: 120px;\n height: 40px;\n padding: 0;\n line-height: 40px;\n outline: none;\n border-radius: 20px;\n border: 1px solid #ddd;\n font-family: 'Noto Sans', sans-serif;\n font-size: 12px;\n font-weight: bold;\n cursor: pointer;\n vertical-align: middle;\n letter-spacing: 0.3px;\n text-align: center;\n}\n.tui-image-editor-container .tui-image-editor-download-btn {\n background-color: #fdba3b;\n border-color: #fdba3b;\n color: #fff;\n}\n.tui-image-editor-container .tui-image-editor-load-btn {\n position: absolute;\n left: 0;\n right: 0;\n display: inline-block;\n top: 0;\n bottom: 0;\n width: 100%;\n cursor: pointer;\n opacity: 0;\n}\n.tui-image-editor-container .tui-image-editor-main-container {\n position: absolute;\n width: 100%;\n top: 0;\n bottom: 64px;\n}\n.tui-image-editor-container .tui-image-editor-main {\n position: absolute;\n text-align: center;\n top: 64px;\n bottom: 0;\n right: 0;\n left: 0;\n}\n.tui-image-editor-container .tui-image-editor-wrap {\n position: absolute;\n bottom: 0;\n width: 100%;\n overflow: auto;\n}\n.tui-image-editor-container .tui-image-editor-wrap .tui-image-editor-size-wrap {\n display: table;\n width: 100%;\n height: 100%;\n}\n.tui-image-editor-container .tui-image-editor-wrap .tui-image-editor-size-wrap .tui-image-editor-align-wrap {\n display: table-cell;\n vertical-align: middle;\n}\n.tui-image-editor-container .tui-image-editor {\n position: relative;\n display: inline-block;\n}\n.tui-image-editor-container .tui-image-editor-menu,\n.tui-image-editor-container .tui-image-editor-help-menu {\n width: auto;\n list-style: none;\n padding: 0;\n margin: 0 auto;\n display: table-cell;\n text-align: center;\n vertical-align: middle;\n white-space: nowrap;\n}\n.tui-image-editor-container .tui-image-editor-menu > .tui-image-editor-item,\n.tui-image-editor-container .tui-image-editor-help-menu > .tui-image-editor-item {\n position: relative;\n display: inline-block;\n border-radius: 2px;\n padding: 7px 8px 3px 8px;\n cursor: pointer;\n margin: 0 4px;\n}\n.tui-image-editor-container .tui-image-editor-menu > .tui-image-editor-item[tooltip-content]:hover:before,\n.tui-image-editor-container .tui-image-editor-help-menu > .tui-image-editor-item[tooltip-content]:hover:before {\n content: '';\n position: absolute;\n display: inline-block;\n margin: 0 auto 0;\n width: 0;\n height: 0;\n border-right: 7px solid transparent;\n border-top: 7px solid #2f2f2f;\n border-left: 7px solid transparent;\n left: 13px;\n top: -2px;\n}\n.tui-image-editor-container .tui-image-editor-menu > .tui-image-editor-item[tooltip-content]:hover:after,\n.tui-image-editor-container .tui-image-editor-help-menu > .tui-image-editor-item[tooltip-content]:hover:after {\n content: attr(tooltip-content);\n position: absolute;\n display: inline-block;\n background-color: #2f2f2f;\n color: #fff;\n padding: 5px 8px;\n font-size: 11px;\n font-weight: lighter;\n border-radius: 3px;\n max-height: 23px;\n top: -25px;\n left: 0;\n min-width: 24px;\n}\n.tui-image-editor-container .tui-image-editor-menu > .tui-image-editor-item.active,\n.tui-image-editor-container .tui-image-editor-help-menu > .tui-image-editor-item.active {\n background-color: #fff;\n transition: all 0.3s ease;\n}\n.tui-image-editor-container .tui-image-editor-wrap {\n position: absolute;\n}\n.tui-image-editor-container .tui-image-editor-grid-visual {\n display: none;\n position: absolute;\n width: 100%;\n height: 100%;\n border: 1px solid rgba(255,255,255,0.7);\n}\n.tui-image-editor-container .tui-image-editor-main.tui-image-editor-menu-flip .tui-image-editor,\n.tui-image-editor-container .tui-image-editor-main.tui-image-editor-menu-rotate .tui-image-editor {\n transition: none;\n}\n.tui-image-editor-container .tui-image-editor-main.tui-image-editor-menu-flip .tui-image-editor-grid-visual,\n.tui-image-editor-container .tui-image-editor-main.tui-image-editor-menu-rotate .tui-image-editor-grid-visual {\n display: block;\n}\n.tui-image-editor-container .tui-image-editor-grid-visual table {\n width: 100%;\n height: 100%;\n border-collapse: collapse;\n}\n.tui-image-editor-container .tui-image-editor-grid-visual table td {\n border: 1px solid rgba(255,255,255,0.3);\n}\n.tui-image-editor-container .tui-image-editor-grid-visual table td.dot:before {\n content: '';\n position: absolute;\n box-sizing: border-box;\n width: 10px;\n height: 10px;\n border: 0;\n box-shadow: 0 0 1px 0 rgba(0,0,0,0.3);\n border-radius: 100%;\n background-color: #fff;\n}\n.tui-image-editor-container .tui-image-editor-grid-visual table td.dot.left-top:before {\n top: -5px;\n left: -5px;\n}\n.tui-image-editor-container .tui-image-editor-grid-visual table td.dot.right-top:before {\n top: -5px;\n right: -5px;\n}\n.tui-image-editor-container .tui-image-editor-grid-visual table td.dot.left-bottom:before {\n bottom: -5px;\n left: -5px;\n}\n.tui-image-editor-container .tui-image-editor-grid-visual table td.dot.right-bottom:before {\n bottom: -5px;\n right: -5px;\n}\n.tui-image-editor-container .tui-image-editor-submenu {\n display: none;\n position: absolute;\n bottom: 0;\n width: 100%;\n height: 150px;\n white-space: nowrap;\n z-index: 2;\n}\n.tui-image-editor-container .tui-image-editor-submenu .tui-image-editor-button:hover svg > use.active {\n display: block;\n}\n.tui-image-editor-container .tui-image-editor-submenu .tui-image-editor-submenu-item li {\n display: inline-block;\n vertical-align: top;\n}\n.tui-image-editor-container .tui-image-editor-submenu .tui-image-editor-submenu-item .tui-image-editor-newline {\n display: block;\n margin-top: 0;\n}\n.tui-image-editor-container .tui-image-editor-submenu .tui-image-editor-submenu-item .tui-image-editor-button {\n position: relative;\n cursor: pointer;\n display: inline-block;\n font-weight: normal;\n font-size: 11px;\n margin: 0 9px 0 9px;\n}\n.tui-image-editor-container .tui-image-editor-submenu .tui-image-editor-submenu-item .tui-image-editor-button.preset {\n margin: 0 9px 20px 5px;\n}\n.tui-image-editor-container .tui-image-editor-submenu .tui-image-editor-submenu-item label > span {\n display: inline-block;\n cursor: pointer;\n padding-top: 5px;\n font-family: \"Noto Sans\", sans-serif;\n font-size: 11px;\n}\n.tui-image-editor-container .tui-image-editor-submenu .tui-image-editor-submenu-item .tui-image-editor-button.apply label,\n.tui-image-editor-container .tui-image-editor-submenu .tui-image-editor-submenu-item .tui-image-editor-button.cancel label {\n vertical-align: 7px;\n}\n.tui-image-editor-container .tui-image-editor-submenu > div {\n display: none;\n vertical-align: bottom;\n}\n.tui-image-editor-container .tui-image-editor-submenu .tui-image-editor-submenu-style {\n opacity: 0.95;\n z-index: -1;\n position: absolute;\n top: 0;\n bottom: 0;\n left: 0;\n right: 0;\n display: block;\n}\n.tui-image-editor-container .tui-image-editor-partition > div {\n width: 1px;\n height: 52px;\n border-left: 1px solid #3c3c3c;\n margin: 0 8px 0 8px;\n}\n.tui-image-editor-container .tui-image-editor-main.tui-image-editor-menu-filter .tui-image-editor-partition > div {\n height: 108px;\n margin: 0 29px 0 0px;\n}\n.tui-image-editor-container .tui-image-editor-submenu-align {\n text-align: left;\n margin-right: 30px;\n}\n.tui-image-editor-container .tui-image-editor-submenu-align label > span {\n width: 55px;\n white-space: nowrap;\n}\n.tui-image-editor-container .tui-image-editor-submenu-align:first-child {\n margin-right: 0;\n}\n.tui-image-editor-container .tui-image-editor-submenu-align:first-child label > span {\n width: 70px;\n}\n.tui-image-editor-container .tui-image-editor-main.tui-image-editor-menu-crop .tui-image-editor-submenu > div.tui-image-editor-menu-crop,\n.tui-image-editor-container .tui-image-editor-main.tui-image-editor-menu-flip .tui-image-editor-submenu > div.tui-image-editor-menu-flip,\n.tui-image-editor-container .tui-image-editor-main.tui-image-editor-menu-rotate .tui-image-editor-submenu > div.tui-image-editor-menu-rotate,\n.tui-image-editor-container .tui-image-editor-main.tui-image-editor-menu-shape .tui-image-editor-submenu > div.tui-image-editor-menu-shape,\n.tui-image-editor-container .tui-image-editor-main.tui-image-editor-menu-text .tui-image-editor-submenu > div.tui-image-editor-menu-text,\n.tui-image-editor-container .tui-image-editor-main.tui-image-editor-menu-mask .tui-image-editor-submenu > div.tui-image-editor-menu-mask,\n.tui-image-editor-container .tui-image-editor-main.tui-image-editor-menu-icon .tui-image-editor-submenu > div.tui-image-editor-menu-icon,\n.tui-image-editor-container .tui-image-editor-main.tui-image-editor-menu-draw .tui-image-editor-submenu > div.tui-image-editor-menu-draw,\n.tui-image-editor-container .tui-image-editor-main.tui-image-editor-menu-filter .tui-image-editor-submenu > div.tui-image-editor-menu-filter,\n.tui-image-editor-container .tui-image-editor-main.tui-image-editor-menu-zoom .tui-image-editor-submenu > div.tui-image-editor-menu-zoom {\n display: table-cell;\n}\n.tui-image-editor-container .tui-image-editor-main.tui-image-editor-menu-crop .tui-image-editor-submenu,\n.tui-image-editor-container .tui-image-editor-main.tui-image-editor-menu-flip .tui-image-editor-submenu,\n.tui-image-editor-container .tui-image-editor-main.tui-image-editor-menu-rotate .tui-image-editor-submenu,\n.tui-image-editor-container .tui-image-editor-main.tui-image-editor-menu-shape .tui-image-editor-submenu,\n.tui-image-editor-container .tui-image-editor-main.tui-image-editor-menu-text .tui-image-editor-submenu,\n.tui-image-editor-container .tui-image-editor-main.tui-image-editor-menu-mask .tui-image-editor-submenu,\n.tui-image-editor-container .tui-image-editor-main.tui-image-editor-menu-icon .tui-image-editor-submenu,\n.tui-image-editor-container .tui-image-editor-main.tui-image-editor-menu-draw .tui-image-editor-submenu,\n.tui-image-editor-container .tui-image-editor-main.tui-image-editor-menu-filter .tui-image-editor-submenu,\n.tui-image-editor-container .tui-image-editor-main.tui-image-editor-menu-zoom .tui-image-editor-submenu {\n display: table;\n}\n.tui-image-editor-container .tui-image-editor-help-menu {\n list-style: none;\n padding: 0;\n margin: 0 auto;\n text-align: center;\n vertical-align: middle;\n border-radius: 20px;\n background-color: rgba(255,255,255,0.06);\n z-index: 2;\n position: absolute;\n}\n.tui-image-editor-container .tui-image-editor-help-menu .tie-panel-history {\n display: none;\n background-color: #fff;\n color: #444;\n position: absolute;\n width: 196px;\n height: 276px;\n padding: 4px 2px;\n box-shadow: 0 2px 6px 0 rgba(0,0,0,0.15);\n cursor: auto;\n transform: translateX(calc(-50% + 12px));\n}\n.tui-image-editor-container .tui-image-editor-help-menu .tie-panel-history .history-list {\n height: 268px;\n padding: 0;\n overflow: hidden scroll;\n list-style: none;\n}\n.tui-image-editor-container .tui-image-editor-help-menu .tie-panel-history .history-list .history-item {\n height: 24px;\n font-size: 11px;\n line-height: 24px;\n}\n.tui-image-editor-container .tui-image-editor-help-menu .tie-panel-history .history-list .history-item .tui-image-editor-history-item {\n position: relative;\n height: 24px;\n cursor: pointer;\n}\n.tui-image-editor-container .tui-image-editor-help-menu .tie-panel-history .history-list .history-item .tui-image-editor-history-item svg {\n width: 24px;\n height: 24px;\n}\n.tui-image-editor-container .tui-image-editor-help-menu .tie-panel-history .history-list .history-item .tui-image-editor-history-item span {\n display: inline-block;\n width: 128px;\n height: 24px;\n text-align: left;\n}\n.tui-image-editor-container .tui-image-editor-help-menu .tie-panel-history .history-list .history-item .tui-image-editor-history-item .history-item-icon {\n display: inline-block;\n width: 24px;\n height: 24px;\n position: absolute;\n top: 6px;\n left: 6px;\n}\n.tui-image-editor-container .tui-image-editor-help-menu .tie-panel-history .history-list .history-item .tui-image-editor-history-item .history-item-checkbox {\n display: none;\n width: 24px;\n height: 24px;\n position: absolute;\n top: 5px;\n right: -6px;\n}\n.tui-image-editor-container .tui-image-editor-help-menu .tie-panel-history .history-list .history-item.selected-item {\n background-color: rgba(119,119,119,0.12);\n}\n.tui-image-editor-container .tui-image-editor-help-menu .tie-panel-history .history-list .history-item.selected-item .history-item-checkbox {\n display: inline-block;\n}\n.tui-image-editor-container .tui-image-editor-help-menu .tie-panel-history .history-list .history-item.disabled-item {\n color: #333;\n opacity: 0.3;\n}\n.tui-image-editor-container .tui-image-editor-help-menu .opened .tie-panel-history {\n display: block;\n}\n.tui-image-editor-container .tui-image-editor-help-menu .opened .tie-panel-history:before {\n content: '';\n position: absolute;\n display: inline-block;\n margin: 0 auto;\n width: 0;\n height: 0;\n}\n.tui-image-editor-container .filter-color-item {\n display: inline-block;\n}\n.tui-image-editor-container .filter-color-item .tui-image-editor-checkbox {\n display: block;\n}\n.tui-image-editor-container .tui-image-editor-checkbox-wrap {\n display: inline-block !important;\n text-align: left;\n}\n.tui-image-editor-container .tui-image-editor-checkbox-wrap.fixed-width {\n width: 187px;\n white-space: normal;\n}\n.tui-image-editor-container .tui-image-editor-checkbox {\n display: inline-block;\n margin: 1px 0 1px 0;\n}\n.tui-image-editor-container .tui-image-editor-checkbox input {\n width: 14px;\n height: 14px;\n opacity: 0;\n}\n.tui-image-editor-container .tui-image-editor-checkbox > label > span {\n color: #fff;\n height: 14px;\n position: relative;\n}\n.tui-image-editor-container .tui-image-editor-checkbox input + label:before,\n.tui-image-editor-container .tui-image-editor-checkbox > label > span:before {\n content: '';\n position: absolute;\n width: 14px;\n height: 14px;\n background-color: #fff;\n top: 6px;\n left: -19px;\n display: inline-block;\n margin: 0;\n text-align: center;\n font-size: 11px;\n border: 0;\n border-radius: 2px;\n padding-top: 1px;\n box-sizing: border-box;\n}\n.tui-image-editor-container .tui-image-editor-checkbox input[type='checkbox']:checked + span:before {\n background-size: cover;\n background-image: url(\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAA4AAAAOCAYAAAAfSC3RAAAAAXNSR0IArs4c6QAAAMBJREFUKBWVkjEOwjAMRe2WgZW7IIHEDdhghhuwcQ42rlJugAQS54Cxa5cq1QM5TUpByZfS2j9+dlJVt/tX5ZxbS4ZU9VLkQvSHKTIGRaVJYFmKrBbTCJxE2UgCdDzMZDkHrOV6b95V0US6UmgKodujEZbJg0B0ZgEModO5lrY1TMQf1TpyJGBEjD+E2NPN7ukIUDiF/BfEXgRiGEw8NgkffYGYwCi808fpn/6OvfUfsDr/Vc1IfRf8sKnFVqeiVQfDu0tf/nWH9gAAAABJRU5ErkJggg==\");\n}\n.tui-image-editor-container .tui-image-editor-selectlist-wrap {\n position: relative;\n}\n.tui-image-editor-container .tui-image-editor-selectlist-wrap select {\n width: 100%;\n height: 28px;\n margin-top: 4px;\n border: 0;\n outline: 0;\n border-radius: 0;\n border: 1px solid #cbdbdb;\n background-color: #fff;\n -webkit-appearance: none;\n -moz-appearance: none;\n appearance: none;\n padding: 0 7px 0 10px;\n}\n.tui-image-editor-container .tui-image-editor-selectlist-wrap .tui-image-editor-selectlist {\n display: none;\n position: relative;\n top: -1px;\n border: 1px solid #ccc;\n background-color: #fff;\n border-top: 0px;\n padding: 4px 0;\n}\n.tui-image-editor-container .tui-image-editor-selectlist-wrap .tui-image-editor-selectlist li {\n display: block;\n text-align: left;\n padding: 7px 10px;\n font-family: 'Noto Sans', sans-serif;\n}\n.tui-image-editor-container .tui-image-editor-selectlist-wrap .tui-image-editor-selectlist li:hover {\n background-color: rgba(81,92,230,0.05);\n}\n.tui-image-editor-container .tui-image-editor-selectlist-wrap:before {\n content: '';\n position: absolute;\n display: inline-block;\n width: 14px;\n height: 14px;\n right: 5px;\n top: 10px;\n background-image: url(\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAA4AAAAOCAYAAAAfSC3RAAAAAXNSR0IArs4c6QAAAHlJREFUKBVjYBgFOEOAEVkmPDxc89+/f6eAYjzI4kD2FyYmJrOVK1deh4kzwRggGiQBVJCELAZig8SQNYHEmEEEMrh69eo1HR0dfqCYJUickZGxf9WqVf3IakBsFBthklpaWmVA9mEQhrJhUoTp0NBQCRAmrHL4qgAAuu4cWZOZIGsAAAAASUVORK5CYII=\");\n background-size: cover;\n}\n.tui-image-editor-container .tui-image-editor-selectlist-wrap select::-ms-expand {\n display: none;\n}\n.tui-image-editor-container .tui-image-editor-virtual-range-bar .tui-image-editor-disabled,\n.tui-image-editor-container .tui-image-editor-virtual-range-subbar .tui-image-editor-disabled,\n.tui-image-editor-container .tui-image-editor-virtual-range-pointer .tui-image-editor-disabled {\n backbround-color: #f00;\n}\n.tui-image-editor-container .tui-image-editor-range {\n position: relative;\n top: 5px;\n width: 166px;\n height: 17px;\n display: inline-block;\n}\n.tui-image-editor-container .tui-image-editor-virtual-range-bar {\n top: 7px;\n position: absolute;\n width: 100%;\n height: 2px;\n background-color: #666;\n}\n.tui-image-editor-container .tui-image-editor-virtual-range-subbar {\n position: absolute;\n height: 100%;\n left: 0;\n right: 0;\n background-color: #d1d1d1;\n}\n.tui-image-editor-container .tui-image-editor-virtual-range-pointer {\n position: absolute;\n cursor: pointer;\n top: -5px;\n left: 0;\n width: 12px;\n height: 12px;\n background-color: #fff;\n border-radius: 100%;\n}\n.tui-image-editor-container .tui-image-editor-range-wrap {\n display: inline-block;\n margin-left: 4px;\n}\n.tui-image-editor-container .tui-image-editor-range-wrap.short .tui-image-editor-range {\n width: 100px;\n}\n.tui-image-editor-container .color-picker-control .tui-image-editor-range {\n width: 108px;\n margin-left: 10px;\n}\n.tui-image-editor-container .color-picker-control .tui-image-editor-virtual-range-pointer {\n background-color: #333;\n}\n.tui-image-editor-container .color-picker-control .tui-image-editor-virtual-range-bar {\n background-color: #ccc;\n}\n.tui-image-editor-container .color-picker-control .tui-image-editor-virtual-range-subbar {\n background-color: #606060;\n}\n.tui-image-editor-container .tui-image-editor-range-wrap.tui-image-editor-newline.short {\n margin-top: -2px;\n margin-left: 19px;\n}\n.tui-image-editor-container .tui-image-editor-range-wrap.tui-image-editor-newline.short label {\n color: #8e8e8e;\n font-weight: normal;\n}\n.tui-image-editor-container .tui-image-editor-range-wrap label {\n vertical-align: baseline;\n font-size: 11px;\n margin-right: 7px;\n color: #fff;\n}\n.tui-image-editor-container .tui-image-editor-range-value {\n cursor: default;\n width: 40px;\n height: 24px;\n outline: none;\n border-radius: 2px;\n box-shadow: none;\n border: 1px solid #d5d5d5;\n text-align: center;\n background-color: #1c1c1c;\n color: #fff;\n font-weight: lighter;\n vertical-align: baseline;\n font-family: 'Noto Sans', sans-serif;\n margin-top: 21px;\n margin-left: 4px;\n}\n.tui-image-editor-container .tui-image-editor-controls {\n position: absolute;\n background-color: #151515;\n width: 100%;\n height: 64px;\n display: table;\n bottom: 0;\n z-index: 2;\n}\n.tui-image-editor-container .tui-image-editor-icpartition {\n display: inline-block;\n background-color: #444;\n width: 1px;\n height: 24px;\n}\n.tui-image-editor-container.left .tui-image-editor-menu > .tui-image-editor-item[tooltip-content]:before {\n left: 28px;\n top: 11px;\n border-right: 7px solid #2f2f2f;\n border-top: 7px solid transparent;\n border-bottom: 7px solid transparent;\n}\n.tui-image-editor-container.left .tui-image-editor-menu > .tui-image-editor-item[tooltip-content]:after {\n top: 7px;\n left: 42px;\n white-space: nowrap;\n}\n.tui-image-editor-container.left .tui-image-editor-submenu {\n left: 0;\n height: 100%;\n width: 248px;\n}\n.tui-image-editor-container.left .tui-image-editor-main-container {\n left: 64px;\n width: calc(100% - 64px);\n height: 100%;\n}\n.tui-image-editor-container.left .tui-image-editor-controls {\n width: 64px;\n height: 100%;\n display: table;\n}\n.tui-image-editor-container.left .tui-image-editor-menu,\n.tui-image-editor-container.right .tui-image-editor-menu {\n white-space: inherit;\n}\n.tui-image-editor-container.left .tui-image-editor-submenu,\n.tui-image-editor-container.right .tui-image-editor-submenu {\n white-space: normal;\n}\n.tui-image-editor-container.left .tui-image-editor-submenu > div,\n.tui-image-editor-container.right .tui-image-editor-submenu > div {\n vertical-align: middle;\n}\n.tui-image-editor-container.left .tui-image-editor-controls li,\n.tui-image-editor-container.right .tui-image-editor-controls li {\n display: inline-block;\n margin: 4px auto;\n}\n.tui-image-editor-container.left .tui-image-editor-icpartition,\n.tui-image-editor-container.right .tui-image-editor-icpartition {\n position: relative;\n top: -7px;\n width: 24px;\n height: 1px;\n}\n.tui-image-editor-container.left .tui-image-editor-submenu .tui-image-editor-partition,\n.tui-image-editor-container.right .tui-image-editor-submenu .tui-image-editor-partition {\n display: block;\n width: 75%;\n margin: auto;\n}\n.tui-image-editor-container.left .tui-image-editor-submenu .tui-image-editor-partition > div,\n.tui-image-editor-container.right .tui-image-editor-submenu .tui-image-editor-partition > div {\n border-left: 0;\n height: 10px;\n border-bottom: 1px solid #3c3c3c;\n width: 100%;\n margin: 0;\n}\n.tui-image-editor-container.left .tui-image-editor-submenu .tui-image-editor-submenu-align,\n.tui-image-editor-container.right .tui-image-editor-submenu .tui-image-editor-submenu-align {\n margin-right: 0;\n}\n.tui-image-editor-container.left .tui-image-editor-submenu .tui-image-editor-submenu-item li,\n.tui-image-editor-container.right .tui-image-editor-submenu .tui-image-editor-submenu-item li {\n margin-top: 15px;\n}\n.tui-image-editor-container.left .tui-image-editor-submenu .tui-image-editor-submenu-item .tui-colorpicker-clearfix li,\n.tui-image-editor-container.right .tui-image-editor-submenu .tui-image-editor-submenu-item .tui-colorpicker-clearfix li {\n margin-top: 0;\n}\n.tui-image-editor-container.left .tui-image-editor-checkbox-wrap.fixed-width,\n.tui-image-editor-container.right .tui-image-editor-checkbox-wrap.fixed-width {\n width: 182px;\n white-space: normal;\n}\n.tui-image-editor-container.left .tui-image-editor-range-wrap.tui-image-editor-newline label.range,\n.tui-image-editor-container.right .tui-image-editor-range-wrap.tui-image-editor-newline label.range {\n display: block;\n text-align: left;\n width: 75%;\n margin: auto;\n}\n.tui-image-editor-container.left .tui-image-editor-range,\n.tui-image-editor-container.right .tui-image-editor-range {\n width: 136px;\n}\n.tui-image-editor-container.right .tui-image-editor-menu > .tui-image-editor-item[tooltip-content]:before {\n left: -3px;\n top: 11px;\n border-left: 7px solid #2f2f2f;\n border-top: 7px solid transparent;\n border-bottom: 7px solid transparent;\n}\n.tui-image-editor-container.right .tui-image-editor-menu > .tui-image-editor-item[tooltip-content]:after {\n top: 7px;\n left: unset;\n right: 43px;\n white-space: nowrap;\n}\n.tui-image-editor-container.right .tui-image-editor-submenu {\n right: 0;\n height: 100%;\n width: 248px;\n}\n.tui-image-editor-container.right .tui-image-editor-main-container {\n right: 64px;\n width: calc(100% - 64px);\n height: 100%;\n}\n.tui-image-editor-container.right .tui-image-editor-controls {\n right: 0;\n width: 64px;\n height: 100%;\n display: table;\n}\n.tui-image-editor-container.top .tui-image-editor-submenu .tui-image-editor-partition.only-left-right,\n.tui-image-editor-container.bottom .tui-image-editor-submenu .tui-image-editor-partition.only-left-right {\n display: none;\n}\n.tui-image-editor-container.bottom .tui-image-editor-submenu > div {\n padding-bottom: 24px;\n}\n.tui-image-editor-container.top .color-picker-control .triangle {\n top: -8px;\n border-right: 7px solid transparent;\n border-top: 0px;\n border-left: 7px solid transparent;\n border-bottom: 8px solid #fff;\n}\n.tui-image-editor-container.top .tui-image-editor-size-wrap {\n height: 100%;\n}\n.tui-image-editor-container.top .tui-image-editor-main-container {\n bottom: 0;\n}\n.tui-image-editor-container.top .tui-image-editor-menu > .tui-image-editor-item[tooltip-content]:before {\n left: 13px;\n border-top: 0;\n border-bottom: 7px solid #2f2f2f;\n top: 33px;\n}\n.tui-image-editor-container.top .tui-image-editor-menu > .tui-image-editor-item[tooltip-content]:after {\n top: 38px;\n}\n.tui-image-editor-container.top .tui-image-editor-submenu {\n top: 0;\n bottom: auto;\n}\n.tui-image-editor-container.top .tui-image-editor-submenu > div {\n padding-top: 24px;\n vertical-align: top;\n}\n.tui-image-editor-container.top .tui-image-editor-controls-logo {\n display: table-cell;\n}\n.tui-image-editor-container.top .tui-image-editor-controls-buttons {\n display: table-cell;\n}\n.tui-image-editor-container.top .tui-image-editor-main {\n top: 64px;\n height: calc(100% - 64px);\n}\n.tui-image-editor-container.top .tui-image-editor-controls {\n top: 0;\n bottom: inherit;\n}\n.tui-image-editor-container .tui-image-editor-help-menu.top {\n white-space: nowrap;\n width: 506px;\n height: 40px;\n top: 8px;\n left: 50%;\n transform: translateX(-50%);\n}\n.tui-image-editor-container .tui-image-editor-help-menu.top .tie-panel-history {\n top: 45px;\n}\n.tui-image-editor-container .tui-image-editor-help-menu.top .opened .tie-panel-history:before {\n border-right: 8px solid transparent;\n border-left: 8px solid transparent;\n border-bottom: 8px solid #fff;\n left: 90px;\n top: -8px;\n}\n.tui-image-editor-container .tui-image-editor-help-menu.top > .tui-image-editor-item[tooltip-content]:before {\n left: 13px;\n top: 35px;\n border: none;\n border-bottom: 7px solid #2f2f2f;\n border-left: 7px solid transparent;\n border-right: 7px solid transparent;\n}\n.tui-image-editor-container .tui-image-editor-help-menu.top > .tui-image-editor-item[tooltip-content]:after {\n top: 41px;\n left: -4px;\n white-space: nowrap;\n}\n.tui-image-editor-container .tui-image-editor-help-menu.top > .tui-image-editor-item[tooltip-content].opened:before,\n.tui-image-editor-container .tui-image-editor-help-menu.top > .tui-image-editor-item[tooltip-content].opened:after {\n content: none;\n}\n.tui-image-editor-container .tui-image-editor-help-menu.bottom {\n white-space: nowrap;\n width: 506px;\n height: 40px;\n bottom: 8px;\n left: 50%;\n transform: translateX(-50%);\n}\n.tui-image-editor-container .tui-image-editor-help-menu.bottom .tie-panel-history {\n bottom: 45px;\n}\n.tui-image-editor-container .tui-image-editor-help-menu.bottom .opened .tie-panel-history:before {\n border-right: 8px solid transparent;\n border-left: 8px solid transparent;\n border-top: 8px solid #fff;\n left: 90px;\n bottom: -8px;\n}\n.tui-image-editor-container .tui-image-editor-help-menu.bottom > .tui-image-editor-item[tooltip-content]:before {\n left: 13px;\n top: auto;\n bottom: 36px;\n border: none;\n border-top: 7px solid #2f2f2f;\n border-left: 7px solid transparent;\n border-right: 7px solid transparent;\n}\n.tui-image-editor-container .tui-image-editor-help-menu.bottom > .tui-image-editor-item[tooltip-content]:after {\n top: auto;\n left: -4px;\n bottom: 41px;\n white-space: nowrap;\n}\n.tui-image-editor-container .tui-image-editor-help-menu.bottom > .tui-image-editor-item[tooltip-content].opened:before,\n.tui-image-editor-container .tui-image-editor-help-menu.bottom > .tui-image-editor-item[tooltip-content].opened:after {\n content: none;\n}\n.tui-image-editor-container .tui-image-editor-help-menu.left {\n white-space: inherit;\n width: 40px;\n height: 506px;\n left: 8px;\n top: 50%;\n transform: translateY(-50%);\n}\n.tui-image-editor-container .tui-image-editor-help-menu.left .tie-panel-history {\n left: 140px;\n top: -4px;\n}\n.tui-image-editor-container .tui-image-editor-help-menu.left .opened .tie-panel-history:before {\n border-top: 8px solid transparent;\n border-bottom: 8px solid transparent;\n border-right: 8px solid #fff;\n left: -8px;\n top: 14px;\n}\n.tui-image-editor-container .tui-image-editor-help-menu.left .tui-image-editor-item {\n margin: 4px auto;\n padding: 6px 8px;\n}\n.tui-image-editor-container .tui-image-editor-help-menu.left > .tui-image-editor-item[tooltip-content]:before {\n left: 27px;\n top: 11px;\n border: none;\n border-right: 7px solid #2f2f2f;\n border-top: 7px solid transparent;\n border-bottom: 7px solid transparent;\n}\n.tui-image-editor-container .tui-image-editor-help-menu.left > .tui-image-editor-item[tooltip-content]:after {\n top: 7px;\n left: 40px;\n white-space: nowrap;\n}\n.tui-image-editor-container .tui-image-editor-help-menu.left > .tui-image-editor-item[tooltip-content].opened:before,\n.tui-image-editor-container .tui-image-editor-help-menu.left > .tui-image-editor-item[tooltip-content].opened:after {\n content: none;\n}\n.tui-image-editor-container .tui-image-editor-help-menu.right {\n white-space: inherit;\n width: 40px;\n height: 506px;\n right: 8px;\n top: 50%;\n transform: translateY(-50%);\n}\n.tui-image-editor-container .tui-image-editor-help-menu.right .tie-panel-history {\n right: -30px;\n top: -4px;\n}\n.tui-image-editor-container .tui-image-editor-help-menu.right .opened .tie-panel-history:before {\n border-top: 8px solid transparent;\n border-bottom: 8px solid transparent;\n border-left: 8px solid #fff;\n right: -8px;\n top: 14px;\n}\n.tui-image-editor-container .tui-image-editor-help-menu.right .tui-image-editor-item {\n margin: 4px auto;\n padding: 6px 8px;\n}\n.tui-image-editor-container .tui-image-editor-help-menu.right > .tui-image-editor-item[tooltip-content]:before {\n left: -6px;\n top: 11px;\n border: none;\n border-left: 7px solid #2f2f2f;\n border-top: 7px solid transparent;\n border-bottom: 7px solid transparent;\n}\n.tui-image-editor-container .tui-image-editor-help-menu.right > .tui-image-editor-item[tooltip-content]:after {\n top: 7px;\n left: auto;\n right: 39px;\n white-space: nowrap;\n}\n.tui-image-editor-container .tui-image-editor-help-menu.right > .tui-image-editor-item[tooltip-content].opened:before,\n.tui-image-editor-container .tui-image-editor-help-menu.right > .tui-image-editor-item[tooltip-content].opened:after {\n content: none;\n}\n.tui-image-editor-container .tie-icon-add-button .tui-image-editor-button {\n min-width: 42px;\n}\n.tui-image-editor-container .svg_ic-menu,\n.tui-image-editor-container .svg_ic-helpmenu {\n width: 24px;\n height: 24px;\n}\n.tui-image-editor-container .svg_ic-submenu {\n width: 32px;\n height: 32px;\n}\n.tui-image-editor-container .svg_img-bi {\n width: 257px;\n height: 26px;\n}\n.tui-image-editor-container .tui-image-editor-help-menu svg > use,\n.tui-image-editor-container .tui-image-editor-controls svg > use {\n display: none;\n}\n.tui-image-editor-container .tui-image-editor-help-menu .enabled svg:hover > use.hover,\n.tui-image-editor-container .tui-image-editor-controls .enabled svg:hover > use.hover,\n.tui-image-editor-container .tui-image-editor-help-menu .normal svg:hover > use.hover,\n.tui-image-editor-container .tui-image-editor-controls .normal svg:hover > use.hover {\n display: block;\n}\n.tui-image-editor-container .tui-image-editor-help-menu .active svg:hover > use.hover,\n.tui-image-editor-container .tui-image-editor-controls .active svg:hover > use.hover {\n display: none;\n}\n.tui-image-editor-container .tui-image-editor-help-menu .on svg > use.hover,\n.tui-image-editor-container .tui-image-editor-controls .on svg > use.hover,\n.tui-image-editor-container .tui-image-editor-help-menu .opened svg > use.hover,\n.tui-image-editor-container .tui-image-editor-controls .opened svg > use.hover {\n display: block;\n}\n.tui-image-editor-container .tui-image-editor-help-menu svg > use.normal,\n.tui-image-editor-container .tui-image-editor-controls svg > use.normal {\n display: block;\n}\n.tui-image-editor-container .tui-image-editor-help-menu .active svg > use.active,\n.tui-image-editor-container .tui-image-editor-controls .active svg > use.active {\n display: block;\n}\n.tui-image-editor-container .tui-image-editor-help-menu .enabled svg > use.enabled,\n.tui-image-editor-container .tui-image-editor-controls .enabled svg > use.enabled {\n display: block;\n}\n.tui-image-editor-container .tui-image-editor-help-menu .active svg > use.normal,\n.tui-image-editor-container .tui-image-editor-controls .active svg > use.normal,\n.tui-image-editor-container .tui-image-editor-help-menu .enabled svg > use.normal,\n.tui-image-editor-container .tui-image-editor-controls .enabled svg > use.normal {\n display: none;\n}\n.tui-image-editor-container .tui-image-editor-help-menu .help svg > use.disabled,\n.tui-image-editor-container .tui-image-editor-controls .help svg > use.disabled,\n.tui-image-editor-container .tui-image-editor-help-menu .help.enabled svg > use.normal,\n.tui-image-editor-container .tui-image-editor-controls .help.enabled svg > use.normal {\n display: block;\n}\n.tui-image-editor-container .tui-image-editor-help-menu .help.enabled svg > use.disabled,\n.tui-image-editor-container .tui-image-editor-controls .help.enabled svg > use.disabled {\n display: none;\n}\n.tui-image-editor-container .tui-image-editor-controls:hover {\n z-index: 3;\n}\n.tui-image-editor-container div.tui-colorpicker-clearfix {\n width: 159px;\n height: 28px;\n border: 1px solid #d5d5d5;\n border-radius: 2px;\n background-color: #f5f5f5;\n margin-top: 6px;\n padding: 4px 7px 4px 7px;\n}\n.tui-image-editor-container .tui-colorpicker-palette-hex {\n width: 114px;\n background-color: #f5f5f5;\n border: 0;\n font-size: 11px;\n margin-top: 2px;\n font-family: 'Noto Sans', sans-serif;\n}\n.tui-image-editor-container .tui-colorpicker-palette-hex[value='#ffffff'] + .tui-colorpicker-palette-preview,\n.tui-image-editor-container .tui-colorpicker-palette-hex[value=''] + .tui-colorpicker-palette-preview {\n border: 1px solid #ccc;\n}\n.tui-image-editor-container .tui-colorpicker-palette-hex[value=''] + .tui-colorpicker-palette-preview {\n background-size: cover;\n background-image: url(\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAAAXNSR0IArs4c6QAAAdBJREFUWAnFl0FuwjAQRZ0ukiugHqFSOQNdseuKW3ALzkA4BateICvUGyCxrtRFd4WuunH/TzykaYJrnLEYaTJJsP2+x8GZZCbQrLU5mj7Bn+EP8HvnCObd+R7xBV5lWfaNON4AnsA38E94qLEt+0yiFaBzAV/Bv+Cxxr4co7hKCDpw1q9wLeNYYdlAwyn8TYt8Hme3+8D5ozcTaMCZ68PXa2tnM2sbEcOZAJhrrpl2DAcTOGNjZPSfCdzkw6JrfbiMv+osBe4y9WOedhm4jZfhbENWuxS44H9Wz/xw4WzqLOAqh1+zycgAwzEMzr5k5gaHOa9ULBwuuDkFlHI1Kl4PJ66kgIpnoywOTmRFAYcbwYk9UMApWkD8zAV5ihcwHk4Rx7gl0IFTQL0EFc+CTQ9OZHWH3YhlVJiVpTHbrTGLhTHLZVgff6s9lyBsI9KduSS83oj+34rTwJutmBmCnMsvozRwZqB5GTkBw6/jdPDu69iJ6BYk6eCcfbcgcQIK/MByaaiMqm8rHcjol2TnpWDhyAKSGdA3FrxtJUToX0ODqatetfGE+8tyEUOV8GY5dGRwLP/MBS4RHQr4bT7NRAQjlcOTfZxmv2G+c4hI8nn+Ax5PG/zhI393AAAAAElFTkSuQmCC\");\n}\n.tui-image-editor-container .tui-colorpicker-palette-preview {\n border-radius: 100%;\n float: left;\n width: 17px;\n height: 17px;\n border: 0;\n}\n.tui-image-editor-container .color-picker-control {\n position: absolute;\n display: none;\n z-index: 99;\n width: 192px;\n background-color: #fff;\n box-shadow: 0 3px 22px 6px rgba(0,0,0,0.15);\n padding: 16px;\n border-radius: 2px;\n}\n.tui-image-editor-container .color-picker-control .tui-colorpicker-palette-toggle-slider {\n display: none;\n}\n.tui-image-editor-container .color-picker-control .tui-colorpicker-palette-button {\n border: 0;\n border-radius: 100%;\n margin: 2px;\n background-size: cover;\n font-size: 1px;\n}\n.tui-image-editor-container .color-picker-control .tui-colorpicker-palette-button[title='#ffffff'] {\n border: 1px solid #ccc;\n}\n.tui-image-editor-container .color-picker-control .tui-colorpicker-palette-button[title=''] {\n border: 1px solid #ccc;\n}\n.tui-image-editor-container .color-picker-control .triangle {\n width: 0;\n height: 0;\n border-right: 7px solid transparent;\n border-top: 8px solid #fff;\n border-left: 7px solid transparent;\n position: absolute;\n bottom: -8px;\n left: 84px;\n}\n.tui-image-editor-container .color-picker-control .tui-colorpicker-container,\n.tui-image-editor-container .color-picker-control .tui-colorpicker-palette-container ul,\n.tui-image-editor-container .color-picker-control .tui-colorpicker-palette-container {\n width: 100%;\n height: auto;\n}\n.tui-image-editor-container .filter-color-item .color-picker-control label {\n font-color: #333;\n font-weight: normal;\n margin-right: 7pxleft;\n}\n.tui-image-editor-container .filter-color-item .tui-image-editor-checkbox {\n margin-top: 0;\n}\n.tui-image-editor-container .filter-color-item .tui-image-editor-checkbox input + label:before,\n.tui-image-editor-container .filter-color-item .tui-image-editor-checkbox > label:before {\n left: -16px;\n}\n.tui-image-editor-container .color-picker {\n width: 100%;\n height: auto;\n}\n.tui-image-editor-container .color-picker-value {\n width: 32px;\n height: 32px;\n border: 0px;\n border-radius: 100%;\n margin: auto;\n margin-bottom: 1px;\n}\n.tui-image-editor-container .color-picker-value.transparent {\n border: 1px solid #cbcbcb;\n background-size: cover;\n background-image: url(\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAAAXNSR0IArs4c6QAAAdBJREFUWAnFl0FuwjAQRZ0ukiugHqFSOQNdseuKW3ALzkA4BateICvUGyCxrtRFd4WuunH/TzykaYJrnLEYaTJJsP2+x8GZZCbQrLU5mj7Bn+EP8HvnCObd+R7xBV5lWfaNON4AnsA38E94qLEt+0yiFaBzAV/Bv+Cxxr4co7hKCDpw1q9wLeNYYdlAwyn8TYt8Hme3+8D5ozcTaMCZ68PXa2tnM2sbEcOZAJhrrpl2DAcTOGNjZPSfCdzkw6JrfbiMv+osBe4y9WOedhm4jZfhbENWuxS44H9Wz/xw4WzqLOAqh1+zycgAwzEMzr5k5gaHOa9ULBwuuDkFlHI1Kl4PJ66kgIpnoywOTmRFAYcbwYk9UMApWkD8zAV5ihcwHk4Rx7gl0IFTQL0EFc+CTQ9OZHWH3YhlVJiVpTHbrTGLhTHLZVgff6s9lyBsI9KduSS83oj+34rTwJutmBmCnMsvozRwZqB5GTkBw6/jdPDu69iJ6BYk6eCcfbcgcQIK/MByaaiMqm8rHcjol2TnpWDhyAKSGdA3FrxtJUToX0ODqatetfGE+8tyEUOV8GY5dGRwLP/MBS4RHQr4bT7NRAQjlcOTfZxmv2G+c4hI8nn+Ax5PG/zhI393AAAAAElFTkSuQmCC\");\n}\n.tui-image-editor-container .color-picker-value + label {\n color: #fff;\n}\n.tui-image-editor-container .tui-image-editor-submenu svg > use {\n display: none;\n}\n.tui-image-editor-container .tui-image-editor-submenu svg > use.normal {\n display: block;\n}\n.tie-icon-add-button.icon-bubble .tui-image-editor-button[data-icontype=\"icon-bubble\"] svg > use.active,\n.tie-icon-add-button.icon-heart .tui-image-editor-button[data-icontype=\"icon-heart\"] svg > use.active,\n.tie-icon-add-button.icon-location .tui-image-editor-button[data-icontype=\"icon-location\"] svg > use.active,\n.tie-icon-add-button.icon-polygon .tui-image-editor-button[data-icontype=\"icon-polygon\"] svg > use.active,\n.tie-icon-add-button.icon-star .tui-image-editor-button[data-icontype=\"icon-star\"] svg > use.active,\n.tie-icon-add-button.icon-star-2 .tui-image-editor-button[data-icontype=\"icon-star-2\"] svg > use.active,\n.tie-icon-add-button.icon-arrow-3 .tui-image-editor-button[data-icontype=\"icon-arrow-3\"] svg > use.active,\n.tie-icon-add-button.icon-arrow-2 .tui-image-editor-button[data-icontype=\"icon-arrow-2\"] svg > use.active,\n.tie-icon-add-button.icon-arrow .tui-image-editor-button[data-icontype=\"icon-arrow\"] svg > use.active {\n display: block;\n}\n.tie-draw-line-select-button.line .tui-image-editor-button.line svg > use.normal,\n.tie-draw-line-select-button.free .tui-image-editor-button.free svg > use.normal {\n display: none;\n}\n.tie-draw-line-select-button.line .tui-image-editor-button.line svg > use.active,\n.tie-draw-line-select-button.free .tui-image-editor-button.free svg > use.active {\n display: block;\n}\n.tie-flip-button.resetFlip .tui-image-editor-button.resetFlip svg > use.normal,\n.tie-flip-button.flipX .tui-image-editor-button.flipX svg > use.normal,\n.tie-flip-button.flipY .tui-image-editor-button.flipY svg > use.normal {\n display: none;\n}\n.tie-flip-button.resetFlip .tui-image-editor-button.resetFlip svg > use.active,\n.tie-flip-button.flipX .tui-image-editor-button.flipX svg > use.active,\n.tie-flip-button.flipY .tui-image-editor-button.flipY svg > use.active {\n display: block;\n}\n.tie-mask-apply.apply.active .tui-image-editor-button.apply label {\n color: #fff;\n}\n.tie-mask-apply.apply.active .tui-image-editor-button.apply svg > use.active {\n display: block;\n}\n.tie-crop-button .tui-image-editor-button.apply,\n.tie-crop-preset-button .tui-image-editor-button.apply {\n margin-right: 24px;\n}\n.tie-crop-button .tui-image-editor-button.preset.active svg > use.active,\n.tie-crop-preset-button .tui-image-editor-button.preset.active svg > use.active {\n display: block;\n}\n.tie-crop-button .tui-image-editor-button.apply.active svg > use.active,\n.tie-crop-preset-button .tui-image-editor-button.apply.active svg > use.active {\n display: block;\n}\n.tie-shape-button.rect .tui-image-editor-button.rect svg > use.normal,\n.tie-shape-button.circle .tui-image-editor-button.circle svg > use.normal,\n.tie-shape-button.triangle .tui-image-editor-button.triangle svg > use.normal {\n display: none;\n}\n.tie-shape-button.rect .tui-image-editor-button.rect svg > use.active,\n.tie-shape-button.circle .tui-image-editor-button.circle svg > use.active,\n.tie-shape-button.triangle .tui-image-editor-button.triangle svg > use.active {\n display: block;\n}\n.tie-text-effect-button .tui-image-editor-button.active svg > use.active {\n display: block;\n}\n.tie-text-align-button.left .tui-image-editor-button.left svg > use.active,\n.tie-text-align-button.center .tui-image-editor-button.center svg > use.active,\n.tie-text-align-button.right .tui-image-editor-button.right svg > use.active {\n display: block;\n}\n.tie-mask-image-file,\n.tie-icon-image-file {\n opacity: 0;\n position: absolute;\n width: 100%;\n height: 100%;\n border: 1px solid #008000;\n cursor: inherit;\n left: 0;\n top: 0;\n}\n.tie-zoom-button.resetFlip .tui-image-editor-button.resetFlip svg > use.normal,\n.tie-zoom-button.flipX .tui-image-editor-button.flipX svg > use.normal,\n.tie-zoom-button.flipY .tui-image-editor-button.flipY svg > use.normal {\n display: none;\n}\n.tie-zoom-button.resetFlip .tui-image-editor-button.resetFlip svg > use.active,\n.tie-zoom-button.flipX .tui-image-editor-button.flipX svg > use.active,\n.tie-zoom-button.flipY .tui-image-editor-button.flipY svg > use.active {\n display: block;\n}\n.tui-image-editor-container.top.tui-image-editor-top-optimization .tui-image-editor-controls ul {\n text-align: right;\n}\n.tui-image-editor-container.top.tui-image-editor-top-optimization .tui-image-editor-controls-logo {\n display: none;\n}\n/*# sourceMappingURL=src/css/index.css.map */","/* GRID VISUAL OF FLIP AND ROTATE MENU */\n.{prefix}-container\n .{prefix}-grid-visual\n display: none;\n position: absolute;\n width: 100%;\n height: 100%;\n border: 1px solid rgba(255,255,255,0.7);\n .{prefix}-main.{prefix}-menu-flip,\n .{prefix}-main.{prefix}-menu-rotate\n .tui-image-editor\n transition: none;\n .{prefix}-main.{prefix}-menu-flip .{prefix}-grid-visual,\n .{prefix}-main.{prefix}-menu-rotate .{prefix}-grid-visual\n display: block;\n .{prefix}-grid-visual \n table\n width: 100%;\n height: 100%;\n border-collapse: collapse;\n td\n border: 1px solid rgba(255,255,255,0.3);\n td.dot:before\n content: '';\n position: absolute;\n box-sizing: border-box;\n width: 10px;\n height: 10px;\n border: 0;\n box-shadow: 0 0 1px 0 rgba(0,0,0,0.3);\n border-radius: 100%;\n background-color: #fff;\n td.dot.left-top:before\n top: -5px;\n left: -5px;\n td.dot.right-top:before\n top: -5px;\n right: -5px;\n td.dot.left-bottom:before\n bottom: -5px;\n left: -5px;\n td.dot.right-bottom:before\n bottom: -5px;\n right: -5px;\n","/* SUBMENU */\n.{prefix}-container\n .{prefix}-submenu\n display: none;\n position: absolute;\n bottom: 0;\n width:100%;\n height: 150px;\n white-space: nowrap;\n z-index: 2;\n .{prefix}-button:hover svg > use.active\n display: block;\n .{prefix}-submenu-item\n li\n display: inline-block;\n vertical-align: top;\n .{prefix}-newline\n display: block;\n margin-top: 0;\n .{prefix}-button\n position: relative;\n cursor: pointer;\n display: inline-block;\n font-weight: normal;\n font-size: 11px;\n margin: 0 9px 0 9px;\n .{prefix}-button.preset\n margin: 0 9px 20px 5px;\n label > span\n display: inline-block;\n cursor: pointer;\n padding-top: 5px;\n font-family: \"Noto Sans\", sans-serif;\n font-size: 11px;\n .{prefix}-button.apply label,\n .{prefix}-button.cancel label\n vertical-align: 7px;\n > div\n display: none;\n vertical-align: bottom;\n .{prefix}-submenu-style\n opacity: 0.95;\n z-index: -1;\n position: absolute;\n top: 0;\n bottom: 0;\n left: 0;\n right: 0;\n display: block;\n\n .{prefix}-partition > div\n width: 1px;\n height: 52px;\n border-left: 1px solid #3c3c3c;\n margin: 0 8px 0 8px;\n .{prefix}-main.{prefix}-menu-filter .{prefix}-partition > div\n height: 108px;\n margin: 0 29px 0 0px;\n .{prefix}-submenu-align\n text-align: left;\n margin-right: 30px;\n label > span\n width: 55px;\n white-space: nowrap;\n .{prefix}-submenu-align:first-child\n margin-right: 0;\n label > span\n width: 70px;\n .{prefix}-main.{prefix}-menu-crop .{prefix}-submenu > div.{prefix}-menu-crop,\n .{prefix}-main.{prefix}-menu-flip .{prefix}-submenu > div.{prefix}-menu-flip,\n .{prefix}-main.{prefix}-menu-rotate .{prefix}-submenu > div.{prefix}-menu-rotate,\n .{prefix}-main.{prefix}-menu-shape .{prefix}-submenu > div.{prefix}-menu-shape,\n .{prefix}-main.{prefix}-menu-text .{prefix}-submenu > div.{prefix}-menu-text,\n .{prefix}-main.{prefix}-menu-mask .{prefix}-submenu > div.{prefix}-menu-mask,\n .{prefix}-main.{prefix}-menu-icon .{prefix}-submenu > div.{prefix}-menu-icon,\n .{prefix}-main.{prefix}-menu-draw .{prefix}-submenu > div.{prefix}-menu-draw,\n .{prefix}-main.{prefix}-menu-filter .{prefix}-submenu > div.{prefix}-menu-filter,\n .{prefix}-main.{prefix}-menu-zoom .{prefix}-submenu > div.{prefix}-menu-zoom\n display: table-cell;\n .{prefix}-main.{prefix}-menu-crop,\n .{prefix}-main.{prefix}-menu-flip,\n .{prefix}-main.{prefix}-menu-rotate,\n .{prefix}-main.{prefix}-menu-shape,\n .{prefix}-main.{prefix}-menu-text,\n .{prefix}-main.{prefix}-menu-mask,\n .{prefix}-main.{prefix}-menu-icon,\n .{prefix}-main.{prefix}-menu-draw,\n .{prefix}-main.{prefix}-menu-filter,\n .{prefix}-main.{prefix}-menu-zoom\n .{prefix}-submenu\n display: table;\n\n/* Help menu bar */\n.{prefix}-container\n .{prefix}-help-menu\n list-style: none;\n padding: 0;\n margin: 0 auto;\n text-align: center;\n vertical-align: middle;\n border-radius: 20px;\n background-color: rgba(255, 255, 255, 0.06);\n z-index: 2;\n position: absolute;\n .tie-panel-history\n display: none;\n background-color: #fff;\n color: #444;\n position: absolute;\n width: 196px;\n height: 276px;\n padding: 4px 2px;\n box-shadow: 0 2px 6px 0 rgba(0, 0, 0, 0.15);\n cursor: auto;\n transform: translateX(calc(-50% + 12px));\n .history-list\n height: 268px;\n padding: 0;\n overflow: hidden scroll;\n list-style: none;\n .history-item\n height: 24px;\n font-size: 11px;\n line-height: 24px;\n .{prefix}-history-item\n position: relative;\n height: 24px;\n cursor: pointer;\n svg\n width: 24px;\n height: 24px;\n span\n display: inline-block;\n width: 128px;\n height: 24px;\n text-align: left;\n .history-item-icon\n display: inline-block;\n width: 24px;\n height: 24px;\n position: absolute;\n top: 6px;\n left: 6px;\n .history-item-checkbox\n display: none;\n width: 24px;\n height: 24px;\n position: absolute;\n top: 5px;\n right: -6px;\n &.selected-item\n background-color: rgba(119, 119, 119, 0.12);\n .history-item-checkbox\n display: inline-block;\n &.disabled-item\n color: #333;\n opacity: 0.3;\n .opened .tie-panel-history\n display: block;\n &:before\n content: '';\n position: absolute;\n display: inline-block;\n margin: 0 auto;\n width: 0;\n height: 0;\n","/* VIRTUAL CHECKBOX */\n.{prefix}-container\n .filter-color-item\n display: inline-block;\n .tui-image-editor-checkbox\n display: block;\n .{prefix}-checkbox-wrap\n display: inline-block !important;\n text-align: left;\n .{prefix}-checkbox-wrap.fixed-width\n width: 187px;\n white-space: normal;\n .{prefix}-checkbox\n display: inline-block;\n margin: 1px 0 1px 0;\n input\n width: 14px;\n height: 14px;\n opacity: 0;\n > label > span\n color: #fff;\n height: 14px;\n position: relative;\n input + label:before,\n > label > span:before\n content: '';\n position: absolute;\n width: 14px;\n height: 14px;\n background-color: #fff;\n top: 6px;\n left: -19px;\n display: inline-block;\n margin: 0;\n text-align: center;\n font-size: 11px;\n border: 0;\n border-radius: 2px;\n padding-top: 1px;\n box-sizing: border-box;\n input[type='checkbox']:checked + span:before\n background-size: cover;\n background-image: url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAA4AAAAOCAYAAAAfSC3RAAAAAXNSR0IArs4c6QAAAMBJREFUKBWVkjEOwjAMRe2WgZW7IIHEDdhghhuwcQ42rlJugAQS54Cxa5cq1QM5TUpByZfS2j9+dlJVt/tX5ZxbS4ZU9VLkQvSHKTIGRaVJYFmKrBbTCJxE2UgCdDzMZDkHrOV6b95V0US6UmgKodujEZbJg0B0ZgEModO5lrY1TMQf1TpyJGBEjD+E2NPN7ukIUDiF/BfEXgRiGEw8NgkffYGYwCi808fpn/6OvfUfsDr/Vc1IfRf8sKnFVqeiVQfDu0tf/nWH9gAAAABJRU5ErkJggg==');\n\n .{prefix}-selectlist-wrap\n position: relative;\n select\n width: 100%;\n height: 28px;\n margin-top: 4px;\n border: 0;\n outline: 0;\n border-radius: 0;\n border: 1px solid #cbdbdb;\n background-color: #fff;\n -webkit-appearance: none;\n -moz-appearance: none;\n appearance: none;\n padding: 0 7px 0 10px;\n .{prefix}-selectlist\n display: none;\n position: relative;\n top: -1px;\n border: 1px solid #ccc;\n background-color: #fff;\n border-top: 0px;\n padding: 4px 0;\n li\n display: block;\n text-align: left;\n padding: 7px 10px;\n font-family: 'Noto Sans', sans-serif;\n li:hover\n background-color: rgba(81, 92, 230, 0.05);\n .{prefix}-selectlist-wrap:before\n content: '';\n position: absolute;\n display: inline-block;\n width: 14px;\n height: 14px;\n right: 5px;\n top: 10px;\n background-image: url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAA4AAAAOCAYAAAAfSC3RAAAAAXNSR0IArs4c6QAAAHlJREFUKBVjYBgFOEOAEVkmPDxc89+/f6eAYjzI4kD2FyYmJrOVK1deh4kzwRggGiQBVJCELAZig8SQNYHEmEEEMrh69eo1HR0dfqCYJUickZGxf9WqVf3IakBsFBthklpaWmVA9mEQhrJhUoTp0NBQCRAmrHL4qgAAuu4cWZOZIGsAAAAASUVORK5CYII=');\n background-size: cover;\n .{prefix}-selectlist-wrap select::-ms-expand\n display:none;\n","/* VIRTUAL RANGE */\n.{prefix}-container\n\n .{prefix}-virtual-range-bar\n .{prefix}-virtual-range-subbar\n .{prefix}-virtual-range-pointer\n .{prefix}-disabled\n backbround-color: red;\n\n .{prefix}-range\n position: relative;\n top: 5px;\n width: 166px;\n height: 17px;\n display: inline-block;\n .{prefix}-virtual-range-bar\n top: 7px;\n position: absolute;\n width: 100%;\n height: 2px;\n background-color: #666666;\n .{prefix}-virtual-range-subbar\n position: absolute;\n height: 100%;\n left: 0;\n right: 0;\n background-color: #d1d1d1;\n .{prefix}-virtual-range-pointer\n position: absolute;\n cursor: pointer;\n top: -5px;\n left: 0;\n width: 12px;\n height: 12px;\n background-color: #fff;\n border-radius: 100%;\n .{prefix}-range-wrap\n display: inline-block;\n margin-left: 4px;\n &.short .tui-image-editor-range\n width: 100px;\n .color-picker-control\n .{prefix}-range\n width: 108px;\n margin-left: 10px;\n .{prefix}-virtual-range-pointer\n background-color: #333;\n .{prefix}-virtual-range-bar\n background-color: #ccc;\n .{prefix}-virtual-range-subbar\n background-color: #606060;\n .{prefix}-range-wrap.{prefix}-newline.short\n margin-top: -2px;\n margin-left: 19px;\n label\n color: #8e8e8e;\n font-weight: normal;\n .{prefix}-range-wrap label\n vertical-align: baseline;\n font-size: 11px;\n margin-right: 7px;\n color: #fff;\n .{prefix}-range-value\n cursor: default;\n width: 40px;\n height: 24px;\n outline: none;\n border-radius: 2px;\n box-shadow: none;\n border: 1px solid #d5d5d5;\n text-align: center;\n background-color: #1c1c1c;\n color: #fff;\n font-weight: lighter;\n vertical-align: baseline;\n font-family: 'Noto Sans', sans-serif;\n margin-top: 21px;\n margin-left: 4px;\n .{prefix}-controls\n position: absolute;\n background-color: #151515;\n width: 100%;\n height: 64px;\n display: table;\n bottom: 0;\n z-index: 2;\n .{prefix}-icpartition\n display: inline-block;\n background-color: #444;\n width: 1px;\n height: 24px;\n","/* POSITION LEFT */\n.{prefix}-container\n &.left\n .{prefix}-menu\n > .{prefix}-item[tooltip-content]\n &:before\n left: 28px;\n top: 11px;\n border-right: 7px solid #2f2f2f;\n border-top: 7px solid transparent;\n border-bottom: 7px solid transparent;\n &:after\n top: 7px;\n left: 42px;\n white-space: nowrap;\n .{prefix}-submenu\n left: 0;\n height: 100%;\n width: 248px;\n .{prefix}-main-container\n left: 64px;\n width: calc(100% - 64px);\n height: 100%;\n .{prefix}-controls\n width: 64px;\n height: 100%;\n display: table;\n\n/* POSITION LEFT & RIGHT */\n.{prefix}-container\n &.left, &.right\n .{prefix}-menu\n white-space: inherit;\n .{prefix}-submenu\n white-space: normal;\n > div\n vertical-align: middle;\n .{prefix}-controls li\n display: inline-block;\n margin: 4px auto;\n .{prefix}-icpartition\n position: relative;\n top: -7px;\n width: 24px;\n height: 1px;\n .{prefix}-submenu\n .{prefix}-partition\n display: block;\n width: 75%;\n margin: auto;\n > div\n border-left: 0;\n height:10px;\n border-bottom: 1px solid #3c3c3c;\n width: 100%;\n margin: 0;\n .{prefix}-submenu-align\n margin-right: 0;\n .{prefix}-submenu-item\n li\n margin-top: 15px;\n .tui-colorpicker-clearfix li\n margin-top: 0;\n\n .{prefix}-checkbox-wrap.fixed-width\n width: 182px;\n white-space: normal;\n .{prefix}-range-wrap.{prefix}-newline label.range\n display: block;\n text-align: left;\n width: 75%;\n margin: auto;\n .{prefix}-range\n width: 136px;\n\n\n/* POSITION RIGHT */\n.{prefix}-container\n &.right\n .{prefix}-menu\n > .{prefix}-item[tooltip-content]\n &:before\n left: -3px;\n top: 11px;\n border-left: 7px solid #2f2f2f;\n border-top: 7px solid transparent;\n border-bottom: 7px solid transparent;\n &:after\n top: 7px;\n left: unset;\n right: 43px;\n white-space: nowrap;\n .{prefix}-submenu\n right: 0;\n height: 100%;\n width: 248px;\n .{prefix}-main-container \n right: 64px;\n width: calc(100% - 64px);\n height: 100%;\n .{prefix}-controls\n right: 0;\n width: 64px;\n height: 100%;\n display: table;\n\n\n/* POSITION TOP & BOTTOM */\n.{prefix}-container\n &.top, &.bottom\n .{prefix}-submenu\n .{prefix}-partition.only-left-right\n display: none;\n\n\n/* POSITION BOTTOM */\n.{prefix}-container\n &.bottom .tui-image-editor-submenu > div\n padding-bottom: 24px;\n\n/* POSITION TOP */\n.{prefix}-container\n &.top\n .color-picker-control .triangle\n top: -8px;\n border-right: 7px solid transparent;\n border-top: 0px;\n border-left: 7px solid transparent;\n border-bottom: 8px solid #fff;\n .{prefix}-size-wrap\n height: 100%;\n .{prefix}-main-container\n bottom: 0;\n .{prefix}-menu\n > .{prefix}-item[tooltip-content]\n &:before\n left: 13px;\n border-top: 0;\n border-bottom: 7px solid #2f2f2f;\n top: 33px;\n &:after\n top: 38px;\n .{prefix}-submenu\n top: 0;\n bottom: auto;\n > div\n padding-top: 24px;\n vertical-align: top;\n .{prefix}-controls-logo\n display: table-cell;\n .{prefix}-controls-buttons\n display: table-cell;\n .{prefix}-main\n top: 64px;\n height: calc(100% - 64px);\n .{prefix}-controls\n top: 0;\n bottom: inherit;\n\n/* HELP MENUBAR POSITION TOP */\n.{prefix}-container\n .{prefix}-help-menu\n &.top\n white-space: nowrap;\n width: 506px;\n height: 40px;\n top: 8px;\n left: 50%;\n transform: translateX(-50%);\n .tie-panel-history\n top: 45px;\n .opened .tie-panel-history:before\n border-right: 8px solid transparent;\n border-left: 8px solid transparent;\n border-bottom: 8px solid #fff;\n left: 90px;\n top: -8px;\n > .{prefix}-item[tooltip-content]\n &:before\n left: 13px;\n top: 35px;\n border: none;\n border-bottom: 7px solid #2f2f2f;\n border-left: 7px solid transparent;\n border-right: 7px solid transparent;\n &:after\n top: 41px;\n left: -4px;\n white-space: nowrap;\n > .{prefix}-item[tooltip-content].opened\n &:before,\n &:after\n content: none;\n\n/* HELP MENUBAR POSITION BOTTOM */\n.{prefix}-container\n .{prefix}-help-menu\n &.bottom\n white-space: nowrap;\n width: 506px;\n height: 40px;\n bottom: 8px;\n left: 50%;\n transform: translateX(-50%);\n .tie-panel-history\n bottom: 45px;\n .opened .tie-panel-history:before\n border-right: 8px solid transparent;\n border-left: 8px solid transparent;\n border-top: 8px solid #fff;\n left: 90px;\n bottom: -8px;\n > .{prefix}-item[tooltip-content]\n &:before\n left: 13px;\n top: auto;\n bottom: 36px;\n border: none;\n border-top: 7px solid #2f2f2f;\n border-left: 7px solid transparent;\n border-right: 7px solid transparent;\n &:after\n top: auto;\n left: -4px;\n bottom: 41px;\n white-space: nowrap;\n > .{prefix}-item[tooltip-content].opened\n &:before,\n &:after\n content: none;\n\n/* HELP MENUBAR POSITION LEFT */\n.{prefix}-container\n .{prefix}-help-menu\n &.left\n white-space: inherit;\n width: 40px;\n height: 506px;\n left: 8px;\n top: 50%;\n transform: translateY(-50%);\n .tie-panel-history\n left: 140px;\n top: -4px;\n .opened .tie-panel-history:before\n border-top: 8px solid transparent;\n border-bottom: 8px solid transparent;\n border-right: 8px solid #fff;\n left: -8px;\n top: 14px;\n .{prefix}-item\n margin: 4px auto;\n padding: 6px 8px;\n > .{prefix}-item[tooltip-content]\n &:before\n left: 27px;\n top: 11px;\n border: none;\n border-right: 7px solid #2f2f2f;\n border-top: 7px solid transparent;\n border-bottom: 7px solid transparent;\n &:after\n top: 7px;\n left: 40px;\n white-space: nowrap;\n > .{prefix}-item[tooltip-content].opened\n &:before,\n &:after\n content: none;\n\n/* HELP MENUBAR POSITION RIGHT */\n.{prefix}-container\n .{prefix}-help-menu\n &.right\n white-space: inherit;\n width: 40px;\n height: 506px;\n right: 8px;\n top: 50%;\n transform: translateY(-50%);\n .tie-panel-history\n right: -30px;\n top: -4px;\n .opened .tie-panel-history:before\n border-top: 8px solid transparent;\n border-bottom: 8px solid transparent;\n border-left: 8px solid #fff;\n right: -8px;\n top: 14px;\n .{prefix}-item\n margin: 4px auto;\n padding: 6px 8px;\n > .{prefix}-item[tooltip-content]\n &:before\n left: -6px;\n top: 11px;\n border: none;\n border-left: 7px solid #2f2f2f;\n border-top: 7px solid transparent;\n border-bottom: 7px solid transparent;\n &:after\n top: 7px;\n left: auto;\n right: 39px;\n white-space: nowrap;\n > .{prefix}-item[tooltip-content].opened\n &:before,\n &:after\n content: none;\n","/* ICON */\n.{prefix}-container\n .tie-icon-add-button .{prefix}-button\n min-width: 42px;\n .svg_ic-menu\n .svg_ic-helpmenu\n width: 24px;\n height: 24px;\n .svg_ic-submenu\n width: 32px;\n height: 32px;\n .svg_img-bi\n width: 257px;\n height: 26px;\n\n .{prefix}-help-menu\n .{prefix}-controls\n svg > use\n display: none;\n .enabled svg:hover > use.hover\n .normal svg:hover > use.hover\n display: block;\n .active svg:hover > use.hover\n display: none;\n .on svg > use.hover,\n .opened svg > use.hover\n display: block;\n svg > use.normal\n display: block;\n .active svg > use.active\n display: block;\n .enabled svg > use.enabled\n display: block;\n .active svg > use.normal,\n .enabled svg > use.normal\n display: none;\n .help svg > use.disabled,\n .help.enabled svg > use.normal\n display: block;\n .help.enabled svg > use.disabled\n display: none;\n\n .{prefix}-controls:hover\n z-index: 3;\n","/* COLOR PICKER */\n.{prefix}-container\n div.tui-colorpicker-clearfix\n width: 159px;\n height: 28px;\n border: 1px solid #d5d5d5;\n border-radius: 2px;\n background-color: #f5f5f5;\n margin-top: 6px;\n padding: 4px 7px 4px 7px;\n .tui-colorpicker-palette-hex\n width: 114px;\n background-color: #f5f5f5;\n border: 0;\n font-size: 11px;\n margin-top: 2px;\n font-family: 'Noto Sans', sans-serif;\n .tui-colorpicker-palette-hex[value='#ffffff'] + .tui-colorpicker-palette-preview,\n .tui-colorpicker-palette-hex[value=''] + .tui-colorpicker-palette-preview\n border: 1px solid #ccc;\n .tui-colorpicker-palette-hex[value=''] + .tui-colorpicker-palette-preview\n background-size: cover;\n background-image: url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAAAXNSR0IArs4c6QAAAdBJREFUWAnFl0FuwjAQRZ0ukiugHqFSOQNdseuKW3ALzkA4BateICvUGyCxrtRFd4WuunH/TzykaYJrnLEYaTJJsP2+x8GZZCbQrLU5mj7Bn+EP8HvnCObd+R7xBV5lWfaNON4AnsA38E94qLEt+0yiFaBzAV/Bv+Cxxr4co7hKCDpw1q9wLeNYYdlAwyn8TYt8Hme3+8D5ozcTaMCZ68PXa2tnM2sbEcOZAJhrrpl2DAcTOGNjZPSfCdzkw6JrfbiMv+osBe4y9WOedhm4jZfhbENWuxS44H9Wz/xw4WzqLOAqh1+zycgAwzEMzr5k5gaHOa9ULBwuuDkFlHI1Kl4PJ66kgIpnoywOTmRFAYcbwYk9UMApWkD8zAV5ihcwHk4Rx7gl0IFTQL0EFc+CTQ9OZHWH3YhlVJiVpTHbrTGLhTHLZVgff6s9lyBsI9KduSS83oj+34rTwJutmBmCnMsvozRwZqB5GTkBw6/jdPDu69iJ6BYk6eCcfbcgcQIK/MByaaiMqm8rHcjol2TnpWDhyAKSGdA3FrxtJUToX0ODqatetfGE+8tyEUOV8GY5dGRwLP/MBS4RHQr4bT7NRAQjlcOTfZxmv2G+c4hI8nn+Ax5PG/zhI393AAAAAElFTkSuQmCC');\n .tui-colorpicker-palette-preview\n border-radius: 100%;\n float: left;\n width: 17px;\n height: 17px;\n border: 0;\n .color-picker-control\n position: absolute;\n display: none;\n z-index: 99;\n width: 192px;\n background-color: #fff;\n box-shadow: 0 3px 22px 6px rgba(0, 0, 0, .15);\n padding: 16px;\n border-radius: 2px;\n .tui-colorpicker-palette-toggle-slider\n display: none;\n .tui-colorpicker-palette-button\n border: 0;\n border-radius: 100%;\n margin: 2px;\n background-size: cover;\n font-size: 1px;\n &[title='#ffffff']\n border: 1px solid #ccc;\n &[title='']\n border: 1px solid #ccc;\n .triangle\n width: 0;\n height: 0;\n border-right: 7px solid transparent;\n border-top: 8px solid #fff;\n border-left: 7px solid transparent;\n position: absolute;\n bottom: -8px;\n left: 84px;\n .tui-colorpicker-container,\n .tui-colorpicker-palette-container ul,\n .tui-colorpicker-palette-container\n width: 100%;\n height: auto;\n\n\n .filter-color-item\n .color-picker-control label\n font-color: #333;\n font-weight: normal;\n margin-right: 7pxleft\n .tui-image-editor-checkbox\n margin-top: 0;\n input + label:before,\n > label:before\n left: -16px;\n .color-picker\n width: 100%;\n height: auto;\n .color-picker-value \n width: 32px;\n height: 32px;\n border: 0px;\n border-radius: 100%;\n margin: auto;\n margin-bottom: 1px;\n &.transparent\n border: 1px solid #cbcbcb;\n background-size: cover;\n background-image: url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAAAXNSR0IArs4c6QAAAdBJREFUWAnFl0FuwjAQRZ0ukiugHqFSOQNdseuKW3ALzkA4BateICvUGyCxrtRFd4WuunH/TzykaYJrnLEYaTJJsP2+x8GZZCbQrLU5mj7Bn+EP8HvnCObd+R7xBV5lWfaNON4AnsA38E94qLEt+0yiFaBzAV/Bv+Cxxr4co7hKCDpw1q9wLeNYYdlAwyn8TYt8Hme3+8D5ozcTaMCZ68PXa2tnM2sbEcOZAJhrrpl2DAcTOGNjZPSfCdzkw6JrfbiMv+osBe4y9WOedhm4jZfhbENWuxS44H9Wz/xw4WzqLOAqh1+zycgAwzEMzr5k5gaHOa9ULBwuuDkFlHI1Kl4PJ66kgIpnoywOTmRFAYcbwYk9UMApWkD8zAV5ihcwHk4Rx7gl0IFTQL0EFc+CTQ9OZHWH3YhlVJiVpTHbrTGLhTHLZVgff6s9lyBsI9KduSS83oj+34rTwJutmBmCnMsvozRwZqB5GTkBw6/jdPDu69iJ6BYk6eCcfbcgcQIK/MByaaiMqm8rHcjol2TnpWDhyAKSGdA3FrxtJUToX0ODqatetfGE+8tyEUOV8GY5dGRwLP/MBS4RHQr4bT7NRAQjlcOTfZxmv2G+c4hI8nn+Ax5PG/zhI393AAAAAElFTkSuQmCC');\n\n .color-picker-value + label\n color: #fff;\n\n .{prefix}-submenu svg > use\n display: none;\n .{prefix}-submenu svg > use.normal\n display: block;\n","/* ICON BUTTON */\n.tie-icon-add-button\n &.icon-bubble .{prefix}-button[data-icontype=\"icon-bubble\"] svg > use.active,\n &.icon-heart .{prefix}-button[data-icontype=\"icon-heart\"] svg > use.active,\n &.icon-location .{prefix}-button[data-icontype=\"icon-location\"] svg > use.active,\n &.icon-polygon .{prefix}-button[data-icontype=\"icon-polygon\"] svg > use.active,\n &.icon-star .{prefix}-button[data-icontype=\"icon-star\"] svg > use.active,\n &.icon-star-2 .{prefix}-button[data-icontype=\"icon-star-2\"] svg > use.active,\n &.icon-arrow-3 .{prefix}-button[data-icontype=\"icon-arrow-3\"] svg > use.active,\n &.icon-arrow-2 .{prefix}-button[data-icontype=\"icon-arrow-2\"] svg > use.active,\n &.icon-arrow .{prefix}-button[data-icontype=\"icon-arrow\"] svg > use.active,\n &.icon-bubble .{prefix}-button[data-icontype=\"icon-bubble\"] svg > use.active\n display: block;\n\n/* DRAW BUTTON */\n.tie-draw-line-select-button\n &.line .{prefix}-button.line svg > use.normal,\n &.free .{prefix}-button.free svg > use.normal\n display: none;\n\n &.line .{prefix}-button.line svg > use.active,\n &.free .{prefix}-button.free svg > use.active\n display: block;\n\n/* FLIP BUTTON */\n.tie-flip-button\n &.resetFlip .{prefix}-button.resetFlip,\n &.flipX .{prefix}-button.flipX,\n &.flipY .{prefix}-button.flipY\n svg > use.normal\n display: none;\n svg > use.active\n display: block;\n\n/* MASK BUTTON */\n.tie-mask-apply.apply.active .{prefix}-button.apply\n label\n color: #fff;\n svg > use.active\n display: block;\n\n/* CROP BUTTON */\n.tie-crop-button,\n.tie-crop-preset-button\n .{prefix}-button.apply\n margin-right: 24px;\n .{prefix}-button.preset.active svg > use.active\n display: block;\n .{prefix}-button.apply.active svg > use.active\n display: block;\n\n\n/* SHAPE BUTTON */\n.tie-shape-button\n &.rect .{prefix}-button.rect,\n &.circle .{prefix}-button.circle,\n &.triangle .{prefix}-button.triangle\n svg > use.normal\n display: none;\n svg > use.active\n display: block;\n\n/* TEXT BUTTON */\n.tie-text-effect-button\n .{prefix}-button.active svg > use.active\n display: block;\n.tie-text-align-button\n &.left .{prefix}-button.left svg > use.active,\n &.center .{prefix}-button.center svg > use.active,\n &.right .{prefix}-button.right svg > use.active\n display: block;\n.tie-mask-image-file,\n.tie-icon-image-file\n opacity: 0;\n position: absolute;\n width: 100%;\n height: 100%;\n border: 1px solid green;\n cursor: inherit;\n left: 0;\n top: 0;\n\n\n/* FLIP BUTTON */\n.tie-zoom-button\n &.resetFlip .{prefix}-button.resetFlip,\n &.flipX .{prefix}-button.flipX,\n &.flipY .{prefix}-button.flipY\n svg > use.normal\n display: none;\n svg > use.active\n display: block;\n","prefix = 'tui-image-editor'\n\n@import 'main.styl'\n@import 'gridtable.styl'\n@import 'submenu.styl'\n@import 'checkbox.styl'\n@import 'range.styl'\n@import 'position.styl'\n@import 'icon.styl'\n@import 'colorpicker.styl'\n@import 'buttons.styl'\n.{prefix}-container.top\n &.{prefix}-top-optimization\n .{prefix}-controls ul\n text-align: right;\n .{prefix}-controls-logo\n display: none;\n"]} \ No newline at end of file +{"version":3,"sources":["tui-image-editor.min.css","src/css/main.styl","index.styl","src/css/gridtable.styl","src/css/submenu.styl","src/css/checkbox.styl","src/css/range.styl","src/css/position.styl","src/css/icon.styl","src/css/colorpicker.styl","src/css/buttons.styl","src/css/index.styl"],"names":[],"mappings":"AAAA;;;;;EAKE,CCLF,cACI,wBCCJ,CDEE,4BACE,QAAQ,CACR,SAAS,CACT,qBAAY,CACZ,gBAAY,CACZ,WAAQ,CACR,iBAAU,CACV,wBAAkB,CAClB,eAAU,CACV,mBCAJ,CDEI,kKACE,qBAAY,CACZ,QAAQ,CACR,SAAS,CACT,oBAAiB,CACjB,0BAAkB,CAClB,uBAAoB,CACpB,wBAAqB,CACrB,gBCIN,CDFI,qDAEI,eAAW,CACX,iBAAU,CACV,wBAAkB,CAClB,KAAK,CACL,UCIR,CDHI,4HAEI,WAAO,CACP,UCKR,CDHI,sHAEI,UAAO,CACP,SAAO,CACP,YCKR,CDHI,2HAEI,WAAO,CACP,WAAQ,CACR,YCKR,CDHI,8QAII,oBAAS,CACT,iBAAU,CACV,WAAO,CACP,WAAQ,CACR,SAAS,CACT,gBAAa,CACb,YAAS,CACT,kBAAe,CACf,qBAAQ,CACR,gCAAwB,CACxB,cAAW,CACX,eAAa,CACb,cAAQ,CACR,qBAAgB,CAChB,mBAAgB,CAChB,iBCKR,CDHI,2DACI,wBAAkB,CAClB,oBAAc,CACd,UCKR,CDJI,uDACI,iBAAU,CACV,MAAM,CACN,OAAO,CACP,oBAAS,CACT,KAAK,CACL,QAAQ,CACR,UAAO,CACP,cAAQ,CACR,SCMR,CDLI,6DACI,iBAAU,CACV,UAAO,CACP,KAAK,CACL,WCOR,CDNI,mDACI,iBAAU,CACV,i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PggCZ,CO//BY,oLAEE,UPigCd,COhgCI,0CACI,UAAO,CACP,WPkgCR,COjgCI,gDACI,UAAO,CACP,WAAQ,CACR,QAAQ,CACR,kBAAe,CAEf,oBPmgCR,COlgCQ,4DACI,wBAAQ,CACR,qBAAiB,CACjB,svBPogCZ,COlgCI,sDACI,UPogCR,COlgCI,8DACI,YPogCR,CQjmCI,28BAUI,aRqmCR,CQjmCE,8JAEE,YRmmCJ,CQjmCE,8JAEE,aRmmCJ,CQ5lCI,uNACI,YRgmCR,CQ/lCI,uNACI,aRmmCR,CQ/lCI,kEACI,URimCR,CQhmCI,2EACI,aRkmCR,CQ7lCI,uGACI,iBRgmCR,CQ7lCI,wSACI,aRomCR,CQ5lCI,wNACI,YRgmCR,CQvlCI,ggBAGI,aRimCR,CQhmCA,0CAEI,SAAS,CACT,iBAAU,CACV,UAAO,CACP,WAAQ,CACR,sBAAQ,CACR,cAAQ,CACR,MAAM,CACN,KRkmCJ,CQ1lCQ,uNACI,YR8lCZ,CQ7lCQ,uNACI,aRimCZ,CS/qCM,gGACI,gBTirCV,CShrCM,kGACI,YTkrCV","file":"tui-image-editor.min.css","sourcesContent":["/*!\n * tui-image-editor.min.js\n * @version 3.14.1\n * @author NHN. FE Development Lab \n * @license MIT\n */\nbody > textarea {\n position: fixed !important;\n}\n.tui-image-editor-container {\n margin: 0;\n padding: 0;\n box-sizing: border-box;\n min-height: 300px;\n height: 100%;\n position: relative;\n background-color: #282828;\n overflow: hidden;\n letter-spacing: 0.3px;\n}\n.tui-image-editor-container div,\n.tui-image-editor-container ul,\n.tui-image-editor-container label,\n.tui-image-editor-container input,\n.tui-image-editor-container li {\n box-sizing: border-box;\n margin: 0;\n padding: 0;\n -ms-user-select: none;\n -moz-user-select: -moz-none;\n -khtml-user-select: none;\n -webkit-user-select: none;\n user-select: none;\n}\n.tui-image-editor-container .tui-image-editor-header {\n/* BUTTON AND LOGO */\n min-width: 533px;\n position: absolute;\n background-color: #151515;\n top: 0;\n width: 100%;\n}\n.tui-image-editor-container .tui-image-editor-header-buttons,\n.tui-image-editor-container .tui-image-editor-controls-buttons {\n float: right;\n margin: 8px;\n}\n.tui-image-editor-container .tui-image-editor-header-logo,\n.tui-image-editor-container .tui-image-editor-controls-logo {\n float: left;\n width: 30%;\n padding: 17px;\n}\n.tui-image-editor-container .tui-image-editor-controls-logo,\n.tui-image-editor-container .tui-image-editor-controls-buttons {\n width: 270px;\n height: 100%;\n display: none;\n}\n.tui-image-editor-container .tui-image-editor-header-buttons button,\n.tui-image-editor-container .tui-image-editor-header-buttons div,\n.tui-image-editor-container .tui-image-editor-controls-buttons button,\n.tui-image-editor-container .tui-image-editor-controls-buttons div {\n display: inline-block;\n position: relative;\n width: 120px;\n height: 40px;\n padding: 0;\n line-height: 40px;\n outline: none;\n border-radius: 20px;\n border: 1px solid #ddd;\n font-family: 'Noto Sans', sans-serif;\n font-size: 12px;\n font-weight: bold;\n cursor: pointer;\n vertical-align: middle;\n letter-spacing: 0.3px;\n text-align: center;\n}\n.tui-image-editor-container .tui-image-editor-download-btn {\n background-color: #fdba3b;\n border-color: #fdba3b;\n color: #fff;\n}\n.tui-image-editor-container .tui-image-editor-load-btn {\n position: absolute;\n left: 0;\n right: 0;\n display: inline-block;\n top: 0;\n bottom: 0;\n width: 100%;\n cursor: pointer;\n opacity: 0;\n}\n.tui-image-editor-container .tui-image-editor-main-container {\n position: absolute;\n width: 100%;\n top: 0;\n bottom: 64px;\n}\n.tui-image-editor-container .tui-image-editor-main {\n position: absolute;\n text-align: center;\n top: 64px;\n bottom: 0;\n right: 0;\n left: 0;\n}\n.tui-image-editor-container .tui-image-editor-wrap {\n position: absolute;\n bottom: 0;\n width: 100%;\n overflow: auto;\n}\n.tui-image-editor-container .tui-image-editor-wrap .tui-image-editor-size-wrap {\n display: table;\n width: 100%;\n height: 100%;\n}\n.tui-image-editor-container .tui-image-editor-wrap .tui-image-editor-size-wrap .tui-image-editor-align-wrap {\n display: table-cell;\n vertical-align: middle;\n}\n.tui-image-editor-container .tui-image-editor {\n position: relative;\n display: inline-block;\n}\n.tui-image-editor-container .tui-image-editor-menu,\n.tui-image-editor-container .tui-image-editor-help-menu {\n width: auto;\n list-style: none;\n padding: 0;\n margin: 0 auto;\n display: table-cell;\n text-align: center;\n vertical-align: middle;\n white-space: nowrap;\n}\n.tui-image-editor-container .tui-image-editor-menu > .tui-image-editor-item,\n.tui-image-editor-container .tui-image-editor-help-menu > .tui-image-editor-item {\n position: relative;\n display: inline-block;\n border-radius: 2px;\n padding: 7px 8px 3px 8px;\n cursor: pointer;\n margin: 0 4px;\n}\n.tui-image-editor-container .tui-image-editor-menu > .tui-image-editor-item[tooltip-content]:hover:before,\n.tui-image-editor-container .tui-image-editor-help-menu > .tui-image-editor-item[tooltip-content]:hover:before {\n content: '';\n position: absolute;\n display: inline-block;\n margin: 0 auto 0;\n width: 0;\n height: 0;\n border-right: 7px solid transparent;\n border-top: 7px solid #2f2f2f;\n border-left: 7px solid transparent;\n left: 13px;\n top: -2px;\n}\n.tui-image-editor-container .tui-image-editor-menu > .tui-image-editor-item[tooltip-content]:hover:after,\n.tui-image-editor-container .tui-image-editor-help-menu > .tui-image-editor-item[tooltip-content]:hover:after {\n content: attr(tooltip-content);\n position: absolute;\n display: inline-block;\n background-color: #2f2f2f;\n color: #fff;\n padding: 5px 8px;\n font-size: 11px;\n font-weight: lighter;\n border-radius: 3px;\n max-height: 23px;\n top: -25px;\n left: 0;\n min-width: 24px;\n}\n.tui-image-editor-container .tui-image-editor-menu > .tui-image-editor-item.active,\n.tui-image-editor-container .tui-image-editor-help-menu > .tui-image-editor-item.active {\n background-color: #fff;\n transition: all 0.3s ease;\n}\n.tui-image-editor-container .tui-image-editor-wrap {\n position: absolute;\n}\n.tui-image-editor-container .tui-image-editor-grid-visual {\n display: none;\n position: absolute;\n width: 100%;\n height: 100%;\n border: 1px solid rgba(255,255,255,0.7);\n}\n.tui-image-editor-container .tui-image-editor-main.tui-image-editor-menu-flip .tui-image-editor,\n.tui-image-editor-container .tui-image-editor-main.tui-image-editor-menu-rotate .tui-image-editor {\n transition: none;\n}\n.tui-image-editor-container .tui-image-editor-main.tui-image-editor-menu-flip .tui-image-editor-grid-visual,\n.tui-image-editor-container .tui-image-editor-main.tui-image-editor-menu-rotate .tui-image-editor-grid-visual {\n display: block;\n}\n.tui-image-editor-container .tui-image-editor-grid-visual table {\n width: 100%;\n height: 100%;\n border-collapse: collapse;\n}\n.tui-image-editor-container .tui-image-editor-grid-visual table td {\n border: 1px solid rgba(255,255,255,0.3);\n}\n.tui-image-editor-container .tui-image-editor-grid-visual table td.dot:before {\n content: '';\n position: absolute;\n box-sizing: border-box;\n width: 10px;\n height: 10px;\n border: 0;\n box-shadow: 0 0 1px 0 rgba(0,0,0,0.3);\n border-radius: 100%;\n background-color: #fff;\n}\n.tui-image-editor-container .tui-image-editor-grid-visual table td.dot.left-top:before {\n top: -5px;\n left: -5px;\n}\n.tui-image-editor-container .tui-image-editor-grid-visual table td.dot.right-top:before {\n top: -5px;\n right: -5px;\n}\n.tui-image-editor-container .tui-image-editor-grid-visual table td.dot.left-bottom:before {\n bottom: -5px;\n left: -5px;\n}\n.tui-image-editor-container .tui-image-editor-grid-visual table td.dot.right-bottom:before {\n bottom: -5px;\n right: -5px;\n}\n.tui-image-editor-container .tui-image-editor-submenu {\n display: none;\n position: absolute;\n bottom: 0;\n width: 100%;\n height: 150px;\n white-space: nowrap;\n z-index: 2;\n}\n.tui-image-editor-container .tui-image-editor-submenu .tui-image-editor-button:hover svg > use.active {\n display: block;\n}\n.tui-image-editor-container .tui-image-editor-submenu .tui-image-editor-submenu-item li {\n display: inline-block;\n vertical-align: top;\n}\n.tui-image-editor-container .tui-image-editor-submenu .tui-image-editor-submenu-item .tui-image-editor-newline {\n display: block;\n margin-top: 0;\n}\n.tui-image-editor-container .tui-image-editor-submenu .tui-image-editor-submenu-item .tui-image-editor-button {\n position: relative;\n cursor: pointer;\n display: inline-block;\n font-weight: normal;\n font-size: 11px;\n margin: 0 9px 0 9px;\n}\n.tui-image-editor-container .tui-image-editor-submenu .tui-image-editor-submenu-item .tui-image-editor-button.preset {\n margin: 0 9px 20px 5px;\n}\n.tui-image-editor-container .tui-image-editor-submenu .tui-image-editor-submenu-item label > span {\n display: inline-block;\n cursor: pointer;\n padding-top: 5px;\n font-family: \"Noto Sans\", sans-serif;\n font-size: 11px;\n}\n.tui-image-editor-container .tui-image-editor-submenu .tui-image-editor-submenu-item .tui-image-editor-button.apply label,\n.tui-image-editor-container .tui-image-editor-submenu .tui-image-editor-submenu-item .tui-image-editor-button.cancel label {\n vertical-align: 7px;\n}\n.tui-image-editor-container .tui-image-editor-submenu > div {\n display: none;\n vertical-align: bottom;\n}\n.tui-image-editor-container .tui-image-editor-submenu .tui-image-editor-submenu-style {\n opacity: 0.95;\n z-index: -1;\n position: absolute;\n top: 0;\n bottom: 0;\n left: 0;\n right: 0;\n display: block;\n}\n.tui-image-editor-container .tui-image-editor-partition > div {\n width: 1px;\n height: 52px;\n border-left: 1px solid #3c3c3c;\n margin: 0 8px 0 8px;\n}\n.tui-image-editor-container .tui-image-editor-main.tui-image-editor-menu-filter .tui-image-editor-partition > div {\n height: 108px;\n margin: 0 29px 0 0px;\n}\n.tui-image-editor-container .tui-image-editor-submenu-align {\n text-align: left;\n margin-right: 30px;\n}\n.tui-image-editor-container .tui-image-editor-submenu-align label > span {\n width: 55px;\n white-space: nowrap;\n}\n.tui-image-editor-container .tui-image-editor-submenu-align:first-child {\n margin-right: 0;\n}\n.tui-image-editor-container .tui-image-editor-submenu-align:first-child label > span {\n width: 70px;\n}\n.tui-image-editor-container .tui-image-editor-main.tui-image-editor-menu-crop .tui-image-editor-submenu > div.tui-image-editor-menu-crop,\n.tui-image-editor-container .tui-image-editor-main.tui-image-editor-menu-flip .tui-image-editor-submenu > div.tui-image-editor-menu-flip,\n.tui-image-editor-container .tui-image-editor-main.tui-image-editor-menu-rotate .tui-image-editor-submenu > div.tui-image-editor-menu-rotate,\n.tui-image-editor-container .tui-image-editor-main.tui-image-editor-menu-shape .tui-image-editor-submenu > div.tui-image-editor-menu-shape,\n.tui-image-editor-container .tui-image-editor-main.tui-image-editor-menu-text .tui-image-editor-submenu > div.tui-image-editor-menu-text,\n.tui-image-editor-container .tui-image-editor-main.tui-image-editor-menu-mask .tui-image-editor-submenu > div.tui-image-editor-menu-mask,\n.tui-image-editor-container .tui-image-editor-main.tui-image-editor-menu-icon .tui-image-editor-submenu > div.tui-image-editor-menu-icon,\n.tui-image-editor-container .tui-image-editor-main.tui-image-editor-menu-draw .tui-image-editor-submenu > div.tui-image-editor-menu-draw,\n.tui-image-editor-container .tui-image-editor-main.tui-image-editor-menu-filter .tui-image-editor-submenu > div.tui-image-editor-menu-filter,\n.tui-image-editor-container .tui-image-editor-main.tui-image-editor-menu-zoom .tui-image-editor-submenu > div.tui-image-editor-menu-zoom {\n display: table-cell;\n}\n.tui-image-editor-container .tui-image-editor-main.tui-image-editor-menu-crop .tui-image-editor-submenu,\n.tui-image-editor-container .tui-image-editor-main.tui-image-editor-menu-flip .tui-image-editor-submenu,\n.tui-image-editor-container .tui-image-editor-main.tui-image-editor-menu-rotate .tui-image-editor-submenu,\n.tui-image-editor-container .tui-image-editor-main.tui-image-editor-menu-shape .tui-image-editor-submenu,\n.tui-image-editor-container .tui-image-editor-main.tui-image-editor-menu-text .tui-image-editor-submenu,\n.tui-image-editor-container .tui-image-editor-main.tui-image-editor-menu-mask .tui-image-editor-submenu,\n.tui-image-editor-container .tui-image-editor-main.tui-image-editor-menu-icon .tui-image-editor-submenu,\n.tui-image-editor-container .tui-image-editor-main.tui-image-editor-menu-draw .tui-image-editor-submenu,\n.tui-image-editor-container .tui-image-editor-main.tui-image-editor-menu-filter .tui-image-editor-submenu,\n.tui-image-editor-container .tui-image-editor-main.tui-image-editor-menu-zoom .tui-image-editor-submenu {\n display: table;\n}\n.tui-image-editor-container .tui-image-editor-help-menu {\n list-style: none;\n padding: 0;\n margin: 0 auto;\n text-align: center;\n vertical-align: middle;\n border-radius: 20px;\n background-color: rgba(255,255,255,0.06);\n z-index: 2;\n position: absolute;\n}\n.tui-image-editor-container .tui-image-editor-help-menu .tie-panel-history {\n display: none;\n background-color: #fff;\n color: #444;\n position: absolute;\n width: 196px;\n height: 276px;\n padding: 4px 2px;\n box-shadow: 0 2px 6px 0 rgba(0,0,0,0.15);\n cursor: auto;\n transform: translateX(calc(-50% + 12px));\n}\n.tui-image-editor-container .tui-image-editor-help-menu .tie-panel-history .history-list {\n height: 268px;\n padding: 0;\n overflow: hidden scroll;\n list-style: none;\n}\n.tui-image-editor-container .tui-image-editor-help-menu .tie-panel-history .history-list .history-item {\n height: 24px;\n font-size: 11px;\n line-height: 24px;\n}\n.tui-image-editor-container .tui-image-editor-help-menu .tie-panel-history .history-list .history-item .tui-image-editor-history-item {\n position: relative;\n height: 24px;\n cursor: pointer;\n}\n.tui-image-editor-container .tui-image-editor-help-menu .tie-panel-history .history-list .history-item .tui-image-editor-history-item svg {\n width: 24px;\n height: 24px;\n}\n.tui-image-editor-container .tui-image-editor-help-menu .tie-panel-history .history-list .history-item .tui-image-editor-history-item span {\n display: inline-block;\n width: 128px;\n height: 24px;\n text-align: left;\n}\n.tui-image-editor-container .tui-image-editor-help-menu .tie-panel-history .history-list .history-item .tui-image-editor-history-item .history-item-icon {\n display: inline-block;\n width: 24px;\n height: 24px;\n position: absolute;\n top: 6px;\n left: 6px;\n}\n.tui-image-editor-container .tui-image-editor-help-menu .tie-panel-history .history-list .history-item .tui-image-editor-history-item .history-item-checkbox {\n display: none;\n width: 24px;\n height: 24px;\n position: absolute;\n top: 5px;\n right: -6px;\n}\n.tui-image-editor-container .tui-image-editor-help-menu .tie-panel-history .history-list .history-item.selected-item {\n background-color: rgba(119,119,119,0.12);\n}\n.tui-image-editor-container .tui-image-editor-help-menu .tie-panel-history .history-list .history-item.selected-item .history-item-checkbox {\n display: inline-block;\n}\n.tui-image-editor-container .tui-image-editor-help-menu .tie-panel-history .history-list .history-item.disabled-item {\n color: #333;\n opacity: 0.3;\n}\n.tui-image-editor-container .tui-image-editor-help-menu .opened .tie-panel-history {\n display: block;\n}\n.tui-image-editor-container .tui-image-editor-help-menu .opened .tie-panel-history:before {\n content: '';\n position: absolute;\n display: inline-block;\n margin: 0 auto;\n width: 0;\n height: 0;\n}\n.tui-image-editor-container .filter-color-item {\n display: inline-block;\n}\n.tui-image-editor-container .filter-color-item .tui-image-editor-checkbox {\n display: block;\n}\n.tui-image-editor-container .tui-image-editor-checkbox-wrap {\n display: inline-block !important;\n text-align: left;\n}\n.tui-image-editor-container .tui-image-editor-checkbox-wrap.fixed-width {\n width: 187px;\n white-space: normal;\n}\n.tui-image-editor-container .tui-image-editor-checkbox {\n display: inline-block;\n margin: 1px 0 1px 0;\n}\n.tui-image-editor-container .tui-image-editor-checkbox input {\n width: 14px;\n height: 14px;\n opacity: 0;\n}\n.tui-image-editor-container .tui-image-editor-checkbox > label > span {\n color: #fff;\n height: 14px;\n position: relative;\n}\n.tui-image-editor-container .tui-image-editor-checkbox input + label:before,\n.tui-image-editor-container .tui-image-editor-checkbox > label > span:before {\n content: '';\n position: absolute;\n width: 14px;\n height: 14px;\n background-color: #fff;\n top: 6px;\n left: -19px;\n display: inline-block;\n margin: 0;\n text-align: center;\n font-size: 11px;\n border: 0;\n border-radius: 2px;\n padding-top: 1px;\n box-sizing: border-box;\n}\n.tui-image-editor-container .tui-image-editor-checkbox input[type='checkbox']:checked + span:before {\n background-size: cover;\n background-image: url(\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAA4AAAAOCAYAAAAfSC3RAAAAAXNSR0IArs4c6QAAAMBJREFUKBWVkjEOwjAMRe2WgZW7IIHEDdhghhuwcQ42rlJugAQS54Cxa5cq1QM5TUpByZfS2j9+dlJVt/tX5ZxbS4ZU9VLkQvSHKTIGRaVJYFmKrBbTCJxE2UgCdDzMZDkHrOV6b95V0US6UmgKodujEZbJg0B0ZgEModO5lrY1TMQf1TpyJGBEjD+E2NPN7ukIUDiF/BfEXgRiGEw8NgkffYGYwCi808fpn/6OvfUfsDr/Vc1IfRf8sKnFVqeiVQfDu0tf/nWH9gAAAABJRU5ErkJggg==\");\n}\n.tui-image-editor-container .tui-image-editor-selectlist-wrap {\n position: relative;\n}\n.tui-image-editor-container .tui-image-editor-selectlist-wrap select {\n width: 100%;\n height: 28px;\n margin-top: 4px;\n border: 0;\n outline: 0;\n border-radius: 0;\n border: 1px solid #cbdbdb;\n background-color: #fff;\n -webkit-appearance: none;\n -moz-appearance: none;\n appearance: none;\n padding: 0 7px 0 10px;\n}\n.tui-image-editor-container .tui-image-editor-selectlist-wrap .tui-image-editor-selectlist {\n display: none;\n position: relative;\n top: -1px;\n border: 1px solid #ccc;\n background-color: #fff;\n border-top: 0px;\n padding: 4px 0;\n}\n.tui-image-editor-container .tui-image-editor-selectlist-wrap .tui-image-editor-selectlist li {\n display: block;\n text-align: left;\n padding: 7px 10px;\n font-family: 'Noto Sans', sans-serif;\n}\n.tui-image-editor-container .tui-image-editor-selectlist-wrap .tui-image-editor-selectlist li:hover {\n background-color: rgba(81,92,230,0.05);\n}\n.tui-image-editor-container .tui-image-editor-selectlist-wrap:before {\n content: '';\n position: absolute;\n display: inline-block;\n width: 14px;\n height: 14px;\n right: 5px;\n top: 10px;\n background-image: url(\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAA4AAAAOCAYAAAAfSC3RAAAAAXNSR0IArs4c6QAAAHlJREFUKBVjYBgFOEOAEVkmPDxc89+/f6eAYjzI4kD2FyYmJrOVK1deh4kzwRggGiQBVJCELAZig8SQNYHEmEEEMrh69eo1HR0dfqCYJUickZGxf9WqVf3IakBsFBthklpaWmVA9mEQhrJhUoTp0NBQCRAmrHL4qgAAuu4cWZOZIGsAAAAASUVORK5CYII=\");\n background-size: cover;\n}\n.tui-image-editor-container .tui-image-editor-selectlist-wrap select::-ms-expand {\n display: none;\n}\n.tui-image-editor-container .tui-image-editor-virtual-range-bar .tui-image-editor-disabled,\n.tui-image-editor-container .tui-image-editor-virtual-range-subbar .tui-image-editor-disabled,\n.tui-image-editor-container .tui-image-editor-virtual-range-pointer .tui-image-editor-disabled {\n backbround-color: #f00;\n}\n.tui-image-editor-container .tui-image-editor-range {\n position: relative;\n top: 5px;\n width: 166px;\n height: 17px;\n display: inline-block;\n}\n.tui-image-editor-container .tui-image-editor-virtual-range-bar {\n top: 7px;\n position: absolute;\n width: 100%;\n height: 2px;\n background-color: #666;\n}\n.tui-image-editor-container .tui-image-editor-virtual-range-subbar {\n position: absolute;\n height: 100%;\n left: 0;\n right: 0;\n background-color: #d1d1d1;\n}\n.tui-image-editor-container .tui-image-editor-virtual-range-pointer {\n position: absolute;\n cursor: pointer;\n top: -5px;\n left: 0;\n width: 12px;\n height: 12px;\n background-color: #fff;\n border-radius: 100%;\n}\n.tui-image-editor-container .tui-image-editor-range-wrap {\n display: inline-block;\n margin-left: 4px;\n}\n.tui-image-editor-container .tui-image-editor-range-wrap.short .tui-image-editor-range {\n width: 100px;\n}\n.tui-image-editor-container .color-picker-control .tui-image-editor-range {\n width: 108px;\n margin-left: 10px;\n}\n.tui-image-editor-container .color-picker-control .tui-image-editor-virtual-range-pointer {\n background-color: #333;\n}\n.tui-image-editor-container .color-picker-control .tui-image-editor-virtual-range-bar {\n background-color: #ccc;\n}\n.tui-image-editor-container .color-picker-control .tui-image-editor-virtual-range-subbar {\n background-color: #606060;\n}\n.tui-image-editor-container .tui-image-editor-range-wrap.tui-image-editor-newline.short {\n margin-top: -2px;\n margin-left: 19px;\n}\n.tui-image-editor-container .tui-image-editor-range-wrap.tui-image-editor-newline.short label {\n color: #8e8e8e;\n font-weight: normal;\n}\n.tui-image-editor-container .tui-image-editor-range-wrap label {\n vertical-align: baseline;\n font-size: 11px;\n margin-right: 7px;\n color: #fff;\n}\n.tui-image-editor-container .tui-image-editor-range-value {\n cursor: default;\n width: 40px;\n height: 24px;\n outline: none;\n border-radius: 2px;\n box-shadow: none;\n border: 1px solid #d5d5d5;\n text-align: center;\n background-color: #1c1c1c;\n color: #fff;\n font-weight: lighter;\n vertical-align: baseline;\n font-family: 'Noto Sans', sans-serif;\n margin-top: 21px;\n margin-left: 4px;\n}\n.tui-image-editor-container .tui-image-editor-controls {\n position: absolute;\n background-color: #151515;\n width: 100%;\n height: 64px;\n display: table;\n bottom: 0;\n z-index: 2;\n}\n.tui-image-editor-container .tui-image-editor-icpartition {\n display: inline-block;\n background-color: #444;\n width: 1px;\n height: 24px;\n}\n.tui-image-editor-container.left .tui-image-editor-menu > .tui-image-editor-item[tooltip-content]:before {\n left: 28px;\n top: 11px;\n border-right: 7px solid #2f2f2f;\n border-top: 7px solid transparent;\n border-bottom: 7px solid transparent;\n}\n.tui-image-editor-container.left .tui-image-editor-menu > .tui-image-editor-item[tooltip-content]:after {\n top: 7px;\n left: 42px;\n white-space: nowrap;\n}\n.tui-image-editor-container.left .tui-image-editor-submenu {\n left: 0;\n height: 100%;\n width: 248px;\n}\n.tui-image-editor-container.left .tui-image-editor-main-container {\n left: 64px;\n width: calc(100% - 64px);\n height: 100%;\n}\n.tui-image-editor-container.left .tui-image-editor-controls {\n width: 64px;\n height: 100%;\n display: table;\n}\n.tui-image-editor-container.left .tui-image-editor-menu,\n.tui-image-editor-container.right .tui-image-editor-menu {\n white-space: inherit;\n}\n.tui-image-editor-container.left .tui-image-editor-submenu,\n.tui-image-editor-container.right .tui-image-editor-submenu {\n white-space: normal;\n}\n.tui-image-editor-container.left .tui-image-editor-submenu > div,\n.tui-image-editor-container.right .tui-image-editor-submenu > div {\n vertical-align: middle;\n}\n.tui-image-editor-container.left .tui-image-editor-controls li,\n.tui-image-editor-container.right .tui-image-editor-controls li {\n display: inline-block;\n margin: 4px auto;\n}\n.tui-image-editor-container.left .tui-image-editor-icpartition,\n.tui-image-editor-container.right .tui-image-editor-icpartition {\n position: relative;\n top: -7px;\n width: 24px;\n height: 1px;\n}\n.tui-image-editor-container.left .tui-image-editor-submenu .tui-image-editor-partition,\n.tui-image-editor-container.right .tui-image-editor-submenu .tui-image-editor-partition {\n display: block;\n width: 75%;\n margin: auto;\n}\n.tui-image-editor-container.left .tui-image-editor-submenu .tui-image-editor-partition > div,\n.tui-image-editor-container.right .tui-image-editor-submenu .tui-image-editor-partition > div {\n border-left: 0;\n height: 10px;\n border-bottom: 1px solid #3c3c3c;\n width: 100%;\n margin: 0;\n}\n.tui-image-editor-container.left .tui-image-editor-submenu .tui-image-editor-submenu-align,\n.tui-image-editor-container.right .tui-image-editor-submenu .tui-image-editor-submenu-align {\n margin-right: 0;\n}\n.tui-image-editor-container.left .tui-image-editor-submenu .tui-image-editor-submenu-item li,\n.tui-image-editor-container.right .tui-image-editor-submenu .tui-image-editor-submenu-item li {\n margin-top: 15px;\n}\n.tui-image-editor-container.left .tui-image-editor-submenu .tui-image-editor-submenu-item .tui-colorpicker-clearfix li,\n.tui-image-editor-container.right .tui-image-editor-submenu .tui-image-editor-submenu-item .tui-colorpicker-clearfix li {\n margin-top: 0;\n}\n.tui-image-editor-container.left .tui-image-editor-checkbox-wrap.fixed-width,\n.tui-image-editor-container.right .tui-image-editor-checkbox-wrap.fixed-width {\n width: 182px;\n white-space: normal;\n}\n.tui-image-editor-container.left .tui-image-editor-range-wrap.tui-image-editor-newline label.range,\n.tui-image-editor-container.right .tui-image-editor-range-wrap.tui-image-editor-newline label.range {\n display: block;\n text-align: left;\n width: 75%;\n margin: auto;\n}\n.tui-image-editor-container.left .tui-image-editor-range,\n.tui-image-editor-container.right .tui-image-editor-range {\n width: 136px;\n}\n.tui-image-editor-container.right .tui-image-editor-menu > .tui-image-editor-item[tooltip-content]:before {\n left: -3px;\n top: 11px;\n border-left: 7px solid #2f2f2f;\n border-top: 7px solid transparent;\n border-bottom: 7px solid transparent;\n}\n.tui-image-editor-container.right .tui-image-editor-menu > .tui-image-editor-item[tooltip-content]:after {\n top: 7px;\n left: unset;\n right: 43px;\n white-space: nowrap;\n}\n.tui-image-editor-container.right .tui-image-editor-submenu {\n right: 0;\n height: 100%;\n width: 248px;\n}\n.tui-image-editor-container.right .tui-image-editor-main-container {\n right: 64px;\n width: calc(100% - 64px);\n height: 100%;\n}\n.tui-image-editor-container.right .tui-image-editor-controls {\n right: 0;\n width: 64px;\n height: 100%;\n display: table;\n}\n.tui-image-editor-container.top .tui-image-editor-submenu .tui-image-editor-partition.only-left-right,\n.tui-image-editor-container.bottom .tui-image-editor-submenu .tui-image-editor-partition.only-left-right {\n display: none;\n}\n.tui-image-editor-container.bottom .tui-image-editor-submenu > div {\n padding-bottom: 24px;\n}\n.tui-image-editor-container.top .color-picker-control .triangle {\n top: -8px;\n border-right: 7px solid transparent;\n border-top: 0px;\n border-left: 7px solid transparent;\n border-bottom: 8px solid #fff;\n}\n.tui-image-editor-container.top .tui-image-editor-size-wrap {\n height: 100%;\n}\n.tui-image-editor-container.top .tui-image-editor-main-container {\n bottom: 0;\n}\n.tui-image-editor-container.top .tui-image-editor-menu > .tui-image-editor-item[tooltip-content]:before {\n left: 13px;\n border-top: 0;\n border-bottom: 7px solid #2f2f2f;\n top: 33px;\n}\n.tui-image-editor-container.top .tui-image-editor-menu > .tui-image-editor-item[tooltip-content]:after {\n top: 38px;\n}\n.tui-image-editor-container.top .tui-image-editor-submenu {\n top: 0;\n bottom: auto;\n}\n.tui-image-editor-container.top .tui-image-editor-submenu > div {\n padding-top: 24px;\n vertical-align: top;\n}\n.tui-image-editor-container.top .tui-image-editor-controls-logo {\n display: table-cell;\n}\n.tui-image-editor-container.top .tui-image-editor-controls-buttons {\n display: table-cell;\n}\n.tui-image-editor-container.top .tui-image-editor-main {\n top: 64px;\n height: calc(100% - 64px);\n}\n.tui-image-editor-container.top .tui-image-editor-controls {\n top: 0;\n bottom: inherit;\n}\n.tui-image-editor-container .tui-image-editor-help-menu.top {\n white-space: nowrap;\n width: 506px;\n height: 40px;\n top: 8px;\n left: 50%;\n transform: translateX(-50%);\n}\n.tui-image-editor-container .tui-image-editor-help-menu.top .tie-panel-history {\n top: 45px;\n}\n.tui-image-editor-container .tui-image-editor-help-menu.top .opened .tie-panel-history:before {\n border-right: 8px solid transparent;\n border-left: 8px solid transparent;\n border-bottom: 8px solid #fff;\n left: 90px;\n top: -8px;\n}\n.tui-image-editor-container .tui-image-editor-help-menu.top > .tui-image-editor-item[tooltip-content]:before {\n left: 13px;\n top: 35px;\n border: none;\n border-bottom: 7px solid #2f2f2f;\n border-left: 7px solid transparent;\n border-right: 7px solid transparent;\n}\n.tui-image-editor-container .tui-image-editor-help-menu.top > .tui-image-editor-item[tooltip-content]:after {\n top: 41px;\n left: -4px;\n white-space: nowrap;\n}\n.tui-image-editor-container .tui-image-editor-help-menu.top > .tui-image-editor-item[tooltip-content].opened:before,\n.tui-image-editor-container .tui-image-editor-help-menu.top > .tui-image-editor-item[tooltip-content].opened:after {\n content: none;\n}\n.tui-image-editor-container .tui-image-editor-help-menu.bottom {\n white-space: nowrap;\n width: 506px;\n height: 40px;\n bottom: 8px;\n left: 50%;\n transform: translateX(-50%);\n}\n.tui-image-editor-container .tui-image-editor-help-menu.bottom .tie-panel-history {\n bottom: 45px;\n}\n.tui-image-editor-container .tui-image-editor-help-menu.bottom .opened .tie-panel-history:before {\n border-right: 8px solid transparent;\n border-left: 8px solid transparent;\n border-top: 8px solid #fff;\n left: 90px;\n bottom: -8px;\n}\n.tui-image-editor-container .tui-image-editor-help-menu.bottom > .tui-image-editor-item[tooltip-content]:before {\n left: 13px;\n top: auto;\n bottom: 36px;\n border: none;\n border-top: 7px solid #2f2f2f;\n border-left: 7px solid transparent;\n border-right: 7px solid transparent;\n}\n.tui-image-editor-container .tui-image-editor-help-menu.bottom > .tui-image-editor-item[tooltip-content]:after {\n top: auto;\n left: -4px;\n bottom: 41px;\n white-space: nowrap;\n}\n.tui-image-editor-container .tui-image-editor-help-menu.bottom > .tui-image-editor-item[tooltip-content].opened:before,\n.tui-image-editor-container .tui-image-editor-help-menu.bottom > .tui-image-editor-item[tooltip-content].opened:after {\n content: none;\n}\n.tui-image-editor-container .tui-image-editor-help-menu.left {\n white-space: inherit;\n width: 40px;\n height: 506px;\n left: 8px;\n top: 50%;\n transform: translateY(-50%);\n}\n.tui-image-editor-container .tui-image-editor-help-menu.left .tie-panel-history {\n left: 140px;\n top: -4px;\n}\n.tui-image-editor-container .tui-image-editor-help-menu.left .opened .tie-panel-history:before {\n border-top: 8px solid transparent;\n border-bottom: 8px solid transparent;\n border-right: 8px solid #fff;\n left: -8px;\n top: 14px;\n}\n.tui-image-editor-container .tui-image-editor-help-menu.left .tui-image-editor-item {\n margin: 4px auto;\n padding: 6px 8px;\n}\n.tui-image-editor-container .tui-image-editor-help-menu.left > .tui-image-editor-item[tooltip-content]:before {\n left: 27px;\n top: 11px;\n border: none;\n border-right: 7px solid #2f2f2f;\n border-top: 7px solid transparent;\n border-bottom: 7px solid transparent;\n}\n.tui-image-editor-container .tui-image-editor-help-menu.left > .tui-image-editor-item[tooltip-content]:after {\n top: 7px;\n left: 40px;\n white-space: nowrap;\n}\n.tui-image-editor-container .tui-image-editor-help-menu.left > .tui-image-editor-item[tooltip-content].opened:before,\n.tui-image-editor-container .tui-image-editor-help-menu.left > .tui-image-editor-item[tooltip-content].opened:after {\n content: none;\n}\n.tui-image-editor-container .tui-image-editor-help-menu.right {\n white-space: inherit;\n width: 40px;\n height: 506px;\n right: 8px;\n top: 50%;\n transform: translateY(-50%);\n}\n.tui-image-editor-container .tui-image-editor-help-menu.right .tie-panel-history {\n right: -30px;\n top: -4px;\n}\n.tui-image-editor-container .tui-image-editor-help-menu.right .opened .tie-panel-history:before {\n border-top: 8px solid transparent;\n border-bottom: 8px solid transparent;\n border-left: 8px solid #fff;\n right: -8px;\n top: 14px;\n}\n.tui-image-editor-container .tui-image-editor-help-menu.right .tui-image-editor-item {\n margin: 4px auto;\n padding: 6px 8px;\n}\n.tui-image-editor-container .tui-image-editor-help-menu.right > .tui-image-editor-item[tooltip-content]:before {\n left: -6px;\n top: 11px;\n border: none;\n border-left: 7px solid #2f2f2f;\n border-top: 7px solid transparent;\n border-bottom: 7px solid transparent;\n}\n.tui-image-editor-container .tui-image-editor-help-menu.right > .tui-image-editor-item[tooltip-content]:after {\n top: 7px;\n left: auto;\n right: 39px;\n white-space: nowrap;\n}\n.tui-image-editor-container .tui-image-editor-help-menu.right > .tui-image-editor-item[tooltip-content].opened:before,\n.tui-image-editor-container .tui-image-editor-help-menu.right > .tui-image-editor-item[tooltip-content].opened:after {\n content: none;\n}\n.tui-image-editor-container .tie-icon-add-button .tui-image-editor-button {\n min-width: 42px;\n}\n.tui-image-editor-container .svg_ic-menu,\n.tui-image-editor-container .svg_ic-helpmenu {\n width: 24px;\n height: 24px;\n}\n.tui-image-editor-container .svg_ic-submenu {\n width: 32px;\n height: 32px;\n}\n.tui-image-editor-container .svg_img-bi {\n width: 257px;\n height: 26px;\n}\n.tui-image-editor-container .tui-image-editor-help-menu svg > use,\n.tui-image-editor-container .tui-image-editor-controls svg > use {\n display: none;\n}\n.tui-image-editor-container .tui-image-editor-help-menu .enabled svg:hover > use.hover,\n.tui-image-editor-container .tui-image-editor-controls .enabled svg:hover > use.hover,\n.tui-image-editor-container .tui-image-editor-help-menu .normal svg:hover > use.hover,\n.tui-image-editor-container .tui-image-editor-controls .normal svg:hover > use.hover {\n display: block;\n}\n.tui-image-editor-container .tui-image-editor-help-menu .active svg:hover > use.hover,\n.tui-image-editor-container .tui-image-editor-controls .active svg:hover > use.hover {\n display: none;\n}\n.tui-image-editor-container .tui-image-editor-help-menu .on svg > use.hover,\n.tui-image-editor-container .tui-image-editor-controls .on svg > use.hover,\n.tui-image-editor-container .tui-image-editor-help-menu .opened svg > use.hover,\n.tui-image-editor-container .tui-image-editor-controls .opened svg > use.hover {\n display: block;\n}\n.tui-image-editor-container .tui-image-editor-help-menu svg > use.normal,\n.tui-image-editor-container .tui-image-editor-controls svg > use.normal {\n display: block;\n}\n.tui-image-editor-container .tui-image-editor-help-menu .active svg > use.active,\n.tui-image-editor-container .tui-image-editor-controls .active svg > use.active {\n display: block;\n}\n.tui-image-editor-container .tui-image-editor-help-menu .enabled svg > use.enabled,\n.tui-image-editor-container .tui-image-editor-controls .enabled svg > use.enabled {\n display: block;\n}\n.tui-image-editor-container .tui-image-editor-help-menu .active svg > use.normal,\n.tui-image-editor-container .tui-image-editor-controls .active svg > use.normal,\n.tui-image-editor-container .tui-image-editor-help-menu .enabled svg > use.normal,\n.tui-image-editor-container .tui-image-editor-controls .enabled svg > use.normal {\n display: none;\n}\n.tui-image-editor-container .tui-image-editor-help-menu .help svg > use.disabled,\n.tui-image-editor-container .tui-image-editor-controls .help svg > use.disabled,\n.tui-image-editor-container .tui-image-editor-help-menu .help.enabled svg > use.normal,\n.tui-image-editor-container .tui-image-editor-controls .help.enabled svg > use.normal {\n display: block;\n}\n.tui-image-editor-container .tui-image-editor-help-menu .help.enabled svg > use.disabled,\n.tui-image-editor-container .tui-image-editor-controls .help.enabled svg > use.disabled {\n display: none;\n}\n.tui-image-editor-container .tui-image-editor-controls:hover {\n z-index: 3;\n}\n.tui-image-editor-container div.tui-colorpicker-clearfix {\n width: 159px;\n height: 28px;\n border: 1px solid #d5d5d5;\n border-radius: 2px;\n background-color: #f5f5f5;\n margin-top: 6px;\n padding: 4px 7px 4px 7px;\n}\n.tui-image-editor-container .tui-colorpicker-palette-hex {\n width: 114px;\n background-color: #f5f5f5;\n border: 0;\n font-size: 11px;\n margin-top: 2px;\n font-family: 'Noto Sans', sans-serif;\n}\n.tui-image-editor-container .tui-colorpicker-palette-hex[value='#ffffff'] + .tui-colorpicker-palette-preview,\n.tui-image-editor-container .tui-colorpicker-palette-hex[value=''] + .tui-colorpicker-palette-preview {\n border: 1px solid #ccc;\n}\n.tui-image-editor-container .tui-colorpicker-palette-hex[value=''] + .tui-colorpicker-palette-preview {\n background-size: cover;\n background-image: url(\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAAAXNSR0IArs4c6QAAAdBJREFUWAnFl0FuwjAQRZ0ukiugHqFSOQNdseuKW3ALzkA4BateICvUGyCxrtRFd4WuunH/TzykaYJrnLEYaTJJsP2+x8GZZCbQrLU5mj7Bn+EP8HvnCObd+R7xBV5lWfaNON4AnsA38E94qLEt+0yiFaBzAV/Bv+Cxxr4co7hKCDpw1q9wLeNYYdlAwyn8TYt8Hme3+8D5ozcTaMCZ68PXa2tnM2sbEcOZAJhrrpl2DAcTOGNjZPSfCdzkw6JrfbiMv+osBe4y9WOedhm4jZfhbENWuxS44H9Wz/xw4WzqLOAqh1+zycgAwzEMzr5k5gaHOa9ULBwuuDkFlHI1Kl4PJ66kgIpnoywOTmRFAYcbwYk9UMApWkD8zAV5ihcwHk4Rx7gl0IFTQL0EFc+CTQ9OZHWH3YhlVJiVpTHbrTGLhTHLZVgff6s9lyBsI9KduSS83oj+34rTwJutmBmCnMsvozRwZqB5GTkBw6/jdPDu69iJ6BYk6eCcfbcgcQIK/MByaaiMqm8rHcjol2TnpWDhyAKSGdA3FrxtJUToX0ODqatetfGE+8tyEUOV8GY5dGRwLP/MBS4RHQr4bT7NRAQjlcOTfZxmv2G+c4hI8nn+Ax5PG/zhI393AAAAAElFTkSuQmCC\");\n}\n.tui-image-editor-container .tui-colorpicker-palette-preview {\n border-radius: 100%;\n float: left;\n width: 17px;\n height: 17px;\n border: 0;\n}\n.tui-image-editor-container .color-picker-control {\n position: absolute;\n display: none;\n z-index: 99;\n width: 192px;\n background-color: #fff;\n box-shadow: 0 3px 22px 6px rgba(0,0,0,0.15);\n padding: 16px;\n border-radius: 2px;\n}\n.tui-image-editor-container .color-picker-control .tui-colorpicker-palette-toggle-slider {\n display: none;\n}\n.tui-image-editor-container .color-picker-control .tui-colorpicker-palette-button {\n border: 0;\n border-radius: 100%;\n margin: 2px;\n background-size: cover;\n font-size: 1px;\n}\n.tui-image-editor-container .color-picker-control .tui-colorpicker-palette-button[title='#ffffff'] {\n border: 1px solid #ccc;\n}\n.tui-image-editor-container .color-picker-control .tui-colorpicker-palette-button[title=''] {\n border: 1px solid #ccc;\n}\n.tui-image-editor-container .color-picker-control .triangle {\n width: 0;\n height: 0;\n border-right: 7px solid transparent;\n border-top: 8px solid #fff;\n border-left: 7px solid transparent;\n position: absolute;\n bottom: -8px;\n left: 84px;\n}\n.tui-image-editor-container .color-picker-control .tui-colorpicker-container,\n.tui-image-editor-container .color-picker-control .tui-colorpicker-palette-container ul,\n.tui-image-editor-container .color-picker-control .tui-colorpicker-palette-container {\n width: 100%;\n height: auto;\n}\n.tui-image-editor-container .filter-color-item .color-picker-control label {\n font-color: #333;\n font-weight: normal;\n margin-right: 7pxleft;\n}\n.tui-image-editor-container .filter-color-item .tui-image-editor-checkbox {\n margin-top: 0;\n}\n.tui-image-editor-container .filter-color-item .tui-image-editor-checkbox input + label:before,\n.tui-image-editor-container .filter-color-item .tui-image-editor-checkbox > label:before {\n left: -16px;\n}\n.tui-image-editor-container .color-picker {\n width: 100%;\n height: auto;\n}\n.tui-image-editor-container .color-picker-value {\n width: 32px;\n height: 32px;\n border: 0px;\n border-radius: 100%;\n margin: auto;\n margin-bottom: 1px;\n}\n.tui-image-editor-container .color-picker-value.transparent {\n border: 1px solid #cbcbcb;\n background-size: cover;\n background-image: url(\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAAAXNSR0IArs4c6QAAAdBJREFUWAnFl0FuwjAQRZ0ukiugHqFSOQNdseuKW3ALzkA4BateICvUGyCxrtRFd4WuunH/TzykaYJrnLEYaTJJsP2+x8GZZCbQrLU5mj7Bn+EP8HvnCObd+R7xBV5lWfaNON4AnsA38E94qLEt+0yiFaBzAV/Bv+Cxxr4co7hKCDpw1q9wLeNYYdlAwyn8TYt8Hme3+8D5ozcTaMCZ68PXa2tnM2sbEcOZAJhrrpl2DAcTOGNjZPSfCdzkw6JrfbiMv+osBe4y9WOedhm4jZfhbENWuxS44H9Wz/xw4WzqLOAqh1+zycgAwzEMzr5k5gaHOa9ULBwuuDkFlHI1Kl4PJ66kgIpnoywOTmRFAYcbwYk9UMApWkD8zAV5ihcwHk4Rx7gl0IFTQL0EFc+CTQ9OZHWH3YhlVJiVpTHbrTGLhTHLZVgff6s9lyBsI9KduSS83oj+34rTwJutmBmCnMsvozRwZqB5GTkBw6/jdPDu69iJ6BYk6eCcfbcgcQIK/MByaaiMqm8rHcjol2TnpWDhyAKSGdA3FrxtJUToX0ODqatetfGE+8tyEUOV8GY5dGRwLP/MBS4RHQr4bT7NRAQjlcOTfZxmv2G+c4hI8nn+Ax5PG/zhI393AAAAAElFTkSuQmCC\");\n}\n.tui-image-editor-container .color-picker-value + label {\n color: #fff;\n}\n.tui-image-editor-container .tui-image-editor-submenu svg > use {\n display: none;\n}\n.tui-image-editor-container .tui-image-editor-submenu svg > use.normal {\n display: block;\n}\n.tie-icon-add-button.icon-bubble .tui-image-editor-button[data-icontype=\"icon-bubble\"] svg > use.active,\n.tie-icon-add-button.icon-heart .tui-image-editor-button[data-icontype=\"icon-heart\"] svg > use.active,\n.tie-icon-add-button.icon-location .tui-image-editor-button[data-icontype=\"icon-location\"] svg > use.active,\n.tie-icon-add-button.icon-polygon .tui-image-editor-button[data-icontype=\"icon-polygon\"] svg > use.active,\n.tie-icon-add-button.icon-star .tui-image-editor-button[data-icontype=\"icon-star\"] svg > use.active,\n.tie-icon-add-button.icon-star-2 .tui-image-editor-button[data-icontype=\"icon-star-2\"] svg > use.active,\n.tie-icon-add-button.icon-arrow-3 .tui-image-editor-button[data-icontype=\"icon-arrow-3\"] svg > use.active,\n.tie-icon-add-button.icon-arrow-2 .tui-image-editor-button[data-icontype=\"icon-arrow-2\"] svg > use.active,\n.tie-icon-add-button.icon-arrow .tui-image-editor-button[data-icontype=\"icon-arrow\"] svg > use.active {\n display: block;\n}\n.tie-draw-line-select-button.line .tui-image-editor-button.line svg > use.normal,\n.tie-draw-line-select-button.free .tui-image-editor-button.free svg > use.normal {\n display: none;\n}\n.tie-draw-line-select-button.line .tui-image-editor-button.line svg > use.active,\n.tie-draw-line-select-button.free .tui-image-editor-button.free svg > use.active {\n display: block;\n}\n.tie-flip-button.resetFlip .tui-image-editor-button.resetFlip svg > use.normal,\n.tie-flip-button.flipX .tui-image-editor-button.flipX svg > use.normal,\n.tie-flip-button.flipY .tui-image-editor-button.flipY svg > use.normal {\n display: none;\n}\n.tie-flip-button.resetFlip .tui-image-editor-button.resetFlip svg > use.active,\n.tie-flip-button.flipX .tui-image-editor-button.flipX svg > use.active,\n.tie-flip-button.flipY .tui-image-editor-button.flipY svg > use.active {\n display: block;\n}\n.tie-mask-apply.apply.active .tui-image-editor-button.apply label {\n color: #fff;\n}\n.tie-mask-apply.apply.active .tui-image-editor-button.apply svg > use.active {\n display: block;\n}\n.tie-crop-button .tui-image-editor-button.apply,\n.tie-crop-preset-button .tui-image-editor-button.apply {\n margin-right: 24px;\n}\n.tie-crop-button .tui-image-editor-button.preset.active svg > use.active,\n.tie-crop-preset-button .tui-image-editor-button.preset.active svg > use.active {\n display: block;\n}\n.tie-crop-button .tui-image-editor-button.apply.active svg > use.active,\n.tie-crop-preset-button .tui-image-editor-button.apply.active svg > use.active {\n display: block;\n}\n.tie-shape-button.rect .tui-image-editor-button.rect svg > use.normal,\n.tie-shape-button.circle .tui-image-editor-button.circle svg > use.normal,\n.tie-shape-button.triangle .tui-image-editor-button.triangle svg > use.normal {\n display: none;\n}\n.tie-shape-button.rect .tui-image-editor-button.rect svg > use.active,\n.tie-shape-button.circle .tui-image-editor-button.circle svg > use.active,\n.tie-shape-button.triangle .tui-image-editor-button.triangle svg > use.active {\n display: block;\n}\n.tie-text-effect-button .tui-image-editor-button.active svg > use.active {\n display: block;\n}\n.tie-text-align-button.left .tui-image-editor-button.left svg > use.active,\n.tie-text-align-button.center .tui-image-editor-button.center svg > use.active,\n.tie-text-align-button.right .tui-image-editor-button.right svg > use.active {\n display: block;\n}\n.tie-mask-image-file,\n.tie-icon-image-file {\n opacity: 0;\n position: absolute;\n width: 100%;\n height: 100%;\n border: 1px solid #008000;\n cursor: inherit;\n left: 0;\n top: 0;\n}\n.tie-zoom-button.resetFlip .tui-image-editor-button.resetFlip svg > use.normal,\n.tie-zoom-button.flipX .tui-image-editor-button.flipX svg > use.normal,\n.tie-zoom-button.flipY .tui-image-editor-button.flipY svg > use.normal {\n display: none;\n}\n.tie-zoom-button.resetFlip .tui-image-editor-button.resetFlip svg > use.active,\n.tie-zoom-button.flipX .tui-image-editor-button.flipX svg > use.active,\n.tie-zoom-button.flipY .tui-image-editor-button.flipY svg > use.active {\n display: block;\n}\n.tui-image-editor-container.top.tui-image-editor-top-optimization .tui-image-editor-controls ul {\n text-align: right;\n}\n.tui-image-editor-container.top.tui-image-editor-top-optimization .tui-image-editor-controls-logo {\n display: none;\n}\n/*# sourceMappingURL=src/css/index.css.map */\n","body > textarea\n position: fixed !important;\n\n+prefix-classes(prefix)\n .-container\n margin: 0;\n padding: 0;\n box-sizing: border-box;\n min-height: 300px;\n height: 100%;\n position: relative;\n background-color: #282828;\n overflow: hidden;\n letter-spacing: 0.3px;\n \n div, ul, label, input, li\n box-sizing: border-box;\n margin: 0;\n padding: 0;\n -ms-user-select: none; \n -moz-user-select: -moz-none;\n -khtml-user-select: none;\n -webkit-user-select: none;\n user-select: none;\n \n .-header\n /* BUTTON AND LOGO */\n min-width: 533px;\n position: absolute;\n background-color: #151515;\n top: 0;\n width: 100%;\n .-header-buttons,\n .-controls-buttons\n float: right;\n margin: 8px;\n\n .-header-logo,\n .-controls-logo\n float: left;\n width: 30%;\n padding: 17px;\n\n .-controls-logo,\n .-controls-buttons\n width: 270px;\n height: 100%;\n display: none;\n\n .-header-buttons button,\n .-header-buttons div,\n .-controls-buttons button,\n .-controls-buttons div\n display: inline-block;\n position: relative;\n width: 120px;\n height: 40px;\n padding: 0;\n line-height: 40px;\n outline: none;\n border-radius: 20px;\n border: 1px solid #ddd;\n font-family: 'Noto Sans', sans-serif;\n font-size: 12px;\n font-weight: bold;\n cursor: pointer;\n vertical-align: middle;\n letter-spacing: 0.3px;\n text-align: center;\n\n .-download-btn\n background-color: #fdba3b;\n border-color: #fdba3b;\n color: #fff;\n .-load-btn\n position: absolute;\n left: 0;\n right: 0;\n display: inline-block;\n top: 0;\n bottom: 0;\n width: 100%;\n cursor: pointer;\n opacity: 0;\n .-main-container\n position: absolute;\n width: 100%;\n top: 0;\n bottom: 64px;\n .-main\n position: absolute;\n text-align: center;\n top: 64px;\n bottom: 0;\n right: 0;\n left: 0;\n .-wrap\n position: absolute;\n bottom: 0;\n width: 100%;\n overflow: auto;\n .-size-wrap\n display: table;\n width: 100%;\n height: 100%\n .-align-wrap\n display: table-cell;\n vertical-align: middle;\n .\n position: relative;\n display: inline-block;\n\n\n/* BIG MENU */\n.{prefix}-container\n .{prefix}-menu, .{prefix}-help-menu\n width: auto;\n list-style: none;\n padding: 0;\n margin: 0 auto;\n display: table-cell;\n text-align: center;\n vertical-align: middle;\n white-space: nowrap;\n > .{prefix}-item\n position: relative;\n display: inline-block;\n border-radius: 2px;\n padding: 7px 8px 3px 8px;\n cursor: pointer;\n margin: 0 4px;\n > .{prefix}-item[tooltip-content]:hover\n &:before\n content: '';\n position: absolute;\n display: inline-block;\n margin: 0 auto 0;\n width: 0;\n height: 0;\n border-right: 7px solid transparent;\n border-top: 7px solid #2f2f2f;\n border-left: 7px solid transparent;\n left: 13px;\n top: -2px;\n &:after\n content: attr(tooltip-content);\n position: absolute;\n display: inline-block;\n background-color: #2f2f2f;\n color: #fff;\n padding: 5px 8px;\n font-size: 11px;\n font-weight: lighter;\n border-radius: 3px;\n max-height: 23px;\n top: -25px;\n left: 0;\n min-width: 24px;\n > .{prefix}-item.active\n background-color: #fff;\n transition: all .3s ease;\n .{prefix}-wrap\n position: absolute;\n","body > textarea {\n position: fixed !important;\n}\n.tui-image-editor-container {\n margin: 0;\n padding: 0;\n box-sizing: border-box;\n min-height: 300px;\n height: 100%;\n position: relative;\n background-color: #282828;\n overflow: hidden;\n letter-spacing: 0.3px;\n}\n.tui-image-editor-container div,\n.tui-image-editor-container ul,\n.tui-image-editor-container label,\n.tui-image-editor-container input,\n.tui-image-editor-container li {\n box-sizing: border-box;\n margin: 0;\n padding: 0;\n -ms-user-select: none;\n -moz-user-select: -moz-none;\n -khtml-user-select: none;\n -webkit-user-select: none;\n user-select: none;\n}\n.tui-image-editor-container .tui-image-editor-header {\n/* BUTTON AND LOGO */\n min-width: 533px;\n position: absolute;\n background-color: #151515;\n top: 0;\n width: 100%;\n}\n.tui-image-editor-container .tui-image-editor-header-buttons,\n.tui-image-editor-container .tui-image-editor-controls-buttons {\n float: right;\n margin: 8px;\n}\n.tui-image-editor-container .tui-image-editor-header-logo,\n.tui-image-editor-container .tui-image-editor-controls-logo {\n float: left;\n width: 30%;\n padding: 17px;\n}\n.tui-image-editor-container .tui-image-editor-controls-logo,\n.tui-image-editor-container .tui-image-editor-controls-buttons {\n width: 270px;\n height: 100%;\n display: none;\n}\n.tui-image-editor-container .tui-image-editor-header-buttons button,\n.tui-image-editor-container .tui-image-editor-header-buttons div,\n.tui-image-editor-container .tui-image-editor-controls-buttons button,\n.tui-image-editor-container .tui-image-editor-controls-buttons div {\n display: inline-block;\n position: relative;\n width: 120px;\n height: 40px;\n padding: 0;\n line-height: 40px;\n outline: none;\n border-radius: 20px;\n border: 1px solid #ddd;\n font-family: 'Noto Sans', sans-serif;\n font-size: 12px;\n font-weight: bold;\n cursor: pointer;\n vertical-align: middle;\n letter-spacing: 0.3px;\n text-align: center;\n}\n.tui-image-editor-container .tui-image-editor-download-btn {\n background-color: #fdba3b;\n border-color: #fdba3b;\n color: #fff;\n}\n.tui-image-editor-container .tui-image-editor-load-btn {\n position: absolute;\n left: 0;\n right: 0;\n display: inline-block;\n top: 0;\n bottom: 0;\n width: 100%;\n cursor: pointer;\n opacity: 0;\n}\n.tui-image-editor-container .tui-image-editor-main-container {\n position: absolute;\n width: 100%;\n top: 0;\n bottom: 64px;\n}\n.tui-image-editor-container .tui-image-editor-main {\n position: absolute;\n text-align: center;\n top: 64px;\n bottom: 0;\n right: 0;\n left: 0;\n}\n.tui-image-editor-container .tui-image-editor-wrap {\n position: absolute;\n bottom: 0;\n width: 100%;\n overflow: auto;\n}\n.tui-image-editor-container .tui-image-editor-wrap .tui-image-editor-size-wrap {\n display: table;\n width: 100%;\n height: 100%;\n}\n.tui-image-editor-container .tui-image-editor-wrap .tui-image-editor-size-wrap .tui-image-editor-align-wrap {\n display: table-cell;\n vertical-align: middle;\n}\n.tui-image-editor-container .tui-image-editor {\n position: relative;\n display: inline-block;\n}\n.tui-image-editor-container .tui-image-editor-menu,\n.tui-image-editor-container .tui-image-editor-help-menu {\n width: auto;\n list-style: none;\n padding: 0;\n margin: 0 auto;\n display: table-cell;\n text-align: center;\n vertical-align: middle;\n white-space: nowrap;\n}\n.tui-image-editor-container .tui-image-editor-menu > .tui-image-editor-item,\n.tui-image-editor-container .tui-image-editor-help-menu > .tui-image-editor-item {\n position: relative;\n display: inline-block;\n border-radius: 2px;\n padding: 7px 8px 3px 8px;\n cursor: pointer;\n margin: 0 4px;\n}\n.tui-image-editor-container .tui-image-editor-menu > .tui-image-editor-item[tooltip-content]:hover:before,\n.tui-image-editor-container .tui-image-editor-help-menu > .tui-image-editor-item[tooltip-content]:hover:before {\n content: '';\n position: absolute;\n display: inline-block;\n margin: 0 auto 0;\n width: 0;\n height: 0;\n border-right: 7px solid transparent;\n border-top: 7px solid #2f2f2f;\n border-left: 7px solid transparent;\n left: 13px;\n top: -2px;\n}\n.tui-image-editor-container .tui-image-editor-menu > .tui-image-editor-item[tooltip-content]:hover:after,\n.tui-image-editor-container .tui-image-editor-help-menu > .tui-image-editor-item[tooltip-content]:hover:after {\n content: attr(tooltip-content);\n position: absolute;\n display: inline-block;\n background-color: #2f2f2f;\n color: #fff;\n padding: 5px 8px;\n font-size: 11px;\n font-weight: lighter;\n border-radius: 3px;\n max-height: 23px;\n top: -25px;\n left: 0;\n min-width: 24px;\n}\n.tui-image-editor-container .tui-image-editor-menu > .tui-image-editor-item.active,\n.tui-image-editor-container .tui-image-editor-help-menu > .tui-image-editor-item.active {\n background-color: #fff;\n transition: all 0.3s ease;\n}\n.tui-image-editor-container .tui-image-editor-wrap {\n position: absolute;\n}\n.tui-image-editor-container .tui-image-editor-grid-visual {\n display: none;\n position: absolute;\n width: 100%;\n height: 100%;\n border: 1px solid rgba(255,255,255,0.7);\n}\n.tui-image-editor-container .tui-image-editor-main.tui-image-editor-menu-flip .tui-image-editor,\n.tui-image-editor-container .tui-image-editor-main.tui-image-editor-menu-rotate .tui-image-editor {\n transition: none;\n}\n.tui-image-editor-container .tui-image-editor-main.tui-image-editor-menu-flip .tui-image-editor-grid-visual,\n.tui-image-editor-container .tui-image-editor-main.tui-image-editor-menu-rotate .tui-image-editor-grid-visual {\n display: block;\n}\n.tui-image-editor-container .tui-image-editor-grid-visual table {\n width: 100%;\n height: 100%;\n border-collapse: collapse;\n}\n.tui-image-editor-container .tui-image-editor-grid-visual table td {\n border: 1px solid rgba(255,255,255,0.3);\n}\n.tui-image-editor-container .tui-image-editor-grid-visual table td.dot:before {\n content: '';\n position: absolute;\n box-sizing: border-box;\n width: 10px;\n height: 10px;\n border: 0;\n box-shadow: 0 0 1px 0 rgba(0,0,0,0.3);\n border-radius: 100%;\n background-color: #fff;\n}\n.tui-image-editor-container .tui-image-editor-grid-visual table td.dot.left-top:before {\n top: -5px;\n left: -5px;\n}\n.tui-image-editor-container .tui-image-editor-grid-visual table td.dot.right-top:before {\n top: -5px;\n right: -5px;\n}\n.tui-image-editor-container .tui-image-editor-grid-visual table td.dot.left-bottom:before {\n bottom: -5px;\n left: -5px;\n}\n.tui-image-editor-container .tui-image-editor-grid-visual table td.dot.right-bottom:before {\n bottom: -5px;\n right: -5px;\n}\n.tui-image-editor-container .tui-image-editor-submenu {\n display: none;\n position: absolute;\n bottom: 0;\n width: 100%;\n height: 150px;\n white-space: nowrap;\n z-index: 2;\n}\n.tui-image-editor-container .tui-image-editor-submenu .tui-image-editor-button:hover svg > use.active {\n display: block;\n}\n.tui-image-editor-container .tui-image-editor-submenu .tui-image-editor-submenu-item li {\n display: inline-block;\n vertical-align: top;\n}\n.tui-image-editor-container .tui-image-editor-submenu .tui-image-editor-submenu-item .tui-image-editor-newline {\n display: block;\n margin-top: 0;\n}\n.tui-image-editor-container .tui-image-editor-submenu .tui-image-editor-submenu-item .tui-image-editor-button {\n position: relative;\n cursor: pointer;\n display: inline-block;\n font-weight: normal;\n font-size: 11px;\n margin: 0 9px 0 9px;\n}\n.tui-image-editor-container .tui-image-editor-submenu .tui-image-editor-submenu-item .tui-image-editor-button.preset {\n margin: 0 9px 20px 5px;\n}\n.tui-image-editor-container .tui-image-editor-submenu .tui-image-editor-submenu-item label > span {\n display: inline-block;\n cursor: pointer;\n padding-top: 5px;\n font-family: \"Noto Sans\", sans-serif;\n font-size: 11px;\n}\n.tui-image-editor-container .tui-image-editor-submenu .tui-image-editor-submenu-item .tui-image-editor-button.apply label,\n.tui-image-editor-container .tui-image-editor-submenu .tui-image-editor-submenu-item .tui-image-editor-button.cancel label {\n vertical-align: 7px;\n}\n.tui-image-editor-container .tui-image-editor-submenu > div {\n display: none;\n vertical-align: bottom;\n}\n.tui-image-editor-container .tui-image-editor-submenu .tui-image-editor-submenu-style {\n opacity: 0.95;\n z-index: -1;\n position: absolute;\n top: 0;\n bottom: 0;\n left: 0;\n right: 0;\n display: block;\n}\n.tui-image-editor-container .tui-image-editor-partition > div {\n width: 1px;\n height: 52px;\n border-left: 1px solid #3c3c3c;\n margin: 0 8px 0 8px;\n}\n.tui-image-editor-container .tui-image-editor-main.tui-image-editor-menu-filter .tui-image-editor-partition > div {\n height: 108px;\n margin: 0 29px 0 0px;\n}\n.tui-image-editor-container .tui-image-editor-submenu-align {\n text-align: left;\n margin-right: 30px;\n}\n.tui-image-editor-container .tui-image-editor-submenu-align label > span {\n width: 55px;\n white-space: nowrap;\n}\n.tui-image-editor-container .tui-image-editor-submenu-align:first-child {\n margin-right: 0;\n}\n.tui-image-editor-container .tui-image-editor-submenu-align:first-child label > span {\n width: 70px;\n}\n.tui-image-editor-container .tui-image-editor-main.tui-image-editor-menu-crop .tui-image-editor-submenu > div.tui-image-editor-menu-crop,\n.tui-image-editor-container .tui-image-editor-main.tui-image-editor-menu-flip .tui-image-editor-submenu > div.tui-image-editor-menu-flip,\n.tui-image-editor-container .tui-image-editor-main.tui-image-editor-menu-rotate .tui-image-editor-submenu > div.tui-image-editor-menu-rotate,\n.tui-image-editor-container .tui-image-editor-main.tui-image-editor-menu-shape .tui-image-editor-submenu > div.tui-image-editor-menu-shape,\n.tui-image-editor-container .tui-image-editor-main.tui-image-editor-menu-text .tui-image-editor-submenu > div.tui-image-editor-menu-text,\n.tui-image-editor-container .tui-image-editor-main.tui-image-editor-menu-mask .tui-image-editor-submenu > div.tui-image-editor-menu-mask,\n.tui-image-editor-container .tui-image-editor-main.tui-image-editor-menu-icon .tui-image-editor-submenu > div.tui-image-editor-menu-icon,\n.tui-image-editor-container .tui-image-editor-main.tui-image-editor-menu-draw .tui-image-editor-submenu > div.tui-image-editor-menu-draw,\n.tui-image-editor-container .tui-image-editor-main.tui-image-editor-menu-filter .tui-image-editor-submenu > div.tui-image-editor-menu-filter,\n.tui-image-editor-container .tui-image-editor-main.tui-image-editor-menu-zoom .tui-image-editor-submenu > div.tui-image-editor-menu-zoom {\n display: table-cell;\n}\n.tui-image-editor-container .tui-image-editor-main.tui-image-editor-menu-crop .tui-image-editor-submenu,\n.tui-image-editor-container .tui-image-editor-main.tui-image-editor-menu-flip .tui-image-editor-submenu,\n.tui-image-editor-container .tui-image-editor-main.tui-image-editor-menu-rotate .tui-image-editor-submenu,\n.tui-image-editor-container .tui-image-editor-main.tui-image-editor-menu-shape .tui-image-editor-submenu,\n.tui-image-editor-container .tui-image-editor-main.tui-image-editor-menu-text .tui-image-editor-submenu,\n.tui-image-editor-container .tui-image-editor-main.tui-image-editor-menu-mask .tui-image-editor-submenu,\n.tui-image-editor-container .tui-image-editor-main.tui-image-editor-menu-icon .tui-image-editor-submenu,\n.tui-image-editor-container .tui-image-editor-main.tui-image-editor-menu-draw .tui-image-editor-submenu,\n.tui-image-editor-container .tui-image-editor-main.tui-image-editor-menu-filter .tui-image-editor-submenu,\n.tui-image-editor-container .tui-image-editor-main.tui-image-editor-menu-zoom .tui-image-editor-submenu {\n display: table;\n}\n.tui-image-editor-container .tui-image-editor-help-menu {\n list-style: none;\n padding: 0;\n margin: 0 auto;\n text-align: center;\n vertical-align: middle;\n border-radius: 20px;\n background-color: rgba(255,255,255,0.06);\n z-index: 2;\n position: absolute;\n}\n.tui-image-editor-container .tui-image-editor-help-menu .tie-panel-history {\n display: none;\n background-color: #fff;\n color: #444;\n position: absolute;\n width: 196px;\n height: 276px;\n padding: 4px 2px;\n box-shadow: 0 2px 6px 0 rgba(0,0,0,0.15);\n cursor: auto;\n transform: translateX(calc(-50% + 12px));\n}\n.tui-image-editor-container .tui-image-editor-help-menu .tie-panel-history .history-list {\n height: 268px;\n padding: 0;\n overflow: hidden scroll;\n list-style: none;\n}\n.tui-image-editor-container .tui-image-editor-help-menu .tie-panel-history .history-list .history-item {\n height: 24px;\n font-size: 11px;\n line-height: 24px;\n}\n.tui-image-editor-container .tui-image-editor-help-menu .tie-panel-history .history-list .history-item .tui-image-editor-history-item {\n position: relative;\n height: 24px;\n cursor: pointer;\n}\n.tui-image-editor-container .tui-image-editor-help-menu .tie-panel-history .history-list .history-item .tui-image-editor-history-item svg {\n width: 24px;\n height: 24px;\n}\n.tui-image-editor-container .tui-image-editor-help-menu .tie-panel-history .history-list .history-item .tui-image-editor-history-item span {\n display: inline-block;\n width: 128px;\n height: 24px;\n text-align: left;\n}\n.tui-image-editor-container .tui-image-editor-help-menu .tie-panel-history .history-list .history-item .tui-image-editor-history-item .history-item-icon {\n display: inline-block;\n width: 24px;\n height: 24px;\n position: absolute;\n top: 6px;\n left: 6px;\n}\n.tui-image-editor-container .tui-image-editor-help-menu .tie-panel-history .history-list .history-item .tui-image-editor-history-item .history-item-checkbox {\n display: none;\n width: 24px;\n height: 24px;\n position: absolute;\n top: 5px;\n right: -6px;\n}\n.tui-image-editor-container .tui-image-editor-help-menu .tie-panel-history .history-list .history-item.selected-item {\n background-color: rgba(119,119,119,0.12);\n}\n.tui-image-editor-container .tui-image-editor-help-menu .tie-panel-history .history-list .history-item.selected-item .history-item-checkbox {\n display: inline-block;\n}\n.tui-image-editor-container .tui-image-editor-help-menu .tie-panel-history .history-list .history-item.disabled-item {\n color: #333;\n opacity: 0.3;\n}\n.tui-image-editor-container .tui-image-editor-help-menu .opened .tie-panel-history {\n display: block;\n}\n.tui-image-editor-container .tui-image-editor-help-menu .opened .tie-panel-history:before {\n content: '';\n position: absolute;\n display: inline-block;\n margin: 0 auto;\n width: 0;\n height: 0;\n}\n.tui-image-editor-container .filter-color-item {\n display: inline-block;\n}\n.tui-image-editor-container .filter-color-item .tui-image-editor-checkbox {\n display: block;\n}\n.tui-image-editor-container .tui-image-editor-checkbox-wrap {\n display: inline-block !important;\n text-align: left;\n}\n.tui-image-editor-container .tui-image-editor-checkbox-wrap.fixed-width {\n width: 187px;\n white-space: normal;\n}\n.tui-image-editor-container .tui-image-editor-checkbox {\n display: inline-block;\n margin: 1px 0 1px 0;\n}\n.tui-image-editor-container .tui-image-editor-checkbox input {\n width: 14px;\n height: 14px;\n opacity: 0;\n}\n.tui-image-editor-container .tui-image-editor-checkbox > label > span {\n color: #fff;\n height: 14px;\n position: relative;\n}\n.tui-image-editor-container .tui-image-editor-checkbox input + label:before,\n.tui-image-editor-container .tui-image-editor-checkbox > label > span:before {\n content: '';\n position: absolute;\n width: 14px;\n height: 14px;\n background-color: #fff;\n top: 6px;\n left: -19px;\n display: inline-block;\n margin: 0;\n text-align: center;\n font-size: 11px;\n border: 0;\n border-radius: 2px;\n padding-top: 1px;\n box-sizing: border-box;\n}\n.tui-image-editor-container .tui-image-editor-checkbox input[type='checkbox']:checked + span:before {\n background-size: cover;\n background-image: url(\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAA4AAAAOCAYAAAAfSC3RAAAAAXNSR0IArs4c6QAAAMBJREFUKBWVkjEOwjAMRe2WgZW7IIHEDdhghhuwcQ42rlJugAQS54Cxa5cq1QM5TUpByZfS2j9+dlJVt/tX5ZxbS4ZU9VLkQvSHKTIGRaVJYFmKrBbTCJxE2UgCdDzMZDkHrOV6b95V0US6UmgKodujEZbJg0B0ZgEModO5lrY1TMQf1TpyJGBEjD+E2NPN7ukIUDiF/BfEXgRiGEw8NgkffYGYwCi808fpn/6OvfUfsDr/Vc1IfRf8sKnFVqeiVQfDu0tf/nWH9gAAAABJRU5ErkJggg==\");\n}\n.tui-image-editor-container .tui-image-editor-selectlist-wrap {\n position: relative;\n}\n.tui-image-editor-container .tui-image-editor-selectlist-wrap select {\n width: 100%;\n height: 28px;\n margin-top: 4px;\n border: 0;\n outline: 0;\n border-radius: 0;\n border: 1px solid #cbdbdb;\n background-color: #fff;\n -webkit-appearance: none;\n -moz-appearance: none;\n appearance: none;\n padding: 0 7px 0 10px;\n}\n.tui-image-editor-container .tui-image-editor-selectlist-wrap .tui-image-editor-selectlist {\n display: none;\n position: relative;\n top: -1px;\n border: 1px solid #ccc;\n background-color: #fff;\n border-top: 0px;\n padding: 4px 0;\n}\n.tui-image-editor-container .tui-image-editor-selectlist-wrap .tui-image-editor-selectlist li {\n display: block;\n text-align: left;\n padding: 7px 10px;\n font-family: 'Noto Sans', sans-serif;\n}\n.tui-image-editor-container .tui-image-editor-selectlist-wrap .tui-image-editor-selectlist li:hover {\n background-color: rgba(81,92,230,0.05);\n}\n.tui-image-editor-container .tui-image-editor-selectlist-wrap:before {\n content: '';\n position: absolute;\n display: inline-block;\n width: 14px;\n height: 14px;\n right: 5px;\n top: 10px;\n background-image: url(\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAA4AAAAOCAYAAAAfSC3RAAAAAXNSR0IArs4c6QAAAHlJREFUKBVjYBgFOEOAEVkmPDxc89+/f6eAYjzI4kD2FyYmJrOVK1deh4kzwRggGiQBVJCELAZig8SQNYHEmEEEMrh69eo1HR0dfqCYJUickZGxf9WqVf3IakBsFBthklpaWmVA9mEQhrJhUoTp0NBQCRAmrHL4qgAAuu4cWZOZIGsAAAAASUVORK5CYII=\");\n background-size: cover;\n}\n.tui-image-editor-container .tui-image-editor-selectlist-wrap select::-ms-expand {\n display: none;\n}\n.tui-image-editor-container .tui-image-editor-virtual-range-bar .tui-image-editor-disabled,\n.tui-image-editor-container .tui-image-editor-virtual-range-subbar .tui-image-editor-disabled,\n.tui-image-editor-container .tui-image-editor-virtual-range-pointer .tui-image-editor-disabled {\n backbround-color: #f00;\n}\n.tui-image-editor-container .tui-image-editor-range {\n position: relative;\n top: 5px;\n width: 166px;\n height: 17px;\n display: inline-block;\n}\n.tui-image-editor-container .tui-image-editor-virtual-range-bar {\n top: 7px;\n position: absolute;\n width: 100%;\n height: 2px;\n background-color: #666;\n}\n.tui-image-editor-container .tui-image-editor-virtual-range-subbar {\n position: absolute;\n height: 100%;\n left: 0;\n right: 0;\n background-color: #d1d1d1;\n}\n.tui-image-editor-container .tui-image-editor-virtual-range-pointer {\n position: absolute;\n cursor: pointer;\n top: -5px;\n left: 0;\n width: 12px;\n height: 12px;\n background-color: #fff;\n border-radius: 100%;\n}\n.tui-image-editor-container .tui-image-editor-range-wrap {\n display: inline-block;\n margin-left: 4px;\n}\n.tui-image-editor-container .tui-image-editor-range-wrap.short .tui-image-editor-range {\n width: 100px;\n}\n.tui-image-editor-container .color-picker-control .tui-image-editor-range {\n width: 108px;\n margin-left: 10px;\n}\n.tui-image-editor-container .color-picker-control .tui-image-editor-virtual-range-pointer {\n background-color: #333;\n}\n.tui-image-editor-container .color-picker-control .tui-image-editor-virtual-range-bar {\n background-color: #ccc;\n}\n.tui-image-editor-container .color-picker-control .tui-image-editor-virtual-range-subbar {\n background-color: #606060;\n}\n.tui-image-editor-container .tui-image-editor-range-wrap.tui-image-editor-newline.short {\n margin-top: -2px;\n margin-left: 19px;\n}\n.tui-image-editor-container .tui-image-editor-range-wrap.tui-image-editor-newline.short label {\n color: #8e8e8e;\n font-weight: normal;\n}\n.tui-image-editor-container .tui-image-editor-range-wrap label {\n vertical-align: baseline;\n font-size: 11px;\n margin-right: 7px;\n color: #fff;\n}\n.tui-image-editor-container .tui-image-editor-range-value {\n cursor: default;\n width: 40px;\n height: 24px;\n outline: none;\n border-radius: 2px;\n box-shadow: none;\n border: 1px solid #d5d5d5;\n text-align: center;\n background-color: #1c1c1c;\n color: #fff;\n font-weight: lighter;\n vertical-align: baseline;\n font-family: 'Noto Sans', sans-serif;\n margin-top: 21px;\n margin-left: 4px;\n}\n.tui-image-editor-container .tui-image-editor-controls {\n position: absolute;\n background-color: #151515;\n width: 100%;\n height: 64px;\n display: table;\n bottom: 0;\n z-index: 2;\n}\n.tui-image-editor-container .tui-image-editor-icpartition {\n display: inline-block;\n background-color: #444;\n width: 1px;\n height: 24px;\n}\n.tui-image-editor-container.left .tui-image-editor-menu > .tui-image-editor-item[tooltip-content]:before {\n left: 28px;\n top: 11px;\n border-right: 7px solid #2f2f2f;\n border-top: 7px solid transparent;\n border-bottom: 7px solid transparent;\n}\n.tui-image-editor-container.left .tui-image-editor-menu > .tui-image-editor-item[tooltip-content]:after {\n top: 7px;\n left: 42px;\n white-space: nowrap;\n}\n.tui-image-editor-container.left .tui-image-editor-submenu {\n left: 0;\n height: 100%;\n width: 248px;\n}\n.tui-image-editor-container.left .tui-image-editor-main-container {\n left: 64px;\n width: calc(100% - 64px);\n height: 100%;\n}\n.tui-image-editor-container.left .tui-image-editor-controls {\n width: 64px;\n height: 100%;\n display: table;\n}\n.tui-image-editor-container.left .tui-image-editor-menu,\n.tui-image-editor-container.right .tui-image-editor-menu {\n white-space: inherit;\n}\n.tui-image-editor-container.left .tui-image-editor-submenu,\n.tui-image-editor-container.right .tui-image-editor-submenu {\n white-space: normal;\n}\n.tui-image-editor-container.left .tui-image-editor-submenu > div,\n.tui-image-editor-container.right .tui-image-editor-submenu > div {\n vertical-align: middle;\n}\n.tui-image-editor-container.left .tui-image-editor-controls li,\n.tui-image-editor-container.right .tui-image-editor-controls li {\n display: inline-block;\n margin: 4px auto;\n}\n.tui-image-editor-container.left .tui-image-editor-icpartition,\n.tui-image-editor-container.right .tui-image-editor-icpartition {\n position: relative;\n top: -7px;\n width: 24px;\n height: 1px;\n}\n.tui-image-editor-container.left .tui-image-editor-submenu .tui-image-editor-partition,\n.tui-image-editor-container.right .tui-image-editor-submenu .tui-image-editor-partition {\n display: block;\n width: 75%;\n margin: auto;\n}\n.tui-image-editor-container.left .tui-image-editor-submenu .tui-image-editor-partition > div,\n.tui-image-editor-container.right .tui-image-editor-submenu .tui-image-editor-partition > div {\n border-left: 0;\n height: 10px;\n border-bottom: 1px solid #3c3c3c;\n width: 100%;\n margin: 0;\n}\n.tui-image-editor-container.left .tui-image-editor-submenu .tui-image-editor-submenu-align,\n.tui-image-editor-container.right .tui-image-editor-submenu .tui-image-editor-submenu-align {\n margin-right: 0;\n}\n.tui-image-editor-container.left .tui-image-editor-submenu .tui-image-editor-submenu-item li,\n.tui-image-editor-container.right .tui-image-editor-submenu .tui-image-editor-submenu-item li {\n margin-top: 15px;\n}\n.tui-image-editor-container.left .tui-image-editor-submenu .tui-image-editor-submenu-item .tui-colorpicker-clearfix li,\n.tui-image-editor-container.right .tui-image-editor-submenu .tui-image-editor-submenu-item .tui-colorpicker-clearfix li {\n margin-top: 0;\n}\n.tui-image-editor-container.left .tui-image-editor-checkbox-wrap.fixed-width,\n.tui-image-editor-container.right .tui-image-editor-checkbox-wrap.fixed-width {\n width: 182px;\n white-space: normal;\n}\n.tui-image-editor-container.left .tui-image-editor-range-wrap.tui-image-editor-newline label.range,\n.tui-image-editor-container.right .tui-image-editor-range-wrap.tui-image-editor-newline label.range {\n display: block;\n text-align: left;\n width: 75%;\n margin: auto;\n}\n.tui-image-editor-container.left .tui-image-editor-range,\n.tui-image-editor-container.right .tui-image-editor-range {\n width: 136px;\n}\n.tui-image-editor-container.right .tui-image-editor-menu > .tui-image-editor-item[tooltip-content]:before {\n left: -3px;\n top: 11px;\n border-left: 7px solid #2f2f2f;\n border-top: 7px solid transparent;\n border-bottom: 7px solid transparent;\n}\n.tui-image-editor-container.right .tui-image-editor-menu > .tui-image-editor-item[tooltip-content]:after {\n top: 7px;\n left: unset;\n right: 43px;\n white-space: nowrap;\n}\n.tui-image-editor-container.right .tui-image-editor-submenu {\n right: 0;\n height: 100%;\n width: 248px;\n}\n.tui-image-editor-container.right .tui-image-editor-main-container {\n right: 64px;\n width: calc(100% - 64px);\n height: 100%;\n}\n.tui-image-editor-container.right .tui-image-editor-controls {\n right: 0;\n width: 64px;\n height: 100%;\n display: table;\n}\n.tui-image-editor-container.top .tui-image-editor-submenu .tui-image-editor-partition.only-left-right,\n.tui-image-editor-container.bottom .tui-image-editor-submenu .tui-image-editor-partition.only-left-right {\n display: none;\n}\n.tui-image-editor-container.bottom .tui-image-editor-submenu > div {\n padding-bottom: 24px;\n}\n.tui-image-editor-container.top .color-picker-control .triangle {\n top: -8px;\n border-right: 7px solid transparent;\n border-top: 0px;\n border-left: 7px solid transparent;\n border-bottom: 8px solid #fff;\n}\n.tui-image-editor-container.top .tui-image-editor-size-wrap {\n height: 100%;\n}\n.tui-image-editor-container.top .tui-image-editor-main-container {\n bottom: 0;\n}\n.tui-image-editor-container.top .tui-image-editor-menu > .tui-image-editor-item[tooltip-content]:before {\n left: 13px;\n border-top: 0;\n border-bottom: 7px solid #2f2f2f;\n top: 33px;\n}\n.tui-image-editor-container.top .tui-image-editor-menu > .tui-image-editor-item[tooltip-content]:after {\n top: 38px;\n}\n.tui-image-editor-container.top .tui-image-editor-submenu {\n top: 0;\n bottom: auto;\n}\n.tui-image-editor-container.top .tui-image-editor-submenu > div {\n padding-top: 24px;\n vertical-align: top;\n}\n.tui-image-editor-container.top .tui-image-editor-controls-logo {\n display: table-cell;\n}\n.tui-image-editor-container.top .tui-image-editor-controls-buttons {\n display: table-cell;\n}\n.tui-image-editor-container.top .tui-image-editor-main {\n top: 64px;\n height: calc(100% - 64px);\n}\n.tui-image-editor-container.top .tui-image-editor-controls {\n top: 0;\n bottom: inherit;\n}\n.tui-image-editor-container .tui-image-editor-help-menu.top {\n white-space: nowrap;\n width: 506px;\n height: 40px;\n top: 8px;\n left: 50%;\n transform: translateX(-50%);\n}\n.tui-image-editor-container .tui-image-editor-help-menu.top .tie-panel-history {\n top: 45px;\n}\n.tui-image-editor-container .tui-image-editor-help-menu.top .opened .tie-panel-history:before {\n border-right: 8px solid transparent;\n border-left: 8px solid transparent;\n border-bottom: 8px solid #fff;\n left: 90px;\n top: -8px;\n}\n.tui-image-editor-container .tui-image-editor-help-menu.top > .tui-image-editor-item[tooltip-content]:before {\n left: 13px;\n top: 35px;\n border: none;\n border-bottom: 7px solid #2f2f2f;\n border-left: 7px solid transparent;\n border-right: 7px solid transparent;\n}\n.tui-image-editor-container .tui-image-editor-help-menu.top > .tui-image-editor-item[tooltip-content]:after {\n top: 41px;\n left: -4px;\n white-space: nowrap;\n}\n.tui-image-editor-container .tui-image-editor-help-menu.top > .tui-image-editor-item[tooltip-content].opened:before,\n.tui-image-editor-container .tui-image-editor-help-menu.top > .tui-image-editor-item[tooltip-content].opened:after {\n content: none;\n}\n.tui-image-editor-container .tui-image-editor-help-menu.bottom {\n white-space: nowrap;\n width: 506px;\n height: 40px;\n bottom: 8px;\n left: 50%;\n transform: translateX(-50%);\n}\n.tui-image-editor-container .tui-image-editor-help-menu.bottom .tie-panel-history {\n bottom: 45px;\n}\n.tui-image-editor-container .tui-image-editor-help-menu.bottom .opened .tie-panel-history:before {\n border-right: 8px solid transparent;\n border-left: 8px solid transparent;\n border-top: 8px solid #fff;\n left: 90px;\n bottom: -8px;\n}\n.tui-image-editor-container .tui-image-editor-help-menu.bottom > .tui-image-editor-item[tooltip-content]:before {\n left: 13px;\n top: auto;\n bottom: 36px;\n border: none;\n border-top: 7px solid #2f2f2f;\n border-left: 7px solid transparent;\n border-right: 7px solid transparent;\n}\n.tui-image-editor-container .tui-image-editor-help-menu.bottom > .tui-image-editor-item[tooltip-content]:after {\n top: auto;\n left: -4px;\n bottom: 41px;\n white-space: nowrap;\n}\n.tui-image-editor-container .tui-image-editor-help-menu.bottom > .tui-image-editor-item[tooltip-content].opened:before,\n.tui-image-editor-container .tui-image-editor-help-menu.bottom > .tui-image-editor-item[tooltip-content].opened:after {\n content: none;\n}\n.tui-image-editor-container .tui-image-editor-help-menu.left {\n white-space: inherit;\n width: 40px;\n height: 506px;\n left: 8px;\n top: 50%;\n transform: translateY(-50%);\n}\n.tui-image-editor-container .tui-image-editor-help-menu.left .tie-panel-history {\n left: 140px;\n top: -4px;\n}\n.tui-image-editor-container .tui-image-editor-help-menu.left .opened .tie-panel-history:before {\n border-top: 8px solid transparent;\n border-bottom: 8px solid transparent;\n border-right: 8px solid #fff;\n left: -8px;\n top: 14px;\n}\n.tui-image-editor-container .tui-image-editor-help-menu.left .tui-image-editor-item {\n margin: 4px auto;\n padding: 6px 8px;\n}\n.tui-image-editor-container .tui-image-editor-help-menu.left > .tui-image-editor-item[tooltip-content]:before {\n left: 27px;\n top: 11px;\n border: none;\n border-right: 7px solid #2f2f2f;\n border-top: 7px solid transparent;\n border-bottom: 7px solid transparent;\n}\n.tui-image-editor-container .tui-image-editor-help-menu.left > .tui-image-editor-item[tooltip-content]:after {\n top: 7px;\n left: 40px;\n white-space: nowrap;\n}\n.tui-image-editor-container .tui-image-editor-help-menu.left > .tui-image-editor-item[tooltip-content].opened:before,\n.tui-image-editor-container .tui-image-editor-help-menu.left > .tui-image-editor-item[tooltip-content].opened:after {\n content: none;\n}\n.tui-image-editor-container .tui-image-editor-help-menu.right {\n white-space: inherit;\n width: 40px;\n height: 506px;\n right: 8px;\n top: 50%;\n transform: translateY(-50%);\n}\n.tui-image-editor-container .tui-image-editor-help-menu.right .tie-panel-history {\n right: -30px;\n top: -4px;\n}\n.tui-image-editor-container .tui-image-editor-help-menu.right .opened .tie-panel-history:before {\n border-top: 8px solid transparent;\n border-bottom: 8px solid transparent;\n border-left: 8px solid #fff;\n right: -8px;\n top: 14px;\n}\n.tui-image-editor-container .tui-image-editor-help-menu.right .tui-image-editor-item {\n margin: 4px auto;\n padding: 6px 8px;\n}\n.tui-image-editor-container .tui-image-editor-help-menu.right > .tui-image-editor-item[tooltip-content]:before {\n left: -6px;\n top: 11px;\n border: none;\n border-left: 7px solid #2f2f2f;\n border-top: 7px solid transparent;\n border-bottom: 7px solid transparent;\n}\n.tui-image-editor-container .tui-image-editor-help-menu.right > .tui-image-editor-item[tooltip-content]:after {\n top: 7px;\n left: auto;\n right: 39px;\n white-space: nowrap;\n}\n.tui-image-editor-container .tui-image-editor-help-menu.right > .tui-image-editor-item[tooltip-content].opened:before,\n.tui-image-editor-container .tui-image-editor-help-menu.right > .tui-image-editor-item[tooltip-content].opened:after {\n content: none;\n}\n.tui-image-editor-container .tie-icon-add-button .tui-image-editor-button {\n min-width: 42px;\n}\n.tui-image-editor-container .svg_ic-menu,\n.tui-image-editor-container .svg_ic-helpmenu {\n width: 24px;\n height: 24px;\n}\n.tui-image-editor-container .svg_ic-submenu {\n width: 32px;\n height: 32px;\n}\n.tui-image-editor-container .svg_img-bi {\n width: 257px;\n height: 26px;\n}\n.tui-image-editor-container .tui-image-editor-help-menu svg > use,\n.tui-image-editor-container .tui-image-editor-controls svg > use {\n display: none;\n}\n.tui-image-editor-container .tui-image-editor-help-menu .enabled svg:hover > use.hover,\n.tui-image-editor-container .tui-image-editor-controls .enabled svg:hover > use.hover,\n.tui-image-editor-container .tui-image-editor-help-menu .normal svg:hover > use.hover,\n.tui-image-editor-container .tui-image-editor-controls .normal svg:hover > use.hover {\n display: block;\n}\n.tui-image-editor-container .tui-image-editor-help-menu .active svg:hover > use.hover,\n.tui-image-editor-container .tui-image-editor-controls .active svg:hover > use.hover {\n display: none;\n}\n.tui-image-editor-container .tui-image-editor-help-menu .on svg > use.hover,\n.tui-image-editor-container .tui-image-editor-controls .on svg > use.hover,\n.tui-image-editor-container .tui-image-editor-help-menu .opened svg > use.hover,\n.tui-image-editor-container .tui-image-editor-controls .opened svg > use.hover {\n display: block;\n}\n.tui-image-editor-container .tui-image-editor-help-menu svg > use.normal,\n.tui-image-editor-container .tui-image-editor-controls svg > use.normal {\n display: block;\n}\n.tui-image-editor-container .tui-image-editor-help-menu .active svg > use.active,\n.tui-image-editor-container .tui-image-editor-controls .active svg > use.active {\n display: block;\n}\n.tui-image-editor-container .tui-image-editor-help-menu .enabled svg > use.enabled,\n.tui-image-editor-container .tui-image-editor-controls .enabled svg > use.enabled {\n display: block;\n}\n.tui-image-editor-container .tui-image-editor-help-menu .active svg > use.normal,\n.tui-image-editor-container .tui-image-editor-controls .active svg > use.normal,\n.tui-image-editor-container .tui-image-editor-help-menu .enabled svg > use.normal,\n.tui-image-editor-container .tui-image-editor-controls .enabled svg > use.normal {\n display: none;\n}\n.tui-image-editor-container .tui-image-editor-help-menu .help svg > use.disabled,\n.tui-image-editor-container .tui-image-editor-controls .help svg > use.disabled,\n.tui-image-editor-container .tui-image-editor-help-menu .help.enabled svg > use.normal,\n.tui-image-editor-container .tui-image-editor-controls .help.enabled svg > use.normal {\n display: block;\n}\n.tui-image-editor-container .tui-image-editor-help-menu .help.enabled svg > use.disabled,\n.tui-image-editor-container .tui-image-editor-controls .help.enabled svg > use.disabled {\n display: none;\n}\n.tui-image-editor-container .tui-image-editor-controls:hover {\n z-index: 3;\n}\n.tui-image-editor-container div.tui-colorpicker-clearfix {\n width: 159px;\n height: 28px;\n border: 1px solid #d5d5d5;\n border-radius: 2px;\n background-color: #f5f5f5;\n margin-top: 6px;\n padding: 4px 7px 4px 7px;\n}\n.tui-image-editor-container .tui-colorpicker-palette-hex {\n width: 114px;\n background-color: #f5f5f5;\n border: 0;\n font-size: 11px;\n margin-top: 2px;\n font-family: 'Noto Sans', sans-serif;\n}\n.tui-image-editor-container .tui-colorpicker-palette-hex[value='#ffffff'] + .tui-colorpicker-palette-preview,\n.tui-image-editor-container .tui-colorpicker-palette-hex[value=''] + .tui-colorpicker-palette-preview {\n border: 1px solid #ccc;\n}\n.tui-image-editor-container .tui-colorpicker-palette-hex[value=''] + .tui-colorpicker-palette-preview {\n background-size: cover;\n background-image: url(\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAAAXNSR0IArs4c6QAAAdBJREFUWAnFl0FuwjAQRZ0ukiugHqFSOQNdseuKW3ALzkA4BateICvUGyCxrtRFd4WuunH/TzykaYJrnLEYaTJJsP2+x8GZZCbQrLU5mj7Bn+EP8HvnCObd+R7xBV5lWfaNON4AnsA38E94qLEt+0yiFaBzAV/Bv+Cxxr4co7hKCDpw1q9wLeNYYdlAwyn8TYt8Hme3+8D5ozcTaMCZ68PXa2tnM2sbEcOZAJhrrpl2DAcTOGNjZPSfCdzkw6JrfbiMv+osBe4y9WOedhm4jZfhbENWuxS44H9Wz/xw4WzqLOAqh1+zycgAwzEMzr5k5gaHOa9ULBwuuDkFlHI1Kl4PJ66kgIpnoywOTmRFAYcbwYk9UMApWkD8zAV5ihcwHk4Rx7gl0IFTQL0EFc+CTQ9OZHWH3YhlVJiVpTHbrTGLhTHLZVgff6s9lyBsI9KduSS83oj+34rTwJutmBmCnMsvozRwZqB5GTkBw6/jdPDu69iJ6BYk6eCcfbcgcQIK/MByaaiMqm8rHcjol2TnpWDhyAKSGdA3FrxtJUToX0ODqatetfGE+8tyEUOV8GY5dGRwLP/MBS4RHQr4bT7NRAQjlcOTfZxmv2G+c4hI8nn+Ax5PG/zhI393AAAAAElFTkSuQmCC\");\n}\n.tui-image-editor-container .tui-colorpicker-palette-preview {\n border-radius: 100%;\n float: left;\n width: 17px;\n height: 17px;\n border: 0;\n}\n.tui-image-editor-container .color-picker-control {\n position: absolute;\n display: none;\n z-index: 99;\n width: 192px;\n background-color: #fff;\n box-shadow: 0 3px 22px 6px rgba(0,0,0,0.15);\n padding: 16px;\n border-radius: 2px;\n}\n.tui-image-editor-container .color-picker-control .tui-colorpicker-palette-toggle-slider {\n display: none;\n}\n.tui-image-editor-container .color-picker-control .tui-colorpicker-palette-button {\n border: 0;\n border-radius: 100%;\n margin: 2px;\n background-size: cover;\n font-size: 1px;\n}\n.tui-image-editor-container .color-picker-control .tui-colorpicker-palette-button[title='#ffffff'] {\n border: 1px solid #ccc;\n}\n.tui-image-editor-container .color-picker-control .tui-colorpicker-palette-button[title=''] {\n border: 1px solid #ccc;\n}\n.tui-image-editor-container .color-picker-control .triangle {\n width: 0;\n height: 0;\n border-right: 7px solid transparent;\n border-top: 8px solid #fff;\n border-left: 7px solid transparent;\n position: absolute;\n bottom: -8px;\n left: 84px;\n}\n.tui-image-editor-container .color-picker-control .tui-colorpicker-container,\n.tui-image-editor-container .color-picker-control .tui-colorpicker-palette-container ul,\n.tui-image-editor-container .color-picker-control .tui-colorpicker-palette-container {\n width: 100%;\n height: auto;\n}\n.tui-image-editor-container .filter-color-item .color-picker-control label {\n font-color: #333;\n font-weight: normal;\n margin-right: 7pxleft;\n}\n.tui-image-editor-container .filter-color-item .tui-image-editor-checkbox {\n margin-top: 0;\n}\n.tui-image-editor-container .filter-color-item .tui-image-editor-checkbox input + label:before,\n.tui-image-editor-container .filter-color-item .tui-image-editor-checkbox > label:before {\n left: -16px;\n}\n.tui-image-editor-container .color-picker {\n width: 100%;\n height: auto;\n}\n.tui-image-editor-container .color-picker-value {\n width: 32px;\n height: 32px;\n border: 0px;\n border-radius: 100%;\n margin: auto;\n margin-bottom: 1px;\n}\n.tui-image-editor-container .color-picker-value.transparent {\n border: 1px solid #cbcbcb;\n background-size: cover;\n background-image: url(\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAAAXNSR0IArs4c6QAAAdBJREFUWAnFl0FuwjAQRZ0ukiugHqFSOQNdseuKW3ALzkA4BateICvUGyCxrtRFd4WuunH/TzykaYJrnLEYaTJJsP2+x8GZZCbQrLU5mj7Bn+EP8HvnCObd+R7xBV5lWfaNON4AnsA38E94qLEt+0yiFaBzAV/Bv+Cxxr4co7hKCDpw1q9wLeNYYdlAwyn8TYt8Hme3+8D5ozcTaMCZ68PXa2tnM2sbEcOZAJhrrpl2DAcTOGNjZPSfCdzkw6JrfbiMv+osBe4y9WOedhm4jZfhbENWuxS44H9Wz/xw4WzqLOAqh1+zycgAwzEMzr5k5gaHOa9ULBwuuDkFlHI1Kl4PJ66kgIpnoywOTmRFAYcbwYk9UMApWkD8zAV5ihcwHk4Rx7gl0IFTQL0EFc+CTQ9OZHWH3YhlVJiVpTHbrTGLhTHLZVgff6s9lyBsI9KduSS83oj+34rTwJutmBmCnMsvozRwZqB5GTkBw6/jdPDu69iJ6BYk6eCcfbcgcQIK/MByaaiMqm8rHcjol2TnpWDhyAKSGdA3FrxtJUToX0ODqatetfGE+8tyEUOV8GY5dGRwLP/MBS4RHQr4bT7NRAQjlcOTfZxmv2G+c4hI8nn+Ax5PG/zhI393AAAAAElFTkSuQmCC\");\n}\n.tui-image-editor-container .color-picker-value + label {\n color: #fff;\n}\n.tui-image-editor-container .tui-image-editor-submenu svg > use {\n display: none;\n}\n.tui-image-editor-container .tui-image-editor-submenu svg > use.normal {\n display: block;\n}\n.tie-icon-add-button.icon-bubble .tui-image-editor-button[data-icontype=\"icon-bubble\"] svg > use.active,\n.tie-icon-add-button.icon-heart .tui-image-editor-button[data-icontype=\"icon-heart\"] svg > use.active,\n.tie-icon-add-button.icon-location .tui-image-editor-button[data-icontype=\"icon-location\"] svg > use.active,\n.tie-icon-add-button.icon-polygon .tui-image-editor-button[data-icontype=\"icon-polygon\"] svg > use.active,\n.tie-icon-add-button.icon-star .tui-image-editor-button[data-icontype=\"icon-star\"] svg > use.active,\n.tie-icon-add-button.icon-star-2 .tui-image-editor-button[data-icontype=\"icon-star-2\"] svg > use.active,\n.tie-icon-add-button.icon-arrow-3 .tui-image-editor-button[data-icontype=\"icon-arrow-3\"] svg > use.active,\n.tie-icon-add-button.icon-arrow-2 .tui-image-editor-button[data-icontype=\"icon-arrow-2\"] svg > use.active,\n.tie-icon-add-button.icon-arrow .tui-image-editor-button[data-icontype=\"icon-arrow\"] svg > use.active {\n display: block;\n}\n.tie-draw-line-select-button.line .tui-image-editor-button.line svg > use.normal,\n.tie-draw-line-select-button.free .tui-image-editor-button.free svg > use.normal {\n display: none;\n}\n.tie-draw-line-select-button.line .tui-image-editor-button.line svg > use.active,\n.tie-draw-line-select-button.free .tui-image-editor-button.free svg > use.active {\n display: block;\n}\n.tie-flip-button.resetFlip .tui-image-editor-button.resetFlip svg > use.normal,\n.tie-flip-button.flipX .tui-image-editor-button.flipX svg > use.normal,\n.tie-flip-button.flipY .tui-image-editor-button.flipY svg > use.normal {\n display: none;\n}\n.tie-flip-button.resetFlip .tui-image-editor-button.resetFlip svg > use.active,\n.tie-flip-button.flipX .tui-image-editor-button.flipX svg > use.active,\n.tie-flip-button.flipY .tui-image-editor-button.flipY svg > use.active {\n display: block;\n}\n.tie-mask-apply.apply.active .tui-image-editor-button.apply label {\n color: #fff;\n}\n.tie-mask-apply.apply.active .tui-image-editor-button.apply svg > use.active {\n display: block;\n}\n.tie-crop-button .tui-image-editor-button.apply,\n.tie-crop-preset-button .tui-image-editor-button.apply {\n margin-right: 24px;\n}\n.tie-crop-button .tui-image-editor-button.preset.active svg > use.active,\n.tie-crop-preset-button .tui-image-editor-button.preset.active svg > use.active {\n display: block;\n}\n.tie-crop-button .tui-image-editor-button.apply.active svg > use.active,\n.tie-crop-preset-button .tui-image-editor-button.apply.active svg > use.active {\n display: block;\n}\n.tie-shape-button.rect .tui-image-editor-button.rect svg > use.normal,\n.tie-shape-button.circle .tui-image-editor-button.circle svg > use.normal,\n.tie-shape-button.triangle .tui-image-editor-button.triangle svg > use.normal {\n display: none;\n}\n.tie-shape-button.rect .tui-image-editor-button.rect svg > use.active,\n.tie-shape-button.circle .tui-image-editor-button.circle svg > use.active,\n.tie-shape-button.triangle .tui-image-editor-button.triangle svg > use.active {\n display: block;\n}\n.tie-text-effect-button .tui-image-editor-button.active svg > use.active {\n display: block;\n}\n.tie-text-align-button.left .tui-image-editor-button.left svg > use.active,\n.tie-text-align-button.center .tui-image-editor-button.center svg > use.active,\n.tie-text-align-button.right .tui-image-editor-button.right svg > use.active {\n display: block;\n}\n.tie-mask-image-file,\n.tie-icon-image-file {\n opacity: 0;\n position: absolute;\n width: 100%;\n height: 100%;\n border: 1px solid #008000;\n cursor: inherit;\n left: 0;\n top: 0;\n}\n.tie-zoom-button.resetFlip .tui-image-editor-button.resetFlip svg > use.normal,\n.tie-zoom-button.flipX .tui-image-editor-button.flipX svg > use.normal,\n.tie-zoom-button.flipY .tui-image-editor-button.flipY svg > use.normal {\n display: none;\n}\n.tie-zoom-button.resetFlip .tui-image-editor-button.resetFlip svg > use.active,\n.tie-zoom-button.flipX .tui-image-editor-button.flipX svg > use.active,\n.tie-zoom-button.flipY .tui-image-editor-button.flipY svg > use.active {\n display: block;\n}\n.tui-image-editor-container.top.tui-image-editor-top-optimization .tui-image-editor-controls ul {\n text-align: right;\n}\n.tui-image-editor-container.top.tui-image-editor-top-optimization .tui-image-editor-controls-logo {\n display: none;\n}\n/*# sourceMappingURL=src/css/index.css.map */","/* GRID VISUAL OF FLIP AND ROTATE MENU */\n.{prefix}-container\n .{prefix}-grid-visual\n display: none;\n position: absolute;\n width: 100%;\n height: 100%;\n border: 1px solid rgba(255,255,255,0.7);\n .{prefix}-main.{prefix}-menu-flip,\n .{prefix}-main.{prefix}-menu-rotate\n .tui-image-editor\n transition: none;\n .{prefix}-main.{prefix}-menu-flip .{prefix}-grid-visual,\n .{prefix}-main.{prefix}-menu-rotate .{prefix}-grid-visual\n display: block;\n .{prefix}-grid-visual \n table\n width: 100%;\n height: 100%;\n border-collapse: collapse;\n td\n border: 1px solid rgba(255,255,255,0.3);\n td.dot:before\n content: '';\n position: absolute;\n box-sizing: border-box;\n width: 10px;\n height: 10px;\n border: 0;\n box-shadow: 0 0 1px 0 rgba(0,0,0,0.3);\n border-radius: 100%;\n background-color: #fff;\n td.dot.left-top:before\n top: -5px;\n left: -5px;\n td.dot.right-top:before\n top: -5px;\n right: -5px;\n td.dot.left-bottom:before\n bottom: -5px;\n left: -5px;\n td.dot.right-bottom:before\n bottom: -5px;\n right: -5px;\n","/* SUBMENU */\n.{prefix}-container\n .{prefix}-submenu\n display: none;\n position: absolute;\n bottom: 0;\n width:100%;\n height: 150px;\n white-space: nowrap;\n z-index: 2;\n .{prefix}-button:hover svg > use.active\n display: block;\n .{prefix}-submenu-item\n li\n display: inline-block;\n vertical-align: top;\n .{prefix}-newline\n display: block;\n margin-top: 0;\n .{prefix}-button\n position: relative;\n cursor: pointer;\n display: inline-block;\n font-weight: normal;\n font-size: 11px;\n margin: 0 9px 0 9px;\n .{prefix}-button.preset\n margin: 0 9px 20px 5px;\n label > span\n display: inline-block;\n cursor: pointer;\n padding-top: 5px;\n font-family: \"Noto Sans\", sans-serif;\n font-size: 11px;\n .{prefix}-button.apply label,\n .{prefix}-button.cancel label\n vertical-align: 7px;\n > div\n display: none;\n vertical-align: bottom;\n .{prefix}-submenu-style\n opacity: 0.95;\n z-index: -1;\n position: absolute;\n top: 0;\n bottom: 0;\n left: 0;\n right: 0;\n display: block;\n\n .{prefix}-partition > div\n width: 1px;\n height: 52px;\n border-left: 1px solid #3c3c3c;\n margin: 0 8px 0 8px;\n .{prefix}-main.{prefix}-menu-filter .{prefix}-partition > div\n height: 108px;\n margin: 0 29px 0 0px;\n .{prefix}-submenu-align\n text-align: left;\n margin-right: 30px;\n label > span\n width: 55px;\n white-space: nowrap;\n .{prefix}-submenu-align:first-child\n margin-right: 0;\n label > span\n width: 70px;\n .{prefix}-main.{prefix}-menu-crop .{prefix}-submenu > div.{prefix}-menu-crop,\n .{prefix}-main.{prefix}-menu-flip .{prefix}-submenu > div.{prefix}-menu-flip,\n .{prefix}-main.{prefix}-menu-rotate .{prefix}-submenu > div.{prefix}-menu-rotate,\n .{prefix}-main.{prefix}-menu-shape .{prefix}-submenu > div.{prefix}-menu-shape,\n .{prefix}-main.{prefix}-menu-text .{prefix}-submenu > div.{prefix}-menu-text,\n .{prefix}-main.{prefix}-menu-mask .{prefix}-submenu > div.{prefix}-menu-mask,\n .{prefix}-main.{prefix}-menu-icon .{prefix}-submenu > div.{prefix}-menu-icon,\n .{prefix}-main.{prefix}-menu-draw .{prefix}-submenu > div.{prefix}-menu-draw,\n .{prefix}-main.{prefix}-menu-filter .{prefix}-submenu > div.{prefix}-menu-filter,\n .{prefix}-main.{prefix}-menu-zoom .{prefix}-submenu > div.{prefix}-menu-zoom\n display: table-cell;\n .{prefix}-main.{prefix}-menu-crop,\n .{prefix}-main.{prefix}-menu-flip,\n .{prefix}-main.{prefix}-menu-rotate,\n .{prefix}-main.{prefix}-menu-shape,\n .{prefix}-main.{prefix}-menu-text,\n .{prefix}-main.{prefix}-menu-mask,\n .{prefix}-main.{prefix}-menu-icon,\n .{prefix}-main.{prefix}-menu-draw,\n .{prefix}-main.{prefix}-menu-filter,\n .{prefix}-main.{prefix}-menu-zoom\n .{prefix}-submenu\n display: table;\n\n/* Help menu bar */\n.{prefix}-container\n .{prefix}-help-menu\n list-style: none;\n padding: 0;\n margin: 0 auto;\n text-align: center;\n vertical-align: middle;\n border-radius: 20px;\n background-color: rgba(255, 255, 255, 0.06);\n z-index: 2;\n position: absolute;\n .tie-panel-history\n display: none;\n background-color: #fff;\n color: #444;\n position: absolute;\n width: 196px;\n height: 276px;\n padding: 4px 2px;\n box-shadow: 0 2px 6px 0 rgba(0, 0, 0, 0.15);\n cursor: auto;\n transform: translateX(calc(-50% + 12px));\n .history-list\n height: 268px;\n padding: 0;\n overflow: hidden scroll;\n list-style: none;\n .history-item\n height: 24px;\n font-size: 11px;\n line-height: 24px;\n .{prefix}-history-item\n position: relative;\n height: 24px;\n cursor: pointer;\n svg\n width: 24px;\n height: 24px;\n span\n display: inline-block;\n width: 128px;\n height: 24px;\n text-align: left;\n .history-item-icon\n display: inline-block;\n width: 24px;\n height: 24px;\n position: absolute;\n top: 6px;\n left: 6px;\n .history-item-checkbox\n display: none;\n width: 24px;\n height: 24px;\n position: absolute;\n top: 5px;\n right: -6px;\n &.selected-item\n background-color: rgba(119, 119, 119, 0.12);\n .history-item-checkbox\n display: inline-block;\n &.disabled-item\n color: #333;\n opacity: 0.3;\n .opened .tie-panel-history\n display: block;\n &:before\n content: '';\n position: absolute;\n display: inline-block;\n margin: 0 auto;\n width: 0;\n height: 0;\n","/* VIRTUAL CHECKBOX */\n.{prefix}-container\n .filter-color-item\n display: inline-block;\n .tui-image-editor-checkbox\n display: block;\n .{prefix}-checkbox-wrap\n display: inline-block !important;\n text-align: left;\n .{prefix}-checkbox-wrap.fixed-width\n width: 187px;\n white-space: normal;\n .{prefix}-checkbox\n display: inline-block;\n margin: 1px 0 1px 0;\n input\n width: 14px;\n height: 14px;\n opacity: 0;\n > label > span\n color: #fff;\n height: 14px;\n position: relative;\n input + label:before,\n > label > span:before\n content: '';\n position: absolute;\n width: 14px;\n height: 14px;\n background-color: #fff;\n top: 6px;\n left: -19px;\n display: inline-block;\n margin: 0;\n text-align: center;\n font-size: 11px;\n border: 0;\n border-radius: 2px;\n padding-top: 1px;\n box-sizing: border-box;\n input[type='checkbox']:checked + span:before\n background-size: cover;\n background-image: url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAA4AAAAOCAYAAAAfSC3RAAAAAXNSR0IArs4c6QAAAMBJREFUKBWVkjEOwjAMRe2WgZW7IIHEDdhghhuwcQ42rlJugAQS54Cxa5cq1QM5TUpByZfS2j9+dlJVt/tX5ZxbS4ZU9VLkQvSHKTIGRaVJYFmKrBbTCJxE2UgCdDzMZDkHrOV6b95V0US6UmgKodujEZbJg0B0ZgEModO5lrY1TMQf1TpyJGBEjD+E2NPN7ukIUDiF/BfEXgRiGEw8NgkffYGYwCi808fpn/6OvfUfsDr/Vc1IfRf8sKnFVqeiVQfDu0tf/nWH9gAAAABJRU5ErkJggg==');\n\n .{prefix}-selectlist-wrap\n position: relative;\n select\n width: 100%;\n height: 28px;\n margin-top: 4px;\n border: 0;\n outline: 0;\n border-radius: 0;\n border: 1px solid #cbdbdb;\n background-color: #fff;\n -webkit-appearance: none;\n -moz-appearance: none;\n appearance: none;\n padding: 0 7px 0 10px;\n .{prefix}-selectlist\n display: none;\n position: relative;\n top: -1px;\n border: 1px solid #ccc;\n background-color: #fff;\n border-top: 0px;\n padding: 4px 0;\n li\n display: block;\n text-align: left;\n padding: 7px 10px;\n font-family: 'Noto Sans', sans-serif;\n li:hover\n background-color: rgba(81, 92, 230, 0.05);\n .{prefix}-selectlist-wrap:before\n content: '';\n position: absolute;\n display: inline-block;\n width: 14px;\n height: 14px;\n right: 5px;\n top: 10px;\n background-image: url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAA4AAAAOCAYAAAAfSC3RAAAAAXNSR0IArs4c6QAAAHlJREFUKBVjYBgFOEOAEVkmPDxc89+/f6eAYjzI4kD2FyYmJrOVK1deh4kzwRggGiQBVJCELAZig8SQNYHEmEEEMrh69eo1HR0dfqCYJUickZGxf9WqVf3IakBsFBthklpaWmVA9mEQhrJhUoTp0NBQCRAmrHL4qgAAuu4cWZOZIGsAAAAASUVORK5CYII=');\n background-size: cover;\n .{prefix}-selectlist-wrap select::-ms-expand\n display:none;\n","/* VIRTUAL RANGE */\n.{prefix}-container\n\n .{prefix}-virtual-range-bar\n .{prefix}-virtual-range-subbar\n .{prefix}-virtual-range-pointer\n .{prefix}-disabled\n backbround-color: red;\n\n .{prefix}-range\n position: relative;\n top: 5px;\n width: 166px;\n height: 17px;\n display: inline-block;\n .{prefix}-virtual-range-bar\n top: 7px;\n position: absolute;\n width: 100%;\n height: 2px;\n background-color: #666666;\n .{prefix}-virtual-range-subbar\n position: absolute;\n height: 100%;\n left: 0;\n right: 0;\n background-color: #d1d1d1;\n .{prefix}-virtual-range-pointer\n position: absolute;\n cursor: pointer;\n top: -5px;\n left: 0;\n width: 12px;\n height: 12px;\n background-color: #fff;\n border-radius: 100%;\n .{prefix}-range-wrap\n display: inline-block;\n margin-left: 4px;\n &.short .tui-image-editor-range\n width: 100px;\n .color-picker-control\n .{prefix}-range\n width: 108px;\n margin-left: 10px;\n .{prefix}-virtual-range-pointer\n background-color: #333;\n .{prefix}-virtual-range-bar\n background-color: #ccc;\n .{prefix}-virtual-range-subbar\n background-color: #606060;\n .{prefix}-range-wrap.{prefix}-newline.short\n margin-top: -2px;\n margin-left: 19px;\n label\n color: #8e8e8e;\n font-weight: normal;\n .{prefix}-range-wrap label\n vertical-align: baseline;\n font-size: 11px;\n margin-right: 7px;\n color: #fff;\n .{prefix}-range-value\n cursor: default;\n width: 40px;\n height: 24px;\n outline: none;\n border-radius: 2px;\n box-shadow: none;\n border: 1px solid #d5d5d5;\n text-align: center;\n background-color: #1c1c1c;\n color: #fff;\n font-weight: lighter;\n vertical-align: baseline;\n font-family: 'Noto Sans', sans-serif;\n margin-top: 21px;\n margin-left: 4px;\n .{prefix}-controls\n position: absolute;\n background-color: #151515;\n width: 100%;\n height: 64px;\n display: table;\n bottom: 0;\n z-index: 2;\n .{prefix}-icpartition\n display: inline-block;\n background-color: #444;\n width: 1px;\n height: 24px;\n","/* POSITION LEFT */\n.{prefix}-container\n &.left\n .{prefix}-menu\n > .{prefix}-item[tooltip-content]\n &:before\n left: 28px;\n top: 11px;\n border-right: 7px solid #2f2f2f;\n border-top: 7px solid transparent;\n border-bottom: 7px solid transparent;\n &:after\n top: 7px;\n left: 42px;\n white-space: nowrap;\n .{prefix}-submenu\n left: 0;\n height: 100%;\n width: 248px;\n .{prefix}-main-container\n left: 64px;\n width: calc(100% - 64px);\n height: 100%;\n .{prefix}-controls\n width: 64px;\n height: 100%;\n display: table;\n\n/* POSITION LEFT & RIGHT */\n.{prefix}-container\n &.left, &.right\n .{prefix}-menu\n white-space: inherit;\n .{prefix}-submenu\n white-space: normal;\n > div\n vertical-align: middle;\n .{prefix}-controls li\n display: inline-block;\n margin: 4px auto;\n .{prefix}-icpartition\n position: relative;\n top: -7px;\n width: 24px;\n height: 1px;\n .{prefix}-submenu\n .{prefix}-partition\n display: block;\n width: 75%;\n margin: auto;\n > div\n border-left: 0;\n height:10px;\n border-bottom: 1px solid #3c3c3c;\n width: 100%;\n margin: 0;\n .{prefix}-submenu-align\n margin-right: 0;\n .{prefix}-submenu-item\n li\n margin-top: 15px;\n .tui-colorpicker-clearfix li\n margin-top: 0;\n\n .{prefix}-checkbox-wrap.fixed-width\n width: 182px;\n white-space: normal;\n .{prefix}-range-wrap.{prefix}-newline label.range\n display: block;\n text-align: left;\n width: 75%;\n margin: auto;\n .{prefix}-range\n width: 136px;\n\n\n/* POSITION RIGHT */\n.{prefix}-container\n &.right\n .{prefix}-menu\n > .{prefix}-item[tooltip-content]\n &:before\n left: -3px;\n top: 11px;\n border-left: 7px solid #2f2f2f;\n border-top: 7px solid transparent;\n border-bottom: 7px solid transparent;\n &:after\n top: 7px;\n left: unset;\n right: 43px;\n white-space: nowrap;\n .{prefix}-submenu\n right: 0;\n height: 100%;\n width: 248px;\n .{prefix}-main-container \n right: 64px;\n width: calc(100% - 64px);\n height: 100%;\n .{prefix}-controls\n right: 0;\n width: 64px;\n height: 100%;\n display: table;\n\n\n/* POSITION TOP & BOTTOM */\n.{prefix}-container\n &.top, &.bottom\n .{prefix}-submenu\n .{prefix}-partition.only-left-right\n display: none;\n\n\n/* POSITION BOTTOM */\n.{prefix}-container\n &.bottom .tui-image-editor-submenu > div\n padding-bottom: 24px;\n\n/* POSITION TOP */\n.{prefix}-container\n &.top\n .color-picker-control .triangle\n top: -8px;\n border-right: 7px solid transparent;\n border-top: 0px;\n border-left: 7px solid transparent;\n border-bottom: 8px solid #fff;\n .{prefix}-size-wrap\n height: 100%;\n .{prefix}-main-container\n bottom: 0;\n .{prefix}-menu\n > .{prefix}-item[tooltip-content]\n &:before\n left: 13px;\n border-top: 0;\n border-bottom: 7px solid #2f2f2f;\n top: 33px;\n &:after\n top: 38px;\n .{prefix}-submenu\n top: 0;\n bottom: auto;\n > div\n padding-top: 24px;\n vertical-align: top;\n .{prefix}-controls-logo\n display: table-cell;\n .{prefix}-controls-buttons\n display: table-cell;\n .{prefix}-main\n top: 64px;\n height: calc(100% - 64px);\n .{prefix}-controls\n top: 0;\n bottom: inherit;\n\n/* HELP MENUBAR POSITION TOP */\n.{prefix}-container\n .{prefix}-help-menu\n &.top\n white-space: nowrap;\n width: 506px;\n height: 40px;\n top: 8px;\n left: 50%;\n transform: translateX(-50%);\n .tie-panel-history\n top: 45px;\n .opened .tie-panel-history:before\n border-right: 8px solid transparent;\n border-left: 8px solid transparent;\n border-bottom: 8px solid #fff;\n left: 90px;\n top: -8px;\n > .{prefix}-item[tooltip-content]\n &:before\n left: 13px;\n top: 35px;\n border: none;\n border-bottom: 7px solid #2f2f2f;\n border-left: 7px solid transparent;\n border-right: 7px solid transparent;\n &:after\n top: 41px;\n left: -4px;\n white-space: nowrap;\n > .{prefix}-item[tooltip-content].opened\n &:before,\n &:after\n content: none;\n\n/* HELP MENUBAR POSITION BOTTOM */\n.{prefix}-container\n .{prefix}-help-menu\n &.bottom\n white-space: nowrap;\n width: 506px;\n height: 40px;\n bottom: 8px;\n left: 50%;\n transform: translateX(-50%);\n .tie-panel-history\n bottom: 45px;\n .opened .tie-panel-history:before\n border-right: 8px solid transparent;\n border-left: 8px solid transparent;\n border-top: 8px solid #fff;\n left: 90px;\n bottom: -8px;\n > .{prefix}-item[tooltip-content]\n &:before\n left: 13px;\n top: auto;\n bottom: 36px;\n border: none;\n border-top: 7px solid #2f2f2f;\n border-left: 7px solid transparent;\n border-right: 7px solid transparent;\n &:after\n top: auto;\n left: -4px;\n bottom: 41px;\n white-space: nowrap;\n > .{prefix}-item[tooltip-content].opened\n &:before,\n &:after\n content: none;\n\n/* HELP MENUBAR POSITION LEFT */\n.{prefix}-container\n .{prefix}-help-menu\n &.left\n white-space: inherit;\n width: 40px;\n height: 506px;\n left: 8px;\n top: 50%;\n transform: translateY(-50%);\n .tie-panel-history\n left: 140px;\n top: -4px;\n .opened .tie-panel-history:before\n border-top: 8px solid transparent;\n border-bottom: 8px solid transparent;\n border-right: 8px solid #fff;\n left: -8px;\n top: 14px;\n .{prefix}-item\n margin: 4px auto;\n padding: 6px 8px;\n > .{prefix}-item[tooltip-content]\n &:before\n left: 27px;\n top: 11px;\n border: none;\n border-right: 7px solid #2f2f2f;\n border-top: 7px solid transparent;\n border-bottom: 7px solid transparent;\n &:after\n top: 7px;\n left: 40px;\n white-space: nowrap;\n > .{prefix}-item[tooltip-content].opened\n &:before,\n &:after\n content: none;\n\n/* HELP MENUBAR POSITION RIGHT */\n.{prefix}-container\n .{prefix}-help-menu\n &.right\n white-space: inherit;\n width: 40px;\n height: 506px;\n right: 8px;\n top: 50%;\n transform: translateY(-50%);\n .tie-panel-history\n right: -30px;\n top: -4px;\n .opened .tie-panel-history:before\n border-top: 8px solid transparent;\n border-bottom: 8px solid transparent;\n border-left: 8px solid #fff;\n right: -8px;\n top: 14px;\n .{prefix}-item\n margin: 4px auto;\n padding: 6px 8px;\n > .{prefix}-item[tooltip-content]\n &:before\n left: -6px;\n top: 11px;\n border: none;\n border-left: 7px solid #2f2f2f;\n border-top: 7px solid transparent;\n border-bottom: 7px solid transparent;\n &:after\n top: 7px;\n left: auto;\n right: 39px;\n white-space: nowrap;\n > .{prefix}-item[tooltip-content].opened\n &:before,\n &:after\n content: none;\n","/* ICON */\n.{prefix}-container\n .tie-icon-add-button .{prefix}-button\n min-width: 42px;\n .svg_ic-menu\n .svg_ic-helpmenu\n width: 24px;\n height: 24px;\n .svg_ic-submenu\n width: 32px;\n height: 32px;\n .svg_img-bi\n width: 257px;\n height: 26px;\n\n .{prefix}-help-menu\n .{prefix}-controls\n svg > use\n display: none;\n .enabled svg:hover > use.hover\n .normal svg:hover > use.hover\n display: block;\n .active svg:hover > use.hover\n display: none;\n .on svg > use.hover,\n .opened svg > use.hover\n display: block;\n svg > use.normal\n display: block;\n .active svg > use.active\n display: block;\n .enabled svg > use.enabled\n display: block;\n .active svg > use.normal,\n .enabled svg > use.normal\n display: none;\n .help svg > use.disabled,\n .help.enabled svg > use.normal\n display: block;\n .help.enabled svg > use.disabled\n display: none;\n\n .{prefix}-controls:hover\n z-index: 3;\n","/* COLOR PICKER */\n.{prefix}-container\n div.tui-colorpicker-clearfix\n width: 159px;\n height: 28px;\n border: 1px solid #d5d5d5;\n border-radius: 2px;\n background-color: #f5f5f5;\n margin-top: 6px;\n padding: 4px 7px 4px 7px;\n .tui-colorpicker-palette-hex\n width: 114px;\n background-color: #f5f5f5;\n border: 0;\n font-size: 11px;\n margin-top: 2px;\n font-family: 'Noto Sans', sans-serif;\n .tui-colorpicker-palette-hex[value='#ffffff'] + .tui-colorpicker-palette-preview,\n .tui-colorpicker-palette-hex[value=''] + .tui-colorpicker-palette-preview\n border: 1px solid #ccc;\n .tui-colorpicker-palette-hex[value=''] + .tui-colorpicker-palette-preview\n background-size: cover;\n background-image: url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAAAXNSR0IArs4c6QAAAdBJREFUWAnFl0FuwjAQRZ0ukiugHqFSOQNdseuKW3ALzkA4BateICvUGyCxrtRFd4WuunH/TzykaYJrnLEYaTJJsP2+x8GZZCbQrLU5mj7Bn+EP8HvnCObd+R7xBV5lWfaNON4AnsA38E94qLEt+0yiFaBzAV/Bv+Cxxr4co7hKCDpw1q9wLeNYYdlAwyn8TYt8Hme3+8D5ozcTaMCZ68PXa2tnM2sbEcOZAJhrrpl2DAcTOGNjZPSfCdzkw6JrfbiMv+osBe4y9WOedhm4jZfhbENWuxS44H9Wz/xw4WzqLOAqh1+zycgAwzEMzr5k5gaHOa9ULBwuuDkFlHI1Kl4PJ66kgIpnoywOTmRFAYcbwYk9UMApWkD8zAV5ihcwHk4Rx7gl0IFTQL0EFc+CTQ9OZHWH3YhlVJiVpTHbrTGLhTHLZVgff6s9lyBsI9KduSS83oj+34rTwJutmBmCnMsvozRwZqB5GTkBw6/jdPDu69iJ6BYk6eCcfbcgcQIK/MByaaiMqm8rHcjol2TnpWDhyAKSGdA3FrxtJUToX0ODqatetfGE+8tyEUOV8GY5dGRwLP/MBS4RHQr4bT7NRAQjlcOTfZxmv2G+c4hI8nn+Ax5PG/zhI393AAAAAElFTkSuQmCC');\n .tui-colorpicker-palette-preview\n border-radius: 100%;\n float: left;\n width: 17px;\n height: 17px;\n border: 0;\n .color-picker-control\n position: absolute;\n display: none;\n z-index: 99;\n width: 192px;\n background-color: #fff;\n box-shadow: 0 3px 22px 6px rgba(0, 0, 0, .15);\n padding: 16px;\n border-radius: 2px;\n .tui-colorpicker-palette-toggle-slider\n display: none;\n .tui-colorpicker-palette-button\n border: 0;\n border-radius: 100%;\n margin: 2px;\n background-size: cover;\n font-size: 1px;\n &[title='#ffffff']\n border: 1px solid #ccc;\n &[title='']\n border: 1px solid #ccc;\n .triangle\n width: 0;\n height: 0;\n border-right: 7px solid transparent;\n border-top: 8px solid #fff;\n border-left: 7px solid transparent;\n position: absolute;\n bottom: -8px;\n left: 84px;\n .tui-colorpicker-container,\n .tui-colorpicker-palette-container ul,\n .tui-colorpicker-palette-container\n width: 100%;\n height: auto;\n\n\n .filter-color-item\n .color-picker-control label\n font-color: #333;\n font-weight: normal;\n margin-right: 7pxleft\n .tui-image-editor-checkbox\n margin-top: 0;\n input + label:before,\n > label:before\n left: -16px;\n .color-picker\n width: 100%;\n height: auto;\n .color-picker-value \n width: 32px;\n height: 32px;\n border: 0px;\n border-radius: 100%;\n margin: auto;\n margin-bottom: 1px;\n &.transparent\n border: 1px solid #cbcbcb;\n background-size: cover;\n background-image: url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAAAXNSR0IArs4c6QAAAdBJREFUWAnFl0FuwjAQRZ0ukiugHqFSOQNdseuKW3ALzkA4BateICvUGyCxrtRFd4WuunH/TzykaYJrnLEYaTJJsP2+x8GZZCbQrLU5mj7Bn+EP8HvnCObd+R7xBV5lWfaNON4AnsA38E94qLEt+0yiFaBzAV/Bv+Cxxr4co7hKCDpw1q9wLeNYYdlAwyn8TYt8Hme3+8D5ozcTaMCZ68PXa2tnM2sbEcOZAJhrrpl2DAcTOGNjZPSfCdzkw6JrfbiMv+osBe4y9WOedhm4jZfhbENWuxS44H9Wz/xw4WzqLOAqh1+zycgAwzEMzr5k5gaHOa9ULBwuuDkFlHI1Kl4PJ66kgIpnoywOTmRFAYcbwYk9UMApWkD8zAV5ihcwHk4Rx7gl0IFTQL0EFc+CTQ9OZHWH3YhlVJiVpTHbrTGLhTHLZVgff6s9lyBsI9KduSS83oj+34rTwJutmBmCnMsvozRwZqB5GTkBw6/jdPDu69iJ6BYk6eCcfbcgcQIK/MByaaiMqm8rHcjol2TnpWDhyAKSGdA3FrxtJUToX0ODqatetfGE+8tyEUOV8GY5dGRwLP/MBS4RHQr4bT7NRAQjlcOTfZxmv2G+c4hI8nn+Ax5PG/zhI393AAAAAElFTkSuQmCC');\n\n .color-picker-value + label\n color: #fff;\n\n .{prefix}-submenu svg > use\n display: none;\n .{prefix}-submenu svg > use.normal\n display: block;\n","/* ICON BUTTON */\n.tie-icon-add-button\n &.icon-bubble .{prefix}-button[data-icontype=\"icon-bubble\"] svg > use.active,\n &.icon-heart .{prefix}-button[data-icontype=\"icon-heart\"] svg > use.active,\n &.icon-location .{prefix}-button[data-icontype=\"icon-location\"] svg > use.active,\n &.icon-polygon .{prefix}-button[data-icontype=\"icon-polygon\"] svg > use.active,\n &.icon-star .{prefix}-button[data-icontype=\"icon-star\"] svg > use.active,\n &.icon-star-2 .{prefix}-button[data-icontype=\"icon-star-2\"] svg > use.active,\n &.icon-arrow-3 .{prefix}-button[data-icontype=\"icon-arrow-3\"] svg > use.active,\n &.icon-arrow-2 .{prefix}-button[data-icontype=\"icon-arrow-2\"] svg > use.active,\n &.icon-arrow .{prefix}-button[data-icontype=\"icon-arrow\"] svg > use.active,\n &.icon-bubble .{prefix}-button[data-icontype=\"icon-bubble\"] svg > use.active\n display: block;\n\n/* DRAW BUTTON */\n.tie-draw-line-select-button\n &.line .{prefix}-button.line svg > use.normal,\n &.free .{prefix}-button.free svg > use.normal\n display: none;\n\n &.line .{prefix}-button.line svg > use.active,\n &.free .{prefix}-button.free svg > use.active\n display: block;\n\n/* FLIP BUTTON */\n.tie-flip-button\n &.resetFlip .{prefix}-button.resetFlip,\n &.flipX .{prefix}-button.flipX,\n &.flipY .{prefix}-button.flipY\n svg > use.normal\n display: none;\n svg > use.active\n display: block;\n\n/* MASK BUTTON */\n.tie-mask-apply.apply.active .{prefix}-button.apply\n label\n color: #fff;\n svg > use.active\n display: block;\n\n/* CROP BUTTON */\n.tie-crop-button,\n.tie-crop-preset-button\n .{prefix}-button.apply\n margin-right: 24px;\n .{prefix}-button.preset.active svg > use.active\n display: block;\n .{prefix}-button.apply.active svg > use.active\n display: block;\n\n\n/* SHAPE BUTTON */\n.tie-shape-button\n &.rect .{prefix}-button.rect,\n &.circle .{prefix}-button.circle,\n &.triangle .{prefix}-button.triangle\n svg > use.normal\n display: none;\n svg > use.active\n display: block;\n\n/* TEXT BUTTON */\n.tie-text-effect-button\n .{prefix}-button.active svg > use.active\n display: block;\n.tie-text-align-button\n &.left .{prefix}-button.left svg > use.active,\n &.center .{prefix}-button.center svg > use.active,\n &.right .{prefix}-button.right svg > use.active\n display: block;\n.tie-mask-image-file,\n.tie-icon-image-file\n opacity: 0;\n position: absolute;\n width: 100%;\n height: 100%;\n border: 1px solid green;\n cursor: inherit;\n left: 0;\n top: 0;\n\n\n/* FLIP BUTTON */\n.tie-zoom-button\n &.resetFlip .{prefix}-button.resetFlip,\n &.flipX .{prefix}-button.flipX,\n &.flipY .{prefix}-button.flipY\n svg > use.normal\n display: none;\n svg > use.active\n display: block;\n","prefix = 'tui-image-editor'\n\n@import 'main.styl'\n@import 'gridtable.styl'\n@import 'submenu.styl'\n@import 'checkbox.styl'\n@import 'range.styl'\n@import 'position.styl'\n@import 'icon.styl'\n@import 'colorpicker.styl'\n@import 'buttons.styl'\n.{prefix}-container.top\n &.{prefix}-top-optimization\n .{prefix}-controls ul\n text-align: right;\n .{prefix}-controls-logo\n display: none;\n"]} \ No newline at end of file diff --git a/apps/image-editor/dist/tui-image-editor.min.js b/apps/image-editor/dist/tui-image-editor.min.js index aa9ef27d3..074ec1158 100644 --- a/apps/image-editor/dist/tui-image-editor.min.js +++ b/apps/image-editor/dist/tui-image-editor.min.js @@ -1,10 +1,10 @@ /*! * tui-image-editor.min.js - * @version 3.14.0 + * @version 3.14.1 * @author NHN. FE Development Lab * @license MIT */ -!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t(require("tui-code-snippet"),require("fabric").fabric,require("tui-color-picker")):"function"==typeof define&&define.amd?define(["tui-code-snippet","fabric","tui-color-picker"],t):"object"==typeof exports?exports.ImageEditor=t(require("tui-code-snippet"),require("fabric").fabric,require("tui-color-picker")):(e.tui=e.tui||{},e.tui.ImageEditor=t(e.tui.util,e.fabric,e.tui.colorPicker))}(window,function(n,i,o){return s={},a.m=r=[function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.emptyCropRectValues=t.defaultFilterRangeValues=t.defaultTextRangeValues=t.defaultShapeStrokeValues=t.defaultDrawRangeValues=t.defaultRotateRangeValues=t.defaultIconPath=t.rejectMessages=t.fObjectOptions=t.keyCodes=t.zoomModes=t.drawingMenuNames=t.drawingModes=t.historyNames=t.eventNames=t.commandNames=t.CROPZONE_DEFAULT_OPTIONS=t.SHAPE_DEFAULT_OPTIONS=t.componentNames=t.filterType=t.OBJ_TYPE=t.SHAPE_TYPE=t.SHAPE_FILL_TYPE=t.HELP_MENUS=t.DELETE_HELP_MENUS=t.COMMAND_HELP_MENUS=t.ZOOM_HELP_MENUS=void 0;var i=n(1),o=t.ZOOM_HELP_MENUS=["zoomIn","zoomOut","hand"],a=t.COMMAND_HELP_MENUS=["history","undo","redo","reset"],r=t.DELETE_HELP_MENUS=["delete","deleteAll"];t.HELP_MENUS=[].concat(o,a,r),t.SHAPE_FILL_TYPE={FILTER:"filter",COLOR:"color"},t.SHAPE_TYPE=["rect","circle","triangle"],t.OBJ_TYPE={CROPZONE:"cropzone"},t.filterType={VINTAGE:"vintage",SEPIA2:"sepia2",REMOVE_COLOR:"removeColor",COLOR_FILTER:"colorFilter",REMOVE_WHITE:"removeWhite",BLEND_COLOR:"blendColor",BLEND:"blend"},t.componentNames=(0,i.keyMirror)("IMAGE_LOADER","CROPPER","FLIP","ROTATION","FREE_DRAWING","LINE","TEXT","ICON","FILTER","SHAPE","ZOOM"),t.SHAPE_DEFAULT_OPTIONS={lockSkewingX:!0,lockSkewingY:!0,bringForward:!0,isRegular:!1},t.CROPZONE_DEFAULT_OPTIONS={hasRotatingPoint:!1,hasBorders:!1,lockScalingFlip:!0,lockRotation:!0,lockSkewingX:!0,lockSkewingY:!0},t.commandNames={CLEAR_OBJECTS:"clearObjects",LOAD_IMAGE:"loadImage",FLIP_IMAGE:"flip",ROTATE_IMAGE:"rotate",ADD_OBJECT:"addObject",REMOVE_OBJECT:"removeObject",APPLY_FILTER:"applyFilter",REMOVE_FILTER:"removeFilter",ADD_ICON:"addIcon",CHANGE_ICON_COLOR:"changeIconColor",ADD_SHAPE:"addShape",CHANGE_SHAPE:"changeShape",ADD_TEXT:"addText",CHANGE_TEXT:"changeText",CHANGE_TEXT_STYLE:"changeTextStyle",ADD_IMAGE_OBJECT:"addImageObject",RESIZE_CANVAS_DIMENSION:"resizeCanvasDimension",SET_OBJECT_PROPERTIES:"setObjectProperties",SET_OBJECT_POSITION:"setObjectPosition",CHANGE_SELECTION:"changeSelection"},t.eventNames={OBJECT_ACTIVATED:"objectActivated",OBJECT_MOVED:"objectMoved",OBJECT_SCALED:"objectScaled",OBJECT_CREATED:"objectCreated",OBJECT_ROTATED:"objectRotated",OBJECT_ADDED:"objectAdded",OBJECT_MODIFIED:"objectModified",TEXT_EDITING:"textEditing",TEXT_CHANGED:"textChanged",ICON_CREATE_RESIZE:"iconCreateResize",ICON_CREATE_END:"iconCreateEnd",ADD_TEXT:"addText",ADD_OBJECT:"addObject",ADD_OBJECT_AFTER:"addObjectAfter",MOUSE_DOWN:"mousedown",MOUSE_UP:"mouseup",MOUSE_MOVE:"mousemove",REDO_STACK_CHANGED:"redoStackChanged",UNDO_STACK_CHANGED:"undoStackChanged",SELECTION_CLEARED:"selectionCleared",SELECTION_CREATED:"selectionCreated",EXECUTE_COMMAND:"executeCommand",AFTER_UNDO:"afterUndo",AFTER_REDO:"afterRedo",ZOOM_CHANGED:"zoomChanged",HAND_STARTED:"handStarted",HAND_STOPPED:"handStopped"},t.historyNames={LOAD_IMAGE:"Load",LOAD_MASK_IMAGE:"Mask",ADD_MASK_IMAGE:"Mask",ADD_IMAGE_OBJECT:"Mask",CROP:"Crop",APPLY_FILTER:"Filter",REMOVE_FILTER:"Filter",CHANGE_SHAPE:"Shape",CHANGE_ICON_COLOR:"Icon",ADD_TEXT:"Text",CHANGE_TEXT_STYLE:"Text",REMOVE_OBJECT:"Delete",CLEAR_OBJECTS:"Delete"},t.drawingModes=(0,i.keyMirror)("NORMAL","CROPPER","FREE_DRAWING","LINE_DRAWING","TEXT","SHAPE","ICON","ZOOM"),t.drawingMenuNames={TEXT:"text",CROP:"crop",SHAPE:"shape",ZOOM:"zoom"},t.zoomModes={DEFAULT:"normal",ZOOM:"zoom",HAND:"hand"},t.keyCodes={Z:90,Y:89,C:67,V:86,SHIFT:16,BACKSPACE:8,DEL:46,ARROW_DOWN:40,ARROW_UP:38,SPACE:32},t.fObjectOptions={SELECTION_STYLE:{borderColor:"red",cornerColor:"green",cornerSize:10,originX:"center",originY:"center",transparentCorners:!1}},t.rejectMessages={addedObject:"The object is already added.",flip:"The flipX and flipY setting values are not changed.",invalidDrawingMode:"This operation is not supported in the drawing mode.",invalidParameters:"Invalid parameters.",isLock:"The executing command state is locked.",loadImage:"The background image is empty.",loadingImageFailed:"Invalid image loaded.",noActiveObject:"There is no active object.",noObject:"The object is not in canvas.",redo:"The promise of redo command is reject.",rotation:"The current angle is same the old angle.",undo:"The promise of undo command is reject.",unsupportedOperation:"Unsupported operation.",unsupportedType:"Unsupported object type."},t.defaultIconPath={"icon-arrow":"M40 12V0l24 24-24 24V36H0V12h40z","icon-arrow-2":"M49,32 H3 V22 h46 l-18,-18 h12 l23,23 L43,50 h-12 l18,-18 z ","icon-arrow-3":"M43.349998,27 L17.354,53 H1.949999 l25.996,-26 L1.949999,1 h15.404 L43.349998,27 z ","icon-star":"M35,54.557999 l-19.912001,10.468 l3.804,-22.172001 l-16.108,-15.7 l22.26,-3.236 L35,3.746 l9.956,20.172001 l22.26,3.236 l-16.108,15.7 l3.804,22.172001 z ","icon-star-2":"M17,31.212 l-7.194,4.08 l-4.728,-6.83 l-8.234,0.524 l-1.328,-8.226 l-7.644,-3.14 l2.338,-7.992 l-5.54,-6.18 l5.54,-6.176 l-2.338,-7.994 l7.644,-3.138 l1.328,-8.226 l8.234,0.522 l4.728,-6.83 L17,-24.312 l7.194,-4.08 l4.728,6.83 l8.234,-0.522 l1.328,8.226 l7.644,3.14 l-2.338,7.992 l5.54,6.178 l-5.54,6.178 l2.338,7.992 l-7.644,3.14 l-1.328,8.226 l-8.234,-0.524 l-4.728,6.83 z ","icon-polygon":"M3,31 L19,3 h32 l16,28 l-16,28 H19 z ","icon-location":"M24 62C8 45.503 0 32.837 0 24 0 10.745 10.745 0 24 0s24 10.745 24 24c0 8.837-8 21.503-24 38zm0-28c5.523 0 10-4.477 10-10s-4.477-10-10-10-10 4.477-10 10 4.477 10 10 10z","icon-heart":"M49.994999,91.349998 l-6.96,-6.333 C18.324001,62.606995 2.01,47.829002 2.01,29.690998 C2.01,14.912998 13.619999,3.299999 28.401001,3.299999 c8.349,0 16.362,5.859 21.594,12 c5.229,-6.141 13.242001,-12 21.591,-12 c14.778,0 26.390999,11.61 26.390999,26.390999 c0,18.138 -16.314001,32.916 -41.025002,55.374001 l-6.96,6.285 z ","icon-bubble":"M44 48L34 58V48H12C5.373 48 0 42.627 0 36V12C0 5.373 5.373 0 12 0h40c6.627 0 12 5.373 12 12v24c0 6.627-5.373 12-12 12h-8z"},t.defaultRotateRangeValues={realTimeEvent:!0,min:-360,max:360,value:0},t.defaultDrawRangeValues={min:5,max:30,value:12},t.defaultShapeStrokeValues={realTimeEvent:!0,min:2,max:300,value:3},t.defaultTextRangeValues={realTimeEvent:!0,min:10,max:100,value:50},t.defaultFilterRangeValues={tintOpacityRange:{realTimeEvent:!0,min:0,max:1,value:.7,useDecimal:!0},removewhiteDistanceRange:{realTimeEvent:!0,min:0,max:1,value:.2,useDecimal:!0},brightnessRange:{realTimeEvent:!0,min:-1,max:1,value:0,useDecimal:!0},noiseRange:{realTimeEvent:!0,min:0,max:1e3,value:100},pixelateRange:{realTimeEvent:!0,min:2,max:20,value:4},colorfilterThresholdRange:{realTimeEvent:!0,min:0,max:1,value:.2,useDecimal:!0},blurFilterRange:{value:.1}},t.emptyCropRectValues={LEFT:0,TOP:0,WIDTH:.5,HEIGHT:.5}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Promise=void 0,t.clamp=function(e,t,n){if(nthis._max)){var o=(0,l.clamp)(i,this._min,this.max);this.value=o,this.fire("change",o,!1)}}}},{key:"_valueUpDownForKeyEvent",value:function(e,t){var n=this._useDecimal?.1:1;return t===c.keyCodes.ARROW_UP?e+=n:t===c.keyCodes.ARROW_DOWN&&(e-=n),e}},{key:"_changeValueWithInput",value:function(e,t){var n=t.keyCode,i=t.target;if(!(0<=[c.keyCodes.ARROW_UP,c.keyCodes.ARROW_DOWN].indexOf(n))){var o=this._filterForInputText(i.value),a=!o||isNaN(o);if(i.value=o,!a){var r=(this._useDecimal?Number:l.toInteger)(o);r=(0,l.clamp)(r,this._min,this.max),this.value=r,this.fire("change",r,e)}}}},{key:"_addClickEvent",value:function(){this.rangeElement.addEventListener("click",this.eventHandler.changeSlideFinally)}},{key:"_removeClickEvent",value:function(){this.rangeElement.removeEventListener("click",this.eventHandler.changeSlideFinally)}},{key:"_addDragEvent",value:function(){this.pointer.addEventListener("mousedown",this.eventHandler.startChangingSlide)}},{key:"_removeDragEvent",value:function(){this.pointer.removeEventListener("mousedown",this.eventHandler.startChangingSlide)}},{key:"_changeSlide",value:function(e){var t=e.screenX-this.firstPosition,n=this.firstLeft+t;n=(n=n>this.rangeWidth?this.rangeWidth:n)<0?0:n,this.pointer.style.left=n+"px",this.subbar.style.right=this.rangeWidth-n+"px";var i=n/this.rangeWidth,o=this._absMax*i+this._min,a=this._useDecimal?o:(0,l.toInteger)(o);this.value!==a&&(this.value=a,this.realTimeEvent&&this.fire("change",this._value,!1))}},{key:"_changeSlideFinally",value:function(e){if(e.stopPropagation(),"tui-image-editor-range"===e.target.className){var t=e.offsetX/this.rangeWidth,n=this._absMax*t+this._min;this.pointer.style.left=t*this.rangeWidth+"px",this.subbar.style.right=(1-t)*this.rangeWidth+"px",this.value=n,this.fire("change",n,!0)}}},{key:"_startChangingSlide",value:function(e){this.firstPosition=e.screenX,this.firstLeft=(0,l.toInteger)(this.pointer.style.left)||0,document.addEventListener("mousemove",this.eventHandler.changeSlide),document.addEventListener("mouseup",this.eventHandler.stopChangingSlide)}},{key:"_stopChangingSlide",value:function(){this.fire("change",this._value,!0),document.removeEventListener("mousemove",this.eventHandler.changeSlide),document.removeEventListener("mouseup",this.eventHandler.stopChangingSlide)}},{key:"_filterForInputText",value:function(e){return e.replace(u,"$1$2$3")}},{key:"max",set:function(e){this._max=e,this._absMax=-1*this._min+this._max,this.value=this._value},get:function(){return this._max}},{key:"value",get:function(){return this._value},set:function(e){var t=((e=this._useDecimal?e:(0,l.toInteger)(e))-this._min)*this.rangeWidth/this._absMax;this.rangeWidth"+e+""}var a,r=n(11),s=n(88),l=n(58),c=n(37),u=n(59),h=n(35),d=n(36),f="prototype",v="script",p=d("IE_PROTO"),m=function(){try{a=document.domain&&new ActiveXObject("htmlfile")}catch(e){}var e,t;m=a?function(e){e.write(o("")),e.close();var t=e.parentWindow.Object;return e=null,t}(a):((t=h("iframe")).style.display="none",u.appendChild(t),t.src=String("javascript:"),(e=t.contentWindow.document).open(),e.write(o("document.F=Object")),e.close(),e.F);for(var n=l.length;n--;)delete m[f][l[n]];return m()};c[p]=!0,e.exports=Object.create||function(e,t){var n;return null!==e?(i[f]=r(e),n=new i,i[f]=null,n[p]=e):n=m(),void 0===t?n:s(n,t)}},function(e,t,n){var i=n(33),o=Math.min;e.exports=function(e){return 0this._max)){var o=(0,l.clamp)(i,this._min,this.max);this.value=o,this.fire("change",o,!1)}}}},{key:"_valueUpDownForKeyEvent",value:function(e,t){var n=this._useDecimal?.1:1;return t===c.keyCodes.ARROW_UP?e+=n:t===c.keyCodes.ARROW_DOWN&&(e-=n),e}},{key:"_changeValueWithInput",value:function(e,t){var n=t.keyCode,i=t.target;if(!(0<=[c.keyCodes.ARROW_UP,c.keyCodes.ARROW_DOWN].indexOf(n))){var o=this._filterForInputText(i.value),a=!o||isNaN(o);if(i.value=o,!a){var r=(this._useDecimal?Number:l.toInteger)(o);r=(0,l.clamp)(r,this._min,this.max),this.value=r,this.fire("change",r,e)}}}},{key:"_addClickEvent",value:function(){this.rangeElement.addEventListener("click",this.eventHandler.changeSlideFinally)}},{key:"_removeClickEvent",value:function(){this.rangeElement.removeEventListener("click",this.eventHandler.changeSlideFinally)}},{key:"_addDragEvent",value:function(){this.pointer.addEventListener("mousedown",this.eventHandler.startChangingSlide)}},{key:"_removeDragEvent",value:function(){this.pointer.removeEventListener("mousedown",this.eventHandler.startChangingSlide)}},{key:"_changeSlide",value:function(e){var t=e.screenX-this.firstPosition,n=this.firstLeft+t;n=(n=n>this.rangeWidth?this.rangeWidth:n)<0?0:n,this.pointer.style.left=n+"px",this.subbar.style.right=this.rangeWidth-n+"px";var i=n/this.rangeWidth,o=this._absMax*i+this._min,a=this._useDecimal?o:(0,l.toInteger)(o);this.value!==a&&(this.value=a,this.realTimeEvent&&this.fire("change",this._value,!1))}},{key:"_changeSlideFinally",value:function(e){if(e.stopPropagation(),"tui-image-editor-range"===e.target.className){var t=e.offsetX/this.rangeWidth,n=this._absMax*t+this._min;this.pointer.style.left=t*this.rangeWidth+"px",this.subbar.style.right=(1-t)*this.rangeWidth+"px",this.value=n,this.fire("change",n,!0)}}},{key:"_startChangingSlide",value:function(e){this.firstPosition=e.screenX,this.firstLeft=(0,l.toInteger)(this.pointer.style.left)||0,document.addEventListener("mousemove",this.eventHandler.changeSlide),document.addEventListener("mouseup",this.eventHandler.stopChangingSlide)}},{key:"_stopChangingSlide",value:function(){this.fire("change",this._value,!0),document.removeEventListener("mousemove",this.eventHandler.changeSlide),document.removeEventListener("mouseup",this.eventHandler.stopChangingSlide)}},{key:"_filterForInputText",value:function(e){return e.replace(u,"$1$2$3")}},{key:"max",set:function(e){this._max=e,this._absMax=-1*this._min+this._max,this.value=this._value},get:function(){return this._max}},{key:"value",get:function(){return this._value},set:function(e){var t=((e=this._useDecimal?e:(0,l.toInteger)(e))-this._min)*this.rangeWidth/this._absMax;this.rangeWidth"+e+""}var a,r=n(11),s=n(88),l=n(58),c=n(37),u=n(59),h=n(35),d=n(36),f="prototype",v="script",p=d("IE_PROTO"),m=function(){try{a=document.domain&&new ActiveXObject("htmlfile")}catch(e){}var e,t;m=a?function(e){e.write(o("")),e.close();var t=e.parentWindow.Object;return e=null,t}(a):((t=h("iframe")).style.display="none",u.appendChild(t),t.src=String("javascript:"),(e=t.contentWindow.document).open(),e.write(o("document.F=Object")),e.close(),e.F);for(var n=l.length;n--;)delete m[f][l[n]];return m()};c[p]=!0,e.exports=Object.create||function(e,t){var n;return null!==e?(i[f]=r(e),n=new i,i[f]=null,n[p]=e):n=m(),void 0===t?n:s(n,t)}},function(e,t,n){var i=n(33),o=Math.min;e.exports=function(e){return 0=n.length?{value:void 0,done:!0}:(e=o(n,i),t.index+=e.length,{value:e,done:!1})})},function(e,t,n){function i(s){return function(e,t){var n,i,o=String(c(e)),a=l(t),r=o.length;return a<0||r<=a?s?"":void 0:(n=o.charCodeAt(a))<55296||56319o;)r(i,n=t[o++])&&(~l(a,n)||a.push(n));return a}},function(e,t,n){function i(s){return function(e,t,n){var i,o=l(e),a=c(o.length),r=u(n,a);if(s&&t!=t){for(;r=t.length?{value:e.target=void 0,done:!0}:"keys"==n?{value:i,done:!1}:"values"==n?{value:t[i],done:!1}:{value:[i,t[i]],done:!1}},"values"),a.Arguments=a.Array,o("keys"),o("values"),o("entries")},function(e,t){e.exports=function(){}},function(e,t){e.exports={CSSRuleList:0,CSSStyleDeclaration:0,CSSValueList:0,ClientRectList:0,DOMRectList:0,DOMStringList:0,DOMTokenList:1,DataTransferItemList:0,FileList:0,HTMLAllCollection:0,HTMLCollection:0,HTMLFormElement:0,HTMLSelectElement:0,MediaList:0,MimeTypeArray:0,NamedNodeMap:0,NodeList:1,PaintRequestList:0,Plugin:0,PluginArray:0,SVGLengthList:0,SVGNumberList:0,SVGPathSegList:0,SVGPointList:0,SVGStringList:0,SVGTransformList:0,SourceBufferList:0,StyleSheetList:0,TextTrackCueList:0,TextTrackList:0,TouchList:0}},function(e,t,n){"use strict";function p(e){var t;return!(!k(e)||"function"!=typeof(t=e.then))&&t}function a(h,d,f){if(!d.notified){d.notified=!0;var v=d.reactions;T(function(){for(var e=d.value,t=1==d.state,n=0;v.length>n;){var i,o,a,r=v[n++],s=t?r.ok:r.fail,l=r.resolve,c=r.reject,u=r.domain;try{s?(t||(2===d.rejection&&oe(h,d),d.rejection=1),!0===s?i=e:(u&&u.enter(),i=s(e),u&&(u.exit(),a=!0)),i===r.promise?c(X("Promise-chain cycle")):(o=p(i))?o.call(i,l,c):l(i)):c(e)}catch(e){u&&!a&&u.exit(),c(e)}}d.reactions=[],d.notified=!1,f&&!d.rejection&&ne(h,d)})}}function o(e,t,n){var i,o;$?((i=Y.createEvent("Event")).promise=t,i.reason=n,i.initEvent(e,!1,!0),f.dispatchEvent(i)):i={promise:t,reason:n},(o=f["on"+e])?o(i):e===Q&&I("Unhandled promise rejection",n)}function r(t,n,i,o){return function(e){t(n,i,e,o)}}function s(e,t,n,i){t.done||(t.done=!0,i&&(t=i),t.value=n,t.state=2,a(e,t,!0))}var i,l,c,u,h=n(15),d=n(21),f=n(5),v=n(18),m=n(61),g=n(29),y=n(100),b=n(41),_=n(101),k=n(14),E=n(17),w=n(102),O=n(22),M=n(45),C=n(30),x=n(106),S=n(62),P=n(63).set,T=n(107),j=n(66),I=n(108),A=n(23),L=n(31),D=n(26),H=n(53),z=n(6),R=n(109),N=z("species"),F="Promise",B=D.get,V=D.set,U=D.getterFor(F),W=m,X=f.TypeError,Y=f.document,G=f.process,Z=v("fetch"),q=A.f,J=q,K="process"==O(G),$=!!(Y&&Y.createEvent&&f.dispatchEvent),Q="unhandledrejection",ee=H(F,function(){if(!(M(W)!==String(W))){if(66===R)return!0;if(!K&&"function"!=typeof PromiseRejectionEvent)return!0}if(d&&!W.prototype.finally)return!0;if(51<=R&&/native code/.test(W))return!1;function e(e){e(function(){},function(){})}var t=W.resolve(1);return(t.constructor={})[N]=e,!(t.then(function(){})instanceof e)}),te=ee||!x(function(e){W.all(e).catch(function(){})}),ne=function(n,i){P.call(f,function(){var e,t=i.value;if(ie(i)&&(e=L(function(){K?G.emit("unhandledRejection",t,n):o(Q,n,t)}),i.rejection=K||ie(i)?2:1,e.error))throw e.value})},ie=function(e){return 1!==e.rejection&&!e.parent},oe=function(e,t){P.call(f,function(){K?G.emit("rejectionHandled",e):o("rejectionhandled",e,t.value)})},ae=function(n,i,e,t){if(!i.done){i.done=!0,t&&(i=t);try{if(n===e)throw X("Promise can't be resolved itself");var o=p(e);o?T(function(){var t={done:!1};try{o.call(e,r(ae,n,t,i),r(s,n,t,i))}catch(e){s(n,t,e,i)}}):(i.value=e,i.state=1,a(n,i,!1))}catch(e){s(n,{done:!1},e,i)}}};ee&&(W=function(e){w(this,W,F),E(e),i.call(this);var t=B(this);try{e(r(ae,this,t),r(s,this,t))}catch(e){s(this,t,e)}},(i=function(){V(this,{type:F,done:!1,notified:!1,parent:!1,reactions:[],rejection:!1,state:0,value:void 0})}).prototype=y(W.prototype,{then:function(e,t){var n=U(this),i=q(S(this,W));return i.ok="function"!=typeof e||e,i.fail="function"==typeof t&&t,i.domain=K?G.domain:void 0,n.parent=!0,n.reactions.push(i),0!=n.state&&a(this,n,!1),i.promise},catch:function(e){return this.then(void 0,e)}}),l=function(){var e=new i,t=B(e);this.promise=e,this.resolve=r(ae,e,t),this.reject=r(s,e,t)},A.f=q=function(e){return e===W||e===c?new l:J(e)},d||"function"!=typeof m||(u=m.prototype.then,g(m.prototype,"then",function(e,t){var n=this;return new W(function(e,t){u.call(n,e,t)}).then(e,t)},{unsafe:!0}),"function"==typeof Z&&h({global:!0,enumerable:!0,forced:!0},{fetch:function(e){return j(W,Z.apply(f,arguments))}}))),h({global:!0,wrap:!0,forced:ee},{Promise:W}),b(W,F,!1,!0),_(F),c=v(F),h({target:F,stat:!0,forced:ee},{reject:function(e){var t=q(this);return t.reject.call(void 0,e),t.promise}}),h({target:F,stat:!0,forced:d||ee},{resolve:function(e){return j(d&&this===c?W:this,e)}}),h({target:F,stat:!0,forced:te},{all:function(e){var s=this,t=q(s),l=t.resolve,c=t.reject,n=L(function(){var i=E(s.resolve),o=[],a=0,r=1;C(e,function(e){var t=a++,n=!1;o.push(void 0),r++,i.call(s,e).then(function(e){n||(n=!0,o[t]=e,--r||l(o))},c)}),--r||l(o)});return n.error&&c(n.value),t.promise},race:function(e){var n=this,i=q(n),o=i.reject,t=L(function(){var t=E(n.resolve);C(e,function(e){t.call(n,e).then(i.resolve,o)})});return t.error&&o(t.value),i.promise}})},function(e,t,n){var o=n(29);e.exports=function(e,t,n){for(var i in t)n&&n.unsafe&&e[i]?e[i]=t[i]:o(e,i,t[i],n);return e}},function(e,t,n){"use strict";var i=n(18),o=n(20),a=n(6),r=n(13),s=a("species");e.exports=function(e){var t=i(e),n=o.f;r&&t&&!t[s]&&n(t,s,{configurable:!0,get:function(){return this}})}},function(e,t){e.exports=function(e,t,n){if(!(e instanceof t))throw TypeError("Incorrect "+(n?n+" ":"")+"invocation");return e}},function(e,t,n){var i=n(6),o=n(19),a=i("iterator"),r=Array.prototype;e.exports=function(e){return void 0!==e&&(o.Array===e||r[a]===e)}},function(e,t,n){var i=n(43),o=n(19),a=n(6)("iterator");e.exports=function(e){if(null!=e)return e[a]||e["@@iterator"]||o[i(e)]}},function(e,t,n){var a=n(11);e.exports=function(t,e,n,i){try{return i?e(a(n)[0],n[1]):e(n)}catch(e){var o=t.return;throw void 0!==o&&a(o.call(t)),e}}},function(e,t,n){var o=n(6)("iterator"),a=!1;try{var i=0,r={next:function(){return{done:!!i++}},return:function(){a=!0}};r[o]=function(){return this},Array.from(r,function(){throw 2})}catch(e){}e.exports=function(e,t){if(!t&&!a)return!1;var n=!1;try{var i={};i[o]=function(){return{next:function(){return{done:n=!0}}}},e(i)}catch(e){}return n}},function(e,t,n){var i,o,a,r,s,l,c,u,h=n(5),d=n(52).f,f=n(22),v=n(63).set,p=n(64),m=h.MutationObserver||h.WebKitMutationObserver,g=h.process,y=h.Promise,b="process"==f(g),_=d(h,"queueMicrotask"),k=_&&_.value;k||(i=function(){var e,t;for(b&&(e=g.domain)&&e.exit();o;){t=o.fn,o=o.next;try{t()}catch(e){throw o?r():a=void 0,e}}a=void 0,e&&e.enter()},r=b?function(){g.nextTick(i)}:m&&!p?(s=!0,l=document.createTextNode(""),new m(i).observe(l,{characterData:!0}),function(){l.data=s=!s}):y&&y.resolve?(c=y.resolve(void 0),u=c.then,function(){u.call(c,i)}):function(){v.call(h,i)}),e.exports=k||function(e){var t={fn:e,next:void 0};a&&(a.next=t),o||(o=t,r()),a=t}},function(e,t,n){var i=n(5);e.exports=function(e,t){var n=i.console;n&&n.error&&(1===arguments.length?n.error(e):n.error(e,t))}},function(e,t,n){var i,o,a=n(5),r=n(65),s=a.process,l=s&&s.versions,c=l&&l.v8;c?o=(i=c.split("."))[0]+i[1]:r&&(!(i=r.match(/Edge\/(\d+)/))||74<=i[1])&&(i=r.match(/Chrome\/(\d+)/))&&(o=i[1]),e.exports=o&&+o},function(e,t,n){"use strict";var i=n(15),o=n(21),a=n(61),r=n(10),s=n(18),l=n(62),c=n(66),u=n(29);i({target:"Promise",proto:!0,real:!0,forced:!!a&&r(function(){a.prototype.finally.call({then:function(){}},function(){})})},{finally:function(t){var n=l(this,s("Promise")),e="function"==typeof t;return this.then(e?function(e){return c(n,t()).then(function(){return e})}:t,e?function(e){return c(n,t()).then(function(){throw e})}:t)}}),o||"function"!=typeof a||a.prototype.finally||u(a.prototype,"finally",s("Promise").prototype.finally)},function(e,t,n){"use strict";var i=n(15),o=n(13),a=n(40),r=n(60),s=n(56),l=n(20),c=n(27),u=n(30),h=n(8),d=n(26),f=d.set,v=d.getterFor("AggregateError"),p=function(e,t){var n=this;if(!(n instanceof p))return new p(e,t);r&&(n=r(new Error(t),a(n)));var i=[];return u(e,i.push,i),o?f(n,{errors:i,type:"AggregateError"}):n.errors=i,void 0!==t&&h(n,"message",String(t)),n};p.prototype=s(Error.prototype,{constructor:c(5,p),message:c(5,""),name:c(5,"AggregateError")}),o&&l.f(p.prototype,"errors",{get:function(){return v(this).errors},configurable:!0}),i({global:!0},{AggregateError:p})},function(e,t,n){n(67)},function(e,t,n){"use strict";var i=n(15),o=n(23),a=n(31);i({target:"Promise",stat:!0},{try:function(e){var t=o.f(this),n=a(e);return(n.error?t.reject:t.resolve)(n.value),t.promise}})},function(e,t,n){"use strict";var i=n(15),h=n(17),d=n(18),o=n(23),a=n(31),f=n(30),v="No one promise resolved";i({target:"Promise",stat:!0},{any:function(e){var l=this,t=o.f(l),c=t.resolve,u=t.reject,n=a(function(){var i=h(l.resolve),o=[],a=0,r=1,s=!1;f(e,function(e){var t=a++,n=!1;o.push(void 0),r++,i.call(l,e).then(function(e){n||s||(s=!0,c(e))},function(e){n||s||(n=!0,o[t]=e,--r||u(new(d("AggregateError"))(o,v)))})}),--r||u(new(d("AggregateError"))(o,v))});return n.error&&u(n.value),t.promise}})},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=function(e,t,n){return t&&o(e.prototype,t),n&&o(e,n),e};function o(e,t){for(var n=0;n\n \n \n \n ',this._editorContainerElement=this._editorElement.querySelector(".tui-image-editor-canvas-container"),this._editorContainerElement.appendChild(n)}},{key:"_getLoadImage",value:function(){return this.options.loadImage}},{key:"changeMenu",value:function(e,t,n){var i=!(1this._editorElementWrap.scrollHeight-150?(i-this._editorElementWrap.scrollHeight)/2:-75:"top"===e?a=i>this._editorElementWrap.offsetHeight-150?75-(i-(this._editorElementWrap.offsetHeight-150))/2:75:"left"===e?r=n>this._editorElementWrap.offsetWidth-248?124-(n-(this._editorElementWrap.offsetWidth-248))/2:124:"right"===e&&(r=n>this._editorElementWrap.scrollWidth-248?(n-this._editorElementWrap.scrollWidth)/2:-124)),o.top=a+"px",o.left=r+"px"}}]),T);function T(e,t,n){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,T),this.options=this._initializeOption(t),this._actions=n,this.submenu=!1,this.imageSize={},this.uiSize={},this._locale=new k.default(this.options.locale),this.theme=new u.default(this.options.theme),this.eventHandler={},this._submenuChangeTransection=!1,this._selectedElement=null,this._mainElement=null,this._editorElementWrap=null,this._editorElement=null,this._menuBarElement=null,this._subMenuElement=null,this._makeUiElement(e),this._setUiSize(),this._initMenuEvent=!1,this._makeSubMenu(),this._attachHistoryEvent(),this._attachZoomEvent()}O.mixin(P),t.default=P},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){var t=e.locale,n=e.biImage,i=e.commonStyle,o=e.headerStyle,a=e.loadButtonStyle,r=e.downloadButtonStyle,s=e.submenuStyle;return'\n
          \n
          \n \n
          \n
          \n '+t.localize("Load")+'\n \n
          \n \n
          \n
          \n
          \n
          \n
          \n
          \n
          \n
          \n
          \n
          \n
          \n
          \n
          \n
          \n
          \n'}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(1);t.default=function(e){var t=e.locale,n=e.biImage,i=e.loadButtonStyle,o=e.downloadButtonStyle,a=e.menuBarPosition;return'\n
            \n
            \n \n
              \n\n
              \n
              \n '+t.localize("Load")+'\n \n
              \n \n
              \n
              \n"}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=function(e,t,n){return t&&o(e.prototype,t),n&&o(e,n),e};function o(e,t){for(var n=0;n'}).join("")}},{key:"makeMenSvgIconSet",value:function(e,t,n){var i=2'+this._makeSvgItem(e,t,i)+""}}]),d);function d(e){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,d),this.styles=this._changeToObject((0,r.extend)({},s.default,e)),(0,c.styleLoad)(this._styleMaker()),this._loadDefaultSvgIcon()}t.default=h},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){var t=e.subMenuLabelActive,n=e.subMenuLabelNormal,i=e.subMenuRangeTitle,o=e.submenuPartitionVertical,a=e.submenuPartitionHorizontal,r=e.submenuCheckbox,s=e.submenuRangePointer,l=e.submenuRangeValue,c=e.submenuColorpickerTitle,u=e.submenuColorpickerButton,h=e.submenuRangeBar,d=e.submenuRangeSubbar,f=e.submenuDisabledRangePointer,v=e.submenuDisabledRangeBar,p=e.submenuDisabledRangeSubbar,m=e.submenuIconSize,g=e.menuIconSize,y=e.biSize,b=e.menuIconStyle,_=e.submenuIconStyle;return'\n .tie-icon-add-button.icon-bubble .tui-image-editor-button[data-icontype="icon-bubble"] label,\n .tie-icon-add-button.icon-heart .tui-image-editor-button[data-icontype="icon-heart"] label,\n .tie-icon-add-button.icon-location .tui-image-editor-button[data-icontype="icon-location"] label,\n .tie-icon-add-button.icon-polygon .tui-image-editor-button[data-icontype="icon-polygon"] label,\n .tie-icon-add-button.icon-star .tui-image-editor-button[data-icontype="icon-star"] label,\n .tie-icon-add-button.icon-star-2 .tui-image-editor-button[data-icontype="icon-star-2"] label,\n .tie-icon-add-button.icon-arrow-3 .tui-image-editor-button[data-icontype="icon-arrow-3"] label,\n .tie-icon-add-button.icon-arrow-2 .tui-image-editor-button[data-icontype="icon-arrow-2"] label,\n .tie-icon-add-button.icon-arrow .tui-image-editor-button[data-icontype="icon-arrow"] label,\n .tie-icon-add-button.icon-bubble .tui-image-editor-button[data-icontype="icon-bubble"] label,\n .tie-draw-line-select-button.line .tui-image-editor-button.line label,\n .tie-draw-line-select-button.free .tui-image-editor-button.free label,\n .tie-flip-button.flipX .tui-image-editor-button.flipX label,\n .tie-flip-button.flipY .tui-image-editor-button.flipY label,\n .tie-flip-button.resetFlip .tui-image-editor-button.resetFlip label,\n .tie-crop-button .tui-image-editor-button.apply.active label,\n .tie-crop-preset-button .tui-image-editor-button.preset.active label,\n .tie-shape-button.rect .tui-image-editor-button.rect label,\n .tie-shape-button.circle .tui-image-editor-button.circle label,\n .tie-shape-button.triangle .tui-image-editor-button.triangle label,\n .tie-text-effect-button .tui-image-editor-button.active label,\n .tie-text-align-button.left .tui-image-editor-button.left label,\n .tie-text-align-button.center .tui-image-editor-button.center label,\n .tie-text-align-button.right .tui-image-editor-button.right label,\n .tie-mask-apply.apply.active .tui-image-editor-button.apply label,\n .tui-image-editor-container .tui-image-editor-submenu .tui-image-editor-button:hover > label,\n .tui-image-editor-container .tui-image-editor-checkbox label > span {\n '+t+"\n }\n .tui-image-editor-container .tui-image-editor-submenu .tui-image-editor-button > label,\n .tui-image-editor-container .tui-image-editor-range-wrap.tui-image-editor-newline.short label,\n .tui-image-editor-container .tui-image-editor-range-wrap.tui-image-editor-newline.short label > span {\n "+n+"\n }\n .tui-image-editor-container .tui-image-editor-range-wrap label > span {\n "+i+"\n }\n .tui-image-editor-container .tui-image-editor-partition > div {\n "+o+"\n }\n .tui-image-editor-container.left .tui-image-editor-submenu .tui-image-editor-partition > div,\n .tui-image-editor-container.right .tui-image-editor-submenu .tui-image-editor-partition > div {\n "+a+"\n }\n .tui-image-editor-container .tui-image-editor-checkbox label > span:before {\n "+r+"\n }\n .tui-image-editor-container .tui-image-editor-checkbox label > input:checked + span:before {\n border: 0;\n }\n .tui-image-editor-container .tui-image-editor-virtual-range-pointer {\n "+s+"\n }\n .tui-image-editor-container .tui-image-editor-virtual-range-bar {\n "+h+"\n }\n .tui-image-editor-container .tui-image-editor-virtual-range-subbar {\n "+d+"\n }\n .tui-image-editor-container .tui-image-editor-disabled .tui-image-editor-virtual-range-pointer {\n "+f+"\n }\n .tui-image-editor-container .tui-image-editor-disabled .tui-image-editor-virtual-range-subbar {\n "+p+"\n }\n .tui-image-editor-container .tui-image-editor-disabled .tui-image-editor-virtual-range-bar {\n "+v+"\n }\n .tui-image-editor-container .tui-image-editor-range-value {\n "+l+"\n }\n .tui-image-editor-container .tui-image-editor-submenu .tui-image-editor-button .color-picker-value + label {\n "+c+"\n }\n .tui-image-editor-container .tui-image-editor-submenu .tui-image-editor-button .color-picker-value {\n "+u+"\n }\n .tui-image-editor-container .svg_ic-menu {\n "+g+"\n }\n .tui-image-editor-container .svg_ic-submenu {\n "+m+"\n }\n .tui-image-editor-container .tui-image-editor-controls-logo > img,\n .tui-image-editor-container .tui-image-editor-header-logo > img {\n "+y+"\n }\n .tui-image-editor-menu use.normal.use-default,\n .tui-image-editor-help-menu use.normal.use-default {\n fill-rule: evenodd;\n fill: "+b.normal.color+";\n stroke: "+b.normal.color+";\n }\n .tui-image-editor-menu use.active.use-default,\n .tui-image-editor-help-menu use.active.use-default {\n fill-rule: evenodd;\n fill: "+b.active.color+";\n stroke: "+b.active.color+";\n }\n .tui-image-editor-menu use.hover.use-default,\n .tui-image-editor-help-menu use.hover.use-default {\n fill-rule: evenodd;\n fill: "+b.hover.color+";\n stroke: "+b.hover.color+";\n }\n .tui-image-editor-menu use.disabled.use-default,\n .tui-image-editor-help-menu use.disabled.use-default {\n fill-rule: evenodd;\n fill: "+b.disabled.color+";\n stroke: "+b.disabled.color+";\n }\n .tui-image-editor-submenu use.normal.use-default {\n fill-rule: evenodd;\n fill: "+_.normal.color+";\n stroke: "+_.normal.color+";\n }\n .tui-image-editor-submenu use.active.use-default {\n fill-rule: evenodd;\n fill: "+_.active.color+";\n stroke: "+_.active.color+";\n }\n"}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default={"common.bi.image":"https://uicdn.toast.com/toastui/img/tui-image-editor-bi.png","common.bisize.width":"251px","common.bisize.height":"21px","common.backgroundImage":"none","common.backgroundColor":"#1e1e1e","common.border":"0px","header.backgroundImage":"none","header.backgroundColor":"transparent","header.border":"0px","loadButton.backgroundColor":"#fff","loadButton.border":"1px solid #ddd","loadButton.color":"#222","loadButton.fontFamily":"'Noto Sans', sans-serif","loadButton.fontSize":"12px","downloadButton.backgroundColor":"#fdba3b","downloadButton.border":"1px solid #fdba3b","downloadButton.color":"#fff","downloadButton.fontFamily":"'Noto Sans', sans-serif","downloadButton.fontSize":"12px","menu.normalIcon.color":"#8a8a8a","menu.activeIcon.color":"#555555","menu.disabledIcon.color":"#434343","menu.hoverIcon.color":"#e9e9e9","submenu.normalIcon.color":"#8a8a8a","submenu.activeIcon.color":"#e9e9e9","menu.iconSize.width":"24px","menu.iconSize.height":"24px","submenu.iconSize.width":"32px","submenu.iconSize.height":"32px","submenu.backgroundColor":"#1e1e1e","submenu.partition.color":"#3c3c3c","submenu.normalLabel.color":"#8a8a8a","submenu.normalLabel.fontWeight":"lighter","submenu.activeLabel.color":"#fff","submenu.activeLabel.fontWeight":"lighter","checkbox.border":"0px","checkbox.backgroundColor":"#fff","range.pointer.color":"#fff","range.bar.color":"#666","range.subbar.color":"#d1d1d1","range.disabledPointer.color":"#414141","range.disabledBar.color":"#282828","range.disabledSubbar.color":"#414141","range.value.color":"#fff","range.value.fontWeight":"lighter","range.value.fontSize":"11px","range.value.border":"1px solid #353535","range.value.backgroundColor":"#151515","range.title.color":"#fff","range.title.fontWeight":"lighter","colorpicker.button.border":"1px solid #1e1e1e","colorpicker.title.color":"#fff"}},function(e,t){e.exports=''},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=function(e,t,n){return t&&o(e.prototype,t),n&&o(e,n),e};function o(e,t){for(var n=0;n\n
            • \n
              \n
              \n '+n(["normal","active"],"shape-rectangle",!0)+"\n
              \n \n
              \n
              \n
              \n '+n(["normal","active"],"shape-circle",!0)+"\n
              \n \n
              \n
              \n
              \n '+n(["normal","active"],"shape-triangle",!0)+"\n
              \n \n
              \n
            • \n
            • \n
              \n
            • \n
            • \n
              \n
              \n
            • \n
            • \n
              \n
            • \n
            • \n \n
              \n \n
            • \n \n'}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=function(e,t,n){return t&&o(e.prototype,t),n&&o(e,n),e};function o(e,t){for(var n=0;n\n
            • \n
              \n
              \n '+n(["normal","active"],"shape-rectangle",!0)+"\n
              \n \n
              \n
              \n
              \n '+n(["normal","active"],"crop",!0)+"\n
              \n \n
              \n
              \n
              \n '+n(["normal","active"],"crop",!0)+"\n
              \n \n
              \n
              \n
              \n '+n(["normal","active"],"crop",!0)+"\n
              \n \n
              \n
              \n
              \n '+n(["normal","active"],"crop",!0)+"\n
              \n \n
              \n
              \n
              \n '+n(["normal","active"],"crop",!0)+"\n
              \n \n
              \n
              \n
              \n '+n(["normal","active"],"crop",!0)+"\n
              \n \n
              \n
            • \n
            • \n
            • \n
            • \n
              \n
            • \n
            • \n
              \n '+n(["normal","active"],"apply")+"\n \n
              \n
              \n '+n(["normal","active"],"cancel")+"\n \n
              \n
            • \n \n"}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=function(e,t,n){return t&&o(e.prototype,t),n&&o(e,n),e};function o(e,t){for(var n=0;n\n
            • \n
              \n
              \n '+n(["normal","active"],"flip-x",!0)+"\n
              \n \n
              \n
              \n
              \n '+n(["normal","active"],"flip-y",!0)+"\n
              \n \n
              \n
            • \n
            • \n
              \n
            • \n
            • \n
              \n
              \n '+n(["normal","active"],"flip-reset",!0)+"\n
              \n \n
              \n
            • \n \n"}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=function(e,t,n){return t&&o(e.prototype,t),n&&o(e,n),e};function o(e,t){for(var n=0;n\n
            • \n
              \n
              \n '+n(["normal","active"],"rotate-clockwise",!0)+'\n
              \n \n
              \n
              \n
              \n '+n(["normal","active"],"rotate-counterclockwise",!0)+'\n
              \n \n
              \n
            • \n
            • \n
              \n
            • \n
            • \n \n
              \n \n
            • \n \n'}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=function(e,t,n){return t&&o(e.prototype,t),n&&o(e,n),e};function o(e,t){for(var n=0;n\n
            • \n
              \n
              \n '+n(["normal","active"],"text-bold",!0)+"\n
              \n \n
              \n
              \n
              \n '+n(["normal","active"],"text-italic",!0)+"\n
              \n \n
              \n
              \n
              \n '+n(["normal","active"],"text-underline",!0)+"\n
              \n \n
              \n
            • \n
            • \n
              \n
            • \n
            • \n
              \n
              \n '+n(["normal","active"],"text-align-left",!0)+"\n
              \n \n
              \n
              \n
              \n '+n(["normal","active"],"text-align-center",!0)+"\n
              \n \n
              \n
              \n
              \n '+n(["normal","active"],"text-align-right",!0)+"\n
              \n \n
              \n
            • \n
            • \n
              \n
            • \n
            • \n
              \n
            • \n
            • \n
              \n
            • \n
            • \n \n
              \n \n
            • \n \n'}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=function(e,t,n){return t&&o(e.prototype,t),n&&o(e,n),e};function o(e,t){for(var n=0;n\n
            • \n
              \n
              \n \n '+n(["normal","active"],"mask-load",!0)+"\n
              \n \n
              \n
            • \n
            • \n
              \n
            • \n
            • \n
              \n '+n(["normal","active"],"apply")+"\n \n
              \n
            • \n \n"}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=function(e,t,n){return t&&o(e.prototype,t),n&&o(e,n),e};function o(e,t){for(var n=0;n\n
            • \n
              \n
              \n '+n(["normal","active"],"icon-arrow",!0)+"\n
              \n \n
              \n
              \n
              \n '+n(["normal","active"],"icon-arrow-2",!0)+"\n
              \n \n
              \n
              \n
              \n '+n(["normal","active"],"icon-arrow-3",!0)+"\n
              \n \n
              \n
              \n
              \n '+n(["normal","active"],"icon-star",!0)+"\n
              \n \n
              \n
              \n
              \n '+n(["normal","active"],"icon-star-2",!0)+"\n
              \n \n
              \n\n
              \n
              \n '+n(["normal","active"],"icon-polygon",!0)+"\n
              \n \n
              \n\n
              \n
              \n '+n(["normal","active"],"icon-location",!0)+"\n
              \n \n
              \n\n
              \n
              \n '+n(["normal","active"],"icon-heart",!0)+"\n
              \n \n
              \n\n
              \n
              \n '+n(["normal","active"],"icon-bubble",!0)+"\n
              \n \n
              \n
            • \n
            • \n
              \n
            • \n
            • \n
              \n
              \n \n '+n(["normal","active"],"icon-load",!0)+"\n
              \n \n
              \n
            • \n
            • \n
              \n
            • \n
            • \n
              \n
            • \n \n'}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=function(e,t,n){return t&&o(e.prototype,t),n&&o(e,n),e};function o(e,t){for(var n=0;n\n
            • \n
              \n
              \n '+n(["normal","active"],"draw-free",!0)+"\n
              \n \n
              \n
              \n
              \n '+n(["normal","active"],"draw-line",!0)+"\n
              \n \n
              \n
            • \n
            • \n
              \n
            • \n
            • \n
              \n
            • \n
            • \n
              \n
            • \n
            • \n \n
              \n \n
            • \n \n'}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=function(e,t,n){return t&&o(e.prototype,t),n&&o(e,n),e};function o(e,t){for(var n=0;n\n
            • \n
              \n
              \n \n
              \n
              \n \n
              \n
              \n \n
              \n
              \n \n
              \n
              \n \n
              \n
              \n \n
              \n
              \n \n
              \n
              \n
            • \n
            • \n
              \n
            • \n
            • \n
              \n
              \n
              \n \n
              \n
              \n
              \n \n
              \n
              \n
              \n
              \n
              \n \n
              \n
              \n
              \n
              \n
              \n
              \n
              \n \n
              \n
              \n
              \n
              \n
              \n
            • \n
            • \n
              \n
            • \n
            • \n
              \n
              \n \n
              \n
              \n
              \n
              \n
              \n
              \n
              \n
              \n \n
              \n
              \n
              \n \n
              \n
              \n
              \n
            • \n
            • \n
              \n
            • \n
            • \n
              \n
              \n
              \n \n
              \n
              \n
              \n
              \n
              \n \n
              \n
              \n
              \n
              \n
              \n \n
              \n
              \n
            • \n \n'}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=function(e,t,n){return t&&o(e.prototype,t),n&&o(e,n),e};function o(e,t){for(var n=0;nthis._historyIndex}},{key:"_addHistoryEventListener",value:function(){var t=this;this._eventHandler.history=function(e){return t._clickHistoryItem(e)},this.listElement.addEventListener("click",this._eventHandler.history)}},{key:"_removeHistoryEventListener",value:function(){this.listElement.removeEventListener("click",this._eventHandler.history)}},{key:"_clickHistoryItem",value:function(e){var t=e.target.closest(".history-item");if(t){var n=Number.parseInt(t.getAttribute("data-index"),10);if(n!==this._historyIndex){var i=Math.abs(n-this._historyIndex);n\n
              \n '+n(["normal","active"],"history-"+i.toLowerCase(),!0)+"\n
              \n \n "+t.localize(i)+"\n "+(o?"("+t.localize(o)+")":"")+'\n \n
              \n '+n(["normal"],"history-check",!0)+"\n
              \n \n"}},function(e,t,n){"use strict";function i(e,t){for(var n=0;n"},history:function(e){o.ui.toggleHistoryMenu(e)},zoomIn:function(){var e;o.ui.toggleZoomButtonStatus("zoomIn"),o.deactivateAll(),e=o._graphics.getZoomMode(),o.stopDrawingMode(),e!==s.zoomModes.ZOOM?(o.startDrawingMode(s.drawingModes.ZOOM),o._graphics.startZoomInMode()):o._graphics.endZoomInMode()},zoomOut:function(){o._graphics.zoomOut()},hand:function(){var e;o.ui.offZoomInButtonStatus(),o.ui.toggleZoomButtonStatus("hand"),o.deactivateAll(),e=o._graphics.getZoomMode(),o.stopDrawingMode(),e!==s.zoomModes.HAND?(o.startDrawingMode(s.drawingModes.ZOOM),o._graphics.startHandMode()):o._graphics.endHandMode()}},this._commonAction())},_iconAction:function(){var o=this;return(0,a.extend)({changeColor:function(e){o.activeObjectId&&o.changeIconColor(o.activeObjectId,e)},addIcon:function(e,t){o.startDrawingMode("ICON"),o.setDrawingIcon(e,t)},cancelAddIcon:function(){o.ui.icon.clearIconType(),o.changeSelectableAll(!0),o.changeCursor("default"),o.stopDrawingMode()},registerDefaultIcons:function(e,t){var n={};n[e]=t,o.registerIcons(n)},registerCustomIcon:function(e,i){(new r.default).imageToSVG(e,function(e){var t=e.match(/path[^>]*d="([^"]*)"/)[1],n={};n[i.name]=t,o.registerIcons(n),o.addIcon(i.name,{left:100,top:100})},r.default.tracerDefaultOption())}},this._commonAction())},_drawAction:function(){var n=this;return(0,a.extend)({setDrawMode:function(e,t){n.stopDrawingMode(),"free"===e?n.startDrawingMode("FREE_DRAWING",t):n.startDrawingMode("LINE_DRAWING",t)},setColor:function(e){n.setBrush({color:e})}},this._commonAction())},_maskAction:function(){var n=this;return(0,a.extend)({loadImageFromURL:function(e,t){return n.loadImageFromURL(n.toDataURL(),"FilterImage").then(function(){n.addImageObject(e).then(function(){URL.revokeObjectURL(t)}),n._invoker.fire(s.eventNames.EXECUTE_COMMAND,s.historyNames.LOAD_MASK_IMAGE)})},applyFilter:function(){n.applyFilter("mask",{maskObjId:n.activeObjectId})}},this._commonAction())},_textAction:function(){var n=this;return(0,a.extend)({changeTextStyle:function(e,t){n.activeObjectId&&n.changeTextStyle(n.activeObjectId,e,t)}},this._commonAction())},_rotateAction:function(){var n=this;return(0,a.extend)({rotate:function(e,t){n.rotate(e,t),n.ui.resizeEditor(),n.ui.rotate.setRangeBarAngle("rotate",e)},setAngle:function(e,t){n.setAngle(e,t),n.ui.resizeEditor(),n.ui.rotate.setRangeBarAngle("setAngle",e)}},this._commonAction())},_shapeAction:function(){var n=this;return(0,a.extend)({changeShape:function(e,t){n.activeObjectId&&n.changeShape(n.activeObjectId,e,t)},setDrawingShape:function(e){n.setDrawingShape(e)}},this._commonAction())},_cropAction:function(){var t=this;return(0,a.extend)({crop:function(){var e=t.getCropzoneRect();e&&!(0,l.isEmptyCropzone)(e)&&t.crop(e).then(function(){t.stopDrawingMode(),t.ui.resizeEditor(),t.ui.changeMenu("crop"),t._invoker.fire(s.eventNames.EXECUTE_COMMAND,s.historyNames.CROP)}).catch(function(e){return Promise.reject(e)})},cancel:function(){t.stopDrawingMode(),t.ui.changeMenu("crop")},preset:function(e){switch(e){case"preset-square":t.setCropzoneRect(1);break;case"preset-3-2":t.setCropzoneRect(1.5);break;case"preset-4-3":t.setCropzoneRect(4/3);break;case"preset-5-4":t.setCropzoneRect(5/4);break;case"preset-7-5":t.setCropzoneRect(1.4);break;case"preset-16-9":t.setCropzoneRect(16/9);break;default:t.setCropzoneRect(),t.ui.crop.changeApplyButtonStatus(!1)}}},this._commonAction())},_flipAction:function(){var t=this;return(0,a.extend)({flip:function(e){return t[e]()}},this._commonAction())},_filterAction:function(){var o=this;return(0,a.extend)({applyFilter:function(e,t,n,i){e?o.applyFilter(t,n,i):o.hasFilter(t)&&o.removeFilter(t)}},this._commonAction())},setReAction:function(){var s=this;this.on({undoStackChanged:function(e){e?(s.ui.changeHelpButtonEnabled("undo",!0),s.ui.changeHelpButtonEnabled("reset",!0)):(s.ui.changeHelpButtonEnabled("undo",!1),s.ui.changeHelpButtonEnabled("reset",!1)),s.ui.resizeEditor()},redoStackChanged:function(e){e?s.ui.changeHelpButtonEnabled("redo",!0):s.ui.changeHelpButtonEnabled("redo",!1),s.ui.resizeEditor()},objectActivated:function(e){s.activeObjectId=e.id,s.ui.changeHelpButtonEnabled("delete",!0),s.ui.changeHelpButtonEnabled("deleteAll",!0),"cropzone"===e.type?s.ui.crop.changeApplyButtonStatus(!0):-1<["rect","circle","triangle"].indexOf(e.type)?(s.stopDrawingMode(),"shape"!==s.ui.submenu&&s.ui.changeMenu("shape",!1,!1),s.ui.shape.setShapeStatus({strokeColor:e.stroke,strokeWidth:e.strokeWidth,fillColor:e.fill}),s.ui.shape.setMaxStrokeValue(Math.min(e.width,e.height))):"path"===e.type||"line"===e.type?"draw"!==s.ui.submenu&&(s.ui.changeMenu("draw",!1,!1),s.ui.draw.changeStandbyMode()):-1<["i-text","text"].indexOf(e.type)?("text"!==s.ui.submenu&&s.ui.changeMenu("text",!1,!1),s.ui.text.setTextStyleStateOnAction(e)):"icon"===e.type&&(s.stopDrawingMode(),"icon"!==s.ui.submenu&&s.ui.changeMenu("icon",!1,!1),s.ui.icon.setIconPickerColor(e.fill))},addText:function(e){var t=s.ui.text,n=t.textColor,i=t.fontSize,o=t.fontStyle,a=t.fontWeight,r=t.underline;s.addText("Double Click",{position:e.originPosition,styles:{fill:n,fontSize:i,fontFamily:"Noto Sans",fontStyle:o,fontWeight:a,underline:r}}).then(function(){s.changeCursor("default")})},addObjectAfter:function(e){"icon"===e.type?s.ui.icon.changeStandbyMode():-1<["rect","circle","triangle"].indexOf(e.type)&&(s.ui.shape.setMaxStrokeValue(Math.min(e.width,e.height)),s.ui.shape.changeStandbyMode())},objectScaled:function(e){if(-1<["i-text","text"].indexOf(e.type))s.ui.text.fontSize=(0,l.toInteger)(e.fontSize);else if(0<=["rect","circle","triangle"].indexOf(e.type)){var t=e.width,n=e.height,i=s.ui.shape.getStrokeValue();tn[i].boundingbox[2]&&(n[i].boundingbox[2]=a-1),r-1n[i].boundingbox[3]&&(n[i].boundingbox[3]=r-1),d=this.pathscan_combined_lookup[e[r][a]][c],e[r][a]=d[0],c=d[1],a+=d[2],r+=d[3],a-1===n[i].points[0].x&&r-1===n[i].points[0].y)if(u=!0,n[i].points.lengtht[2]&&e[3]>t[3]}},{key:"batchpathscan",value:function(e,t){var n=[];for(var i in e)e.hasOwnProperty(i)&&(n[i]=this.pathscan(e[i],t));return n}},{key:"internodes",value:function(e,t){var n=[],i=0,o=0,a=0,r=0,s=0,l=void 0,c=void 0;for(l=0;le.points.length||o<0)return[];var a=i,r=0,s=!0,l=void 0,c=void 0,u=void 0,h=o-i;h<0&&(h+=e.points.length);for(var d=(e.points[o].x-e.points[i].x)/h,f=(e.points[o].y-e.points[i].y)/h,v=(i+1)%e.points.length,p=void 0;v!=o;)(p=v-i)<0&&(p+=e.points.length),l=e.points[i].x+d*p,c=e.points[i].y+f*p,t<(u=(e.points[v].x-l)*(e.points[v].x-l)+(e.points[v].y-c)*(e.points[v].y-c))&&(s=!1),r',r+='',r+='',r+=''),!a.segments[s].hasOwnProperty("x3")&&i.lcpr&&(r+='');for(l=0;l',r+='',r+='',r+=''),!c.segments[s].hasOwnProperty("x3")&&i.lcpr&&(r+='')}return r}},{key:"getsvgstring",value:function(e,t){t=this.checkoptions(t);for(var n=e.width*t.scale,i=e.height*t.scale,o="',a=0;an},_getColor:function(e,t,n){var i=[0,0,0,0],o=e.data,a=4*(e.width*n+t);return i[0]=o[a],i[1]=o[1+a],i[2]=o[2+a],i[3]=o[3+a],i}});t.default=a},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=function(e,t,n){return t&&o(e.prototype,t),n&&o(e,n),e};function o(e,t){for(var n=0;n=n.length?{value:void 0,done:!0}:(e=o(n,i),t.index+=e.length,{value:e,done:!1})})},function(e,t,n){function i(s){return function(e,t){var n,i,o=String(c(e)),a=l(t),r=o.length;return a<0||r<=a?s?"":void 0:(n=o.charCodeAt(a))<55296||56319o;)r(i,n=t[o++])&&(~l(a,n)||a.push(n));return a}},function(e,t,n){function i(s){return function(e,t,n){var i,o=l(e),a=c(o.length),r=u(n,a);if(s&&t!=t){for(;r=t.length?{value:e.target=void 0,done:!0}:"keys"==n?{value:i,done:!1}:"values"==n?{value:t[i],done:!1}:{value:[i,t[i]],done:!1}},"values"),a.Arguments=a.Array,o("keys"),o("values"),o("entries")},function(e,t){e.exports=function(){}},function(e,t){e.exports={CSSRuleList:0,CSSStyleDeclaration:0,CSSValueList:0,ClientRectList:0,DOMRectList:0,DOMStringList:0,DOMTokenList:1,DataTransferItemList:0,FileList:0,HTMLAllCollection:0,HTMLCollection:0,HTMLFormElement:0,HTMLSelectElement:0,MediaList:0,MimeTypeArray:0,NamedNodeMap:0,NodeList:1,PaintRequestList:0,Plugin:0,PluginArray:0,SVGLengthList:0,SVGNumberList:0,SVGPathSegList:0,SVGPointList:0,SVGStringList:0,SVGTransformList:0,SourceBufferList:0,StyleSheetList:0,TextTrackCueList:0,TextTrackList:0,TouchList:0}},function(e,t,n){"use strict";function p(e){var t;return!(!k(e)||"function"!=typeof(t=e.then))&&t}function a(h,d,f){if(!d.notified){d.notified=!0;var v=d.reactions;T(function(){for(var e=d.value,t=1==d.state,n=0;v.length>n;){var i,o,a,r=v[n++],s=t?r.ok:r.fail,l=r.resolve,c=r.reject,u=r.domain;try{s?(t||(2===d.rejection&&oe(h,d),d.rejection=1),!0===s?i=e:(u&&u.enter(),i=s(e),u&&(u.exit(),a=!0)),i===r.promise?c(X("Promise-chain cycle")):(o=p(i))?o.call(i,l,c):l(i)):c(e)}catch(e){u&&!a&&u.exit(),c(e)}}d.reactions=[],d.notified=!1,f&&!d.rejection&&ne(h,d)})}}function o(e,t,n){var i,o;$?((i=Y.createEvent("Event")).promise=t,i.reason=n,i.initEvent(e,!1,!0),f.dispatchEvent(i)):i={promise:t,reason:n},(o=f["on"+e])?o(i):e===Q&&I("Unhandled promise rejection",n)}function r(t,n,i,o){return function(e){t(n,i,e,o)}}function s(e,t,n,i){t.done||(t.done=!0,i&&(t=i),t.value=n,t.state=2,a(e,t,!0))}var i,l,c,u,h=n(15),d=n(21),f=n(5),v=n(18),m=n(61),g=n(29),y=n(100),b=n(41),_=n(101),k=n(14),E=n(17),O=n(102),w=n(22),M=n(45),C=n(30),x=n(106),S=n(62),P=n(63).set,T=n(107),j=n(66),I=n(108),A=n(23),L=n(31),D=n(26),H=n(53),z=n(6),R=n(109),N=z("species"),F="Promise",B=D.get,V=D.set,U=D.getterFor(F),W=m,X=f.TypeError,Y=f.document,G=f.process,Z=v("fetch"),q=A.f,J=q,K="process"==w(G),$=!!(Y&&Y.createEvent&&f.dispatchEvent),Q="unhandledrejection",ee=H(F,function(){if(!(M(W)!==String(W))){if(66===R)return!0;if(!K&&"function"!=typeof PromiseRejectionEvent)return!0}if(d&&!W.prototype.finally)return!0;if(51<=R&&/native code/.test(W))return!1;function e(e){e(function(){},function(){})}var t=W.resolve(1);return(t.constructor={})[N]=e,!(t.then(function(){})instanceof e)}),te=ee||!x(function(e){W.all(e).catch(function(){})}),ne=function(n,i){P.call(f,function(){var e,t=i.value;if(ie(i)&&(e=L(function(){K?G.emit("unhandledRejection",t,n):o(Q,n,t)}),i.rejection=K||ie(i)?2:1,e.error))throw e.value})},ie=function(e){return 1!==e.rejection&&!e.parent},oe=function(e,t){P.call(f,function(){K?G.emit("rejectionHandled",e):o("rejectionhandled",e,t.value)})},ae=function(n,i,e,t){if(!i.done){i.done=!0,t&&(i=t);try{if(n===e)throw X("Promise can't be resolved itself");var o=p(e);o?T(function(){var t={done:!1};try{o.call(e,r(ae,n,t,i),r(s,n,t,i))}catch(e){s(n,t,e,i)}}):(i.value=e,i.state=1,a(n,i,!1))}catch(e){s(n,{done:!1},e,i)}}};ee&&(W=function(e){O(this,W,F),E(e),i.call(this);var t=B(this);try{e(r(ae,this,t),r(s,this,t))}catch(e){s(this,t,e)}},(i=function(){V(this,{type:F,done:!1,notified:!1,parent:!1,reactions:[],rejection:!1,state:0,value:void 0})}).prototype=y(W.prototype,{then:function(e,t){var n=U(this),i=q(S(this,W));return i.ok="function"!=typeof e||e,i.fail="function"==typeof t&&t,i.domain=K?G.domain:void 0,n.parent=!0,n.reactions.push(i),0!=n.state&&a(this,n,!1),i.promise},catch:function(e){return this.then(void 0,e)}}),l=function(){var e=new i,t=B(e);this.promise=e,this.resolve=r(ae,e,t),this.reject=r(s,e,t)},A.f=q=function(e){return e===W||e===c?new l:J(e)},d||"function"!=typeof m||(u=m.prototype.then,g(m.prototype,"then",function(e,t){var n=this;return new W(function(e,t){u.call(n,e,t)}).then(e,t)},{unsafe:!0}),"function"==typeof Z&&h({global:!0,enumerable:!0,forced:!0},{fetch:function(e){return j(W,Z.apply(f,arguments))}}))),h({global:!0,wrap:!0,forced:ee},{Promise:W}),b(W,F,!1,!0),_(F),c=v(F),h({target:F,stat:!0,forced:ee},{reject:function(e){var t=q(this);return t.reject.call(void 0,e),t.promise}}),h({target:F,stat:!0,forced:d||ee},{resolve:function(e){return j(d&&this===c?W:this,e)}}),h({target:F,stat:!0,forced:te},{all:function(e){var s=this,t=q(s),l=t.resolve,c=t.reject,n=L(function(){var i=E(s.resolve),o=[],a=0,r=1;C(e,function(e){var t=a++,n=!1;o.push(void 0),r++,i.call(s,e).then(function(e){n||(n=!0,o[t]=e,--r||l(o))},c)}),--r||l(o)});return n.error&&c(n.value),t.promise},race:function(e){var n=this,i=q(n),o=i.reject,t=L(function(){var t=E(n.resolve);C(e,function(e){t.call(n,e).then(i.resolve,o)})});return t.error&&o(t.value),i.promise}})},function(e,t,n){var o=n(29);e.exports=function(e,t,n){for(var i in t)n&&n.unsafe&&e[i]?e[i]=t[i]:o(e,i,t[i],n);return e}},function(e,t,n){"use strict";var i=n(18),o=n(20),a=n(6),r=n(13),s=a("species");e.exports=function(e){var t=i(e),n=o.f;r&&t&&!t[s]&&n(t,s,{configurable:!0,get:function(){return this}})}},function(e,t){e.exports=function(e,t,n){if(!(e instanceof t))throw TypeError("Incorrect "+(n?n+" ":"")+"invocation");return e}},function(e,t,n){var i=n(6),o=n(19),a=i("iterator"),r=Array.prototype;e.exports=function(e){return void 0!==e&&(o.Array===e||r[a]===e)}},function(e,t,n){var i=n(43),o=n(19),a=n(6)("iterator");e.exports=function(e){if(null!=e)return e[a]||e["@@iterator"]||o[i(e)]}},function(e,t,n){var a=n(11);e.exports=function(t,e,n,i){try{return i?e(a(n)[0],n[1]):e(n)}catch(e){var o=t.return;throw void 0!==o&&a(o.call(t)),e}}},function(e,t,n){var o=n(6)("iterator"),a=!1;try{var i=0,r={next:function(){return{done:!!i++}},return:function(){a=!0}};r[o]=function(){return this},Array.from(r,function(){throw 2})}catch(e){}e.exports=function(e,t){if(!t&&!a)return!1;var n=!1;try{var i={};i[o]=function(){return{next:function(){return{done:n=!0}}}},e(i)}catch(e){}return n}},function(e,t,n){var i,o,a,r,s,l,c,u,h=n(5),d=n(52).f,f=n(22),v=n(63).set,p=n(64),m=h.MutationObserver||h.WebKitMutationObserver,g=h.process,y=h.Promise,b="process"==f(g),_=d(h,"queueMicrotask"),k=_&&_.value;k||(i=function(){var e,t;for(b&&(e=g.domain)&&e.exit();o;){t=o.fn,o=o.next;try{t()}catch(e){throw o?r():a=void 0,e}}a=void 0,e&&e.enter()},r=b?function(){g.nextTick(i)}:m&&!p?(s=!0,l=document.createTextNode(""),new m(i).observe(l,{characterData:!0}),function(){l.data=s=!s}):y&&y.resolve?(c=y.resolve(void 0),u=c.then,function(){u.call(c,i)}):function(){v.call(h,i)}),e.exports=k||function(e){var t={fn:e,next:void 0};a&&(a.next=t),o||(o=t,r()),a=t}},function(e,t,n){var i=n(5);e.exports=function(e,t){var n=i.console;n&&n.error&&(1===arguments.length?n.error(e):n.error(e,t))}},function(e,t,n){var i,o,a=n(5),r=n(65),s=a.process,l=s&&s.versions,c=l&&l.v8;c?o=(i=c.split("."))[0]+i[1]:r&&(!(i=r.match(/Edge\/(\d+)/))||74<=i[1])&&(i=r.match(/Chrome\/(\d+)/))&&(o=i[1]),e.exports=o&&+o},function(e,t,n){"use strict";var i=n(15),o=n(21),a=n(61),r=n(10),s=n(18),l=n(62),c=n(66),u=n(29);i({target:"Promise",proto:!0,real:!0,forced:!!a&&r(function(){a.prototype.finally.call({then:function(){}},function(){})})},{finally:function(t){var n=l(this,s("Promise")),e="function"==typeof t;return this.then(e?function(e){return c(n,t()).then(function(){return e})}:t,e?function(e){return c(n,t()).then(function(){throw e})}:t)}}),o||"function"!=typeof a||a.prototype.finally||u(a.prototype,"finally",s("Promise").prototype.finally)},function(e,t,n){"use strict";var i=n(15),o=n(13),a=n(40),r=n(60),s=n(56),l=n(20),c=n(27),u=n(30),h=n(8),d=n(26),f=d.set,v=d.getterFor("AggregateError"),p=function(e,t){var n=this;if(!(n instanceof p))return new p(e,t);r&&(n=r(new Error(t),a(n)));var i=[];return u(e,i.push,i),o?f(n,{errors:i,type:"AggregateError"}):n.errors=i,void 0!==t&&h(n,"message",String(t)),n};p.prototype=s(Error.prototype,{constructor:c(5,p),message:c(5,""),name:c(5,"AggregateError")}),o&&l.f(p.prototype,"errors",{get:function(){return v(this).errors},configurable:!0}),i({global:!0},{AggregateError:p})},function(e,t,n){n(67)},function(e,t,n){"use strict";var i=n(15),o=n(23),a=n(31);i({target:"Promise",stat:!0},{try:function(e){var t=o.f(this),n=a(e);return(n.error?t.reject:t.resolve)(n.value),t.promise}})},function(e,t,n){"use strict";var i=n(15),h=n(17),d=n(18),o=n(23),a=n(31),f=n(30),v="No one promise resolved";i({target:"Promise",stat:!0},{any:function(e){var l=this,t=o.f(l),c=t.resolve,u=t.reject,n=a(function(){var i=h(l.resolve),o=[],a=0,r=1,s=!1;f(e,function(e){var t=a++,n=!1;o.push(void 0),r++,i.call(l,e).then(function(e){n||s||(s=!0,c(e))},function(e){n||s||(n=!0,o[t]=e,--r||u(new(d("AggregateError"))(o,v)))})}),--r||u(new(d("AggregateError"))(o,v))});return n.error&&u(n.value),t.promise}})},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=function(e,t,n){return t&&o(e.prototype,t),n&&o(e,n),e};function o(e,t){for(var n=0;n\n
              \n
              \n
              \n ',this._editorContainerElement=this._editorElement.querySelector(".tui-image-editor-canvas-container"),this._editorContainerElement.appendChild(n)}},{key:"_getLoadImage",value:function(){return this.options.loadImage}},{key:"changeMenu",value:function(e,t,n){var i=!(1this._editorElementWrap.scrollHeight-150?(i-this._editorElementWrap.scrollHeight)/2:-75:"top"===e?a=i>this._editorElementWrap.offsetHeight-150?75-(i-(this._editorElementWrap.offsetHeight-150))/2:75:"left"===e?r=n>this._editorElementWrap.offsetWidth-248?124-(n-(this._editorElementWrap.offsetWidth-248))/2:124:"right"===e&&(r=n>this._editorElementWrap.scrollWidth-248?(n-this._editorElementWrap.scrollWidth)/2:-124)),o.top=a+"px",o.left=r+"px"}}]),T);function T(e,t,n){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,T),this.options=this._initializeOption(t),this._actions=n,this.submenu=!1,this.imageSize={},this.uiSize={},this._locale=new k.default(this.options.locale),this.theme=new u.default(this.options.theme),this.eventHandler={},this._submenuChangeTransection=!1,this._selectedElement=null,this._mainElement=null,this._editorElementWrap=null,this._editorElement=null,this._menuBarElement=null,this._subMenuElement=null,this._makeUiElement(e),this._setUiSize(),this._initMenuEvent=!1,this._makeSubMenu(),this._attachHistoryEvent(),this._attachZoomEvent()}w.mixin(P),t.default=P},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){var t=e.locale,n=e.biImage,i=e.commonStyle,o=e.headerStyle,a=e.loadButtonStyle,r=e.downloadButtonStyle,s=e.submenuStyle;return'\n
              \n
              \n \n
              \n
              \n '+t.localize("Load")+'\n \n
              \n \n
              \n
              \n
              \n
              \n
              \n
              \n
              \n
              \n
              \n
              \n
              \n
              \n
              \n
              \n
              \n'}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(1);t.default=function(e){var t=e.locale,n=e.biImage,i=e.loadButtonStyle,o=e.downloadButtonStyle,a=e.menuBarPosition;return'\n
                \n
                \n \n
                  \n\n
                  \n
                  \n '+t.localize("Load")+'\n \n
                  \n \n
                  \n
                  \n"}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=function(e,t,n){return t&&o(e.prototype,t),n&&o(e,n),e};function o(e,t){for(var n=0;n'}).join("")}},{key:"makeMenSvgIconSet",value:function(e,t,n){var i=2'+this._makeSvgItem(e,t,i)+""}}]),d);function d(e){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,d),this.styles=this._changeToObject((0,r.extend)({},s.default,e)),(0,c.styleLoad)(this._styleMaker()),this._loadDefaultSvgIcon()}t.default=h},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){var t=e.subMenuLabelActive,n=e.subMenuLabelNormal,i=e.subMenuRangeTitle,o=e.submenuPartitionVertical,a=e.submenuPartitionHorizontal,r=e.submenuCheckbox,s=e.submenuRangePointer,l=e.submenuRangeValue,c=e.submenuColorpickerTitle,u=e.submenuColorpickerButton,h=e.submenuRangeBar,d=e.submenuRangeSubbar,f=e.submenuDisabledRangePointer,v=e.submenuDisabledRangeBar,p=e.submenuDisabledRangeSubbar,m=e.submenuIconSize,g=e.menuIconSize,y=e.biSize,b=e.menuIconStyle,_=e.submenuIconStyle;return'\n .tie-icon-add-button.icon-bubble .tui-image-editor-button[data-icontype="icon-bubble"] label,\n .tie-icon-add-button.icon-heart .tui-image-editor-button[data-icontype="icon-heart"] label,\n .tie-icon-add-button.icon-location .tui-image-editor-button[data-icontype="icon-location"] label,\n .tie-icon-add-button.icon-polygon .tui-image-editor-button[data-icontype="icon-polygon"] label,\n .tie-icon-add-button.icon-star .tui-image-editor-button[data-icontype="icon-star"] label,\n .tie-icon-add-button.icon-star-2 .tui-image-editor-button[data-icontype="icon-star-2"] label,\n .tie-icon-add-button.icon-arrow-3 .tui-image-editor-button[data-icontype="icon-arrow-3"] label,\n .tie-icon-add-button.icon-arrow-2 .tui-image-editor-button[data-icontype="icon-arrow-2"] label,\n .tie-icon-add-button.icon-arrow .tui-image-editor-button[data-icontype="icon-arrow"] label,\n .tie-icon-add-button.icon-bubble .tui-image-editor-button[data-icontype="icon-bubble"] label,\n .tie-draw-line-select-button.line .tui-image-editor-button.line label,\n .tie-draw-line-select-button.free .tui-image-editor-button.free label,\n .tie-flip-button.flipX .tui-image-editor-button.flipX label,\n .tie-flip-button.flipY .tui-image-editor-button.flipY label,\n .tie-flip-button.resetFlip .tui-image-editor-button.resetFlip label,\n .tie-crop-button .tui-image-editor-button.apply.active label,\n .tie-crop-preset-button .tui-image-editor-button.preset.active label,\n .tie-shape-button.rect .tui-image-editor-button.rect label,\n .tie-shape-button.circle .tui-image-editor-button.circle label,\n .tie-shape-button.triangle .tui-image-editor-button.triangle label,\n .tie-text-effect-button .tui-image-editor-button.active label,\n .tie-text-align-button.left .tui-image-editor-button.left label,\n .tie-text-align-button.center .tui-image-editor-button.center label,\n .tie-text-align-button.right .tui-image-editor-button.right label,\n .tie-mask-apply.apply.active .tui-image-editor-button.apply label,\n .tui-image-editor-container .tui-image-editor-submenu .tui-image-editor-button:hover > label,\n .tui-image-editor-container .tui-image-editor-checkbox label > span {\n '+t+"\n }\n .tui-image-editor-container .tui-image-editor-submenu .tui-image-editor-button > label,\n .tui-image-editor-container .tui-image-editor-range-wrap.tui-image-editor-newline.short label,\n .tui-image-editor-container .tui-image-editor-range-wrap.tui-image-editor-newline.short label > span {\n "+n+"\n }\n .tui-image-editor-container .tui-image-editor-range-wrap label > span {\n "+i+"\n }\n .tui-image-editor-container .tui-image-editor-partition > div {\n "+o+"\n }\n .tui-image-editor-container.left .tui-image-editor-submenu .tui-image-editor-partition > div,\n .tui-image-editor-container.right .tui-image-editor-submenu .tui-image-editor-partition > div {\n "+a+"\n }\n .tui-image-editor-container .tui-image-editor-checkbox label > span:before {\n "+r+"\n }\n .tui-image-editor-container .tui-image-editor-checkbox label > input:checked + span:before {\n border: 0;\n }\n .tui-image-editor-container .tui-image-editor-virtual-range-pointer {\n "+s+"\n }\n .tui-image-editor-container .tui-image-editor-virtual-range-bar {\n "+h+"\n }\n .tui-image-editor-container .tui-image-editor-virtual-range-subbar {\n "+d+"\n }\n .tui-image-editor-container .tui-image-editor-disabled .tui-image-editor-virtual-range-pointer {\n "+f+"\n }\n .tui-image-editor-container .tui-image-editor-disabled .tui-image-editor-virtual-range-subbar {\n "+p+"\n }\n .tui-image-editor-container .tui-image-editor-disabled .tui-image-editor-virtual-range-bar {\n "+v+"\n }\n .tui-image-editor-container .tui-image-editor-range-value {\n "+l+"\n }\n .tui-image-editor-container .tui-image-editor-submenu .tui-image-editor-button .color-picker-value + label {\n "+c+"\n }\n .tui-image-editor-container .tui-image-editor-submenu .tui-image-editor-button .color-picker-value {\n "+u+"\n }\n .tui-image-editor-container .svg_ic-menu {\n "+g+"\n }\n .tui-image-editor-container .svg_ic-submenu {\n "+m+"\n }\n .tui-image-editor-container .tui-image-editor-controls-logo > img,\n .tui-image-editor-container .tui-image-editor-header-logo > img {\n "+y+"\n }\n .tui-image-editor-menu use.normal.use-default,\n .tui-image-editor-help-menu use.normal.use-default {\n fill-rule: evenodd;\n fill: "+b.normal.color+";\n stroke: "+b.normal.color+";\n }\n .tui-image-editor-menu use.active.use-default,\n .tui-image-editor-help-menu use.active.use-default {\n fill-rule: evenodd;\n fill: "+b.active.color+";\n stroke: "+b.active.color+";\n }\n .tui-image-editor-menu use.hover.use-default,\n .tui-image-editor-help-menu use.hover.use-default {\n fill-rule: evenodd;\n fill: "+b.hover.color+";\n stroke: "+b.hover.color+";\n }\n .tui-image-editor-menu use.disabled.use-default,\n .tui-image-editor-help-menu use.disabled.use-default {\n fill-rule: evenodd;\n fill: "+b.disabled.color+";\n stroke: "+b.disabled.color+";\n }\n .tui-image-editor-submenu use.normal.use-default {\n fill-rule: evenodd;\n fill: "+_.normal.color+";\n stroke: "+_.normal.color+";\n }\n .tui-image-editor-submenu use.active.use-default {\n fill-rule: evenodd;\n fill: "+_.active.color+";\n stroke: "+_.active.color+";\n }\n"}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default={"common.bi.image":"https://uicdn.toast.com/toastui/img/tui-image-editor-bi.png","common.bisize.width":"251px","common.bisize.height":"21px","common.backgroundImage":"none","common.backgroundColor":"#1e1e1e","common.border":"0px","header.backgroundImage":"none","header.backgroundColor":"transparent","header.border":"0px","loadButton.backgroundColor":"#fff","loadButton.border":"1px solid #ddd","loadButton.color":"#222","loadButton.fontFamily":"'Noto Sans', sans-serif","loadButton.fontSize":"12px","downloadButton.backgroundColor":"#fdba3b","downloadButton.border":"1px solid #fdba3b","downloadButton.color":"#fff","downloadButton.fontFamily":"'Noto Sans', sans-serif","downloadButton.fontSize":"12px","menu.normalIcon.color":"#8a8a8a","menu.activeIcon.color":"#555555","menu.disabledIcon.color":"#434343","menu.hoverIcon.color":"#e9e9e9","submenu.normalIcon.color":"#8a8a8a","submenu.activeIcon.color":"#e9e9e9","menu.iconSize.width":"24px","menu.iconSize.height":"24px","submenu.iconSize.width":"32px","submenu.iconSize.height":"32px","submenu.backgroundColor":"#1e1e1e","submenu.partition.color":"#3c3c3c","submenu.normalLabel.color":"#8a8a8a","submenu.normalLabel.fontWeight":"lighter","submenu.activeLabel.color":"#fff","submenu.activeLabel.fontWeight":"lighter","checkbox.border":"0px","checkbox.backgroundColor":"#fff","range.pointer.color":"#fff","range.bar.color":"#666","range.subbar.color":"#d1d1d1","range.disabledPointer.color":"#414141","range.disabledBar.color":"#282828","range.disabledSubbar.color":"#414141","range.value.color":"#fff","range.value.fontWeight":"lighter","range.value.fontSize":"11px","range.value.border":"1px solid #353535","range.value.backgroundColor":"#151515","range.title.color":"#fff","range.title.fontWeight":"lighter","colorpicker.button.border":"1px solid #1e1e1e","colorpicker.title.color":"#fff"}},function(e,t){e.exports=''},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=function(e,t,n){return t&&o(e.prototype,t),n&&o(e,n),e};function o(e,t){for(var n=0;n\n
                • \n
                  \n
                  \n '+n(["normal","active"],"shape-rectangle",!0)+"\n
                  \n \n
                  \n
                  \n
                  \n '+n(["normal","active"],"shape-circle",!0)+"\n
                  \n \n
                  \n
                  \n
                  \n '+n(["normal","active"],"shape-triangle",!0)+"\n
                  \n \n
                  \n
                • \n
                • \n
                  \n
                • \n
                • \n
                  \n
                  \n
                • \n
                • \n
                  \n
                • \n
                • \n \n
                  \n \n
                • \n \n'}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=function(e,t,n){return t&&o(e.prototype,t),n&&o(e,n),e};function o(e,t){for(var n=0;n\n
                • \n
                  \n
                  \n '+n(["normal","active"],"shape-rectangle",!0)+"\n
                  \n \n
                  \n
                  \n
                  \n '+n(["normal","active"],"crop",!0)+"\n
                  \n \n
                  \n
                  \n
                  \n '+n(["normal","active"],"crop",!0)+"\n
                  \n \n
                  \n
                  \n
                  \n '+n(["normal","active"],"crop",!0)+"\n
                  \n \n
                  \n
                  \n
                  \n '+n(["normal","active"],"crop",!0)+"\n
                  \n \n
                  \n
                  \n
                  \n '+n(["normal","active"],"crop",!0)+"\n
                  \n \n
                  \n
                  \n
                  \n '+n(["normal","active"],"crop",!0)+"\n
                  \n \n
                  \n
                • \n
                • \n
                • \n
                • \n
                  \n
                • \n
                • \n
                  \n '+n(["normal","active"],"apply")+"\n \n
                  \n
                  \n '+n(["normal","active"],"cancel")+"\n \n
                  \n
                • \n \n"}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=function(e,t,n){return t&&o(e.prototype,t),n&&o(e,n),e};function o(e,t){for(var n=0;n\n
                • \n
                  \n
                  \n '+n(["normal","active"],"flip-x",!0)+"\n
                  \n \n
                  \n
                  \n
                  \n '+n(["normal","active"],"flip-y",!0)+"\n
                  \n \n
                  \n
                • \n
                • \n
                  \n
                • \n
                • \n
                  \n
                  \n '+n(["normal","active"],"flip-reset",!0)+"\n
                  \n \n
                  \n
                • \n \n"}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=function(e,t,n){return t&&o(e.prototype,t),n&&o(e,n),e};function o(e,t){for(var n=0;n\n
                • \n
                  \n
                  \n '+n(["normal","active"],"rotate-clockwise",!0)+'\n
                  \n \n
                  \n
                  \n
                  \n '+n(["normal","active"],"rotate-counterclockwise",!0)+'\n
                  \n \n
                  \n
                • \n
                • \n
                  \n
                • \n
                • \n \n
                  \n \n
                • \n \n'}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=function(e,t,n){return t&&o(e.prototype,t),n&&o(e,n),e};function o(e,t){for(var n=0;n\n
                • \n
                  \n
                  \n '+n(["normal","active"],"text-bold",!0)+"\n
                  \n \n
                  \n
                  \n
                  \n '+n(["normal","active"],"text-italic",!0)+"\n
                  \n \n
                  \n
                  \n
                  \n '+n(["normal","active"],"text-underline",!0)+"\n
                  \n \n
                  \n
                • \n
                • \n
                  \n
                • \n
                • \n
                  \n
                  \n '+n(["normal","active"],"text-align-left",!0)+"\n
                  \n \n
                  \n
                  \n
                  \n '+n(["normal","active"],"text-align-center",!0)+"\n
                  \n \n
                  \n
                  \n
                  \n '+n(["normal","active"],"text-align-right",!0)+"\n
                  \n \n
                  \n
                • \n
                • \n
                  \n
                • \n
                • \n
                  \n
                • \n
                • \n
                  \n
                • \n
                • \n \n
                  \n \n
                • \n \n'}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=function(e,t,n){return t&&o(e.prototype,t),n&&o(e,n),e};function o(e,t){for(var n=0;n\n
                • \n
                  \n
                  \n \n '+n(["normal","active"],"mask-load",!0)+"\n
                  \n \n
                  \n
                • \n
                • \n
                  \n
                • \n
                • \n
                  \n '+n(["normal","active"],"apply")+"\n \n
                  \n
                • \n \n"}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=function(e,t,n){return t&&o(e.prototype,t),n&&o(e,n),e};function o(e,t){for(var n=0;n\n
                • \n
                  \n
                  \n '+n(["normal","active"],"icon-arrow",!0)+"\n
                  \n \n
                  \n
                  \n
                  \n '+n(["normal","active"],"icon-arrow-2",!0)+"\n
                  \n \n
                  \n
                  \n
                  \n '+n(["normal","active"],"icon-arrow-3",!0)+"\n
                  \n \n
                  \n
                  \n
                  \n '+n(["normal","active"],"icon-star",!0)+"\n
                  \n \n
                  \n
                  \n
                  \n '+n(["normal","active"],"icon-star-2",!0)+"\n
                  \n \n
                  \n\n
                  \n
                  \n '+n(["normal","active"],"icon-polygon",!0)+"\n
                  \n \n
                  \n\n
                  \n
                  \n '+n(["normal","active"],"icon-location",!0)+"\n
                  \n \n
                  \n\n
                  \n
                  \n '+n(["normal","active"],"icon-heart",!0)+"\n
                  \n \n
                  \n\n
                  \n
                  \n '+n(["normal","active"],"icon-bubble",!0)+"\n
                  \n \n
                  \n
                • \n
                • \n
                  \n
                • \n
                • \n
                  \n
                  \n \n '+n(["normal","active"],"icon-load",!0)+"\n
                  \n \n
                  \n
                • \n
                • \n
                  \n
                • \n
                • \n
                  \n
                • \n \n'}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=function(e,t,n){return t&&o(e.prototype,t),n&&o(e,n),e};function o(e,t){for(var n=0;n\n
                • \n
                  \n
                  \n '+n(["normal","active"],"draw-free",!0)+"\n
                  \n \n
                  \n
                  \n
                  \n '+n(["normal","active"],"draw-line",!0)+"\n
                  \n \n
                  \n
                • \n
                • \n
                  \n
                • \n
                • \n
                  \n
                • \n
                • \n
                  \n
                • \n
                • \n \n
                  \n \n
                • \n \n'}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=function(e,t,n){return t&&o(e.prototype,t),n&&o(e,n),e};function o(e,t){for(var n=0;n\n
                • \n
                  \n
                  \n \n
                  \n
                  \n \n
                  \n
                  \n \n
                  \n
                  \n \n
                  \n
                  \n \n
                  \n
                  \n \n
                  \n
                  \n \n
                  \n
                  \n
                • \n
                • \n
                  \n
                • \n
                • \n
                  \n
                  \n
                  \n \n
                  \n
                  \n
                  \n \n
                  \n
                  \n
                  \n
                  \n
                  \n \n
                  \n
                  \n
                  \n
                  \n
                  \n
                  \n
                  \n \n
                  \n
                  \n
                  \n
                  \n
                  \n
                • \n
                • \n
                  \n
                • \n
                • \n
                  \n
                  \n \n
                  \n
                  \n
                  \n
                  \n
                  \n
                  \n
                  \n
                  \n \n
                  \n
                  \n
                  \n \n
                  \n
                  \n
                  \n
                • \n
                • \n
                  \n
                • \n
                • \n
                  \n
                  \n
                  \n \n
                  \n
                  \n
                  \n
                  \n
                  \n \n
                  \n
                  \n
                  \n
                  \n
                  \n \n
                  \n
                  \n
                • \n \n'}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=function(e,t,n){return t&&o(e.prototype,t),n&&o(e,n),e};function o(e,t){for(var n=0;nthis._historyIndex}},{key:"_addHistoryEventListener",value:function(){var t=this;this._eventHandler.history=function(e){return t._clickHistoryItem(e)},this.listElement.addEventListener("click",this._eventHandler.history)}},{key:"_removeHistoryEventListener",value:function(){this.listElement.removeEventListener("click",this._eventHandler.history)}},{key:"_clickHistoryItem",value:function(e){var t=e.target.closest(".history-item");if(t){var n=Number.parseInt(t.getAttribute("data-index"),10);if(n!==this._historyIndex){var i=Math.abs(n-this._historyIndex);n\n
                  \n '+n(["normal","active"],"history-"+i.toLowerCase(),!0)+"\n
                  \n \n "+t.localize(i)+"\n "+(o?"("+t.localize(o)+")":"")+'\n \n
                  \n '+n(["normal"],"history-check",!0)+"\n
                  \n \n"}},function(e,t,n){"use strict";function i(e,t){for(var n=0;n"},history:function(e){o.ui.toggleHistoryMenu(e)},zoomIn:function(){var e;o.ui.toggleZoomButtonStatus("zoomIn"),o.deactivateAll(),e=o._graphics.getZoomMode(),o.stopDrawingMode(),e!==s.zoomModes.ZOOM?(o.startDrawingMode(s.drawingModes.ZOOM),o._graphics.startZoomInMode()):o._graphics.endZoomInMode()},zoomOut:function(){o._graphics.zoomOut()},hand:function(){var e;o.ui.offZoomInButtonStatus(),o.ui.toggleZoomButtonStatus("hand"),o.deactivateAll(),e=o._graphics.getZoomMode(),o.stopDrawingMode(),e!==s.zoomModes.HAND?(o.startDrawingMode(s.drawingModes.ZOOM),o._graphics.startHandMode()):o._graphics.endHandMode()}},this._commonAction())},_iconAction:function(){var o=this;return(0,a.extend)({changeColor:function(e){o.activeObjectId&&o.changeIconColor(o.activeObjectId,e)},addIcon:function(e,t){o.startDrawingMode("ICON"),o.setDrawingIcon(e,t)},cancelAddIcon:function(){o.ui.icon.clearIconType(),o.changeSelectableAll(!0),o.changeCursor("default"),o.stopDrawingMode()},registerDefaultIcons:function(e,t){var n={};n[e]=t,o.registerIcons(n)},registerCustomIcon:function(e,i){(new r.default).imageToSVG(e,function(e){var t=e.match(/path[^>]*d="([^"]*)"/)[1],n={};n[i.name]=t,o.registerIcons(n),o.addIcon(i.name,{left:100,top:100})},r.default.tracerDefaultOption())}},this._commonAction())},_drawAction:function(){var n=this;return(0,a.extend)({setDrawMode:function(e,t){n.stopDrawingMode(),"free"===e?n.startDrawingMode("FREE_DRAWING",t):n.startDrawingMode("LINE_DRAWING",t)},setColor:function(e){n.setBrush({color:e})}},this._commonAction())},_maskAction:function(){var n=this;return(0,a.extend)({loadImageFromURL:function(e,t){return n.loadImageFromURL(n.toDataURL(),"FilterImage").then(function(){n.addImageObject(e).then(function(){URL.revokeObjectURL(t)}),n._invoker.fire(s.eventNames.EXECUTE_COMMAND,s.historyNames.LOAD_MASK_IMAGE)})},applyFilter:function(){n.applyFilter("mask",{maskObjId:n.activeObjectId})}},this._commonAction())},_textAction:function(){var n=this;return(0,a.extend)({changeTextStyle:function(e,t){n.activeObjectId&&n.changeTextStyle(n.activeObjectId,e,t)}},this._commonAction())},_rotateAction:function(){var n=this;return(0,a.extend)({rotate:function(e,t){n.rotate(e,t),n.ui.resizeEditor(),n.ui.rotate.setRangeBarAngle("rotate",e)},setAngle:function(e,t){n.setAngle(e,t),n.ui.resizeEditor(),n.ui.rotate.setRangeBarAngle("setAngle",e)}},this._commonAction())},_shapeAction:function(){var n=this;return(0,a.extend)({changeShape:function(e,t){n.activeObjectId&&n.changeShape(n.activeObjectId,e,t)},setDrawingShape:function(e){n.setDrawingShape(e)}},this._commonAction())},_cropAction:function(){var t=this;return(0,a.extend)({crop:function(){var e=t.getCropzoneRect();e&&!(0,l.isEmptyCropzone)(e)&&t.crop(e).then(function(){t.stopDrawingMode(),t.ui.resizeEditor(),t.ui.changeMenu("crop"),t._invoker.fire(s.eventNames.EXECUTE_COMMAND,s.historyNames.CROP)}).catch(function(e){return Promise.reject(e)})},cancel:function(){t.stopDrawingMode(),t.ui.changeMenu("crop")},preset:function(e){switch(e){case"preset-square":t.setCropzoneRect(1);break;case"preset-3-2":t.setCropzoneRect(1.5);break;case"preset-4-3":t.setCropzoneRect(4/3);break;case"preset-5-4":t.setCropzoneRect(5/4);break;case"preset-7-5":t.setCropzoneRect(1.4);break;case"preset-16-9":t.setCropzoneRect(16/9);break;default:t.setCropzoneRect(),t.ui.crop.changeApplyButtonStatus(!1)}}},this._commonAction())},_flipAction:function(){var t=this;return(0,a.extend)({flip:function(e){return t[e]()}},this._commonAction())},_filterAction:function(){var o=this;return(0,a.extend)({applyFilter:function(e,t,n,i){e?o.applyFilter(t,n,i):o.hasFilter(t)&&o.removeFilter(t)}},this._commonAction())},setReAction:function(){var s=this;this.on({undoStackChanged:function(e){e?(s.ui.changeHelpButtonEnabled("undo",!0),s.ui.changeHelpButtonEnabled("reset",!0)):(s.ui.changeHelpButtonEnabled("undo",!1),s.ui.changeHelpButtonEnabled("reset",!1)),s.ui.resizeEditor()},redoStackChanged:function(e){e?s.ui.changeHelpButtonEnabled("redo",!0):s.ui.changeHelpButtonEnabled("redo",!1),s.ui.resizeEditor()},objectActivated:function(e){s.activeObjectId=e.id,s.ui.changeHelpButtonEnabled("delete",!0),s.ui.changeHelpButtonEnabled("deleteAll",!0),"cropzone"===e.type?s.ui.crop.changeApplyButtonStatus(!0):-1<["rect","circle","triangle"].indexOf(e.type)?(s.stopDrawingMode(),"shape"!==s.ui.submenu&&s.ui.changeMenu("shape",!1,!1),s.ui.shape.setShapeStatus({strokeColor:e.stroke,strokeWidth:e.strokeWidth,fillColor:e.fill}),s.ui.shape.setMaxStrokeValue(Math.min(e.width,e.height))):"path"===e.type||"line"===e.type?"draw"!==s.ui.submenu&&(s.ui.changeMenu("draw",!1,!1),s.ui.draw.changeStandbyMode()):-1<["i-text","text"].indexOf(e.type)?("text"!==s.ui.submenu&&s.ui.changeMenu("text",!1,!1),s.ui.text.setTextStyleStateOnAction(e)):"icon"===e.type&&(s.stopDrawingMode(),"icon"!==s.ui.submenu&&s.ui.changeMenu("icon",!1,!1),s.ui.icon.setIconPickerColor(e.fill))},addText:function(e){var t=s.ui.text,n=t.textColor,i=t.fontSize,o=t.fontStyle,a=t.fontWeight,r=t.underline;s.addText("Double Click",{position:e.originPosition,styles:{fill:n,fontSize:i,fontFamily:"Noto Sans",fontStyle:o,fontWeight:a,underline:r}}).then(function(){s.changeCursor("default")})},addObjectAfter:function(e){"icon"===e.type?s.ui.icon.changeStandbyMode():-1<["rect","circle","triangle"].indexOf(e.type)&&(s.ui.shape.setMaxStrokeValue(Math.min(e.width,e.height)),s.ui.shape.changeStandbyMode())},objectScaled:function(e){if(-1<["i-text","text"].indexOf(e.type))s.ui.text.fontSize=(0,l.toInteger)(e.fontSize);else if(0<=["rect","circle","triangle"].indexOf(e.type)){var t=e.width,n=e.height,i=s.ui.shape.getStrokeValue();tn[i].boundingbox[2]&&(n[i].boundingbox[2]=a-1),r-1n[i].boundingbox[3]&&(n[i].boundingbox[3]=r-1),d=this.pathscan_combined_lookup[e[r][a]][c],e[r][a]=d[0],c=d[1],a+=d[2],r+=d[3],a-1===n[i].points[0].x&&r-1===n[i].points[0].y)if(u=!0,n[i].points.lengtht[2]&&e[3]>t[3]}},{key:"batchpathscan",value:function(e,t){var n=[];for(var i in e)e.hasOwnProperty(i)&&(n[i]=this.pathscan(e[i],t));return n}},{key:"internodes",value:function(e,t){var n=[],i=0,o=0,a=0,r=0,s=0,l=void 0,c=void 0;for(l=0;le.points.length||o<0)return[];var a=i,r=0,s=!0,l=void 0,c=void 0,u=void 0,h=o-i;h<0&&(h+=e.points.length);for(var d=(e.points[o].x-e.points[i].x)/h,f=(e.points[o].y-e.points[i].y)/h,v=(i+1)%e.points.length,p=void 0;v!=o;)(p=v-i)<0&&(p+=e.points.length),l=e.points[i].x+d*p,c=e.points[i].y+f*p,t<(u=(e.points[v].x-l)*(e.points[v].x-l)+(e.points[v].y-c)*(e.points[v].y-c))&&(s=!1),r',r+='',r+='',r+=''),!a.segments[s].hasOwnProperty("x3")&&i.lcpr&&(r+='');for(l=0;l',r+='',r+='',r+=''),!c.segments[s].hasOwnProperty("x3")&&i.lcpr&&(r+='')}return r}},{key:"getsvgstring",value:function(e,t){t=this.checkoptions(t);for(var n=e.width*t.scale,i=e.height*t.scale,o="',a=0;an},_getColor:function(e,t,n){var i=[0,0,0,0],o=e.data,a=4*(e.width*n+t);return i[0]=o[a],i[1]=o[1+a],i[2]=o[2+a],i[3]=o[3+a],i}});t.default=a},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=function(e,t,n){return t&&o(e.prototype,t),n&&o(e,n),e};function o(e,t){for(var n=0;n\n * @fileoverview Constants\n */\nimport { keyMirror } from '@/util';\n\n/**\n * Help features for zoom\n * @type {Array.}\n */\nexport const ZOOM_HELP_MENUS = ['zoomIn', 'zoomOut', 'hand'];\n\n/**\n * Help features for command\n * @type {Array.}\n */\nexport const COMMAND_HELP_MENUS = ['history', 'undo', 'redo', 'reset'];\n\n/**\n * Help features for delete\n * @type {Array.}\n */\nexport const DELETE_HELP_MENUS = ['delete', 'deleteAll'];\n\n/**\n * Editor help features\n * @type {Array.}\n */\nexport const HELP_MENUS = [...ZOOM_HELP_MENUS, ...COMMAND_HELP_MENUS, ...DELETE_HELP_MENUS];\n\n/**\n * Fill type for shape\n * @type {Object.}\n */\nexport const SHAPE_FILL_TYPE = {\n FILTER: 'filter',\n COLOR: 'color',\n};\n\n/**\n * Shape type list\n * @type {Array.}\n */\nexport const SHAPE_TYPE = ['rect', 'circle', 'triangle'];\n\n/**\n * Object type\n * @type {Object.}\n */\nexport const OBJ_TYPE = {\n CROPZONE: 'cropzone',\n};\n\n/**\n * Filter type map\n * @type {Object.}\n */\nexport const filterType = {\n VINTAGE: 'vintage',\n SEPIA2: 'sepia2',\n REMOVE_COLOR: 'removeColor',\n COLOR_FILTER: 'colorFilter',\n REMOVE_WHITE: 'removeWhite',\n BLEND_COLOR: 'blendColor',\n BLEND: 'blend',\n};\n\n/**\n * Component names\n * @type {Object.}\n */\nexport const componentNames = keyMirror(\n 'IMAGE_LOADER',\n 'CROPPER',\n 'FLIP',\n 'ROTATION',\n 'FREE_DRAWING',\n 'LINE',\n 'TEXT',\n 'ICON',\n 'FILTER',\n 'SHAPE',\n 'ZOOM'\n);\n\n/**\n * Shape default option\n * @type {Object}\n */\nexport const SHAPE_DEFAULT_OPTIONS = {\n lockSkewingX: true,\n lockSkewingY: true,\n bringForward: true,\n isRegular: false,\n};\n\n/**\n * Cropzone default option\n * @type {Object}\n */\nexport const CROPZONE_DEFAULT_OPTIONS = {\n hasRotatingPoint: false,\n hasBorders: false,\n lockScalingFlip: true,\n lockRotation: true,\n lockSkewingX: true,\n lockSkewingY: true,\n};\n\n/**\n * Command names\n * @type {Object.}\n */\nexport const commandNames = {\n CLEAR_OBJECTS: 'clearObjects',\n LOAD_IMAGE: 'loadImage',\n FLIP_IMAGE: 'flip',\n ROTATE_IMAGE: 'rotate',\n ADD_OBJECT: 'addObject',\n REMOVE_OBJECT: 'removeObject',\n APPLY_FILTER: 'applyFilter',\n REMOVE_FILTER: 'removeFilter',\n ADD_ICON: 'addIcon',\n CHANGE_ICON_COLOR: 'changeIconColor',\n ADD_SHAPE: 'addShape',\n CHANGE_SHAPE: 'changeShape',\n ADD_TEXT: 'addText',\n CHANGE_TEXT: 'changeText',\n CHANGE_TEXT_STYLE: 'changeTextStyle',\n ADD_IMAGE_OBJECT: 'addImageObject',\n RESIZE_CANVAS_DIMENSION: 'resizeCanvasDimension',\n SET_OBJECT_PROPERTIES: 'setObjectProperties',\n SET_OBJECT_POSITION: 'setObjectPosition',\n CHANGE_SELECTION: 'changeSelection',\n};\n\n/**\n * Event names\n * @type {Object.}\n */\nexport const eventNames = {\n OBJECT_ACTIVATED: 'objectActivated',\n OBJECT_MOVED: 'objectMoved',\n OBJECT_SCALED: 'objectScaled',\n OBJECT_CREATED: 'objectCreated',\n OBJECT_ROTATED: 'objectRotated',\n OBJECT_ADDED: 'objectAdded',\n OBJECT_MODIFIED: 'objectModified',\n TEXT_EDITING: 'textEditing',\n TEXT_CHANGED: 'textChanged',\n ICON_CREATE_RESIZE: 'iconCreateResize',\n ICON_CREATE_END: 'iconCreateEnd',\n ADD_TEXT: 'addText',\n ADD_OBJECT: 'addObject',\n ADD_OBJECT_AFTER: 'addObjectAfter',\n MOUSE_DOWN: 'mousedown',\n MOUSE_UP: 'mouseup',\n MOUSE_MOVE: 'mousemove',\n // UNDO/REDO Events\n REDO_STACK_CHANGED: 'redoStackChanged',\n UNDO_STACK_CHANGED: 'undoStackChanged',\n SELECTION_CLEARED: 'selectionCleared',\n SELECTION_CREATED: 'selectionCreated',\n EXECUTE_COMMAND: 'executeCommand',\n AFTER_UNDO: 'afterUndo',\n AFTER_REDO: 'afterRedo',\n ZOOM_CHANGED: 'zoomChanged',\n HAND_STARTED: 'handStarted',\n HAND_STOPPED: 'handStopped',\n};\n\n/**\n * History names\n * @type {Object.}\n */\nexport const historyNames = {\n LOAD_IMAGE: 'Load',\n LOAD_MASK_IMAGE: 'Mask',\n ADD_MASK_IMAGE: 'Mask',\n ADD_IMAGE_OBJECT: 'Mask',\n CROP: 'Crop',\n APPLY_FILTER: 'Filter',\n REMOVE_FILTER: 'Filter',\n CHANGE_SHAPE: 'Shape',\n CHANGE_ICON_COLOR: 'Icon',\n ADD_TEXT: 'Text',\n CHANGE_TEXT_STYLE: 'Text',\n REMOVE_OBJECT: 'Delete',\n CLEAR_OBJECTS: 'Delete',\n};\n\n/**\n * Editor states\n * @type {Object.}\n */\nexport const drawingModes = keyMirror(\n 'NORMAL',\n 'CROPPER',\n 'FREE_DRAWING',\n 'LINE_DRAWING',\n 'TEXT',\n 'SHAPE',\n 'ICON',\n 'ZOOM'\n);\n\n/**\n * Menu names with drawing mode\n * @type {Object.}\n */\nexport const drawingMenuNames = {\n TEXT: 'text',\n CROP: 'crop',\n SHAPE: 'shape',\n ZOOM: 'zoom',\n};\n\n/**\n * Zoom modes\n * @type {Object.}\n */\nexport const zoomModes = {\n DEFAULT: 'normal',\n ZOOM: 'zoom',\n HAND: 'hand',\n};\n\n/**\n * Shortcut key values\n * @type {Object.}\n */\nexport const keyCodes = {\n Z: 90,\n Y: 89,\n C: 67,\n V: 86,\n SHIFT: 16,\n BACKSPACE: 8,\n DEL: 46,\n ARROW_DOWN: 40,\n ARROW_UP: 38,\n SPACE: 32,\n};\n\n/**\n * Fabric object options\n * @type {Object.}\n */\nexport const fObjectOptions = {\n SELECTION_STYLE: {\n borderColor: 'red',\n cornerColor: 'green',\n cornerSize: 10,\n originX: 'center',\n originY: 'center',\n transparentCorners: false,\n },\n};\n\n/**\n * Promise reject messages\n * @type {Object.}\n */\nexport const rejectMessages = {\n addedObject: 'The object is already added.',\n flip: 'The flipX and flipY setting values are not changed.',\n invalidDrawingMode: 'This operation is not supported in the drawing mode.',\n invalidParameters: 'Invalid parameters.',\n isLock: 'The executing command state is locked.',\n loadImage: 'The background image is empty.',\n loadingImageFailed: 'Invalid image loaded.',\n noActiveObject: 'There is no active object.',\n noObject: 'The object is not in canvas.',\n redo: 'The promise of redo command is reject.',\n rotation: 'The current angle is same the old angle.',\n undo: 'The promise of undo command is reject.',\n unsupportedOperation: 'Unsupported operation.',\n unsupportedType: 'Unsupported object type.',\n};\n\n/**\n * Default icon menu svg path\n * @type {Object.}\n */\nexport const defaultIconPath = {\n 'icon-arrow': 'M40 12V0l24 24-24 24V36H0V12h40z',\n 'icon-arrow-2': 'M49,32 H3 V22 h46 l-18,-18 h12 l23,23 L43,50 h-12 l18,-18 z ',\n 'icon-arrow-3':\n 'M43.349998,27 L17.354,53 H1.949999 l25.996,-26 L1.949999,1 h15.404 L43.349998,27 z ',\n 'icon-star':\n 'M35,54.557999 l-19.912001,10.468 l3.804,-22.172001 l-16.108,-15.7 l22.26,-3.236 L35,3.746 l9.956,20.172001 l22.26,3.236 l-16.108,15.7 l3.804,22.172001 z ',\n 'icon-star-2':\n 'M17,31.212 l-7.194,4.08 l-4.728,-6.83 l-8.234,0.524 l-1.328,-8.226 l-7.644,-3.14 l2.338,-7.992 l-5.54,-6.18 l5.54,-6.176 l-2.338,-7.994 l7.644,-3.138 l1.328,-8.226 l8.234,0.522 l4.728,-6.83 L17,-24.312 l7.194,-4.08 l4.728,6.83 l8.234,-0.522 l1.328,8.226 l7.644,3.14 l-2.338,7.992 l5.54,6.178 l-5.54,6.178 l2.338,7.992 l-7.644,3.14 l-1.328,8.226 l-8.234,-0.524 l-4.728,6.83 z ',\n 'icon-polygon': 'M3,31 L19,3 h32 l16,28 l-16,28 H19 z ',\n 'icon-location':\n 'M24 62C8 45.503 0 32.837 0 24 0 10.745 10.745 0 24 0s24 10.745 24 24c0 8.837-8 21.503-24 38zm0-28c5.523 0 10-4.477 10-10s-4.477-10-10-10-10 4.477-10 10 4.477 10 10 10z',\n 'icon-heart':\n 'M49.994999,91.349998 l-6.96,-6.333 C18.324001,62.606995 2.01,47.829002 2.01,29.690998 C2.01,14.912998 13.619999,3.299999 28.401001,3.299999 c8.349,0 16.362,5.859 21.594,12 c5.229,-6.141 13.242001,-12 21.591,-12 c14.778,0 26.390999,11.61 26.390999,26.390999 c0,18.138 -16.314001,32.916 -41.025002,55.374001 l-6.96,6.285 z ',\n 'icon-bubble':\n 'M44 48L34 58V48H12C5.373 48 0 42.627 0 36V12C0 5.373 5.373 0 12 0h40c6.627 0 12 5.373 12 12v24c0 6.627-5.373 12-12 12h-8z',\n};\n\nexport const defaultRotateRangeValues = {\n realTimeEvent: true,\n min: -360,\n max: 360,\n value: 0,\n};\n\nexport const defaultDrawRangeValues = {\n min: 5,\n max: 30,\n value: 12,\n};\n\nexport const defaultShapeStrokeValues = {\n realTimeEvent: true,\n min: 2,\n max: 300,\n value: 3,\n};\n\nexport const defaultTextRangeValues = {\n realTimeEvent: true,\n min: 10,\n max: 100,\n value: 50,\n};\n\nexport const defaultFilterRangeValues = {\n tintOpacityRange: {\n realTimeEvent: true,\n min: 0,\n max: 1,\n value: 0.7,\n useDecimal: true,\n },\n removewhiteDistanceRange: {\n realTimeEvent: true,\n min: 0,\n max: 1,\n value: 0.2,\n useDecimal: true,\n },\n brightnessRange: {\n realTimeEvent: true,\n min: -1,\n max: 1,\n value: 0,\n useDecimal: true,\n },\n noiseRange: {\n realTimeEvent: true,\n min: 0,\n max: 1000,\n value: 100,\n },\n pixelateRange: {\n realTimeEvent: true,\n min: 2,\n max: 20,\n value: 4,\n },\n colorfilterThresholdRange: {\n realTimeEvent: true,\n min: 0,\n max: 1,\n value: 0.2,\n useDecimal: true,\n },\n blurFilterRange: {\n value: 0.1,\n },\n};\n\nexport const emptyCropRectValues = {\n LEFT: 0,\n TOP: 0,\n WIDTH: 0.5,\n HEIGHT: 0.5,\n};\n","/**\n * @author NHN. FE Development Team \n * @fileoverview Util\n */\nimport { forEach, sendHostname, extend, isString, pick, inArray } from 'tui-code-snippet';\nimport Promise from 'core-js-pure/features/promise';\nimport {\n commandNames,\n filterType,\n historyNames,\n SHAPE_FILL_TYPE,\n SHAPE_TYPE,\n emptyCropRectValues,\n} from '@/consts';\n\nconst FLOATING_POINT_DIGIT = 2;\nconst CSS_PREFIX = 'tui-image-editor-';\nconst { min, max } = Math;\nlet hostnameSent = false;\n\n/**\n * Export Promise Class (for simplified module path)\n * @returns {Promise} promise class\n */\nexport { Promise };\n\n/**\n * Clamp value\n * @param {number} value - Value\n * @param {number} minValue - Minimum value\n * @param {number} maxValue - Maximum value\n * @returns {number} clamped value\n */\nexport function clamp(value, minValue, maxValue) {\n if (minValue > maxValue) {\n [minValue, maxValue] = [maxValue, minValue];\n }\n\n return max(minValue, min(value, maxValue));\n}\n\n/**\n * Make key-value object from arguments\n * @returns {object.}\n */\nexport function keyMirror(...args) {\n const obj = {};\n\n forEach(args, (key) => {\n obj[key] = key;\n });\n\n return obj;\n}\n\n/**\n * Make CSSText\n * @param {Object} styleObj - Style info object\n * @returns {string} Connected string of style\n */\nexport function makeStyleText(styleObj) {\n let styleStr = '';\n\n forEach(styleObj, (value, prop) => {\n styleStr += `${prop}: ${value};`;\n });\n\n return styleStr;\n}\n\n/**\n * Get object's properties\n * @param {Object} obj - object\n * @param {Array} keys - keys\n * @returns {Object} properties object\n */\nexport function getProperties(obj, keys) {\n const props = {};\n const { length } = keys;\n let i = 0;\n let key;\n\n for (i = 0; i < length; i += 1) {\n key = keys[i];\n props[key] = obj[key];\n }\n\n return props;\n}\n\n/**\n * ParseInt simpliment\n * @param {number} value - Value\n * @returns {number}\n */\nexport function toInteger(value) {\n return parseInt(value, 10);\n}\n\n/**\n * String to camelcase string\n * @param {string} targetString - change target\n * @returns {string}\n * @private\n */\nexport function toCamelCase(targetString) {\n return targetString.replace(/-([a-z])/g, ($0, $1) => $1.toUpperCase());\n}\n\n/**\n * Check browser file api support\n * @returns {boolean}\n * @private\n */\nexport function isSupportFileApi() {\n return !!(window.File && window.FileList && window.FileReader);\n}\n\n/**\n * hex to rgb\n * @param {string} color - hex color\n * @param {string} alpha - color alpha value\n * @returns {string} rgb expression\n */\nexport function getRgb(color, alpha) {\n if (color.length === 4) {\n color = `${color}${color.slice(1, 4)}`;\n }\n const r = parseInt(color.slice(1, 3), 16);\n const g = parseInt(color.slice(3, 5), 16);\n const b = parseInt(color.slice(5, 7), 16);\n const a = alpha || 1;\n\n return `rgba(${r}, ${g}, ${b}, ${a})`;\n}\n\n/**\n * send hostname\n */\nexport function sendHostName() {\n if (hostnameSent) {\n return;\n }\n hostnameSent = true;\n\n sendHostname('image-editor', 'UA-129999381-1');\n}\n\n/**\n * Apply css resource\n * @param {string} styleBuffer - serialized css text\n * @param {string} tagId - style tag id\n */\nexport function styleLoad(styleBuffer, tagId) {\n const [head] = document.getElementsByTagName('head');\n const linkElement = document.createElement('link');\n const styleData = encodeURIComponent(styleBuffer);\n if (tagId) {\n linkElement.id = tagId;\n // linkElement.id = 'tui-image-editor-theme-style';\n }\n linkElement.setAttribute('rel', 'stylesheet');\n linkElement.setAttribute('type', 'text/css');\n linkElement.setAttribute('href', `data:text/css;charset=UTF-8,${styleData}`);\n head.appendChild(linkElement);\n}\n\n/**\n * Get selector\n * @param {HTMLElement} targetElement - target element\n * @returns {Function} selector\n */\nexport function getSelector(targetElement) {\n return (str) => targetElement.querySelector(str);\n}\n\n/**\n * Change base64 to blob\n * @param {String} data - base64 string data\n * @returns {Blob} Blob Data\n */\nexport function base64ToBlob(data) {\n const rImageType = /data:(image\\/.+);base64,/;\n let mimeString = '';\n let raw, uInt8Array, i;\n\n raw = data.replace(rImageType, (header, imageType) => {\n mimeString = imageType;\n\n return '';\n });\n\n raw = atob(raw);\n const rawLength = raw.length;\n uInt8Array = new Uint8Array(rawLength); // eslint-disable-line\n\n for (i = 0; i < rawLength; i += 1) {\n uInt8Array[i] = raw.charCodeAt(i);\n }\n\n return new Blob([uInt8Array], { type: mimeString });\n}\n\n/**\n * Fix floating point diff.\n * @param {number} value - original value\n * @returns {number} fixed value\n */\nexport function fixFloatingPoint(value) {\n return Number(value.toFixed(FLOATING_POINT_DIGIT));\n}\n\n/**\n * Assignment for destroying objects.\n * @param {Object} targetObject - object to be removed.\n */\nexport function assignmentForDestroy(targetObject) {\n forEach(targetObject, (value, key) => {\n targetObject[key] = null;\n });\n}\n\n/**\n * Make class name for ui\n * @param {String} str - main string of className\n * @param {String} prefix - prefix string of className\n * @returns {String} class name\n */\nexport function cls(str = '', prefix = '') {\n if (str.charAt(0) === '.') {\n return `.${CSS_PREFIX}${prefix}${str.slice(1)}`;\n }\n\n return `${CSS_PREFIX}${prefix}${str}`;\n}\n\n/**\n * Change object origin\n * @param {fabric.Object} fObject - fabric object\n * @param {Object} origin - origin of fabric object\n * @param {string} originX - horizontal basis.\n * @param {string} originY - vertical basis.\n */\nexport function changeOrigin(fObject, origin) {\n const { originX, originY } = origin;\n const { x: left, y: top } = fObject.getPointByOrigin(originX, originY);\n\n fObject.set({\n left,\n top,\n originX,\n originY,\n });\n\n fObject.setCoords();\n}\n\n/**\n * Object key value flip\n * @param {Object} targetObject - The data object of the key value.\n * @returns {Object}\n */\nexport function flipObject(targetObject) {\n const result = {};\n\n Object.keys(targetObject).forEach((key) => {\n result[targetObject[key]] = key;\n });\n\n return result;\n}\n\n/**\n * Set custom properties\n * @param {Object} targetObject - target object\n * @param {Object} props - custom props object\n */\nexport function setCustomProperty(targetObject, props) {\n targetObject.customProps = targetObject.customProps || {};\n extend(targetObject.customProps, props);\n}\n\n/**\n * Get custom property\n * @param {fabric.Object} fObject - fabric object\n * @param {Array|string} propNames - prop name array\n * @returns {object | number | string}\n */\nexport function getCustomProperty(fObject, propNames) {\n const resultObject = {};\n if (isString(propNames)) {\n propNames = [propNames];\n }\n forEach(propNames, (propName) => {\n resultObject[propName] = fObject.customProps[propName];\n });\n\n return resultObject;\n}\n\n/**\n * Capitalize string\n * @param {string} targetString - target string\n * @returns {string}\n */\nexport function capitalizeString(targetString) {\n return targetString.charAt(0).toUpperCase() + targetString.slice(1);\n}\n\n/**\n * Array includes check\n * @param {Array} targetArray - target array\n * @param {string|number} compareValue - compare value\n * @returns {boolean}\n */\nexport function includes(targetArray, compareValue) {\n return targetArray.indexOf(compareValue) >= 0;\n}\n\n/**\n * Get fill type\n * @param {Object | string} fillOption - shape fill option\n * @returns {string} 'color' or 'filter'\n */\nexport function getFillTypeFromOption(fillOption = {}) {\n return pick(fillOption, 'type') || SHAPE_FILL_TYPE.COLOR;\n}\n\n/**\n * Get fill type of shape type object\n * @param {fabric.Object} shapeObj - fabric object\n * @returns {string} 'transparent' or 'color' or 'filter'\n */\nexport function getFillTypeFromObject(shapeObj) {\n const { fill = {} } = shapeObj;\n if (fill.source) {\n return SHAPE_FILL_TYPE.FILTER;\n }\n\n return SHAPE_FILL_TYPE.COLOR;\n}\n\n/**\n * Check if the object is a shape object.\n * @param {fabric.Object} obj - fabric object\n * @returns {boolean}\n */\nexport function isShape(obj) {\n return inArray(obj.get('type'), SHAPE_TYPE) >= 0;\n}\n\n/**\n * Get object type\n * @param {string} type - fabric object type\n * @returns {string} type of object (ex: shape, icon, ...)\n */\nexport function getObjectType(type) {\n if (includes(SHAPE_TYPE, type)) {\n return 'Shape';\n }\n\n switch (type) {\n case 'i-text':\n return 'Text';\n case 'path':\n case 'line':\n return 'Draw';\n case 'activeSelection':\n return 'Group';\n default:\n return toStartOfCapital(type);\n }\n}\n\n/**\n * Get filter type\n * @param {string} type - fabric filter type\n * @param {object} [options] - filter type options\n * @param {boolean} [options.useAlpha=true] - usage of alpha(true is 'color filter', false is 'remove white')\n * @param {string} [options.mode] - mode of blendColor\n * @returns {string} type of filter (ex: sepia, blur, ...)\n */\nfunction getFilterType(type, { useAlpha = true, mode } = {}) {\n const {\n VINTAGE,\n REMOVE_COLOR,\n BLEND_COLOR,\n SEPIA2,\n COLOR_FILTER,\n REMOVE_WHITE,\n BLEND,\n } = filterType;\n\n let filterName;\n\n switch (type) {\n case VINTAGE:\n filterName = SEPIA2;\n break;\n case REMOVE_COLOR:\n filterName = useAlpha ? COLOR_FILTER : REMOVE_WHITE;\n break;\n case BLEND_COLOR:\n filterName = mode === 'add' ? BLEND : mode;\n break;\n default:\n filterName = type;\n }\n\n return toStartOfCapital(filterName);\n}\n\n/**\n * Check if command is silent command\n * @param {Command|string} command - command or command name\n * @returns {boolean}\n */\nexport function isSilentCommand(command) {\n const { LOAD_IMAGE } = commandNames;\n\n return typeof command === 'string' ? LOAD_IMAGE === command : LOAD_IMAGE === command.name;\n}\n\n/**\n * Get command name\n * @param {Command|string} command - command or command name\n * @returns {{name: string, ?detail: string}}\n */\n// eslint-disable-next-line complexity, require-jsdoc\nexport function getHistoryTitle(command) {\n const {\n FLIP_IMAGE,\n ROTATE_IMAGE,\n ADD_TEXT,\n APPLY_FILTER,\n REMOVE_FILTER,\n CHANGE_SHAPE,\n CHANGE_ICON_COLOR,\n CHANGE_TEXT_STYLE,\n CLEAR_OBJECTS,\n ADD_IMAGE_OBJECT,\n REMOVE_OBJECT,\n } = commandNames;\n const { name, args } = command;\n let historyInfo;\n\n switch (name) {\n case FLIP_IMAGE:\n historyInfo = { name, detail: args[1] === 'reset' ? args[1] : args[1].slice(4) };\n break;\n case ROTATE_IMAGE:\n historyInfo = { name, detail: args[2] };\n break;\n case APPLY_FILTER:\n historyInfo = { name: historyNames.APPLY_FILTER, detail: getFilterType(args[1], args[2]) };\n break;\n case REMOVE_FILTER:\n historyInfo = { name: historyNames.REMOVE_FILTER, detail: 'Remove' };\n break;\n case CHANGE_SHAPE:\n historyInfo = { name: historyNames.CHANGE_SHAPE, detail: 'Change' };\n break;\n case CHANGE_ICON_COLOR:\n historyInfo = { name: historyNames.CHANGE_ICON_COLOR, detail: 'Change' };\n break;\n case CHANGE_TEXT_STYLE:\n historyInfo = { name: historyNames.CHANGE_TEXT_STYLE, detail: 'Change' };\n break;\n case REMOVE_OBJECT:\n historyInfo = { name: historyNames.REMOVE_OBJECT, detail: args[2] };\n break;\n case CLEAR_OBJECTS:\n historyInfo = { name: historyNames.CLEAR_OBJECTS, detail: 'All' };\n break;\n case ADD_IMAGE_OBJECT:\n historyInfo = { name: historyNames.ADD_IMAGE_OBJECT, detail: 'Add' };\n break;\n case ADD_TEXT:\n historyInfo = { name: historyNames.ADD_TEXT };\n break;\n\n default:\n historyInfo = { name };\n break;\n }\n\n if (args[1] === 'mask') {\n historyInfo = { name: historyNames.LOAD_MASK_IMAGE, detail: 'Apply' };\n }\n\n return historyInfo;\n}\n\n/**\n * Get help menubar position(opposite of menubar)\n * @param {string} position - position of menubar\n * @returns {string} position of help menubar\n */\nexport function getHelpMenuBarPosition(position) {\n if (position === 'top') {\n return 'bottom';\n }\n if (position === 'left') {\n return 'right';\n }\n if (position === 'right') {\n return 'left';\n }\n\n return 'top';\n}\n\n/**\n * Change to capital start letter\n * @param {string} str - string to change\n * @returns {string}\n */\nfunction toStartOfCapital(str) {\n return str.replace(/[a-z]/, (first) => first.toUpperCase());\n}\n\n/**\n * Check if cropRect is Empty.\n * @param {Object} cropRect - cropRect object\n * @param {Number} cropRect.left - cropRect left position value\n * @param {Number} cropRect.top - cropRect top position value\n * @param {Number} cropRect.width - cropRect width value\n * @param {Number} cropRect.height - cropRect height value\n * @returns {boolean}\n */\nexport function isEmptyCropzone(cropRect) {\n const { left, top, width, height } = cropRect;\n const { LEFT, TOP, WIDTH, HEIGHT } = emptyCropRectValues;\n\n return left === LEFT && top === TOP && width === WIDTH && height === HEIGHT;\n}\n","module.exports = __WEBPACK_EXTERNAL_MODULE__2__;","/**\n * @author NHN. FE Development Team \n * @fileoverview Command factory\n */\nimport Command from '@/interface/command';\n\nconst commands = {};\n\n/**\n * Create a command\n * @param {string} name - Command name\n * @param {...*} args - Arguments for creating command\n * @returns {Command}\n * @ignore\n */\nfunction create(name, ...args) {\n const actions = commands[name];\n if (actions) {\n return new Command(actions, args);\n }\n\n return null;\n}\n\n/**\n * Register a command with name as a key\n * @param {Object} command - {name:{string}, execute: {function}, undo: {function}}\n * @param {string} command.name - command name\n * @param {function} command.execute - executable function\n * @param {function} command.undo - undo function\n * @ignore\n */\nfunction register(command) {\n commands[command.name] = command;\n}\n\nexport default {\n create,\n register,\n};\n","module.exports = __WEBPACK_EXTERNAL_MODULE__4__;","var check = function (it) {\n return it && it.Math == Math && it;\n};\n\n// https://github.com/zloirock/core-js/issues/86#issuecomment-115759028\nmodule.exports =\n // eslint-disable-next-line no-undef\n check(typeof globalThis == 'object' && globalThis) ||\n check(typeof window == 'object' && window) ||\n check(typeof self == 'object' && self) ||\n check(typeof global == 'object' && global) ||\n // eslint-disable-next-line no-new-func\n Function('return this')();\n","var global = require('../internals/global');\nvar shared = require('../internals/shared');\nvar has = require('../internals/has');\nvar uid = require('../internals/uid');\nvar NATIVE_SYMBOL = require('../internals/native-symbol');\nvar USE_SYMBOL_AS_UID = require('../internals/use-symbol-as-uid');\n\nvar WellKnownSymbolsStore = shared('wks');\nvar Symbol = global.Symbol;\nvar createWellKnownSymbol = USE_SYMBOL_AS_UID ? Symbol : Symbol && Symbol.withoutSetter || uid;\n\nmodule.exports = function (name) {\n if (!has(WellKnownSymbolsStore, name)) {\n if (NATIVE_SYMBOL && has(Symbol, name)) WellKnownSymbolsStore[name] = Symbol[name];\n else WellKnownSymbolsStore[name] = createWellKnownSymbol('Symbol.' + name);\n } return WellKnownSymbolsStore[name];\n};\n","/**\n * @author NHN. FE Development Team \n * @fileoverview Component interface\n */\n\n/**\n * Component interface\n * @class\n * @param {string} name - component name\n * @param {Graphics} graphics - Graphics instance\n * @ignore\n */\nclass Component {\n constructor(name, graphics) {\n /**\n * Component name\n * @type {string}\n */\n this.name = name;\n\n /**\n * Graphics instance\n * @type {Graphics}\n */\n this.graphics = graphics;\n }\n\n /**\n * Fire Graphics event\n * @returns {Object} return value\n */\n fire(...args) {\n const context = this.graphics;\n\n return this.graphics.fire.apply(context, args);\n }\n\n /**\n * Save image(background) of canvas\n * @param {string} name - Name of image\n * @param {fabric.Image} oImage - Fabric image instance\n */\n setCanvasImage(name, oImage) {\n this.graphics.setCanvasImage(name, oImage);\n }\n\n /**\n * Returns canvas element of fabric.Canvas[[lower-canvas]]\n * @returns {HTMLCanvasElement}\n */\n getCanvasElement() {\n return this.graphics.getCanvasElement();\n }\n\n /**\n * Get fabric.Canvas instance\n * @returns {fabric.Canvas}\n */\n getCanvas() {\n return this.graphics.getCanvas();\n }\n\n /**\n * Get canvasImage (fabric.Image instance)\n * @returns {fabric.Image}\n */\n getCanvasImage() {\n return this.graphics.getCanvasImage();\n }\n\n /**\n * Get image name\n * @returns {string}\n */\n getImageName() {\n return this.graphics.getImageName();\n }\n\n /**\n * Get image editor\n * @returns {ImageEditor}\n */\n getEditor() {\n return this.graphics.getEditor();\n }\n\n /**\n * Return component name\n * @returns {string}\n */\n getName() {\n return this.name;\n }\n\n /**\n * Set image properties\n * @param {Object} setting - Image properties\n * @param {boolean} [withRendering] - If true, The changed image will be reflected in the canvas\n */\n setImageProperties(setting, withRendering) {\n this.graphics.setImageProperties(setting, withRendering);\n }\n\n /**\n * Set canvas dimension - css only\n * @param {Object} dimension - Canvas css dimension\n */\n setCanvasCssDimension(dimension) {\n this.graphics.setCanvasCssDimension(dimension);\n }\n\n /**\n * Set canvas dimension - css only\n * @param {Object} dimension - Canvas backstore dimension\n */\n setCanvasBackstoreDimension(dimension) {\n this.graphics.setCanvasBackstoreDimension(dimension);\n }\n\n /**\n * Adjust canvas dimension with scaling image\n */\n adjustCanvasDimension() {\n this.graphics.adjustCanvasDimension();\n }\n}\n\nexport default Component;\n","var DESCRIPTORS = require('../internals/descriptors');\nvar definePropertyModule = require('../internals/object-define-property');\nvar createPropertyDescriptor = require('../internals/create-property-descriptor');\n\nmodule.exports = DESCRIPTORS ? function (object, key, value) {\n return definePropertyModule.f(object, key, createPropertyDescriptor(1, value));\n} : function (object, key, value) {\n object[key] = value;\n return object;\n};\n","/**\n * Submenu Base Class\n * @class\n * @ignore\n */\nclass Submenu {\n /**\n * @param {HTMLElement} subMenuElement - submenu dom element\n * @param {Locale} locale - translate text\n * @param {string} name - name of sub menu\n * @param {Object} iconStyle - style of icon\n * @param {string} menuBarPosition - position of menu\n * @param {*} templateHtml - template for SubMenuElement\n * @param {boolean} [usageStatistics=false] - template for SubMenuElement\n */\n constructor(\n subMenuElement,\n { locale, name, makeSvgIcon, menuBarPosition, templateHtml, usageStatistics }\n ) {\n this.subMenuElement = subMenuElement;\n this.menuBarPosition = menuBarPosition;\n this.toggleDirection = menuBarPosition === 'top' ? 'down' : 'up';\n this.colorPickerControls = [];\n this.usageStatistics = usageStatistics;\n this.eventHandler = {};\n this._makeSubMenuElement({\n locale,\n name,\n makeSvgIcon,\n templateHtml,\n });\n }\n\n /**\n * editor dom ui query selector\n * @param {string} selectName - query selector string name\n * @returns {HTMLElement}\n */\n selector(selectName) {\n return this.subMenuElement.querySelector(selectName);\n }\n\n /**\n * change show state change for colorpicker instance\n * @param {Colorpicker} occurredControl - target Colorpicker Instance\n */\n colorPickerChangeShow(occurredControl) {\n this.colorPickerControls.forEach((pickerControl) => {\n if (occurredControl !== pickerControl) {\n pickerControl.hide();\n }\n });\n }\n\n /**\n * Get button type\n * @param {HTMLElement} button - event target element\n * @param {array} buttonNames - Array of button names\n * @returns {string} - button type\n */\n getButtonType(button, buttonNames) {\n return button.className.match(RegExp(`(${buttonNames.join('|')})`))[0];\n }\n\n /**\n * Get button type\n * @param {HTMLElement} target - event target element\n * @param {string} removeClass - remove class name\n * @param {string} addClass - add class name\n */\n changeClass(target, removeClass, addClass) {\n target.classList.remove(removeClass);\n target.classList.add(addClass);\n }\n\n /**\n * Interface method whose implementation is optional.\n * Returns the menu to its default state.\n */\n changeStandbyMode() {}\n\n /**\n * Interface method whose implementation is optional.\n * Executed when the menu starts.\n */\n changeStartMode() {}\n\n /**\n * Make submenu dom element\n * @param {Locale} locale - translate text\n * @param {string} name - submenu name\n * @param {Object} iconStyle - icon style\n * @param {*} templateHtml - template for SubMenuElement\n * @private\n */\n _makeSubMenuElement({ locale, name, iconStyle, makeSvgIcon, templateHtml }) {\n const iconSubMenu = document.createElement('div');\n iconSubMenu.className = `tui-image-editor-menu-${name}`;\n iconSubMenu.innerHTML = templateHtml({\n locale,\n iconStyle,\n makeSvgIcon,\n });\n\n this.subMenuElement.appendChild(iconSubMenu);\n }\n}\n\nexport default Submenu;\n","module.exports = function (exec) {\n try {\n return !!exec();\n } catch (error) {\n return true;\n }\n};\n","var isObject = require('../internals/is-object');\n\nmodule.exports = function (it) {\n if (!isObject(it)) {\n throw TypeError(String(it) + ' is not an object');\n } return it;\n};\n","var hasOwnProperty = {}.hasOwnProperty;\n\nmodule.exports = function (it, key) {\n return hasOwnProperty.call(it, key);\n};\n","var fails = require('../internals/fails');\n\n// Thank's IE8 for his funny defineProperty\nmodule.exports = !fails(function () {\n return Object.defineProperty({}, 1, { get: function () { return 7; } })[1] != 7;\n});\n","module.exports = function (it) {\n return typeof it === 'object' ? it !== null : typeof it === 'function';\n};\n","'use strict';\nvar global = require('../internals/global');\nvar getOwnPropertyDescriptor = require('../internals/object-get-own-property-descriptor').f;\nvar isForced = require('../internals/is-forced');\nvar path = require('../internals/path');\nvar bind = require('../internals/function-bind-context');\nvar createNonEnumerableProperty = require('../internals/create-non-enumerable-property');\nvar has = require('../internals/has');\n\nvar wrapConstructor = function (NativeConstructor) {\n var Wrapper = function (a, b, c) {\n if (this instanceof NativeConstructor) {\n switch (arguments.length) {\n case 0: return new NativeConstructor();\n case 1: return new NativeConstructor(a);\n case 2: return new NativeConstructor(a, b);\n } return new NativeConstructor(a, b, c);\n } return NativeConstructor.apply(this, arguments);\n };\n Wrapper.prototype = NativeConstructor.prototype;\n return Wrapper;\n};\n\n/*\n options.target - name of the target object\n options.global - target is the global object\n options.stat - export as static methods of target\n options.proto - export as prototype methods of target\n options.real - real prototype method for the `pure` version\n options.forced - export even if the native feature is available\n options.bind - bind methods to the target, required for the `pure` version\n options.wrap - wrap constructors to preventing global pollution, required for the `pure` version\n options.unsafe - use the simple assignment of property instead of delete + defineProperty\n options.sham - add a flag to not completely full polyfills\n options.enumerable - export as enumerable property\n options.noTargetGet - prevent calling a getter on target\n*/\nmodule.exports = function (options, source) {\n var TARGET = options.target;\n var GLOBAL = options.global;\n var STATIC = options.stat;\n var PROTO = options.proto;\n\n var nativeSource = GLOBAL ? global : STATIC ? global[TARGET] : (global[TARGET] || {}).prototype;\n\n var target = GLOBAL ? path : path[TARGET] || (path[TARGET] = {});\n var targetPrototype = target.prototype;\n\n var FORCED, USE_NATIVE, VIRTUAL_PROTOTYPE;\n var key, sourceProperty, targetProperty, nativeProperty, resultProperty, descriptor;\n\n for (key in source) {\n FORCED = isForced(GLOBAL ? key : TARGET + (STATIC ? '.' : '#') + key, options.forced);\n // contains in native\n USE_NATIVE = !FORCED && nativeSource && has(nativeSource, key);\n\n targetProperty = target[key];\n\n if (USE_NATIVE) if (options.noTargetGet) {\n descriptor = getOwnPropertyDescriptor(nativeSource, key);\n nativeProperty = descriptor && descriptor.value;\n } else nativeProperty = nativeSource[key];\n\n // export native or implementation\n sourceProperty = (USE_NATIVE && nativeProperty) ? nativeProperty : source[key];\n\n if (USE_NATIVE && typeof targetProperty === typeof sourceProperty) continue;\n\n // bind timers to global for call from export context\n if (options.bind && USE_NATIVE) resultProperty = bind(sourceProperty, global);\n // wrap global constructors for prevent changs in this version\n else if (options.wrap && USE_NATIVE) resultProperty = wrapConstructor(sourceProperty);\n // make static versions for prototype methods\n else if (PROTO && typeof sourceProperty == 'function') resultProperty = bind(Function.call, sourceProperty);\n // default case\n else resultProperty = sourceProperty;\n\n // add a flag to not completely full polyfills\n if (options.sham || (sourceProperty && sourceProperty.sham) || (targetProperty && targetProperty.sham)) {\n createNonEnumerableProperty(resultProperty, 'sham', true);\n }\n\n target[key] = resultProperty;\n\n if (PROTO) {\n VIRTUAL_PROTOTYPE = TARGET + 'Prototype';\n if (!has(path, VIRTUAL_PROTOTYPE)) {\n createNonEnumerableProperty(path, VIRTUAL_PROTOTYPE, {});\n }\n // export virtual prototype methods\n path[VIRTUAL_PROTOTYPE][key] = sourceProperty;\n // export real prototype methods\n if (options.real && targetPrototype && !targetPrototype[key]) {\n createNonEnumerableProperty(targetPrototype, key, sourceProperty);\n }\n }\n }\n};\n","/**\n * @author NHN. FE Development Team \n * @fileoverview DrawingMode interface\n */\nimport errorMessage from '@/factory/errorMessage';\n\nconst createMessage = errorMessage.create;\nconst errorTypes = errorMessage.types;\n\n/**\n * DrawingMode interface\n * @class\n * @param {string} name - drawing mode name\n * @ignore\n */\nclass DrawingMode {\n constructor(name) {\n /**\n * the name of drawing mode\n * @type {string}\n */\n this.name = name;\n }\n\n /**\n * Get this drawing mode name;\n * @returns {string} drawing mode name\n */\n getName() {\n return this.name;\n }\n\n /**\n * start this drawing mode\n * @param {Object} options - drawing mode options\n * @abstract\n */\n start() {\n throw new Error(createMessage(errorTypes.UN_IMPLEMENTATION, 'start'));\n }\n\n /**\n * stop this drawing mode\n * @abstract\n */\n end() {\n throw new Error(createMessage(errorTypes.UN_IMPLEMENTATION, 'stop'));\n }\n}\n\nexport default DrawingMode;\n","module.exports = function (it) {\n if (typeof it != 'function') {\n throw TypeError(String(it) + ' is not a function');\n } return it;\n};\n","var path = require('../internals/path');\nvar global = require('../internals/global');\n\nvar aFunction = function (variable) {\n return typeof variable == 'function' ? variable : undefined;\n};\n\nmodule.exports = function (namespace, method) {\n return arguments.length < 2 ? aFunction(path[namespace]) || aFunction(global[namespace])\n : path[namespace] && path[namespace][method] || global[namespace] && global[namespace][method];\n};\n","module.exports = {};\n","var DESCRIPTORS = require('../internals/descriptors');\nvar IE8_DOM_DEFINE = require('../internals/ie8-dom-define');\nvar anObject = require('../internals/an-object');\nvar toPrimitive = require('../internals/to-primitive');\n\nvar nativeDefineProperty = Object.defineProperty;\n\n// `Object.defineProperty` method\n// https://tc39.github.io/ecma262/#sec-object.defineproperty\nexports.f = DESCRIPTORS ? nativeDefineProperty : function defineProperty(O, P, Attributes) {\n anObject(O);\n P = toPrimitive(P, true);\n anObject(Attributes);\n if (IE8_DOM_DEFINE) try {\n return nativeDefineProperty(O, P, Attributes);\n } catch (error) { /* empty */ }\n if ('get' in Attributes || 'set' in Attributes) throw TypeError('Accessors not supported');\n if ('value' in Attributes) O[P] = Attributes.value;\n return O;\n};\n","module.exports = true;\n","var toString = {}.toString;\n\nmodule.exports = function (it) {\n return toString.call(it).slice(8, -1);\n};\n","'use strict';\nvar aFunction = require('../internals/a-function');\n\nvar PromiseCapability = function (C) {\n var resolve, reject;\n this.promise = new C(function ($$resolve, $$reject) {\n if (resolve !== undefined || reject !== undefined) throw TypeError('Bad Promise constructor');\n resolve = $$resolve;\n reject = $$reject;\n });\n this.resolve = aFunction(resolve);\n this.reject = aFunction(reject);\n};\n\n// 25.4.1.5 NewPromiseCapability(C)\nmodule.exports.f = function (C) {\n return new PromiseCapability(C);\n};\n","import snippet from 'tui-code-snippet';\nimport tuiColorPicker from 'tui-color-picker';\n\nconst PICKER_COLOR = [\n '#000000',\n '#2a2a2a',\n '#545454',\n '#7e7e7e',\n '#a8a8a8',\n '#d2d2d2',\n '#ffffff',\n '',\n '#ff4040',\n '#ff6518',\n '#ffbb3b',\n '#03bd9e',\n '#00a9ff',\n '#515ce6',\n '#9e5fff',\n '#ff5583',\n];\n\n/**\n * Colorpicker control class\n * @class\n * @ignore\n */\nclass Colorpicker {\n constructor(\n colorpickerElement,\n defaultColor = '#7e7e7e',\n toggleDirection = 'up',\n usageStatistics\n ) {\n this.colorpickerElement = colorpickerElement;\n this.usageStatistics = usageStatistics;\n\n this._show = false;\n\n this._colorpickerElement = colorpickerElement;\n this._toggleDirection = toggleDirection;\n this._makePickerButtonElement(defaultColor);\n this._makePickerLayerElement(colorpickerElement, colorpickerElement.getAttribute('title'));\n this._color = defaultColor;\n this.picker = tuiColorPicker.create({\n container: this.pickerElement,\n preset: PICKER_COLOR,\n color: defaultColor,\n usageStatistics: this.usageStatistics,\n });\n\n this._addEvent();\n }\n\n /**\n * Destroys the instance.\n */\n destroy() {\n this._removeEvent();\n this.picker.destroy();\n this.colorpickerElement.innerHTML = '';\n snippet.forEach(this, (value, key) => {\n this[key] = null;\n });\n }\n\n /**\n * Get color\n * @returns {Number} color value\n */\n get color() {\n return this._color;\n }\n\n /**\n * Set color\n * @param {string} color color value\n */\n set color(color) {\n this._color = color;\n this._changeColorElement(color);\n }\n\n /**\n * Change color element\n * @param {string} color color value\n * #private\n */\n _changeColorElement(color) {\n if (color) {\n this.colorElement.classList.remove('transparent');\n this.colorElement.style.backgroundColor = color;\n } else {\n this.colorElement.style.backgroundColor = '#fff';\n this.colorElement.classList.add('transparent');\n }\n }\n\n /**\n * Make picker button element\n * @param {string} defaultColor color value\n * @private\n */\n _makePickerButtonElement(defaultColor) {\n this.colorpickerElement.classList.add('tui-image-editor-button');\n\n this.colorElement = document.createElement('div');\n this.colorElement.className = 'color-picker-value';\n if (defaultColor) {\n this.colorElement.style.backgroundColor = defaultColor;\n } else {\n this.colorElement.classList.add('transparent');\n }\n }\n\n /**\n * Make picker layer element\n * @param {HTMLElement} colorpickerElement color picker element\n * @param {string} title picker title\n * @private\n */\n _makePickerLayerElement(colorpickerElement, title) {\n const label = document.createElement('label');\n const triangle = document.createElement('div');\n\n this.pickerControl = document.createElement('div');\n this.pickerControl.className = 'color-picker-control';\n\n this.pickerElement = document.createElement('div');\n this.pickerElement.className = 'color-picker';\n\n label.innerHTML = title;\n triangle.className = 'triangle';\n\n this.pickerControl.appendChild(this.pickerElement);\n this.pickerControl.appendChild(triangle);\n\n colorpickerElement.appendChild(this.pickerControl);\n colorpickerElement.appendChild(this.colorElement);\n colorpickerElement.appendChild(label);\n }\n\n /**\n * Add event\n * @private\n */\n _addEvent() {\n this.picker.on('selectColor', (value) => {\n this._changeColorElement(value.color);\n this._color = value.color;\n this.fire('change', value.color);\n });\n\n this.eventHandler = {\n pickerToggle: this._pickerToggleEventHandler.bind(this),\n pickerHide: () => this.hide(),\n };\n\n this.colorpickerElement.addEventListener('click', this.eventHandler.pickerToggle);\n document.body.addEventListener('click', this.eventHandler.pickerHide);\n }\n\n /**\n * Remove event\n * @private\n */\n _removeEvent() {\n this.colorpickerElement.removeEventListener('click', this.eventHandler.pickerToggle);\n document.body.removeEventListener('click', this.eventHandler.pickerHide);\n this.picker.off();\n }\n\n /**\n * Picker toggle event handler\n * @param {object} event - change event\n * @private\n */\n _pickerToggleEventHandler(event) {\n const { target } = event;\n const isInPickerControl = target && this._isElementInColorPickerControl(target);\n\n if (!isInPickerControl || (isInPickerControl && this._isPaletteButton(target))) {\n this._show = !this._show;\n this.pickerControl.style.display = this._show ? 'block' : 'none';\n this._setPickerControlPosition();\n this.fire('changeShow', this);\n }\n event.stopPropagation();\n }\n\n /**\n * Check hex input or not\n * @param {Element} target - Event target element\n * @returns {boolean}\n * @private\n */\n _isPaletteButton(target) {\n return target.className === 'tui-colorpicker-palette-button';\n }\n\n /**\n * Check given element is in pickerControl element\n * @param {Element} element - element to check\n * @returns {boolean}\n * @private\n */\n _isElementInColorPickerControl(element) {\n let parentNode = element;\n\n while (parentNode !== document.body) {\n if (!parentNode) {\n break;\n }\n\n if (parentNode === this.pickerControl) {\n return true;\n }\n\n parentNode = parentNode.parentNode;\n }\n\n return false;\n }\n\n hide() {\n this._show = false;\n this.pickerControl.style.display = 'none';\n }\n\n /**\n * Set picker control position\n * @private\n */\n _setPickerControlPosition() {\n const controlStyle = this.pickerControl.style;\n const halfPickerWidth = this._colorpickerElement.clientWidth / 2 + 2;\n const left = this.pickerControl.offsetWidth / 2 - halfPickerWidth;\n let top = (this.pickerControl.offsetHeight + 10) * -1;\n\n if (this._toggleDirection === 'down') {\n top = 30;\n }\n\n controlStyle.top = `${top}px`;\n controlStyle.left = `-${left}px`;\n }\n}\n\nsnippet.CustomEvents.mixin(Colorpicker);\nexport default Colorpicker;\n","import snippet from 'tui-code-snippet';\nimport { toInteger, clamp } from '@/util';\nimport { keyCodes } from '@/consts';\n\nconst INPUT_FILTER_REGEXP = /(-?)([0-9]*)[^0-9]*([0-9]*)/g;\n\n/**\n * Range control class\n * @class\n * @ignore\n */\nclass Range {\n /**\n * @constructor\n * @extends {View}\n * @param {Object} rangeElements - Html resources for creating sliders\n * @param {HTMLElement} rangeElements.slider - b\n * @param {HTMLElement} [rangeElements.input] - c\n * @param {Object} options - Slider make options\n * @param {number} options.min - min value\n * @param {number} options.max - max value\n * @param {number} options.value - default value\n * @param {number} [options.useDecimal] - Decimal point processing.\n * @param {boolean} [options.realTimeEvent] - Reflect live events.\n */\n constructor(rangeElements, options = {}) {\n this._value = options.value || 0;\n\n this.rangeElement = rangeElements.slider;\n this.rangeInputElement = rangeElements.input;\n\n this._drawRangeElement();\n\n this.rangeWidth = this._getRangeWidth();\n this._min = options.min || 0;\n this._max = options.max || 100;\n this._useDecimal = options.useDecimal;\n this._absMax = this._min * -1 + this._max;\n this.realTimeEvent = options.realTimeEvent || false;\n\n this.eventHandler = {\n startChangingSlide: this._startChangingSlide.bind(this),\n stopChangingSlide: this._stopChangingSlide.bind(this),\n changeSlide: this._changeSlide.bind(this),\n changeSlideFinally: this._changeSlideFinally.bind(this),\n changeInput: this._changeValueWithInput.bind(this, false),\n changeInputFinally: this._changeValueWithInput.bind(this, true),\n changeInputWithArrow: this._changeValueWithInputKeyEvent.bind(this),\n };\n\n this._addClickEvent();\n this._addDragEvent();\n this._addInputEvent();\n this.value = options.value;\n this.trigger('change');\n }\n\n /**\n * Destroys the instance.\n */\n destroy() {\n this._removeClickEvent();\n this._removeDragEvent();\n this._removeInputEvent();\n this.rangeElement.innerHTML = '';\n snippet.forEach(this, (value, key) => {\n this[key] = null;\n });\n }\n\n /**\n * Set range max value and re position cursor\n * @param {number} maxValue - max value\n */\n set max(maxValue) {\n this._max = maxValue;\n this._absMax = this._min * -1 + this._max;\n this.value = this._value;\n }\n\n get max() {\n return this._max;\n }\n\n /**\n * Get range value\n * @returns {Number} range value\n */\n get value() {\n return this._value;\n }\n\n /**\n * Set range value\n * @param {Number} value range value\n */\n set value(value) {\n value = this._useDecimal ? value : toInteger(value);\n\n const absValue = value - this._min;\n let leftPosition = (absValue * this.rangeWidth) / this._absMax;\n\n if (this.rangeWidth < leftPosition) {\n leftPosition = this.rangeWidth;\n }\n\n this.pointer.style.left = `${leftPosition}px`;\n this.subbar.style.right = `${this.rangeWidth - leftPosition}px`;\n\n this._value = value;\n if (this.rangeInputElement) {\n this.rangeInputElement.value = value;\n }\n }\n\n /**\n * event trigger\n * @param {string} type - type\n */\n trigger(type) {\n this.fire(type, this._value);\n }\n\n /**\n * Calculate slider width\n * @returns {number} - slider width\n */\n _getRangeWidth() {\n const getElementWidth = (element) => toInteger(window.getComputedStyle(element, null).width);\n\n return getElementWidth(this.rangeElement) - getElementWidth(this.pointer);\n }\n\n /**\n * Make range element\n * @private\n */\n _drawRangeElement() {\n this.rangeElement.classList.add('tui-image-editor-range');\n\n this.bar = document.createElement('div');\n this.bar.className = 'tui-image-editor-virtual-range-bar';\n\n this.subbar = document.createElement('div');\n this.subbar.className = 'tui-image-editor-virtual-range-subbar';\n\n this.pointer = document.createElement('div');\n this.pointer.className = 'tui-image-editor-virtual-range-pointer';\n\n this.bar.appendChild(this.subbar);\n this.bar.appendChild(this.pointer);\n this.rangeElement.appendChild(this.bar);\n }\n\n /**\n * Add range input editing event\n * @private\n */\n _addInputEvent() {\n if (this.rangeInputElement) {\n this.rangeInputElement.addEventListener('keydown', this.eventHandler.changeInputWithArrow);\n this.rangeInputElement.addEventListener('keyup', this.eventHandler.changeInput);\n this.rangeInputElement.addEventListener('blur', this.eventHandler.changeInputFinally);\n }\n }\n\n /**\n * Remove range input editing event\n * @private\n */\n _removeInputEvent() {\n if (this.rangeInputElement) {\n this.rangeInputElement.removeEventListener('keydown', this.eventHandler.changeInputWithArrow);\n this.rangeInputElement.removeEventListener('keyup', this.eventHandler.changeInput);\n this.rangeInputElement.removeEventListener('blur', this.eventHandler.changeInputFinally);\n }\n }\n\n /**\n * change angle event\n * @param {object} event - key event\n * @private\n */\n _changeValueWithInputKeyEvent(event) {\n const { keyCode, target } = event;\n\n if ([keyCodes.ARROW_UP, keyCodes.ARROW_DOWN].indexOf(keyCode) < 0) {\n return;\n }\n\n let value = Number(target.value);\n\n value = this._valueUpDownForKeyEvent(value, keyCode);\n\n const unChanged = value < this._min || value > this._max;\n\n if (!unChanged) {\n const clampValue = clamp(value, this._min, this.max);\n this.value = clampValue;\n this.fire('change', clampValue, false);\n }\n }\n\n /**\n * value up down for input\n * @param {number} value - original value number\n * @param {number} keyCode - input event key code\n * @returns {number} value - changed value\n * @private\n */\n _valueUpDownForKeyEvent(value, keyCode) {\n const step = this._useDecimal ? 0.1 : 1;\n\n if (keyCode === keyCodes.ARROW_UP) {\n value += step;\n } else if (keyCode === keyCodes.ARROW_DOWN) {\n value -= step;\n }\n\n return value;\n }\n\n /**\n * change angle event\n * @param {boolean} isLast - Is last change\n * @param {object} event - key event\n * @private\n */\n _changeValueWithInput(isLast, event) {\n const { keyCode, target } = event;\n\n if ([keyCodes.ARROW_UP, keyCodes.ARROW_DOWN].indexOf(keyCode) >= 0) {\n return;\n }\n\n const stringValue = this._filterForInputText(target.value);\n const waitForChange = !stringValue || isNaN(stringValue);\n target.value = stringValue;\n\n if (!waitForChange) {\n let value = this._useDecimal ? Number(stringValue) : toInteger(stringValue);\n value = clamp(value, this._min, this.max);\n\n this.value = value;\n this.fire('change', value, isLast);\n }\n }\n\n /**\n * Add Range click event\n * @private\n */\n _addClickEvent() {\n this.rangeElement.addEventListener('click', this.eventHandler.changeSlideFinally);\n }\n\n /**\n * Remove Range click event\n * @private\n */\n _removeClickEvent() {\n this.rangeElement.removeEventListener('click', this.eventHandler.changeSlideFinally);\n }\n\n /**\n * Add Range drag event\n * @private\n */\n _addDragEvent() {\n this.pointer.addEventListener('mousedown', this.eventHandler.startChangingSlide);\n }\n\n /**\n * Remove Range drag event\n * @private\n */\n _removeDragEvent() {\n this.pointer.removeEventListener('mousedown', this.eventHandler.startChangingSlide);\n }\n\n /**\n * change angle event\n * @param {object} event - change event\n * @private\n */\n _changeSlide(event) {\n const changePosition = event.screenX;\n const diffPosition = changePosition - this.firstPosition;\n let touchPx = this.firstLeft + diffPosition;\n touchPx = touchPx > this.rangeWidth ? this.rangeWidth : touchPx;\n touchPx = touchPx < 0 ? 0 : touchPx;\n\n this.pointer.style.left = `${touchPx}px`;\n this.subbar.style.right = `${this.rangeWidth - touchPx}px`;\n\n const ratio = touchPx / this.rangeWidth;\n const resultValue = this._absMax * ratio + this._min;\n const value = this._useDecimal ? resultValue : toInteger(resultValue);\n const isValueChanged = this.value !== value;\n\n if (isValueChanged) {\n this.value = value;\n if (this.realTimeEvent) {\n this.fire('change', this._value, false);\n }\n }\n }\n\n _changeSlideFinally(event) {\n event.stopPropagation();\n if (event.target.className !== 'tui-image-editor-range') {\n return;\n }\n const touchPx = event.offsetX;\n const ratio = touchPx / this.rangeWidth;\n const value = this._absMax * ratio + this._min;\n this.pointer.style.left = `${ratio * this.rangeWidth}px`;\n this.subbar.style.right = `${(1 - ratio) * this.rangeWidth}px`;\n this.value = value;\n\n this.fire('change', value, true);\n }\n\n _startChangingSlide(event) {\n this.firstPosition = event.screenX;\n this.firstLeft = toInteger(this.pointer.style.left) || 0;\n\n document.addEventListener('mousemove', this.eventHandler.changeSlide);\n document.addEventListener('mouseup', this.eventHandler.stopChangingSlide);\n }\n\n /**\n * stop change angle event\n * @private\n */\n _stopChangingSlide() {\n this.fire('change', this._value, true);\n\n document.removeEventListener('mousemove', this.eventHandler.changeSlide);\n document.removeEventListener('mouseup', this.eventHandler.stopChangingSlide);\n }\n\n /**\n * Unnecessary string filtering.\n * @param {string} inputValue - origin string of input\n * @returns {string} filtered string\n * @private\n */\n _filterForInputText(inputValue) {\n return inputValue.replace(INPUT_FILTER_REGEXP, '$1$2$3');\n }\n}\n\nsnippet.CustomEvents.mixin(Range);\n\nexport default Range;\n","var NATIVE_WEAK_MAP = require('../internals/native-weak-map');\nvar global = require('../internals/global');\nvar isObject = require('../internals/is-object');\nvar createNonEnumerableProperty = require('../internals/create-non-enumerable-property');\nvar objectHas = require('../internals/has');\nvar sharedKey = require('../internals/shared-key');\nvar hiddenKeys = require('../internals/hidden-keys');\n\nvar WeakMap = global.WeakMap;\nvar set, get, has;\n\nvar enforce = function (it) {\n return has(it) ? get(it) : set(it, {});\n};\n\nvar getterFor = function (TYPE) {\n return function (it) {\n var state;\n if (!isObject(it) || (state = get(it)).type !== TYPE) {\n throw TypeError('Incompatible receiver, ' + TYPE + ' required');\n } return state;\n };\n};\n\nif (NATIVE_WEAK_MAP) {\n var store = new WeakMap();\n var wmget = store.get;\n var wmhas = store.has;\n var wmset = store.set;\n set = function (it, metadata) {\n wmset.call(store, it, metadata);\n return metadata;\n };\n get = function (it) {\n return wmget.call(store, it) || {};\n };\n has = function (it) {\n return wmhas.call(store, it);\n };\n} else {\n var STATE = sharedKey('state');\n hiddenKeys[STATE] = true;\n set = function (it, metadata) {\n createNonEnumerableProperty(it, STATE, metadata);\n return metadata;\n };\n get = function (it) {\n return objectHas(it, STATE) ? it[STATE] : {};\n };\n has = function (it) {\n return objectHas(it, STATE);\n };\n}\n\nmodule.exports = {\n set: set,\n get: get,\n has: has,\n enforce: enforce,\n getterFor: getterFor\n};\n","module.exports = function (bitmap, value) {\n return {\n enumerable: !(bitmap & 1),\n configurable: !(bitmap & 2),\n writable: !(bitmap & 4),\n value: value\n };\n};\n","// toObject with fallback for non-array-like ES3 strings\nvar IndexedObject = require('../internals/indexed-object');\nvar requireObjectCoercible = require('../internals/require-object-coercible');\n\nmodule.exports = function (it) {\n return IndexedObject(requireObjectCoercible(it));\n};\n","var createNonEnumerableProperty = require('../internals/create-non-enumerable-property');\n\nmodule.exports = function (target, key, value, options) {\n if (options && options.enumerable) target[key] = value;\n else createNonEnumerableProperty(target, key, value);\n};\n","var anObject = require('../internals/an-object');\nvar isArrayIteratorMethod = require('../internals/is-array-iterator-method');\nvar toLength = require('../internals/to-length');\nvar bind = require('../internals/function-bind-context');\nvar getIteratorMethod = require('../internals/get-iterator-method');\nvar callWithSafeIterationClosing = require('../internals/call-with-safe-iteration-closing');\n\nvar Result = function (stopped, result) {\n this.stopped = stopped;\n this.result = result;\n};\n\nvar iterate = module.exports = function (iterable, fn, that, AS_ENTRIES, IS_ITERATOR) {\n var boundFunction = bind(fn, that, AS_ENTRIES ? 2 : 1);\n var iterator, iterFn, index, length, result, next, step;\n\n if (IS_ITERATOR) {\n iterator = iterable;\n } else {\n iterFn = getIteratorMethod(iterable);\n if (typeof iterFn != 'function') throw TypeError('Target is not iterable');\n // optimisation for array iterators\n if (isArrayIteratorMethod(iterFn)) {\n for (index = 0, length = toLength(iterable.length); length > index; index++) {\n result = AS_ENTRIES\n ? boundFunction(anObject(step = iterable[index])[0], step[1])\n : boundFunction(iterable[index]);\n if (result && result instanceof Result) return result;\n } return new Result(false);\n }\n iterator = iterFn.call(iterable);\n }\n\n next = iterator.next;\n while (!(step = next.call(iterator)).done) {\n result = callWithSafeIterationClosing(iterator, boundFunction, step.value, AS_ENTRIES);\n if (typeof result == 'object' && result && result instanceof Result) return result;\n } return new Result(false);\n};\n\niterate.stop = function (result) {\n return new Result(true, result);\n};\n","module.exports = function (exec) {\n try {\n return { error: false, value: exec() };\n } catch (error) {\n return { error: true, value: error };\n }\n};\n","/**\n * @author NHN. FE Development Team \n * @fileoverview Selection modification helper\n */\n\nimport { extend } from 'tui-code-snippet';\n\n/**\n * Cached selection's info\n * @type {Array}\n * @private\n */\nlet cachedUndoDataForChangeDimension = null;\n\n/**\n * Set cached undo data\n * @param {Array} undoData - selection object\n * @private\n */\nexport function setCachedUndoDataForDimension(undoData) {\n cachedUndoDataForChangeDimension = undoData;\n}\n\n/**\n * Get cached undo data\n * @returns {Object} cached undo data\n * @private\n */\nexport function getCachedUndoDataForDimension() {\n return cachedUndoDataForChangeDimension;\n}\n\n/**\n * Make undo data\n * @param {fabric.Object} obj - selection object\n * @param {Function} undoDatumMaker - make undo datum\n * @returns {Array} undoData\n * @private\n */\nexport function makeSelectionUndoData(obj, undoDatumMaker) {\n let undoData;\n\n if (obj.type === 'activeSelection') {\n undoData = obj.getObjects().map((item) => {\n const { angle, left, top, scaleX, scaleY, width, height } = item;\n\n obj.realizeTransform(item);\n const result = undoDatumMaker(item);\n\n item.set({\n angle,\n left,\n top,\n width,\n height,\n scaleX,\n scaleY,\n });\n\n return result;\n });\n } else {\n undoData = [undoDatumMaker(obj)];\n }\n\n return undoData;\n}\n\n/**\n * Make undo datum\n * @param {number} id - object id\n * @param {fabric.Object} obj - selection object\n * @param {boolean} isSelection - whether or not object is selection\n * @returns {Object} undo datum\n * @private\n */\nexport function makeSelectionUndoDatum(id, obj, isSelection) {\n return isSelection\n ? {\n id,\n width: obj.width,\n height: obj.height,\n top: obj.top,\n left: obj.left,\n angle: obj.angle,\n scaleX: obj.scaleX,\n scaleY: obj.scaleY,\n }\n : extend({ id }, obj);\n}\n","var ceil = Math.ceil;\nvar floor = Math.floor;\n\n// `ToInteger` abstract operation\n// https://tc39.github.io/ecma262/#sec-tointeger\nmodule.exports = function (argument) {\n return isNaN(argument = +argument) ? 0 : (argument > 0 ? floor : ceil)(argument);\n};\n","// `RequireObjectCoercible` abstract operation\n// https://tc39.github.io/ecma262/#sec-requireobjectcoercible\nmodule.exports = function (it) {\n if (it == undefined) throw TypeError(\"Can't call method on \" + it);\n return it;\n};\n","var global = require('../internals/global');\nvar isObject = require('../internals/is-object');\n\nvar document = global.document;\n// typeof document.createElement is 'object' in old IE\nvar EXISTS = isObject(document) && isObject(document.createElement);\n\nmodule.exports = function (it) {\n return EXISTS ? document.createElement(it) : {};\n};\n","var shared = require('../internals/shared');\nvar uid = require('../internals/uid');\n\nvar keys = shared('keys');\n\nmodule.exports = function (key) {\n return keys[key] || (keys[key] = uid(key));\n};\n","module.exports = {};\n","module.exports = {};\n","var aFunction = require('../internals/a-function');\n\n// optional / simple context binding\nmodule.exports = function (fn, that, length) {\n aFunction(fn);\n if (that === undefined) return fn;\n switch (length) {\n case 0: return function () {\n return fn.call(that);\n };\n case 1: return function (a) {\n return fn.call(that, a);\n };\n case 2: return function (a, b) {\n return fn.call(that, a, b);\n };\n case 3: return function (a, b, c) {\n return fn.call(that, a, b, c);\n };\n }\n return function (/* ...args */) {\n return fn.apply(that, arguments);\n };\n};\n","var has = require('../internals/has');\nvar toObject = require('../internals/to-object');\nvar sharedKey = require('../internals/shared-key');\nvar CORRECT_PROTOTYPE_GETTER = require('../internals/correct-prototype-getter');\n\nvar IE_PROTO = sharedKey('IE_PROTO');\nvar ObjectPrototype = Object.prototype;\n\n// `Object.getPrototypeOf` method\n// https://tc39.github.io/ecma262/#sec-object.getprototypeof\nmodule.exports = CORRECT_PROTOTYPE_GETTER ? Object.getPrototypeOf : function (O) {\n O = toObject(O);\n if (has(O, IE_PROTO)) return O[IE_PROTO];\n if (typeof O.constructor == 'function' && O instanceof O.constructor) {\n return O.constructor.prototype;\n } return O instanceof Object ? ObjectPrototype : null;\n};\n","var TO_STRING_TAG_SUPPORT = require('../internals/to-string-tag-support');\nvar defineProperty = require('../internals/object-define-property').f;\nvar createNonEnumerableProperty = require('../internals/create-non-enumerable-property');\nvar has = require('../internals/has');\nvar toString = require('../internals/object-to-string');\nvar wellKnownSymbol = require('../internals/well-known-symbol');\n\nvar TO_STRING_TAG = wellKnownSymbol('toStringTag');\n\nmodule.exports = function (it, TAG, STATIC, SET_METHOD) {\n if (it) {\n var target = STATIC ? it : it.prototype;\n if (!has(target, TO_STRING_TAG)) {\n defineProperty(target, TO_STRING_TAG, { configurable: true, value: TAG });\n }\n if (SET_METHOD && !TO_STRING_TAG_SUPPORT) {\n createNonEnumerableProperty(target, 'toString', toString);\n }\n }\n};\n","var wellKnownSymbol = require('../internals/well-known-symbol');\n\nvar TO_STRING_TAG = wellKnownSymbol('toStringTag');\nvar test = {};\n\ntest[TO_STRING_TAG] = 'z';\n\nmodule.exports = String(test) === '[object z]';\n","var TO_STRING_TAG_SUPPORT = require('../internals/to-string-tag-support');\nvar classofRaw = require('../internals/classof-raw');\nvar wellKnownSymbol = require('../internals/well-known-symbol');\n\nvar TO_STRING_TAG = wellKnownSymbol('toStringTag');\n// ES3 wrong here\nvar CORRECT_ARGUMENTS = classofRaw(function () { return arguments; }()) == 'Arguments';\n\n// fallback for IE11 Script Access Denied error\nvar tryGet = function (it, key) {\n try {\n return it[key];\n } catch (error) { /* empty */ }\n};\n\n// getting tag from ES6+ `Object.prototype.toString`\nmodule.exports = TO_STRING_TAG_SUPPORT ? classofRaw : function (it) {\n var O, tag, result;\n return it === undefined ? 'Undefined' : it === null ? 'Null'\n // @@toStringTag case\n : typeof (tag = tryGet(O = Object(it), TO_STRING_TAG)) == 'string' ? tag\n // builtinTag case\n : CORRECT_ARGUMENTS ? classofRaw(O)\n // ES3 arguments fallback\n : (result = classofRaw(O)) == 'Object' && typeof O.callee == 'function' ? 'Arguments' : result;\n};\n","/**\n * @author NHN. FE Development Team \n * @fileoverview Error-message factory\n */\nimport snippet from 'tui-code-snippet';\nimport { keyMirror } from '@/util';\n\nconst types = keyMirror('UN_IMPLEMENTATION', 'NO_COMPONENT_NAME');\nconst messages = {\n UN_IMPLEMENTATION: 'Should implement a method: ',\n NO_COMPONENT_NAME: 'Should set a component name',\n};\nconst map = {\n UN_IMPLEMENTATION(methodName) {\n return messages.UN_IMPLEMENTATION + methodName;\n },\n NO_COMPONENT_NAME() {\n return messages.NO_COMPONENT_NAME;\n },\n};\n\nexport default {\n types: snippet.extend({}, types),\n\n create(type, ...args) {\n type = type.toLowerCase();\n const func = map[type];\n\n return func(...args);\n },\n};\n","var store = require('../internals/shared-store');\n\nvar functionToString = Function.toString;\n\n// this helper broken in `3.4.1-3.4.4`, so we can't use `shared` helper\nif (typeof store.inspectSource != 'function') {\n store.inspectSource = function (it) {\n return functionToString.call(it);\n };\n}\n\nmodule.exports = store.inspectSource;\n","var global = require('../internals/global');\nvar setGlobal = require('../internals/set-global');\n\nvar SHARED = '__core-js_shared__';\nvar store = global[SHARED] || setGlobal(SHARED, {});\n\nmodule.exports = store;\n","var DESCRIPTORS = require('../internals/descriptors');\nvar fails = require('../internals/fails');\nvar createElement = require('../internals/document-create-element');\n\n// Thank's IE8 for his funny defineProperty\nmodule.exports = !DESCRIPTORS && !fails(function () {\n return Object.defineProperty(createElement('div'), 'a', {\n get: function () { return 7; }\n }).a != 7;\n});\n","var isObject = require('../internals/is-object');\n\n// `ToPrimitive` abstract operation\n// https://tc39.github.io/ecma262/#sec-toprimitive\n// instead of the ES6 spec version, we didn't implement @@toPrimitive case\n// and the second argument - flag - preferred type is a string\nmodule.exports = function (input, PREFERRED_STRING) {\n if (!isObject(input)) return input;\n var fn, val;\n if (PREFERRED_STRING && typeof (fn = input.toString) == 'function' && !isObject(val = fn.call(input))) return val;\n if (typeof (fn = input.valueOf) == 'function' && !isObject(val = fn.call(input))) return val;\n if (!PREFERRED_STRING && typeof (fn = input.toString) == 'function' && !isObject(val = fn.call(input))) return val;\n throw TypeError(\"Can't convert object to primitive value\");\n};\n","var IS_PURE = require('../internals/is-pure');\nvar store = require('../internals/shared-store');\n\n(module.exports = function (key, value) {\n return store[key] || (store[key] = value !== undefined ? value : {});\n})('versions', []).push({\n version: '3.6.4',\n mode: IS_PURE ? 'pure' : 'global',\n copyright: '© 2020 Denis Pushkarev (zloirock.ru)'\n});\n","var id = 0;\nvar postfix = Math.random();\n\nmodule.exports = function (key) {\n return 'Symbol(' + String(key === undefined ? '' : key) + ')_' + (++id + postfix).toString(36);\n};\n","'use strict';\nvar $ = require('../internals/export');\nvar createIteratorConstructor = require('../internals/create-iterator-constructor');\nvar getPrototypeOf = require('../internals/object-get-prototype-of');\nvar setPrototypeOf = require('../internals/object-set-prototype-of');\nvar setToStringTag = require('../internals/set-to-string-tag');\nvar createNonEnumerableProperty = require('../internals/create-non-enumerable-property');\nvar redefine = require('../internals/redefine');\nvar wellKnownSymbol = require('../internals/well-known-symbol');\nvar IS_PURE = require('../internals/is-pure');\nvar Iterators = require('../internals/iterators');\nvar IteratorsCore = require('../internals/iterators-core');\n\nvar IteratorPrototype = IteratorsCore.IteratorPrototype;\nvar BUGGY_SAFARI_ITERATORS = IteratorsCore.BUGGY_SAFARI_ITERATORS;\nvar ITERATOR = wellKnownSymbol('iterator');\nvar KEYS = 'keys';\nvar VALUES = 'values';\nvar ENTRIES = 'entries';\n\nvar returnThis = function () { return this; };\n\nmodule.exports = function (Iterable, NAME, IteratorConstructor, next, DEFAULT, IS_SET, FORCED) {\n createIteratorConstructor(IteratorConstructor, NAME, next);\n\n var getIterationMethod = function (KIND) {\n if (KIND === DEFAULT && defaultIterator) return defaultIterator;\n if (!BUGGY_SAFARI_ITERATORS && KIND in IterablePrototype) return IterablePrototype[KIND];\n switch (KIND) {\n case KEYS: return function keys() { return new IteratorConstructor(this, KIND); };\n case VALUES: return function values() { return new IteratorConstructor(this, KIND); };\n case ENTRIES: return function entries() { return new IteratorConstructor(this, KIND); };\n } return function () { return new IteratorConstructor(this); };\n };\n\n var TO_STRING_TAG = NAME + ' Iterator';\n var INCORRECT_VALUES_NAME = false;\n var IterablePrototype = Iterable.prototype;\n var nativeIterator = IterablePrototype[ITERATOR]\n || IterablePrototype['@@iterator']\n || DEFAULT && IterablePrototype[DEFAULT];\n var defaultIterator = !BUGGY_SAFARI_ITERATORS && nativeIterator || getIterationMethod(DEFAULT);\n var anyNativeIterator = NAME == 'Array' ? IterablePrototype.entries || nativeIterator : nativeIterator;\n var CurrentIteratorPrototype, methods, KEY;\n\n // fix native\n if (anyNativeIterator) {\n CurrentIteratorPrototype = getPrototypeOf(anyNativeIterator.call(new Iterable()));\n if (IteratorPrototype !== Object.prototype && CurrentIteratorPrototype.next) {\n if (!IS_PURE && getPrototypeOf(CurrentIteratorPrototype) !== IteratorPrototype) {\n if (setPrototypeOf) {\n setPrototypeOf(CurrentIteratorPrototype, IteratorPrototype);\n } else if (typeof CurrentIteratorPrototype[ITERATOR] != 'function') {\n createNonEnumerableProperty(CurrentIteratorPrototype, ITERATOR, returnThis);\n }\n }\n // Set @@toStringTag to native iterators\n setToStringTag(CurrentIteratorPrototype, TO_STRING_TAG, true, true);\n if (IS_PURE) Iterators[TO_STRING_TAG] = returnThis;\n }\n }\n\n // fix Array#{values, @@iterator}.name in V8 / FF\n if (DEFAULT == VALUES && nativeIterator && nativeIterator.name !== VALUES) {\n INCORRECT_VALUES_NAME = true;\n defaultIterator = function values() { return nativeIterator.call(this); };\n }\n\n // define iterator\n if ((!IS_PURE || FORCED) && IterablePrototype[ITERATOR] !== defaultIterator) {\n createNonEnumerableProperty(IterablePrototype, ITERATOR, defaultIterator);\n }\n Iterators[NAME] = defaultIterator;\n\n // export additional methods\n if (DEFAULT) {\n methods = {\n values: getIterationMethod(VALUES),\n keys: IS_SET ? defaultIterator : getIterationMethod(KEYS),\n entries: getIterationMethod(ENTRIES)\n };\n if (FORCED) for (KEY in methods) {\n if (BUGGY_SAFARI_ITERATORS || INCORRECT_VALUES_NAME || !(KEY in IterablePrototype)) {\n redefine(IterablePrototype, KEY, methods[KEY]);\n }\n } else $({ target: NAME, proto: true, forced: BUGGY_SAFARI_ITERATORS || INCORRECT_VALUES_NAME }, methods);\n }\n\n return methods;\n};\n","var DESCRIPTORS = require('../internals/descriptors');\nvar propertyIsEnumerableModule = require('../internals/object-property-is-enumerable');\nvar createPropertyDescriptor = require('../internals/create-property-descriptor');\nvar toIndexedObject = require('../internals/to-indexed-object');\nvar toPrimitive = require('../internals/to-primitive');\nvar has = require('../internals/has');\nvar IE8_DOM_DEFINE = require('../internals/ie8-dom-define');\n\nvar nativeGetOwnPropertyDescriptor = Object.getOwnPropertyDescriptor;\n\n// `Object.getOwnPropertyDescriptor` method\n// https://tc39.github.io/ecma262/#sec-object.getownpropertydescriptor\nexports.f = DESCRIPTORS ? nativeGetOwnPropertyDescriptor : function getOwnPropertyDescriptor(O, P) {\n O = toIndexedObject(O);\n P = toPrimitive(P, true);\n if (IE8_DOM_DEFINE) try {\n return nativeGetOwnPropertyDescriptor(O, P);\n } catch (error) { /* empty */ }\n if (has(O, P)) return createPropertyDescriptor(!propertyIsEnumerableModule.f.call(O, P), O[P]);\n};\n","var fails = require('../internals/fails');\n\nvar replacement = /#|\\.prototype\\./;\n\nvar isForced = function (feature, detection) {\n var value = data[normalize(feature)];\n return value == POLYFILL ? true\n : value == NATIVE ? false\n : typeof detection == 'function' ? fails(detection)\n : !!detection;\n};\n\nvar normalize = isForced.normalize = function (string) {\n return String(string).replace(replacement, '.').toLowerCase();\n};\n\nvar data = isForced.data = {};\nvar NATIVE = isForced.NATIVE = 'N';\nvar POLYFILL = isForced.POLYFILL = 'P';\n\nmodule.exports = isForced;\n","'use strict';\nvar getPrototypeOf = require('../internals/object-get-prototype-of');\nvar createNonEnumerableProperty = require('../internals/create-non-enumerable-property');\nvar has = require('../internals/has');\nvar wellKnownSymbol = require('../internals/well-known-symbol');\nvar IS_PURE = require('../internals/is-pure');\n\nvar ITERATOR = wellKnownSymbol('iterator');\nvar BUGGY_SAFARI_ITERATORS = false;\n\nvar returnThis = function () { return this; };\n\n// `%IteratorPrototype%` object\n// https://tc39.github.io/ecma262/#sec-%iteratorprototype%-object\nvar IteratorPrototype, PrototypeOfArrayIteratorPrototype, arrayIterator;\n\nif ([].keys) {\n arrayIterator = [].keys();\n // Safari 8 has buggy iterators w/o `next`\n if (!('next' in arrayIterator)) BUGGY_SAFARI_ITERATORS = true;\n else {\n PrototypeOfArrayIteratorPrototype = getPrototypeOf(getPrototypeOf(arrayIterator));\n if (PrototypeOfArrayIteratorPrototype !== Object.prototype) IteratorPrototype = PrototypeOfArrayIteratorPrototype;\n }\n}\n\nif (IteratorPrototype == undefined) IteratorPrototype = {};\n\n// 25.1.2.1.1 %IteratorPrototype%[@@iterator]()\nif (!IS_PURE && !has(IteratorPrototype, ITERATOR)) {\n createNonEnumerableProperty(IteratorPrototype, ITERATOR, returnThis);\n}\n\nmodule.exports = {\n IteratorPrototype: IteratorPrototype,\n BUGGY_SAFARI_ITERATORS: BUGGY_SAFARI_ITERATORS\n};\n","var fails = require('../internals/fails');\n\nmodule.exports = !!Object.getOwnPropertySymbols && !fails(function () {\n // Chrome 38 Symbol has incorrect toString conversion\n // eslint-disable-next-line no-undef\n return !String(Symbol());\n});\n","var anObject = require('../internals/an-object');\nvar defineProperties = require('../internals/object-define-properties');\nvar enumBugKeys = require('../internals/enum-bug-keys');\nvar hiddenKeys = require('../internals/hidden-keys');\nvar html = require('../internals/html');\nvar documentCreateElement = require('../internals/document-create-element');\nvar sharedKey = require('../internals/shared-key');\n\nvar GT = '>';\nvar LT = '<';\nvar PROTOTYPE = 'prototype';\nvar SCRIPT = 'script';\nvar IE_PROTO = sharedKey('IE_PROTO');\n\nvar EmptyConstructor = function () { /* empty */ };\n\nvar scriptTag = function (content) {\n return LT + SCRIPT + GT + content + LT + '/' + SCRIPT + GT;\n};\n\n// Create object with fake `null` prototype: use ActiveX Object with cleared prototype\nvar NullProtoObjectViaActiveX = function (activeXDocument) {\n activeXDocument.write(scriptTag(''));\n activeXDocument.close();\n var temp = activeXDocument.parentWindow.Object;\n activeXDocument = null; // avoid memory leak\n return temp;\n};\n\n// Create object with fake `null` prototype: use iframe Object with cleared prototype\nvar NullProtoObjectViaIFrame = function () {\n // Thrash, waste and sodomy: IE GC bug\n var iframe = documentCreateElement('iframe');\n var JS = 'java' + SCRIPT + ':';\n var iframeDocument;\n iframe.style.display = 'none';\n html.appendChild(iframe);\n // https://github.com/zloirock/core-js/issues/475\n iframe.src = String(JS);\n iframeDocument = iframe.contentWindow.document;\n iframeDocument.open();\n iframeDocument.write(scriptTag('document.F=Object'));\n iframeDocument.close();\n return iframeDocument.F;\n};\n\n// Check for document.domain and active x support\n// No need to use active x approach when document.domain is not set\n// see https://github.com/es-shims/es5-shim/issues/150\n// variation of https://github.com/kitcambridge/es5-shim/commit/4f738ac066346\n// avoid IE GC bug\nvar activeXDocument;\nvar NullProtoObject = function () {\n try {\n /* global ActiveXObject */\n activeXDocument = document.domain && new ActiveXObject('htmlfile');\n } catch (error) { /* ignore */ }\n NullProtoObject = activeXDocument ? NullProtoObjectViaActiveX(activeXDocument) : NullProtoObjectViaIFrame();\n var length = enumBugKeys.length;\n while (length--) delete NullProtoObject[PROTOTYPE][enumBugKeys[length]];\n return NullProtoObject();\n};\n\nhiddenKeys[IE_PROTO] = true;\n\n// `Object.create` method\n// https://tc39.github.io/ecma262/#sec-object.create\nmodule.exports = Object.create || function create(O, Properties) {\n var result;\n if (O !== null) {\n EmptyConstructor[PROTOTYPE] = anObject(O);\n result = new EmptyConstructor();\n EmptyConstructor[PROTOTYPE] = null;\n // add \"__proto__\" for Object.getPrototypeOf polyfill\n result[IE_PROTO] = O;\n } else result = NullProtoObject();\n return Properties === undefined ? result : defineProperties(result, Properties);\n};\n","var toInteger = require('../internals/to-integer');\n\nvar min = Math.min;\n\n// `ToLength` abstract operation\n// https://tc39.github.io/ecma262/#sec-tolength\nmodule.exports = function (argument) {\n return argument > 0 ? min(toInteger(argument), 0x1FFFFFFFFFFFFF) : 0; // 2 ** 53 - 1 == 9007199254740991\n};\n","// IE8- don't enum bug keys\nmodule.exports = [\n 'constructor',\n 'hasOwnProperty',\n 'isPrototypeOf',\n 'propertyIsEnumerable',\n 'toLocaleString',\n 'toString',\n 'valueOf'\n];\n","var getBuiltIn = require('../internals/get-built-in');\n\nmodule.exports = getBuiltIn('document', 'documentElement');\n","var anObject = require('../internals/an-object');\nvar aPossiblePrototype = require('../internals/a-possible-prototype');\n\n// `Object.setPrototypeOf` method\n// https://tc39.github.io/ecma262/#sec-object.setprototypeof\n// Works with __proto__ only. Old v8 can't work with null proto objects.\n/* eslint-disable no-proto */\nmodule.exports = Object.setPrototypeOf || ('__proto__' in {} ? function () {\n var CORRECT_SETTER = false;\n var test = {};\n var setter;\n try {\n setter = Object.getOwnPropertyDescriptor(Object.prototype, '__proto__').set;\n setter.call(test, []);\n CORRECT_SETTER = test instanceof Array;\n } catch (error) { /* empty */ }\n return function setPrototypeOf(O, proto) {\n anObject(O);\n aPossiblePrototype(proto);\n if (CORRECT_SETTER) setter.call(O, proto);\n else O.__proto__ = proto;\n return O;\n };\n}() : undefined);\n","var global = require('../internals/global');\n\nmodule.exports = global.Promise;\n","var anObject = require('../internals/an-object');\nvar aFunction = require('../internals/a-function');\nvar wellKnownSymbol = require('../internals/well-known-symbol');\n\nvar SPECIES = wellKnownSymbol('species');\n\n// `SpeciesConstructor` abstract operation\n// https://tc39.github.io/ecma262/#sec-speciesconstructor\nmodule.exports = function (O, defaultConstructor) {\n var C = anObject(O).constructor;\n var S;\n return C === undefined || (S = anObject(C)[SPECIES]) == undefined ? defaultConstructor : aFunction(S);\n};\n","var global = require('../internals/global');\nvar fails = require('../internals/fails');\nvar classof = require('../internals/classof-raw');\nvar bind = require('../internals/function-bind-context');\nvar html = require('../internals/html');\nvar createElement = require('../internals/document-create-element');\nvar IS_IOS = require('../internals/engine-is-ios');\n\nvar location = global.location;\nvar set = global.setImmediate;\nvar clear = global.clearImmediate;\nvar process = global.process;\nvar MessageChannel = global.MessageChannel;\nvar Dispatch = global.Dispatch;\nvar counter = 0;\nvar queue = {};\nvar ONREADYSTATECHANGE = 'onreadystatechange';\nvar defer, channel, port;\n\nvar run = function (id) {\n // eslint-disable-next-line no-prototype-builtins\n if (queue.hasOwnProperty(id)) {\n var fn = queue[id];\n delete queue[id];\n fn();\n }\n};\n\nvar runner = function (id) {\n return function () {\n run(id);\n };\n};\n\nvar listener = function (event) {\n run(event.data);\n};\n\nvar post = function (id) {\n // old engines have not location.origin\n global.postMessage(id + '', location.protocol + '//' + location.host);\n};\n\n// Node.js 0.9+ & IE10+ has setImmediate, otherwise:\nif (!set || !clear) {\n set = function setImmediate(fn) {\n var args = [];\n var i = 1;\n while (arguments.length > i) args.push(arguments[i++]);\n queue[++counter] = function () {\n // eslint-disable-next-line no-new-func\n (typeof fn == 'function' ? fn : Function(fn)).apply(undefined, args);\n };\n defer(counter);\n return counter;\n };\n clear = function clearImmediate(id) {\n delete queue[id];\n };\n // Node.js 0.8-\n if (classof(process) == 'process') {\n defer = function (id) {\n process.nextTick(runner(id));\n };\n // Sphere (JS game engine) Dispatch API\n } else if (Dispatch && Dispatch.now) {\n defer = function (id) {\n Dispatch.now(runner(id));\n };\n // Browsers with MessageChannel, includes WebWorkers\n // except iOS - https://github.com/zloirock/core-js/issues/624\n } else if (MessageChannel && !IS_IOS) {\n channel = new MessageChannel();\n port = channel.port2;\n channel.port1.onmessage = listener;\n defer = bind(port.postMessage, port, 1);\n // Browsers with postMessage, skip WebWorkers\n // IE8 has postMessage, but it's sync & typeof its postMessage is 'object'\n } else if (global.addEventListener && typeof postMessage == 'function' && !global.importScripts && !fails(post)) {\n defer = post;\n global.addEventListener('message', listener, false);\n // IE8-\n } else if (ONREADYSTATECHANGE in createElement('script')) {\n defer = function (id) {\n html.appendChild(createElement('script'))[ONREADYSTATECHANGE] = function () {\n html.removeChild(this);\n run(id);\n };\n };\n // Rest old browsers\n } else {\n defer = function (id) {\n setTimeout(runner(id), 0);\n };\n }\n}\n\nmodule.exports = {\n set: set,\n clear: clear\n};\n","var userAgent = require('../internals/engine-user-agent');\n\nmodule.exports = /(iphone|ipod|ipad).*applewebkit/i.test(userAgent);\n","var getBuiltIn = require('../internals/get-built-in');\n\nmodule.exports = getBuiltIn('navigator', 'userAgent') || '';\n","var anObject = require('../internals/an-object');\nvar isObject = require('../internals/is-object');\nvar newPromiseCapability = require('../internals/new-promise-capability');\n\nmodule.exports = function (C, x) {\n anObject(C);\n if (isObject(x) && x.constructor === C) return x;\n var promiseCapability = newPromiseCapability.f(C);\n var resolve = promiseCapability.resolve;\n resolve(x);\n return promiseCapability.promise;\n};\n","'use strict';\nvar $ = require('../internals/export');\nvar aFunction = require('../internals/a-function');\nvar newPromiseCapabilityModule = require('../internals/new-promise-capability');\nvar perform = require('../internals/perform');\nvar iterate = require('../internals/iterate');\n\n// `Promise.allSettled` method\n// https://github.com/tc39/proposal-promise-allSettled\n$({ target: 'Promise', stat: true }, {\n allSettled: function allSettled(iterable) {\n var C = this;\n var capability = newPromiseCapabilityModule.f(C);\n var resolve = capability.resolve;\n var reject = capability.reject;\n var result = perform(function () {\n var promiseResolve = aFunction(C.resolve);\n var values = [];\n var counter = 0;\n var remaining = 1;\n iterate(iterable, function (promise) {\n var index = counter++;\n var alreadyCalled = false;\n values.push(undefined);\n remaining++;\n promiseResolve.call(C, promise).then(function (value) {\n if (alreadyCalled) return;\n alreadyCalled = true;\n values[index] = { status: 'fulfilled', value: value };\n --remaining || resolve(values);\n }, function (e) {\n if (alreadyCalled) return;\n alreadyCalled = true;\n values[index] = { status: 'rejected', reason: e };\n --remaining || resolve(values);\n });\n });\n --remaining || resolve(values);\n });\n if (result.error) reject(result.value);\n return capability.promise;\n }\n});\n","/**\n * @author NHN. FE Development Team \n * @fileoverview Shape resize helper\n */\nconst DIVISOR = {\n rect: 1,\n circle: 2,\n triangle: 1,\n};\nconst DIMENSION_KEYS = {\n rect: {\n w: 'width',\n h: 'height',\n },\n circle: {\n w: 'rx',\n h: 'ry',\n },\n triangle: {\n w: 'width',\n h: 'height',\n },\n};\n\n/**\n * Set the start point value to the shape object\n * @param {fabric.Object} shape - Shape object\n * @ignore\n */\nfunction setStartPoint(shape) {\n const { originX, originY } = shape;\n const originKey = originX.substring(0, 1) + originY.substring(0, 1);\n\n shape.startPoint = shape.origins[originKey];\n}\n\n/**\n * Get the positions of ratated origin by the pointer value\n * @param {{x: number, y: number}} origin - Origin value\n * @param {{x: number, y: number}} pointer - Pointer value\n * @param {number} angle - Rotating angle\n * @returns {Object} Postions of origin\n * @ignore\n */\nfunction getPositionsOfRotatedOrigin(origin, pointer, angle) {\n const sx = origin.x;\n const sy = origin.y;\n const px = pointer.x;\n const py = pointer.y;\n const r = (angle * Math.PI) / 180;\n const rx = (px - sx) * Math.cos(r) - (py - sy) * Math.sin(r) + sx;\n const ry = (px - sx) * Math.sin(r) + (py - sy) * Math.cos(r) + sy;\n\n return {\n originX: sx > rx ? 'right' : 'left',\n originY: sy > ry ? 'bottom' : 'top',\n };\n}\n\n/**\n * Whether the shape has the center origin or not\n * @param {fabric.Object} shape - Shape object\n * @returns {boolean} State\n * @ignore\n */\nfunction hasCenterOrigin(shape) {\n return shape.originX === 'center' && shape.originY === 'center';\n}\n\n/**\n * Adjust the origin of shape by the start point\n * @param {{x: number, y: number}} pointer - Pointer value\n * @param {fabric.Object} shape - Shape object\n * @ignore\n */\nfunction adjustOriginByStartPoint(pointer, shape) {\n const centerPoint = shape.getPointByOrigin('center', 'center');\n const angle = -shape.angle;\n const originPositions = getPositionsOfRotatedOrigin(centerPoint, pointer, angle);\n const { originX, originY } = originPositions;\n const origin = shape.getPointByOrigin(originX, originY);\n const left = shape.left - (centerPoint.x - origin.x);\n const top = shape.top - (centerPoint.y - origin.y);\n\n shape.set({\n originX,\n originY,\n left,\n top,\n });\n\n shape.setCoords();\n}\n\n/**\n * Adjust the origin of shape by the moving pointer value\n * @param {{x: number, y: number}} pointer - Pointer value\n * @param {fabric.Object} shape - Shape object\n * @ignore\n */\nfunction adjustOriginByMovingPointer(pointer, shape) {\n const origin = shape.startPoint;\n const angle = -shape.angle;\n const originPositions = getPositionsOfRotatedOrigin(origin, pointer, angle);\n const { originX, originY } = originPositions;\n\n shape.setPositionByOrigin(origin, originX, originY);\n shape.setCoords();\n}\n\n/**\n * Adjust the dimension of shape on firing scaling event\n * @param {fabric.Object} shape - Shape object\n * @ignore\n */\nfunction adjustDimensionOnScaling(shape) {\n const { type, scaleX, scaleY } = shape;\n const dimensionKeys = DIMENSION_KEYS[type];\n let width = shape[dimensionKeys.w] * scaleX;\n let height = shape[dimensionKeys.h] * scaleY;\n\n if (shape.isRegular) {\n const maxScale = Math.max(scaleX, scaleY);\n\n width = shape[dimensionKeys.w] * maxScale;\n height = shape[dimensionKeys.h] * maxScale;\n }\n\n const options = {\n hasControls: false,\n hasBorders: false,\n scaleX: 1,\n scaleY: 1,\n };\n\n options[dimensionKeys.w] = width;\n options[dimensionKeys.h] = height;\n\n shape.set(options);\n}\n\n/**\n * Adjust the dimension of shape on firing mouse move event\n * @param {{x: number, y: number}} pointer - Pointer value\n * @param {fabric.Object} shape - Shape object\n * @ignore\n */\nfunction adjustDimensionOnMouseMove(pointer, shape) {\n const { type, strokeWidth, startPoint: origin } = shape;\n const divisor = DIVISOR[type];\n const dimensionKeys = DIMENSION_KEYS[type];\n const isTriangle = !!(shape.type === 'triangle');\n const options = {};\n let width = Math.abs(origin.x - pointer.x) / divisor;\n let height = Math.abs(origin.y - pointer.y) / divisor;\n\n if (width > strokeWidth) {\n width -= strokeWidth / divisor;\n }\n\n if (height > strokeWidth) {\n height -= strokeWidth / divisor;\n }\n\n if (shape.isRegular) {\n width = height = Math.max(width, height);\n\n if (isTriangle) {\n height = (Math.sqrt(3) / 2) * width;\n }\n }\n\n options[dimensionKeys.w] = width;\n options[dimensionKeys.h] = height;\n\n shape.set(options);\n}\n\nmodule.exports = {\n /**\n * Set each origin value to shape\n * @param {fabric.Object} shape - Shape object\n */\n setOrigins(shape) {\n const leftTopPoint = shape.getPointByOrigin('left', 'top');\n const rightTopPoint = shape.getPointByOrigin('right', 'top');\n const rightBottomPoint = shape.getPointByOrigin('right', 'bottom');\n const leftBottomPoint = shape.getPointByOrigin('left', 'bottom');\n\n shape.origins = {\n lt: leftTopPoint,\n rt: rightTopPoint,\n rb: rightBottomPoint,\n lb: leftBottomPoint,\n };\n },\n\n /**\n * Resize the shape\n * @param {fabric.Object} shape - Shape object\n * @param {{x: number, y: number}} pointer - Mouse pointer values on canvas\n * @param {boolean} isScaling - Whether the resizing action is scaling or not\n */\n resize(shape, pointer, isScaling) {\n if (hasCenterOrigin(shape)) {\n adjustOriginByStartPoint(pointer, shape);\n setStartPoint(shape);\n }\n\n if (isScaling) {\n adjustDimensionOnScaling(shape, pointer);\n } else {\n adjustDimensionOnMouseMove(pointer, shape);\n }\n\n adjustOriginByMovingPointer(pointer, shape);\n },\n\n /**\n * Adjust the origin position of shape to center\n * @param {fabric.Object} shape - Shape object\n */\n adjustOriginToCenter(shape) {\n const centerPoint = shape.getPointByOrigin('center', 'center');\n const { originX, originY } = shape;\n const origin = shape.getPointByOrigin(originX, originY);\n const left = shape.left + (centerPoint.x - origin.x);\n const top = shape.top + (centerPoint.y - origin.y);\n\n shape.set({\n hasControls: true,\n hasBorders: true,\n originX: 'center',\n originY: 'center',\n left,\n top,\n });\n\n shape.setCoords(); // For left, top properties\n },\n};\n","import '@/polyfill';\nimport ImageEditor from '@/imageEditor';\nimport '@css/index.styl';\n\n// commands\nimport '@/command/addIcon';\nimport '@/command/addImageObject';\nimport '@/command/addObject';\nimport '@/command/addShape';\nimport '@/command/addText';\nimport '@/command/applyFilter';\nimport '@/command/changeIconColor';\nimport '@/command/changeShape';\nimport '@/command/changeText';\nimport '@/command/changeTextStyle';\nimport '@/command/clearObjects';\nimport '@/command/flip';\nimport '@/command/loadImage';\nimport '@/command/removeFilter';\nimport '@/command/removeObject';\nimport '@/command/resizeCanvasDimension';\nimport '@/command/rotate';\nimport '@/command/setObjectProperties';\nimport '@/command/setObjectPosition';\nimport '@/command/changeSelection';\n\nmodule.exports = ImageEditor;\n","// https://developer.mozilla.org/en-US/docs/Web/API/Element/closest\n// Any copyright is dedicated to the Public Domain. http://creativecommons.org/publicdomain/zero/1.0/if (!Element.prototype.matches)\nElement.prototype.matches =\n Element.prototype.msMatchesSelector || Element.prototype.webkitMatchesSelector;\n\nif (!Element.prototype.closest)\n Element.prototype.closest = function (s) {\n var el = this;\n if (!document.documentElement.contains(el)) return null;\n do {\n if (el.matches(s)) return el;\n el = el.parentElement || el.parentNode;\n } while (el !== null && el.nodeType === 1);\n return null;\n };\n\n/*\n * classList.js: Cross-browser full element.classList implementation.\n * 1.1.20170427\n *\n * By Eli Grey, http://eligrey.com\n * License: Dedicated to the public domain.\n * See https://github.com/eligrey/classList.js/blob/master/LICENSE.md\n */\n\n/*global self, document, DOMException */\n\n/*! @source http://purl.eligrey.com/github/classList.js/blob/master/classList.js */\n\nif ('document' in window.self) {\n // Full polyfill for browsers with no classList support\n // Including IE < Edge missing SVGElement.classList\n if (\n !('classList' in document.createElement('_')) ||\n (document.createElementNS &&\n !('classList' in document.createElementNS('http://www.w3.org/2000/svg', 'g')))\n ) {\n (function (view) {\n 'use strict';\n\n if (!('Element' in view)) return;\n\n var classListProp = 'classList',\n protoProp = 'prototype',\n elemCtrProto = view.Element[protoProp],\n objCtr = Object,\n strTrim =\n String[protoProp].trim ||\n function () {\n return this.replace(/^\\s+|\\s+$/g, '');\n },\n arrIndexOf =\n Array[protoProp].indexOf ||\n function (item) {\n var i = 0,\n len = this.length;\n for (; i < len; i++) {\n if (i in this && this[i] === item) {\n return i;\n }\n }\n return -1;\n },\n // Vendors: please allow content code to instantiate DOMExceptions\n DOMEx = function (type, message) {\n this.name = type;\n this.code = DOMException[type];\n this.message = message;\n },\n checkTokenAndGetIndex = function (classList, token) {\n if (token === '') {\n throw new DOMEx('SYNTAX_ERR', 'An invalid or illegal string was specified');\n }\n if (/\\s/.test(token)) {\n throw new DOMEx('INVALID_CHARACTER_ERR', 'String contains an invalid character');\n }\n return arrIndexOf.call(classList, token);\n },\n ClassList = function (elem) {\n var trimmedClasses = strTrim.call(elem.getAttribute('class') || ''),\n classes = trimmedClasses ? trimmedClasses.split(/\\s+/) : [],\n i = 0,\n len = classes.length;\n for (; i < len; i++) {\n this.push(classes[i]);\n }\n this._updateClassName = function () {\n elem.setAttribute('class', this.toString());\n };\n },\n classListProto = (ClassList[protoProp] = []),\n classListGetter = function () {\n return new ClassList(this);\n };\n // Most DOMException implementations don't allow calling DOMException's toString()\n // on non-DOMExceptions. Error's toString() is sufficient here.\n DOMEx[protoProp] = Error[protoProp];\n classListProto.item = function (i) {\n return this[i] || null;\n };\n classListProto.contains = function (token) {\n token += '';\n return checkTokenAndGetIndex(this, token) !== -1;\n };\n classListProto.add = function () {\n var tokens = arguments,\n i = 0,\n l = tokens.length,\n token,\n updated = false;\n do {\n token = tokens[i] + '';\n if (checkTokenAndGetIndex(this, token) === -1) {\n this.push(token);\n updated = true;\n }\n } while (++i < l);\n\n if (updated) {\n this._updateClassName();\n }\n };\n classListProto.remove = function () {\n var tokens = arguments,\n i = 0,\n l = tokens.length,\n token,\n updated = false,\n index;\n do {\n token = tokens[i] + '';\n index = checkTokenAndGetIndex(this, token);\n while (index !== -1) {\n this.splice(index, 1);\n updated = true;\n index = checkTokenAndGetIndex(this, token);\n }\n } while (++i < l);\n\n if (updated) {\n this._updateClassName();\n }\n };\n classListProto.toggle = function (token, force) {\n token += '';\n\n var result = this.contains(token),\n method = result ? force !== true && 'remove' : force !== false && 'add';\n if (method) {\n this[method](token);\n }\n\n if (force === true || force === false) {\n return force;\n } else {\n return !result;\n }\n };\n classListProto.toString = function () {\n return this.join(' ');\n };\n\n if (objCtr.defineProperty) {\n var classListPropDesc = {\n get: classListGetter,\n enumerable: true,\n configurable: true,\n };\n try {\n objCtr.defineProperty(elemCtrProto, classListProp, classListPropDesc);\n } catch (ex) {\n // IE 8 doesn't support enumerable:true\n // adding undefined to fight this issue https://github.com/eligrey/classList.js/issues/36\n // modernie IE8-MSW7 machine has IE8 8.0.6001.18702 and is affected\n if (ex.number === undefined || ex.number === -0x7ff5ec54) {\n classListPropDesc.enumerable = false;\n objCtr.defineProperty(elemCtrProto, classListProp, classListPropDesc);\n }\n }\n } else if (objCtr[protoProp].__defineGetter__) {\n elemCtrProto.__defineGetter__(classListProp, classListGetter);\n }\n })(window.self);\n }\n\n // There is full or partial native classList support, so just check if we need\n // to normalize the add/remove and toggle APIs.\n\n (function () {\n 'use strict';\n\n var testElement = document.createElement('_');\n\n testElement.classList.add('c1', 'c2');\n\n // Polyfill for IE 10/11 and Firefox <26, where classList.add and\n // classList.remove exist but support only one argument at a time.\n if (!testElement.classList.contains('c2')) {\n var createMethod = function (method) {\n var original = DOMTokenList.prototype[method];\n\n DOMTokenList.prototype[method] = function (token) {\n var i,\n len = arguments.length;\n\n for (i = 0; i < len; i++) {\n token = arguments[i];\n original.call(this, token);\n }\n };\n };\n createMethod('add');\n createMethod('remove');\n }\n\n testElement.classList.toggle('c3', false);\n\n // Polyfill for IE 10 and Firefox <24, where classList.toggle does not\n // support the second argument.\n if (testElement.classList.contains('c3')) {\n var _toggle = DOMTokenList.prototype.toggle;\n\n DOMTokenList.prototype.toggle = function (token, force) {\n if (1 in arguments && !this.contains(token) === !force) {\n return force;\n } else {\n return _toggle.call(this, token);\n }\n };\n }\n\n testElement = null;\n })();\n}\n\n/*!\n * @copyright Copyright (c) 2017 IcoMoon.io\n * @license Licensed under MIT license\n * See https://github.com/Keyamoon/svgxuse\n * @version 1.2.6\n */\n/*jslint browser: true */\n/*global XDomainRequest, MutationObserver, window */\n(function () {\n 'use strict';\n if (typeof window !== 'undefined' && window.addEventListener) {\n var cache = Object.create(null); // holds xhr objects to prevent multiple requests\n var checkUseElems;\n var tid; // timeout id\n var debouncedCheck = function () {\n clearTimeout(tid);\n tid = setTimeout(checkUseElems, 100);\n };\n var unobserveChanges = function () {\n return;\n };\n var observeChanges = function () {\n var observer;\n window.addEventListener('resize', debouncedCheck, false);\n window.addEventListener('orientationchange', debouncedCheck, false);\n if (window.MutationObserver) {\n observer = new MutationObserver(debouncedCheck);\n observer.observe(document.documentElement, {\n childList: true,\n subtree: true,\n attributes: true,\n });\n unobserveChanges = function () {\n try {\n observer.disconnect();\n window.removeEventListener('resize', debouncedCheck, false);\n window.removeEventListener('orientationchange', debouncedCheck, false);\n } catch (ignore) {}\n };\n } else {\n document.documentElement.addEventListener('DOMSubtreeModified', debouncedCheck, false);\n unobserveChanges = function () {\n document.documentElement.removeEventListener('DOMSubtreeModified', debouncedCheck, false);\n window.removeEventListener('resize', debouncedCheck, false);\n window.removeEventListener('orientationchange', debouncedCheck, false);\n };\n }\n };\n var createRequest = function (url) {\n // In IE 9, cross origin requests can only be sent using XDomainRequest.\n // XDomainRequest would fail if CORS headers are not set.\n // Therefore, XDomainRequest should only be used with cross origin requests.\n function getOrigin(loc) {\n var a;\n if (loc.protocol !== undefined) {\n a = loc;\n } else {\n a = document.createElement('a');\n a.href = loc;\n }\n return a.protocol.replace(/:/g, '') + a.host;\n }\n var Request;\n var origin;\n var origin2;\n if (window.XMLHttpRequest) {\n Request = new XMLHttpRequest();\n origin = getOrigin(location);\n origin2 = getOrigin(url);\n if (Request.withCredentials === undefined && origin2 !== '' && origin2 !== origin) {\n Request = XDomainRequest || undefined;\n } else {\n Request = XMLHttpRequest;\n }\n }\n return Request;\n };\n var xlinkNS = 'http://www.w3.org/1999/xlink';\n checkUseElems = function () {\n var base;\n var bcr;\n var fallback = ''; // optional fallback URL in case no base path to SVG file was given and no symbol definition was found.\n var hash;\n var href;\n var i;\n var inProgressCount = 0;\n var isHidden;\n var Request;\n var url;\n var uses;\n var xhr;\n function observeIfDone() {\n // If done with making changes, start watching for chagnes in DOM again\n inProgressCount -= 1;\n if (inProgressCount === 0) {\n // if all xhrs were resolved\n unobserveChanges(); // make sure to remove old handlers\n observeChanges(); // watch for changes to DOM\n }\n }\n function attrUpdateFunc(spec) {\n return function () {\n if (cache[spec.base] !== true) {\n spec.useEl.setAttributeNS(xlinkNS, 'xlink:href', '#' + spec.hash);\n if (spec.useEl.hasAttribute('href')) {\n spec.useEl.setAttribute('href', '#' + spec.hash);\n }\n }\n };\n }\n function onloadFunc(xhr) {\n return function () {\n var body = document.body;\n var x = document.createElement('x');\n var svg;\n xhr.onload = null;\n x.innerHTML = xhr.responseText;\n svg = x.getElementsByTagName('svg')[0];\n if (svg) {\n svg.setAttribute('aria-hidden', 'true');\n svg.style.position = 'absolute';\n svg.style.width = 0;\n svg.style.height = 0;\n svg.style.overflow = 'hidden';\n body.insertBefore(svg, body.firstChild);\n }\n observeIfDone();\n };\n }\n function onErrorTimeout(xhr) {\n return function () {\n xhr.onerror = null;\n xhr.ontimeout = null;\n observeIfDone();\n };\n }\n unobserveChanges(); // stop watching for changes to DOM\n // find all use elements\n uses = document.getElementsByTagName('use');\n for (i = 0; i < uses.length; i += 1) {\n try {\n bcr = uses[i].getBoundingClientRect();\n } catch (ignore) {\n // failed to get bounding rectangle of the use element\n bcr = false;\n }\n href =\n uses[i].getAttribute('href') ||\n uses[i].getAttributeNS(xlinkNS, 'href') ||\n uses[i].getAttribute('xlink:href');\n if (href && href.split) {\n url = href.split('#');\n } else {\n url = ['', ''];\n }\n base = url[0];\n hash = url[1];\n isHidden = bcr && bcr.left === 0 && bcr.right === 0 && bcr.top === 0 && bcr.bottom === 0;\n if (bcr && bcr.width === 0 && bcr.height === 0 && !isHidden) {\n // the use element is empty\n // if there is a reference to an external SVG, try to fetch it\n // use the optional fallback URL if there is no reference to an external SVG\n if (fallback && !base.length && hash && !document.getElementById(hash)) {\n base = fallback;\n }\n if (uses[i].hasAttribute('href')) {\n uses[i].setAttributeNS(xlinkNS, 'xlink:href', href);\n }\n if (base.length) {\n // schedule updating xlink:href\n xhr = cache[base];\n if (xhr !== true) {\n // true signifies that prepending the SVG was not required\n setTimeout(\n attrUpdateFunc({\n useEl: uses[i],\n base: base,\n hash: hash,\n }),\n 0\n );\n }\n if (xhr === undefined) {\n Request = createRequest(base);\n if (Request !== undefined) {\n xhr = new Request();\n cache[base] = xhr;\n xhr.onload = onloadFunc(xhr);\n xhr.onerror = onErrorTimeout(xhr);\n xhr.ontimeout = onErrorTimeout(xhr);\n xhr.open('GET', base);\n xhr.send();\n inProgressCount += 1;\n }\n }\n }\n } else {\n if (!isHidden) {\n if (cache[base] === undefined) {\n // remember this URL if the use element was not empty and no request was sent\n cache[base] = true;\n } else if (cache[base].onload) {\n // if it turns out that prepending the SVG is not necessary,\n // abort the in-progress xhr.\n cache[base].abort();\n delete cache[base].onload;\n cache[base] = true;\n }\n } else if (base.length && cache[base]) {\n setTimeout(\n attrUpdateFunc({\n useEl: uses[i],\n base: base,\n hash: hash,\n }),\n 0\n );\n }\n }\n }\n uses = '';\n inProgressCount += 1;\n observeIfDone();\n };\n var winLoad;\n winLoad = function () {\n window.removeEventListener('load', winLoad, false); // to prevent memory leaks\n tid = setTimeout(checkUseElems, 0);\n };\n if (document.readyState !== 'complete') {\n // The load event fires when all resources have finished loading, which allows detecting whether SVG use elements are empty.\n window.addEventListener('load', winLoad, false);\n } else {\n // No need to add a listener if the document is already loaded, initialize immediately.\n winLoad();\n }\n }\n})();\n","/**\n * @author NHN. FE Development Team \n * @fileoverview Image-editor application class\n */\nimport snippet from 'tui-code-snippet';\nimport Invoker from '@/invoker';\nimport UI from '@/ui';\nimport action from '@/action';\nimport commandFactory from '@/factory/command';\nimport Graphics from '@/graphics';\nimport { makeSelectionUndoData, makeSelectionUndoDatum } from '@/helper/selectionModifyHelper';\nimport { sendHostName, Promise, getObjectType } from '@/util';\nimport {\n eventNames as events,\n commandNames as commands,\n keyCodes,\n rejectMessages,\n OBJ_TYPE,\n} from '@/consts';\n\nconst { isUndefined, forEach, CustomEvents } = snippet;\n\nconst {\n MOUSE_DOWN,\n OBJECT_MOVED,\n OBJECT_SCALED,\n OBJECT_ACTIVATED,\n OBJECT_ROTATED,\n OBJECT_ADDED,\n OBJECT_MODIFIED,\n ADD_TEXT,\n ADD_OBJECT,\n TEXT_EDITING,\n TEXT_CHANGED,\n ICON_CREATE_RESIZE,\n ICON_CREATE_END,\n SELECTION_CLEARED,\n SELECTION_CREATED,\n ADD_OBJECT_AFTER,\n} = events;\n\n/**\n * Image filter result\n * @typedef {object} FilterResult\n * @property {string} type - filter type like 'mask', 'Grayscale' and so on\n * @property {string} action - action type like 'add', 'remove'\n */\n\n/**\n * Flip status\n * @typedef {object} FlipStatus\n * @property {boolean} flipX - x axis\n * @property {boolean} flipY - y axis\n * @property {Number} angle - angle\n */\n/**\n * Rotation status\n * @typedef {Number} RotateStatus\n * @property {Number} angle - angle\n */\n\n/**\n * Old and new Size\n * @typedef {object} SizeChange\n * @property {Number} oldWidth - old width\n * @property {Number} oldHeight - old height\n * @property {Number} newWidth - new width\n * @property {Number} newHeight - new height\n */\n\n/**\n * @typedef {string} ErrorMsg - {string} error message\n */\n\n/**\n * @typedef {object} ObjectProps - graphics object properties\n * @property {number} id - object id\n * @property {string} type - object type\n * @property {string} text - text content\n * @property {(string | number)} left - Left\n * @property {(string | number)} top - Top\n * @property {(string | number)} width - Width\n * @property {(string | number)} height - Height\n * @property {string} fill - Color\n * @property {string} stroke - Stroke\n * @property {(string | number)} strokeWidth - StrokeWidth\n * @property {string} fontFamily - Font type for text\n * @property {number} fontSize - Font Size\n * @property {string} fontStyle - Type of inclination (normal / italic)\n * @property {string} fontWeight - Type of thicker or thinner looking (normal / bold)\n * @property {string} textAlign - Type of text align (left / center / right)\n * @property {string} textDecoration - Type of line (underline / line-through / overline)\n */\n\n/**\n * Shape filter option\n * @typedef {object.} ShapeFilterOption\n */\n\n/**\n * Shape filter option\n * @typedef {object} ShapeFillOption - fill option of shape\n * @property {string} type - fill type ('color' or 'filter')\n * @property {Array.} [filter] - {@link ShapeFilterOption} List.\n * only applies to filter types\n * (ex: \\[\\{pixelate: 20\\}, \\{blur: 0.3\\}\\])\n * @property {string} [color] - Shape foreground color (ex: '#fff', 'transparent')\n */\n\n/**\n * Image editor\n * @class\n * @param {string|HTMLElement} wrapper - Wrapper's element or selector\n * @param {Object} [options] - Canvas max width & height of css\n * @param {number} [options.includeUI] - Use the provided UI\n * @param {Object} [options.includeUI.loadImage] - Basic editing image\n * @param {string} options.includeUI.loadImage.path - image path\n * @param {string} options.includeUI.loadImage.name - image name\n * @param {Object} [options.includeUI.theme] - Theme object\n * @param {Array} [options.includeUI.menu] - It can be selected when only specific menu is used, Default values are \\['crop', 'flip', 'rotate', 'draw', 'shape', 'icon', 'text', 'mask', 'filter'\\].\n * @param {string} [options.includeUI.initMenu] - The first menu to be selected and started.\n * @param {Object} [options.includeUI.uiSize] - ui size of editor\n * @param {string} options.includeUI.uiSize.width - width of ui\n * @param {string} options.includeUI.uiSize.height - height of ui\n * @param {string} [options.includeUI.menuBarPosition=bottom] - Menu bar position('top', 'bottom', 'left', 'right')\n * @param {number} options.cssMaxWidth - Canvas css-max-width\n * @param {number} options.cssMaxHeight - Canvas css-max-height\n * @param {Object} [options.selectionStyle] - selection style\n * @param {string} [options.selectionStyle.cornerStyle] - selection corner style\n * @param {number} [options.selectionStyle.cornerSize] - selection corner size\n * @param {string} [options.selectionStyle.cornerColor] - selection corner color\n * @param {string} [options.selectionStyle.cornerStrokeColor] = selection corner stroke color\n * @param {boolean} [options.selectionStyle.transparentCorners] - selection corner transparent\n * @param {number} [options.selectionStyle.lineWidth] - selection line width\n * @param {string} [options.selectionStyle.borderColor] - selection border color\n * @param {number} [options.selectionStyle.rotatingPointOffset] - selection rotating point length\n * @param {Boolean} [options.usageStatistics=true] - Let us know the hostname. If you don't want to send the hostname, please set to false.\n * @example\n * var ImageEditor = require('tui-image-editor');\n * var blackTheme = require('./js/theme/black-theme.js');\n * var instance = new ImageEditor(document.querySelector('#tui-image-editor'), {\n * includeUI: {\n * loadImage: {\n * path: 'img/sampleImage.jpg',\n * name: 'SampleImage'\n * },\n * theme: blackTheme, // or whiteTheme\n * menu: ['shape', 'filter'],\n * initMenu: 'filter',\n * uiSize: {\n * width: '1000px',\n * height: '700px'\n * },\n * menuBarPosition: 'bottom'\n * },\n * cssMaxWidth: 700,\n * cssMaxHeight: 500,\n * selectionStyle: {\n * cornerSize: 20,\n * rotatingPointOffset: 70\n * }\n * });\n */\nclass ImageEditor {\n constructor(wrapper, options) {\n options = snippet.extend(\n {\n includeUI: false,\n usageStatistics: true,\n },\n options\n );\n\n this.mode = null;\n\n this.activeObjectId = null;\n\n /**\n * UI instance\n * @type {Ui}\n */\n if (options.includeUI) {\n const UIOption = options.includeUI;\n UIOption.usageStatistics = options.usageStatistics;\n\n this.ui = new UI(wrapper, UIOption, this.getActions());\n options = this.ui.setUiDefaultSelectionStyle(options);\n }\n\n /**\n * Invoker\n * @type {Invoker}\n * @private\n */\n this._invoker = new Invoker();\n\n /**\n * Graphics instance\n * @type {Graphics}\n * @private\n */\n this._graphics = new Graphics(this.ui ? this.ui.getEditorArea() : wrapper, {\n cssMaxWidth: options.cssMaxWidth,\n cssMaxHeight: options.cssMaxHeight,\n });\n\n /**\n * Event handler list\n * @type {Object}\n * @private\n */\n this._handlers = {\n keydown: this._onKeyDown.bind(this),\n mousedown: this._onMouseDown.bind(this),\n objectActivated: this._onObjectActivated.bind(this),\n objectMoved: this._onObjectMoved.bind(this),\n objectScaled: this._onObjectScaled.bind(this),\n objectRotated: this._onObjectRotated.bind(this),\n objectAdded: this._onObjectAdded.bind(this),\n objectModified: this._onObjectModified.bind(this),\n createdPath: this._onCreatedPath,\n addText: this._onAddText.bind(this),\n addObject: this._onAddObject.bind(this),\n textEditing: this._onTextEditing.bind(this),\n textChanged: this._onTextChanged.bind(this),\n iconCreateResize: this._onIconCreateResize.bind(this),\n iconCreateEnd: this._onIconCreateEnd.bind(this),\n selectionCleared: this._selectionCleared.bind(this),\n selectionCreated: this._selectionCreated.bind(this),\n };\n\n this._attachInvokerEvents();\n this._attachGraphicsEvents();\n this._attachDomEvents();\n this._setSelectionStyle(options.selectionStyle, {\n applyCropSelectionStyle: options.applyCropSelectionStyle,\n applyGroupSelectionStyle: options.applyGroupSelectionStyle,\n });\n\n if (options.usageStatistics) {\n sendHostName();\n }\n\n if (this.ui) {\n this.ui.initCanvas();\n this.setReAction();\n }\n fabric.enableGLFiltering = false;\n }\n\n /**\n * Set selection style by init option\n * @param {Object} selectionStyle - Selection styles\n * @param {Object} applyTargets - Selection apply targets\n * @param {boolean} applyCropSelectionStyle - whether apply with crop selection style or not\n * @param {boolean} applyGroupSelectionStyle - whether apply with group selection style or not\n * @private\n */\n _setSelectionStyle(selectionStyle, { applyCropSelectionStyle, applyGroupSelectionStyle }) {\n if (selectionStyle) {\n this._graphics.setSelectionStyle(selectionStyle);\n }\n\n if (applyCropSelectionStyle) {\n this._graphics.setCropSelectionStyle(selectionStyle);\n }\n\n if (applyGroupSelectionStyle) {\n this.on('selectionCreated', (eventTarget) => {\n if (eventTarget.type === 'activeSelection') {\n eventTarget.set(selectionStyle);\n }\n });\n }\n }\n\n /**\n * Attach invoker events\n * @private\n */\n _attachInvokerEvents() {\n const {\n UNDO_STACK_CHANGED,\n REDO_STACK_CHANGED,\n EXECUTE_COMMAND,\n AFTER_UNDO,\n AFTER_REDO,\n HAND_STARTED,\n HAND_STOPPED,\n } = events;\n\n /**\n * Undo stack changed event\n * @event ImageEditor#undoStackChanged\n * @param {Number} length - undo stack length\n * @example\n * imageEditor.on('undoStackChanged', function(length) {\n * console.log(length);\n * });\n */\n this._invoker.on(UNDO_STACK_CHANGED, this.fire.bind(this, UNDO_STACK_CHANGED));\n /**\n * Redo stack changed event\n * @event ImageEditor#redoStackChanged\n * @param {Number} length - redo stack length\n * @example\n * imageEditor.on('redoStackChanged', function(length) {\n * console.log(length);\n * });\n */\n this._invoker.on(REDO_STACK_CHANGED, this.fire.bind(this, REDO_STACK_CHANGED));\n\n if (this.ui) {\n const canvas = this._graphics.getCanvas();\n\n this._invoker.on(EXECUTE_COMMAND, (command) => this.ui.fire(EXECUTE_COMMAND, command));\n this._invoker.on(AFTER_UNDO, (command) => this.ui.fire(AFTER_UNDO, command));\n this._invoker.on(AFTER_REDO, (command) => this.ui.fire(AFTER_REDO, command));\n\n canvas.on(HAND_STARTED, () => this.ui.fire(HAND_STARTED));\n canvas.on(HAND_STOPPED, () => this.ui.fire(HAND_STOPPED));\n }\n }\n\n /**\n * Attach canvas events\n * @private\n */\n _attachGraphicsEvents() {\n this._graphics.on({\n [MOUSE_DOWN]: this._handlers.mousedown,\n [OBJECT_MOVED]: this._handlers.objectMoved,\n [OBJECT_SCALED]: this._handlers.objectScaled,\n [OBJECT_ROTATED]: this._handlers.objectRotated,\n [OBJECT_ACTIVATED]: this._handlers.objectActivated,\n [OBJECT_ADDED]: this._handlers.objectAdded,\n [OBJECT_MODIFIED]: this._handlers.objectModified,\n [ADD_TEXT]: this._handlers.addText,\n [ADD_OBJECT]: this._handlers.addObject,\n [TEXT_EDITING]: this._handlers.textEditing,\n [TEXT_CHANGED]: this._handlers.textChanged,\n [ICON_CREATE_RESIZE]: this._handlers.iconCreateResize,\n [ICON_CREATE_END]: this._handlers.iconCreateEnd,\n [SELECTION_CLEARED]: this._handlers.selectionCleared,\n [SELECTION_CREATED]: this._handlers.selectionCreated,\n });\n }\n\n /**\n * Attach dom events\n * @private\n */\n _attachDomEvents() {\n // ImageEditor supports IE 9 higher\n document.addEventListener('keydown', this._handlers.keydown);\n }\n\n /**\n * Detach dom events\n * @private\n */\n _detachDomEvents() {\n // ImageEditor supports IE 9 higher\n document.removeEventListener('keydown', this._handlers.keydown);\n }\n\n /**\n * Keydown event handler\n * @param {KeyboardEvent} e - Event object\n * @private\n */\n /* eslint-disable complexity */\n _onKeyDown(e) {\n const { ctrlKey, keyCode, metaKey } = e;\n const isModifierKey = ctrlKey || metaKey;\n\n if (isModifierKey) {\n if (keyCode === keyCodes.C) {\n this._graphics.resetTargetObjectForCopyPaste();\n } else if (keyCode === keyCodes.V) {\n this._graphics.pasteObject();\n this.clearRedoStack();\n } else if (keyCode === keyCodes.Z) {\n // There is no error message on shortcut when it's empty\n this.undo()['catch'](() => {});\n } else if (keyCode === keyCodes.Y) {\n // There is no error message on shortcut when it's empty\n this.redo()['catch'](() => {});\n }\n }\n\n const isDeleteKey = keyCode === keyCodes.BACKSPACE || keyCode === keyCodes.DEL;\n const isRemoveReady = this._graphics.isReadyRemoveObject();\n\n if (isRemoveReady && isDeleteKey) {\n e.preventDefault();\n this.removeActiveObject();\n }\n }\n\n /**\n * Remove Active Object\n */\n removeActiveObject() {\n const activeObjectId = this._graphics.getActiveObjectIdForRemove();\n\n this.removeObject(activeObjectId);\n }\n\n /**\n * mouse down event handler\n * @param {Event} event - mouse down event\n * @param {Object} originPointer - origin pointer\n * @param {Number} originPointer.x x position\n * @param {Number} originPointer.y y position\n * @private\n */\n _onMouseDown(event, originPointer) {\n /**\n * The mouse down event with position x, y on canvas\n * @event ImageEditor#mousedown\n * @param {Object} event - browser mouse event object\n * @param {Object} originPointer origin pointer\n * @param {Number} originPointer.x x position\n * @param {Number} originPointer.y y position\n * @example\n * imageEditor.on('mousedown', function(event, originPointer) {\n * console.log(event);\n * console.log(originPointer);\n * if (imageEditor.hasFilter('colorFilter')) {\n * imageEditor.applyFilter('colorFilter', {\n * x: parseInt(originPointer.x, 10),\n * y: parseInt(originPointer.y, 10)\n * });\n * }\n * });\n */\n\n this.fire(events.MOUSE_DOWN, event, originPointer);\n }\n\n /**\n * Add a 'addObject' command\n * @param {Object} obj - Fabric object\n * @private\n */\n _pushAddObjectCommand(obj) {\n const command = commandFactory.create(commands.ADD_OBJECT, this._graphics, obj);\n this._invoker.pushUndoStack(command);\n }\n\n /**\n * Add a 'changeSelection' command\n * @param {fabric.Object} obj - selection object\n * @private\n */\n _pushModifyObjectCommand(obj) {\n const { type } = obj;\n const props = makeSelectionUndoData(obj, (item) =>\n makeSelectionUndoDatum(this._graphics.getObjectId(item), item, type === 'activeSelection')\n );\n const command = commandFactory.create(commands.CHANGE_SELECTION, this._graphics, props);\n command.execute(this._graphics, props);\n\n this._invoker.pushUndoStack(command);\n }\n\n /**\n * 'objectActivated' event handler\n * @param {ObjectProps} props - object properties\n * @private\n */\n _onObjectActivated(props) {\n /**\n * The event when object is selected(aka activated).\n * @event ImageEditor#objectActivated\n * @param {ObjectProps} objectProps - object properties\n * @example\n * imageEditor.on('objectActivated', function(props) {\n * console.log(props);\n * console.log(props.type);\n * console.log(props.id);\n * });\n */\n this.fire(events.OBJECT_ACTIVATED, props);\n }\n\n /**\n * 'objectMoved' event handler\n * @param {ObjectProps} props - object properties\n * @private\n */\n _onObjectMoved(props) {\n /**\n * The event when object is moved\n * @event ImageEditor#objectMoved\n * @param {ObjectProps} props - object properties\n * @example\n * imageEditor.on('objectMoved', function(props) {\n * console.log(props);\n * console.log(props.type);\n * });\n */\n this.fire(events.OBJECT_MOVED, props);\n }\n\n /**\n * 'objectScaled' event handler\n * @param {ObjectProps} props - object properties\n * @private\n */\n _onObjectScaled(props) {\n /**\n * The event when scale factor is changed\n * @event ImageEditor#objectScaled\n * @param {ObjectProps} props - object properties\n * @example\n * imageEditor.on('objectScaled', function(props) {\n * console.log(props);\n * console.log(props.type);\n * });\n */\n this.fire(events.OBJECT_SCALED, props);\n }\n\n /**\n * 'objectRotated' event handler\n * @param {ObjectProps} props - object properties\n * @private\n */\n _onObjectRotated(props) {\n /**\n * The event when object angle is changed\n * @event ImageEditor#objectRotated\n * @param {ObjectProps} props - object properties\n * @example\n * imageEditor.on('objectRotated', function(props) {\n * console.log(props);\n * console.log(props.type);\n * });\n */\n this.fire(events.OBJECT_ROTATED, props);\n }\n\n /**\n * Get current drawing mode\n * @returns {string}\n * @example\n * // Image editor drawing mode\n * //\n * // NORMAL: 'NORMAL'\n * // CROPPER: 'CROPPER'\n * // FREE_DRAWING: 'FREE_DRAWING'\n * // LINE_DRAWING: 'LINE_DRAWING'\n * // TEXT: 'TEXT'\n * //\n * if (imageEditor.getDrawingMode() === 'FREE_DRAWING') {\n * imageEditor.stopDrawingMode();\n * }\n */\n getDrawingMode() {\n return this._graphics.getDrawingMode();\n }\n\n /**\n * Clear all objects\n * @returns {Promise}\n * @example\n * imageEditor.clearObjects();\n */\n clearObjects() {\n return this.execute(commands.CLEAR_OBJECTS);\n }\n\n /**\n * Deactivate all objects\n * @example\n * imageEditor.deactivateAll();\n */\n deactivateAll() {\n this._graphics.deactivateAll();\n this._graphics.renderAll();\n }\n\n /**\n * discard selction\n * @example\n * imageEditor.discardSelection();\n */\n discardSelection() {\n this._graphics.discardSelection();\n }\n\n /**\n * selectable status change\n * @param {boolean} selectable - selectable status\n * @example\n * imageEditor.changeSelectableAll(false); // or true\n */\n changeSelectableAll(selectable) {\n this._graphics.changeSelectableAll(selectable);\n }\n\n /**\n * Init history\n */\n _initHistory() {\n if (this.ui) {\n this.ui.initHistory();\n }\n }\n\n /**\n * Clear history\n */\n _clearHistory() {\n if (this.ui) {\n this.ui.clearHistory();\n }\n }\n\n /**\n * Invoke command\n * @param {String} commandName - Command name\n * @param {...*} args - Arguments for creating command\n * @returns {Promise}\n * @private\n */\n execute(commandName, ...args) {\n // Inject an Graphics instance as first parameter\n const theArgs = [this._graphics].concat(args);\n\n return this._invoker.execute(commandName, ...theArgs);\n }\n\n /**\n * Invoke command\n * @param {String} commandName - Command name\n * @param {...*} args - Arguments for creating command\n * @returns {Promise}\n * @private\n */\n executeSilent(commandName, ...args) {\n // Inject an Graphics instance as first parameter\n const theArgs = [this._graphics].concat(args);\n\n return this._invoker.executeSilent(commandName, ...theArgs);\n }\n\n /**\n * Undo\n * @param {number} [iterationCount=1] - Iteration count of undo\n * @returns {Promise}\n * @example\n * imageEditor.undo();\n */\n undo(iterationCount = 1) {\n let promise = Promise.resolve();\n\n for (let i = 0; i < iterationCount; i += 1) {\n promise = promise.then(() => this._invoker.undo());\n }\n\n return promise;\n }\n\n /**\n * Redo\n * @param {number} [iterationCount=1] - Iteration count of redo\n * @returns {Promise}\n * @example\n * imageEditor.redo();\n */\n redo(iterationCount = 1) {\n let promise = Promise.resolve();\n\n for (let i = 0; i < iterationCount; i += 1) {\n promise = promise.then(() => this._invoker.redo());\n }\n\n return promise;\n }\n\n /**\n * Zoom\n * @param {number} x - x axis of center point for zoom\n * @param {number} y - y axis of center point for zoom\n * @param {number} zoomLevel - level of zoom(1.0 ~ 5.0)\n */\n zoom({ x, y, zoomLevel }) {\n this._graphics.zoom({ x, y }, zoomLevel);\n }\n\n /**\n * Reset zoom. Change zoom level to 1.0\n */\n resetZoom() {\n this._graphics.resetZoom();\n }\n\n /**\n * Load image from file\n * @param {File} imgFile - Image file\n * @param {string} [imageName] - imageName\n * @returns {Promise}\n * @example\n * imageEditor.loadImageFromFile(file).then(result => {\n * console.log('old : ' + result.oldWidth + ', ' + result.oldHeight);\n * console.log('new : ' + result.newWidth + ', ' + result.newHeight);\n * });\n */\n loadImageFromFile(imgFile, imageName) {\n if (!imgFile) {\n return Promise.reject(rejectMessages.invalidParameters);\n }\n\n const imgUrl = URL.createObjectURL(imgFile);\n imageName = imageName || imgFile.name;\n\n return this.loadImageFromURL(imgUrl, imageName).then((value) => {\n URL.revokeObjectURL(imgFile);\n\n return value;\n });\n }\n\n /**\n * Load image from url\n * @param {string} url - File url\n * @param {string} imageName - imageName\n * @returns {Promise}\n * @example\n * imageEditor.loadImageFromURL('http://url/testImage.png', 'lena').then(result => {\n * console.log('old : ' + result.oldWidth + ', ' + result.oldHeight);\n * console.log('new : ' + result.newWidth + ', ' + result.newHeight);\n * });\n */\n loadImageFromURL(url, imageName) {\n if (!imageName || !url) {\n return Promise.reject(rejectMessages.invalidParameters);\n }\n\n return this.execute(commands.LOAD_IMAGE, imageName, url);\n }\n\n /**\n * Add image object on canvas\n * @param {string} imgUrl - Image url to make object\n * @returns {Promise}\n * @example\n * imageEditor.addImageObject('path/fileName.jpg').then(objectProps => {\n * console.log(ojectProps.id);\n * });\n */\n addImageObject(imgUrl) {\n if (!imgUrl) {\n return Promise.reject(rejectMessages.invalidParameters);\n }\n\n return this.execute(commands.ADD_IMAGE_OBJECT, imgUrl);\n }\n\n /**\n * Start a drawing mode. If the current mode is not 'NORMAL', 'stopDrawingMode()' will be called first.\n * @param {String} mode Can be one of 'CROPPER', 'FREE_DRAWING', 'LINE_DRAWING', 'TEXT', 'SHAPE'\n * @param {Object} [option] parameters of drawing mode, it's available with 'FREE_DRAWING', 'LINE_DRAWING'\n * @param {Number} [option.width] brush width\n * @param {String} [option.color] brush color\n * @param {Object} [option.arrowType] arrow decorate\n * @param {string} [option.arrowType.tail] arrow decorate for tail. 'chevron' or 'triangle'\n * @param {string} [option.arrowType.head] arrow decorate for head. 'chevron' or 'triangle'\n * @returns {boolean} true if success or false\n * @example\n * imageEditor.startDrawingMode('FREE_DRAWING', {\n * width: 10,\n * color: 'rgba(255,0,0,0.5)'\n * });\n * imageEditor.startDrawingMode('LINE_DRAWING', {\n * width: 10,\n * color: 'rgba(255,0,0,0.5)',\n * arrowType: {\n * tail: 'chevron' // triangle\n * }\n * });\n *\n */\n startDrawingMode(mode, option) {\n return this._graphics.startDrawingMode(mode, option);\n }\n\n /**\n * Stop the current drawing mode and back to the 'NORMAL' mode\n * @example\n * imageEditor.stopDrawingMode();\n */\n stopDrawingMode() {\n this._graphics.stopDrawingMode();\n }\n\n /**\n * Crop this image with rect\n * @param {Object} rect crop rect\n * @param {Number} rect.left left position\n * @param {Number} rect.top top position\n * @param {Number} rect.width width\n * @param {Number} rect.height height\n * @returns {Promise}\n * @example\n * imageEditor.crop(imageEditor.getCropzoneRect());\n */\n crop(rect) {\n const data = this._graphics.getCroppedImageData(rect);\n if (!data) {\n return Promise.reject(rejectMessages.invalidParameters);\n }\n\n return this.loadImageFromURL(data.url, data.imageName);\n }\n\n /**\n * Get the cropping rect\n * @returns {Object} {{left: number, top: number, width: number, height: number}} rect\n */\n getCropzoneRect() {\n return this._graphics.getCropzoneRect();\n }\n\n /**\n * Set the cropping rect\n * @param {number} [mode] crop rect mode [1, 1.5, 1.3333333333333333, 1.25, 1.7777777777777777]\n */\n setCropzoneRect(mode) {\n this._graphics.setCropzoneRect(mode);\n }\n\n /**\n * Flip\n * @returns {Promise}\n * @param {string} type - 'flipX' or 'flipY' or 'reset'\n * @returns {Promise}\n * @private\n */\n _flip(type) {\n return this.execute(commands.FLIP_IMAGE, type);\n }\n\n /**\n * Flip x\n * @returns {Promise}\n * @example\n * imageEditor.flipX().then((status => {\n * console.log('flipX: ', status.flipX);\n * console.log('flipY: ', status.flipY);\n * console.log('angle: ', status.angle);\n * }).catch(message => {\n * console.log('error: ', message);\n * });\n */\n flipX() {\n return this._flip('flipX');\n }\n\n /**\n * Flip y\n * @returns {Promise}\n * @example\n * imageEditor.flipY().then(status => {\n * console.log('flipX: ', status.flipX);\n * console.log('flipY: ', status.flipY);\n * console.log('angle: ', status.angle);\n * }).catch(message => {\n * console.log('error: ', message);\n * });\n */\n flipY() {\n return this._flip('flipY');\n }\n\n /**\n * Reset flip\n * @returns {Promise}\n * @example\n * imageEditor.resetFlip().then(status => {\n * console.log('flipX: ', status.flipX);\n * console.log('flipY: ', status.flipY);\n * console.log('angle: ', status.angle);\n * }).catch(message => {\n * console.log('error: ', message);\n * });;\n */\n resetFlip() {\n return this._flip('reset');\n }\n\n /**\n * @param {string} type - 'rotate' or 'setAngle'\n * @param {number} angle - angle value (degree)\n * @param {boolean} isSilent - is silent execution or not\n * @returns {Promise}\n * @private\n */\n _rotate(type, angle, isSilent) {\n let result = null;\n\n if (isSilent) {\n result = this.executeSilent(commands.ROTATE_IMAGE, type, angle);\n } else {\n result = this.execute(commands.ROTATE_IMAGE, type, angle);\n }\n\n return result;\n }\n\n /**\n * Rotate image\n * @returns {Promise}\n * @param {number} angle - Additional angle to rotate image\n * @param {boolean} isSilent - is silent execution or not\n * @returns {Promise}\n * @example\n * imageEditor.rotate(10); // angle = 10\n * imageEditor.rotate(10); // angle = 20\n * imageEditor.rotate(5); // angle = 5\n * imageEditor.rotate(-95); // angle = -90\n * imageEditor.rotate(10).then(status => {\n * console.log('angle: ', status.angle);\n * })).catch(message => {\n * console.log('error: ', message);\n * });\n */\n rotate(angle, isSilent) {\n return this._rotate('rotate', angle, isSilent);\n }\n\n /**\n * Set angle\n * @param {number} angle - Angle of image\n * @param {boolean} isSilent - is silent execution or not\n * @returns {Promise}\n * @example\n * imageEditor.setAngle(10); // angle = 10\n * imageEditor.rotate(10); // angle = 20\n * imageEditor.setAngle(5); // angle = 5\n * imageEditor.rotate(50); // angle = 55\n * imageEditor.setAngle(-40); // angle = -40\n * imageEditor.setAngle(10).then(status => {\n * console.log('angle: ', status.angle);\n * })).catch(message => {\n * console.log('error: ', message);\n * });\n */\n setAngle(angle, isSilent) {\n return this._rotate('setAngle', angle, isSilent);\n }\n\n /**\n * Set drawing brush\n * @param {Object} option brush option\n * @param {Number} option.width width\n * @param {String} option.color color like 'FFFFFF', 'rgba(0, 0, 0, 0.5)'\n * @example\n * imageEditor.startDrawingMode('FREE_DRAWING');\n * imageEditor.setBrush({\n * width: 12,\n * color: 'rgba(0, 0, 0, 0.5)'\n * });\n * imageEditor.setBrush({\n * width: 8,\n * color: 'FFFFFF'\n * });\n */\n setBrush(option) {\n this._graphics.setBrush(option);\n }\n\n /**\n * Set states of current drawing shape\n * @param {string} type - Shape type (ex: 'rect', 'circle', 'triangle')\n * @param {Object} [options] - Shape options\n * @param {(ShapeFillOption | string)} [options.fill] - {@link ShapeFillOption} or\n * Shape foreground color (ex: '#fff', 'transparent')\n * @param {string} [options.stoke] - Shape outline color\n * @param {number} [options.strokeWidth] - Shape outline width\n * @param {number} [options.width] - Width value (When type option is 'rect', this options can use)\n * @param {number} [options.height] - Height value (When type option is 'rect', this options can use)\n * @param {number} [options.rx] - Radius x value (When type option is 'circle', this options can use)\n * @param {number} [options.ry] - Radius y value (When type option is 'circle', this options can use)\n * @param {number} [options.isRegular] - Whether resizing shape has 1:1 ratio or not\n * @example\n * imageEditor.setDrawingShape('rect', {\n * fill: 'red',\n * width: 100,\n * height: 200\n * });\n * @example\n * imageEditor.setDrawingShape('rect', {\n * fill: {\n * type: 'filter',\n * filter: [{blur: 0.3}, {pixelate: 20}]\n * },\n * width: 100,\n * height: 200\n * });\n * @example\n * imageEditor.setDrawingShape('circle', {\n * fill: 'transparent',\n * stroke: 'blue',\n * strokeWidth: 3,\n * rx: 10,\n * ry: 100\n * });\n * @example\n * imageEditor.setDrawingShape('triangle', { // When resizing, the shape keep the 1:1 ratio\n * width: 1,\n * height: 1,\n * isRegular: true\n * });\n * @example\n * imageEditor.setDrawingShape('circle', { // When resizing, the shape keep the 1:1 ratio\n * rx: 10,\n * ry: 10,\n * isRegular: true\n * });\n */\n setDrawingShape(type, options) {\n this._graphics.setDrawingShape(type, options);\n }\n\n setDrawingIcon(type, iconColor) {\n this._graphics.setIconStyle(type, iconColor);\n }\n\n /**\n * Add shape\n * @param {string} type - Shape type (ex: 'rect', 'circle', 'triangle')\n * @param {Object} options - Shape options\n * @param {(ShapeFillOption | string)} [options.fill] - {@link ShapeFillOption} or\n * Shape foreground color (ex: '#fff', 'transparent')\n * @param {string} [options.stroke] - Shape outline color\n * @param {number} [options.strokeWidth] - Shape outline width\n * @param {number} [options.width] - Width value (When type option is 'rect', this options can use)\n * @param {number} [options.height] - Height value (When type option is 'rect', this options can use)\n * @param {number} [options.rx] - Radius x value (When type option is 'circle', this options can use)\n * @param {number} [options.ry] - Radius y value (When type option is 'circle', this options can use)\n * @param {number} [options.left] - Shape x position\n * @param {number} [options.top] - Shape y position\n * @param {boolean} [options.isRegular] - Whether resizing shape has 1:1 ratio or not\n * @returns {Promise}\n * @example\n * imageEditor.addShape('rect', {\n * fill: 'red',\n * stroke: 'blue',\n * strokeWidth: 3,\n * width: 100,\n * height: 200,\n * left: 10,\n * top: 10,\n * isRegular: true\n * });\n * @example\n * imageEditor.addShape('circle', {\n * fill: 'red',\n * stroke: 'blue',\n * strokeWidth: 3,\n * rx: 10,\n * ry: 100,\n * isRegular: false\n * }).then(objectProps => {\n * console.log(objectProps.id);\n * });\n * @example\n * imageEditor.addShape('rect', {\n * fill: {\n * type: 'filter',\n * filter: [{blur: 0.3}, {pixelate: 20}]\n * },\n * stroke: 'blue',\n * strokeWidth: 3,\n * rx: 10,\n * ry: 100,\n * isRegular: false\n * }).then(objectProps => {\n * console.log(objectProps.id);\n * });\n */\n addShape(type, options) {\n options = options || {};\n\n this._setPositions(options);\n\n return this.execute(commands.ADD_SHAPE, type, options);\n }\n\n /**\n * Change shape\n * @param {number} id - object id\n * @param {Object} options - Shape options\n * @param {(ShapeFillOption | string)} [options.fill] - {@link ShapeFillOption} or\n * Shape foreground color (ex: '#fff', 'transparent')\n * @param {string} [options.stroke] - Shape outline color\n * @param {number} [options.strokeWidth] - Shape outline width\n * @param {number} [options.width] - Width value (When type option is 'rect', this options can use)\n * @param {number} [options.height] - Height value (When type option is 'rect', this options can use)\n * @param {number} [options.rx] - Radius x value (When type option is 'circle', this options can use)\n * @param {number} [options.ry] - Radius y value (When type option is 'circle', this options can use)\n * @param {boolean} [options.isRegular] - Whether resizing shape has 1:1 ratio or not\n * @param {boolean} isSilent - is silent execution or not\n * @returns {Promise}\n * @example\n * // call after selecting shape object on canvas\n * imageEditor.changeShape(id, { // change rectagle or triangle\n * fill: 'red',\n * stroke: 'blue',\n * strokeWidth: 3,\n * width: 100,\n * height: 200\n * });\n * @example\n * // call after selecting shape object on canvas\n * imageEditor.changeShape(id, { // change circle\n * fill: 'red',\n * stroke: 'blue',\n * strokeWidth: 3,\n * rx: 10,\n * ry: 100\n * });\n */\n changeShape(id, options, isSilent) {\n const executeMethodName = isSilent ? 'executeSilent' : 'execute';\n\n return this[executeMethodName](commands.CHANGE_SHAPE, id, options);\n }\n\n /**\n * Add text on image\n * @param {string} text - Initial input text\n * @param {Object} [options] Options for generating text\n * @param {Object} [options.styles] Initial styles\n * @param {string} [options.styles.fill] Color\n * @param {string} [options.styles.fontFamily] Font type for text\n * @param {number} [options.styles.fontSize] Size\n * @param {string} [options.styles.fontStyle] Type of inclination (normal / italic)\n * @param {string} [options.styles.fontWeight] Type of thicker or thinner looking (normal / bold)\n * @param {string} [options.styles.textAlign] Type of text align (left / center / right)\n * @param {string} [options.styles.textDecoration] Type of line (underline / line-through / overline)\n * @param {{x: number, y: number}} [options.position] - Initial position\n * @param {boolean} [options.autofocus] - text autofocus, default is true\n * @returns {Promise}\n * @example\n * imageEditor.addText('init text');\n * @example\n * imageEditor.addText('init text', {\n * styles: {\n * fill: '#000',\n * fontSize: 20,\n * fontWeight: 'bold'\n * },\n * position: {\n * x: 10,\n * y: 10\n * }\n * }).then(objectProps => {\n * console.log(objectProps.id);\n * });\n */\n addText(text, options) {\n text = text || '';\n options = options || {};\n\n return this.execute(commands.ADD_TEXT, text, options);\n }\n\n /**\n * Change contents of selected text object on image\n * @param {number} id - object id\n * @param {string} text - Changing text\n * @returns {Promise}\n * @example\n * imageEditor.changeText(id, 'change text');\n */\n changeText(id, text) {\n text = text || '';\n\n return this.execute(commands.CHANGE_TEXT, id, text);\n }\n\n /**\n * Set style\n * @param {number} id - object id\n * @param {Object} styleObj - text styles\n * @param {string} [styleObj.fill] Color\n * @param {string} [styleObj.fontFamily] Font type for text\n * @param {number} [styleObj.fontSize] Size\n * @param {string} [styleObj.fontStyle] Type of inclination (normal / italic)\n * @param {string} [styleObj.fontWeight] Type of thicker or thinner looking (normal / bold)\n * @param {string} [styleObj.textAlign] Type of text align (left / center / right)\n * @param {string} [styleObj.textDecoration] Type of line (underline / line-through / overline)\n * @param {boolean} isSilent - is silent execution or not\n * @returns {Promise}\n * @example\n * imageEditor.changeTextStyle(id, {\n * fontStyle: 'italic'\n * });\n */\n changeTextStyle(id, styleObj, isSilent) {\n const executeMethodName = isSilent ? 'executeSilent' : 'execute';\n\n return this[executeMethodName](commands.CHANGE_TEXT_STYLE, id, styleObj);\n }\n\n /**\n * change text mode\n * @param {string} type - change type\n * @private\n */\n _changeActivateMode(type) {\n if (type !== 'ICON' && this.getDrawingMode() !== type) {\n this.startDrawingMode(type);\n }\n }\n\n /**\n * 'textChanged' event handler\n * @param {Object} target - changed text object\n * @private\n */\n _onTextChanged(target) {\n this.fire(events.TEXT_CHANGED, target);\n }\n\n /**\n * 'iconCreateResize' event handler\n * @param {Object} originPointer origin pointer\n * @param {Number} originPointer.x x position\n * @param {Number} originPointer.y y position\n * @private\n */\n _onIconCreateResize(originPointer) {\n this.fire(events.ICON_CREATE_RESIZE, originPointer);\n }\n\n /**\n * 'iconCreateEnd' event handler\n * @param {Object} originPointer origin pointer\n * @param {Number} originPointer.x x position\n * @param {Number} originPointer.y y position\n * @private\n */\n _onIconCreateEnd(originPointer) {\n this.fire(events.ICON_CREATE_END, originPointer);\n }\n\n /**\n * 'textEditing' event handler\n * @private\n */\n _onTextEditing() {\n /**\n * The event which starts to edit text object\n * @event ImageEditor#textEditing\n * @example\n * imageEditor.on('textEditing', function() {\n * console.log('text editing');\n * });\n */\n\n this.fire(events.TEXT_EDITING);\n }\n\n /**\n * Mousedown event handler in case of 'TEXT' drawing mode\n * @param {fabric.Event} event - Current mousedown event object\n * @private\n */\n _onAddText(event) {\n /**\n * The event when 'TEXT' drawing mode is enabled and click non-object area.\n * @event ImageEditor#addText\n * @param {Object} pos\n * @param {Object} pos.originPosition - Current position on origin canvas\n * @param {Number} pos.originPosition.x - x\n * @param {Number} pos.originPosition.y - y\n * @param {Object} pos.clientPosition - Current position on client area\n * @param {Number} pos.clientPosition.x - x\n * @param {Number} pos.clientPosition.y - y\n * @example\n * imageEditor.on('addText', function(pos) {\n * console.log('text position on canvas: ' + pos.originPosition);\n * console.log('text position on brwoser: ' + pos.clientPosition);\n * });\n */\n\n this.fire(events.ADD_TEXT, {\n originPosition: event.originPosition,\n clientPosition: event.clientPosition,\n });\n }\n\n /**\n * 'addObject' event handler\n * @param {Object} objectProps added object properties\n * @private\n */\n _onAddObject(objectProps) {\n const obj = this._graphics.getObject(objectProps.id);\n this._invoker.fire(events.EXECUTE_COMMAND, getObjectType(obj.type));\n this._pushAddObjectCommand(obj);\n }\n\n /**\n * 'objectAdded' event handler\n * @param {Object} objectProps added object properties\n * @private\n */\n _onObjectAdded(objectProps) {\n /**\n * The event when object added\n * @event ImageEditor#objectAdded\n * @param {ObjectProps} props - object properties\n * @example\n * imageEditor.on('objectAdded', function(props) {\n * console.log(props);\n * });\n */\n this.fire(OBJECT_ADDED, objectProps);\n\n /**\n * The event when object added (deprecated)\n * @event ImageEditor#addObjectAfter\n * @param {ObjectProps} props - object properties\n * @deprecated\n */\n this.fire(ADD_OBJECT_AFTER, objectProps);\n }\n\n /**\n * 'objectModified' event handler\n * @param {fabric.Object} obj - selection object\n * @private\n */\n _onObjectModified(obj) {\n if (obj.type !== OBJ_TYPE.CROPZONE) {\n this._invoker.fire(events.EXECUTE_COMMAND, getObjectType(obj.type));\n this._pushModifyObjectCommand(obj);\n }\n }\n\n /**\n * 'selectionCleared' event handler\n * @private\n */\n _selectionCleared() {\n this.fire(SELECTION_CLEARED);\n }\n\n /**\n * 'selectionCreated' event handler\n * @param {Object} eventTarget - Fabric object\n * @private\n */\n _selectionCreated(eventTarget) {\n this.fire(SELECTION_CREATED, eventTarget);\n }\n\n /**\n * Register custom icons\n * @param {{iconType: string, pathValue: string}} infos - Infos to register icons\n * @example\n * imageEditor.registerIcons({\n * customIcon: 'M 0 0 L 20 20 L 10 10 Z',\n * customArrow: 'M 60 0 L 120 60 H 90 L 75 45 V 180 H 45 V 45 L 30 60 H 0 Z'\n * });\n */\n registerIcons(infos) {\n this._graphics.registerPaths(infos);\n }\n\n /**\n * Change canvas cursor type\n * @param {string} cursorType - cursor type\n * @example\n * imageEditor.changeCursor('crosshair');\n */\n changeCursor(cursorType) {\n this._graphics.changeCursor(cursorType);\n }\n\n /**\n * Add icon on canvas\n * @param {string} type - Icon type ('arrow', 'cancel', custom icon name)\n * @param {Object} options - Icon options\n * @param {string} [options.fill] - Icon foreground color\n * @param {number} [options.left] - Icon x position\n * @param {number} [options.top] - Icon y position\n * @returns {Promise}\n * @example\n * imageEditor.addIcon('arrow'); // The position is center on canvas\n * @example\n * imageEditor.addIcon('arrow', {\n * left: 100,\n * top: 100\n * }).then(objectProps => {\n * console.log(objectProps.id);\n * });\n */\n addIcon(type, options) {\n options = options || {};\n\n this._setPositions(options);\n\n return this.execute(commands.ADD_ICON, type, options);\n }\n\n /**\n * Change icon color\n * @param {number} id - object id\n * @param {string} color - Color for icon\n * @returns {Promise}\n * @example\n * imageEditor.changeIconColor(id, '#000000');\n */\n changeIconColor(id, color) {\n return this.execute(commands.CHANGE_ICON_COLOR, id, color);\n }\n\n /**\n * Remove an object or group by id\n * @param {number} id - object id\n * @returns {Promise}\n * @example\n * imageEditor.removeObject(id);\n */\n removeObject(id) {\n const { type } = this._graphics.getObject(id);\n\n return this.execute(commands.REMOVE_OBJECT, id, getObjectType(type));\n }\n\n /**\n * Whether it has the filter or not\n * @param {string} type - Filter type\n * @returns {boolean} true if it has the filter\n */\n hasFilter(type) {\n return this._graphics.hasFilter(type);\n }\n\n /**\n * Remove filter on canvas image\n * @param {string} type - Filter type\n * @returns {Promise}\n * @example\n * imageEditor.removeFilter('Grayscale').then(obj => {\n * console.log('filterType: ', obj.type);\n * console.log('actType: ', obj.action);\n * }).catch(message => {\n * console.log('error: ', message);\n * });\n */\n removeFilter(type) {\n return this.execute(commands.REMOVE_FILTER, type);\n }\n\n /**\n * Apply filter on canvas image\n * @param {string} type - Filter type\n * @param {object} options - Options to apply filter\n * @param {boolean} isSilent - is silent execution or not\n * @returns {Promise}\n * @example\n * imageEditor.applyFilter('Grayscale');\n * @example\n * imageEditor.applyFilter('mask', {maskObjId: id}).then(obj => {\n * console.log('filterType: ', obj.type);\n * console.log('actType: ', obj.action);\n * }).catch(message => {\n * console.log('error: ', message);\n * });;\n */\n applyFilter(type, options, isSilent) {\n const executeMethodName = isSilent ? 'executeSilent' : 'execute';\n\n return this[executeMethodName](commands.APPLY_FILTER, type, options);\n }\n\n /**\n * Get data url\n * @param {Object} options - options for toDataURL\n * @param {String} [options.format=png] The format of the output image. Either \"jpeg\" or \"png\"\n * @param {Number} [options.quality=1] Quality level (0..1). Only used for jpeg.\n * @param {Number} [options.multiplier=1] Multiplier to scale by\n * @param {Number} [options.left] Cropping left offset. Introduced in fabric v1.2.14\n * @param {Number} [options.top] Cropping top offset. Introduced in fabric v1.2.14\n * @param {Number} [options.width] Cropping width. Introduced in fabric v1.2.14\n * @param {Number} [options.height] Cropping height. Introduced in fabric v1.2.14\n * @returns {string} A DOMString containing the requested data URI\n * @example\n * imgEl.src = imageEditor.toDataURL();\n *\n * imageEditor.loadImageFromURL(imageEditor.toDataURL(), 'FilterImage').then(() => {\n * imageEditor.addImageObject(imgUrl);\n * });\n */\n toDataURL(options) {\n return this._graphics.toDataURL(options);\n }\n\n /**\n * Get image name\n * @returns {string} image name\n * @example\n * console.log(imageEditor.getImageName());\n */\n getImageName() {\n return this._graphics.getImageName();\n }\n\n /**\n * Clear undoStack\n * @example\n * imageEditor.clearUndoStack();\n */\n clearUndoStack() {\n this._invoker.clearUndoStack();\n }\n\n /**\n * Clear redoStack\n * @example\n * imageEditor.clearRedoStack();\n */\n clearRedoStack() {\n this._invoker.clearRedoStack();\n }\n\n /**\n * Whehter the undo stack is empty or not\n * @returns {boolean}\n * imageEditor.isEmptyUndoStack();\n */\n isEmptyUndoStack() {\n return this._invoker.isEmptyUndoStack();\n }\n\n /**\n * Whehter the redo stack is empty or not\n * @returns {boolean}\n * imageEditor.isEmptyRedoStack();\n */\n isEmptyRedoStack() {\n return this._invoker.isEmptyRedoStack();\n }\n\n /**\n * Resize canvas dimension\n * @param {{width: number, height: number}} dimension - Max width & height\n * @returns {Promise}\n */\n resizeCanvasDimension(dimension) {\n if (!dimension) {\n return Promise.reject(rejectMessages.invalidParameters);\n }\n\n return this.execute(commands.RESIZE_CANVAS_DIMENSION, dimension);\n }\n\n /**\n * Destroy\n */\n destroy() {\n this.stopDrawingMode();\n this._detachDomEvents();\n this._graphics.destroy();\n this._graphics = null;\n\n if (this.ui) {\n this.ui.destroy();\n }\n\n forEach(\n this,\n (value, key) => {\n this[key] = null;\n },\n this\n );\n }\n\n /**\n * Set position\n * @param {Object} options - Position options (left or top)\n * @private\n */\n _setPositions(options) {\n const centerPosition = this._graphics.getCenter();\n\n if (isUndefined(options.left)) {\n options.left = centerPosition.left;\n }\n\n if (isUndefined(options.top)) {\n options.top = centerPosition.top;\n }\n }\n\n /**\n * Set properties of active object\n * @param {number} id - object id\n * @param {Object} keyValue - key & value\n * @returns {Promise}\n * @example\n * imageEditor.setObjectProperties(id, {\n * left:100,\n * top:100,\n * width: 200,\n * height: 200,\n * opacity: 0.5\n * });\n */\n setObjectProperties(id, keyValue) {\n return this.execute(commands.SET_OBJECT_PROPERTIES, id, keyValue);\n }\n\n /**\n * Set properties of active object, Do not leave an invoke history.\n * @param {number} id - object id\n * @param {Object} keyValue - key & value\n * @example\n * imageEditor.setObjectPropertiesQuietly(id, {\n * left:100,\n * top:100,\n * width: 200,\n * height: 200,\n * opacity: 0.5\n * });\n */\n setObjectPropertiesQuietly(id, keyValue) {\n this._graphics.setObjectProperties(id, keyValue);\n }\n\n /**\n * Get properties of active object corresponding key\n * @param {number} id - object id\n * @param {Array|ObjectProps|string} keys - property's key\n * @returns {ObjectProps} properties if id is valid or null\n * @example\n * var props = imageEditor.getObjectProperties(id, 'left');\n * console.log(props);\n * @example\n * var props = imageEditor.getObjectProperties(id, ['left', 'top', 'width', 'height']);\n * console.log(props);\n * @example\n * var props = imageEditor.getObjectProperties(id, {\n * left: null,\n * top: null,\n * width: null,\n * height: null,\n * opacity: null\n * });\n * console.log(props);\n */\n getObjectProperties(id, keys) {\n const object = this._graphics.getObject(id);\n if (!object) {\n return null;\n }\n\n return this._graphics.getObjectProperties(id, keys);\n }\n\n /**\n * Get the canvas size\n * @returns {Object} {{width: number, height: number}} canvas size\n * @example\n * var canvasSize = imageEditor.getCanvasSize();\n * console.log(canvasSize.width);\n * console.height(canvasSize.height);\n */\n getCanvasSize() {\n return this._graphics.getCanvasSize();\n }\n\n /**\n * Get object position by originX, originY\n * @param {number} id - object id\n * @param {string} originX - can be 'left', 'center', 'right'\n * @param {string} originY - can be 'top', 'center', 'bottom'\n * @returns {Object} {{x:number, y: number}} position by origin if id is valid, or null\n * @example\n * var position = imageEditor.getObjectPosition(id, 'left', 'top');\n * console.log(position);\n */\n getObjectPosition(id, originX, originY) {\n return this._graphics.getObjectPosition(id, originX, originY);\n }\n\n /**\n * Set object position by originX, originY\n * @param {number} id - object id\n * @param {Object} posInfo - position object\n * @param {number} posInfo.x - x position\n * @param {number} posInfo.y - y position\n * @param {string} posInfo.originX - can be 'left', 'center', 'right'\n * @param {string} posInfo.originY - can be 'top', 'center', 'bottom'\n * @returns {Promise}\n * @example\n * // align the object to 'left', 'top'\n * imageEditor.setObjectPosition(id, {\n * x: 0,\n * y: 0,\n * originX: 'left',\n * originY: 'top'\n * });\n * @example\n * // align the object to 'right', 'top'\n * var canvasSize = imageEditor.getCanvasSize();\n * imageEditor.setObjectPosition(id, {\n * x: canvasSize.width,\n * y: 0,\n * originX: 'right',\n * originY: 'top'\n * });\n * @example\n * // align the object to 'left', 'bottom'\n * var canvasSize = imageEditor.getCanvasSize();\n * imageEditor.setObjectPosition(id, {\n * x: 0,\n * y: canvasSize.height,\n * originX: 'left',\n * originY: 'bottom'\n * });\n * @example\n * // align the object to 'right', 'bottom'\n * var canvasSize = imageEditor.getCanvasSize();\n * imageEditor.setObjectPosition(id, {\n * x: canvasSize.width,\n * y: canvasSize.height,\n * originX: 'right',\n * originY: 'bottom'\n * });\n */\n setObjectPosition(id, posInfo) {\n return this.execute(commands.SET_OBJECT_POSITION, id, posInfo);\n }\n}\n\naction.mixin(ImageEditor);\nCustomEvents.mixin(ImageEditor);\n\nexport default ImageEditor;\n","/**\n * @author NHN. FE Development Team \n * @fileoverview Invoker - invoke commands\n */\nimport snippet from 'tui-code-snippet';\nimport commandFactory from '@/factory/command';\nimport { Promise } from '@/util';\nimport { eventNames, rejectMessages } from '@/consts';\n\nconst { isFunction, isString, CustomEvents } = snippet;\n\n/**\n * Invoker\n * @class\n * @ignore\n */\nclass Invoker {\n constructor() {\n /**\n * Undo stack\n * @type {Array.}\n * @private\n */\n this._undoStack = [];\n\n /**\n * Redo stack\n * @type {Array.}\n * @private\n */\n this._redoStack = [];\n\n /**\n * Lock-flag for executing command\n * @type {boolean}\n * @private\n */\n this._isLocked = false;\n\n this._isSilent = false;\n }\n\n /**\n * Invoke command execution\n * @param {Command} command - Command\n * @param {boolean} [isRedo=false] - check if command is redo\n * @returns {Promise}\n * @private\n */\n _invokeExecution(command, isRedo = false) {\n this.lock();\n\n let { args } = command;\n if (!args) {\n args = [];\n }\n\n return command\n .execute(...args)\n .then((value) => {\n if (!this._isSilent) {\n this.pushUndoStack(command);\n\n this.fire(isRedo ? eventNames.AFTER_REDO : eventNames.EXECUTE_COMMAND, command);\n }\n this.unlock();\n if (isFunction(command.executeCallback)) {\n command.executeCallback(value);\n }\n\n return value;\n })\n ['catch']((message) => {\n this.unlock();\n\n return Promise.reject(message);\n });\n }\n\n /**\n * Invoke command undo\n * @param {Command} command - Command\n * @returns {Promise}\n * @private\n */\n _invokeUndo(command) {\n this.lock();\n\n let { args } = command;\n if (!args) {\n args = [];\n }\n\n return command\n .undo(...args)\n .then((value) => {\n this.pushRedoStack(command);\n this.fire(eventNames.AFTER_UNDO, command);\n this.unlock();\n if (isFunction(command.undoCallback)) {\n command.undoCallback(value);\n }\n\n return value;\n })\n ['catch']((message) => {\n this.unlock();\n\n return Promise.reject(message);\n });\n }\n\n /**\n * fire REDO_STACK_CHANGED event\n * @private\n */\n _fireRedoStackChanged() {\n this.fire(eventNames.REDO_STACK_CHANGED, this._redoStack.length);\n }\n\n /**\n * fire UNDO_STACK_CHANGED event\n * @private\n */\n _fireUndoStackChanged() {\n this.fire(eventNames.UNDO_STACK_CHANGED, this._undoStack.length);\n }\n\n /**\n * Lock this invoker\n */\n lock() {\n this._isLocked = true;\n }\n\n /**\n * Unlock this invoker\n */\n unlock() {\n this._isLocked = false;\n }\n\n executeSilent(...args) {\n this._isSilent = true;\n\n return this.execute(...args, this._isSilent).then(() => {\n this._isSilent = false;\n });\n }\n\n /**\n * Invoke command\n * Store the command to the undoStack\n * Clear the redoStack\n * @param {String} commandName - Command name\n * @param {...*} args - Arguments for creating command\n * @returns {Promise}\n */\n execute(...args) {\n if (this._isLocked) {\n return Promise.reject(rejectMessages.isLock);\n }\n\n let [command] = args;\n if (isString(command)) {\n command = commandFactory.create(...args);\n }\n\n return this._invokeExecution(command).then((value) => {\n this.clearRedoStack();\n\n return value;\n });\n }\n\n /**\n * Undo command\n * @returns {Promise}\n */\n undo() {\n let command = this._undoStack.pop();\n let promise;\n let message = '';\n\n if (command && this._isLocked) {\n this.pushUndoStack(command, true);\n command = null;\n }\n if (command) {\n if (this.isEmptyUndoStack()) {\n this._fireUndoStackChanged();\n }\n promise = this._invokeUndo(command);\n } else {\n message = rejectMessages.undo;\n if (this._isLocked) {\n message = `${message} Because ${rejectMessages.isLock}`;\n }\n promise = Promise.reject(message);\n }\n\n return promise;\n }\n\n /**\n * Redo command\n * @returns {Promise}\n */\n redo() {\n let command = this._redoStack.pop();\n let promise;\n let message = '';\n\n if (command && this._isLocked) {\n this.pushRedoStack(command, true);\n command = null;\n }\n if (command) {\n if (this.isEmptyRedoStack()) {\n this._fireRedoStackChanged();\n }\n promise = this._invokeExecution(command, true);\n } else {\n message = rejectMessages.redo;\n if (this._isLocked) {\n message = `${message} Because ${rejectMessages.isLock}`;\n }\n promise = Promise.reject(message);\n }\n\n return promise;\n }\n\n /**\n * Push undo stack\n * @param {Command} command - command\n * @param {boolean} [isSilent] - Fire event or not\n */\n pushUndoStack(command, isSilent) {\n this._undoStack.push(command);\n if (!isSilent) {\n this._fireUndoStackChanged();\n }\n }\n\n /**\n * Push redo stack\n * @param {Command} command - command\n * @param {boolean} [isSilent] - Fire event or not\n */\n pushRedoStack(command, isSilent) {\n this._redoStack.push(command);\n if (!isSilent) {\n this._fireRedoStackChanged();\n }\n }\n\n /**\n * Return whether the redoStack is empty\n * @returns {boolean}\n */\n isEmptyRedoStack() {\n return this._redoStack.length === 0;\n }\n\n /**\n * Return whether the undoStack is empty\n * @returns {boolean}\n */\n isEmptyUndoStack() {\n return this._undoStack.length === 0;\n }\n\n /**\n * Clear undoStack\n */\n clearUndoStack() {\n if (!this.isEmptyUndoStack()) {\n this._undoStack = [];\n this._fireUndoStackChanged();\n }\n }\n\n /**\n * Clear redoStack\n */\n clearRedoStack() {\n if (!this.isEmptyRedoStack()) {\n this._redoStack = [];\n this._fireRedoStackChanged();\n }\n }\n}\n\nCustomEvents.mixin(Invoker);\n\nexport default Invoker;\n","/**\n * @author NHN. FE Development Team \n * @fileoverview Command interface\n */\nimport snippet from 'tui-code-snippet';\nimport errorMessage from '@/factory/errorMessage';\n\nconst createMessage = errorMessage.create;\nconst errorTypes = errorMessage.types;\n\n/**\n * Command class\n * @class\n * @param {{name:function, execute: function, undo: function,\n * executeCallback: function, undoCallback: function}} actions - Command actions\n * @param {Array} args - passing arguments on execute, undo\n * @ignore\n */\nclass Command {\n constructor(actions, args) {\n /**\n * command name\n * @type {string}\n */\n this.name = actions.name;\n\n /**\n * arguments\n * @type {Array}\n */\n this.args = args;\n\n /**\n * Execute function\n * @type {function}\n */\n this.execute = actions.execute;\n\n /**\n * Undo function\n * @type {function}\n */\n this.undo = actions.undo;\n\n /**\n * executeCallback\n * @type {function}\n */\n this.executeCallback = actions.executeCallback || null;\n\n /**\n * undoCallback\n * @type {function}\n */\n this.undoCallback = actions.undoCallback || null;\n\n /**\n * data for undo\n * @type {Object}\n */\n this.undoData = {};\n }\n\n /**\n * Execute action\n * @param {Object.} compMap - Components injection\n * @abstract\n */\n execute() {\n throw new Error(createMessage(errorTypes.UN_IMPLEMENTATION, 'execute'));\n }\n\n /**\n * Undo action\n * @param {Object.} compMap - Components injection\n * @abstract\n */\n undo() {\n throw new Error(createMessage(errorTypes.UN_IMPLEMENTATION, 'undo'));\n }\n\n /**\n * command for redo if undoData exists\n * @returns {boolean} isRedo\n */\n get isRedo() {\n return Object.keys(this.undoData).length > 0;\n }\n\n /**\n * Set undoData action\n * @param {Object} undoData - maked undo data\n * @param {Object} cachedUndoDataForSilent - cached undo data\n * @param {boolean} isSilent - is silent execution or not\n * @returns {Object} cachedUndoDataForSilent\n */\n setUndoData(undoData, cachedUndoDataForSilent, isSilent) {\n if (cachedUndoDataForSilent) {\n undoData = cachedUndoDataForSilent;\n }\n\n if (!isSilent) {\n snippet.extend(this.undoData, undoData);\n cachedUndoDataForSilent = null;\n } else if (!cachedUndoDataForSilent) {\n cachedUndoDataForSilent = undoData;\n }\n\n return cachedUndoDataForSilent;\n }\n\n /**\n * Attach execute callabck\n * @param {function} callback - Callback after execution\n * @returns {Command} this\n */\n setExecuteCallback(callback) {\n this.executeCallback = callback;\n\n return this;\n }\n\n /**\n * Attach undo callback\n * @param {function} callback - Callback after undo\n * @returns {Command} this\n */\n setUndoCallback(callback) {\n this.undoCallback = callback;\n\n return this;\n }\n}\n\nexport default Command;\n","var parent = require('../../es/promise');\nrequire('../../modules/esnext.aggregate-error');\n// TODO: Remove from `core-js@4`\nrequire('../../modules/esnext.promise.all-settled');\nrequire('../../modules/esnext.promise.try');\nrequire('../../modules/esnext.promise.any');\n\nmodule.exports = parent;\n","require('../../modules/es.object.to-string');\nrequire('../../modules/es.string.iterator');\nrequire('../../modules/web.dom-collections.iterator');\nrequire('../../modules/es.promise');\nrequire('../../modules/es.promise.all-settled');\nrequire('../../modules/es.promise.finally');\nvar path = require('../../internals/path');\n\nmodule.exports = path.Promise;\n","'use strict';\nvar charAt = require('../internals/string-multibyte').charAt;\nvar InternalStateModule = require('../internals/internal-state');\nvar defineIterator = require('../internals/define-iterator');\n\nvar STRING_ITERATOR = 'String Iterator';\nvar setInternalState = InternalStateModule.set;\nvar getInternalState = InternalStateModule.getterFor(STRING_ITERATOR);\n\n// `String.prototype[@@iterator]` method\n// https://tc39.github.io/ecma262/#sec-string.prototype-@@iterator\ndefineIterator(String, 'String', function (iterated) {\n setInternalState(this, {\n type: STRING_ITERATOR,\n string: String(iterated),\n index: 0\n });\n// `%StringIteratorPrototype%.next` method\n// https://tc39.github.io/ecma262/#sec-%stringiteratorprototype%.next\n}, function next() {\n var state = getInternalState(this);\n var string = state.string;\n var index = state.index;\n var point;\n if (index >= string.length) return { value: undefined, done: true };\n point = charAt(string, index);\n state.index += point.length;\n return { value: point, done: false };\n});\n","var toInteger = require('../internals/to-integer');\nvar requireObjectCoercible = require('../internals/require-object-coercible');\n\n// `String.prototype.{ codePointAt, at }` methods implementation\nvar createMethod = function (CONVERT_TO_STRING) {\n return function ($this, pos) {\n var S = String(requireObjectCoercible($this));\n var position = toInteger(pos);\n var size = S.length;\n var first, second;\n if (position < 0 || position >= size) return CONVERT_TO_STRING ? '' : undefined;\n first = S.charCodeAt(position);\n return first < 0xD800 || first > 0xDBFF || position + 1 === size\n || (second = S.charCodeAt(position + 1)) < 0xDC00 || second > 0xDFFF\n ? CONVERT_TO_STRING ? S.charAt(position) : first\n : CONVERT_TO_STRING ? S.slice(position, position + 2) : (first - 0xD800 << 10) + (second - 0xDC00) + 0x10000;\n };\n};\n\nmodule.exports = {\n // `String.prototype.codePointAt` method\n // https://tc39.github.io/ecma262/#sec-string.prototype.codepointat\n codeAt: createMethod(false),\n // `String.prototype.at` method\n // https://github.com/mathiasbynens/String.prototype.at\n charAt: createMethod(true)\n};\n","var global = require('../internals/global');\nvar inspectSource = require('../internals/inspect-source');\n\nvar WeakMap = global.WeakMap;\n\nmodule.exports = typeof WeakMap === 'function' && /native code/.test(inspectSource(WeakMap));\n","var g;\n\n// This works in non-strict mode\ng = (function() {\n\treturn this;\n})();\n\ntry {\n\t// This works if eval is allowed (see CSP)\n\tg = g || new Function(\"return this\")();\n} catch (e) {\n\t// This works if the window reference is available\n\tif (typeof window === \"object\") g = window;\n}\n\n// g can still be undefined, but nothing to do about it...\n// We return undefined, instead of nothing here, so it's\n// easier to handle this case. if(!global) { ...}\n\nmodule.exports = g;\n","var global = require('../internals/global');\nvar createNonEnumerableProperty = require('../internals/create-non-enumerable-property');\n\nmodule.exports = function (key, value) {\n try {\n createNonEnumerableProperty(global, key, value);\n } catch (error) {\n global[key] = value;\n } return value;\n};\n","'use strict';\nvar nativePropertyIsEnumerable = {}.propertyIsEnumerable;\nvar getOwnPropertyDescriptor = Object.getOwnPropertyDescriptor;\n\n// Nashorn ~ JDK8 bug\nvar NASHORN_BUG = getOwnPropertyDescriptor && !nativePropertyIsEnumerable.call({ 1: 2 }, 1);\n\n// `Object.prototype.propertyIsEnumerable` method implementation\n// https://tc39.github.io/ecma262/#sec-object.prototype.propertyisenumerable\nexports.f = NASHORN_BUG ? function propertyIsEnumerable(V) {\n var descriptor = getOwnPropertyDescriptor(this, V);\n return !!descriptor && descriptor.enumerable;\n} : nativePropertyIsEnumerable;\n","var fails = require('../internals/fails');\nvar classof = require('../internals/classof-raw');\n\nvar split = ''.split;\n\n// fallback for non-array-like ES3 and non-enumerable old V8 strings\nmodule.exports = fails(function () {\n // throws an error in rhino, see https://github.com/mozilla/rhino/issues/346\n // eslint-disable-next-line no-prototype-builtins\n return !Object('z').propertyIsEnumerable(0);\n}) ? function (it) {\n return classof(it) == 'String' ? split.call(it, '') : Object(it);\n} : Object;\n","'use strict';\nvar IteratorPrototype = require('../internals/iterators-core').IteratorPrototype;\nvar create = require('../internals/object-create');\nvar createPropertyDescriptor = require('../internals/create-property-descriptor');\nvar setToStringTag = require('../internals/set-to-string-tag');\nvar Iterators = require('../internals/iterators');\n\nvar returnThis = function () { return this; };\n\nmodule.exports = function (IteratorConstructor, NAME, next) {\n var TO_STRING_TAG = NAME + ' Iterator';\n IteratorConstructor.prototype = create(IteratorPrototype, { next: createPropertyDescriptor(1, next) });\n setToStringTag(IteratorConstructor, TO_STRING_TAG, false, true);\n Iterators[TO_STRING_TAG] = returnThis;\n return IteratorConstructor;\n};\n","var requireObjectCoercible = require('../internals/require-object-coercible');\n\n// `ToObject` abstract operation\n// https://tc39.github.io/ecma262/#sec-toobject\nmodule.exports = function (argument) {\n return Object(requireObjectCoercible(argument));\n};\n","var fails = require('../internals/fails');\n\nmodule.exports = !fails(function () {\n function F() { /* empty */ }\n F.prototype.constructor = null;\n return Object.getPrototypeOf(new F()) !== F.prototype;\n});\n","var NATIVE_SYMBOL = require('../internals/native-symbol');\n\nmodule.exports = NATIVE_SYMBOL\n // eslint-disable-next-line no-undef\n && !Symbol.sham\n // eslint-disable-next-line no-undef\n && typeof Symbol.iterator == 'symbol';\n","var DESCRIPTORS = require('../internals/descriptors');\nvar definePropertyModule = require('../internals/object-define-property');\nvar anObject = require('../internals/an-object');\nvar objectKeys = require('../internals/object-keys');\n\n// `Object.defineProperties` method\n// https://tc39.github.io/ecma262/#sec-object.defineproperties\nmodule.exports = DESCRIPTORS ? Object.defineProperties : function defineProperties(O, Properties) {\n anObject(O);\n var keys = objectKeys(Properties);\n var length = keys.length;\n var index = 0;\n var key;\n while (length > index) definePropertyModule.f(O, key = keys[index++], Properties[key]);\n return O;\n};\n","var internalObjectKeys = require('../internals/object-keys-internal');\nvar enumBugKeys = require('../internals/enum-bug-keys');\n\n// `Object.keys` method\n// https://tc39.github.io/ecma262/#sec-object.keys\nmodule.exports = Object.keys || function keys(O) {\n return internalObjectKeys(O, enumBugKeys);\n};\n","var has = require('../internals/has');\nvar toIndexedObject = require('../internals/to-indexed-object');\nvar indexOf = require('../internals/array-includes').indexOf;\nvar hiddenKeys = require('../internals/hidden-keys');\n\nmodule.exports = function (object, names) {\n var O = toIndexedObject(object);\n var i = 0;\n var result = [];\n var key;\n for (key in O) !has(hiddenKeys, key) && has(O, key) && result.push(key);\n // Don't enum bug & hidden keys\n while (names.length > i) if (has(O, key = names[i++])) {\n ~indexOf(result, key) || result.push(key);\n }\n return result;\n};\n","var toIndexedObject = require('../internals/to-indexed-object');\nvar toLength = require('../internals/to-length');\nvar toAbsoluteIndex = require('../internals/to-absolute-index');\n\n// `Array.prototype.{ indexOf, includes }` methods implementation\nvar createMethod = function (IS_INCLUDES) {\n return function ($this, el, fromIndex) {\n var O = toIndexedObject($this);\n var length = toLength(O.length);\n var index = toAbsoluteIndex(fromIndex, length);\n var value;\n // Array#includes uses SameValueZero equality algorithm\n // eslint-disable-next-line no-self-compare\n if (IS_INCLUDES && el != el) while (length > index) {\n value = O[index++];\n // eslint-disable-next-line no-self-compare\n if (value != value) return true;\n // Array#indexOf ignores holes, Array#includes - not\n } else for (;length > index; index++) {\n if ((IS_INCLUDES || index in O) && O[index] === el) return IS_INCLUDES || index || 0;\n } return !IS_INCLUDES && -1;\n };\n};\n\nmodule.exports = {\n // `Array.prototype.includes` method\n // https://tc39.github.io/ecma262/#sec-array.prototype.includes\n includes: createMethod(true),\n // `Array.prototype.indexOf` method\n // https://tc39.github.io/ecma262/#sec-array.prototype.indexof\n indexOf: createMethod(false)\n};\n","var toInteger = require('../internals/to-integer');\n\nvar max = Math.max;\nvar min = Math.min;\n\n// Helper for a popular repeating case of the spec:\n// Let integer be ? ToInteger(index).\n// If integer < 0, let result be max((length + integer), 0); else let result be min(integer, length).\nmodule.exports = function (index, length) {\n var integer = toInteger(index);\n return integer < 0 ? max(integer + length, 0) : min(integer, length);\n};\n","'use strict';\nvar TO_STRING_TAG_SUPPORT = require('../internals/to-string-tag-support');\nvar classof = require('../internals/classof');\n\n// `Object.prototype.toString` method implementation\n// https://tc39.github.io/ecma262/#sec-object.prototype.tostring\nmodule.exports = TO_STRING_TAG_SUPPORT ? {}.toString : function toString() {\n return '[object ' + classof(this) + ']';\n};\n","var isObject = require('../internals/is-object');\n\nmodule.exports = function (it) {\n if (!isObject(it) && it !== null) {\n throw TypeError(\"Can't set \" + String(it) + ' as a prototype');\n } return it;\n};\n","require('./es.array.iterator');\nvar DOMIterables = require('../internals/dom-iterables');\nvar global = require('../internals/global');\nvar classof = require('../internals/classof');\nvar createNonEnumerableProperty = require('../internals/create-non-enumerable-property');\nvar Iterators = require('../internals/iterators');\nvar wellKnownSymbol = require('../internals/well-known-symbol');\n\nvar TO_STRING_TAG = wellKnownSymbol('toStringTag');\n\nfor (var COLLECTION_NAME in DOMIterables) {\n var Collection = global[COLLECTION_NAME];\n var CollectionPrototype = Collection && Collection.prototype;\n if (CollectionPrototype && classof(CollectionPrototype) !== TO_STRING_TAG) {\n createNonEnumerableProperty(CollectionPrototype, TO_STRING_TAG, COLLECTION_NAME);\n }\n Iterators[COLLECTION_NAME] = Iterators.Array;\n}\n","'use strict';\nvar toIndexedObject = require('../internals/to-indexed-object');\nvar addToUnscopables = require('../internals/add-to-unscopables');\nvar Iterators = require('../internals/iterators');\nvar InternalStateModule = require('../internals/internal-state');\nvar defineIterator = require('../internals/define-iterator');\n\nvar ARRAY_ITERATOR = 'Array Iterator';\nvar setInternalState = InternalStateModule.set;\nvar getInternalState = InternalStateModule.getterFor(ARRAY_ITERATOR);\n\n// `Array.prototype.entries` method\n// https://tc39.github.io/ecma262/#sec-array.prototype.entries\n// `Array.prototype.keys` method\n// https://tc39.github.io/ecma262/#sec-array.prototype.keys\n// `Array.prototype.values` method\n// https://tc39.github.io/ecma262/#sec-array.prototype.values\n// `Array.prototype[@@iterator]` method\n// https://tc39.github.io/ecma262/#sec-array.prototype-@@iterator\n// `CreateArrayIterator` internal method\n// https://tc39.github.io/ecma262/#sec-createarrayiterator\nmodule.exports = defineIterator(Array, 'Array', function (iterated, kind) {\n setInternalState(this, {\n type: ARRAY_ITERATOR,\n target: toIndexedObject(iterated), // target\n index: 0, // next index\n kind: kind // kind\n });\n// `%ArrayIteratorPrototype%.next` method\n// https://tc39.github.io/ecma262/#sec-%arrayiteratorprototype%.next\n}, function () {\n var state = getInternalState(this);\n var target = state.target;\n var kind = state.kind;\n var index = state.index++;\n if (!target || index >= target.length) {\n state.target = undefined;\n return { value: undefined, done: true };\n }\n if (kind == 'keys') return { value: index, done: false };\n if (kind == 'values') return { value: target[index], done: false };\n return { value: [index, target[index]], done: false };\n}, 'values');\n\n// argumentsList[@@iterator] is %ArrayProto_values%\n// https://tc39.github.io/ecma262/#sec-createunmappedargumentsobject\n// https://tc39.github.io/ecma262/#sec-createmappedargumentsobject\nIterators.Arguments = Iterators.Array;\n\n// https://tc39.github.io/ecma262/#sec-array.prototype-@@unscopables\naddToUnscopables('keys');\naddToUnscopables('values');\naddToUnscopables('entries');\n","module.exports = function () { /* empty */ };\n","// iterable DOM collections\n// flag - `iterable` interface - 'entries', 'keys', 'values', 'forEach' methods\nmodule.exports = {\n CSSRuleList: 0,\n CSSStyleDeclaration: 0,\n CSSValueList: 0,\n ClientRectList: 0,\n DOMRectList: 0,\n DOMStringList: 0,\n DOMTokenList: 1,\n DataTransferItemList: 0,\n FileList: 0,\n HTMLAllCollection: 0,\n HTMLCollection: 0,\n HTMLFormElement: 0,\n HTMLSelectElement: 0,\n MediaList: 0,\n MimeTypeArray: 0,\n NamedNodeMap: 0,\n NodeList: 1,\n PaintRequestList: 0,\n Plugin: 0,\n PluginArray: 0,\n SVGLengthList: 0,\n SVGNumberList: 0,\n SVGPathSegList: 0,\n SVGPointList: 0,\n SVGStringList: 0,\n SVGTransformList: 0,\n SourceBufferList: 0,\n StyleSheetList: 0,\n TextTrackCueList: 0,\n TextTrackList: 0,\n TouchList: 0\n};\n","'use strict';\nvar $ = require('../internals/export');\nvar IS_PURE = require('../internals/is-pure');\nvar global = require('../internals/global');\nvar getBuiltIn = require('../internals/get-built-in');\nvar NativePromise = require('../internals/native-promise-constructor');\nvar redefine = require('../internals/redefine');\nvar redefineAll = require('../internals/redefine-all');\nvar setToStringTag = require('../internals/set-to-string-tag');\nvar setSpecies = require('../internals/set-species');\nvar isObject = require('../internals/is-object');\nvar aFunction = require('../internals/a-function');\nvar anInstance = require('../internals/an-instance');\nvar classof = require('../internals/classof-raw');\nvar inspectSource = require('../internals/inspect-source');\nvar iterate = require('../internals/iterate');\nvar checkCorrectnessOfIteration = require('../internals/check-correctness-of-iteration');\nvar speciesConstructor = require('../internals/species-constructor');\nvar task = require('../internals/task').set;\nvar microtask = require('../internals/microtask');\nvar promiseResolve = require('../internals/promise-resolve');\nvar hostReportErrors = require('../internals/host-report-errors');\nvar newPromiseCapabilityModule = require('../internals/new-promise-capability');\nvar perform = require('../internals/perform');\nvar InternalStateModule = require('../internals/internal-state');\nvar isForced = require('../internals/is-forced');\nvar wellKnownSymbol = require('../internals/well-known-symbol');\nvar V8_VERSION = require('../internals/engine-v8-version');\n\nvar SPECIES = wellKnownSymbol('species');\nvar PROMISE = 'Promise';\nvar getInternalState = InternalStateModule.get;\nvar setInternalState = InternalStateModule.set;\nvar getInternalPromiseState = InternalStateModule.getterFor(PROMISE);\nvar PromiseConstructor = NativePromise;\nvar TypeError = global.TypeError;\nvar document = global.document;\nvar process = global.process;\nvar $fetch = getBuiltIn('fetch');\nvar newPromiseCapability = newPromiseCapabilityModule.f;\nvar newGenericPromiseCapability = newPromiseCapability;\nvar IS_NODE = classof(process) == 'process';\nvar DISPATCH_EVENT = !!(document && document.createEvent && global.dispatchEvent);\nvar UNHANDLED_REJECTION = 'unhandledrejection';\nvar REJECTION_HANDLED = 'rejectionhandled';\nvar PENDING = 0;\nvar FULFILLED = 1;\nvar REJECTED = 2;\nvar HANDLED = 1;\nvar UNHANDLED = 2;\nvar Internal, OwnPromiseCapability, PromiseWrapper, nativeThen;\n\nvar FORCED = isForced(PROMISE, function () {\n var GLOBAL_CORE_JS_PROMISE = inspectSource(PromiseConstructor) !== String(PromiseConstructor);\n if (!GLOBAL_CORE_JS_PROMISE) {\n // V8 6.6 (Node 10 and Chrome 66) have a bug with resolving custom thenables\n // https://bugs.chromium.org/p/chromium/issues/detail?id=830565\n // We can't detect it synchronously, so just check versions\n if (V8_VERSION === 66) return true;\n // Unhandled rejections tracking support, NodeJS Promise without it fails @@species test\n if (!IS_NODE && typeof PromiseRejectionEvent != 'function') return true;\n }\n // We need Promise#finally in the pure version for preventing prototype pollution\n if (IS_PURE && !PromiseConstructor.prototype['finally']) return true;\n // We can't use @@species feature detection in V8 since it causes\n // deoptimization and performance degradation\n // https://github.com/zloirock/core-js/issues/679\n if (V8_VERSION >= 51 && /native code/.test(PromiseConstructor)) return false;\n // Detect correctness of subclassing with @@species support\n var promise = PromiseConstructor.resolve(1);\n var FakePromise = function (exec) {\n exec(function () { /* empty */ }, function () { /* empty */ });\n };\n var constructor = promise.constructor = {};\n constructor[SPECIES] = FakePromise;\n return !(promise.then(function () { /* empty */ }) instanceof FakePromise);\n});\n\nvar INCORRECT_ITERATION = FORCED || !checkCorrectnessOfIteration(function (iterable) {\n PromiseConstructor.all(iterable)['catch'](function () { /* empty */ });\n});\n\n// helpers\nvar isThenable = function (it) {\n var then;\n return isObject(it) && typeof (then = it.then) == 'function' ? then : false;\n};\n\nvar notify = function (promise, state, isReject) {\n if (state.notified) return;\n state.notified = true;\n var chain = state.reactions;\n microtask(function () {\n var value = state.value;\n var ok = state.state == FULFILLED;\n var index = 0;\n // variable length - can't use forEach\n while (chain.length > index) {\n var reaction = chain[index++];\n var handler = ok ? reaction.ok : reaction.fail;\n var resolve = reaction.resolve;\n var reject = reaction.reject;\n var domain = reaction.domain;\n var result, then, exited;\n try {\n if (handler) {\n if (!ok) {\n if (state.rejection === UNHANDLED) onHandleUnhandled(promise, state);\n state.rejection = HANDLED;\n }\n if (handler === true) result = value;\n else {\n if (domain) domain.enter();\n result = handler(value); // can throw\n if (domain) {\n domain.exit();\n exited = true;\n }\n }\n if (result === reaction.promise) {\n reject(TypeError('Promise-chain cycle'));\n } else if (then = isThenable(result)) {\n then.call(result, resolve, reject);\n } else resolve(result);\n } else reject(value);\n } catch (error) {\n if (domain && !exited) domain.exit();\n reject(error);\n }\n }\n state.reactions = [];\n state.notified = false;\n if (isReject && !state.rejection) onUnhandled(promise, state);\n });\n};\n\nvar dispatchEvent = function (name, promise, reason) {\n var event, handler;\n if (DISPATCH_EVENT) {\n event = document.createEvent('Event');\n event.promise = promise;\n event.reason = reason;\n event.initEvent(name, false, true);\n global.dispatchEvent(event);\n } else event = { promise: promise, reason: reason };\n if (handler = global['on' + name]) handler(event);\n else if (name === UNHANDLED_REJECTION) hostReportErrors('Unhandled promise rejection', reason);\n};\n\nvar onUnhandled = function (promise, state) {\n task.call(global, function () {\n var value = state.value;\n var IS_UNHANDLED = isUnhandled(state);\n var result;\n if (IS_UNHANDLED) {\n result = perform(function () {\n if (IS_NODE) {\n process.emit('unhandledRejection', value, promise);\n } else dispatchEvent(UNHANDLED_REJECTION, promise, value);\n });\n // Browsers should not trigger `rejectionHandled` event if it was handled here, NodeJS - should\n state.rejection = IS_NODE || isUnhandled(state) ? UNHANDLED : HANDLED;\n if (result.error) throw result.value;\n }\n });\n};\n\nvar isUnhandled = function (state) {\n return state.rejection !== HANDLED && !state.parent;\n};\n\nvar onHandleUnhandled = function (promise, state) {\n task.call(global, function () {\n if (IS_NODE) {\n process.emit('rejectionHandled', promise);\n } else dispatchEvent(REJECTION_HANDLED, promise, state.value);\n });\n};\n\nvar bind = function (fn, promise, state, unwrap) {\n return function (value) {\n fn(promise, state, value, unwrap);\n };\n};\n\nvar internalReject = function (promise, state, value, unwrap) {\n if (state.done) return;\n state.done = true;\n if (unwrap) state = unwrap;\n state.value = value;\n state.state = REJECTED;\n notify(promise, state, true);\n};\n\nvar internalResolve = function (promise, state, value, unwrap) {\n if (state.done) return;\n state.done = true;\n if (unwrap) state = unwrap;\n try {\n if (promise === value) throw TypeError(\"Promise can't be resolved itself\");\n var then = isThenable(value);\n if (then) {\n microtask(function () {\n var wrapper = { done: false };\n try {\n then.call(value,\n bind(internalResolve, promise, wrapper, state),\n bind(internalReject, promise, wrapper, state)\n );\n } catch (error) {\n internalReject(promise, wrapper, error, state);\n }\n });\n } else {\n state.value = value;\n state.state = FULFILLED;\n notify(promise, state, false);\n }\n } catch (error) {\n internalReject(promise, { done: false }, error, state);\n }\n};\n\n// constructor polyfill\nif (FORCED) {\n // 25.4.3.1 Promise(executor)\n PromiseConstructor = function Promise(executor) {\n anInstance(this, PromiseConstructor, PROMISE);\n aFunction(executor);\n Internal.call(this);\n var state = getInternalState(this);\n try {\n executor(bind(internalResolve, this, state), bind(internalReject, this, state));\n } catch (error) {\n internalReject(this, state, error);\n }\n };\n // eslint-disable-next-line no-unused-vars\n Internal = function Promise(executor) {\n setInternalState(this, {\n type: PROMISE,\n done: false,\n notified: false,\n parent: false,\n reactions: [],\n rejection: false,\n state: PENDING,\n value: undefined\n });\n };\n Internal.prototype = redefineAll(PromiseConstructor.prototype, {\n // `Promise.prototype.then` method\n // https://tc39.github.io/ecma262/#sec-promise.prototype.then\n then: function then(onFulfilled, onRejected) {\n var state = getInternalPromiseState(this);\n var reaction = newPromiseCapability(speciesConstructor(this, PromiseConstructor));\n reaction.ok = typeof onFulfilled == 'function' ? onFulfilled : true;\n reaction.fail = typeof onRejected == 'function' && onRejected;\n reaction.domain = IS_NODE ? process.domain : undefined;\n state.parent = true;\n state.reactions.push(reaction);\n if (state.state != PENDING) notify(this, state, false);\n return reaction.promise;\n },\n // `Promise.prototype.catch` method\n // https://tc39.github.io/ecma262/#sec-promise.prototype.catch\n 'catch': function (onRejected) {\n return this.then(undefined, onRejected);\n }\n });\n OwnPromiseCapability = function () {\n var promise = new Internal();\n var state = getInternalState(promise);\n this.promise = promise;\n this.resolve = bind(internalResolve, promise, state);\n this.reject = bind(internalReject, promise, state);\n };\n newPromiseCapabilityModule.f = newPromiseCapability = function (C) {\n return C === PromiseConstructor || C === PromiseWrapper\n ? new OwnPromiseCapability(C)\n : newGenericPromiseCapability(C);\n };\n\n if (!IS_PURE && typeof NativePromise == 'function') {\n nativeThen = NativePromise.prototype.then;\n\n // wrap native Promise#then for native async functions\n redefine(NativePromise.prototype, 'then', function then(onFulfilled, onRejected) {\n var that = this;\n return new PromiseConstructor(function (resolve, reject) {\n nativeThen.call(that, resolve, reject);\n }).then(onFulfilled, onRejected);\n // https://github.com/zloirock/core-js/issues/640\n }, { unsafe: true });\n\n // wrap fetch result\n if (typeof $fetch == 'function') $({ global: true, enumerable: true, forced: true }, {\n // eslint-disable-next-line no-unused-vars\n fetch: function fetch(input /* , init */) {\n return promiseResolve(PromiseConstructor, $fetch.apply(global, arguments));\n }\n });\n }\n}\n\n$({ global: true, wrap: true, forced: FORCED }, {\n Promise: PromiseConstructor\n});\n\nsetToStringTag(PromiseConstructor, PROMISE, false, true);\nsetSpecies(PROMISE);\n\nPromiseWrapper = getBuiltIn(PROMISE);\n\n// statics\n$({ target: PROMISE, stat: true, forced: FORCED }, {\n // `Promise.reject` method\n // https://tc39.github.io/ecma262/#sec-promise.reject\n reject: function reject(r) {\n var capability = newPromiseCapability(this);\n capability.reject.call(undefined, r);\n return capability.promise;\n }\n});\n\n$({ target: PROMISE, stat: true, forced: IS_PURE || FORCED }, {\n // `Promise.resolve` method\n // https://tc39.github.io/ecma262/#sec-promise.resolve\n resolve: function resolve(x) {\n return promiseResolve(IS_PURE && this === PromiseWrapper ? PromiseConstructor : this, x);\n }\n});\n\n$({ target: PROMISE, stat: true, forced: INCORRECT_ITERATION }, {\n // `Promise.all` method\n // https://tc39.github.io/ecma262/#sec-promise.all\n all: function all(iterable) {\n var C = this;\n var capability = newPromiseCapability(C);\n var resolve = capability.resolve;\n var reject = capability.reject;\n var result = perform(function () {\n var $promiseResolve = aFunction(C.resolve);\n var values = [];\n var counter = 0;\n var remaining = 1;\n iterate(iterable, function (promise) {\n var index = counter++;\n var alreadyCalled = false;\n values.push(undefined);\n remaining++;\n $promiseResolve.call(C, promise).then(function (value) {\n if (alreadyCalled) return;\n alreadyCalled = true;\n values[index] = value;\n --remaining || resolve(values);\n }, reject);\n });\n --remaining || resolve(values);\n });\n if (result.error) reject(result.value);\n return capability.promise;\n },\n // `Promise.race` method\n // https://tc39.github.io/ecma262/#sec-promise.race\n race: function race(iterable) {\n var C = this;\n var capability = newPromiseCapability(C);\n var reject = capability.reject;\n var result = perform(function () {\n var $promiseResolve = aFunction(C.resolve);\n iterate(iterable, function (promise) {\n $promiseResolve.call(C, promise).then(capability.resolve, reject);\n });\n });\n if (result.error) reject(result.value);\n return capability.promise;\n }\n});\n","var redefine = require('../internals/redefine');\n\nmodule.exports = function (target, src, options) {\n for (var key in src) {\n if (options && options.unsafe && target[key]) target[key] = src[key];\n else redefine(target, key, src[key], options);\n } return target;\n};\n","'use strict';\nvar getBuiltIn = require('../internals/get-built-in');\nvar definePropertyModule = require('../internals/object-define-property');\nvar wellKnownSymbol = require('../internals/well-known-symbol');\nvar DESCRIPTORS = require('../internals/descriptors');\n\nvar SPECIES = wellKnownSymbol('species');\n\nmodule.exports = function (CONSTRUCTOR_NAME) {\n var Constructor = getBuiltIn(CONSTRUCTOR_NAME);\n var defineProperty = definePropertyModule.f;\n\n if (DESCRIPTORS && Constructor && !Constructor[SPECIES]) {\n defineProperty(Constructor, SPECIES, {\n configurable: true,\n get: function () { return this; }\n });\n }\n};\n","module.exports = function (it, Constructor, name) {\n if (!(it instanceof Constructor)) {\n throw TypeError('Incorrect ' + (name ? name + ' ' : '') + 'invocation');\n } return it;\n};\n","var wellKnownSymbol = require('../internals/well-known-symbol');\nvar Iterators = require('../internals/iterators');\n\nvar ITERATOR = wellKnownSymbol('iterator');\nvar ArrayPrototype = Array.prototype;\n\n// check on default Array iterator\nmodule.exports = function (it) {\n return it !== undefined && (Iterators.Array === it || ArrayPrototype[ITERATOR] === it);\n};\n","var classof = require('../internals/classof');\nvar Iterators = require('../internals/iterators');\nvar wellKnownSymbol = require('../internals/well-known-symbol');\n\nvar ITERATOR = wellKnownSymbol('iterator');\n\nmodule.exports = function (it) {\n if (it != undefined) return it[ITERATOR]\n || it['@@iterator']\n || Iterators[classof(it)];\n};\n","var anObject = require('../internals/an-object');\n\n// call something on iterator step with safe closing on error\nmodule.exports = function (iterator, fn, value, ENTRIES) {\n try {\n return ENTRIES ? fn(anObject(value)[0], value[1]) : fn(value);\n // 7.4.6 IteratorClose(iterator, completion)\n } catch (error) {\n var returnMethod = iterator['return'];\n if (returnMethod !== undefined) anObject(returnMethod.call(iterator));\n throw error;\n }\n};\n","var wellKnownSymbol = require('../internals/well-known-symbol');\n\nvar ITERATOR = wellKnownSymbol('iterator');\nvar SAFE_CLOSING = false;\n\ntry {\n var called = 0;\n var iteratorWithReturn = {\n next: function () {\n return { done: !!called++ };\n },\n 'return': function () {\n SAFE_CLOSING = true;\n }\n };\n iteratorWithReturn[ITERATOR] = function () {\n return this;\n };\n // eslint-disable-next-line no-throw-literal\n Array.from(iteratorWithReturn, function () { throw 2; });\n} catch (error) { /* empty */ }\n\nmodule.exports = function (exec, SKIP_CLOSING) {\n if (!SKIP_CLOSING && !SAFE_CLOSING) return false;\n var ITERATION_SUPPORT = false;\n try {\n var object = {};\n object[ITERATOR] = function () {\n return {\n next: function () {\n return { done: ITERATION_SUPPORT = true };\n }\n };\n };\n exec(object);\n } catch (error) { /* empty */ }\n return ITERATION_SUPPORT;\n};\n","var global = require('../internals/global');\nvar getOwnPropertyDescriptor = require('../internals/object-get-own-property-descriptor').f;\nvar classof = require('../internals/classof-raw');\nvar macrotask = require('../internals/task').set;\nvar IS_IOS = require('../internals/engine-is-ios');\n\nvar MutationObserver = global.MutationObserver || global.WebKitMutationObserver;\nvar process = global.process;\nvar Promise = global.Promise;\nvar IS_NODE = classof(process) == 'process';\n// Node.js 11 shows ExperimentalWarning on getting `queueMicrotask`\nvar queueMicrotaskDescriptor = getOwnPropertyDescriptor(global, 'queueMicrotask');\nvar queueMicrotask = queueMicrotaskDescriptor && queueMicrotaskDescriptor.value;\n\nvar flush, head, last, notify, toggle, node, promise, then;\n\n// modern engines have queueMicrotask method\nif (!queueMicrotask) {\n flush = function () {\n var parent, fn;\n if (IS_NODE && (parent = process.domain)) parent.exit();\n while (head) {\n fn = head.fn;\n head = head.next;\n try {\n fn();\n } catch (error) {\n if (head) notify();\n else last = undefined;\n throw error;\n }\n } last = undefined;\n if (parent) parent.enter();\n };\n\n // Node.js\n if (IS_NODE) {\n notify = function () {\n process.nextTick(flush);\n };\n // browsers with MutationObserver, except iOS - https://github.com/zloirock/core-js/issues/339\n } else if (MutationObserver && !IS_IOS) {\n toggle = true;\n node = document.createTextNode('');\n new MutationObserver(flush).observe(node, { characterData: true });\n notify = function () {\n node.data = toggle = !toggle;\n };\n // environments with maybe non-completely correct, but existent Promise\n } else if (Promise && Promise.resolve) {\n // Promise.resolve without an argument throws an error in LG WebOS 2\n promise = Promise.resolve(undefined);\n then = promise.then;\n notify = function () {\n then.call(promise, flush);\n };\n // for other environments - macrotask based on:\n // - setImmediate\n // - MessageChannel\n // - window.postMessag\n // - onreadystatechange\n // - setTimeout\n } else {\n notify = function () {\n // strange IE + webpack dev server bug - use .call(global)\n macrotask.call(global, flush);\n };\n }\n}\n\nmodule.exports = queueMicrotask || function (fn) {\n var task = { fn: fn, next: undefined };\n if (last) last.next = task;\n if (!head) {\n head = task;\n notify();\n } last = task;\n};\n","var global = require('../internals/global');\n\nmodule.exports = function (a, b) {\n var console = global.console;\n if (console && console.error) {\n arguments.length === 1 ? console.error(a) : console.error(a, b);\n }\n};\n","var global = require('../internals/global');\nvar userAgent = require('../internals/engine-user-agent');\n\nvar process = global.process;\nvar versions = process && process.versions;\nvar v8 = versions && versions.v8;\nvar match, version;\n\nif (v8) {\n match = v8.split('.');\n version = match[0] + match[1];\n} else if (userAgent) {\n match = userAgent.match(/Edge\\/(\\d+)/);\n if (!match || match[1] >= 74) {\n match = userAgent.match(/Chrome\\/(\\d+)/);\n if (match) version = match[1];\n }\n}\n\nmodule.exports = version && +version;\n","'use strict';\nvar $ = require('../internals/export');\nvar IS_PURE = require('../internals/is-pure');\nvar NativePromise = require('../internals/native-promise-constructor');\nvar fails = require('../internals/fails');\nvar getBuiltIn = require('../internals/get-built-in');\nvar speciesConstructor = require('../internals/species-constructor');\nvar promiseResolve = require('../internals/promise-resolve');\nvar redefine = require('../internals/redefine');\n\n// Safari bug https://bugs.webkit.org/show_bug.cgi?id=200829\nvar NON_GENERIC = !!NativePromise && fails(function () {\n NativePromise.prototype['finally'].call({ then: function () { /* empty */ } }, function () { /* empty */ });\n});\n\n// `Promise.prototype.finally` method\n// https://tc39.github.io/ecma262/#sec-promise.prototype.finally\n$({ target: 'Promise', proto: true, real: true, forced: NON_GENERIC }, {\n 'finally': function (onFinally) {\n var C = speciesConstructor(this, getBuiltIn('Promise'));\n var isFunction = typeof onFinally == 'function';\n return this.then(\n isFunction ? function (x) {\n return promiseResolve(C, onFinally()).then(function () { return x; });\n } : onFinally,\n isFunction ? function (e) {\n return promiseResolve(C, onFinally()).then(function () { throw e; });\n } : onFinally\n );\n }\n});\n\n// patch native Promise.prototype for native async functions\nif (!IS_PURE && typeof NativePromise == 'function' && !NativePromise.prototype['finally']) {\n redefine(NativePromise.prototype, 'finally', getBuiltIn('Promise').prototype['finally']);\n}\n","'use strict';\nvar $ = require('../internals/export');\nvar DESCRIPTORS = require('../internals/descriptors');\nvar getPrototypeOf = require('../internals/object-get-prototype-of');\nvar setPrototypeOf = require('../internals/object-set-prototype-of');\nvar create = require('../internals/object-create');\nvar defineProperty = require('../internals/object-define-property');\nvar createPropertyDescriptor = require('../internals/create-property-descriptor');\nvar iterate = require('../internals/iterate');\nvar createNonEnumerableProperty = require('../internals/create-non-enumerable-property');\nvar InternalStateModule = require('../internals/internal-state');\n\nvar setInternalState = InternalStateModule.set;\nvar getInternalAggregateErrorState = InternalStateModule.getterFor('AggregateError');\n\nvar $AggregateError = function AggregateError(errors, message) {\n var that = this;\n if (!(that instanceof $AggregateError)) return new $AggregateError(errors, message);\n if (setPrototypeOf) {\n that = setPrototypeOf(new Error(message), getPrototypeOf(that));\n }\n var errorsArray = [];\n iterate(errors, errorsArray.push, errorsArray);\n if (DESCRIPTORS) setInternalState(that, { errors: errorsArray, type: 'AggregateError' });\n else that.errors = errorsArray;\n if (message !== undefined) createNonEnumerableProperty(that, 'message', String(message));\n return that;\n};\n\n$AggregateError.prototype = create(Error.prototype, {\n constructor: createPropertyDescriptor(5, $AggregateError),\n message: createPropertyDescriptor(5, ''),\n name: createPropertyDescriptor(5, 'AggregateError')\n});\n\nif (DESCRIPTORS) defineProperty.f($AggregateError.prototype, 'errors', {\n get: function () {\n return getInternalAggregateErrorState(this).errors;\n },\n configurable: true\n});\n\n$({ global: true }, {\n AggregateError: $AggregateError\n});\n","// TODO: Remove from `core-js@4`\nrequire('./es.promise.all-settled.js');\n","'use strict';\nvar $ = require('../internals/export');\nvar newPromiseCapabilityModule = require('../internals/new-promise-capability');\nvar perform = require('../internals/perform');\n\n// `Promise.try` method\n// https://github.com/tc39/proposal-promise-try\n$({ target: 'Promise', stat: true }, {\n 'try': function (callbackfn) {\n var promiseCapability = newPromiseCapabilityModule.f(this);\n var result = perform(callbackfn);\n (result.error ? promiseCapability.reject : promiseCapability.resolve)(result.value);\n return promiseCapability.promise;\n }\n});\n","'use strict';\nvar $ = require('../internals/export');\nvar aFunction = require('../internals/a-function');\nvar getBuiltIn = require('../internals/get-built-in');\nvar newPromiseCapabilityModule = require('../internals/new-promise-capability');\nvar perform = require('../internals/perform');\nvar iterate = require('../internals/iterate');\n\nvar PROMISE_ANY_ERROR = 'No one promise resolved';\n\n// `Promise.any` method\n// https://github.com/tc39/proposal-promise-any\n$({ target: 'Promise', stat: true }, {\n any: function any(iterable) {\n var C = this;\n var capability = newPromiseCapabilityModule.f(C);\n var resolve = capability.resolve;\n var reject = capability.reject;\n var result = perform(function () {\n var promiseResolve = aFunction(C.resolve);\n var errors = [];\n var counter = 0;\n var remaining = 1;\n var alreadyResolved = false;\n iterate(iterable, function (promise) {\n var index = counter++;\n var alreadyRejected = false;\n errors.push(undefined);\n remaining++;\n promiseResolve.call(C, promise).then(function (value) {\n if (alreadyRejected || alreadyResolved) return;\n alreadyResolved = true;\n resolve(value);\n }, function (e) {\n if (alreadyRejected || alreadyResolved) return;\n alreadyRejected = true;\n errors[index] = e;\n --remaining || reject(new (getBuiltIn('AggregateError'))(errors, PROMISE_ANY_ERROR));\n });\n });\n --remaining || reject(new (getBuiltIn('AggregateError'))(errors, PROMISE_ANY_ERROR));\n });\n if (result.error) reject(result.value);\n return capability.promise;\n }\n});\n","import snippet from 'tui-code-snippet';\nimport { getSelector, assignmentForDestroy, cls, getHistoryTitle, isSilentCommand } from '@/util';\nimport {\n ZOOM_HELP_MENUS,\n COMMAND_HELP_MENUS,\n DELETE_HELP_MENUS,\n eventNames,\n HELP_MENUS,\n} from '@/consts';\nimport mainContainer from '@/ui/template/mainContainer';\nimport controls from '@/ui/template/controls';\n\nimport Theme from '@/ui/theme/theme';\nimport Shape from '@/ui/shape';\nimport Crop from '@/ui/crop';\nimport Flip from '@/ui/flip';\nimport Rotate from '@/ui/rotate';\nimport Text from '@/ui/text';\nimport Mask from '@/ui/mask';\nimport Icon from '@/ui/icon';\nimport Draw from '@/ui/draw';\nimport Filter from '@/ui/filter';\nimport History from '@/ui/history';\nimport Locale from '@/ui/locale/locale';\n\nconst SUB_UI_COMPONENT = {\n Shape,\n Crop,\n Flip,\n Rotate,\n Text,\n Mask,\n Icon,\n Draw,\n Filter,\n};\n\nconst { CustomEvents } = snippet;\n\nconst BI_EXPRESSION_MINSIZE_WHEN_TOP_POSITION = '1300';\nconst HISTORY_MENU = 'history';\nconst HISTORY_PANEL_CLASS_NAME = 'tie-panel-history';\n\nconst CLASS_NAME_ON = 'on';\nconst ZOOM_BUTTON_TYPE = {\n ZOOM_IN: 'zoomIn',\n HAND: 'hand',\n};\n\n/**\n * Default UI Class\n * @class\n * @param {string|HTMLElement} element - Wrapper's element or selector\n * @param {Object} [options] - Ui setting options\n * @param {number} options.loadImage - Init default load image\n * @param {number} options.initMenu - Init start menu\n * @param {Boolean} [options.menuBarPosition=bottom] - Let\n * @param {Boolean} [options.applyCropSelectionStyle=false] - Let\n * @param {Boolean} [options.usageStatistics=false] - Use statistics or not\n * @param {Object} [options.uiSize] - ui size of editor\n * @param {string} options.uiSize.width - width of ui\n * @param {string} options.uiSize.height - height of ui\n * @param {Object} actions - ui action instance\n */\nclass Ui {\n constructor(element, options, actions) {\n this.options = this._initializeOption(options);\n this._actions = actions;\n this.submenu = false;\n this.imageSize = {};\n this.uiSize = {};\n this._locale = new Locale(this.options.locale);\n this.theme = new Theme(this.options.theme);\n this.eventHandler = {};\n this._submenuChangeTransection = false;\n this._selectedElement = null;\n this._mainElement = null;\n this._editorElementWrap = null;\n this._editorElement = null;\n this._menuBarElement = null;\n this._subMenuElement = null;\n this._makeUiElement(element);\n this._setUiSize();\n this._initMenuEvent = false;\n\n this._makeSubMenu();\n\n this._attachHistoryEvent();\n this._attachZoomEvent();\n }\n\n /**\n * Destroys the instance.\n */\n destroy() {\n this._removeUiEvent();\n this._destroyAllMenu();\n this._selectedElement.innerHTML = '';\n\n assignmentForDestroy(this);\n }\n\n /**\n * Set Default Selection for includeUI\n * @param {Object} option - imageEditor options\n * @returns {Object} - extends selectionStyle option\n * @ignore\n */\n setUiDefaultSelectionStyle(option) {\n return snippet.extend(\n {\n applyCropSelectionStyle: true,\n applyGroupSelectionStyle: true,\n selectionStyle: {\n cornerStyle: 'circle',\n cornerSize: 16,\n cornerColor: '#fff',\n cornerStrokeColor: '#fff',\n transparentCorners: false,\n lineWidth: 2,\n borderColor: '#fff',\n },\n },\n option\n );\n }\n\n /**\n * Change editor size\n * @param {Object} resizeInfo - ui & image size info\n * @param {Object} [resizeInfo.uiSize] - image size dimension\n * @param {string} resizeInfo.uiSize.width - ui width\n * @param {string} resizeInfo.uiSize.height - ui height\n * @param {Object} [resizeInfo.imageSize] - image size dimension\n * @param {Number} resizeInfo.imageSize.oldWidth - old width\n * @param {Number} resizeInfo.imageSize.oldHeight - old height\n * @param {Number} resizeInfo.imageSize.newWidth - new width\n * @param {Number} resizeInfo.imageSize.newHeight - new height\n * @example\n * // Change the image size and ui size, and change the affected ui state together.\n * imageEditor.ui.resizeEditor({\n * imageSize: {oldWidth: 100, oldHeight: 100, newWidth: 700, newHeight: 700},\n * uiSize: {width: 1000, height: 1000}\n * });\n * @example\n * // Apply the ui state while preserving the previous attribute (for example, if responsive Ui)\n * imageEditor.ui.resizeEditor();\n */\n resizeEditor({ uiSize, imageSize = this.imageSize } = {}) {\n if (imageSize !== this.imageSize) {\n this.imageSize = imageSize;\n }\n if (uiSize) {\n this._setUiSize(uiSize);\n }\n\n const { width, height } = this._getCanvasMaxDimension();\n const editorElementStyle = this._editorElement.style;\n const { menuBarPosition } = this.options;\n\n editorElementStyle.height = `${height}px`;\n editorElementStyle.width = `${width}px`;\n\n this._setEditorPosition(menuBarPosition);\n\n this._editorElementWrap.style.bottom = `0px`;\n this._editorElementWrap.style.top = `0px`;\n this._editorElementWrap.style.left = `0px`;\n this._editorElementWrap.style.width = `100%`;\n\n const selectElementClassList = this._selectedElement.classList;\n\n if (\n menuBarPosition === 'top' &&\n this._selectedElement.offsetWidth < BI_EXPRESSION_MINSIZE_WHEN_TOP_POSITION\n ) {\n selectElementClassList.add('tui-image-editor-top-optimization');\n } else {\n selectElementClassList.remove('tui-image-editor-top-optimization');\n }\n }\n\n /**\n * Toggle zoom button status\n * @param {string} type - type of zoom button\n */\n toggleZoomButtonStatus(type) {\n const targetClassList = this._buttonElements[type].classList;\n\n targetClassList.toggle(CLASS_NAME_ON);\n\n if (type === ZOOM_BUTTON_TYPE.ZOOM_IN) {\n this._buttonElements[ZOOM_BUTTON_TYPE.HAND].classList.remove(CLASS_NAME_ON);\n } else {\n this._buttonElements[ZOOM_BUTTON_TYPE.ZOOM_IN].classList.remove(CLASS_NAME_ON);\n }\n }\n\n /**\n * Turn off zoom-in button status\n */\n offZoomInButtonStatus() {\n const zoomInClassList = this._buttonElements[ZOOM_BUTTON_TYPE.ZOOM_IN].classList;\n\n zoomInClassList.remove(CLASS_NAME_ON);\n }\n\n /**\n * Change hand button status\n * @param {boolean} enabled - status to change\n */\n changeHandButtonStatus(enabled) {\n const handClassList = this._buttonElements[ZOOM_BUTTON_TYPE.HAND].classList;\n\n handClassList[enabled ? 'add' : 'remove'](CLASS_NAME_ON);\n }\n\n /**\n * Change help button status\n * @param {string} buttonType - target button type\n * @param {Boolean} enableStatus - enabled status\n * @ignore\n */\n changeHelpButtonEnabled(buttonType, enableStatus) {\n const buttonClassList = this._buttonElements[buttonType].classList;\n\n buttonClassList[enableStatus ? 'add' : 'remove']('enabled');\n }\n\n /**\n * Change delete button status\n * @param {Object} [options] - Ui setting options\n * @param {object} [options.loadImage] - Init default load image\n * @param {string} [options.initMenu] - Init start menu\n * @param {string} [options.menuBarPosition=bottom] - Let\n * @param {boolean} [options.applyCropSelectionStyle=false] - Let\n * @param {boolean} [options.usageStatistics=false] - Send statistics ping or not\n * @returns {Object} initialize option\n * @private\n */\n _initializeOption(options) {\n return snippet.extend(\n {\n loadImage: {\n path: '',\n name: '',\n },\n locale: {},\n menuIconPath: '',\n menu: ['crop', 'flip', 'rotate', 'draw', 'shape', 'icon', 'text', 'mask', 'filter'],\n initMenu: '',\n uiSize: {\n width: '100%',\n height: '100%',\n },\n menuBarPosition: 'bottom',\n },\n options\n );\n }\n\n /**\n * Set ui container size\n * @param {Object} uiSize - ui dimension\n * @param {string} uiSize.width - css width property\n * @param {string} uiSize.height - css height property\n * @private\n */\n _setUiSize(uiSize = this.options.uiSize) {\n const elementDimension = this._selectedElement.style;\n elementDimension.width = uiSize.width;\n elementDimension.height = uiSize.height;\n }\n\n /**\n * Make submenu dom element\n * @private\n */\n _makeSubMenu() {\n snippet.forEach(this.options.menu, (menuName) => {\n const SubComponentClass =\n SUB_UI_COMPONENT[menuName.replace(/^[a-z]/, ($0) => $0.toUpperCase())];\n\n // make menu element\n this._makeMenuElement(menuName);\n\n // menu btn element\n this._buttonElements[menuName] = this._menuBarElement.querySelector(`.tie-btn-${menuName}`);\n\n // submenu ui instance\n this[menuName] = new SubComponentClass(this._subMenuElement, {\n locale: this._locale,\n makeSvgIcon: this.theme.makeMenSvgIconSet.bind(this.theme),\n menuBarPosition: this.options.menuBarPosition,\n usageStatistics: this.options.usageStatistics,\n });\n });\n }\n\n /**\n * Attach history event\n * @private\n */\n _attachHistoryEvent() {\n this.on(eventNames.EXECUTE_COMMAND, this._addHistory.bind(this));\n this.on(eventNames.AFTER_UNDO, this._selectPrevHistory.bind(this));\n this.on(eventNames.AFTER_REDO, this._selectNextHistory.bind(this));\n }\n\n /**\n * Attach zoom event\n * @private\n */\n _attachZoomEvent() {\n this.on(eventNames.HAND_STARTED, () => {\n this.offZoomInButtonStatus();\n this.changeHandButtonStatus(true);\n });\n this.on(eventNames.HAND_STOPPED, () => this.changeHandButtonStatus(false));\n }\n\n /**\n * Make primary ui dom element\n * @param {string|HTMLElement} element - Wrapper's element or selector\n * @private\n */\n _makeUiElement(element) {\n let selectedElement;\n\n window.snippet = snippet;\n\n if (element.nodeType) {\n selectedElement = element;\n } else {\n selectedElement = document.querySelector(element);\n }\n const selector = getSelector(selectedElement);\n\n selectedElement.classList.add('tui-image-editor-container');\n selectedElement.innerHTML =\n controls({\n locale: this._locale,\n biImage: this.theme.getStyle('common.bi'),\n loadButtonStyle: this.theme.getStyle('loadButton'),\n downloadButtonStyle: this.theme.getStyle('downloadButton'),\n menuBarPosition: this.options.menuBarPosition,\n }) +\n mainContainer({\n locale: this._locale,\n biImage: this.theme.getStyle('common.bi'),\n commonStyle: this.theme.getStyle('common'),\n headerStyle: this.theme.getStyle('header'),\n loadButtonStyle: this.theme.getStyle('loadButton'),\n downloadButtonStyle: this.theme.getStyle('downloadButton'),\n submenuStyle: this.theme.getStyle('submenu'),\n });\n\n this._selectedElement = selectedElement;\n this._selectedElement.classList.add(this.options.menuBarPosition);\n\n this._mainElement = selector('.tui-image-editor-main');\n this._editorElementWrap = selector('.tui-image-editor-wrap');\n this._editorElement = selector('.tui-image-editor');\n this._helpMenuBarElement = selector('.tui-image-editor-help-menu');\n this._menuBarElement = selector('.tui-image-editor-menu');\n this._subMenuElement = selector('.tui-image-editor-submenu');\n this._buttonElements = {\n download: this._selectedElement.querySelectorAll('.tui-image-editor-download-btn'),\n load: this._selectedElement.querySelectorAll('.tui-image-editor-load-btn'),\n };\n\n this._addHelpMenus();\n\n this._historyMenu = new History(this._buttonElements[HISTORY_MENU], {\n locale: this._locale,\n makeSvgIcon: this.theme.makeMenSvgIconSet.bind(this.theme),\n });\n\n this._activateZoomMenus();\n }\n\n /**\n * Activate help menus for zoom.\n * @private\n */\n _activateZoomMenus() {\n snippet.forEach(ZOOM_HELP_MENUS, (menu) => {\n this.changeHelpButtonEnabled(menu, true);\n });\n }\n\n /**\n * make array for help menu output, including partitions.\n * @returns {Array}\n * @private\n */\n _makeHelpMenuWithPartition() {\n return [...ZOOM_HELP_MENUS, '', ...COMMAND_HELP_MENUS, '', ...DELETE_HELP_MENUS];\n }\n\n /**\n * Add help menu\n * @private\n */\n _addHelpMenus() {\n const helpMenuWithPartition = this._makeHelpMenuWithPartition();\n\n snippet.forEach(helpMenuWithPartition, (menuName) => {\n if (!menuName) {\n this._makeMenuPartitionElement();\n } else {\n this._makeMenuElement(menuName, ['normal', 'disabled', 'hover'], 'help');\n\n this._buttonElements[menuName] = this._helpMenuBarElement.querySelector(\n `.tie-btn-${menuName}`\n );\n }\n });\n }\n\n /**\n * Make menu partition element\n * @private\n */\n _makeMenuPartitionElement() {\n const partitionElement = document.createElement('li');\n const partitionInnerElement = document.createElement('div');\n partitionElement.className = cls('item');\n partitionInnerElement.className = cls('icpartition');\n partitionElement.appendChild(partitionInnerElement);\n\n this._helpMenuBarElement.appendChild(partitionElement);\n }\n\n /**\n * Make menu button element\n * @param {string} menuName - menu name\n * @param {Array} useIconTypes - Possible values are \\['normal', 'active', 'hover', 'disabled'\\]\n * @param {string} menuType - 'normal' or 'help'\n * @private\n */\n _makeMenuElement(menuName, useIconTypes = ['normal', 'active', 'hover'], menuType = 'normal') {\n const btnElement = document.createElement('li');\n const menuItemHtml = this.theme.makeMenSvgIconSet(useIconTypes, menuName);\n\n this._addTooltipAttribute(btnElement, menuName);\n btnElement.className = `tie-btn-${menuName} ${cls('item')} ${menuType}`;\n btnElement.innerHTML = menuItemHtml;\n\n if (menuType === 'normal') {\n this._menuBarElement.appendChild(btnElement);\n } else {\n this._helpMenuBarElement.appendChild(btnElement);\n }\n }\n\n /**\n * Add help action event\n * @private\n */\n _addHelpActionEvent() {\n snippet.forEach(HELP_MENUS, (helpName) => {\n this.eventHandler[helpName] = (event) => this._actions.main[helpName](event);\n this._buttonElements[helpName].addEventListener('click', this.eventHandler[helpName]);\n });\n }\n\n /**\n * Remove help action event\n * @private\n */\n _removeHelpActionEvent() {\n snippet.forEach(HELP_MENUS, (helpName) => {\n this._buttonElements[helpName].removeEventListener('click', this.eventHandler[helpName]);\n });\n }\n\n /**\n * Add history\n * @param {Command|string} command - command or command name\n */\n _addHistory(command) {\n if (!isSilentCommand(command)) {\n const historyTitle =\n typeof command === 'string' ? { name: command } : getHistoryTitle(command);\n\n this._historyMenu.add(historyTitle);\n }\n }\n\n /**\n * Init history\n */\n initHistory() {\n this._historyMenu.init();\n }\n\n /**\n * Clear history\n */\n clearHistory() {\n this._historyMenu.clear();\n }\n\n /**\n * Select prev history\n */\n _selectPrevHistory() {\n this._historyMenu.prev();\n }\n\n /**\n * Select next history\n */\n _selectNextHistory() {\n this._historyMenu.next();\n }\n\n /**\n * Toggle history menu\n * @param {object} event - event object\n */\n toggleHistoryMenu(event) {\n const { target } = event;\n const item = target.closest(`.${HISTORY_PANEL_CLASS_NAME}`);\n\n if (item) {\n return;\n }\n\n const historyButtonClassList = this._buttonElements[HISTORY_MENU].classList;\n\n historyButtonClassList.toggle('opened');\n }\n\n /**\n * Add attribute for menu tooltip\n * @param {HTMLElement} element - menu element\n * @param {string} tooltipName - tooltipName\n * @private\n */\n _addTooltipAttribute(element, tooltipName) {\n element.setAttribute(\n 'tooltip-content',\n this._locale.localize(tooltipName.replace(/^[a-z]/g, ($0) => $0.toUpperCase()))\n );\n }\n\n /**\n * Add download event\n * @private\n */\n _addDownloadEvent() {\n this.eventHandler.download = () => this._actions.main.download();\n snippet.forEach(this._buttonElements.download, (element) => {\n element.addEventListener('click', this.eventHandler.download);\n });\n }\n\n _removeDownloadEvent() {\n snippet.forEach(this._buttonElements.download, (element) => {\n element.removeEventListener('click', this.eventHandler.download);\n });\n }\n\n /**\n * Add load event\n * @private\n */\n _addLoadEvent() {\n this.eventHandler.loadImage = (event) => this._actions.main.load(event.target.files[0]);\n\n snippet.forEach(this._buttonElements.load, (element) => {\n element.addEventListener('change', this.eventHandler.loadImage);\n });\n }\n\n /**\n * Remove load event\n * @private\n */\n _removeLoadEvent() {\n snippet.forEach(this._buttonElements.load, (element) => {\n element.removeEventListener('change', this.eventHandler.loadImage);\n });\n }\n\n /**\n * Add menu event\n * @param {string} menuName - menu name\n * @private\n */\n _addMainMenuEvent(menuName) {\n this.eventHandler[menuName] = () => this.changeMenu(menuName);\n this._buttonElements[menuName].addEventListener('click', this.eventHandler[menuName]);\n }\n\n /**\n * Add menu event\n * @param {string} menuName - menu name\n * @private\n */\n _addSubMenuEvent(menuName) {\n this[menuName].addEvent(this._actions[menuName]);\n }\n\n /**\n * Add menu event\n * @private\n */\n _addMenuEvent() {\n snippet.forEach(this.options.menu, (menuName) => {\n this._addMainMenuEvent(menuName);\n this._addSubMenuEvent(menuName);\n });\n }\n\n /**\n * Remove menu event\n * @private\n */\n _removeMainMenuEvent() {\n snippet.forEach(this.options.menu, (menuName) => {\n this._buttonElements[menuName].removeEventListener('click', this.eventHandler[menuName]);\n });\n }\n\n /**\n * Get editor area element\n * @returns {HTMLElement} editor area html element\n * @ignore\n */\n getEditorArea() {\n return this._editorElement;\n }\n\n /**\n * Add event for menu items\n * @ignore\n */\n activeMenuEvent() {\n if (this._initMenuEvent) {\n return;\n }\n\n this._addHelpActionEvent();\n this._addDownloadEvent();\n this._addMenuEvent();\n this._initMenu();\n this._historyMenu.addEvent(this._actions.history);\n this._initMenuEvent = true;\n }\n\n /**\n * Remove ui event\n * @private\n */\n _removeUiEvent() {\n this._removeHelpActionEvent();\n this._removeDownloadEvent();\n this._removeLoadEvent();\n this._removeMainMenuEvent();\n this._historyMenu.removeEvent();\n }\n\n /**\n * Destroy all menu instance\n * @private\n */\n _destroyAllMenu() {\n snippet.forEach(this.options.menu, (menuName) => {\n this[menuName].destroy();\n });\n\n this._historyMenu.destroy();\n }\n\n /**\n * Init canvas\n * @ignore\n */\n initCanvas() {\n const loadImageInfo = this._getLoadImage();\n if (loadImageInfo.path) {\n this._actions.main.initLoadImage(loadImageInfo.path, loadImageInfo.name).then(() => {\n this.activeMenuEvent();\n });\n }\n\n this._addLoadEvent();\n\n const gridVisual = document.createElement('div');\n\n gridVisual.className = cls('grid-visual');\n const grid = `\n \n \n \n
                  `;\n gridVisual.innerHTML = grid;\n this._editorContainerElement = this._editorElement.querySelector(\n '.tui-image-editor-canvas-container'\n );\n this._editorContainerElement.appendChild(gridVisual);\n }\n\n /**\n * get editor area element\n * @returns {Object} load image option\n * @private\n */\n _getLoadImage() {\n return this.options.loadImage;\n }\n\n /**\n * change menu\n * @param {string} menuName - menu name\n * @param {boolean} toggle - whether toogle or not\n * @param {boolean} discardSelection - discard selection\n * @ignore\n */\n changeMenu(menuName, toggle = true, discardSelection = true) {\n if (!this._submenuChangeTransection) {\n this._submenuChangeTransection = true;\n this._changeMenu(menuName, toggle, discardSelection);\n this._submenuChangeTransection = false;\n }\n }\n\n /**\n * change menu\n * @param {string} menuName - menu name\n * @param {boolean} toggle - whether toggle or not\n * @param {boolean} discardSelection - discard selection\n * @private\n */\n _changeMenu(menuName, toggle, discardSelection) {\n if (this.submenu) {\n this._buttonElements[this.submenu].classList.remove('active');\n this._mainElement.classList.remove(`tui-image-editor-menu-${this.submenu}`);\n if (discardSelection) {\n this._actions.main.discardSelection();\n }\n this._actions.main.changeSelectableAll(true);\n this[this.submenu].changeStandbyMode();\n }\n\n if (this.submenu === menuName && toggle) {\n this.submenu = null;\n } else {\n this._buttonElements[menuName].classList.add('active');\n this._mainElement.classList.add(`tui-image-editor-menu-${menuName}`);\n this.submenu = menuName;\n this[this.submenu].changeStartMode();\n }\n\n this.resizeEditor();\n }\n\n /**\n * Init menu\n * @private\n */\n _initMenu() {\n if (this.options.initMenu) {\n const evt = document.createEvent('MouseEvents');\n evt.initEvent('click', true, false);\n this._buttonElements[this.options.initMenu].dispatchEvent(evt);\n }\n\n if (this.icon) {\n this.icon.registerDefaultIcon();\n }\n }\n\n /**\n * Get canvas max Dimension\n * @returns {Object} - width & height of editor\n * @private\n */\n _getCanvasMaxDimension() {\n const { maxWidth, maxHeight } = this._editorContainerElement.style;\n const width = parseFloat(maxWidth);\n const height = parseFloat(maxHeight);\n\n return {\n width,\n height,\n };\n }\n\n /**\n * Set editor position\n * @param {string} menuBarPosition - top or right or bottom or left\n * @private\n */\n // eslint-disable-next-line complexity\n _setEditorPosition(menuBarPosition) {\n const { width, height } = this._getCanvasMaxDimension();\n const editorElementStyle = this._editorElement.style;\n let top = 0;\n let left = 0;\n\n if (this.submenu) {\n if (menuBarPosition === 'bottom') {\n if (height > this._editorElementWrap.scrollHeight - 150) {\n top = (height - this._editorElementWrap.scrollHeight) / 2;\n } else {\n top = (150 / 2) * -1;\n }\n } else if (menuBarPosition === 'top') {\n if (height > this._editorElementWrap.offsetHeight - 150) {\n top = 150 / 2 - (height - (this._editorElementWrap.offsetHeight - 150)) / 2;\n } else {\n top = 150 / 2;\n }\n } else if (menuBarPosition === 'left') {\n if (width > this._editorElementWrap.offsetWidth - 248) {\n left = 248 / 2 - (width - (this._editorElementWrap.offsetWidth - 248)) / 2;\n } else {\n left = 248 / 2;\n }\n } else if (menuBarPosition === 'right') {\n if (width > this._editorElementWrap.scrollWidth - 248) {\n left = (width - this._editorElementWrap.scrollWidth) / 2;\n } else {\n left = (248 / 2) * -1;\n }\n }\n }\n editorElementStyle.top = `${top}px`;\n editorElementStyle.left = `${left}px`;\n }\n}\n\nCustomEvents.mixin(Ui);\n\nexport default Ui;\n","export default ({\n locale,\n biImage,\n commonStyle,\n headerStyle,\n loadButtonStyle,\n downloadButtonStyle,\n submenuStyle,\n}) => `\n
                  \n
                  \n
                  \n \n
                  \n
                  \n
                  \n ${locale.localize('Load')}\n \n
                  \n \n
                  \n
                  \n
                  \n
                  \n
                  \n
                  \n
                  \n
                  \n
                  \n
                  \n
                  \n
                  \n
                  \n
                  \n
                  \n`;\n","import { getHelpMenuBarPosition } from '@/util';\n\nexport default ({ locale, biImage, loadButtonStyle, downloadButtonStyle, menuBarPosition }) => `\n
                    \n
                    \n
                    \n \n
                    \n
                      \n\n
                      \n
                      \n ${locale.localize('Load')}\n \n
                      \n \n
                      \n
                      \n`;\n","import { extend, forEach, map } from 'tui-code-snippet';\nimport style from '@/ui/template/style';\nimport standardTheme from '@/ui/theme/standard';\nimport icon from '@svg/default.svg';\nimport { styleLoad } from '@/util';\n\n/**\n * Theme manager\n * @class\n * @param {Object} customTheme - custom theme\n * @ignore\n */\nclass Theme {\n constructor(customTheme) {\n this.styles = this._changeToObject(extend({}, standardTheme, customTheme));\n styleLoad(this._styleMaker());\n\n this._loadDefaultSvgIcon();\n }\n\n /**\n * Get a Style cssText or StyleObject\n * @param {string} type - style type\n * @returns {string|object} - cssText or StyleObject\n */\n // eslint-disable-next-line complexity\n getStyle(type) {\n let result = null;\n const firstProperty = type.replace(/\\..+$/, '');\n const option = this.styles[type];\n switch (type) {\n case 'common.bi':\n result = this.styles[type].image;\n break;\n case 'menu.icon':\n result = {\n active: this.styles[`${firstProperty}.activeIcon`],\n normal: this.styles[`${firstProperty}.normalIcon`],\n hover: this.styles[`${firstProperty}.hoverIcon`],\n disabled: this.styles[`${firstProperty}.disabledIcon`],\n };\n break;\n case 'submenu.icon':\n result = {\n active: this.styles[`${firstProperty}.activeIcon`],\n normal: this.styles[`${firstProperty}.normalIcon`],\n };\n break;\n case 'submenu.label':\n result = {\n active: this._makeCssText(this.styles[`${firstProperty}.activeLabel`]),\n normal: this._makeCssText(this.styles[`${firstProperty}.normalLabel`]),\n };\n break;\n case 'submenu.partition':\n result = {\n vertical: this._makeCssText(\n extend({}, option, { borderLeft: `1px solid ${option.color}` })\n ),\n horizontal: this._makeCssText(\n extend({}, option, { borderBottom: `1px solid ${option.color}` })\n ),\n };\n break;\n\n case 'range.disabledPointer':\n case 'range.disabledBar':\n case 'range.disabledSubbar':\n case 'range.pointer':\n case 'range.bar':\n case 'range.subbar':\n option.backgroundColor = option.color;\n result = this._makeCssText(option);\n break;\n default:\n result = this._makeCssText(option);\n break;\n }\n\n return result;\n }\n\n /**\n * Make css resource\n * @returns {string} - serialized css text\n * @private\n */\n _styleMaker() {\n const submenuLabelStyle = this.getStyle('submenu.label');\n const submenuPartitionStyle = this.getStyle('submenu.partition');\n\n return style({\n subMenuLabelActive: submenuLabelStyle.active,\n subMenuLabelNormal: submenuLabelStyle.normal,\n submenuPartitionVertical: submenuPartitionStyle.vertical,\n submenuPartitionHorizontal: submenuPartitionStyle.horizontal,\n biSize: this.getStyle('common.bisize'),\n subMenuRangeTitle: this.getStyle('range.title'),\n submenuRangePointer: this.getStyle('range.pointer'),\n submenuRangeBar: this.getStyle('range.bar'),\n submenuRangeSubbar: this.getStyle('range.subbar'),\n\n submenuDisabledRangePointer: this.getStyle('range.disabledPointer'),\n submenuDisabledRangeBar: this.getStyle('range.disabledBar'),\n submenuDisabledRangeSubbar: this.getStyle('range.disabledSubbar'),\n\n submenuRangeValue: this.getStyle('range.value'),\n submenuColorpickerTitle: this.getStyle('colorpicker.title'),\n submenuColorpickerButton: this.getStyle('colorpicker.button'),\n submenuCheckbox: this.getStyle('checkbox'),\n menuIconSize: this.getStyle('menu.iconSize'),\n submenuIconSize: this.getStyle('submenu.iconSize'),\n menuIconStyle: this.getStyle('menu.icon'),\n submenuIconStyle: this.getStyle('submenu.icon'),\n });\n }\n\n /**\n * Change to low dimensional object.\n * @param {object} styleOptions - style object of user interface\n * @returns {object} low level object for style apply\n * @private\n */\n _changeToObject(styleOptions) {\n const styleObject = {};\n forEach(styleOptions, (value, key) => {\n const keyExplode = key.match(/^(.+)\\.([a-z]+)$/i);\n const [, property, subProperty] = keyExplode;\n\n if (!styleObject[property]) {\n styleObject[property] = {};\n }\n styleObject[property][subProperty] = value;\n });\n\n return styleObject;\n }\n\n /**\n * Style object to Csstext serialize\n * @param {object} styleObject - style object\n * @returns {string} - css text string\n * @private\n */\n _makeCssText(styleObject) {\n const converterStack = [];\n\n forEach(styleObject, (value, key) => {\n if (['backgroundImage'].indexOf(key) > -1 && value !== 'none') {\n value = `url(${value})`;\n }\n\n converterStack.push(`${this._toUnderScore(key)}: ${value}`);\n });\n\n return converterStack.join(';');\n }\n\n /**\n * Camel key string to Underscore string\n * @param {string} targetString - change target\n * @returns {string}\n * @private\n */\n _toUnderScore(targetString) {\n return targetString.replace(/([A-Z])/g, ($0, $1) => `-${$1.toLowerCase()}`);\n }\n\n /**\n * Load default svg icon\n * @private\n */\n _loadDefaultSvgIcon() {\n if (!document.getElementById('tui-image-editor-svg-default-icons')) {\n const parser = new DOMParser();\n const dom = parser.parseFromString(icon, 'text/xml');\n\n document.body.appendChild(dom.documentElement);\n }\n }\n\n /**\n * Make className for svg icon\n * @param {string} iconType - normal' or 'active' or 'hover' or 'disabled\n * @param {boolean} isSubmenu - submenu icon or not.\n * @returns {string}\n * @private\n */\n _makeIconClassName(iconType, isSubmenu) {\n const iconStyleInfo = isSubmenu ? this.getStyle('submenu.icon') : this.getStyle('menu.icon');\n const { path, name } = iconStyleInfo[iconType];\n\n return path && name ? iconType : `${iconType} use-default`;\n }\n\n /**\n * Make svg use link path name\n * @param {string} iconType - normal' or 'active' or 'hover' or 'disabled\n * @param {boolean} isSubmenu - submenu icon or not.\n * @returns {string}\n * @private\n */\n _makeSvgIconPrefix(iconType, isSubmenu) {\n const iconStyleInfo = isSubmenu ? this.getStyle('submenu.icon') : this.getStyle('menu.icon');\n const { path, name } = iconStyleInfo[iconType];\n\n return path && name ? `${path}#${name}-` : '#';\n }\n\n /**\n * Make svg use link path name\n * @param {Array.} useIconTypes - normal' or 'active' or 'hover' or 'disabled\n * @param {string} menuName - menu name\n * @param {boolean} isSubmenu - submenu icon or not.\n * @returns {string}\n * @private\n */\n _makeSvgItem(useIconTypes, menuName, isSubmenu) {\n return map(useIconTypes, (iconType) => {\n const svgIconPrefix = this._makeSvgIconPrefix(iconType, isSubmenu);\n const iconName = this._toUnderScore(menuName);\n const svgIconClassName = this._makeIconClassName(iconType, isSubmenu);\n\n return ``;\n }).join('');\n }\n\n /**\n * Make svg icon set\n * @param {Array.} useIconTypes - normal' or 'active' or 'hover' or 'disabled\n * @param {string} menuName - menu name\n * @param {boolean} isSubmenu - submenu icon or not.\n * @returns {string}\n */\n makeMenSvgIconSet(useIconTypes, menuName, isSubmenu = false) {\n return `${this._makeSvgItem(\n useIconTypes,\n menuName,\n isSubmenu\n )}`;\n }\n}\n\nexport default Theme;\n","export default ({\n subMenuLabelActive,\n subMenuLabelNormal,\n subMenuRangeTitle,\n submenuPartitionVertical,\n submenuPartitionHorizontal,\n submenuCheckbox,\n submenuRangePointer,\n submenuRangeValue,\n submenuColorpickerTitle,\n submenuColorpickerButton,\n submenuRangeBar,\n submenuRangeSubbar,\n submenuDisabledRangePointer,\n submenuDisabledRangeBar,\n submenuDisabledRangeSubbar,\n submenuIconSize,\n menuIconSize,\n biSize,\n menuIconStyle,\n submenuIconStyle,\n}) => `\n .tie-icon-add-button.icon-bubble .tui-image-editor-button[data-icontype=\"icon-bubble\"] label,\n .tie-icon-add-button.icon-heart .tui-image-editor-button[data-icontype=\"icon-heart\"] label,\n .tie-icon-add-button.icon-location .tui-image-editor-button[data-icontype=\"icon-location\"] label,\n .tie-icon-add-button.icon-polygon .tui-image-editor-button[data-icontype=\"icon-polygon\"] label,\n .tie-icon-add-button.icon-star .tui-image-editor-button[data-icontype=\"icon-star\"] label,\n .tie-icon-add-button.icon-star-2 .tui-image-editor-button[data-icontype=\"icon-star-2\"] label,\n .tie-icon-add-button.icon-arrow-3 .tui-image-editor-button[data-icontype=\"icon-arrow-3\"] label,\n .tie-icon-add-button.icon-arrow-2 .tui-image-editor-button[data-icontype=\"icon-arrow-2\"] label,\n .tie-icon-add-button.icon-arrow .tui-image-editor-button[data-icontype=\"icon-arrow\"] label,\n .tie-icon-add-button.icon-bubble .tui-image-editor-button[data-icontype=\"icon-bubble\"] label,\n .tie-draw-line-select-button.line .tui-image-editor-button.line label,\n .tie-draw-line-select-button.free .tui-image-editor-button.free label,\n .tie-flip-button.flipX .tui-image-editor-button.flipX label,\n .tie-flip-button.flipY .tui-image-editor-button.flipY label,\n .tie-flip-button.resetFlip .tui-image-editor-button.resetFlip label,\n .tie-crop-button .tui-image-editor-button.apply.active label,\n .tie-crop-preset-button .tui-image-editor-button.preset.active label,\n .tie-shape-button.rect .tui-image-editor-button.rect label,\n .tie-shape-button.circle .tui-image-editor-button.circle label,\n .tie-shape-button.triangle .tui-image-editor-button.triangle label,\n .tie-text-effect-button .tui-image-editor-button.active label,\n .tie-text-align-button.left .tui-image-editor-button.left label,\n .tie-text-align-button.center .tui-image-editor-button.center label,\n .tie-text-align-button.right .tui-image-editor-button.right label,\n .tie-mask-apply.apply.active .tui-image-editor-button.apply label,\n .tui-image-editor-container .tui-image-editor-submenu .tui-image-editor-button:hover > label,\n .tui-image-editor-container .tui-image-editor-checkbox label > span {\n ${subMenuLabelActive}\n }\n .tui-image-editor-container .tui-image-editor-submenu .tui-image-editor-button > label,\n .tui-image-editor-container .tui-image-editor-range-wrap.tui-image-editor-newline.short label,\n .tui-image-editor-container .tui-image-editor-range-wrap.tui-image-editor-newline.short label > span {\n ${subMenuLabelNormal}\n }\n .tui-image-editor-container .tui-image-editor-range-wrap label > span {\n ${subMenuRangeTitle}\n }\n .tui-image-editor-container .tui-image-editor-partition > div {\n ${submenuPartitionVertical}\n }\n .tui-image-editor-container.left .tui-image-editor-submenu .tui-image-editor-partition > div,\n .tui-image-editor-container.right .tui-image-editor-submenu .tui-image-editor-partition > div {\n ${submenuPartitionHorizontal}\n }\n .tui-image-editor-container .tui-image-editor-checkbox label > span:before {\n ${submenuCheckbox}\n }\n .tui-image-editor-container .tui-image-editor-checkbox label > input:checked + span:before {\n border: 0;\n }\n .tui-image-editor-container .tui-image-editor-virtual-range-pointer {\n ${submenuRangePointer}\n }\n .tui-image-editor-container .tui-image-editor-virtual-range-bar {\n ${submenuRangeBar}\n }\n .tui-image-editor-container .tui-image-editor-virtual-range-subbar {\n ${submenuRangeSubbar}\n }\n .tui-image-editor-container .tui-image-editor-disabled .tui-image-editor-virtual-range-pointer {\n ${submenuDisabledRangePointer}\n }\n .tui-image-editor-container .tui-image-editor-disabled .tui-image-editor-virtual-range-subbar {\n ${submenuDisabledRangeSubbar}\n }\n .tui-image-editor-container .tui-image-editor-disabled .tui-image-editor-virtual-range-bar {\n ${submenuDisabledRangeBar}\n }\n .tui-image-editor-container .tui-image-editor-range-value {\n ${submenuRangeValue}\n }\n .tui-image-editor-container .tui-image-editor-submenu .tui-image-editor-button .color-picker-value + label {\n ${submenuColorpickerTitle}\n }\n .tui-image-editor-container .tui-image-editor-submenu .tui-image-editor-button .color-picker-value {\n ${submenuColorpickerButton}\n }\n .tui-image-editor-container .svg_ic-menu {\n ${menuIconSize}\n }\n .tui-image-editor-container .svg_ic-submenu {\n ${submenuIconSize}\n }\n .tui-image-editor-container .tui-image-editor-controls-logo > img,\n .tui-image-editor-container .tui-image-editor-header-logo > img {\n ${biSize}\n }\n .tui-image-editor-menu use.normal.use-default,\n .tui-image-editor-help-menu use.normal.use-default {\n fill-rule: evenodd;\n fill: ${menuIconStyle.normal.color};\n stroke: ${menuIconStyle.normal.color};\n }\n .tui-image-editor-menu use.active.use-default,\n .tui-image-editor-help-menu use.active.use-default {\n fill-rule: evenodd;\n fill: ${menuIconStyle.active.color};\n stroke: ${menuIconStyle.active.color};\n }\n .tui-image-editor-menu use.hover.use-default,\n .tui-image-editor-help-menu use.hover.use-default {\n fill-rule: evenodd;\n fill: ${menuIconStyle.hover.color};\n stroke: ${menuIconStyle.hover.color};\n }\n .tui-image-editor-menu use.disabled.use-default,\n .tui-image-editor-help-menu use.disabled.use-default {\n fill-rule: evenodd;\n fill: ${menuIconStyle.disabled.color};\n stroke: ${menuIconStyle.disabled.color};\n }\n .tui-image-editor-submenu use.normal.use-default {\n fill-rule: evenodd;\n fill: ${submenuIconStyle.normal.color};\n stroke: ${submenuIconStyle.normal.color};\n }\n .tui-image-editor-submenu use.active.use-default {\n fill-rule: evenodd;\n fill: ${submenuIconStyle.active.color};\n stroke: ${submenuIconStyle.active.color};\n }\n`;\n","/**\n * @author NHN. FE Development Team \n * @fileoverview The standard theme\n */\n\n/**\n * Full configuration for theme.
                      \n * @typedef {object} themeConfig\n * @property {string} common.bi.image - Brand icon image\n * @property {string} common.bisize.width - Icon image width\n * @property {string} common.bisize.height - Icon Image Height\n * @property {string} common.backgroundImage - Background image\n * @property {string} common.backgroundColor - Background color\n * @property {string} common.border - Full area border style\n * @property {string} header.backgroundImage - header area background\n * @property {string} header.backgroundColor - header area background color\n * @property {string} header.border - header area border style\n * @property {string} loadButton.backgroundColor - load button background color\n * @property {string} loadButton.border - load button border style\n * @property {string} loadButton.color - load button foreground color\n * @property {string} loadButton.fontFamily - load button font type\n * @property {string} loadButton.fontSize - load button font size\n * @property {string} downloadButton.backgroundColor - download button background color\n * @property {string} downloadButton.border - download button border style\n * @property {string} downloadButton.color - download button foreground color\n * @property {string} downloadButton.fontFamily - download button font type\n * @property {string} downloadButton.fontSize - download button font size\n * @property {string} menu.normalIcon.color - Menu normal color for default icon\n * @property {string} menu.normalIcon.path - Menu normal icon svg bundle file path\n * @property {string} menu.normalIcon.name - Menu normal icon svg bundle name\n * @property {string} menu.activeIcon.color - Menu active color for default icon\n * @property {string} menu.activeIcon.path - Menu active icon svg bundle file path\n * @property {string} menu.activeIcon.name - Menu active icon svg bundle name\n * @property {string} menu.disabled.color - Menu disabled color for default icon\n * @property {string} menu.disabled.path - Menu disabled icon svg bundle file path\n * @property {string} menu.disabled.name - Menu disabled icon svg bundle name\n * @property {string} menu.hover.color - Menu default icon hover color\n * @property {string} menu.hover.path - Menu hover icon svg bundle file path\n * @property {string} menu.hover.name - Menu hover icon svg bundle name\n * @property {string} menu.iconSize.width - Menu icon Size Width\n * @property {string} menu.iconSize.height - Menu Icon Size Height\n * @property {string} submenu.backgroundColor - Sub-menu area background color\n * @property {string} submenu.partition.color - Submenu partition line color\n * @property {string} submenu.normalIcon.color - Submenu normal color for default icon\n * @property {string} submenu.normalIcon.path - Submenu default icon svg bundle file path\n * @property {string} submenu.normalIcon.name - Submenu default icon svg bundle name\n * @property {string} submenu.activeIcon.color - Submenu active color for default icon\n * @property {string} submenu.activeIcon.path - Submenu active icon svg bundle file path\n * @property {string} submenu.activeIcon.name - Submenu active icon svg bundle name\n * @property {string} submenu.iconSize.width - Submenu icon Size Width\n * @property {string} submenu.iconSize.height - Submenu Icon Size Height\n * @property {string} submenu.normalLabel.color - Submenu default label color\n * @property {string} submenu.normalLabel.fontWeight - Sub Menu Default Label Font Thickness\n * @property {string} submenu.activeLabel.color - Submenu active label color\n * @property {string} submenu.activeLabel.fontWeight - Submenu active label Font thickness\n * @property {string} checkbox.border - Checkbox border style\n * @property {string} checkbox.backgroundColor - Checkbox background color\n * @property {string} range.pointer.color - range control pointer color\n * @property {string} range.bar.color - range control bar color\n * @property {string} range.subbar.color - range control subbar color\n * @property {string} range.value.color - range number box font color\n * @property {string} range.value.fontWeight - range number box font thickness\n * @property {string} range.value.fontSize - range number box font size\n * @property {string} range.value.border - range number box border style\n * @property {string} range.value.backgroundColor - range number box background color\n * @property {string} range.title.color - range title font color\n * @property {string} range.title.fontWeight - range title font weight\n * @property {string} colorpicker.button.border - colorpicker button border style\n * @property {string} colorpicker.title.color - colorpicker button title font color\n * @example\n // default keys and styles\n var customTheme = {\n 'common.bi.image': 'https://uicdn.toast.com/toastui/img/tui-image-editor-bi.png',\n 'common.bisize.width': '251px',\n 'common.bisize.height': '21px',\n 'common.backgroundImage': 'none',\n 'common.backgroundColor': '#1e1e1e',\n 'common.border': '0px',\n\n // header\n 'header.backgroundImage': 'none',\n 'header.backgroundColor': 'transparent',\n 'header.border': '0px',\n\n // load button\n 'loadButton.backgroundColor': '#fff',\n 'loadButton.border': '1px solid #ddd',\n 'loadButton.color': '#222',\n 'loadButton.fontFamily': 'NotoSans, sans-serif',\n 'loadButton.fontSize': '12px',\n\n // download button\n 'downloadButton.backgroundColor': '#fdba3b',\n 'downloadButton.border': '1px solid #fdba3b',\n 'downloadButton.color': '#fff',\n 'downloadButton.fontFamily': 'NotoSans, sans-serif',\n 'downloadButton.fontSize': '12px',\n\n // icons default\n 'menu.normalIcon.color': '#8a8a8a',\n 'menu.activeIcon.color': '#555555',\n 'menu.disabledIcon.color': '#434343',\n 'menu.hoverIcon.color': '#e9e9e9',\n 'submenu.normalIcon.color': '#8a8a8a',\n 'submenu.activeIcon.color': '#e9e9e9',\n\n 'menu.iconSize.width': '24px',\n 'menu.iconSize.height': '24px',\n 'submenu.iconSize.width': '32px',\n 'submenu.iconSize.height': '32px',\n\n // submenu primary color\n 'submenu.backgroundColor': '#1e1e1e',\n 'submenu.partition.color': '#858585',\n\n // submenu labels\n 'submenu.normalLabel.color': '#858585',\n 'submenu.normalLabel.fontWeight': 'lighter',\n 'submenu.activeLabel.color': '#fff',\n 'submenu.activeLabel.fontWeight': 'lighter',\n\n // checkbox style\n 'checkbox.border': '1px solid #ccc',\n 'checkbox.backgroundColor': '#fff',\n\n // rango style\n 'range.pointer.color': '#fff',\n 'range.bar.color': '#666',\n 'range.subbar.color': '#d1d1d1',\n\n 'range.disabledPointer.color': '#414141',\n 'range.disabledBar.color': '#282828',\n 'range.disabledSubbar.color': '#414141',\n\n 'range.value.color': '#fff',\n 'range.value.fontWeight': 'lighter',\n 'range.value.fontSize': '11px',\n 'range.value.border': '1px solid #353535',\n 'range.value.backgroundColor': '#151515',\n 'range.title.color': '#fff',\n 'range.title.fontWeight': 'lighter',\n\n // colorpicker style\n 'colorpicker.button.border': '1px solid #1e1e1e',\n 'colorpicker.title.color': '#fff'\n};\n */\nexport default {\n 'common.bi.image': 'https://uicdn.toast.com/toastui/img/tui-image-editor-bi.png',\n 'common.bisize.width': '251px',\n 'common.bisize.height': '21px',\n 'common.backgroundImage': 'none',\n 'common.backgroundColor': '#1e1e1e',\n 'common.border': '0px',\n\n // header\n 'header.backgroundImage': 'none',\n 'header.backgroundColor': 'transparent',\n 'header.border': '0px',\n\n // load button\n 'loadButton.backgroundColor': '#fff',\n 'loadButton.border': '1px solid #ddd',\n 'loadButton.color': '#222',\n 'loadButton.fontFamily': \"'Noto Sans', sans-serif\",\n 'loadButton.fontSize': '12px',\n\n // download button\n 'downloadButton.backgroundColor': '#fdba3b',\n 'downloadButton.border': '1px solid #fdba3b',\n 'downloadButton.color': '#fff',\n 'downloadButton.fontFamily': \"'Noto Sans', sans-serif\",\n 'downloadButton.fontSize': '12px',\n\n // main icons\n 'menu.normalIcon.color': '#8a8a8a',\n 'menu.activeIcon.color': '#555555',\n 'menu.disabledIcon.color': '#434343',\n 'menu.hoverIcon.color': '#e9e9e9',\n\n // submenu icons\n 'submenu.normalIcon.color': '#8a8a8a',\n 'submenu.activeIcon.color': '#e9e9e9',\n\n 'menu.iconSize.width': '24px',\n 'menu.iconSize.height': '24px',\n\n 'submenu.iconSize.width': '32px',\n 'submenu.iconSize.height': '32px',\n\n // submenu primary color\n 'submenu.backgroundColor': '#1e1e1e',\n 'submenu.partition.color': '#3c3c3c',\n\n // submenu labels\n 'submenu.normalLabel.color': '#8a8a8a',\n 'submenu.normalLabel.fontWeight': 'lighter',\n 'submenu.activeLabel.color': '#fff',\n 'submenu.activeLabel.fontWeight': 'lighter',\n\n // checkbox style\n 'checkbox.border': '0px',\n 'checkbox.backgroundColor': '#fff',\n\n // range style\n 'range.pointer.color': '#fff',\n 'range.bar.color': '#666',\n 'range.subbar.color': '#d1d1d1',\n\n 'range.disabledPointer.color': '#414141',\n 'range.disabledBar.color': '#282828',\n 'range.disabledSubbar.color': '#414141',\n\n 'range.value.color': '#fff',\n 'range.value.fontWeight': 'lighter',\n 'range.value.fontSize': '11px',\n 'range.value.border': '1px solid #353535',\n 'range.value.backgroundColor': '#151515',\n 'range.title.color': '#fff',\n 'range.title.fontWeight': 'lighter',\n\n // colorpicker style\n 'colorpicker.button.border': '1px solid #1e1e1e',\n 'colorpicker.title.color': '#fff',\n};\n","module.exports = \"\"","import Colorpicker from '@/ui/tools/colorpicker';\nimport Range from '@/ui/tools/range';\nimport Submenu from '@/ui/submenuBase';\nimport templateHtml from '@/ui/template/submenu/shape';\nimport { toInteger, assignmentForDestroy } from '@/util';\nimport { defaultShapeStrokeValues } from '@/consts';\n\nconst SHAPE_DEFAULT_OPTION = {\n stroke: '#ffbb3b',\n fill: '',\n strokeWidth: 3,\n};\n\n/**\n * Shape ui class\n * @class\n * @ignore\n */\nclass Shape extends Submenu {\n constructor(subMenuElement, { locale, makeSvgIcon, menuBarPosition, usageStatistics }) {\n super(subMenuElement, {\n locale,\n name: 'shape',\n makeSvgIcon,\n menuBarPosition,\n templateHtml,\n usageStatistics,\n });\n this.type = null;\n this.options = SHAPE_DEFAULT_OPTION;\n\n this._els = {\n shapeSelectButton: this.selector('.tie-shape-button'),\n shapeColorButton: this.selector('.tie-shape-color-button'),\n strokeRange: new Range(\n {\n slider: this.selector('.tie-stroke-range'),\n input: this.selector('.tie-stroke-range-value'),\n },\n defaultShapeStrokeValues\n ),\n fillColorpicker: new Colorpicker(\n this.selector('.tie-color-fill'),\n '',\n this.toggleDirection,\n this.usageStatistics\n ),\n strokeColorpicker: new Colorpicker(\n this.selector('.tie-color-stroke'),\n '#ffbb3b',\n this.toggleDirection,\n this.usageStatistics\n ),\n };\n\n this.colorPickerControls.push(this._els.fillColorpicker);\n this.colorPickerControls.push(this._els.strokeColorpicker);\n }\n\n /**\n * Destroys the instance.\n */\n destroy() {\n this._removeEvent();\n this._els.strokeRange.destroy();\n this._els.fillColorpicker.destroy();\n this._els.strokeColorpicker.destroy();\n\n assignmentForDestroy(this);\n }\n\n /**\n * Add event for shape\n * @param {Object} actions - actions for shape\n * @param {Function} actions.changeShape - change shape mode\n * @param {Function} actions.setDrawingShape - set drawing shape\n */\n addEvent(actions) {\n this.eventHandler.shapeTypeSelected = this._changeShapeHandler.bind(this);\n this.actions = actions;\n\n this._els.shapeSelectButton.addEventListener('click', this.eventHandler.shapeTypeSelected);\n this._els.strokeRange.on('change', this._changeStrokeRangeHandler.bind(this));\n this._els.fillColorpicker.on('change', this._changeFillColorHandler.bind(this));\n this._els.strokeColorpicker.on('change', this._changeStrokeColorHandler.bind(this));\n this._els.fillColorpicker.on('changeShow', this.colorPickerChangeShow.bind(this));\n this._els.strokeColorpicker.on('changeShow', this.colorPickerChangeShow.bind(this));\n }\n\n /**\n * Remove event\n * @private\n */\n _removeEvent() {\n this._els.shapeSelectButton.removeEventListener('click', this.eventHandler.shapeTypeSelected);\n this._els.strokeRange.off();\n this._els.fillColorpicker.off();\n this._els.strokeColorpicker.off();\n }\n\n /**\n * Set Shape status\n * @param {Object} options - options of shape status\n * @param {string} strokeWidth - stroke width\n * @param {string} strokeColor - stroke color\n * @param {string} fillColor - fill color\n */\n setShapeStatus({ strokeWidth, strokeColor, fillColor }) {\n this._els.strokeRange.value = strokeWidth;\n this._els.strokeColorpicker.color = strokeColor;\n this._els.fillColorpicker.color = fillColor;\n this.options.stroke = strokeColor;\n this.options.fill = fillColor;\n this.options.strokeWidth = strokeWidth;\n\n this.actions.setDrawingShape(this.type, { strokeWidth });\n }\n\n /**\n * Executed when the menu starts.\n */\n changeStartMode() {\n this.actions.stopDrawingMode();\n }\n\n /**\n * Returns the menu to its default state.\n */\n changeStandbyMode() {\n this.type = null;\n this.actions.changeSelectableAll(true);\n this._els.shapeSelectButton.classList.remove('circle');\n this._els.shapeSelectButton.classList.remove('triangle');\n this._els.shapeSelectButton.classList.remove('rect');\n }\n\n /**\n * set range stroke max value\n * @param {number} maxValue - expect max value for change\n */\n setMaxStrokeValue(maxValue) {\n let strokeMaxValue = maxValue;\n if (strokeMaxValue <= 0) {\n strokeMaxValue = defaultShapeStrokeValues.max;\n }\n this._els.strokeRange.max = strokeMaxValue;\n }\n\n /**\n * Set stroke value\n * @param {number} value - expect value for strokeRange change\n */\n setStrokeValue(value) {\n this._els.strokeRange.value = value;\n this._els.strokeRange.trigger('change');\n }\n\n /**\n * Get stroke value\n * @returns {number} - stroke range value\n */\n getStrokeValue() {\n return this._els.strokeRange.value;\n }\n\n /**\n * Change icon color\n * @param {object} event - add button event object\n * @private\n */\n _changeShapeHandler(event) {\n const button = event.target.closest('.tui-image-editor-button');\n if (button) {\n this.actions.stopDrawingMode();\n this.actions.discardSelection();\n const shapeType = this.getButtonType(button, ['circle', 'triangle', 'rect']);\n\n if (this.type === shapeType) {\n this.changeStandbyMode();\n\n return;\n }\n this.changeStandbyMode();\n this.type = shapeType;\n event.currentTarget.classList.add(shapeType);\n this.actions.changeSelectableAll(false);\n this.actions.modeChange('shape');\n }\n }\n\n /**\n * Change stroke range\n * @param {number} value - stroke range value\n * @param {boolean} isLast - Is last change\n * @private\n */\n _changeStrokeRangeHandler(value, isLast) {\n this.options.strokeWidth = toInteger(value);\n this.actions.changeShape(\n {\n strokeWidth: value,\n },\n !isLast\n );\n\n this.actions.setDrawingShape(this.type, this.options);\n }\n\n /**\n * Change shape color\n * @param {string} color - fill color\n * @private\n */\n _changeFillColorHandler(color) {\n color = color || 'transparent';\n this.options.fill = color;\n this.actions.changeShape({\n fill: color,\n });\n }\n\n /**\n * Change shape stroke color\n * @param {string} color - fill color\n * @private\n */\n _changeStrokeColorHandler(color) {\n color = color || 'transparent';\n this.options.stroke = color;\n this.actions.changeShape({\n stroke: color,\n });\n }\n}\n\nexport default Shape;\n","module.exports = __WEBPACK_EXTERNAL_MODULE__123__;","/**\n * @param {Object} submenuInfo - submenu info for make template\n * @param {Locale} locale - Translate text\n * @param {Function} makeSvgIcon - svg icon generator\n * @returns {string}\n */\nexport default ({ locale, makeSvgIcon }) => `\n
                        \n
                      • \n
                        \n
                        \n ${makeSvgIcon(['normal', 'active'], 'shape-rectangle', true)}\n
                        \n \n
                        \n
                        \n
                        \n ${makeSvgIcon(['normal', 'active'], 'shape-circle', true)}\n
                        \n \n
                        \n
                        \n
                        \n ${makeSvgIcon(['normal', 'active'], 'shape-triangle', true)}\n
                        \n \n
                        \n
                      • \n
                      • \n
                        \n
                      • \n
                      • \n
                        \n
                        \n
                      • \n
                      • \n
                        \n
                      • \n
                      • \n \n
                        \n \n
                      • \n
                      \n`;\n","import snippet from 'tui-code-snippet';\nimport Submenu from '@/ui/submenuBase';\nimport templateHtml from '@/ui/template/submenu/crop';\nimport { assignmentForDestroy } from '@/util';\n\n/**\n * Crop ui class\n * @class\n * @ignore\n */\nclass Crop extends Submenu {\n constructor(subMenuElement, { locale, makeSvgIcon, menuBarPosition, usageStatistics }) {\n super(subMenuElement, {\n locale,\n name: 'crop',\n makeSvgIcon,\n menuBarPosition,\n templateHtml,\n usageStatistics,\n });\n\n this.status = 'active';\n\n this._els = {\n apply: this.selector('.tie-crop-button .apply'),\n cancel: this.selector('.tie-crop-button .cancel'),\n preset: this.selector('.tie-crop-preset-button'),\n };\n\n this.defaultPresetButton = this._els.preset.querySelector('.preset-none');\n }\n\n /**\n * Destroys the instance.\n */\n destroy() {\n this._removeEvent();\n\n assignmentForDestroy(this);\n }\n\n /**\n * Add event for crop\n * @param {Object} actions - actions for crop\n * @param {Function} actions.crop - crop action\n * @param {Function} actions.cancel - cancel action\n * @param {Function} actions.preset - draw rectzone at a predefined ratio\n */\n addEvent(actions) {\n const apply = this._applyEventHandler.bind(this);\n const cancel = this._cancelEventHandler.bind(this);\n const cropzonePreset = this._cropzonePresetEventHandler.bind(this);\n\n this.eventHandler = {\n apply,\n cancel,\n cropzonePreset,\n };\n\n this.actions = actions;\n this._els.apply.addEventListener('click', apply);\n this._els.cancel.addEventListener('click', cancel);\n this._els.preset.addEventListener('click', cropzonePreset);\n }\n\n /**\n * Remove event\n * @private\n */\n _removeEvent() {\n this._els.apply.removeEventListener('click', this.eventHandler.apply);\n this._els.cancel.removeEventListener('click', this.eventHandler.cancel);\n this._els.preset.removeEventListener('click', this.eventHandler.cropzonePreset);\n }\n\n _applyEventHandler() {\n this.actions.crop();\n this._els.apply.classList.remove('active');\n }\n\n _cancelEventHandler() {\n this.actions.cancel();\n this._els.apply.classList.remove('active');\n }\n\n _cropzonePresetEventHandler(event) {\n const button = event.target.closest('.tui-image-editor-button.preset');\n if (button) {\n const [presetType] = button.className.match(/preset-[^\\s]+/);\n\n this._setPresetButtonActive(button);\n this.actions.preset(presetType);\n }\n }\n\n /**\n * Executed when the menu starts.\n */\n changeStartMode() {\n this.actions.modeChange('crop');\n }\n\n /**\n * Returns the menu to its default state.\n */\n changeStandbyMode() {\n this.actions.stopDrawingMode();\n this._setPresetButtonActive();\n }\n\n /**\n * Change apply button status\n * @param {Boolean} enableStatus - apply button status\n */\n changeApplyButtonStatus(enableStatus) {\n if (enableStatus) {\n this._els.apply.classList.add('active');\n } else {\n this._els.apply.classList.remove('active');\n }\n }\n\n /**\n * Set preset button to active status\n * @param {HTMLElement} button - event target element\n * @private\n */\n _setPresetButtonActive(button = this.defaultPresetButton) {\n snippet.forEach([].slice.call(this._els.preset.querySelectorAll('.preset')), (presetButton) => {\n presetButton.classList.remove('active');\n });\n\n if (button) {\n button.classList.add('active');\n }\n }\n}\n\nexport default Crop;\n","/**\n * @param {Object} submenuInfo - submenu info for make template\n * @param {Locale} locale - Translate text\n * @param {Function} makeSvgIcon - svg icon generator\n * @returns {string}\n */\nexport default ({ locale, makeSvgIcon }) => `\n
                        \n
                      • \n
                        \n
                        \n ${makeSvgIcon(['normal', 'active'], 'shape-rectangle', true)}\n
                        \n \n
                        \n
                        \n
                        \n ${makeSvgIcon(['normal', 'active'], 'crop', true)}\n
                        \n \n
                        \n
                        \n
                        \n ${makeSvgIcon(['normal', 'active'], 'crop', true)}\n
                        \n \n
                        \n
                        \n
                        \n ${makeSvgIcon(['normal', 'active'], 'crop', true)}\n
                        \n \n
                        \n
                        \n
                        \n ${makeSvgIcon(['normal', 'active'], 'crop', true)}\n
                        \n \n
                        \n
                        \n
                        \n ${makeSvgIcon(['normal', 'active'], 'crop', true)}\n
                        \n \n
                        \n
                        \n
                        \n ${makeSvgIcon(['normal', 'active'], 'crop', true)}\n
                        \n \n
                        \n
                      • \n
                      • \n
                      • \n
                      • \n
                        \n
                      • \n
                      • \n
                        \n ${makeSvgIcon(['normal', 'active'], 'apply')}\n \n
                        \n
                        \n ${makeSvgIcon(['normal', 'active'], 'cancel')}\n \n
                        \n
                      • \n
                      \n`;\n","import snippet from 'tui-code-snippet';\nimport Submenu from '@/ui/submenuBase';\nimport templateHtml from '@/ui/template/submenu/flip';\nimport { assignmentForDestroy } from '@/util';\n\n/**\n * Flip ui class\n * @class\n * @ignore\n */\nclass Flip extends Submenu {\n constructor(subMenuElement, { locale, makeSvgIcon, menuBarPosition, usageStatistics }) {\n super(subMenuElement, {\n locale,\n name: 'flip',\n makeSvgIcon,\n menuBarPosition,\n templateHtml,\n usageStatistics,\n });\n this.flipStatus = false;\n\n this._els = {\n flipButton: this.selector('.tie-flip-button'),\n };\n }\n\n /**\n * Destroys the instance.\n */\n destroy() {\n this._removeEvent();\n\n assignmentForDestroy(this);\n }\n\n /**\n * Add event for flip\n * @param {Object} actions - actions for flip\n * @param {Function} actions.flip - flip action\n */\n addEvent(actions) {\n this.eventHandler.changeFlip = this._changeFlip.bind(this);\n this._actions = actions;\n this._els.flipButton.addEventListener('click', this.eventHandler.changeFlip);\n }\n\n /**\n * Remove event\n * @private\n */\n _removeEvent() {\n this._els.flipButton.removeEventListener('click', this.eventHandler.changeFlip);\n }\n\n /**\n * change Flip status\n * @param {object} event - change event\n * @private\n */\n _changeFlip(event) {\n const button = event.target.closest('.tui-image-editor-button');\n if (button) {\n const flipType = this.getButtonType(button, ['flipX', 'flipY', 'resetFlip']);\n if (!this.flipStatus && flipType === 'resetFlip') {\n return;\n }\n\n this._actions.flip(flipType).then((flipStatus) => {\n const flipClassList = this._els.flipButton.classList;\n this.flipStatus = false;\n\n flipClassList.remove('resetFlip');\n snippet.forEach(['flipX', 'flipY'], (type) => {\n flipClassList.remove(type);\n if (flipStatus[type]) {\n flipClassList.add(type);\n flipClassList.add('resetFlip');\n this.flipStatus = true;\n }\n });\n });\n }\n }\n}\n\nexport default Flip;\n","/**\n * @param {Object} submenuInfo - submenu info for make template\n * @param {Locale} locale - Translate text\n * @param {Function} makeSvgIcon - svg icon generator\n * @returns {string}\n */\nexport default ({ locale, makeSvgIcon }) => `\n
                        \n
                      • \n
                        \n
                        \n ${makeSvgIcon(['normal', 'active'], 'flip-x', true)}\n
                        \n \n
                        \n
                        \n
                        \n ${makeSvgIcon(['normal', 'active'], 'flip-y', true)}\n
                        \n \n
                        \n
                      • \n
                      • \n
                        \n
                      • \n
                      • \n
                        \n
                        \n ${makeSvgIcon(['normal', 'active'], 'flip-reset', true)}\n
                        \n \n
                        \n
                      • \n
                      \n`;\n","import Range from '@/ui/tools/range';\nimport Submenu from '@/ui/submenuBase';\nimport templateHtml from '@/ui/template/submenu/rotate';\nimport { toInteger, assignmentForDestroy } from '@/util';\nimport { defaultRotateRangeValues } from '@/consts';\n\nconst CLOCKWISE = 30;\nconst COUNTERCLOCKWISE = -30;\n\n/**\n * Rotate ui class\n * @class\n * @ignore\n */\nclass Rotate extends Submenu {\n constructor(subMenuElement, { locale, makeSvgIcon, menuBarPosition, usageStatistics }) {\n super(subMenuElement, {\n locale,\n name: 'rotate',\n makeSvgIcon,\n menuBarPosition,\n templateHtml,\n usageStatistics,\n });\n this._value = 0;\n\n this._els = {\n rotateButton: this.selector('.tie-rotate-button'),\n rotateRange: new Range(\n {\n slider: this.selector('.tie-rotate-range'),\n input: this.selector('.tie-rotate-range-value'),\n },\n defaultRotateRangeValues\n ),\n };\n }\n\n /**\n * Destroys the instance.\n */\n destroy() {\n this._removeEvent();\n this._els.rotateRange.destroy();\n\n assignmentForDestroy(this);\n }\n\n setRangeBarAngle(type, angle) {\n let resultAngle = angle;\n\n if (type === 'rotate') {\n resultAngle = parseInt(this._els.rotateRange.value, 10) + angle;\n }\n\n this._setRangeBarRatio(resultAngle);\n }\n\n _setRangeBarRatio(angle) {\n this._els.rotateRange.value = angle;\n }\n\n /**\n * Add event for rotate\n * @param {Object} actions - actions for crop\n * @param {Function} actions.rotate - rotate action\n * @param {Function} actions.setAngle - set angle action\n */\n addEvent(actions) {\n this.eventHandler.rotationAngleChanged = this._changeRotateForButton.bind(this);\n\n // {rotate, setAngle}\n this.actions = actions;\n this._els.rotateButton.addEventListener('click', this.eventHandler.rotationAngleChanged);\n this._els.rotateRange.on('change', this._changeRotateForRange.bind(this));\n }\n\n /**\n * Remove event\n * @private\n */\n _removeEvent() {\n this._els.rotateButton.removeEventListener('click', this.eventHandler.rotationAngleChanged);\n this._els.rotateRange.off();\n }\n\n /**\n * Change rotate for range\n * @param {number} value - angle value\n * @param {boolean} isLast - Is last change\n * @private\n */\n _changeRotateForRange(value, isLast) {\n const angle = toInteger(value);\n this.actions.setAngle(angle, !isLast);\n this._value = angle;\n }\n\n /**\n * Change rotate for button\n * @param {object} event - add button event object\n * @private\n */\n _changeRotateForButton(event) {\n const button = event.target.closest('.tui-image-editor-button');\n const angle = this._els.rotateRange.value;\n\n if (button) {\n const rotateType = this.getButtonType(button, ['counterclockwise', 'clockwise']);\n const rotateAngle = {\n clockwise: CLOCKWISE,\n counterclockwise: COUNTERCLOCKWISE,\n }[rotateType];\n const newAngle = parseInt(angle, 10) + rotateAngle;\n const isRotatable = newAngle >= -360 && newAngle <= 360;\n if (isRotatable) {\n this.actions.rotate(rotateAngle);\n }\n }\n }\n}\n\nexport default Rotate;\n","/**\n * @param {Object} submenuInfo - submenu info for make template\n * @param {Locale} locale - Translate text\n * @param {Function} makeSvgIcon - svg icon generator\n * @returns {string}\n */\nexport default ({ locale, makeSvgIcon }) => `\n
                        \n
                      • \n
                        \n
                        \n ${makeSvgIcon(['normal', 'active'], 'rotate-clockwise', true)}\n
                        \n \n
                        \n
                        \n
                        \n ${makeSvgIcon(['normal', 'active'], 'rotate-counterclockwise', true)}\n
                        \n \n
                        \n
                      • \n
                      • \n
                        \n
                      • \n
                      • \n \n
                        \n \n
                      • \n
                      \n`;\n","import Range from '@/ui/tools/range';\nimport Colorpicker from '@/ui/tools/colorpicker';\nimport Submenu from '@/ui/submenuBase';\nimport templateHtml from '@/ui/template/submenu/text';\nimport { assignmentForDestroy } from '@/util';\nimport { defaultTextRangeValues } from '@/consts';\n\n/**\n * Crop ui class\n * @class\n * @ignore\n */\nexport default class Text extends Submenu {\n constructor(subMenuElement, { locale, makeSvgIcon, menuBarPosition, usageStatistics }) {\n super(subMenuElement, {\n locale,\n name: 'text',\n makeSvgIcon,\n menuBarPosition,\n templateHtml,\n usageStatistics,\n });\n this.effect = {\n bold: false,\n italic: false,\n underline: false,\n };\n this.align = 'left';\n this._els = {\n textEffectButton: this.selector('.tie-text-effect-button'),\n textAlignButton: this.selector('.tie-text-align-button'),\n textColorpicker: new Colorpicker(\n this.selector('.tie-text-color'),\n '#ffbb3b',\n this.toggleDirection,\n this.usageStatistics\n ),\n textRange: new Range(\n {\n slider: this.selector('.tie-text-range'),\n input: this.selector('.tie-text-range-value'),\n },\n defaultTextRangeValues\n ),\n };\n }\n\n /**\n * Destroys the instance.\n */\n destroy() {\n this._removeEvent();\n this._els.textColorpicker.destroy();\n this._els.textRange.destroy();\n\n assignmentForDestroy(this);\n }\n\n /**\n * Add event for text\n * @param {Object} actions - actions for text\n * @param {Function} actions.changeTextStyle - change text style\n */\n addEvent(actions) {\n const setTextEffect = this._setTextEffectHandler.bind(this);\n const setTextAlign = this._setTextAlignHandler.bind(this);\n\n this.eventHandler = {\n setTextEffect,\n setTextAlign,\n };\n\n this.actions = actions;\n this._els.textEffectButton.addEventListener('click', setTextEffect);\n this._els.textAlignButton.addEventListener('click', setTextAlign);\n this._els.textRange.on('change', this._changeTextRnageHandler.bind(this));\n this._els.textColorpicker.on('change', this._changeColorHandler.bind(this));\n }\n\n /**\n * Remove event\n * @private\n */\n _removeEvent() {\n const { setTextEffect, setTextAlign } = this.eventHandler;\n\n this._els.textEffectButton.removeEventListener('click', setTextEffect);\n this._els.textAlignButton.removeEventListener('click', setTextAlign);\n this._els.textRange.off();\n this._els.textColorpicker.off();\n }\n\n /**\n * Returns the menu to its default state.\n */\n changeStandbyMode() {\n this.actions.stopDrawingMode();\n }\n\n /**\n * Executed when the menu starts.\n */\n changeStartMode() {\n this.actions.modeChange('text');\n }\n\n set textColor(color) {\n this._els.textColorpicker.color = color;\n }\n\n /**\n * Get text color\n * @returns {string} - text color\n */\n get textColor() {\n return this._els.textColorpicker.color;\n }\n\n /**\n * Get text size\n * @returns {string} - text size\n */\n get fontSize() {\n return this._els.textRange.value;\n }\n\n /**\n * Set text size\n * @param {Number} value - text size\n */\n set fontSize(value) {\n this._els.textRange.value = value;\n }\n\n /**\n * get font style\n * @returns {string} - font style\n */\n get fontStyle() {\n return this.effect.italic ? 'italic' : 'normal';\n }\n\n /**\n * get font weight\n * @returns {string} - font weight\n */\n get fontWeight() {\n return this.effect.bold ? 'bold' : 'normal';\n }\n\n /**\n * get text underline text underline\n * @returns {boolean} - true or false\n */\n get underline() {\n return this.effect.underline;\n }\n\n setTextStyleStateOnAction(textStyle = {}) {\n const { fill, fontSize, fontStyle, fontWeight, textDecoration, textAlign } = textStyle;\n\n this.textColor = fill;\n this.fontSize = fontSize;\n this.setEffectState('italic', fontStyle);\n this.setEffectState('bold', fontWeight);\n this.setEffectState('underline', textDecoration);\n this.setAlignState(textAlign);\n }\n\n setEffectState(effectName, value) {\n const effectValue = value === 'italic' || value === 'bold' || value === 'underline';\n const button = this._els.textEffectButton.querySelector(\n `.tui-image-editor-button.${effectName}`\n );\n\n this.effect[effectName] = effectValue;\n\n button.classList[effectValue ? 'add' : 'remove']('active');\n }\n\n setAlignState(value) {\n const button = this._els.textAlignButton;\n button.classList.remove(this.align);\n button.classList.add(value);\n this.align = value;\n }\n\n /**\n * text effect set handler\n * @param {object} event - add button event object\n * @private\n */\n _setTextEffectHandler(event) {\n const button = event.target.closest('.tui-image-editor-button');\n if (button) {\n const [styleType] = button.className.match(/(bold|italic|underline)/);\n const styleObj = {\n bold: { fontWeight: 'bold' },\n italic: { fontStyle: 'italic' },\n underline: { textDecoration: 'underline' },\n }[styleType];\n\n this.effect[styleType] = !this.effect[styleType];\n button.classList.toggle('active');\n this.actions.changeTextStyle(styleObj);\n }\n }\n\n /**\n * text effect set handler\n * @param {object} event - add button event object\n * @private\n */\n _setTextAlignHandler(event) {\n const button = event.target.closest('.tui-image-editor-button');\n if (button) {\n const styleType = this.getButtonType(button, ['left', 'center', 'right']);\n\n event.currentTarget.classList.remove(this.align);\n if (this.align !== styleType) {\n event.currentTarget.classList.add(styleType);\n }\n this.actions.changeTextStyle({ textAlign: styleType });\n\n this.align = styleType;\n }\n }\n\n /**\n * text align set handler\n * @param {number} value - range value\n * @param {boolean} isLast - Is last change\n * @private\n */\n _changeTextRnageHandler(value, isLast) {\n this.actions.changeTextStyle(\n {\n fontSize: value,\n },\n !isLast\n );\n }\n\n /**\n * change color handler\n * @param {string} color - change color string\n * @private\n */\n _changeColorHandler(color) {\n color = color || 'transparent';\n this.actions.changeTextStyle({\n fill: color,\n });\n }\n}\n","/**\n * @param {Object} submenuInfo - submenu info for make template\n * @param {Locale} locale - Translate text\n * @param {Function} makeSvgIcon - svg icon generator\n * @returns {string}\n */\nexport default ({ locale, makeSvgIcon }) => `\n
                        \n
                      • \n
                        \n
                        \n ${makeSvgIcon(['normal', 'active'], 'text-bold', true)}\n
                        \n \n
                        \n
                        \n
                        \n ${makeSvgIcon(['normal', 'active'], 'text-italic', true)}\n
                        \n \n
                        \n
                        \n
                        \n ${makeSvgIcon(['normal', 'active'], 'text-underline', true)}\n
                        \n \n
                        \n
                      • \n
                      • \n
                        \n
                      • \n
                      • \n
                        \n
                        \n ${makeSvgIcon(['normal', 'active'], 'text-align-left', true)}\n
                        \n \n
                        \n
                        \n
                        \n ${makeSvgIcon(['normal', 'active'], 'text-align-center', true)}\n
                        \n \n
                        \n
                        \n
                        \n ${makeSvgIcon(['normal', 'active'], 'text-align-right', true)}\n
                        \n \n
                        \n
                      • \n
                      • \n
                        \n
                      • \n
                      • \n
                        \n
                      • \n
                      • \n
                        \n
                      • \n
                      • \n \n
                        \n \n
                      • \n
                      \n`;\n","import Submenu from '@/ui/submenuBase';\nimport templateHtml from '@/ui/template/submenu/mask';\nimport { assignmentForDestroy, isSupportFileApi } from '@/util';\n\n/**\n * Mask ui class\n * @class\n * @ignore\n */\nclass Mask extends Submenu {\n constructor(subMenuElement, { locale, makeSvgIcon, menuBarPosition, usageStatistics }) {\n super(subMenuElement, {\n locale,\n name: 'mask',\n makeSvgIcon,\n menuBarPosition,\n templateHtml,\n usageStatistics,\n });\n\n this._els = {\n applyButton: this.selector('.tie-mask-apply'),\n maskImageButton: this.selector('.tie-mask-image-file'),\n };\n }\n\n /**\n * Destroys the instance.\n */\n destroy() {\n this._removeEvent();\n\n assignmentForDestroy(this);\n }\n\n /**\n * Add event for mask\n * @param {Object} actions - actions for crop\n * @param {Function} actions.loadImageFromURL - load image action\n * @param {Function} actions.applyFilter - apply filter action\n */\n addEvent(actions) {\n const loadMaskFile = this._loadMaskFile.bind(this);\n const applyMask = this._applyMask.bind(this);\n\n this.eventHandler = {\n loadMaskFile,\n applyMask,\n };\n\n this.actions = actions;\n this._els.maskImageButton.addEventListener('change', loadMaskFile);\n this._els.applyButton.addEventListener('click', applyMask);\n }\n\n /**\n * Remove event\n * @private\n */\n _removeEvent() {\n this._els.maskImageButton.removeEventListener('change', this.eventHandler.loadMaskFile);\n this._els.applyButton.removeEventListener('click', this.eventHandler.applyMask);\n }\n\n /**\n * Apply mask\n * @private\n */\n _applyMask() {\n this.actions.applyFilter();\n this._els.applyButton.classList.remove('active');\n }\n\n /**\n * Load mask file\n * @param {object} event - File change event object\n * @private\n */\n _loadMaskFile(event) {\n let imgUrl;\n\n if (!isSupportFileApi()) {\n alert('This browser does not support file-api');\n }\n\n const [file] = event.target.files;\n\n if (file) {\n imgUrl = URL.createObjectURL(file);\n this.actions.loadImageFromURL(imgUrl, file);\n this._els.applyButton.classList.add('active');\n }\n }\n}\n\nexport default Mask;\n","/**\n * @param {Object} submenuInfo - submenu info for make template\n * @param {Locale} locale - Translate text\n * @param {Function} makeSvgIcon - svg icon generator\n * @returns {string}\n */\nexport default ({ locale, makeSvgIcon }) => `\n
                        \n
                      • \n
                        \n
                        \n \n ${makeSvgIcon(['normal', 'active'], 'mask-load', true)}\n
                        \n \n
                        \n
                      • \n
                      • \n
                        \n
                      • \n
                      • \n
                        \n ${makeSvgIcon(['normal', 'active'], 'apply')}\n \n
                        \n
                      • \n
                      \n`;\n","import snippet from 'tui-code-snippet';\nimport Colorpicker from '@/ui/tools/colorpicker';\nimport Submenu from '@/ui/submenuBase';\nimport templateHtml from '@/ui/template/submenu/icon';\nimport { isSupportFileApi, assignmentForDestroy } from '@/util';\nimport { defaultIconPath } from '@/consts';\n\n/**\n * Icon ui class\n * @class\n * @ignore\n */\nclass Icon extends Submenu {\n constructor(subMenuElement, { locale, makeSvgIcon, menuBarPosition, usageStatistics }) {\n super(subMenuElement, {\n locale,\n name: 'icon',\n makeSvgIcon,\n menuBarPosition,\n templateHtml,\n usageStatistics,\n });\n\n this.iconType = null;\n this._iconMap = {};\n\n this._els = {\n registerIconButton: this.selector('.tie-icon-image-file'),\n addIconButton: this.selector('.tie-icon-add-button'),\n iconColorpicker: new Colorpicker(\n this.selector('.tie-icon-color'),\n '#ffbb3b',\n this.toggleDirection,\n this.usageStatistics\n ),\n };\n }\n\n /**\n * Destroys the instance.\n */\n destroy() {\n this._removeEvent();\n this._els.iconColorpicker.destroy();\n\n assignmentForDestroy(this);\n }\n\n /**\n * Add event for icon\n * @param {Object} actions - actions for icon\n * @param {Function} actions.registerCustomIcon - register icon\n * @param {Function} actions.addIcon - add icon\n * @param {Function} actions.changeColor - change icon color\n */\n addEvent(actions) {\n const registerIcon = this._registerIconHandler.bind(this);\n const addIcon = this._addIconHandler.bind(this);\n\n this.eventHandler = {\n registerIcon,\n addIcon,\n };\n\n this.actions = actions;\n this._els.iconColorpicker.on('change', this._changeColorHandler.bind(this));\n this._els.registerIconButton.addEventListener('change', registerIcon);\n this._els.addIconButton.addEventListener('click', addIcon);\n }\n\n /**\n * Remove event\n * @private\n */\n _removeEvent() {\n this._els.iconColorpicker.off();\n this._els.registerIconButton.removeEventListener('change', this.eventHandler.registerIcon);\n this._els.addIconButton.removeEventListener('click', this.eventHandler.addIcon);\n }\n\n /**\n * Clear icon type\n */\n clearIconType() {\n this._els.addIconButton.classList.remove(this.iconType);\n this.iconType = null;\n }\n\n /**\n * Register default icon\n */\n registerDefaultIcon() {\n snippet.forEach(defaultIconPath, (path, type) => {\n this.actions.registerDefaultIcons(type, path);\n });\n }\n\n /**\n * Set icon picker color\n * @param {string} iconColor - rgb color string\n */\n setIconPickerColor(iconColor) {\n this._els.iconColorpicker.color = iconColor;\n }\n\n /**\n * Returns the menu to its default state.\n */\n changeStandbyMode() {\n this.clearIconType();\n this.actions.cancelAddIcon();\n }\n\n /**\n * Change icon color\n * @param {string} color - color for change\n * @private\n */\n _changeColorHandler(color) {\n color = color || 'transparent';\n this.actions.changeColor(color);\n }\n\n /**\n * Change icon color\n * @param {object} event - add button event object\n * @private\n */\n _addIconHandler(event) {\n const button = event.target.closest('.tui-image-editor-button');\n\n if (button) {\n const iconType = button.getAttribute('data-icontype');\n const iconColor = this._els.iconColorpicker.color;\n this.actions.discardSelection();\n this.actions.changeSelectableAll(false);\n this._els.addIconButton.classList.remove(this.iconType);\n this._els.addIconButton.classList.add(iconType);\n\n if (this.iconType === iconType) {\n this.changeStandbyMode();\n } else {\n this.actions.addIcon(iconType, iconColor);\n this.iconType = iconType;\n }\n }\n }\n\n /**\n * register icon\n * @param {object} event - file change event object\n * @private\n */\n _registerIconHandler(event) {\n let imgUrl;\n\n if (!isSupportFileApi) {\n alert('This browser does not support file-api');\n }\n\n const [file] = event.target.files;\n\n if (file) {\n imgUrl = URL.createObjectURL(file);\n this.actions.registerCustomIcon(imgUrl, file);\n }\n }\n}\n\nexport default Icon;\n","/**\n * @param {Object} submenuInfo - submenu info for make template\n * @param {Locale} locale - Translate text\n * @param {Function} makeSvgIcon - svg icon generator\n * @returns {string}\n */\nexport default ({ locale, makeSvgIcon }) => `\n
                        \n
                      • \n
                        \n
                        \n ${makeSvgIcon(['normal', 'active'], 'icon-arrow', true)}\n
                        \n \n
                        \n
                        \n
                        \n ${makeSvgIcon(['normal', 'active'], 'icon-arrow-2', true)}\n
                        \n \n
                        \n
                        \n
                        \n ${makeSvgIcon(['normal', 'active'], 'icon-arrow-3', true)}\n
                        \n \n
                        \n
                        \n
                        \n ${makeSvgIcon(['normal', 'active'], 'icon-star', true)}\n
                        \n \n
                        \n
                        \n
                        \n ${makeSvgIcon(['normal', 'active'], 'icon-star-2', true)}\n
                        \n \n
                        \n\n
                        \n
                        \n ${makeSvgIcon(['normal', 'active'], 'icon-polygon', true)}\n
                        \n \n
                        \n\n
                        \n
                        \n ${makeSvgIcon(['normal', 'active'], 'icon-location', true)}\n
                        \n \n
                        \n\n
                        \n
                        \n ${makeSvgIcon(['normal', 'active'], 'icon-heart', true)}\n
                        \n \n
                        \n\n
                        \n
                        \n ${makeSvgIcon(['normal', 'active'], 'icon-bubble', true)}\n
                        \n \n
                        \n
                      • \n
                      • \n
                        \n
                      • \n
                      • \n
                        \n
                        \n \n ${makeSvgIcon(['normal', 'active'], 'icon-load', true)}\n
                        \n \n
                        \n
                      • \n
                      • \n
                        \n
                      • \n
                      • \n
                        \n
                      • \n
                      \n`;\n","import Colorpicker from '@/ui/tools/colorpicker';\nimport Range from '@/ui/tools/range';\nimport Submenu from '@/ui/submenuBase';\nimport templateHtml from '@/ui/template/submenu/draw';\nimport { assignmentForDestroy, getRgb } from '@/util';\nimport { defaultDrawRangeValues } from '@/consts';\n\nconst DRAW_OPACITY = 0.7;\n\n/**\n * Draw ui class\n * @class\n * @ignore\n */\nclass Draw extends Submenu {\n constructor(subMenuElement, { locale, makeSvgIcon, menuBarPosition, usageStatistics }) {\n super(subMenuElement, {\n locale,\n name: 'draw',\n makeSvgIcon,\n menuBarPosition,\n templateHtml,\n usageStatistics,\n });\n\n this._els = {\n lineSelectButton: this.selector('.tie-draw-line-select-button'),\n drawColorPicker: new Colorpicker(\n this.selector('.tie-draw-color'),\n '#00a9ff',\n this.toggleDirection,\n this.usageStatistics\n ),\n drawRange: new Range(\n {\n slider: this.selector('.tie-draw-range'),\n input: this.selector('.tie-draw-range-value'),\n },\n defaultDrawRangeValues\n ),\n };\n\n this.type = null;\n this.color = this._els.drawColorPicker.color;\n this.width = this._els.drawRange.value;\n }\n\n /**\n * Destroys the instance.\n */\n destroy() {\n this._removeEvent();\n this._els.drawColorPicker.destroy();\n this._els.drawRange.destroy();\n\n assignmentForDestroy(this);\n }\n\n /**\n * Add event for draw\n * @param {Object} actions - actions for crop\n * @param {Function} actions.setDrawMode - set draw mode\n */\n addEvent(actions) {\n this.eventHandler.changeDrawType = this._changeDrawType.bind(this);\n\n this.actions = actions;\n this._els.lineSelectButton.addEventListener('click', this.eventHandler.changeDrawType);\n this._els.drawColorPicker.on('change', this._changeDrawColor.bind(this));\n this._els.drawRange.on('change', this._changeDrawRange.bind(this));\n }\n\n /**\n * Remove event\n * @private\n */\n _removeEvent() {\n this._els.lineSelectButton.removeEventListener('click', this.eventHandler.changeDrawType);\n this._els.drawColorPicker.off();\n this._els.drawRange.off();\n }\n\n /**\n * set draw mode - action runner\n */\n setDrawMode() {\n this.actions.setDrawMode(this.type, {\n width: this.width,\n color: getRgb(this.color, DRAW_OPACITY),\n });\n }\n\n /**\n * Returns the menu to its default state.\n */\n changeStandbyMode() {\n this.type = null;\n this.actions.stopDrawingMode();\n this.actions.changeSelectableAll(true);\n this._els.lineSelectButton.classList.remove('free');\n this._els.lineSelectButton.classList.remove('line');\n }\n\n /**\n * Executed when the menu starts.\n */\n changeStartMode() {\n this.type = 'free';\n this._els.lineSelectButton.classList.add('free');\n this.setDrawMode();\n }\n\n /**\n * Change draw type event\n * @param {object} event - line select event\n * @private\n */\n _changeDrawType(event) {\n const button = event.target.closest('.tui-image-editor-button');\n if (button) {\n const lineType = this.getButtonType(button, ['free', 'line']);\n this.actions.discardSelection();\n\n if (this.type === lineType) {\n this.changeStandbyMode();\n\n return;\n }\n\n this.changeStandbyMode();\n this.type = lineType;\n this._els.lineSelectButton.classList.add(lineType);\n this.setDrawMode();\n }\n }\n\n /**\n * Change drawing color\n * @param {string} color - select drawing color\n * @private\n */\n _changeDrawColor(color) {\n this.color = color || 'transparent';\n if (!this.type) {\n this.changeStartMode();\n } else {\n this.setDrawMode();\n }\n }\n\n /**\n * Change drawing Range\n * @param {number} value - select drawing range\n * @private\n */\n _changeDrawRange(value) {\n this.width = value;\n if (!this.type) {\n this.changeStartMode();\n } else {\n this.setDrawMode();\n }\n }\n}\n\nexport default Draw;\n","/**\n * @param {Object} submenuInfo - submenu info for make template\n * @param {Locale} locale - Translate text\n * @param {Function} makeSvgIcon - svg icon generator\n * @returns {string}\n */\nexport default ({ locale, makeSvgIcon }) => `\n
                        \n
                      • \n
                        \n
                        \n ${makeSvgIcon(['normal', 'active'], 'draw-free', true)}\n
                        \n \n
                        \n
                        \n
                        \n ${makeSvgIcon(['normal', 'active'], 'draw-line', true)}\n
                        \n \n
                        \n
                      • \n
                      • \n
                        \n
                      • \n
                      • \n
                        \n
                      • \n
                      • \n
                        \n
                      • \n
                      • \n \n
                        \n \n
                      • \n
                      \n`;\n","import snippet from 'tui-code-snippet';\nimport Colorpicker from '@/ui/tools/colorpicker';\nimport Range from '@/ui/tools/range';\nimport Submenu from '@/ui/submenuBase';\nimport templateHtml from '@/ui/template/submenu/filter';\nimport { toInteger, toCamelCase, assignmentForDestroy } from '@/util';\nimport { defaultFilterRangeValues as FILTER_RANGE } from '@/consts';\n\nconst PICKER_CONTROL_HEIGHT = '130px';\nconst BLEND_OPTIONS = ['add', 'diff', 'subtract', 'multiply', 'screen', 'lighten', 'darken'];\nconst FILTER_OPTIONS = [\n 'grayscale',\n 'invert',\n 'sepia',\n 'vintage',\n 'blur',\n 'sharpen',\n 'emboss',\n 'remove-white',\n 'brightness',\n 'noise',\n 'pixelate',\n 'color-filter',\n 'tint',\n 'multiply',\n 'blend',\n];\nconst filterNameMap = {\n grayscale: 'grayscale',\n invert: 'invert',\n sepia: 'sepia',\n blur: 'blur',\n sharpen: 'sharpen',\n emboss: 'emboss',\n removeWhite: 'removeColor',\n brightness: 'brightness',\n contrast: 'contrast',\n saturation: 'saturation',\n vintage: 'vintage',\n polaroid: 'polaroid',\n noise: 'noise',\n pixelate: 'pixelate',\n colorFilter: 'removeColor',\n tint: 'blendColor',\n multiply: 'blendColor',\n blend: 'blendColor',\n hue: 'hue',\n gamma: 'gamma',\n};\nconst RANGE_INSTANCE_NAMES = [\n 'removewhiteDistanceRange',\n 'colorfilterThresholdRange',\n 'pixelateRange',\n 'noiseRange',\n 'brightnessRange',\n 'tintOpacity',\n];\nconst COLORPICKER_INSTANCE_NAMES = ['filterBlendColor', 'filterMultiplyColor', 'filterTintColor'];\n\n/**\n * Filter ui class\n * @class\n * @ignore\n */\nclass Filter extends Submenu {\n constructor(subMenuElement, { locale, menuBarPosition, usageStatistics }) {\n super(subMenuElement, {\n locale,\n name: 'filter',\n menuBarPosition,\n templateHtml,\n usageStatistics,\n });\n\n this.selectBoxShow = false;\n\n this.checkedMap = {};\n this._makeControlElement();\n }\n\n /**\n * Destroys the instance.\n */\n destroy() {\n this._removeEvent();\n this._destroyToolInstance();\n\n assignmentForDestroy(this);\n }\n\n /**\n * Remove event for filter\n */\n _removeEvent() {\n snippet.forEach(FILTER_OPTIONS, (filter) => {\n const filterCheckElement = this.selector(`.tie-${filter}`);\n const filterNameCamelCase = toCamelCase(filter);\n\n filterCheckElement.removeEventListener('change', this.eventHandler[filterNameCamelCase]);\n });\n\n snippet.forEach([...RANGE_INSTANCE_NAMES, ...COLORPICKER_INSTANCE_NAMES], (instanceName) => {\n this._els[instanceName].off();\n });\n\n this._els.blendType.removeEventListener('change', this.eventHandler.changeBlendFilter);\n this._els.blendType.removeEventListener('click', this.eventHandler.changeBlendFilter);\n }\n\n _destroyToolInstance() {\n snippet.forEach([...RANGE_INSTANCE_NAMES, ...COLORPICKER_INSTANCE_NAMES], (instanceName) => {\n this._els[instanceName].destroy();\n });\n }\n\n /**\n * Add event for filter\n * @param {Object} actions - actions for crop\n * @param {Function} actions.applyFilter - apply filter option\n */\n addEvent({ applyFilter }) {\n const changeFilterState = (filterName) =>\n this._changeFilterState.bind(this, applyFilter, filterName);\n const changeFilterStateForRange = (filterName) => (value, isLast) =>\n this._changeFilterState(applyFilter, filterName, isLast);\n\n this.eventHandler = {\n changeBlendFilter: changeFilterState('blend'),\n blandTypeClick: (event) => event.stopPropagation(),\n };\n\n snippet.forEach(FILTER_OPTIONS, (filter) => {\n const filterCheckElement = this.selector(`.tie-${filter}`);\n const filterNameCamelCase = toCamelCase(filter);\n this.checkedMap[filterNameCamelCase] = filterCheckElement;\n this.eventHandler[filterNameCamelCase] = changeFilterState(filterNameCamelCase);\n\n filterCheckElement.addEventListener('change', this.eventHandler[filterNameCamelCase]);\n });\n\n this._els.removewhiteDistanceRange.on('change', changeFilterStateForRange('removeWhite'));\n this._els.colorfilterThresholdRange.on('change', changeFilterStateForRange('colorFilter'));\n this._els.pixelateRange.on('change', changeFilterStateForRange('pixelate'));\n this._els.noiseRange.on('change', changeFilterStateForRange('noise'));\n this._els.brightnessRange.on('change', changeFilterStateForRange('brightness'));\n\n this._els.filterBlendColor.on('change', this.eventHandler.changeBlendFilter);\n this._els.filterMultiplyColor.on('change', changeFilterState('multiply'));\n this._els.filterTintColor.on('change', changeFilterState('tint'));\n this._els.tintOpacity.on('change', changeFilterStateForRange('tint'));\n this._els.filterMultiplyColor.on('changeShow', this.colorPickerChangeShow.bind(this));\n this._els.filterTintColor.on('changeShow', this.colorPickerChangeShow.bind(this));\n this._els.filterBlendColor.on('changeShow', this.colorPickerChangeShow.bind(this));\n\n this._els.blendType.addEventListener('change', this.eventHandler.changeBlendFilter);\n this._els.blendType.addEventListener('click', this.eventHandler.blandTypeClick);\n }\n\n /**\n * Set filter for undo changed\n * @param {Object} changedFilterInfos - changed command infos\n * @param {string} type - filter type\n * @param {string} action - add or remove\n * @param {Object} options - filter options\n */\n setFilterState(changedFilterInfos) {\n const { type, options, action } = changedFilterInfos;\n const filterName = this._getFilterNameFromOptions(type, options);\n const isRemove = action === 'remove';\n\n if (!isRemove) {\n this._setFilterState(filterName, options);\n }\n\n this.checkedMap[filterName].checked = !isRemove;\n }\n\n /**\n * Set filter for undo changed\n * @param {string} filterName - filter name\n * @param {Object} options - filter options\n * @private\n */\n // eslint-disable-next-line complexity\n _setFilterState(filterName, options) {\n if (filterName === 'colorFilter') {\n this._els.colorfilterThresholdRange.value = options.distance;\n } else if (filterName === 'removeWhite') {\n this._els.removewhiteDistanceRange.value = options.distance;\n } else if (filterName === 'pixelate') {\n this._els.pixelateRange.value = options.blocksize;\n } else if (filterName === 'brightness') {\n this._els.brightnessRange.value = options.brightness;\n } else if (filterName === 'noise') {\n this._els.noiseRange.value = options.noise;\n } else if (filterName === 'tint') {\n this._els.tintOpacity.value = options.alpha;\n this._els.filterTintColor.color = options.color;\n } else if (filterName === 'blend') {\n this._els.filterBlendColor.color = options.color;\n } else if (filterName === 'multiply') {\n this._els.filterMultiplyColor.color = options.color;\n }\n }\n\n /**\n * Get filter name\n * @param {string} type - filter type\n * @param {Object} options - filter options\n * @returns {string} filter name\n * @private\n */\n _getFilterNameFromOptions(type, options) {\n let filterName = type;\n\n if (type === 'removeColor') {\n filterName = snippet.isExisty(options.useAlpha) ? 'removeWhite' : 'colorFilter';\n } else if (type === 'blendColor') {\n filterName = {\n add: 'blend',\n multiply: 'multiply',\n tint: 'tint',\n }[options.mode];\n }\n\n return filterName;\n }\n\n /**\n * Add event for filter\n * @param {Function} applyFilter - actions for firter\n * @param {string} filterName - filter name\n * @param {boolean} [isLast] - Is last change\n */\n _changeFilterState(applyFilter, filterName, isLast = true) {\n const apply = this.checkedMap[filterName].checked;\n const type = filterNameMap[filterName];\n\n const checkboxGroup = this.checkedMap[filterName].closest('.tui-image-editor-checkbox-group');\n if (checkboxGroup) {\n if (apply) {\n checkboxGroup.classList.remove('tui-image-editor-disabled');\n } else {\n checkboxGroup.classList.add('tui-image-editor-disabled');\n }\n }\n applyFilter(apply, type, this._getFilterOption(filterName), !isLast);\n }\n\n /**\n * Get filter option\n * @param {String} type - filter type\n * @returns {Object} filter option object\n * @private\n */\n // eslint-disable-next-line complexity\n _getFilterOption(type) {\n const option = {};\n switch (type) {\n case 'removeWhite':\n option.color = '#FFFFFF';\n option.useAlpha = false;\n option.distance = parseFloat(this._els.removewhiteDistanceRange.value);\n break;\n case 'colorFilter':\n option.color = '#FFFFFF';\n option.distance = parseFloat(this._els.colorfilterThresholdRange.value);\n break;\n case 'pixelate':\n option.blocksize = toInteger(this._els.pixelateRange.value);\n break;\n case 'noise':\n option.noise = toInteger(this._els.noiseRange.value);\n break;\n case 'brightness':\n option.brightness = parseFloat(this._els.brightnessRange.value);\n break;\n case 'blend':\n option.mode = 'add';\n option.color = this._els.filterBlendColor.color;\n option.mode = this._els.blendType.value;\n break;\n case 'multiply':\n option.mode = 'multiply';\n option.color = this._els.filterMultiplyColor.color;\n break;\n case 'tint':\n option.mode = 'tint';\n option.color = this._els.filterTintColor.color;\n option.alpha = this._els.tintOpacity.value;\n break;\n case 'blur':\n option.blur = this._els.blurRange.value;\n break;\n default:\n break;\n }\n\n return option;\n }\n\n /**\n * Make submenu range and colorpicker control\n * @private\n */\n _makeControlElement() {\n this._els = {\n removewhiteDistanceRange: new Range(\n { slider: this.selector('.tie-removewhite-distance-range') },\n FILTER_RANGE.removewhiteDistanceRange\n ),\n brightnessRange: new Range(\n { slider: this.selector('.tie-brightness-range') },\n FILTER_RANGE.brightnessRange\n ),\n noiseRange: new Range({ slider: this.selector('.tie-noise-range') }, FILTER_RANGE.noiseRange),\n pixelateRange: new Range(\n { slider: this.selector('.tie-pixelate-range') },\n FILTER_RANGE.pixelateRange\n ),\n colorfilterThresholdRange: new Range(\n { slider: this.selector('.tie-colorfilter-threshold-range') },\n FILTER_RANGE.colorfilterThresholdRange\n ),\n filterTintColor: new Colorpicker(\n this.selector('.tie-filter-tint-color'),\n '#03bd9e',\n this.toggleDirection,\n this.usageStatistics\n ),\n filterMultiplyColor: new Colorpicker(\n this.selector('.tie-filter-multiply-color'),\n '#515ce6',\n this.toggleDirection,\n this.usageStatistics\n ),\n filterBlendColor: new Colorpicker(\n this.selector('.tie-filter-blend-color'),\n '#ffbb3b',\n this.toggleDirection,\n this.usageStatistics\n ),\n blurRange: FILTER_RANGE.blurFilterRange,\n };\n\n this._els.tintOpacity = this._pickerWithRange(this._els.filterTintColor.pickerControl);\n this._els.blendType = this._pickerWithSelectbox(this._els.filterBlendColor.pickerControl);\n\n this.colorPickerControls.push(this._els.filterTintColor);\n this.colorPickerControls.push(this._els.filterMultiplyColor);\n this.colorPickerControls.push(this._els.filterBlendColor);\n }\n\n /**\n * Make submenu control for picker & range mixin\n * @param {HTMLElement} pickerControl - pickerControl dom element\n * @returns {Range}\n * @private\n */\n _pickerWithRange(pickerControl) {\n const rangeWrap = document.createElement('div');\n const rangeLabel = document.createElement('label');\n const slider = document.createElement('div');\n\n slider.id = 'tie-filter-tint-opacity';\n rangeLabel.innerHTML = 'Opacity';\n rangeWrap.appendChild(rangeLabel);\n rangeWrap.appendChild(slider);\n pickerControl.appendChild(rangeWrap);\n pickerControl.style.height = PICKER_CONTROL_HEIGHT;\n\n return new Range({ slider }, FILTER_RANGE.tintOpacityRange);\n }\n\n /**\n * Make submenu control for picker & selectbox\n * @param {HTMLElement} pickerControl - pickerControl dom element\n * @returns {HTMLElement}\n * @private\n */\n _pickerWithSelectbox(pickerControl) {\n const selectlistWrap = document.createElement('div');\n const selectlist = document.createElement('select');\n const optionlist = document.createElement('ul');\n\n selectlistWrap.className = 'tui-image-editor-selectlist-wrap';\n optionlist.className = 'tui-image-editor-selectlist';\n\n selectlistWrap.appendChild(selectlist);\n selectlistWrap.appendChild(optionlist);\n\n this._makeSelectOptionList(selectlist);\n\n pickerControl.appendChild(selectlistWrap);\n pickerControl.style.height = PICKER_CONTROL_HEIGHT;\n\n this._drawSelectOptionList(selectlist, optionlist);\n this._pickerWithSelectboxForAddEvent(selectlist, optionlist);\n\n return selectlist;\n }\n\n /**\n * Make selectbox option list custom style\n * @param {HTMLElement} selectlist - selectbox element\n * @param {HTMLElement} optionlist - custom option list item element\n * @private\n */\n _drawSelectOptionList(selectlist, optionlist) {\n const options = selectlist.querySelectorAll('option');\n snippet.forEach(options, (option) => {\n const optionElement = document.createElement('li');\n optionElement.innerHTML = option.innerHTML;\n optionElement.setAttribute('data-item', option.value);\n optionlist.appendChild(optionElement);\n });\n }\n\n /**\n * custom selectbox custom event\n * @param {HTMLElement} selectlist - selectbox element\n * @param {HTMLElement} optionlist - custom option list item element\n * @private\n */\n _pickerWithSelectboxForAddEvent(selectlist, optionlist) {\n optionlist.addEventListener('click', (event) => {\n const optionValue = event.target.getAttribute('data-item');\n const fireEvent = document.createEvent('HTMLEvents');\n\n selectlist.querySelector(`[value=\"${optionValue}\"]`).selected = true;\n fireEvent.initEvent('change', true, true);\n\n selectlist.dispatchEvent(fireEvent);\n\n this.selectBoxShow = false;\n optionlist.style.display = 'none';\n });\n\n selectlist.addEventListener('mousedown', (event) => {\n event.preventDefault();\n this.selectBoxShow = !this.selectBoxShow;\n optionlist.style.display = this.selectBoxShow ? 'block' : 'none';\n optionlist.setAttribute('data-selectitem', selectlist.value);\n optionlist.querySelector(`[data-item='${selectlist.value}']`).classList.add('active');\n });\n }\n\n /**\n * Make option list for select control\n * @param {HTMLElement} selectlist - blend option select list element\n * @private\n */\n _makeSelectOptionList(selectlist) {\n snippet.forEach(BLEND_OPTIONS, (option) => {\n const selectOption = document.createElement('option');\n selectOption.setAttribute('value', option);\n selectOption.innerHTML = option.replace(/^[a-z]/, ($0) => $0.toUpperCase());\n selectlist.appendChild(selectOption);\n });\n }\n}\n\nexport default Filter;\n","/**\n * @param {Locale} locale - Translate text\n * @returns {string}\n */\nexport default ({ locale }) => `\n
                        \n
                      • \n
                        \n
                        \n \n
                        \n
                        \n \n
                        \n
                        \n \n
                        \n
                        \n \n
                        \n
                        \n \n
                        \n
                        \n \n
                        \n
                        \n \n
                        \n
                        \n
                      • \n
                      • \n
                        \n
                      • \n
                      • \n
                        \n
                        \n
                        \n \n
                        \n
                        \n
                        \n \n
                        \n
                        \n
                        \n
                        \n
                        \n \n
                        \n
                        \n
                        \n
                        \n
                        \n
                        \n
                        \n \n
                        \n
                        \n
                        \n
                        \n
                        \n
                      • \n
                      • \n
                        \n
                      • \n
                      • \n
                        \n
                        \n \n
                        \n
                        \n
                        \n
                        \n
                        \n
                        \n
                        \n
                        \n \n
                        \n
                        \n
                        \n \n
                        \n
                        \n
                        \n
                      • \n
                      • \n
                        \n
                      • \n
                      • \n
                        \n
                        \n
                        \n \n
                        \n
                        \n
                        \n
                        \n
                        \n \n
                        \n
                        \n
                        \n
                        \n
                        \n \n
                        \n
                        \n
                      • \n
                      \n`;\n","import Panel from '@/ui/panelMenu';\nimport templateHtml from '@/ui/template/submenu/history';\nimport { assignmentForDestroy } from '@/util';\n\nconst historyClassName = 'history-item';\nconst selectedClassName = 'selected-item';\nconst disabledClassName = 'disabled-item';\n\n/**\n * History ui class\n * @class\n * @ignore\n */\nclass History extends Panel {\n constructor(menuElement, { locale, makeSvgIcon }) {\n super(menuElement, { name: 'history' });\n menuElement.classList.add('enabled');\n\n this.locale = locale;\n this.makeSvgIcon = makeSvgIcon;\n this._eventHandler = {};\n this._historyIndex = this.getListLength();\n }\n\n /**\n * Add history\n * @param {string} name - name of history\n * @param {?string} detail - detail information of history\n */\n add({ name, detail }) {\n if (this._hasDisabledItem()) {\n this.deleteListItemElement(this._historyIndex + 1, this.getListLength());\n }\n\n const html = templateHtml({ locale: this.locale, makeSvgIcon: this.makeSvgIcon, name, detail });\n const item = this.makeListItemElement(html);\n\n this.pushListItemElement(item);\n this._historyIndex = this.getListLength() - 1;\n this._selectItem(this._historyIndex);\n }\n\n /**\n * Init history\n */\n init() {\n this.deleteListItemElement(1, this.getListLength());\n this._historyIndex = 0;\n this._selectItem(this._historyIndex);\n }\n\n /**\n * Clear history\n */\n clear() {\n this.deleteListItemElement(0, this.getListLength());\n this._historyIndex = -1;\n }\n\n /**\n * Select previous history of current selected history\n */\n prev() {\n this._historyIndex -= 1;\n this._selectItem(this._historyIndex);\n }\n\n /**\n * Select next history of current selected history\n */\n next() {\n this._historyIndex += 1;\n this._selectItem(this._historyIndex);\n }\n\n /**\n * Whether history menu has disabled item\n * @returns {boolean}\n */\n _hasDisabledItem() {\n return this.getListLength() - 1 > this._historyIndex;\n }\n\n /**\n * Add history menu event\n * @private\n */\n _addHistoryEventListener() {\n this._eventHandler.history = (event) => this._clickHistoryItem(event);\n this.listElement.addEventListener('click', this._eventHandler.history);\n }\n\n /**\n * Remove history menu event\n * @private\n */\n _removeHistoryEventListener() {\n this.listElement.removeEventListener('click', this._eventHandler.history);\n }\n\n /**\n * onClick history menu event listener\n * @param {object} event - event object\n * @private\n */\n _clickHistoryItem(event) {\n const { target } = event;\n const item = target.closest(`.${historyClassName}`);\n\n if (!item) {\n return;\n }\n\n const index = Number.parseInt(item.getAttribute('data-index'), 10);\n\n if (index !== this._historyIndex) {\n const count = Math.abs(index - this._historyIndex);\n\n if (index < this._historyIndex) {\n this._actions.undo(count);\n } else {\n this._actions.redo(count);\n }\n }\n }\n\n /**\n * Change item's state to selected state\n * @param {number} index - index of selected item\n */\n _selectItem(index) {\n for (let i = 0; i < this.getListLength(); i += 1) {\n this.removeClass(i, selectedClassName);\n this.removeClass(i, disabledClassName);\n if (i > index) {\n this.addClass(i, disabledClassName);\n }\n }\n this.addClass(index, selectedClassName);\n }\n\n /**\n * Destroys the instance.\n */\n destroy() {\n this.removeEvent();\n\n assignmentForDestroy(this);\n }\n\n /**\n * Add event for history\n * @param {Object} actions - actions for crop\n * @param {Function} actions.undo - undo action\n * @param {Function} actions.redo - redo action\n */\n addEvent(actions) {\n this._actions = actions;\n this._addHistoryEventListener();\n }\n\n /**\n * Remove event\n * @private\n */\n removeEvent() {\n this._removeHistoryEventListener();\n }\n}\n\nexport default History;\n","/**\n * Menu Panel Class\n * @class\n * @ignore\n */\n\nclass Panel {\n /**\n * @param {HTMLElement} menuElement - menu dom element\n * @param {Object} options - menu options\n * @param {string} options.name - name of panel menu\n */\n constructor(menuElement, { name }) {\n this.name = name;\n this.items = [];\n\n this.panelElement = this._makePanelElement();\n this.listElement = this._makeListElement();\n\n this.panelElement.appendChild(this.listElement);\n menuElement.appendChild(this.panelElement);\n }\n\n /**\n * Make Panel element\n * @returns {HTMLElement}\n */\n _makePanelElement() {\n const panel = document.createElement('div');\n\n panel.className = `tie-panel-${this.name}`;\n\n return panel;\n }\n\n /**\n * Make list element\n * @returns {HTMLElement} list element\n * @private\n */\n _makeListElement() {\n const list = document.createElement('ol');\n\n list.className = `${this.name}-list`;\n\n return list;\n }\n\n /**\n * Make list item element\n * @param {string} html - history list item html\n * @returns {HTMLElement} list item element\n */\n makeListItemElement(html) {\n const listItem = document.createElement('li');\n\n listItem.innerHTML = html;\n listItem.className = `${this.name}-item`;\n listItem.setAttribute('data-index', this.items.length);\n\n return listItem;\n }\n\n /**\n * Push list item element\n * @param {HTMLElement} item - list item element to add to the list\n */\n pushListItemElement(item) {\n this.listElement.appendChild(item);\n this.listElement.scrollTop += item.offsetHeight;\n this.items.push(item);\n }\n\n /**\n * Delete list item element\n * @param {number} start - start index to delete\n * @param {number} end - end index to delete\n */\n deleteListItemElement(start, end) {\n const { items } = this;\n\n for (let i = start; i < end; i += 1) {\n this.listElement.removeChild(items[i]);\n }\n items.splice(start, end - start + 1);\n }\n\n /**\n * Get list's length\n * @returns {number}\n */\n getListLength() {\n return this.items.length;\n }\n\n /**\n * Add class name of item\n * @param {number} index - index of item\n * @param {string} className - class name to add\n */\n addClass(index, className) {\n if (this.items[index]) {\n this.items[index].classList.add(className);\n }\n }\n\n /**\n * Remove class name of item\n * @param {number} index - index of item\n * @param {string} className - class name to remove\n */\n removeClass(index, className) {\n if (this.items[index]) {\n this.items[index].classList.remove(className);\n }\n }\n\n /**\n * Toggle class name of item\n * @param {number} index - index of item\n * @param {string} className - class name to remove\n */\n toggleClass(index, className) {\n if (this.items[index]) {\n this.items[index].classList.toggle(className);\n }\n }\n}\n\nexport default Panel;\n","/**\n * @param {Object} submenuInfo - submenu info for make template\n * @param {Locale} locale - Translate text\n * @param {Function} makeSvgIcon - svg icon generator\n * @param {string} name - history name\n * @param {string} detail - history detail information\n * @returns {string}\n */\nexport default ({ locale, makeSvgIcon, name, detail }) => `\n
                      \n
                      \n ${makeSvgIcon(['normal', 'active'], `history-${name.toLowerCase()}`, true)}\n
                      \n \n ${locale.localize(name)}\n ${detail ? `(${locale.localize(detail)})` : ''}\n \n
                      \n ${makeSvgIcon(['normal'], 'history-check', true)}\n
                      \n
                      \n`;\n","/**\n * Translate messages\n */\nclass Locale {\n /**\n * @constructor\n * @param {Object} locale - Locale object for initialise\n */\n constructor(locale) {\n this._locale = locale;\n }\n\n /**\n * localize message\n * @param {string} message - message who will be localized\n * @returns {string}\n */\n localize(message) {\n return this._locale[message] || message;\n }\n}\n\nexport default Locale;\n","import { extend } from 'tui-code-snippet';\nimport Imagetracer from '@/helper/imagetracer';\nimport { isSupportFileApi, base64ToBlob, toInteger, isEmptyCropzone } from '@/util';\nimport { eventNames, historyNames, drawingModes, drawingMenuNames, zoomModes } from '@/consts';\n\nexport default {\n /**\n * Get ui actions\n * @returns {Object} actions for ui\n * @private\n */\n getActions() {\n return {\n main: this._mainAction(),\n shape: this._shapeAction(),\n crop: this._cropAction(),\n flip: this._flipAction(),\n rotate: this._rotateAction(),\n text: this._textAction(),\n mask: this._maskAction(),\n draw: this._drawAction(),\n icon: this._iconAction(),\n filter: this._filterAction(),\n history: this._historyAction(),\n };\n },\n\n /**\n * Main Action\n * @returns {Object} actions for ui main\n * @private\n */\n _mainAction() {\n const exitCropOnAction = () => {\n if (this.ui.submenu === 'crop') {\n this.stopDrawingMode();\n this.ui.changeMenu('crop');\n }\n };\n const setAngleRangeBarOnAction = (angle) => {\n if (this.ui.submenu === 'rotate') {\n this.ui.rotate.setRangeBarAngle('setAngle', angle);\n }\n };\n const setFilterStateRangeBarOnAction = (filterOptions) => {\n if (this.ui.submenu === 'filter') {\n this.ui.filter.setFilterState(filterOptions);\n }\n };\n const onEndUndoRedo = (result) => {\n setAngleRangeBarOnAction(result);\n setFilterStateRangeBarOnAction(result);\n\n return result;\n };\n const toggleZoomMode = () => {\n const zoomMode = this._graphics.getZoomMode();\n\n this.stopDrawingMode();\n if (zoomMode !== zoomModes.ZOOM) {\n this.startDrawingMode(drawingModes.ZOOM);\n this._graphics.startZoomInMode();\n } else {\n this._graphics.endZoomInMode();\n }\n };\n const toggleHandMode = () => {\n const zoomMode = this._graphics.getZoomMode();\n\n this.stopDrawingMode();\n if (zoomMode !== zoomModes.HAND) {\n this.startDrawingMode(drawingModes.ZOOM);\n this._graphics.startHandMode();\n } else {\n this._graphics.endHandMode();\n }\n };\n\n return extend(\n {\n initLoadImage: (imagePath, imageName) =>\n this.loadImageFromURL(imagePath, imageName).then((sizeValue) => {\n exitCropOnAction();\n this.ui.initializeImgUrl = imagePath;\n this.ui.resizeEditor({ imageSize: sizeValue });\n this.clearUndoStack();\n this._invoker.fire(eventNames.EXECUTE_COMMAND, historyNames.LOAD_IMAGE);\n }),\n undo: () => {\n if (!this.isEmptyUndoStack()) {\n exitCropOnAction();\n this.deactivateAll();\n this.undo().then(onEndUndoRedo);\n }\n },\n redo: () => {\n if (!this.isEmptyRedoStack()) {\n exitCropOnAction();\n this.deactivateAll();\n this.redo().then(onEndUndoRedo);\n }\n },\n reset: () => {\n exitCropOnAction();\n this.loadImageFromURL(this.ui.initializeImgUrl, 'resetImage').then((sizeValue) => {\n exitCropOnAction();\n this.ui.resizeEditor({ imageSize: sizeValue });\n this.clearUndoStack();\n this._initHistory();\n });\n },\n delete: () => {\n this.ui.changeHelpButtonEnabled('delete', false);\n exitCropOnAction();\n this.removeActiveObject();\n this.activeObjectId = null;\n },\n deleteAll: () => {\n exitCropOnAction();\n this.clearObjects();\n this.ui.changeHelpButtonEnabled('delete', false);\n this.ui.changeHelpButtonEnabled('deleteAll', false);\n },\n load: (file) => {\n if (!isSupportFileApi()) {\n alert('This browser does not support file-api');\n }\n\n this.ui.initializeImgUrl = URL.createObjectURL(file);\n this.loadImageFromFile(file)\n .then((sizeValue) => {\n exitCropOnAction();\n this.clearUndoStack();\n this.ui.activeMenuEvent();\n this.ui.resizeEditor({ imageSize: sizeValue });\n this._clearHistory();\n this._invoker.fire(eventNames.EXECUTE_COMMAND, historyNames.LOAD_IMAGE);\n })\n ['catch']((message) => Promise.reject(message));\n },\n download: () => {\n const dataURL = this.toDataURL();\n let imageName = this.getImageName();\n let blob, type, w;\n\n if (isSupportFileApi() && window.saveAs) {\n blob = base64ToBlob(dataURL);\n type = blob.type.split('/')[1];\n if (imageName.split('.').pop() !== type) {\n imageName += `.${type}`;\n }\n saveAs(blob, imageName); // eslint-disable-line\n } else {\n w = window.open();\n w.document.body.innerHTML = ``;\n }\n },\n history: (event) => {\n this.ui.toggleHistoryMenu(event);\n },\n zoomIn: () => {\n this.ui.toggleZoomButtonStatus('zoomIn');\n this.deactivateAll();\n toggleZoomMode();\n },\n zoomOut: () => {\n this._graphics.zoomOut();\n },\n hand: () => {\n this.ui.offZoomInButtonStatus();\n this.ui.toggleZoomButtonStatus('hand');\n this.deactivateAll();\n toggleHandMode();\n },\n },\n this._commonAction()\n );\n },\n\n /**\n * Icon Action\n * @returns {Object} actions for ui icon\n * @private\n */\n _iconAction() {\n return extend(\n {\n changeColor: (color) => {\n if (this.activeObjectId) {\n this.changeIconColor(this.activeObjectId, color);\n }\n },\n addIcon: (iconType, iconColor) => {\n this.startDrawingMode('ICON');\n this.setDrawingIcon(iconType, iconColor);\n },\n cancelAddIcon: () => {\n this.ui.icon.clearIconType();\n this.changeSelectableAll(true);\n this.changeCursor('default');\n this.stopDrawingMode();\n },\n registerDefaultIcons: (type, path) => {\n const iconObj = {};\n iconObj[type] = path;\n this.registerIcons(iconObj);\n },\n registerCustomIcon: (imgUrl, file) => {\n const imagetracer = new Imagetracer();\n imagetracer.imageToSVG(\n imgUrl,\n (svgstr) => {\n const [, svgPath] = svgstr.match(/path[^>]*d=\"([^\"]*)\"/);\n const iconObj = {};\n iconObj[file.name] = svgPath;\n this.registerIcons(iconObj);\n this.addIcon(file.name, {\n left: 100,\n top: 100,\n });\n },\n Imagetracer.tracerDefaultOption()\n );\n },\n },\n this._commonAction()\n );\n },\n\n /**\n * Draw Action\n * @returns {Object} actions for ui draw\n * @private\n */\n _drawAction() {\n return extend(\n {\n setDrawMode: (type, settings) => {\n this.stopDrawingMode();\n if (type === 'free') {\n this.startDrawingMode('FREE_DRAWING', settings);\n } else {\n this.startDrawingMode('LINE_DRAWING', settings);\n }\n },\n setColor: (color) => {\n this.setBrush({\n color,\n });\n },\n },\n this._commonAction()\n );\n },\n\n /**\n * Mask Action\n * @returns {Object} actions for ui mask\n * @private\n */\n _maskAction() {\n return extend(\n {\n loadImageFromURL: (imgUrl, file) => {\n return this.loadImageFromURL(this.toDataURL(), 'FilterImage').then(() => {\n this.addImageObject(imgUrl).then(() => {\n URL.revokeObjectURL(file);\n });\n this._invoker.fire(eventNames.EXECUTE_COMMAND, historyNames.LOAD_MASK_IMAGE);\n });\n },\n applyFilter: () => {\n this.applyFilter('mask', {\n maskObjId: this.activeObjectId,\n });\n },\n },\n this._commonAction()\n );\n },\n\n /**\n * Text Action\n * @returns {Object} actions for ui text\n * @private\n */\n _textAction() {\n return extend(\n {\n changeTextStyle: (styleObj, isSilent) => {\n if (this.activeObjectId) {\n this.changeTextStyle(this.activeObjectId, styleObj, isSilent);\n }\n },\n },\n this._commonAction()\n );\n },\n\n /**\n * Rotate Action\n * @returns {Object} actions for ui rotate\n * @private\n */\n _rotateAction() {\n return extend(\n {\n rotate: (angle, isSilent) => {\n this.rotate(angle, isSilent);\n this.ui.resizeEditor();\n this.ui.rotate.setRangeBarAngle('rotate', angle);\n },\n setAngle: (angle, isSilent) => {\n this.setAngle(angle, isSilent);\n this.ui.resizeEditor();\n this.ui.rotate.setRangeBarAngle('setAngle', angle);\n },\n },\n this._commonAction()\n );\n },\n\n /**\n * Shape Action\n * @returns {Object} actions for ui shape\n * @private\n */\n _shapeAction() {\n return extend(\n {\n changeShape: (changeShapeObject, isSilent) => {\n if (this.activeObjectId) {\n this.changeShape(this.activeObjectId, changeShapeObject, isSilent);\n }\n },\n setDrawingShape: (shapeType) => {\n this.setDrawingShape(shapeType);\n },\n },\n this._commonAction()\n );\n },\n\n /**\n * Crop Action\n * @returns {Object} actions for ui crop\n * @private\n */\n _cropAction() {\n return extend(\n {\n crop: () => {\n const cropRect = this.getCropzoneRect();\n if (cropRect && !isEmptyCropzone(cropRect)) {\n this.crop(cropRect)\n .then(() => {\n this.stopDrawingMode();\n this.ui.resizeEditor();\n this.ui.changeMenu('crop');\n this._invoker.fire(eventNames.EXECUTE_COMMAND, historyNames.CROP);\n })\n ['catch']((message) => Promise.reject(message));\n }\n },\n cancel: () => {\n this.stopDrawingMode();\n this.ui.changeMenu('crop');\n },\n /* eslint-disable */\n preset: (presetType) => {\n switch (presetType) {\n case 'preset-square':\n this.setCropzoneRect(1 / 1);\n break;\n case 'preset-3-2':\n this.setCropzoneRect(3 / 2);\n break;\n case 'preset-4-3':\n this.setCropzoneRect(4 / 3);\n break;\n case 'preset-5-4':\n this.setCropzoneRect(5 / 4);\n break;\n case 'preset-7-5':\n this.setCropzoneRect(7 / 5);\n break;\n case 'preset-16-9':\n this.setCropzoneRect(16 / 9);\n break;\n default:\n this.setCropzoneRect();\n this.ui.crop.changeApplyButtonStatus(false);\n break;\n }\n },\n },\n this._commonAction()\n );\n },\n\n /**\n * Flip Action\n * @returns {Object} actions for ui flip\n * @private\n */\n _flipAction() {\n return extend(\n {\n flip: (flipType) => this[flipType](),\n },\n this._commonAction()\n );\n },\n\n /**\n * Filter Action\n * @returns {Object} actions for ui filter\n * @private\n */\n _filterAction() {\n return extend(\n {\n applyFilter: (applying, type, options, isSilent) => {\n if (applying) {\n this.applyFilter(type, options, isSilent);\n } else if (this.hasFilter(type)) {\n this.removeFilter(type);\n }\n },\n },\n this._commonAction()\n );\n },\n\n /**\n * Image Editor Event Observer\n */\n setReAction() {\n this.on({\n undoStackChanged: (length) => {\n if (length) {\n this.ui.changeHelpButtonEnabled('undo', true);\n this.ui.changeHelpButtonEnabled('reset', true);\n } else {\n this.ui.changeHelpButtonEnabled('undo', false);\n this.ui.changeHelpButtonEnabled('reset', false);\n }\n this.ui.resizeEditor();\n },\n redoStackChanged: (length) => {\n if (length) {\n this.ui.changeHelpButtonEnabled('redo', true);\n } else {\n this.ui.changeHelpButtonEnabled('redo', false);\n }\n this.ui.resizeEditor();\n },\n /* eslint-disable complexity */\n objectActivated: (obj) => {\n this.activeObjectId = obj.id;\n\n this.ui.changeHelpButtonEnabled('delete', true);\n this.ui.changeHelpButtonEnabled('deleteAll', true);\n\n if (obj.type === 'cropzone') {\n this.ui.crop.changeApplyButtonStatus(true);\n } else if (['rect', 'circle', 'triangle'].indexOf(obj.type) > -1) {\n this.stopDrawingMode();\n if (this.ui.submenu !== 'shape') {\n this.ui.changeMenu('shape', false, false);\n }\n this.ui.shape.setShapeStatus({\n strokeColor: obj.stroke,\n strokeWidth: obj.strokeWidth,\n fillColor: obj.fill,\n });\n\n this.ui.shape.setMaxStrokeValue(Math.min(obj.width, obj.height));\n } else if (obj.type === 'path' || obj.type === 'line') {\n if (this.ui.submenu !== 'draw') {\n this.ui.changeMenu('draw', false, false);\n this.ui.draw.changeStandbyMode();\n }\n } else if (['i-text', 'text'].indexOf(obj.type) > -1) {\n if (this.ui.submenu !== 'text') {\n this.ui.changeMenu('text', false, false);\n }\n\n this.ui.text.setTextStyleStateOnAction(obj);\n } else if (obj.type === 'icon') {\n this.stopDrawingMode();\n if (this.ui.submenu !== 'icon') {\n this.ui.changeMenu('icon', false, false);\n }\n this.ui.icon.setIconPickerColor(obj.fill);\n }\n },\n /* eslint-enable complexity */\n addText: (pos) => {\n const { textColor: fill, fontSize, fontStyle, fontWeight, underline } = this.ui.text;\n const fontFamily = 'Noto Sans';\n\n this.addText('Double Click', {\n position: pos.originPosition,\n styles: { fill, fontSize, fontFamily, fontStyle, fontWeight, underline },\n }).then(() => {\n this.changeCursor('default');\n });\n },\n addObjectAfter: (obj) => {\n if (obj.type === 'icon') {\n this.ui.icon.changeStandbyMode();\n } else if (['rect', 'circle', 'triangle'].indexOf(obj.type) > -1) {\n this.ui.shape.setMaxStrokeValue(Math.min(obj.width, obj.height));\n this.ui.shape.changeStandbyMode();\n }\n },\n objectScaled: (obj) => {\n if (['i-text', 'text'].indexOf(obj.type) > -1) {\n this.ui.text.fontSize = toInteger(obj.fontSize);\n } else if (['rect', 'circle', 'triangle'].indexOf(obj.type) >= 0) {\n const { width, height } = obj;\n const strokeValue = this.ui.shape.getStrokeValue();\n\n if (width < strokeValue) {\n this.ui.shape.setStrokeValue(width);\n }\n if (height < strokeValue) {\n this.ui.shape.setStrokeValue(height);\n }\n }\n },\n selectionCleared: () => {\n this.activeObjectId = null;\n if (this.ui.submenu === 'text') {\n this.changeCursor('text');\n } else if (this.ui.submenu !== 'draw' && this.ui.submenu !== 'crop') {\n this.stopDrawingMode();\n }\n },\n });\n },\n\n /**\n * History Action\n * @returns {Object} history actions for ui\n * @private\n */\n _historyAction() {\n return {\n undo: (count) => this.undo(count),\n redo: (count) => this.redo(count),\n };\n },\n\n /**\n * Common Action\n * @returns {Object} common actions for ui\n * @private\n */\n _commonAction() {\n const { TEXT, CROPPER, SHAPE, ZOOM } = drawingModes;\n\n return {\n modeChange: (menu) => {\n switch (menu) {\n case drawingMenuNames.TEXT:\n this._changeActivateMode(TEXT);\n break;\n case drawingMenuNames.CROP:\n this.startDrawingMode(CROPPER);\n break;\n case drawingMenuNames.SHAPE:\n this._changeActivateMode(SHAPE);\n this.setDrawingShape(this.ui.shape.type, this.ui.shape.options);\n break;\n case drawingMenuNames.ZOOM:\n this.startDrawingMode(ZOOM);\n break;\n default:\n break;\n }\n },\n deactivateAll: this.deactivateAll.bind(this),\n changeSelectableAll: this.changeSelectableAll.bind(this),\n discardSelection: this.discardSelection.bind(this),\n stopDrawingMode: this.stopDrawingMode.bind(this),\n };\n },\n\n /**\n * Mixin\n * @param {ImageEditor} ImageEditor instance\n */\n mixin(ImageEditor) {\n extend(ImageEditor.prototype, this);\n },\n};\n","/*\n imagetracer.js version 1.2.4\n Simple raster image tracer and vectorizer written in JavaScript.\n andras@jankovics.net\n*/\n\n/*\n The Unlicense / PUBLIC DOMAIN\n This is free and unencumbered software released into the public domain.\n Anyone is free to copy, modify, publish, use, compile, sell, or\n distribute this software, either in source code form or as a compiled\n binary, for any purpose, commercial or non-commercial, and by any\n means.\n In jurisdictions that recognize copyright laws, the author or authors\n of this software dedicate any and all copyright interest in the\n software to the public domain. We make this dedication for the benefit\n of the public at large and to the detriment of our heirs and\n successors. We intend this dedication to be an overt act of\n relinquishment in perpetuity of all present and future rights to this\n software under copyright law.\n THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\n EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\n MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.\n IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR\n OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,\n ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR\n OTHER DEALINGS IN THE SOFTWARE.\n For more information, please refer to http://unlicense.org/\n*/\nexport default class ImageTracer {\n static tracerDefaultOption() {\n return {\n pathomit: 100,\n ltres: 0.1,\n qtres: 1,\n\n scale: 1,\n strokewidth: 5,\n viewbox: false,\n linefilter: true,\n desc: false,\n rightangleenhance: false,\n pal: [\n {\n r: 0,\n g: 0,\n b: 0,\n a: 255,\n },\n {\n r: 255,\n g: 255,\n b: 255,\n a: 255,\n },\n ],\n };\n }\n /* eslint-disable */\n constructor() {\n this.versionnumber = '1.2.4';\n this.optionpresets = {\n default: {\n corsenabled: false,\n ltres: 1,\n qtres: 1,\n pathomit: 8,\n rightangleenhance: true,\n colorsampling: 2,\n numberofcolors: 16,\n mincolorratio: 0,\n colorquantcycles: 3,\n layering: 0,\n strokewidth: 1,\n linefilter: false,\n scale: 1,\n roundcoords: 1,\n viewbox: false,\n desc: false,\n lcpr: 0,\n qcpr: 0,\n blurradius: 0,\n blurdelta: 20,\n },\n posterized1: {\n colorsampling: 0,\n numberofcolors: 2,\n },\n posterized2: {\n numberofcolors: 4,\n blurradius: 5,\n },\n curvy: {\n ltres: 0.01,\n linefilter: true,\n rightangleenhance: false,\n },\n sharp: { qtres: 0.01, linefilter: false },\n detailed: { pathomit: 0, roundcoords: 2, ltres: 0.5, qtres: 0.5, numberofcolors: 64 },\n smoothed: { blurradius: 5, blurdelta: 64 },\n grayscale: { colorsampling: 0, colorquantcycles: 1, numberofcolors: 7 },\n fixedpalette: { colorsampling: 0, colorquantcycles: 1, numberofcolors: 27 },\n randomsampling1: { colorsampling: 1, numberofcolors: 8 },\n randomsampling2: { colorsampling: 1, numberofcolors: 64 },\n artistic1: {\n colorsampling: 0,\n colorquantcycles: 1,\n pathomit: 0,\n blurradius: 5,\n blurdelta: 64,\n ltres: 0.01,\n linefilter: true,\n numberofcolors: 16,\n strokewidth: 2,\n },\n artistic2: {\n qtres: 0.01,\n colorsampling: 0,\n colorquantcycles: 1,\n numberofcolors: 4,\n strokewidth: 0,\n },\n artistic3: { qtres: 10, ltres: 10, numberofcolors: 8 },\n artistic4: {\n qtres: 10,\n ltres: 10,\n numberofcolors: 64,\n blurradius: 5,\n blurdelta: 256,\n strokewidth: 2,\n },\n posterized3: {\n ltres: 1,\n qtres: 1,\n pathomit: 20,\n rightangleenhance: true,\n colorsampling: 0,\n numberofcolors: 3,\n mincolorratio: 0,\n colorquantcycles: 3,\n blurradius: 3,\n blurdelta: 20,\n strokewidth: 0,\n linefilter: false,\n roundcoords: 1,\n pal: [\n { r: 0, g: 0, b: 100, a: 255 },\n { r: 255, g: 255, b: 255, a: 255 },\n ],\n },\n };\n\n this.pathscan_combined_lookup = [\n [\n [-1, -1, -1, -1],\n [-1, -1, -1, -1],\n [-1, -1, -1, -1],\n [-1, -1, -1, -1],\n ],\n [\n [0, 1, 0, -1],\n [-1, -1, -1, -1],\n [-1, -1, -1, -1],\n [0, 2, -1, 0],\n ],\n [\n [-1, -1, -1, -1],\n [-1, -1, -1, -1],\n [0, 1, 0, -1],\n [0, 0, 1, 0],\n ],\n [\n [0, 0, 1, 0],\n [-1, -1, -1, -1],\n [0, 2, -1, 0],\n [-1, -1, -1, -1],\n ],\n [\n [-1, -1, -1, -1],\n [0, 0, 1, 0],\n [0, 3, 0, 1],\n [-1, -1, -1, -1],\n ],\n [\n [13, 3, 0, 1],\n [13, 2, -1, 0],\n [7, 1, 0, -1],\n [7, 0, 1, 0],\n ],\n [\n [-1, -1, -1, -1],\n [0, 1, 0, -1],\n [-1, -1, -1, -1],\n [0, 3, 0, 1],\n ],\n [\n [0, 3, 0, 1],\n [0, 2, -1, 0],\n [-1, -1, -1, -1],\n [-1, -1, -1, -1],\n ],\n [\n [0, 3, 0, 1],\n [0, 2, -1, 0],\n [-1, -1, -1, -1],\n [-1, -1, -1, -1],\n ],\n [\n [-1, -1, -1, -1],\n [0, 1, 0, -1],\n [-1, -1, -1, -1],\n [0, 3, 0, 1],\n ],\n [\n [11, 1, 0, -1],\n [14, 0, 1, 0],\n [14, 3, 0, 1],\n [11, 2, -1, 0],\n ],\n [\n [-1, -1, -1, -1],\n [0, 0, 1, 0],\n [0, 3, 0, 1],\n [-1, -1, -1, -1],\n ],\n [\n [0, 0, 1, 0],\n [-1, -1, -1, -1],\n [0, 2, -1, 0],\n [-1, -1, -1, -1],\n ],\n [\n [-1, -1, -1, -1],\n [-1, -1, -1, -1],\n [0, 1, 0, -1],\n [0, 0, 1, 0],\n ],\n [\n [0, 1, 0, -1],\n [-1, -1, -1, -1],\n [-1, -1, -1, -1],\n [0, 2, -1, 0],\n ],\n [\n [-1, -1, -1, -1],\n [-1, -1, -1, -1],\n [-1, -1, -1, -1],\n [-1, -1, -1, -1],\n ],\n ];\n\n this.gks = [\n [0.27901, 0.44198, 0.27901],\n [0.135336, 0.228569, 0.272192, 0.228569, 0.135336],\n [0.086776, 0.136394, 0.178908, 0.195843, 0.178908, 0.136394, 0.086776],\n [0.063327, 0.093095, 0.122589, 0.144599, 0.152781, 0.144599, 0.122589, 0.093095, 0.063327],\n [\n 0.049692,\n 0.069304,\n 0.089767,\n 0.107988,\n 0.120651,\n 0.125194,\n 0.120651,\n 0.107988,\n 0.089767,\n 0.069304,\n 0.049692,\n ],\n ];\n\n this.specpalette = [\n { r: 0, g: 0, b: 0, a: 255 },\n { r: 128, g: 128, b: 128, a: 255 },\n { r: 0, g: 0, b: 128, a: 255 },\n { r: 64, g: 64, b: 128, a: 255 },\n { r: 192, g: 192, b: 192, a: 255 },\n { r: 255, g: 255, b: 255, a: 255 },\n { r: 128, g: 128, b: 192, a: 255 },\n { r: 0, g: 0, b: 192, a: 255 },\n { r: 128, g: 0, b: 0, a: 255 },\n { r: 128, g: 64, b: 64, a: 255 },\n { r: 128, g: 0, b: 128, a: 255 },\n { r: 168, g: 168, b: 168, a: 255 },\n { r: 192, g: 128, b: 128, a: 255 },\n { r: 192, g: 0, b: 0, a: 255 },\n { r: 255, g: 255, b: 255, a: 255 },\n { r: 0, g: 128, b: 0, a: 255 },\n ];\n }\n\n imageToSVG(url, callback, options) {\n options = this.checkoptions(options);\n this.loadImage(\n url,\n (canvas) => {\n callback(this.imagedataToSVG(this.getImgdata(canvas), options));\n },\n options\n );\n }\n\n imagedataToSVG(imgd, options) {\n options = this.checkoptions(options);\n const td = this.imagedataToTracedata(imgd, options);\n\n return this.getsvgstring(td, options);\n }\n\n imageToTracedata(url, callback, options) {\n options = this.checkoptions(options);\n this.loadImage(\n url,\n (canvas) => {\n callback(this.imagedataToTracedata(this.getImgdata(canvas), options));\n },\n options\n );\n }\n\n imagedataToTracedata(imgd, options) {\n options = this.checkoptions(options);\n const ii = this.colorquantization(imgd, options);\n let tracedata;\n if (options.layering === 0) {\n tracedata = {\n layers: [],\n palette: ii.palette,\n width: ii.array[0].length - 2,\n height: ii.array.length - 2,\n };\n\n for (let colornum = 0; colornum < ii.palette.length; colornum += 1) {\n const tracedlayer = this.batchtracepaths(\n this.internodes(\n this.pathscan(this.layeringstep(ii, colornum), options.pathomit),\n options\n ),\n options.ltres,\n options.qtres\n );\n tracedata.layers.push(tracedlayer);\n }\n } else {\n const ls = this.layering(ii);\n if (options.layercontainerid) {\n this.drawLayers(ls, this.specpalette, options.scale, options.layercontainerid);\n }\n const bps = this.batchpathscan(ls, options.pathomit);\n const bis = this.batchinternodes(bps, options);\n tracedata = {\n layers: this.batchtracelayers(bis, options.ltres, options.qtres),\n palette: ii.palette,\n width: imgd.width,\n height: imgd.height,\n };\n }\n\n return tracedata;\n }\n\n checkoptions(options) {\n options = options || {};\n if (typeof options === 'string') {\n options = options.toLowerCase();\n if (this.optionpresets[options]) {\n options = this.optionpresets[options];\n } else {\n options = {};\n }\n }\n const ok = Object.keys(this.optionpresets['default']);\n for (let k = 0; k < ok.length; k += 1) {\n if (!options.hasOwnProperty(ok[k])) {\n options[ok[k]] = this.optionpresets['default'][ok[k]];\n }\n }\n\n return options;\n }\n\n colorquantization(imgd, options) {\n const arr = [];\n let idx = 0;\n let cd;\n let cdl;\n let ci;\n const paletteacc = [];\n const pixelnum = imgd.width * imgd.height;\n let i;\n let j;\n let k;\n let cnt;\n let palette;\n\n for (j = 0; j < imgd.height + 2; j += 1) {\n arr[j] = [];\n for (i = 0; i < imgd.width + 2; i += 1) {\n arr[j][i] = -1;\n }\n }\n if (options.pal) {\n palette = options.pal;\n } else if (options.colorsampling === 0) {\n palette = this.generatepalette(options.numberofcolors);\n } else if (options.colorsampling === 1) {\n palette = this.samplepalette(options.numberofcolors, imgd);\n } else {\n palette = this.samplepalette2(options.numberofcolors, imgd);\n }\n if (options.blurradius > 0) {\n imgd = this.blur(imgd, options.blurradius, options.blurdelta);\n }\n for (cnt = 0; cnt < options.colorquantcycles; cnt += 1) {\n if (cnt > 0) {\n for (k = 0; k < palette.length; k += 1) {\n if (paletteacc[k].n > 0) {\n palette[k] = {\n r: Math.floor(paletteacc[k].r / paletteacc[k].n),\n g: Math.floor(paletteacc[k].g / paletteacc[k].n),\n b: Math.floor(paletteacc[k].b / paletteacc[k].n),\n a: Math.floor(paletteacc[k].a / paletteacc[k].n),\n };\n }\n\n if (\n paletteacc[k].n / pixelnum < options.mincolorratio &&\n cnt < options.colorquantcycles - 1\n ) {\n palette[k] = {\n r: Math.floor(Math.random() * 255),\n g: Math.floor(Math.random() * 255),\n b: Math.floor(Math.random() * 255),\n a: Math.floor(Math.random() * 255),\n };\n }\n }\n }\n\n for (i = 0; i < palette.length; i += 1) {\n paletteacc[i] = { r: 0, g: 0, b: 0, a: 0, n: 0 };\n }\n\n for (j = 0; j < imgd.height; j += 1) {\n for (i = 0; i < imgd.width; i += 1) {\n idx = (j * imgd.width + i) * 4;\n\n ci = 0;\n cdl = 1024;\n for (k = 0; k < palette.length; k += 1) {\n cd =\n Math.abs(palette[k].r - imgd.data[idx]) +\n Math.abs(palette[k].g - imgd.data[idx + 1]) +\n Math.abs(palette[k].b - imgd.data[idx + 2]) +\n Math.abs(palette[k].a - imgd.data[idx + 3]);\n\n if (cd < cdl) {\n cdl = cd;\n ci = k;\n }\n }\n\n paletteacc[ci].r += imgd.data[idx];\n paletteacc[ci].g += imgd.data[idx + 1];\n paletteacc[ci].b += imgd.data[idx + 2];\n paletteacc[ci].a += imgd.data[idx + 3];\n paletteacc[ci].n += 1;\n\n arr[j + 1][i + 1] = ci;\n }\n }\n }\n\n return { array: arr, palette };\n }\n\n samplepalette(numberofcolors, imgd) {\n let idx;\n const palette = [];\n for (let i = 0; i < numberofcolors; i += 1) {\n idx = Math.floor((Math.random() * imgd.data.length) / 4) * 4;\n palette.push({\n r: imgd.data[idx],\n g: imgd.data[idx + 1],\n b: imgd.data[idx + 2],\n a: imgd.data[idx + 3],\n });\n }\n\n return palette;\n }\n\n samplepalette2(numberofcolors, imgd) {\n let idx;\n const palette = [];\n const ni = Math.ceil(Math.sqrt(numberofcolors));\n const nj = Math.ceil(numberofcolors / ni);\n const vx = imgd.width / (ni + 1);\n const vy = imgd.height / (nj + 1);\n for (let j = 0; j < nj; j += 1) {\n for (let i = 0; i < ni; i += 1) {\n if (palette.length === numberofcolors) {\n break;\n } else {\n idx = Math.floor((j + 1) * vy * imgd.width + (i + 1) * vx) * 4;\n palette.push({\n r: imgd.data[idx],\n g: imgd.data[idx + 1],\n b: imgd.data[idx + 2],\n a: imgd.data[idx + 3],\n });\n }\n }\n }\n\n return palette;\n }\n\n generatepalette(numberofcolors) {\n const palette = [];\n let rcnt;\n let gcnt;\n let bcnt;\n if (numberofcolors < 8) {\n const graystep = Math.floor(255 / (numberofcolors - 1));\n for (let i = 0; i < numberofcolors; i += 1) {\n palette.push({ r: i * graystep, g: i * graystep, b: i * graystep, a: 255 });\n }\n } else {\n const colorqnum = Math.floor(Math.pow(numberofcolors, 1 / 3));\n const colorstep = Math.floor(255 / (colorqnum - 1));\n const rndnum = numberofcolors - colorqnum * colorqnum * colorqnum;\n for (rcnt = 0; rcnt < colorqnum; rcnt += 1) {\n for (gcnt = 0; gcnt < colorqnum; gcnt += 1) {\n for (bcnt = 0; bcnt < colorqnum; bcnt += 1) {\n palette.push({ r: rcnt * colorstep, g: gcnt * colorstep, b: bcnt * colorstep, a: 255 });\n }\n }\n }\n for (rcnt = 0; rcnt < rndnum; rcnt += 1) {\n palette.push({\n r: Math.floor(Math.random() * 255),\n g: Math.floor(Math.random() * 255),\n b: Math.floor(Math.random() * 255),\n a: Math.floor(Math.random() * 255),\n });\n }\n }\n\n return palette;\n }\n\n layering(ii) {\n const layers = [];\n let val = 0;\n const ah = ii.array.length;\n const aw = ii.array[0].length;\n let n1;\n let n2;\n let n3;\n let n4;\n let n5;\n let n6;\n let n7;\n let n8;\n let i;\n let j;\n let k;\n for (k = 0; k < ii.palette.length; k += 1) {\n layers[k] = [];\n for (j = 0; j < ah; j += 1) {\n layers[k][j] = [];\n for (i = 0; i < aw; i += 1) {\n layers[k][j][i] = 0;\n }\n }\n }\n for (j = 1; j < ah - 1; j += 1) {\n for (i = 1; i < aw - 1; i += 1) {\n val = ii.array[j][i];\n\n n1 = ii.array[j - 1][i - 1] === val ? 1 : 0;\n n2 = ii.array[j - 1][i] === val ? 1 : 0;\n n3 = ii.array[j - 1][i + 1] === val ? 1 : 0;\n n4 = ii.array[j][i - 1] === val ? 1 : 0;\n n5 = ii.array[j][i + 1] === val ? 1 : 0;\n n6 = ii.array[j + 1][i - 1] === val ? 1 : 0;\n n7 = ii.array[j + 1][i] === val ? 1 : 0;\n n8 = ii.array[j + 1][i + 1] === val ? 1 : 0;\n\n layers[val][j + 1][i + 1] = 1 + n5 * 2 + n8 * 4 + n7 * 8;\n if (!n4) {\n layers[val][j + 1][i] = 0 + 2 + n7 * 4 + n6 * 8;\n }\n if (!n2) {\n layers[val][j][i + 1] = 0 + n3 * 2 + n5 * 4 + 8;\n }\n if (!n1) {\n layers[val][j][i] = 0 + n2 * 2 + 4 + n4 * 8;\n }\n }\n }\n\n return layers;\n }\n\n layeringstep(ii, cnum) {\n const layer = [];\n const ah = ii.array.length;\n const aw = ii.array[0].length;\n let i;\n let j;\n for (j = 0; j < ah; j += 1) {\n layer[j] = [];\n for (i = 0; i < aw; i += 1) {\n layer[j][i] = 0;\n }\n }\n for (j = 1; j < ah; j += 1) {\n for (i = 1; i < aw; i += 1) {\n layer[j][i] =\n (ii.array[j - 1][i - 1] === cnum ? 1 : 0) +\n (ii.array[j - 1][i] === cnum ? 2 : 0) +\n (ii.array[j][i - 1] === cnum ? 8 : 0) +\n (ii.array[j][i] === cnum ? 4 : 0);\n }\n }\n\n return layer;\n }\n\n pathscan(arr, pathomit) {\n const paths = [];\n let pacnt = 0;\n let pcnt = 0;\n let px = 0;\n let py = 0;\n const w = arr[0].length;\n const h = arr.length;\n let dir = 0;\n let pathfinished = true;\n let holepath = false;\n let lookuprow;\n for (let j = 0; j < h; j += 1) {\n for (let i = 0; i < w; i += 1) {\n if (arr[j][i] === 4 || arr[j][i] === 11) {\n px = i;\n py = j;\n paths[pacnt] = {};\n paths[pacnt].points = [];\n paths[pacnt].boundingbox = [px, py, px, py];\n paths[pacnt].holechildren = [];\n pathfinished = false;\n pcnt = 0;\n holepath = arr[j][i] === 11;\n dir = 1;\n\n while (!pathfinished) {\n paths[pacnt].points[pcnt] = {};\n paths[pacnt].points[pcnt].x = px - 1;\n paths[pacnt].points[pcnt].y = py - 1;\n paths[pacnt].points[pcnt].t = arr[py][px];\n\n if (px - 1 < paths[pacnt].boundingbox[0]) {\n paths[pacnt].boundingbox[0] = px - 1;\n }\n if (px - 1 > paths[pacnt].boundingbox[2]) {\n paths[pacnt].boundingbox[2] = px - 1;\n }\n if (py - 1 < paths[pacnt].boundingbox[1]) {\n paths[pacnt].boundingbox[1] = py - 1;\n }\n if (py - 1 > paths[pacnt].boundingbox[3]) {\n paths[pacnt].boundingbox[3] = py - 1;\n }\n\n lookuprow = this.pathscan_combined_lookup[arr[py][px]][dir];\n arr[py][px] = lookuprow[0];\n dir = lookuprow[1];\n px += lookuprow[2];\n py += lookuprow[3];\n\n if (px - 1 === paths[pacnt].points[0].x && py - 1 === paths[pacnt].points[0].y) {\n pathfinished = true;\n\n if (paths[pacnt].points.length < pathomit) {\n paths.pop();\n } else {\n paths[pacnt].isholepath = !!holepath;\n\n if (holepath) {\n let parentidx = 0,\n parentbbox = [-1, -1, w + 1, h + 1];\n for (let parentcnt = 0; parentcnt < pacnt; parentcnt++) {\n if (\n !paths[parentcnt].isholepath &&\n this.boundingboxincludes(\n paths[parentcnt].boundingbox,\n paths[pacnt].boundingbox\n ) &&\n this.boundingboxincludes(parentbbox, paths[parentcnt].boundingbox)\n ) {\n parentidx = parentcnt;\n parentbbox = paths[parentcnt].boundingbox;\n }\n }\n paths[parentidx].holechildren.push(pacnt);\n }\n pacnt += 1;\n }\n }\n pcnt += 1;\n }\n }\n }\n }\n\n return paths;\n }\n\n boundingboxincludes(parentbbox, childbbox) {\n return (\n parentbbox[0] < childbbox[0] &&\n parentbbox[1] < childbbox[1] &&\n parentbbox[2] > childbbox[2] &&\n parentbbox[3] > childbbox[3]\n );\n }\n\n batchpathscan(layers, pathomit) {\n const bpaths = [];\n for (const k in layers) {\n if (!layers.hasOwnProperty(k)) {\n continue;\n }\n bpaths[k] = this.pathscan(layers[k], pathomit);\n }\n\n return bpaths;\n }\n\n internodes(paths, options) {\n const ins = [];\n let palen = 0;\n let nextidx = 0;\n let nextidx2 = 0;\n let previdx = 0;\n let previdx2 = 0;\n let pacnt;\n let pcnt;\n for (pacnt = 0; pacnt < paths.length; pacnt += 1) {\n ins[pacnt] = {};\n ins[pacnt].points = [];\n ins[pacnt].boundingbox = paths[pacnt].boundingbox;\n ins[pacnt].holechildren = paths[pacnt].holechildren;\n ins[pacnt].isholepath = paths[pacnt].isholepath;\n palen = paths[pacnt].points.length;\n\n for (pcnt = 0; pcnt < palen; pcnt += 1) {\n nextidx = (pcnt + 1) % palen;\n nextidx2 = (pcnt + 2) % palen;\n previdx = (pcnt - 1 + palen) % palen;\n previdx2 = (pcnt - 2 + palen) % palen;\n\n if (\n options.rightangleenhance &&\n this.testrightangle(paths[pacnt], previdx2, previdx, pcnt, nextidx, nextidx2)\n ) {\n if (ins[pacnt].points.length > 0) {\n ins[pacnt].points[ins[pacnt].points.length - 1].linesegment = this.getdirection(\n ins[pacnt].points[ins[pacnt].points.length - 1].x,\n ins[pacnt].points[ins[pacnt].points.length - 1].y,\n paths[pacnt].points[pcnt].x,\n paths[pacnt].points[pcnt].y\n );\n }\n\n ins[pacnt].points.push({\n x: paths[pacnt].points[pcnt].x,\n y: paths[pacnt].points[pcnt].y,\n linesegment: this.getdirection(\n paths[pacnt].points[pcnt].x,\n paths[pacnt].points[pcnt].y,\n (paths[pacnt].points[pcnt].x + paths[pacnt].points[nextidx].x) / 2,\n (paths[pacnt].points[pcnt].y + paths[pacnt].points[nextidx].y) / 2\n ),\n });\n }\n\n ins[pacnt].points.push({\n x: (paths[pacnt].points[pcnt].x + paths[pacnt].points[nextidx].x) / 2,\n y: (paths[pacnt].points[pcnt].y + paths[pacnt].points[nextidx].y) / 2,\n linesegment: this.getdirection(\n (paths[pacnt].points[pcnt].x + paths[pacnt].points[nextidx].x) / 2,\n (paths[pacnt].points[pcnt].y + paths[pacnt].points[nextidx].y) / 2,\n (paths[pacnt].points[nextidx].x + paths[pacnt].points[nextidx2].x) / 2,\n (paths[pacnt].points[nextidx].y + paths[pacnt].points[nextidx2].y) / 2\n ),\n });\n }\n }\n\n return ins;\n }\n\n testrightangle(path, idx1, idx2, idx3, idx4, idx5) {\n return (\n (path.points[idx3].x === path.points[idx1].x &&\n path.points[idx3].x === path.points[idx2].x &&\n path.points[idx3].y === path.points[idx4].y &&\n path.points[idx3].y === path.points[idx5].y) ||\n (path.points[idx3].y === path.points[idx1].y &&\n path.points[idx3].y === path.points[idx2].y &&\n path.points[idx3].x === path.points[idx4].x &&\n path.points[idx3].x === path.points[idx5].x)\n );\n }\n\n getdirection(x1, y1, x2, y2) {\n let val = 8;\n if (x1 < x2) {\n if (y1 < y2) {\n val = 1;\n } else if (y1 > y2) {\n val = 7;\n } else {\n val = 0;\n }\n } else if (x1 > x2) {\n if (y1 < y2) {\n val = 3;\n } else if (y1 > y2) {\n val = 5;\n } else {\n val = 4;\n }\n } else if (y1 < y2) {\n val = 2;\n } else if (y1 > y2) {\n val = 6;\n } else {\n val = 8;\n }\n\n return val;\n }\n\n batchinternodes(bpaths, options) {\n const binternodes = [];\n for (const k in bpaths) {\n if (!bpaths.hasOwnProperty(k)) {\n continue;\n }\n binternodes[k] = this.internodes(bpaths[k], options);\n }\n\n return binternodes;\n }\n\n tracepath(path, ltres, qtres) {\n let pcnt = 0;\n let segtype1;\n let segtype2;\n let seqend;\n const smp = {};\n smp.segments = [];\n smp.boundingbox = path.boundingbox;\n smp.holechildren = path.holechildren;\n smp.isholepath = path.isholepath;\n\n while (pcnt < path.points.length) {\n segtype1 = path.points[pcnt].linesegment;\n segtype2 = -1;\n seqend = pcnt + 1;\n while (\n (path.points[seqend].linesegment === segtype1 ||\n path.points[seqend].linesegment === segtype2 ||\n segtype2 === -1) &&\n seqend < path.points.length - 1\n ) {\n if (path.points[seqend].linesegment !== segtype1 && segtype2 === -1) {\n segtype2 = path.points[seqend].linesegment;\n }\n seqend += 1;\n }\n if (seqend === path.points.length - 1) {\n seqend = 0;\n }\n\n smp.segments = smp.segments.concat(this.fitseq(path, ltres, qtres, pcnt, seqend));\n\n if (seqend > 0) {\n pcnt = seqend;\n } else {\n pcnt = path.points.length;\n }\n }\n\n return smp;\n }\n\n fitseq(path, ltres, qtres, seqstart, seqend) {\n if (seqend > path.points.length || seqend < 0) {\n return [];\n }\n let errorpoint = seqstart,\n errorval = 0,\n curvepass = true,\n px,\n py,\n dist2;\n let tl = seqend - seqstart;\n if (tl < 0) {\n tl += path.points.length;\n }\n let vx = (path.points[seqend].x - path.points[seqstart].x) / tl,\n vy = (path.points[seqend].y - path.points[seqstart].y) / tl;\n let pcnt = (seqstart + 1) % path.points.length,\n pl;\n while (pcnt != seqend) {\n pl = pcnt - seqstart;\n if (pl < 0) {\n pl += path.points.length;\n }\n px = path.points[seqstart].x + vx * pl;\n py = path.points[seqstart].y + vy * pl;\n dist2 =\n (path.points[pcnt].x - px) * (path.points[pcnt].x - px) +\n (path.points[pcnt].y - py) * (path.points[pcnt].y - py);\n if (dist2 > ltres) {\n curvepass = false;\n }\n if (dist2 > errorval) {\n errorpoint = pcnt;\n errorval = dist2;\n }\n pcnt = (pcnt + 1) % path.points.length;\n }\n if (curvepass) {\n return [\n {\n type: 'L',\n x1: path.points[seqstart].x,\n y1: path.points[seqstart].y,\n x2: path.points[seqend].x,\n y2: path.points[seqend].y,\n },\n ];\n }\n const fitpoint = errorpoint;\n curvepass = true;\n errorval = 0;\n let t = (fitpoint - seqstart) / tl,\n t1 = (1 - t) * (1 - t),\n t2 = 2 * (1 - t) * t,\n t3 = t * t;\n let cpx =\n (t1 * path.points[seqstart].x + t3 * path.points[seqend].x - path.points[fitpoint].x) / -t2,\n cpy =\n (t1 * path.points[seqstart].y + t3 * path.points[seqend].y - path.points[fitpoint].y) / -t2;\n pcnt = seqstart + 1;\n while (pcnt != seqend) {\n t = (pcnt - seqstart) / tl;\n t1 = (1 - t) * (1 - t);\n t2 = 2 * (1 - t) * t;\n t3 = t * t;\n px = t1 * path.points[seqstart].x + t2 * cpx + t3 * path.points[seqend].x;\n py = t1 * path.points[seqstart].y + t2 * cpy + t3 * path.points[seqend].y;\n dist2 =\n (path.points[pcnt].x - px) * (path.points[pcnt].x - px) +\n (path.points[pcnt].y - py) * (path.points[pcnt].y - py);\n if (dist2 > qtres) {\n curvepass = false;\n }\n if (dist2 > errorval) {\n errorpoint = pcnt;\n errorval = dist2;\n }\n pcnt = (pcnt + 1) % path.points.length;\n }\n if (curvepass) {\n return [\n {\n type: 'Q',\n x1: path.points[seqstart].x,\n y1: path.points[seqstart].y,\n x2: cpx,\n y2: cpy,\n x3: path.points[seqend].x,\n y3: path.points[seqend].y,\n },\n ];\n }\n const splitpoint = fitpoint;\n\n return this.fitseq(path, ltres, qtres, seqstart, splitpoint).concat(\n this.fitseq(path, ltres, qtres, splitpoint, seqend)\n );\n }\n\n batchtracepaths(internodepaths, ltres, qtres) {\n const btracedpaths = [];\n for (const k in internodepaths) {\n if (!internodepaths.hasOwnProperty(k)) {\n continue;\n }\n btracedpaths.push(this.tracepath(internodepaths[k], ltres, qtres));\n }\n\n return btracedpaths;\n }\n\n batchtracelayers(binternodes, ltres, qtres) {\n const btbis = [];\n for (const k in binternodes) {\n if (!binternodes.hasOwnProperty(k)) {\n continue;\n }\n btbis[k] = this.batchtracepaths(binternodes[k], ltres, qtres);\n }\n\n return btbis;\n }\n\n roundtodec(val, places) {\n return Number(val.toFixed(places));\n }\n\n svgpathstring(tracedata, lnum, pathnum, options) {\n let layer = tracedata.layers[lnum],\n smp = layer[pathnum],\n str = '',\n pcnt;\n if (options.linefilter && smp.segments.length < 3) {\n return str;\n }\n str = `= 0; pcnt--) {\n str += `${hsmp.segments[pcnt].type} `;\n if (hsmp.segments[pcnt].hasOwnProperty('x3')) {\n str += `${hsmp.segments[pcnt].x2 * options.scale} ${\n hsmp.segments[pcnt].y2 * options.scale\n } `;\n }\n str += `${hsmp.segments[pcnt].x1 * options.scale} ${\n hsmp.segments[pcnt].y1 * options.scale\n } `;\n }\n } else {\n if (hsmp.segments[hsmp.segments.length - 1].hasOwnProperty('x3')) {\n str += `M ${this.roundtodec(\n hsmp.segments[hsmp.segments.length - 1].x3 * options.scale\n )} ${this.roundtodec(hsmp.segments[hsmp.segments.length - 1].y3 * options.scale)} `;\n } else {\n str += `M ${this.roundtodec(\n hsmp.segments[hsmp.segments.length - 1].x2 * options.scale\n )} ${this.roundtodec(hsmp.segments[hsmp.segments.length - 1].y2 * options.scale)} `;\n }\n for (pcnt = hsmp.segments.length - 1; pcnt >= 0; pcnt--) {\n str += `${hsmp.segments[pcnt].type} `;\n if (hsmp.segments[pcnt].hasOwnProperty('x3')) {\n str += `${this.roundtodec(hsmp.segments[pcnt].x2 * options.scale)} ${this.roundtodec(\n hsmp.segments[pcnt].y2 * options.scale\n )} `;\n }\n str += `${this.roundtodec(hsmp.segments[pcnt].x1 * options.scale)} ${this.roundtodec(\n hsmp.segments[pcnt].y1 * options.scale\n )} `;\n }\n }\n str += 'Z ';\n }\n str += '\" />';\n if (options.lcpr || options.qcpr) {\n for (pcnt = 0; pcnt < smp.segments.length; pcnt++) {\n if (smp.segments[pcnt].hasOwnProperty('x3') && options.qcpr) {\n str += ``;\n str += ``;\n str += ``;\n str += ``;\n }\n if (!smp.segments[pcnt].hasOwnProperty('x3') && options.lcpr) {\n str += ``;\n }\n }\n\n for (var hcnt = 0; hcnt < smp.holechildren.length; hcnt++) {\n var hsmp = layer[smp.holechildren[hcnt]];\n for (pcnt = 0; pcnt < hsmp.segments.length; pcnt++) {\n if (hsmp.segments[pcnt].hasOwnProperty('x3') && options.qcpr) {\n str += ``;\n str += ``;\n str += ``;\n str += ``;\n }\n if (!hsmp.segments[pcnt].hasOwnProperty('x3') && options.lcpr) {\n str += ``;\n }\n }\n }\n }\n\n return str;\n }\n\n getsvgstring(tracedata, options) {\n options = this.checkoptions(options);\n const w = tracedata.width * options.scale;\n const h = tracedata.height * options.scale;\n\n let svgstr = ``;\n for (let lcnt = 0; lcnt < tracedata.layers.length; lcnt += 1) {\n for (let pcnt = 0; pcnt < tracedata.layers[lcnt].length; pcnt += 1) {\n if (!tracedata.layers[lcnt][pcnt].isholepath) {\n svgstr += this.svgpathstring(tracedata, lcnt, pcnt, options);\n }\n }\n }\n svgstr += '';\n\n return svgstr;\n }\n\n compareNumbers(a, b) {\n return a - b;\n }\n\n torgbastr(c) {\n return `rgba(${c.r},${c.g},${c.b},${c.a})`;\n }\n\n tosvgcolorstr(c, options) {\n return `fill=\"rgb(${c.r},${c.g},${c.b})\" stroke=\"rgb(${c.r},${c.g},${c.b})\" stroke-width=\"${\n options.strokewidth\n }\" opacity=\"${c.a / 255.0}\" `;\n }\n\n appendSVGString(svgstr, parentid) {\n let div;\n if (parentid) {\n div = document.getElementById(parentid);\n if (!div) {\n div = document.createElement('div');\n div.id = parentid;\n document.body.appendChild(div);\n }\n } else {\n div = document.createElement('div');\n document.body.appendChild(div);\n }\n div.innerHTML += svgstr;\n }\n\n blur(imgd, radius, delta) {\n let i, j, k, d, idx, racc, gacc, bacc, aacc, wacc;\n const imgd2 = { width: imgd.width, height: imgd.height, data: [] };\n radius = Math.floor(radius);\n if (radius < 1) {\n return imgd;\n }\n if (radius > 5) {\n radius = 5;\n }\n delta = Math.abs(delta);\n if (delta > 1024) {\n delta = 1024;\n }\n const thisgk = this.gks[radius - 1];\n for (j = 0; j < imgd.height; j++) {\n for (i = 0; i < imgd.width; i++) {\n racc = 0;\n gacc = 0;\n bacc = 0;\n aacc = 0;\n wacc = 0;\n\n for (k = -radius; k < radius + 1; k++) {\n if (i + k > 0 && i + k < imgd.width) {\n idx = (j * imgd.width + i + k) * 4;\n racc += imgd.data[idx] * thisgk[k + radius];\n gacc += imgd.data[idx + 1] * thisgk[k + radius];\n bacc += imgd.data[idx + 2] * thisgk[k + radius];\n aacc += imgd.data[idx + 3] * thisgk[k + radius];\n wacc += thisgk[k + radius];\n }\n }\n\n idx = (j * imgd.width + i) * 4;\n imgd2.data[idx] = Math.floor(racc / wacc);\n imgd2.data[idx + 1] = Math.floor(gacc / wacc);\n imgd2.data[idx + 2] = Math.floor(bacc / wacc);\n imgd2.data[idx + 3] = Math.floor(aacc / wacc);\n }\n }\n const himgd = new Uint8ClampedArray(imgd2.data);\n for (j = 0; j < imgd.height; j++) {\n for (i = 0; i < imgd.width; i++) {\n racc = 0;\n gacc = 0;\n bacc = 0;\n aacc = 0;\n wacc = 0;\n\n for (k = -radius; k < radius + 1; k++) {\n if (j + k > 0 && j + k < imgd.height) {\n idx = ((j + k) * imgd.width + i) * 4;\n racc += himgd[idx] * thisgk[k + radius];\n gacc += himgd[idx + 1] * thisgk[k + radius];\n bacc += himgd[idx + 2] * thisgk[k + radius];\n aacc += himgd[idx + 3] * thisgk[k + radius];\n wacc += thisgk[k + radius];\n }\n }\n\n idx = (j * imgd.width + i) * 4;\n imgd2.data[idx] = Math.floor(racc / wacc);\n imgd2.data[idx + 1] = Math.floor(gacc / wacc);\n imgd2.data[idx + 2] = Math.floor(bacc / wacc);\n imgd2.data[idx + 3] = Math.floor(aacc / wacc);\n }\n }\n for (j = 0; j < imgd.height; j++) {\n for (i = 0; i < imgd.width; i++) {\n idx = (j * imgd.width + i) * 4;\n\n d =\n Math.abs(imgd2.data[idx] - imgd.data[idx]) +\n Math.abs(imgd2.data[idx + 1] - imgd.data[idx + 1]) +\n Math.abs(imgd2.data[idx + 2] - imgd.data[idx + 2]) +\n Math.abs(imgd2.data[idx + 3] - imgd.data[idx + 3]);\n\n if (d > delta) {\n imgd2.data[idx] = imgd.data[idx];\n imgd2.data[idx + 1] = imgd.data[idx + 1];\n imgd2.data[idx + 2] = imgd.data[idx + 2];\n imgd2.data[idx + 3] = imgd.data[idx + 3];\n }\n }\n }\n\n return imgd2;\n }\n\n loadImage(url, callback, options) {\n const img = new Image();\n if (options && options.corsenabled) {\n img.crossOrigin = 'Anonymous';\n }\n img.src = url;\n img.onload = function () {\n const canvas = document.createElement('canvas');\n canvas.width = img.width;\n canvas.height = img.height;\n const context = canvas.getContext('2d');\n context.drawImage(img, 0, 0);\n callback(canvas);\n };\n }\n\n getImgdata(canvas) {\n const context = canvas.getContext('2d');\n\n return context.getImageData(0, 0, canvas.width, canvas.height);\n }\n\n drawLayers(layers, palette, scale, parentid) {\n scale = scale || 1;\n let w, h, i, j, k;\n let div;\n if (parentid) {\n div = document.getElementById(parentid);\n if (!div) {\n div = document.createElement('div');\n div.id = parentid;\n document.body.appendChild(div);\n }\n } else {\n div = document.createElement('div');\n document.body.appendChild(div);\n }\n for (k in layers) {\n if (!layers.hasOwnProperty(k)) {\n continue;\n }\n\n w = layers[k][0].length;\n h = layers[k].length;\n\n const canvas = document.createElement('canvas');\n canvas.width = w * scale;\n canvas.height = h * scale;\n const context = canvas.getContext('2d');\n\n for (j = 0; j < h; j += 1) {\n for (i = 0; i < w; i += 1) {\n context.fillStyle = this.torgbastr(palette[layers[k][j][i] % palette.length]);\n context.fillRect(i * scale, j * scale, scale, scale);\n }\n }\n\n div.appendChild(canvas);\n }\n }\n}\n","/**\n * @author NHN. FE Development Team \n * @fileoverview Graphics module\n */\nimport snippet from 'tui-code-snippet';\nimport fabric from 'fabric';\nimport ImageLoader from '@/component/imageLoader';\nimport Cropper from '@/component/cropper';\nimport Flip from '@/component/flip';\nimport Rotation from '@/component/rotation';\nimport FreeDrawing from '@/component/freeDrawing';\nimport Line from '@/component/line';\nimport Text from '@/component/text';\nimport Icon from '@/component/icon';\nimport Filter from '@/component/filter';\nimport Shape from '@/component/shape';\nimport Zoom from '@/component/zoom';\nimport CropperDrawingMode from '@/drawingMode/cropper';\nimport FreeDrawingMode from '@/drawingMode/freeDrawing';\nimport LineDrawingMode from '@/drawingMode/lineDrawing';\nimport ShapeDrawingMode from '@/drawingMode/shape';\nimport TextDrawingMode from '@/drawingMode/text';\nimport IconDrawingMode from '@/drawingMode/icon';\nimport ZoomDrawingMode from '@/drawingMode/zoom';\nimport {\n makeSelectionUndoData,\n makeSelectionUndoDatum,\n setCachedUndoDataForDimension,\n} from '@/helper/selectionModifyHelper';\nimport { getProperties, includes, isShape, Promise } from '@/util';\nimport {\n componentNames as components,\n eventNames as events,\n drawingModes,\n fObjectOptions,\n} from '@/consts';\n\nconst {\n extend,\n stamp,\n isArray,\n isString,\n forEachArray,\n forEachOwnProperties,\n CustomEvents,\n} = snippet;\nconst DEFAULT_CSS_MAX_WIDTH = 1000;\nconst DEFAULT_CSS_MAX_HEIGHT = 800;\nconst EXTRA_PX_FOR_PASTE = 10;\n\nconst cssOnly = {\n cssOnly: true,\n};\nconst backstoreOnly = {\n backstoreOnly: true,\n};\n\n/**\n * Graphics class\n * @class\n * @param {string|HTMLElement} wrapper - Wrapper's element or selector\n * @param {Object} [option] - Canvas max width & height of css\n * @param {number} option.cssMaxWidth - Canvas css-max-width\n * @param {number} option.cssMaxHeight - Canvas css-max-height\n * @ignore\n */\nclass Graphics {\n constructor(element, { cssMaxWidth, cssMaxHeight } = {}) {\n /**\n * Fabric image instance\n * @type {fabric.Image}\n */\n this.canvasImage = null;\n\n /**\n * Max width of canvas elements\n * @type {number}\n */\n this.cssMaxWidth = cssMaxWidth || DEFAULT_CSS_MAX_WIDTH;\n\n /**\n * Max height of canvas elements\n * @type {number}\n */\n this.cssMaxHeight = cssMaxHeight || DEFAULT_CSS_MAX_HEIGHT;\n\n /**\n * cropper Selection Style\n * @type {Object}\n */\n this.cropSelectionStyle = {};\n\n /**\n * target fabric object for copy paste feature\n * @type {fabric.Object}\n * @private\n */\n this.targetObjectForCopyPaste = null;\n\n /**\n * Image name\n * @type {string}\n */\n this.imageName = '';\n\n /**\n * Object Map\n * @type {Object}\n * @private\n */\n this._objects = {};\n\n /**\n * Fabric-Canvas instance\n * @type {fabric.Canvas}\n * @private\n */\n this._canvas = null;\n\n /**\n * Drawing mode\n * @type {string}\n * @private\n */\n this._drawingMode = drawingModes.NORMAL;\n\n /**\n * DrawingMode map\n * @type {Object.}\n * @private\n */\n this._drawingModeMap = {};\n\n /**\n * Component map\n * @type {Object.}\n * @private\n */\n this._componentMap = {};\n\n /**\n * fabric event handlers\n * @type {Object.}\n * @private\n */\n this._handler = {\n onMouseDown: this._onMouseDown.bind(this),\n onObjectAdded: this._onObjectAdded.bind(this),\n onObjectRemoved: this._onObjectRemoved.bind(this),\n onObjectMoved: this._onObjectMoved.bind(this),\n onObjectScaled: this._onObjectScaled.bind(this),\n onObjectModified: this._onObjectModified.bind(this),\n onObjectRotated: this._onObjectRotated.bind(this),\n onObjectSelected: this._onObjectSelected.bind(this),\n onPathCreated: this._onPathCreated.bind(this),\n onSelectionCleared: this._onSelectionCleared.bind(this),\n onSelectionCreated: this._onSelectionCreated.bind(this),\n };\n\n this._setObjectCachingToFalse();\n this._setCanvasElement(element);\n this._createDrawingModeInstances();\n this._createComponents();\n this._attachCanvasEvents();\n }\n\n /**\n * Destroy canvas element\n */\n destroy() {\n const { wrapperEl } = this._canvas;\n\n this._canvas.clear();\n\n wrapperEl.parentNode.removeChild(wrapperEl);\n }\n\n /**\n * Deactivates all objects on canvas\n * @returns {Graphics} this\n */\n deactivateAll() {\n this._canvas.discardActiveObject();\n\n return this;\n }\n\n /**\n * Renders all objects on canvas\n * @returns {Graphics} this\n */\n renderAll() {\n this._canvas.renderAll();\n\n return this;\n }\n\n /**\n * Adds objects on canvas\n * @param {Object|Array} objects - objects\n */\n add(objects) {\n let theArgs = [];\n if (isArray(objects)) {\n theArgs = objects;\n } else {\n theArgs.push(objects);\n }\n\n this._canvas.add(...theArgs);\n }\n\n /**\n * Removes the object or group\n * @param {Object} target - graphics object or group\n * @returns {boolean} true if contains or false\n */\n contains(target) {\n return this._canvas.contains(target);\n }\n\n /**\n * Gets all objects or group\n * @returns {Array} all objects, shallow copy\n */\n getObjects() {\n return this._canvas.getObjects().slice();\n }\n\n /**\n * Get an object by id\n * @param {number} id - object id\n * @returns {fabric.Object} object corresponding id\n */\n getObject(id) {\n return this._objects[id];\n }\n\n /**\n * Removes the object or group\n * @param {Object} target - graphics object or group\n */\n remove(target) {\n this._canvas.remove(target);\n }\n\n /**\n * Removes all object or group\n * @param {boolean} includesBackground - remove the background image or not\n * @returns {Array} all objects array which is removed\n */\n removeAll(includesBackground) {\n const canvas = this._canvas;\n const objects = canvas.getObjects().slice();\n canvas.remove(...this._canvas.getObjects());\n\n if (includesBackground) {\n canvas.clear();\n }\n\n return objects;\n }\n\n /**\n * Removes an object or group by id\n * @param {number} id - object id\n * @returns {Array} removed objects\n */\n removeObjectById(id) {\n const objects = [];\n const canvas = this._canvas;\n const target = this.getObject(id);\n const isValidGroup = target && target.isType('group') && !target.isEmpty();\n\n if (isValidGroup) {\n canvas.discardActiveObject(); // restore states for each objects\n target.forEachObject((obj) => {\n objects.push(obj);\n canvas.remove(obj);\n });\n } else if (canvas.contains(target)) {\n objects.push(target);\n canvas.remove(target);\n }\n\n return objects;\n }\n\n /**\n * Get an id by object instance\n * @param {fabric.Object} object object\n * @returns {number} object id if it exists or null\n */\n getObjectId(object) {\n let key = null;\n for (key in this._objects) {\n if (this._objects.hasOwnProperty(key)) {\n if (object === this._objects[key]) {\n return key;\n }\n }\n }\n\n return null;\n }\n\n /**\n * Gets an active object or group\n * @returns {Object} active object or group instance\n */\n getActiveObject() {\n return this._canvas._activeObject;\n }\n\n /**\n * Returns the object ID to delete the object.\n * @returns {number} object id for remove\n */\n getActiveObjectIdForRemove() {\n const activeObject = this.getActiveObject();\n const { type, left, top } = activeObject;\n const isSelection = type === 'activeSelection';\n\n if (isSelection) {\n const group = new fabric.Group([...activeObject.getObjects()], {\n left,\n top,\n });\n\n return this._addFabricObject(group);\n }\n\n return this.getObjectId(activeObject);\n }\n\n /**\n * Verify that you are ready to erase the object.\n * @returns {boolean} ready for object remove\n */\n isReadyRemoveObject() {\n const activeObject = this.getActiveObject();\n\n return activeObject && !activeObject.isEditing;\n }\n\n /**\n * Gets an active group object\n * @returns {Object} active group object instance\n */\n getActiveObjects() {\n const activeObject = this._canvas._activeObject;\n\n return activeObject && activeObject.type === 'activeSelection' ? activeObject : null;\n }\n\n /**\n * Get Active object Selection from object ids\n * @param {Array.} objects - fabric objects\n * @returns {Object} target - target object group\n */\n getActiveSelectionFromObjects(objects) {\n const canvas = this.getCanvas();\n\n return new fabric.ActiveSelection(objects, { canvas });\n }\n\n /**\n * Activates an object or group\n * @param {Object} target - target object or group\n */\n setActiveObject(target) {\n this._canvas.setActiveObject(target);\n }\n\n /**\n * Set Crop selection style\n * @param {Object} style - Selection styles\n */\n setCropSelectionStyle(style) {\n this.cropSelectionStyle = style;\n }\n\n /**\n * Get component\n * @param {string} name - Component name\n * @returns {Component}\n */\n getComponent(name) {\n return this._componentMap[name];\n }\n\n /**\n * Get current drawing mode\n * @returns {string}\n */\n getDrawingMode() {\n return this._drawingMode;\n }\n\n /**\n * Start a drawing mode. If the current mode is not 'NORMAL', 'stopDrawingMode()' will be called first.\n * @param {String} mode Can be one of 'CROPPER', 'FREE_DRAWING', 'LINE', 'TEXT', 'SHAPE'\n * @param {Object} [option] parameters of drawing mode, it's available with 'FREE_DRAWING', 'LINE_DRAWING'\n * @param {Number} [option.width] brush width\n * @param {String} [option.color] brush color\n * @returns {boolean} true if success or false\n */\n startDrawingMode(mode, option) {\n if (this._isSameDrawingMode(mode)) {\n return true;\n }\n\n // If the current mode is not 'NORMAL', 'stopDrawingMode()' will be called first.\n this.stopDrawingMode();\n\n const drawingModeInstance = this._getDrawingModeInstance(mode);\n if (drawingModeInstance && drawingModeInstance.start) {\n drawingModeInstance.start(this, option);\n\n this._drawingMode = mode;\n }\n\n return !!drawingModeInstance;\n }\n\n /**\n * Stop the current drawing mode and back to the 'NORMAL' mode\n */\n stopDrawingMode() {\n if (this._isSameDrawingMode(drawingModes.NORMAL)) {\n return;\n }\n\n const drawingModeInstance = this._getDrawingModeInstance(this.getDrawingMode());\n if (drawingModeInstance && drawingModeInstance.end) {\n drawingModeInstance.end(this);\n }\n this._drawingMode = drawingModes.NORMAL;\n }\n\n /**\n * Change zoom of canvas\n * @param {{x: number, y: number}} center - center of zoom\n * @param {number} zoomLevel - zoom level\n */\n zoom({ x, y }, zoomLevel) {\n const zoom = this.getComponent(components.ZOOM);\n\n zoom.zoom({ x, y }, zoomLevel);\n }\n\n /**\n * Get zoom mode\n * @returns {string}\n */\n getZoomMode() {\n const zoom = this.getComponent(components.ZOOM);\n\n return zoom.mode;\n }\n\n /**\n * Start zoom-in mode\n */\n startZoomInMode() {\n const zoom = this.getComponent(components.ZOOM);\n\n zoom.startZoomInMode();\n }\n\n /**\n * Stop zoom-in mode\n */\n endZoomInMode() {\n const zoom = this.getComponent(components.ZOOM);\n\n zoom.endZoomInMode();\n }\n\n /**\n * Zoom out one step\n */\n zoomOut() {\n const zoom = this.getComponent(components.ZOOM);\n\n zoom.zoomOut();\n }\n\n /**\n * Start hand mode\n */\n startHandMode() {\n const zoom = this.getComponent(components.ZOOM);\n\n zoom.startHandMode();\n }\n\n /**\n * Stop hand mode\n */\n endHandMode() {\n const zoom = this.getComponent(components.ZOOM);\n\n zoom.endHandMode();\n }\n\n /**\n * Zoom reset\n */\n resetZoom() {\n const zoom = this.getComponent(components.ZOOM);\n\n zoom.resetZoom();\n }\n\n /**\n * To data url from canvas\n * @param {Object} options - options for toDataURL\n * @param {String} [options.format=png] The format of the output image. Either \"jpeg\" or \"png\"\n * @param {Number} [options.quality=1] Quality level (0..1). Only used for jpeg.\n * @param {Number} [options.multiplier=1] Multiplier to scale by\n * @param {Number} [options.left] Cropping left offset. Introduced in fabric v1.2.14\n * @param {Number} [options.top] Cropping top offset. Introduced in fabric v1.2.14\n * @param {Number} [options.width] Cropping width. Introduced in fabric v1.2.14\n * @param {Number} [options.height] Cropping height. Introduced in fabric v1.2.14\n * @returns {string} A DOMString containing the requested data URI.\n */\n toDataURL(options) {\n const cropper = this.getComponent(components.CROPPER);\n cropper.changeVisibility(false);\n\n const dataUrl = this._canvas && this._canvas.toDataURL(options);\n cropper.changeVisibility(true);\n\n return dataUrl;\n }\n\n /**\n * Save image(background) of canvas\n * @param {string} name - Name of image\n * @param {?fabric.Image} canvasImage - Fabric image instance\n */\n setCanvasImage(name, canvasImage) {\n if (canvasImage) {\n stamp(canvasImage);\n }\n this.imageName = name;\n this.canvasImage = canvasImage;\n }\n\n /**\n * Set css max dimension\n * @param {{width: number, height: number}} maxDimension - Max width & Max height\n */\n setCssMaxDimension(maxDimension) {\n this.cssMaxWidth = maxDimension.width || this.cssMaxWidth;\n this.cssMaxHeight = maxDimension.height || this.cssMaxHeight;\n }\n\n /**\n * Adjust canvas dimension with scaling image\n */\n adjustCanvasDimension() {\n const canvasImage = this.canvasImage.scale(1);\n const { width, height } = canvasImage.getBoundingRect();\n const maxDimension = this._calcMaxDimension(width, height);\n\n this.setCanvasCssDimension({\n width: '100%',\n height: '100%', // Set height '' for IE9\n 'max-width': `${maxDimension.width}px`,\n 'max-height': `${maxDimension.height}px`,\n });\n\n this.setCanvasBackstoreDimension({\n width,\n height,\n });\n this._canvas.centerObject(canvasImage);\n }\n\n /**\n * Set canvas dimension - css only\n * {@link http://fabricjs.com/docs/fabric.Canvas.html#setDimensions}\n * @param {Object} dimension - Canvas css dimension\n */\n setCanvasCssDimension(dimension) {\n this._canvas.setDimensions(dimension, cssOnly);\n }\n\n /**\n * Set canvas dimension - backstore only\n * {@link http://fabricjs.com/docs/fabric.Canvas.html#setDimensions}\n * @param {Object} dimension - Canvas backstore dimension\n */\n setCanvasBackstoreDimension(dimension) {\n this._canvas.setDimensions(dimension, backstoreOnly);\n }\n\n /**\n * Set image properties\n * {@link http://fabricjs.com/docs/fabric.Image.html#set}\n * @param {Object} setting - Image properties\n * @param {boolean} [withRendering] - If true, The changed image will be reflected in the canvas\n */\n setImageProperties(setting, withRendering) {\n const { canvasImage } = this;\n\n if (!canvasImage) {\n return;\n }\n\n canvasImage.set(setting).setCoords();\n if (withRendering) {\n this._canvas.renderAll();\n }\n }\n\n /**\n * Returns canvas element of fabric.Canvas[[lower-canvas]]\n * @returns {HTMLCanvasElement}\n */\n getCanvasElement() {\n return this._canvas.getElement();\n }\n\n /**\n * Get fabric.Canvas instance\n * @returns {fabric.Canvas}\n */\n getCanvas() {\n return this._canvas;\n }\n\n /**\n * Get canvasImage (fabric.Image instance)\n * @returns {fabric.Image}\n */\n getCanvasImage() {\n return this.canvasImage;\n }\n\n /**\n * Get image name\n * @returns {string}\n */\n getImageName() {\n return this.imageName;\n }\n\n /**\n * Add image object on canvas\n * @param {string} imgUrl - Image url to make object\n * @returns {Promise}\n */\n addImageObject(imgUrl) {\n const callback = this._callbackAfterLoadingImageObject.bind(this);\n\n return new Promise((resolve) => {\n fabric.Image.fromURL(\n imgUrl,\n (image) => {\n callback(image);\n resolve(this.createObjectProperties(image));\n },\n {\n crossOrigin: 'Anonymous',\n }\n );\n });\n }\n\n /**\n * Get center position of canvas\n * @returns {Object} {left, top}\n */\n getCenter() {\n return this._canvas.getCenter();\n }\n\n /**\n * Get cropped rect\n * @returns {Object} rect\n */\n getCropzoneRect() {\n return this.getComponent(components.CROPPER).getCropzoneRect();\n }\n\n /**\n * Get cropped rect\n * @param {number} [mode] cropzone rect mode\n */\n setCropzoneRect(mode) {\n this.getComponent(components.CROPPER).setCropzoneRect(mode);\n }\n\n /**\n * Get cropped image data\n * @param {Object} cropRect cropzone rect\n * @param {Number} cropRect.left left position\n * @param {Number} cropRect.top top position\n * @param {Number} cropRect.width width\n * @param {Number} cropRect.height height\n * @returns {?{imageName: string, url: string}} cropped Image data\n */\n getCroppedImageData(cropRect) {\n return this.getComponent(components.CROPPER).getCroppedImageData(cropRect);\n }\n\n /**\n * Set brush option\n * @param {Object} option brush option\n * @param {Number} option.width width\n * @param {String} option.color color like 'FFFFFF', 'rgba(0, 0, 0, 0.5)'\n */\n setBrush(option) {\n const drawingMode = this._drawingMode;\n let compName = components.FREE_DRAWING;\n\n if (drawingMode === drawingModes.LINE_DRAWING) {\n compName = components.LINE;\n }\n\n this.getComponent(compName).setBrush(option);\n }\n\n /**\n * Set states of current drawing shape\n * @param {string} type - Shape type (ex: 'rect', 'circle', 'triangle')\n * @param {Object} [options] - Shape options\n * @param {(ShapeFillOption | string)} [options.fill] - {@link ShapeFillOption} or\n * Shape foreground color (ex: '#fff', 'transparent')\n * @param {string} [options.stoke] - Shape outline color\n * @param {number} [options.strokeWidth] - Shape outline width\n * @param {number} [options.width] - Width value (When type option is 'rect', this options can use)\n * @param {number} [options.height] - Height value (When type option is 'rect', this options can use)\n * @param {number} [options.rx] - Radius x value (When type option is 'circle', this options can use)\n * @param {number} [options.ry] - Radius y value (When type option is 'circle', this options can use)\n * @param {number} [options.isRegular] - Whether resizing shape has 1:1 ratio or not\n */\n setDrawingShape(type, options) {\n this.getComponent(components.SHAPE).setStates(type, options);\n }\n\n /**\n * Set style of current drawing icon\n * @param {string} type - icon type (ex: 'icon-arrow', 'icon-star')\n * @param {Object} [iconColor] - Icon color\n */\n setIconStyle(type, iconColor) {\n this.getComponent(components.ICON).setStates(type, iconColor);\n }\n\n /**\n * Register icon paths\n * @param {Object} pathInfos - Path infos\n * @param {string} pathInfos.key - key\n * @param {string} pathInfos.value - value\n */\n registerPaths(pathInfos) {\n this.getComponent(components.ICON).registerPaths(pathInfos);\n }\n\n /**\n * Change cursor style\n * @param {string} cursorType - cursor type\n */\n changeCursor(cursorType) {\n const canvas = this.getCanvas();\n canvas.defaultCursor = cursorType;\n canvas.renderAll();\n }\n\n /**\n * Whether it has the filter or not\n * @param {string} type - Filter type\n * @returns {boolean} true if it has the filter\n */\n hasFilter(type) {\n return this.getComponent(components.FILTER).hasFilter(type);\n }\n\n /**\n * Set selection style of fabric object by init option\n * @param {Object} styles - Selection styles\n */\n setSelectionStyle(styles) {\n extend(fObjectOptions.SELECTION_STYLE, styles);\n }\n\n /**\n * Set object properties\n * @param {number} id - object id\n * @param {Object} props - props\n * @param {string} [props.fill] Color\n * @param {string} [props.fontFamily] Font type for text\n * @param {number} [props.fontSize] Size\n * @param {string} [props.fontStyle] Type of inclination (normal / italic)\n * @param {string} [props.fontWeight] Type of thicker or thinner looking (normal / bold)\n * @param {string} [props.textAlign] Type of text align (left / center / right)\n * @param {string} [props.textDecoration] Type of line (underline / line-through / overline)\n * @returns {Object} applied properties\n */\n setObjectProperties(id, props) {\n const object = this.getObject(id);\n const clone = extend({}, props);\n\n object.set(clone);\n\n object.setCoords();\n\n this.getCanvas().renderAll();\n\n return clone;\n }\n\n /**\n * Get object properties corresponding key\n * @param {number} id - object id\n * @param {Array|ObjectProps|string} keys - property's key\n * @returns {Object} properties\n */\n getObjectProperties(id, keys) {\n const object = this.getObject(id);\n const props = {};\n\n if (isString(keys)) {\n props[keys] = object[keys];\n } else if (isArray(keys)) {\n forEachArray(keys, (value) => {\n props[value] = object[value];\n });\n } else {\n forEachOwnProperties(keys, (value, key) => {\n props[key] = object[key];\n });\n }\n\n return props;\n }\n\n /**\n * Get object position by originX, originY\n * @param {number} id - object id\n * @param {string} originX - can be 'left', 'center', 'right'\n * @param {string} originY - can be 'top', 'center', 'bottom'\n * @returns {Object} {{x:number, y: number}} position by origin if id is valid, or null\n */\n getObjectPosition(id, originX, originY) {\n const targetObj = this.getObject(id);\n if (!targetObj) {\n return null;\n }\n\n return targetObj.getPointByOrigin(originX, originY);\n }\n\n /**\n * Set object position by originX, originY\n * @param {number} id - object id\n * @param {Object} posInfo - position object\n * @param {number} posInfo.x - x position\n * @param {number} posInfo.y - y position\n * @param {string} posInfo.originX - can be 'left', 'center', 'right'\n * @param {string} posInfo.originY - can be 'top', 'center', 'bottom'\n * @returns {boolean} true if target id is valid or false\n */\n setObjectPosition(id, posInfo) {\n const targetObj = this.getObject(id);\n const { x, y, originX, originY } = posInfo;\n if (!targetObj) {\n return false;\n }\n\n const targetOrigin = targetObj.getPointByOrigin(originX, originY);\n const centerOrigin = targetObj.getPointByOrigin('center', 'center');\n const diffX = centerOrigin.x - targetOrigin.x;\n const diffY = centerOrigin.y - targetOrigin.y;\n\n targetObj.set({\n left: x + diffX,\n top: y + diffY,\n });\n\n targetObj.setCoords();\n\n return true;\n }\n\n /**\n * Get the canvas size\n * @returns {Object} {{width: number, height: number}} image size\n */\n getCanvasSize() {\n const image = this.getCanvasImage();\n\n return {\n width: image ? image.width : 0,\n height: image ? image.height : 0,\n };\n }\n\n /**\n * Create fabric static canvas\n * @returns {Object} {{width: number, height: number}} image size\n */\n createStaticCanvas() {\n const staticCanvas = new fabric.StaticCanvas();\n\n staticCanvas.set({\n enableRetinaScaling: false,\n });\n\n return staticCanvas;\n }\n\n /**\n * Get a DrawingMode instance\n * @param {string} modeName - DrawingMode Class Name\n * @returns {DrawingMode} DrawingMode instance\n * @private\n */\n _getDrawingModeInstance(modeName) {\n return this._drawingModeMap[modeName];\n }\n\n /**\n * Set object caching to false. This brought many bugs when draw Shape & cropzone\n * @see http://fabricjs.com/fabric-object-caching\n * @private\n */\n _setObjectCachingToFalse() {\n fabric.Object.prototype.objectCaching = false;\n }\n\n /**\n * Set canvas element to fabric.Canvas\n * @param {Element|string} element - Wrapper or canvas element or selector\n * @private\n */\n _setCanvasElement(element) {\n let selectedElement;\n let canvasElement;\n\n if (element.nodeType) {\n selectedElement = element;\n } else {\n selectedElement = document.querySelector(element);\n }\n\n if (selectedElement.nodeName.toUpperCase() !== 'CANVAS') {\n canvasElement = document.createElement('canvas');\n selectedElement.appendChild(canvasElement);\n }\n\n this._canvas = new fabric.Canvas(canvasElement, {\n containerClass: 'tui-image-editor-canvas-container',\n enableRetinaScaling: false,\n });\n }\n\n /**\n * Creates DrawingMode instances\n * @private\n */\n _createDrawingModeInstances() {\n this._register(this._drawingModeMap, new CropperDrawingMode());\n this._register(this._drawingModeMap, new FreeDrawingMode());\n this._register(this._drawingModeMap, new LineDrawingMode());\n this._register(this._drawingModeMap, new ShapeDrawingMode());\n this._register(this._drawingModeMap, new TextDrawingMode());\n this._register(this._drawingModeMap, new IconDrawingMode());\n this._register(this._drawingModeMap, new ZoomDrawingMode());\n }\n\n /**\n * Create components\n * @private\n */\n _createComponents() {\n this._register(this._componentMap, new ImageLoader(this));\n this._register(this._componentMap, new Cropper(this));\n this._register(this._componentMap, new Flip(this));\n this._register(this._componentMap, new Rotation(this));\n this._register(this._componentMap, new FreeDrawing(this));\n this._register(this._componentMap, new Line(this));\n this._register(this._componentMap, new Text(this));\n this._register(this._componentMap, new Icon(this));\n this._register(this._componentMap, new Filter(this));\n this._register(this._componentMap, new Shape(this));\n this._register(this._componentMap, new Zoom(this));\n }\n\n /**\n * Register component\n * @param {Object} map - map object\n * @param {Object} module - module which has getName method\n * @private\n */\n _register(map, module) {\n map[module.getName()] = module;\n }\n\n /**\n * Get the current drawing mode is same with given mode\n * @param {string} mode drawing mode\n * @returns {boolean} true if same or false\n */\n _isSameDrawingMode(mode) {\n return this.getDrawingMode() === mode;\n }\n\n /**\n * Calculate max dimension of canvas\n * The css-max dimension is dynamically decided with maintaining image ratio\n * The css-max dimension is lower than canvas dimension (attribute of canvas, not css)\n * @param {number} width - Canvas width\n * @param {number} height - Canvas height\n * @returns {{width: number, height: number}} - Max width & Max height\n * @private\n */\n _calcMaxDimension(width, height) {\n const wScaleFactor = this.cssMaxWidth / width;\n const hScaleFactor = this.cssMaxHeight / height;\n let cssMaxWidth = Math.min(width, this.cssMaxWidth);\n let cssMaxHeight = Math.min(height, this.cssMaxHeight);\n\n if (wScaleFactor < 1 && wScaleFactor < hScaleFactor) {\n cssMaxWidth = width * wScaleFactor;\n cssMaxHeight = height * wScaleFactor;\n } else if (hScaleFactor < 1 && hScaleFactor < wScaleFactor) {\n cssMaxWidth = width * hScaleFactor;\n cssMaxHeight = height * hScaleFactor;\n }\n\n return {\n width: Math.floor(cssMaxWidth),\n height: Math.floor(cssMaxHeight),\n };\n }\n\n /**\n * Callback function after loading image\n * @param {fabric.Image} obj - Fabric image object\n * @private\n */\n _callbackAfterLoadingImageObject(obj) {\n const centerPos = this.getCanvasImage().getCenterPoint();\n\n obj.set(fObjectOptions.SELECTION_STYLE);\n obj.set({\n left: centerPos.x,\n top: centerPos.y,\n crossOrigin: 'Anonymous',\n });\n\n this.getCanvas().add(obj).setActiveObject(obj);\n }\n\n /**\n * Attach canvas's events\n */\n _attachCanvasEvents() {\n const canvas = this._canvas;\n const handler = this._handler;\n canvas.on({\n 'mouse:down': handler.onMouseDown,\n 'object:added': handler.onObjectAdded,\n 'object:removed': handler.onObjectRemoved,\n 'object:moving': handler.onObjectMoved,\n 'object:scaling': handler.onObjectScaled,\n 'object:modified': handler.onObjectModified,\n 'object:rotating': handler.onObjectRotated,\n 'path:created': handler.onPathCreated,\n 'selection:cleared': handler.onSelectionCleared,\n 'selection:created': handler.onSelectionCreated,\n 'selection:updated': handler.onObjectSelected,\n });\n }\n\n /**\n * \"mouse:down\" canvas event handler\n * @param {{target: fabric.Object, e: MouseEvent}} fEvent - Fabric event\n * @private\n */\n _onMouseDown(fEvent) {\n const { e: event, target } = fEvent;\n const originPointer = this._canvas.getPointer(event);\n\n if (target) {\n const { type } = target;\n const undoData = makeSelectionUndoData(target, (item) =>\n makeSelectionUndoDatum(this.getObjectId(item), item, type === 'activeSelection')\n );\n\n setCachedUndoDataForDimension(undoData);\n }\n\n this.fire(events.MOUSE_DOWN, event, originPointer);\n }\n\n /**\n * \"object:added\" canvas event handler\n * @param {{target: fabric.Object, e: MouseEvent}} fEvent - Fabric event\n * @private\n */\n _onObjectAdded(fEvent) {\n const obj = fEvent.target;\n if (obj.isType('cropzone')) {\n return;\n }\n\n this._addFabricObject(obj);\n }\n\n /**\n * \"object:removed\" canvas event handler\n * @param {{target: fabric.Object, e: MouseEvent}} fEvent - Fabric event\n * @private\n */\n _onObjectRemoved(fEvent) {\n const obj = fEvent.target;\n\n this._removeFabricObject(stamp(obj));\n }\n\n /**\n * \"object:moving\" canvas event handler\n * @param {{target: fabric.Object, e: MouseEvent}} fEvent - Fabric event\n * @private\n */\n _onObjectMoved(fEvent) {\n this._lazyFire(\n events.OBJECT_MOVED,\n (object) => this.createObjectProperties(object),\n fEvent.target\n );\n }\n\n /**\n * \"object:scaling\" canvas event handler\n * @param {{target: fabric.Object, e: MouseEvent}} fEvent - Fabric event\n * @private\n */\n _onObjectScaled(fEvent) {\n this._lazyFire(\n events.OBJECT_SCALED,\n (object) => this.createObjectProperties(object),\n fEvent.target\n );\n }\n\n /**\n * \"object:modified\" canvas event handler\n * @param {{target: fabric.Object, e: MouseEvent}} fEvent - Fabric event\n * @private\n */\n _onObjectModified(fEvent) {\n const { target } = fEvent;\n if (target.type === 'activeSelection') {\n const items = target.getObjects();\n\n items.forEach((item) => item.fire('modifiedInGroup', target));\n }\n\n this.fire(events.OBJECT_MODIFIED, target, this.getObjectId(target));\n }\n\n /**\n * \"object:rotating\" canvas event handler\n * @param {{target: fabric.Object, e: MouseEvent}} fEvent - Fabric event\n * @private\n */\n _onObjectRotated(fEvent) {\n this._lazyFire(\n events.OBJECT_ROTATED,\n (object) => this.createObjectProperties(object),\n fEvent.target\n );\n }\n\n /**\n * Lazy event emitter\n * @param {string} eventName - event name\n * @param {Function} paramsMaker - make param function\n * @param {Object} [target] - Object of the event owner.\n * @private\n */\n _lazyFire(eventName, paramsMaker, target) {\n const existEventDelegation = target && target.canvasEventDelegation;\n const delegationState = existEventDelegation ? target.canvasEventDelegation(eventName) : 'none';\n\n if (delegationState === 'unregistered') {\n target.canvasEventRegister(eventName, (object) => {\n this.fire(eventName, paramsMaker(object));\n });\n }\n\n if (delegationState === 'none') {\n this.fire(eventName, paramsMaker(target));\n }\n }\n\n /**\n * \"object:selected\" canvas event handler\n * @param {{target: fabric.Object, e: MouseEvent}} fEvent - Fabric event\n * @private\n */\n _onObjectSelected(fEvent) {\n const { target } = fEvent;\n const params = this.createObjectProperties(target);\n\n this.fire(events.OBJECT_ACTIVATED, params);\n }\n\n /**\n * \"path:created\" canvas event handler\n * @param {{path: fabric.Path}} obj - Path object\n * @private\n */\n _onPathCreated(obj) {\n const { x: left, y: top } = obj.path.getCenterPoint();\n obj.path.set(\n extend(\n {\n left,\n top,\n },\n fObjectOptions.SELECTION_STYLE\n )\n );\n\n const params = this.createObjectProperties(obj.path);\n\n this.fire(events.ADD_OBJECT, params);\n }\n\n /**\n * \"selction:cleared\" canvas event handler\n * @private\n */\n _onSelectionCleared() {\n this.fire(events.SELECTION_CLEARED);\n }\n\n /**\n * \"selction:created\" canvas event handler\n * @param {{target: fabric.Object, e: MouseEvent}} fEvent - Fabric event\n * @private\n */\n _onSelectionCreated(fEvent) {\n const { target } = fEvent;\n const params = this.createObjectProperties(target);\n\n this.fire(events.OBJECT_ACTIVATED, params);\n this.fire(events.SELECTION_CREATED, fEvent.target);\n }\n\n /**\n * Canvas discard selection all\n */\n discardSelection() {\n this._canvas.discardActiveObject();\n this._canvas.renderAll();\n }\n\n /**\n * Canvas Selectable status change\n * @param {boolean} selectable - expect status\n */\n changeSelectableAll(selectable) {\n this._canvas.forEachObject((obj) => {\n obj.selectable = selectable;\n obj.hoverCursor = selectable ? 'move' : 'crosshair';\n });\n }\n\n /**\n * Return object's properties\n * @param {fabric.Object} obj - fabric object\n * @returns {Object} properties object\n */\n createObjectProperties(obj) {\n const predefinedKeys = [\n 'left',\n 'top',\n 'width',\n 'height',\n 'fill',\n 'stroke',\n 'strokeWidth',\n 'opacity',\n 'angle',\n ];\n const props = {\n id: stamp(obj),\n type: obj.type,\n };\n\n extend(props, getProperties(obj, predefinedKeys));\n\n if (includes(['i-text', 'text'], obj.type)) {\n extend(props, this._createTextProperties(obj, props));\n } else if (includes(['rect', 'triangle', 'circle'], obj.type)) {\n const shapeComp = this.getComponent(components.SHAPE);\n extend(props, {\n fill: shapeComp.makeFillPropertyForUserEvent(obj),\n });\n }\n\n return props;\n }\n\n /**\n * Get text object's properties\n * @param {fabric.Object} obj - fabric text object\n * @param {Object} props - properties\n * @returns {Object} properties object\n */\n _createTextProperties(obj) {\n const predefinedKeys = [\n 'text',\n 'fontFamily',\n 'fontSize',\n 'fontStyle',\n 'textAlign',\n 'textDecoration',\n 'fontWeight',\n ];\n const props = {};\n extend(props, getProperties(obj, predefinedKeys));\n\n return props;\n }\n\n /**\n * Add object array by id\n * @param {fabric.Object} obj - fabric object\n * @returns {number} object id\n */\n _addFabricObject(obj) {\n const id = stamp(obj);\n this._objects[id] = obj;\n\n return id;\n }\n\n /**\n * Remove an object in array yb id\n * @param {number} id - object id\n */\n _removeFabricObject(id) {\n delete this._objects[id];\n }\n\n /**\n * Reset targetObjectForCopyPaste value from activeObject\n */\n resetTargetObjectForCopyPaste() {\n const activeObject = this.getActiveObject();\n\n if (activeObject) {\n this.targetObjectForCopyPaste = activeObject;\n }\n }\n\n /**\n * Paste fabric object\n * @returns {Promise}\n */\n pasteObject() {\n if (!this.targetObjectForCopyPaste) {\n return Promise.resolve([]);\n }\n\n const targetObject = this.targetObjectForCopyPaste;\n const isGroupSelect = targetObject.type === 'activeSelection';\n const targetObjects = isGroupSelect ? targetObject.getObjects() : [targetObject];\n let newTargetObject = null;\n\n this.discardSelection();\n\n return this._cloneObject(targetObjects).then((addedObjects) => {\n if (addedObjects.length > 1) {\n newTargetObject = this.getActiveSelectionFromObjects(addedObjects);\n } else {\n [newTargetObject] = addedObjects;\n }\n this.targetObjectForCopyPaste = newTargetObject;\n this.setActiveObject(newTargetObject);\n });\n }\n\n /**\n * Clone object\n * @param {fabric.Object} targetObjects - fabric object\n * @returns {Promise}\n * @private\n */\n _cloneObject(targetObjects) {\n const addedObjects = snippet.map(targetObjects, (targetObject) =>\n this._cloneObjectItem(targetObject)\n );\n\n return Promise.all(addedObjects);\n }\n\n /**\n * Clone object one item\n * @param {fabric.Object} targetObject - fabric object\n * @returns {Promise}\n * @private\n */\n _cloneObjectItem(targetObject) {\n return this._copyFabricObjectForPaste(targetObject).then((clonedObject) => {\n const objectProperties = this.createObjectProperties(clonedObject);\n this.add(clonedObject);\n\n this.fire(events.ADD_OBJECT, objectProperties);\n\n return clonedObject;\n });\n }\n\n /**\n * Copy fabric object with Changed position for copy and paste\n * @param {fabric.Object} targetObject - fabric object\n * @returns {Promise}\n * @private\n */\n _copyFabricObjectForPaste(targetObject) {\n const addExtraPx = (value, isReverse) =>\n isReverse ? value - EXTRA_PX_FOR_PASTE : value + EXTRA_PX_FOR_PASTE;\n\n return this._copyFabricObject(targetObject).then((clonedObject) => {\n const { left, top, width, height } = clonedObject;\n const { width: canvasWidth, height: canvasHeight } = this.getCanvasSize();\n const rightEdge = left + width / 2;\n const bottomEdge = top + height / 2;\n\n clonedObject.set(\n snippet.extend(\n {\n left: addExtraPx(left, rightEdge + EXTRA_PX_FOR_PASTE > canvasWidth),\n top: addExtraPx(top, bottomEdge + EXTRA_PX_FOR_PASTE > canvasHeight),\n },\n fObjectOptions.SELECTION_STYLE\n )\n );\n\n return clonedObject;\n });\n }\n\n /**\n * Copy fabric object\n * @param {fabric.Object} targetObject - fabric object\n * @returns {Promise}\n * @private\n */\n _copyFabricObject(targetObject) {\n return new Promise((resolve) => {\n targetObject.clone((cloned) => {\n const shapeComp = this.getComponent(components.SHAPE);\n if (isShape(cloned)) {\n shapeComp.processForCopiedObject(cloned, targetObject);\n }\n\n resolve(cloned);\n });\n });\n }\n}\n\nCustomEvents.mixin(Graphics);\n\nexport default Graphics;\n","/**\n * @author NHN. FE Development Team \n * @fileoverview Image loader\n */\nimport Component from '@/interface/component';\nimport { Promise } from '@/util';\nimport { componentNames, rejectMessages } from '@/consts';\n\nconst imageOption = {\n padding: 0,\n crossOrigin: 'Anonymous',\n};\n\n/**\n * ImageLoader components\n * @extends {Component}\n * @class ImageLoader\n * @param {Graphics} graphics - Graphics instance\n * @ignore\n */\nclass ImageLoader extends Component {\n constructor(graphics) {\n super(componentNames.IMAGE_LOADER, graphics);\n }\n\n /**\n * Load image from url\n * @param {?string} imageName - File name\n * @param {?(fabric.Image|string)} img - fabric.Image instance or URL of an image\n * @returns {Promise}\n */\n load(imageName, img) {\n let promise;\n\n if (!imageName && !img) {\n // Back to the initial state, not error.\n const canvas = this.getCanvas();\n\n canvas.backgroundImage = null;\n canvas.renderAll();\n\n promise = new Promise((resolve) => {\n this.setCanvasImage('', null);\n resolve();\n });\n } else {\n promise = this._setBackgroundImage(img).then((oImage) => {\n this.setCanvasImage(imageName, oImage);\n this.adjustCanvasDimension();\n\n return oImage;\n });\n }\n\n return promise;\n }\n\n /**\n * Set background image\n * @param {?(fabric.Image|String)} img fabric.Image instance or URL of an image to set background to\n * @returns {Promise}\n * @private\n */\n _setBackgroundImage(img) {\n if (!img) {\n return Promise.reject(rejectMessages.loadImage);\n }\n\n return new Promise((resolve, reject) => {\n const canvas = this.getCanvas();\n\n canvas.setBackgroundImage(\n img,\n () => {\n const oImage = canvas.backgroundImage;\n\n if (oImage && oImage.getElement()) {\n resolve(oImage);\n } else {\n reject(rejectMessages.loadingImageFailed);\n }\n },\n imageOption\n );\n });\n }\n}\n\nexport default ImageLoader;\n","/**\n * @author NHN. FE Development Team \n * @fileoverview Image crop module (start cropping, end cropping)\n */\nimport snippet from 'tui-code-snippet';\nimport fabric from 'fabric';\nimport Component from '@/interface/component';\nimport Cropzone from '@/extension/cropzone';\nimport { keyCodes, componentNames, CROPZONE_DEFAULT_OPTIONS } from '@/consts';\nimport { clamp, fixFloatingPoint } from '@/util';\n\nconst MOUSE_MOVE_THRESHOLD = 10;\nconst DEFAULT_OPTION = {\n presetRatio: null,\n top: -10,\n left: -10,\n height: 1,\n width: 1,\n};\n\n/**\n * Cropper components\n * @param {Graphics} graphics - Graphics instance\n * @extends {Component}\n * @class Cropper\n * @ignore\n */\nclass Cropper extends Component {\n constructor(graphics) {\n super(componentNames.CROPPER, graphics);\n\n /**\n * Cropzone\n * @type {Cropzone}\n * @private\n */\n this._cropzone = null;\n\n /**\n * StartX of Cropzone\n * @type {number}\n * @private\n */\n this._startX = null;\n\n /**\n * StartY of Cropzone\n * @type {number}\n * @private\n */\n this._startY = null;\n\n /**\n * State whether shortcut key is pressed or not\n * @type {boolean}\n * @private\n */\n this._withShiftKey = false;\n\n /**\n * Listeners\n * @type {object.}\n * @private\n */\n this._listeners = {\n keydown: this._onKeyDown.bind(this),\n keyup: this._onKeyUp.bind(this),\n mousedown: this._onFabricMouseDown.bind(this),\n mousemove: this._onFabricMouseMove.bind(this),\n mouseup: this._onFabricMouseUp.bind(this),\n };\n }\n\n /**\n * Start cropping\n */\n start() {\n if (this._cropzone) {\n return;\n }\n const canvas = this.getCanvas();\n\n canvas.forEachObject((obj) => {\n // {@link http://fabricjs.com/docs/fabric.Object.html#evented}\n obj.evented = false;\n });\n\n this._cropzone = new Cropzone(\n canvas,\n snippet.extend(\n {\n left: 0,\n top: 0,\n width: 0.5,\n height: 0.5,\n strokeWidth: 0, // {@link https://github.com/kangax/fabric.js/issues/2860}\n cornerSize: 10,\n cornerColor: 'black',\n fill: 'transparent',\n },\n CROPZONE_DEFAULT_OPTIONS,\n this.graphics.cropSelectionStyle\n )\n );\n\n canvas.discardActiveObject();\n canvas.add(this._cropzone);\n canvas.on('mouse:down', this._listeners.mousedown);\n canvas.selection = false;\n canvas.defaultCursor = 'crosshair';\n\n fabric.util.addListener(document, 'keydown', this._listeners.keydown);\n fabric.util.addListener(document, 'keyup', this._listeners.keyup);\n }\n\n /**\n * End cropping\n */\n end() {\n const canvas = this.getCanvas();\n const cropzone = this._cropzone;\n\n if (!cropzone) {\n return;\n }\n canvas.remove(cropzone);\n canvas.selection = true;\n canvas.defaultCursor = 'default';\n canvas.off('mouse:down', this._listeners.mousedown);\n canvas.forEachObject((obj) => {\n obj.evented = true;\n });\n\n this._cropzone = null;\n\n fabric.util.removeListener(document, 'keydown', this._listeners.keydown);\n fabric.util.removeListener(document, 'keyup', this._listeners.keyup);\n }\n\n /**\n * Change cropzone visible\n * @param {boolean} visible - cropzone visible state\n */\n changeVisibility(visible) {\n if (this._cropzone) {\n this._cropzone.set({ visible });\n }\n }\n\n /**\n * onMousedown handler in fabric canvas\n * @param {{target: fabric.Object, e: MouseEvent}} fEvent - Fabric event\n * @private\n */\n _onFabricMouseDown(fEvent) {\n const canvas = this.getCanvas();\n\n if (fEvent.target) {\n return;\n }\n\n canvas.selection = false;\n const coord = canvas.getPointer(fEvent.e);\n\n this._startX = coord.x;\n this._startY = coord.y;\n\n canvas.on({\n 'mouse:move': this._listeners.mousemove,\n 'mouse:up': this._listeners.mouseup,\n });\n }\n\n /**\n * onMousemove handler in fabric canvas\n * @param {{target: fabric.Object, e: MouseEvent}} fEvent - Fabric event\n * @private\n */\n _onFabricMouseMove(fEvent) {\n const canvas = this.getCanvas();\n const pointer = canvas.getPointer(fEvent.e);\n const { x, y } = pointer;\n const cropzone = this._cropzone;\n\n if (Math.abs(x - this._startX) + Math.abs(y - this._startY) > MOUSE_MOVE_THRESHOLD) {\n canvas.remove(cropzone);\n cropzone.set(this._calcRectDimensionFromPoint(x, y));\n\n canvas.add(cropzone);\n canvas.setActiveObject(cropzone);\n }\n }\n\n /**\n * Get rect dimension setting from Canvas-Mouse-Position(x, y)\n * @param {number} x - Canvas-Mouse-Position x\n * @param {number} y - Canvas-Mouse-Position Y\n * @returns {{left: number, top: number, width: number, height: number}}\n * @private\n */\n _calcRectDimensionFromPoint(x, y) {\n const canvas = this.getCanvas();\n const canvasWidth = canvas.getWidth();\n const canvasHeight = canvas.getHeight();\n const startX = this._startX;\n const startY = this._startY;\n let left = clamp(x, 0, startX);\n let top = clamp(y, 0, startY);\n let width = clamp(x, startX, canvasWidth) - left; // (startX <= x(mouse) <= canvasWidth) - left\n let height = clamp(y, startY, canvasHeight) - top; // (startY <= y(mouse) <= canvasHeight) - top\n\n if (this._withShiftKey) {\n // make fixed ratio cropzone\n if (width > height) {\n height = width;\n } else if (height > width) {\n width = height;\n }\n\n if (startX >= x) {\n left = startX - width;\n }\n\n if (startY >= y) {\n top = startY - height;\n }\n }\n\n return {\n left,\n top,\n width,\n height,\n };\n }\n\n /**\n * onMouseup handler in fabric canvas\n * @private\n */\n _onFabricMouseUp() {\n const cropzone = this._cropzone;\n const listeners = this._listeners;\n const canvas = this.getCanvas();\n\n canvas.setActiveObject(cropzone);\n canvas.off({\n 'mouse:move': listeners.mousemove,\n 'mouse:up': listeners.mouseup,\n });\n }\n\n /**\n * Get cropped image data\n * @param {Object} cropRect cropzone rect\n * @param {Number} cropRect.left left position\n * @param {Number} cropRect.top top position\n * @param {Number} cropRect.width width\n * @param {Number} cropRect.height height\n * @returns {?{imageName: string, url: string}} cropped Image data\n */\n getCroppedImageData(cropRect) {\n const canvas = this.getCanvas();\n const containsCropzone = canvas.contains(this._cropzone);\n if (!cropRect) {\n return null;\n }\n\n if (containsCropzone) {\n canvas.remove(this._cropzone);\n }\n\n const imageData = {\n imageName: this.getImageName(),\n url: canvas.toDataURL(cropRect),\n };\n\n if (containsCropzone) {\n canvas.add(this._cropzone);\n }\n\n return imageData;\n }\n\n /**\n * Get cropped rect\n * @returns {Object} rect\n */\n getCropzoneRect() {\n const cropzone = this._cropzone;\n\n if (!cropzone.isValid()) {\n return null;\n }\n\n return {\n left: cropzone.left,\n top: cropzone.top,\n width: cropzone.width,\n height: cropzone.height,\n };\n }\n\n /**\n * Set a cropzone square\n * @param {number} [presetRatio] - preset ratio\n */\n setCropzoneRect(presetRatio) {\n const canvas = this.getCanvas();\n const cropzone = this._cropzone;\n\n canvas.discardActiveObject();\n canvas.selection = false;\n canvas.remove(cropzone);\n\n cropzone.set(presetRatio ? this._getPresetPropertiesForCropSize(presetRatio) : DEFAULT_OPTION);\n\n canvas.add(cropzone);\n canvas.selection = true;\n\n if (presetRatio) {\n canvas.setActiveObject(cropzone);\n }\n }\n\n /**\n * get a cropzone square info\n * @param {number} presetRatio - preset ratio\n * @returns {{presetRatio: number, left: number, top: number, width: number, height: number}}\n * @private\n */\n _getPresetPropertiesForCropSize(presetRatio) {\n const canvas = this.getCanvas();\n const originalWidth = canvas.getWidth();\n const originalHeight = canvas.getHeight();\n\n const standardSize = originalWidth >= originalHeight ? originalWidth : originalHeight;\n const getScale = (value, orignalValue) => (value > orignalValue ? orignalValue / value : 1);\n\n let width = standardSize * presetRatio;\n let height = standardSize;\n\n const scaleWidth = getScale(width, originalWidth);\n [width, height] = snippet.map([width, height], (sizeValue) => sizeValue * scaleWidth);\n\n const scaleHeight = getScale(height, originalHeight);\n [width, height] = snippet.map([width, height], (sizeValue) =>\n fixFloatingPoint(sizeValue * scaleHeight)\n );\n\n return {\n presetRatio,\n top: (originalHeight - height) / 2,\n left: (originalWidth - width) / 2,\n width,\n height,\n };\n }\n\n /**\n * Keydown event handler\n * @param {KeyboardEvent} e - Event object\n * @private\n */\n _onKeyDown(e) {\n if (e.keyCode === keyCodes.SHIFT) {\n this._withShiftKey = true;\n }\n }\n\n /**\n * Keyup event handler\n * @param {KeyboardEvent} e - Event object\n * @private\n */\n _onKeyUp(e) {\n if (e.keyCode === keyCodes.SHIFT) {\n this._withShiftKey = false;\n }\n }\n}\n\nexport default Cropper;\n","/**\n * @author NHN. FE Development Team \n * @fileoverview Cropzone extending fabric.Rect\n */\nimport snippet from 'tui-code-snippet';\nimport fabric from 'fabric';\nimport { clamp } from '@/util';\nimport { eventNames as events, keyCodes } from '@/consts';\n\nconst CORNER_TYPE_TOP_LEFT = 'tl';\nconst CORNER_TYPE_TOP_RIGHT = 'tr';\nconst CORNER_TYPE_MIDDLE_TOP = 'mt';\nconst CORNER_TYPE_MIDDLE_LEFT = 'ml';\nconst CORNER_TYPE_MIDDLE_RIGHT = 'mr';\nconst CORNER_TYPE_MIDDLE_BOTTOM = 'mb';\nconst CORNER_TYPE_BOTTOM_LEFT = 'bl';\nconst CORNER_TYPE_BOTTOM_RIGHT = 'br';\nconst CORNER_TYPE_LIST = [\n CORNER_TYPE_TOP_LEFT,\n CORNER_TYPE_TOP_RIGHT,\n CORNER_TYPE_MIDDLE_TOP,\n CORNER_TYPE_MIDDLE_LEFT,\n CORNER_TYPE_MIDDLE_RIGHT,\n CORNER_TYPE_MIDDLE_BOTTOM,\n CORNER_TYPE_BOTTOM_LEFT,\n CORNER_TYPE_BOTTOM_RIGHT,\n];\nconst NOOP_FUNCTION = () => {};\n\n/**\n * Align with cropzone ratio\n * @param {string} selectedCorner - selected corner type\n * @returns {{width: number, height: number}}\n * @private\n */\nfunction cornerTypeValid(selectedCorner) {\n return CORNER_TYPE_LIST.indexOf(selectedCorner) >= 0;\n}\n\n/**\n * return scale basis type\n * @param {number} diffX - X distance of the cursor and corner.\n * @param {number} diffY - Y distance of the cursor and corner.\n * @returns {string}\n * @private\n */\nfunction getScaleBasis(diffX, diffY) {\n return diffX > diffY ? 'width' : 'height';\n}\n\n/**\n * Cropzone object\n * Issue: IE7, 8(with excanvas)\n * - Cropzone is a black zone without transparency.\n * @class Cropzone\n * @extends {fabric.Rect}\n * @ignore\n */\nconst Cropzone = fabric.util.createClass(\n fabric.Rect,\n /** @lends Cropzone.prototype */ {\n /**\n * Constructor\n * @param {Object} canvas canvas\n * @param {Object} options Options object\n * @param {Object} extendsOptions object for extends \"options\"\n * @override\n */\n initialize(canvas, options, extendsOptions) {\n options = snippet.extend(options, extendsOptions);\n options.type = 'cropzone';\n\n this.callSuper('initialize', options);\n this._addEventHandler();\n\n this.canvas = canvas;\n this.options = options;\n },\n canvasEventDelegation(eventName) {\n let delegationState = 'unregistered';\n const isRegistered = this.canvasEventTrigger[eventName] !== NOOP_FUNCTION;\n if (isRegistered) {\n delegationState = 'registered';\n } else if ([events.OBJECT_MOVED, events.OBJECT_SCALED].indexOf(eventName) < 0) {\n delegationState = 'none';\n }\n\n return delegationState;\n },\n canvasEventRegister(eventName, eventTrigger) {\n this.canvasEventTrigger[eventName] = eventTrigger;\n },\n _addEventHandler() {\n this.canvasEventTrigger = {\n [events.OBJECT_MOVED]: NOOP_FUNCTION,\n [events.OBJECT_SCALED]: NOOP_FUNCTION,\n };\n this.on({\n moving: this._onMoving.bind(this),\n scaling: this._onScaling.bind(this),\n });\n fabric.util.addListener(document, 'keydown', this._onKeyDown.bind(this));\n fabric.util.addListener(document, 'keyup', this._onKeyUp.bind(this));\n },\n _renderCropzone(ctx) {\n const cropzoneDashLineWidth = 7;\n const cropzoneDashLineOffset = 7;\n\n // Calc original scale\n const originalFlipX = this.flipX ? -1 : 1;\n const originalFlipY = this.flipY ? -1 : 1;\n const originalScaleX = originalFlipX / this.scaleX;\n const originalScaleY = originalFlipY / this.scaleY;\n\n // Set original scale\n ctx.scale(originalScaleX, originalScaleY);\n\n // Render outer rect\n this._fillOuterRect(ctx, 'rgba(0, 0, 0, 0.5)');\n\n if (this.options.lineWidth) {\n this._fillInnerRect(ctx);\n this._strokeBorder(ctx, 'rgb(255, 255, 255)', {\n lineWidth: this.options.lineWidth,\n });\n } else {\n // Black dash line\n this._strokeBorder(ctx, 'rgb(0, 0, 0)', {\n lineDashWidth: cropzoneDashLineWidth,\n });\n\n // White dash line\n this._strokeBorder(ctx, 'rgb(255, 255, 255)', {\n lineDashWidth: cropzoneDashLineWidth,\n lineDashOffset: cropzoneDashLineOffset,\n });\n }\n\n // Reset scale\n ctx.scale(1 / originalScaleX, 1 / originalScaleY);\n },\n\n /**\n * Render Crop-zone\n * @private\n * @override\n */\n _render(ctx) {\n this.callSuper('_render', ctx);\n\n this._renderCropzone(ctx);\n },\n\n /**\n * Cropzone-coordinates with outer rectangle\n *\n * x0 x1 x2 x3\n * y0 +--------------------------+\n * |///////|//////////|///////| // <--- \"Outer-rectangle\"\n * |///////|//////////|///////|\n * y1 +-------+----------+-------+\n * |///////| Cropzone |///////| Cropzone is the \"Inner-rectangle\"\n * |///////| (0, 0) |///////| Center point (0, 0)\n * y2 +-------+----------+-------+\n * |///////|//////////|///////|\n * |///////|//////////|///////|\n * y3 +--------------------------+\n *\n * @typedef {{x: Array, y: Array}} cropzoneCoordinates\n * @ignore\n */\n\n /**\n * Fill outer rectangle\n * @param {CanvasRenderingContext2D} ctx - Context\n * @param {string|CanvasGradient|CanvasPattern} fillStyle - Fill-style\n * @private\n */\n _fillOuterRect(ctx, fillStyle) {\n const { x, y } = this._getCoordinates();\n\n ctx.save();\n ctx.fillStyle = fillStyle;\n ctx.beginPath();\n\n // Outer rectangle\n // Numbers are +/-1 so that overlay edges don't get blurry.\n ctx.moveTo(x[0] - 1, y[0] - 1);\n ctx.lineTo(x[3] + 1, y[0] - 1);\n ctx.lineTo(x[3] + 1, y[3] + 1);\n ctx.lineTo(x[0] - 1, y[3] + 1);\n ctx.lineTo(x[0] - 1, y[0] - 1);\n ctx.closePath();\n\n // Inner rectangle\n ctx.moveTo(x[1], y[1]);\n ctx.lineTo(x[1], y[2]);\n ctx.lineTo(x[2], y[2]);\n ctx.lineTo(x[2], y[1]);\n ctx.lineTo(x[1], y[1]);\n ctx.closePath();\n\n ctx.fill();\n ctx.restore();\n },\n\n /**\n * Draw Inner grid line\n * @param {CanvasRenderingContext2D} ctx - Context\n * @private\n */\n _fillInnerRect(ctx) {\n const { x: outerX, y: outerY } = this._getCoordinates();\n const x = this._caculateInnerPosition(outerX, (outerX[2] - outerX[1]) / 3);\n const y = this._caculateInnerPosition(outerY, (outerY[2] - outerY[1]) / 3);\n\n ctx.save();\n ctx.strokeStyle = 'rgba(255, 255, 255, 0.7)';\n ctx.lineWidth = this.options.lineWidth;\n ctx.beginPath();\n\n ctx.moveTo(x[0], y[1]);\n ctx.lineTo(x[3], y[1]);\n\n ctx.moveTo(x[0], y[2]);\n ctx.lineTo(x[3], y[2]);\n\n ctx.moveTo(x[1], y[0]);\n ctx.lineTo(x[1], y[3]);\n\n ctx.moveTo(x[2], y[0]);\n ctx.lineTo(x[2], y[3]);\n ctx.stroke();\n ctx.closePath();\n\n ctx.restore();\n },\n\n /**\n * Calculate Inner Position\n * @param {Array} outer - outer position\n * @param {number} size - interval for calculate\n * @returns {Array} - inner position\n * @private\n */\n _caculateInnerPosition(outer, size) {\n const position = [];\n position[0] = outer[1];\n position[1] = outer[1] + size;\n position[2] = outer[1] + size * 2;\n position[3] = outer[2];\n\n return position;\n },\n\n /**\n * Get coordinates\n * @returns {cropzoneCoordinates} - {@link cropzoneCoordinates}\n * @private\n */\n _getCoordinates() {\n const { canvas, width, height, left, top } = this;\n const halfWidth = width / 2;\n const halfHeight = height / 2;\n const canvasHeight = canvas.getHeight(); // fabric object\n const canvasWidth = canvas.getWidth(); // fabric object\n\n return {\n x: snippet.map(\n [\n -(halfWidth + left), // x0\n -halfWidth, // x1\n halfWidth, // x2\n halfWidth + (canvasWidth - left - width), // x3\n ],\n Math.ceil\n ),\n y: snippet.map(\n [\n -(halfHeight + top), // y0\n -halfHeight, // y1\n halfHeight, // y2\n halfHeight + (canvasHeight - top - height), // y3\n ],\n Math.ceil\n ),\n };\n },\n\n /**\n * Stroke border\n * @param {CanvasRenderingContext2D} ctx - Context\n * @param {string|CanvasGradient|CanvasPattern} strokeStyle - Stroke-style\n * @param {number} lineDashWidth - Dash width\n * @param {number} [lineDashOffset] - Dash offset\n * @param {number} [lineWidth] - line width\n * @private\n */\n _strokeBorder(ctx, strokeStyle, { lineDashWidth, lineDashOffset, lineWidth }) {\n const halfWidth = this.width / 2;\n const halfHeight = this.height / 2;\n\n ctx.save();\n ctx.strokeStyle = strokeStyle;\n\n if (ctx.setLineDash) {\n ctx.setLineDash([lineDashWidth, lineDashWidth]);\n }\n if (lineDashOffset) {\n ctx.lineDashOffset = lineDashOffset;\n }\n if (lineWidth) {\n ctx.lineWidth = lineWidth;\n }\n\n ctx.beginPath();\n ctx.moveTo(-halfWidth, -halfHeight);\n ctx.lineTo(halfWidth, -halfHeight);\n ctx.lineTo(halfWidth, halfHeight);\n ctx.lineTo(-halfWidth, halfHeight);\n ctx.lineTo(-halfWidth, -halfHeight);\n ctx.stroke();\n\n ctx.restore();\n },\n\n /**\n * onMoving event listener\n * @private\n */\n _onMoving() {\n const { height, width, left, top } = this;\n const maxLeft = this.canvas.getWidth() - width;\n const maxTop = this.canvas.getHeight() - height;\n\n this.left = clamp(left, 0, maxLeft);\n this.top = clamp(top, 0, maxTop);\n\n this.canvasEventTrigger[events.OBJECT_MOVED](this);\n },\n\n /**\n * onScaling event listener\n * @param {{e: MouseEvent}} fEvent - Fabric event\n * @private\n */\n _onScaling(fEvent) {\n const selectedCorner = fEvent.transform.corner;\n const pointer = this.canvas.getPointer(fEvent.e);\n const settings = this._calcScalingSizeFromPointer(pointer, selectedCorner);\n\n // On scaling cropzone,\n // change real width and height and fix scaleFactor to 1\n this.scale(1).set(settings);\n\n this.canvasEventTrigger[events.OBJECT_SCALED](this);\n },\n\n /**\n * Calc scaled size from mouse pointer with selected corner\n * @param {{x: number, y: number}} pointer - Mouse position\n * @param {string} selectedCorner - selected corner type\n * @returns {Object} Having left or(and) top or(and) width or(and) height.\n * @private\n */\n _calcScalingSizeFromPointer(pointer, selectedCorner) {\n const isCornerTypeValid = cornerTypeValid(selectedCorner);\n\n return isCornerTypeValid && this._resizeCropZone(pointer, selectedCorner);\n },\n\n /**\n * Align with cropzone ratio\n * @param {number} width - cropzone width\n * @param {number} height - cropzone height\n * @param {number} maxWidth - limit max width\n * @param {number} maxHeight - limit max height\n * @param {number} scaleTo - cropzone ratio\n * @returns {{width: number, height: number}}\n * @private\n */\n adjustRatioCropzoneSize({ width, height, leftMaker, topMaker, maxWidth, maxHeight, scaleTo }) {\n width = maxWidth ? clamp(width, 1, maxWidth) : width;\n height = maxHeight ? clamp(height, 1, maxHeight) : height;\n\n if (!this.presetRatio) {\n if (this._withShiftKey) {\n // make fixed ratio cropzone\n if (width > height) {\n height = width;\n } else if (height > width) {\n width = height;\n }\n }\n\n return {\n width,\n height,\n left: leftMaker(width),\n top: topMaker(height),\n };\n }\n\n if (scaleTo === 'width') {\n height = width / this.presetRatio;\n } else {\n width = height * this.presetRatio;\n }\n\n const maxScaleFactor = Math.min(maxWidth / width, maxHeight / height);\n if (maxScaleFactor <= 1) {\n [width, height] = [width, height].map((v) => v * maxScaleFactor);\n }\n\n return {\n width,\n height,\n left: leftMaker(width),\n top: topMaker(height),\n };\n },\n\n /**\n * Get dimension last state cropzone\n * @returns {{rectTop: number, rectLeft: number, rectWidth: number, rectHeight: number}}\n * @private\n */\n _getCropzoneRectInfo() {\n const { width: canvasWidth, height: canvasHeight } = this.canvas;\n const {\n top: rectTop,\n left: rectLeft,\n width: rectWidth,\n height: rectHeight,\n } = this.getBoundingRect(false, true);\n\n return {\n rectTop,\n rectLeft,\n rectWidth,\n rectHeight,\n rectRight: rectLeft + rectWidth,\n rectBottom: rectTop + rectHeight,\n canvasWidth,\n canvasHeight,\n };\n },\n\n /**\n * Calc scaling dimension\n * @param {Object} position - Mouse position\n * @param {string} corner - corner type\n * @returns {{left: number, top: number, width: number, height: number}}\n * @private\n */\n _resizeCropZone({ x, y }, corner) {\n const {\n rectWidth,\n rectHeight,\n rectTop,\n rectLeft,\n rectBottom,\n rectRight,\n canvasWidth,\n canvasHeight,\n } = this._getCropzoneRectInfo();\n\n const resizeInfoMap = {\n tl: {\n width: rectRight - x,\n height: rectBottom - y,\n leftMaker: (newWidth) => rectRight - newWidth,\n topMaker: (newHeight) => rectBottom - newHeight,\n maxWidth: rectRight,\n maxHeight: rectBottom,\n scaleTo: getScaleBasis(rectLeft - x, rectTop - y),\n },\n tr: {\n width: x - rectLeft,\n height: rectBottom - y,\n leftMaker: () => rectLeft,\n topMaker: (newHeight) => rectBottom - newHeight,\n maxWidth: canvasWidth - rectLeft,\n maxHeight: rectBottom,\n scaleTo: getScaleBasis(x - rectRight, rectTop - y),\n },\n mt: {\n width: rectWidth,\n height: rectBottom - y,\n leftMaker: () => rectLeft,\n topMaker: (newHeight) => rectBottom - newHeight,\n maxWidth: canvasWidth - rectLeft,\n maxHeight: rectBottom,\n scaleTo: 'height',\n },\n ml: {\n width: rectRight - x,\n height: rectHeight,\n leftMaker: (newWidth) => rectRight - newWidth,\n topMaker: () => rectTop,\n maxWidth: rectRight,\n maxHeight: canvasHeight - rectTop,\n scaleTo: 'width',\n },\n mr: {\n width: x - rectLeft,\n height: rectHeight,\n leftMaker: () => rectLeft,\n topMaker: () => rectTop,\n maxWidth: canvasWidth - rectLeft,\n maxHeight: canvasHeight - rectTop,\n scaleTo: 'width',\n },\n mb: {\n width: rectWidth,\n height: y - rectTop,\n leftMaker: () => rectLeft,\n topMaker: () => rectTop,\n maxWidth: canvasWidth - rectLeft,\n maxHeight: canvasHeight - rectTop,\n scaleTo: 'height',\n },\n bl: {\n width: rectRight - x,\n height: y - rectTop,\n leftMaker: (newWidth) => rectRight - newWidth,\n topMaker: () => rectTop,\n maxWidth: rectRight,\n maxHeight: canvasHeight - rectTop,\n scaleTo: getScaleBasis(rectLeft - x, y - rectBottom),\n },\n br: {\n width: x - rectLeft,\n height: y - rectTop,\n leftMaker: () => rectLeft,\n topMaker: () => rectTop,\n maxWidth: canvasWidth - rectLeft,\n maxHeight: canvasHeight - rectTop,\n scaleTo: getScaleBasis(x - rectRight, y - rectBottom),\n },\n };\n\n return this.adjustRatioCropzoneSize(resizeInfoMap[corner]);\n },\n\n /**\n * Return the whether this cropzone is valid\n * @returns {boolean}\n */\n isValid() {\n return this.left >= 0 && this.top >= 0 && this.width > 0 && this.height > 0;\n },\n\n /**\n * Keydown event handler\n * @param {{number}} keyCode - Event keyCode\n * @private\n */\n _onKeyDown({ keyCode }) {\n if (keyCode === keyCodes.SHIFT) {\n this._withShiftKey = true;\n }\n },\n\n /**\n * Keyup event handler\n * @param {{number}} keyCode - Event keyCode\n * @private\n */\n _onKeyUp({ keyCode }) {\n if (keyCode === keyCodes.SHIFT) {\n this._withShiftKey = false;\n }\n },\n }\n);\n\nexport default Cropzone;\n","/**\n * @author NHN. FE Development Team \n * @fileoverview Image flip module\n */\nimport snippet from 'tui-code-snippet';\nimport Component from '@/interface/component';\nimport { Promise } from '@/util';\nimport { componentNames, rejectMessages } from '@/consts';\n\n/**\n * Flip\n * @class Flip\n * @param {Graphics} graphics - Graphics instance\n * @extends {Component}\n * @ignore\n */\nclass Flip extends Component {\n constructor(graphics) {\n super(componentNames.FLIP, graphics);\n }\n\n /**\n * Get current flip settings\n * @returns {{flipX: Boolean, flipY: Boolean}}\n */\n getCurrentSetting() {\n const canvasImage = this.getCanvasImage();\n\n return {\n flipX: canvasImage.flipX,\n flipY: canvasImage.flipY,\n };\n }\n\n /**\n * Set flipX, flipY\n * @param {{flipX: Boolean, flipY: Boolean}} newSetting - Flip setting\n * @returns {Promise}\n */\n set(newSetting) {\n const setting = this.getCurrentSetting();\n const isChangingFlipX = setting.flipX !== newSetting.flipX;\n const isChangingFlipY = setting.flipY !== newSetting.flipY;\n\n if (!isChangingFlipX && !isChangingFlipY) {\n return Promise.reject(rejectMessages.flip);\n }\n\n snippet.extend(setting, newSetting);\n this.setImageProperties(setting, true);\n this._invertAngle(isChangingFlipX, isChangingFlipY);\n this._flipObjects(isChangingFlipX, isChangingFlipY);\n\n return Promise.resolve({\n flipX: setting.flipX,\n flipY: setting.flipY,\n angle: this.getCanvasImage().angle,\n });\n }\n\n /**\n * Invert image angle for flip\n * @param {boolean} isChangingFlipX - Change flipX\n * @param {boolean} isChangingFlipY - Change flipY\n */\n _invertAngle(isChangingFlipX, isChangingFlipY) {\n const canvasImage = this.getCanvasImage();\n let { angle } = canvasImage;\n\n if (isChangingFlipX) {\n angle *= -1;\n }\n if (isChangingFlipY) {\n angle *= -1;\n }\n canvasImage.rotate(parseFloat(angle)).setCoords(); // parseFloat for -0 to 0\n }\n\n /**\n * Flip objects\n * @param {boolean} isChangingFlipX - Change flipX\n * @param {boolean} isChangingFlipY - Change flipY\n * @private\n */\n _flipObjects(isChangingFlipX, isChangingFlipY) {\n const canvas = this.getCanvas();\n\n if (isChangingFlipX) {\n canvas.forEachObject((obj) => {\n obj\n .set({\n angle: parseFloat(obj.angle * -1), // parseFloat for -0 to 0\n flipX: !obj.flipX,\n left: canvas.width - obj.left,\n })\n .setCoords();\n });\n }\n if (isChangingFlipY) {\n canvas.forEachObject((obj) => {\n obj\n .set({\n angle: parseFloat(obj.angle * -1), // parseFloat for -0 to 0\n flipY: !obj.flipY,\n top: canvas.height - obj.top,\n })\n .setCoords();\n });\n }\n canvas.renderAll();\n }\n\n /**\n * Reset flip settings\n * @returns {Promise}\n */\n reset() {\n return this.set({\n flipX: false,\n flipY: false,\n });\n }\n\n /**\n * Flip x\n * @returns {Promise}\n */\n flipX() {\n const current = this.getCurrentSetting();\n\n return this.set({\n flipX: !current.flipX,\n flipY: current.flipY,\n });\n }\n\n /**\n * Flip y\n * @returns {Promise}\n */\n flipY() {\n const current = this.getCurrentSetting();\n\n return this.set({\n flipX: current.flipX,\n flipY: !current.flipY,\n });\n }\n}\n\nexport default Flip;\n","/**\n * @author NHN. FE Development Team \n * @fileoverview Image rotation module\n */\nimport fabric from 'fabric';\nimport Component from '@/interface/component';\nimport { Promise } from '@/util';\nimport { componentNames } from '@/consts';\n\n/**\n * Image Rotation component\n * @class Rotation\n * @extends {Component}\n * @param {Graphics} graphics - Graphics instance\n * @ignore\n */\nclass Rotation extends Component {\n constructor(graphics) {\n super(componentNames.ROTATION, graphics);\n }\n\n /**\n * Get current angle\n * @returns {Number}\n */\n getCurrentAngle() {\n return this.getCanvasImage().angle;\n }\n\n /**\n * Set angle of the image\n *\n * Do not call \"this.setImageProperties\" for setting angle directly.\n * Before setting angle, The originX,Y of image should be set to center.\n * See \"http://fabricjs.com/docs/fabric.Object.html#setAngle\"\n *\n * @param {number} angle - Angle value\n * @returns {Promise}\n */\n setAngle(angle) {\n const oldAngle = this.getCurrentAngle() % 360; // The angle is lower than 2*PI(===360 degrees)\n\n angle %= 360;\n\n const canvasImage = this.getCanvasImage();\n const oldImageCenter = canvasImage.getCenterPoint();\n canvasImage.set({ angle }).setCoords();\n this.adjustCanvasDimension();\n const newImageCenter = canvasImage.getCenterPoint();\n this._rotateForEachObject(oldImageCenter, newImageCenter, angle - oldAngle);\n\n return Promise.resolve(angle);\n }\n\n /**\n * Rotate for each object\n * @param {fabric.Point} oldImageCenter - Image center point before rotation\n * @param {fabric.Point} newImageCenter - Image center point after rotation\n * @param {number} angleDiff - Image angle difference after rotation\n * @private\n */\n _rotateForEachObject(oldImageCenter, newImageCenter, angleDiff) {\n const canvas = this.getCanvas();\n const centerDiff = {\n x: oldImageCenter.x - newImageCenter.x,\n y: oldImageCenter.y - newImageCenter.y,\n };\n\n canvas.forEachObject((obj) => {\n const objCenter = obj.getCenterPoint();\n const radian = fabric.util.degreesToRadians(angleDiff);\n const newObjCenter = fabric.util.rotatePoint(objCenter, oldImageCenter, radian);\n\n obj.set({\n left: newObjCenter.x - centerDiff.x,\n top: newObjCenter.y - centerDiff.y,\n angle: (obj.angle + angleDiff) % 360,\n });\n obj.setCoords();\n });\n canvas.renderAll();\n }\n\n /**\n * Rotate the image\n * @param {number} additionalAngle - Additional angle\n * @returns {Promise}\n */\n rotate(additionalAngle) {\n const current = this.getCurrentAngle();\n\n return this.setAngle(current + additionalAngle);\n }\n}\n\nexport default Rotation;\n","/**\n * @author NHN. FE Development Team \n * @fileoverview Free drawing module, Set brush\n */\nimport fabric from 'fabric';\nimport Component from '@/interface/component';\nimport { componentNames } from '@/consts';\n\n/**\n * FreeDrawing\n * @class FreeDrawing\n * @param {Graphics} graphics - Graphics instance\n * @extends {Component}\n * @ignore\n */\nclass FreeDrawing extends Component {\n constructor(graphics) {\n super(componentNames.FREE_DRAWING, graphics);\n\n /**\n * Brush width\n * @type {number}\n */\n this.width = 12;\n\n /**\n * fabric.Color instance for brush color\n * @type {fabric.Color}\n */\n this.oColor = new fabric.Color('rgba(0, 0, 0, 0.5)');\n }\n\n /**\n * Start free drawing mode\n * @param {{width: ?number, color: ?string}} [setting] - Brush width & color\n */\n start(setting) {\n const canvas = this.getCanvas();\n\n canvas.isDrawingMode = true;\n this.setBrush(setting);\n }\n\n /**\n * Set brush\n * @param {{width: ?number, color: ?string}} [setting] - Brush width & color\n */\n setBrush(setting) {\n const brush = this.getCanvas().freeDrawingBrush;\n\n setting = setting || {};\n this.width = setting.width || this.width;\n if (setting.color) {\n this.oColor = new fabric.Color(setting.color);\n }\n brush.width = this.width;\n brush.color = this.oColor.toRgba();\n }\n\n /**\n * End free drawing mode\n */\n end() {\n const canvas = this.getCanvas();\n\n canvas.isDrawingMode = false;\n }\n}\n\nexport default FreeDrawing;\n","/**\n * @author NHN. FE Development Team \n * @fileoverview Free drawing module, Set brush\n */\nimport snippet from 'tui-code-snippet';\nimport fabric from 'fabric';\nimport Component from '@/interface/component';\nimport ArrowLine from '@/extension/arrowLine';\nimport { eventNames, componentNames, fObjectOptions } from '@/consts';\n\n/**\n * Line\n * @class Line\n * @param {Graphics} graphics - Graphics instance\n * @extends {Component}\n * @ignore\n */\nclass Line extends Component {\n constructor(graphics) {\n super(componentNames.LINE, graphics);\n\n /**\n * Brush width\n * @type {number}\n * @private\n */\n this._width = 12;\n\n /**\n * fabric.Color instance for brush color\n * @type {fabric.Color}\n * @private\n */\n this._oColor = new fabric.Color('rgba(0, 0, 0, 0.5)');\n\n /**\n * Listeners\n * @type {object.}\n * @private\n */\n this._listeners = {\n mousedown: this._onFabricMouseDown.bind(this),\n mousemove: this._onFabricMouseMove.bind(this),\n mouseup: this._onFabricMouseUp.bind(this),\n };\n }\n\n /**\n * Start drawing line mode\n * @param {{width: ?number, color: ?string}} [setting] - Brush width & color\n */\n setHeadOption(setting) {\n const {\n arrowType = {\n head: null,\n tail: null,\n },\n } = setting;\n\n this._arrowType = arrowType;\n }\n\n /**\n * Start drawing line mode\n * @param {{width: ?number, color: ?string}} [setting] - Brush width & color\n */\n start(setting = {}) {\n const canvas = this.getCanvas();\n\n canvas.defaultCursor = 'crosshair';\n canvas.selection = false;\n\n this.setHeadOption(setting);\n this.setBrush(setting);\n\n canvas.forEachObject((obj) => {\n obj.set({\n evented: false,\n });\n });\n\n canvas.on({\n 'mouse:down': this._listeners.mousedown,\n });\n }\n\n /**\n * Set brush\n * @param {{width: ?number, color: ?string}} [setting] - Brush width & color\n */\n setBrush(setting) {\n const brush = this.getCanvas().freeDrawingBrush;\n\n setting = setting || {};\n this._width = setting.width || this._width;\n\n if (setting.color) {\n this._oColor = new fabric.Color(setting.color);\n }\n brush.width = this._width;\n brush.color = this._oColor.toRgba();\n }\n\n /**\n * End drawing line mode\n */\n end() {\n const canvas = this.getCanvas();\n\n canvas.defaultCursor = 'default';\n canvas.selection = true;\n\n canvas.forEachObject((obj) => {\n obj.set({\n evented: true,\n });\n });\n\n canvas.off('mouse:down', this._listeners.mousedown);\n }\n\n /**\n * Mousedown event handler in fabric canvas\n * @param {{target: fabric.Object, e: MouseEvent}} fEvent - Fabric event object\n * @private\n */\n _onFabricMouseDown(fEvent) {\n const canvas = this.getCanvas();\n const { x, y } = canvas.getPointer(fEvent.e);\n const points = [x, y, x, y];\n\n this._line = new ArrowLine(points, {\n stroke: this._oColor.toRgba(),\n strokeWidth: this._width,\n arrowType: this._arrowType,\n evented: false,\n });\n\n this._line.set(fObjectOptions.SELECTION_STYLE);\n\n canvas.add(this._line);\n\n canvas.on({\n 'mouse:move': this._listeners.mousemove,\n 'mouse:up': this._listeners.mouseup,\n });\n\n this.fire(eventNames.ADD_OBJECT, this._createLineEventObjectProperties());\n }\n\n /**\n * Mousemove event handler in fabric canvas\n * @param {{target: fabric.Object, e: MouseEvent}} fEvent - Fabric event object\n * @private\n */\n _onFabricMouseMove(fEvent) {\n const canvas = this.getCanvas();\n const pointer = canvas.getPointer(fEvent.e);\n\n this._line.set({\n x2: pointer.x,\n y2: pointer.y,\n });\n\n this._line.setCoords();\n\n canvas.renderAll();\n }\n\n /**\n * Mouseup event handler in fabric canvas\n * @private\n */\n _onFabricMouseUp() {\n const canvas = this.getCanvas();\n\n this.fire(eventNames.OBJECT_ADDED, this._createLineEventObjectProperties());\n\n this._line = null;\n\n canvas.off({\n 'mouse:move': this._listeners.mousemove,\n 'mouse:up': this._listeners.mouseup,\n });\n }\n\n /**\n * create line event object properties\n * @returns {Object} properties line object\n * @private\n */\n _createLineEventObjectProperties() {\n const params = this.graphics.createObjectProperties(this._line);\n const { x1, x2, y1, y2 } = this._line;\n\n return snippet.extend({}, params, {\n startPosition: {\n x: x1,\n y: y1,\n },\n endPosition: {\n x: x2,\n y: y2,\n },\n });\n }\n}\n\nexport default Line;\n","/**\n * @author NHN. FE Development Team \n * @fileoverview Blur extending fabric.Image.filters.Convolute\n */\nimport fabric from 'fabric';\n\nconst ARROW_ANGLE = 30;\nconst CHEVRON_SIZE_RATIO = 2.7;\nconst TRIANGLE_SIZE_RATIO = 1.7;\nconst RADIAN_CONVERSION_VALUE = 180;\n\nconst ArrowLine = fabric.util.createClass(\n fabric.Line,\n /** @lends Convolute.prototype */ {\n /**\n * Line type\n * @param {String} type\n * @default\n */\n type: 'line',\n\n /**\n * Constructor\n * @param {Array} [points] Array of points\n * @param {Object} [options] Options object\n * @override\n */\n initialize(points, options = {}) {\n this.callSuper('initialize', points, options);\n\n this.arrowType = options.arrowType;\n },\n\n /**\n * Render ArrowLine\n * @private\n * @override\n */\n _render(ctx) {\n const { x1: fromX, y1: fromY, x2: toX, y2: toY } = this.calcLinePoints();\n const linePosition = {\n fromX,\n fromY,\n toX,\n toY,\n };\n this.ctx = ctx;\n ctx.lineWidth = this.strokeWidth;\n\n this._renderBasicLinePath(linePosition);\n this._drawDecoratorPath(linePosition);\n\n this._renderStroke(ctx);\n },\n\n /**\n * Render Basic line path\n * @param {Object} linePosition - line position\n * @param {number} option.fromX - line start position x\n * @param {number} option.fromY - line start position y\n * @param {number} option.toX - line end position x\n * @param {number} option.toY - line end position y\n * @private\n */\n _renderBasicLinePath({ fromX, fromY, toX, toY }) {\n this.ctx.beginPath();\n this.ctx.moveTo(fromX, fromY);\n this.ctx.lineTo(toX, toY);\n },\n\n /**\n * Render Arrow Head\n * @param {Object} linePosition - line position\n * @param {number} option.fromX - line start position x\n * @param {number} option.fromY - line start position y\n * @param {number} option.toX - line end position x\n * @param {number} option.toY - line end position y\n * @private\n */\n _drawDecoratorPath(linePosition) {\n this._drawDecoratorPathType('head', linePosition);\n this._drawDecoratorPathType('tail', linePosition);\n },\n\n /**\n * Render Arrow Head\n * @param {string} type - 'head' or 'tail'\n * @param {Object} linePosition - line position\n * @param {number} option.fromX - line start position x\n * @param {number} option.fromY - line start position y\n * @param {number} option.toX - line end position x\n * @param {number} option.toY - line end position y\n * @private\n */\n _drawDecoratorPathType(type, linePosition) {\n switch (this.arrowType[type]) {\n case 'triangle':\n this._drawTrianglePath(type, linePosition);\n break;\n case 'chevron':\n this._drawChevronPath(type, linePosition);\n break;\n default:\n break;\n }\n },\n\n /**\n * Render Triangle Head\n * @param {string} type - 'head' or 'tail'\n * @param {Object} linePosition - line position\n * @param {number} option.fromX - line start position x\n * @param {number} option.fromY - line start position y\n * @param {number} option.toX - line end position x\n * @param {number} option.toY - line end position y\n * @private\n */\n _drawTrianglePath(type, linePosition) {\n const decorateSize = this.ctx.lineWidth * TRIANGLE_SIZE_RATIO;\n\n this._drawChevronPath(type, linePosition, decorateSize);\n this.ctx.closePath();\n },\n\n /**\n * Render Chevron Head\n * @param {string} type - 'head' or 'tail'\n * @param {Object} linePosition - line position\n * @param {number} option.fromX - line start position x\n * @param {number} option.fromY - line start position y\n * @param {number} option.toX - line end position x\n * @param {number} option.toY - line end position y\n * @param {number} decorateSize - decorate size\n * @private\n */\n _drawChevronPath(type, { fromX, fromY, toX, toY }, decorateSize) {\n const { ctx } = this;\n if (!decorateSize) {\n decorateSize = this.ctx.lineWidth * CHEVRON_SIZE_RATIO;\n }\n\n const [standardX, standardY] = type === 'head' ? [fromX, fromY] : [toX, toY];\n const [compareX, compareY] = type === 'head' ? [toX, toY] : [fromX, fromY];\n\n const angle =\n (Math.atan2(compareY - standardY, compareX - standardX) * RADIAN_CONVERSION_VALUE) /\n Math.PI;\n const rotatedPosition = (changeAngle) =>\n this.getRotatePosition(decorateSize, changeAngle, {\n x: standardX,\n y: standardY,\n });\n\n ctx.moveTo(...rotatedPosition(angle + ARROW_ANGLE));\n ctx.lineTo(standardX, standardY);\n ctx.lineTo(...rotatedPosition(angle - ARROW_ANGLE));\n },\n\n /**\n * return position from change angle.\n * @param {number} distance - change distance\n * @param {number} angle - change angle\n * @param {Object} referencePosition - reference position\n * @returns {Array}\n * @private\n */\n getRotatePosition(distance, angle, referencePosition) {\n const radian = (angle * Math.PI) / RADIAN_CONVERSION_VALUE;\n const { x, y } = referencePosition;\n\n return [distance * Math.cos(radian) + x, distance * Math.sin(radian) + y];\n },\n }\n);\n\nexport default ArrowLine;\n","/**\n * @author NHN. FE Development Team \n * @fileoverview Text module\n */\nimport snippet from 'tui-code-snippet';\nimport fabric from 'fabric';\nimport Component from '@/interface/component';\nimport { Promise } from '@/util';\nimport { componentNames, eventNames as events, fObjectOptions } from '@/consts';\n\nconst defaultStyles = {\n fill: '#000000',\n left: 0,\n top: 0,\n};\nconst resetStyles = {\n fill: '#000000',\n fontStyle: 'normal',\n fontWeight: 'normal',\n textAlign: 'left',\n underline: false,\n};\nconst DBCLICK_TIME = 500;\n\n/**\n * Text\n * @class Text\n * @param {Graphics} graphics - Graphics instance\n * @extends {Component}\n * @ignore\n */\nclass Text extends Component {\n constructor(graphics) {\n super(componentNames.TEXT, graphics);\n\n /**\n * Default text style\n * @type {Object}\n */\n this._defaultStyles = defaultStyles;\n\n /**\n * Selected state\n * @type {boolean}\n */\n this._isSelected = false;\n\n /**\n * Selected text object\n * @type {Object}\n */\n this._selectedObj = {};\n\n /**\n * Editing text object\n * @type {Object}\n */\n this._editingObj = {};\n\n /**\n * Listeners for fabric event\n * @type {Object}\n */\n this._listeners = {\n mousedown: this._onFabricMouseDown.bind(this),\n select: this._onFabricSelect.bind(this),\n selectClear: this._onFabricSelectClear.bind(this),\n scaling: this._onFabricScaling.bind(this),\n textChanged: this._onFabricTextChanged.bind(this),\n };\n\n /**\n * Textarea element for editing\n * @type {HTMLElement}\n */\n this._textarea = null;\n\n /**\n * Ratio of current canvas\n * @type {number}\n */\n this._ratio = 1;\n\n /**\n * Last click time\n * @type {Date}\n */\n this._lastClickTime = new Date().getTime();\n\n /**\n * Text object infos before editing\n * @type {Object}\n */\n this._editingObjInfos = {};\n\n /**\n * Previous state of editing\n * @type {boolean}\n */\n this.isPrevEditing = false;\n }\n\n /**\n * Start input text mode\n */\n start() {\n const canvas = this.getCanvas();\n\n canvas.selection = false;\n canvas.defaultCursor = 'text';\n canvas.on({\n 'mouse:down': this._listeners.mousedown,\n 'selection:created': this._listeners.select,\n 'selection:updated': this._listeners.select,\n 'before:selection:cleared': this._listeners.selectClear,\n 'object:scaling': this._listeners.scaling,\n 'text:changed': this._listeners.textChanged,\n });\n\n canvas.forEachObject((obj) => {\n if (obj.type === 'i-text') {\n this.adjustOriginPosition(obj, 'start');\n }\n });\n\n this.setCanvasRatio();\n }\n\n /**\n * End input text mode\n */\n end() {\n const canvas = this.getCanvas();\n\n canvas.selection = true;\n canvas.defaultCursor = 'default';\n\n canvas.forEachObject((obj) => {\n if (obj.type === 'i-text') {\n if (obj.text === '') {\n canvas.remove(obj);\n } else {\n this.adjustOriginPosition(obj, 'end');\n }\n }\n });\n\n canvas.off({\n 'mouse:down': this._listeners.mousedown,\n 'selection:created': this._listeners.select,\n 'selection:updated': this._listeners.select,\n 'before:selection:cleared': this._listeners.selectClear,\n 'object:selected': this._listeners.select,\n 'object:scaling': this._listeners.scaling,\n 'text:changed': this._listeners.textChanged,\n });\n }\n\n /**\n * Adjust the origin position\n * @param {fabric.Object} text - text object\n * @param {string} editStatus - 'start' or 'end'\n */\n adjustOriginPosition(text, editStatus) {\n let [originX, originY] = ['center', 'center'];\n if (editStatus === 'start') {\n [originX, originY] = ['left', 'top'];\n }\n\n const { x: left, y: top } = text.getPointByOrigin(originX, originY);\n text.set({\n left,\n top,\n originX,\n originY,\n });\n text.setCoords();\n }\n\n /**\n * Add new text on canvas image\n * @param {string} text - Initial input text\n * @param {Object} options - Options for generating text\n * @param {Object} [options.styles] Initial styles\n * @param {string} [options.styles.fill] Color\n * @param {string} [options.styles.fontFamily] Font type for text\n * @param {number} [options.styles.fontSize] Size\n * @param {string} [options.styles.fontStyle] Type of inclination (normal / italic)\n * @param {string} [options.styles.fontWeight] Type of thicker or thinner looking (normal / bold)\n * @param {string} [options.styles.textAlign] Type of text align (left / center / right)\n * @param {string} [options.styles.textDecoration] Type of line (underline / line-through / overline)\n * @param {{x: number, y: number}} [options.position] - Initial position\n * @returns {Promise}\n */\n add(text, options) {\n return new Promise((resolve) => {\n const canvas = this.getCanvas();\n let newText = null;\n let selectionStyle = fObjectOptions.SELECTION_STYLE;\n let styles = this._defaultStyles;\n\n this._setInitPos(options.position);\n\n if (options.styles) {\n styles = snippet.extend(styles, options.styles);\n }\n\n if (!snippet.isExisty(options.autofocus)) {\n options.autofocus = true;\n }\n\n newText = new fabric.IText(text, styles);\n selectionStyle = snippet.extend({}, selectionStyle, {\n originX: 'left',\n originY: 'top',\n });\n\n newText.set(selectionStyle);\n newText.on({\n mouseup: this._onFabricMouseUp.bind(this),\n });\n\n canvas.add(newText);\n\n if (options.autofocus) {\n newText.enterEditing();\n newText.selectAll();\n }\n\n if (!canvas.getActiveObject()) {\n canvas.setActiveObject(newText);\n }\n\n this.isPrevEditing = true;\n resolve(this.graphics.createObjectProperties(newText));\n });\n }\n\n /**\n * Change text of activate object on canvas image\n * @param {Object} activeObj - Current selected text object\n * @param {string} text - Changed text\n * @returns {Promise}\n */\n change(activeObj, text) {\n return new Promise((resolve) => {\n activeObj.set('text', text);\n\n this.getCanvas().renderAll();\n resolve();\n });\n }\n\n /**\n * Set style\n * @param {Object} activeObj - Current selected text object\n * @param {Object} styleObj - Initial styles\n * @param {string} [styleObj.fill] Color\n * @param {string} [styleObj.fontFamily] Font type for text\n * @param {number} [styleObj.fontSize] Size\n * @param {string} [styleObj.fontStyle] Type of inclination (normal / italic)\n * @param {string} [styleObj.fontWeight] Type of thicker or thinner looking (normal / bold)\n * @param {string} [styleObj.textAlign] Type of text align (left / center / right)\n * @param {string} [styleObj.textDecoration] Type of line (underline / line-through / overline)\n * @returns {Promise}\n */\n setStyle(activeObj, styleObj) {\n return new Promise((resolve) => {\n snippet.forEach(\n styleObj,\n (val, key) => {\n if (activeObj[key] === val && key !== 'fontSize') {\n styleObj[key] = resetStyles[key] || '';\n }\n },\n this\n );\n\n if ('textDecoration' in styleObj) {\n snippet.extend(styleObj, this._getTextDecorationAdaptObject(styleObj.textDecoration));\n }\n\n activeObj.set(styleObj);\n\n this.getCanvas().renderAll();\n resolve();\n });\n }\n\n /**\n * Get the text\n * @param {Object} activeObj - Current selected text object\n * @returns {String} text\n */\n getText(activeObj) {\n return activeObj.text;\n }\n\n /**\n * Set infos of the current selected object\n * @param {fabric.Text} obj - Current selected text object\n * @param {boolean} state - State of selecting\n */\n setSelectedInfo(obj, state) {\n this._selectedObj = obj;\n this._isSelected = state;\n }\n\n /**\n * Whether object is selected or not\n * @returns {boolean} State of selecting\n */\n isSelected() {\n return this._isSelected;\n }\n\n /**\n * Get current selected text object\n * @returns {fabric.Text} Current selected text object\n */\n getSelectedObj() {\n return this._selectedObj;\n }\n\n /**\n * Set ratio value of canvas\n */\n setCanvasRatio() {\n const canvasElement = this.getCanvasElement();\n const cssWidth = parseInt(canvasElement.style.maxWidth, 10);\n const originWidth = canvasElement.width;\n\n this._ratio = originWidth / cssWidth;\n }\n\n /**\n * Get ratio value of canvas\n * @returns {number} Ratio value\n */\n getCanvasRatio() {\n return this._ratio;\n }\n\n /**\n * Get text decoration adapt object\n * @param {string} textDecoration - text decoration option string\n * @returns {object} adapt object for override\n */\n _getTextDecorationAdaptObject(textDecoration) {\n return {\n underline: textDecoration === 'underline',\n linethrough: textDecoration === 'line-through',\n overline: textDecoration === 'overline',\n };\n }\n\n /**\n * Set initial position on canvas image\n * @param {{x: number, y: number}} [position] - Selected position\n * @private\n */\n _setInitPos(position) {\n position = position || this.getCanvasImage().getCenterPoint();\n\n this._defaultStyles.left = position.x;\n this._defaultStyles.top = position.y;\n }\n\n /**\n * Input event handler\n * @private\n */\n _onInput() {\n const ratio = this.getCanvasRatio();\n const obj = this._editingObj;\n const textareaStyle = this._textarea.style;\n\n textareaStyle.width = `${Math.ceil(obj.width / ratio)}px`;\n textareaStyle.height = `${Math.ceil(obj.height / ratio)}px`;\n }\n\n /**\n * Keydown event handler\n * @private\n */\n _onKeyDown() {\n const ratio = this.getCanvasRatio();\n const obj = this._editingObj;\n const textareaStyle = this._textarea.style;\n\n setTimeout(() => {\n obj.text(this._textarea.value);\n\n textareaStyle.width = `${Math.ceil(obj.width / ratio)}px`;\n textareaStyle.height = `${Math.ceil(obj.height / ratio)}px`;\n }, 0);\n }\n\n /**\n * Blur event handler\n * @private\n */\n _onBlur() {\n const ratio = this.getCanvasRatio();\n const editingObj = this._editingObj;\n const editingObjInfos = this._editingObjInfos;\n const textContent = this._textarea.value;\n let transWidth = editingObj.width / ratio - editingObjInfos.width / ratio;\n let transHeight = editingObj.height / ratio - editingObjInfos.height / ratio;\n\n if (ratio === 1) {\n transWidth /= 2;\n transHeight /= 2;\n }\n\n this._textarea.style.display = 'none';\n\n editingObj.set({\n left: editingObjInfos.left + transWidth,\n top: editingObjInfos.top + transHeight,\n });\n\n if (textContent.length) {\n this.getCanvas().add(editingObj);\n\n const params = {\n id: snippet.stamp(editingObj),\n type: editingObj.type,\n text: textContent,\n };\n\n this.fire(events.TEXT_CHANGED, params);\n }\n }\n\n /**\n * Scroll event handler\n * @private\n */\n _onScroll() {\n this._textarea.scrollLeft = 0;\n this._textarea.scrollTop = 0;\n }\n\n /**\n * Fabric scaling event handler\n * @param {fabric.Event} fEvent - Current scaling event on selected object\n * @private\n */\n _onFabricScaling(fEvent) {\n const obj = fEvent.target;\n\n obj.fontSize = obj.fontSize * obj.scaleY;\n obj.scaleX = 1;\n obj.scaleY = 1;\n }\n\n /**\n * textChanged event handler\n * @param {{target: fabric.Object}} props - changed text object\n * @private\n */\n _onFabricTextChanged(props) {\n this.fire(events.TEXT_CHANGED, props.target);\n }\n\n /**\n * onSelectClear handler in fabric canvas\n * @param {{target: fabric.Object, e: MouseEvent}} fEvent - Fabric event\n * @private\n */\n _onFabricSelectClear(fEvent) {\n const obj = this.getSelectedObj();\n\n this.isPrevEditing = true;\n\n this.setSelectedInfo(fEvent.target, false);\n\n if (obj) {\n // obj is empty object at initial time, will be set fabric object\n if (obj.text === '') {\n this.getCanvas().remove(obj);\n }\n }\n }\n\n /**\n * onSelect handler in fabric canvas\n * @param {{target: fabric.Object, e: MouseEvent}} fEvent - Fabric event\n * @private\n */\n _onFabricSelect(fEvent) {\n this.isPrevEditing = true;\n\n this.setSelectedInfo(fEvent.target, true);\n }\n\n /**\n * Fabric 'mousedown' event handler\n * @param {fabric.Event} fEvent - Current mousedown event on selected object\n * @private\n */\n _onFabricMouseDown(fEvent) {\n const obj = fEvent.target;\n\n if (obj && !obj.isType('text')) {\n return;\n }\n\n if (this.isPrevEditing) {\n this.isPrevEditing = false;\n\n return;\n }\n\n this._fireAddText(fEvent);\n }\n\n /**\n * Fire 'addText' event if object is not selected.\n * @param {fabric.Event} fEvent - Current mousedown event on selected object\n * @private\n */\n _fireAddText(fEvent) {\n const obj = fEvent.target;\n const e = fEvent.e || {};\n const originPointer = this.getCanvas().getPointer(e);\n\n if (!obj) {\n this.fire(events.ADD_TEXT, {\n originPosition: {\n x: originPointer.x,\n y: originPointer.y,\n },\n clientPosition: {\n x: e.clientX || 0,\n y: e.clientY || 0,\n },\n });\n }\n }\n\n /**\n * Fabric mouseup event handler\n * @param {fabric.Event} fEvent - Current mousedown event on selected object\n * @private\n */\n _onFabricMouseUp(fEvent) {\n const { target } = fEvent;\n const newClickTime = new Date().getTime();\n\n if (this._isDoubleClick(newClickTime) && !target.isEditing) {\n target.enterEditing();\n }\n\n if (target.isEditing) {\n this.fire(events.TEXT_EDITING); // fire editing text event\n }\n\n this._lastClickTime = newClickTime;\n }\n\n /**\n * Get state of firing double click event\n * @param {Date} newClickTime - Current clicked time\n * @returns {boolean} Whether double clicked or not\n * @private\n */\n _isDoubleClick(newClickTime) {\n return newClickTime - this._lastClickTime < DBCLICK_TIME;\n }\n}\n\nexport default Text;\n","/**\n * @author NHN. FE Development Team \n * @fileoverview Add icon module\n */\nimport snippet from 'tui-code-snippet';\nimport fabric from 'fabric';\nimport Component from '@/interface/component';\nimport { Promise } from '@/util';\nimport { eventNames as events, rejectMessages, componentNames, fObjectOptions } from '@/consts';\n\nconst pathMap = {\n arrow: 'M 0 90 H 105 V 120 L 160 60 L 105 0 V 30 H 0 Z',\n cancel:\n 'M 0 30 L 30 60 L 0 90 L 30 120 L 60 90 L 90 120 L 120 90 ' +\n 'L 90 60 L 120 30 L 90 0 L 60 30 L 30 0 Z',\n};\n\n/**\n * Icon\n * @class Icon\n * @param {Graphics} graphics - Graphics instance\n * @extends {Component}\n * @ignore\n */\nclass Icon extends Component {\n constructor(graphics) {\n super(componentNames.ICON, graphics);\n\n /**\n * Default icon color\n * @type {string}\n */\n this._oColor = '#000000';\n\n /**\n * Path value of each icon type\n * @type {Object}\n */\n this._pathMap = pathMap;\n\n /**\n * Type of the drawing icon\n * @type {string}\n * @private\n */\n this._type = null;\n\n /**\n * Color of the drawing icon\n * @type {string}\n * @private\n */\n this._iconColor = null;\n\n /**\n * Event handler list\n * @type {Object}\n * @private\n */\n this._handlers = {\n mousedown: this._onFabricMouseDown.bind(this),\n mousemove: this._onFabricMouseMove.bind(this),\n mouseup: this._onFabricMouseUp.bind(this),\n };\n }\n\n /**\n * Set states of the current drawing shape\n * @ignore\n * @param {string} type - Icon type ('arrow', 'cancel', custom icon name)\n * @param {string} iconColor - Icon foreground color\n */\n setStates(type, iconColor) {\n this._type = type;\n this._iconColor = iconColor;\n }\n\n /**\n * Start to draw the icon on canvas\n * @ignore\n */\n start() {\n const canvas = this.getCanvas();\n canvas.selection = false;\n canvas.on('mouse:down', this._handlers.mousedown);\n }\n\n /**\n * End to draw the icon on canvas\n * @ignore\n */\n end() {\n const canvas = this.getCanvas();\n\n canvas.selection = true;\n canvas.off({\n 'mouse:down': this._handlers.mousedown,\n });\n }\n\n /**\n * Add icon\n * @param {string} type - Icon type\n * @param {Object} options - Icon options\n * @param {string} [options.fill] - Icon foreground color\n * @param {string} [options.left] - Icon x position\n * @param {string} [options.top] - Icon y position\n * @returns {Promise}\n */\n add(type, options) {\n return new Promise((resolve, reject) => {\n const canvas = this.getCanvas();\n const path = this._pathMap[type];\n const selectionStyle = fObjectOptions.SELECTION_STYLE;\n const icon = path ? this._createIcon(path) : null;\n this._icon = icon;\n\n if (!icon) {\n reject(rejectMessages.invalidParameters);\n }\n\n icon.set(\n snippet.extend(\n {\n type: 'icon',\n fill: this._oColor,\n },\n selectionStyle,\n options,\n this.graphics.controlStyle\n )\n );\n\n canvas.add(icon).setActiveObject(icon);\n\n resolve(this.graphics.createObjectProperties(icon));\n });\n }\n\n /**\n * Register icon paths\n * @param {{key: string, value: string}} pathInfos - Path infos\n */\n registerPaths(pathInfos) {\n snippet.forEach(\n pathInfos,\n (path, type) => {\n this._pathMap[type] = path;\n },\n this\n );\n }\n\n /**\n * Set icon object color\n * @param {string} color - Color to set\n * @param {fabric.Path}[obj] - Current activated path object\n */\n setColor(color, obj) {\n this._oColor = color;\n\n if (obj && obj.get('type') === 'icon') {\n obj.set({ fill: this._oColor });\n this.getCanvas().renderAll();\n }\n }\n\n /**\n * Get icon color\n * @param {fabric.Path}[obj] - Current activated path object\n * @returns {string} color\n */\n getColor(obj) {\n return obj.fill;\n }\n\n /**\n * Create icon object\n * @param {string} path - Path value to create icon\n * @returns {fabric.Path} Path object\n */\n _createIcon(path) {\n return new fabric.Path(path);\n }\n\n /**\n * MouseDown event handler on canvas\n * @param {{target: fabric.Object, e: MouseEvent}} fEvent - Fabric event object\n * @private\n */\n _onFabricMouseDown(fEvent) {\n const canvas = this.getCanvas();\n\n this._startPoint = canvas.getPointer(fEvent.e);\n const { x: left, y: top } = this._startPoint;\n\n this.add(this._type, {\n left,\n top,\n fill: this._iconColor,\n }).then(() => {\n this.fire(events.ADD_OBJECT, this.graphics.createObjectProperties(this._icon));\n canvas.on('mouse:move', this._handlers.mousemove);\n canvas.on('mouse:up', this._handlers.mouseup);\n });\n }\n\n /**\n * MouseMove event handler on canvas\n * @param {{target: fabric.Object, e: MouseEvent}} fEvent - Fabric event object\n * @private\n */\n _onFabricMouseMove(fEvent) {\n const canvas = this.getCanvas();\n\n if (!this._icon) {\n return;\n }\n const moveOriginPointer = canvas.getPointer(fEvent.e);\n\n const scaleX = (moveOriginPointer.x - this._startPoint.x) / this._icon.width;\n const scaleY = (moveOriginPointer.y - this._startPoint.y) / this._icon.height;\n\n this._icon.set({\n scaleX: Math.abs(scaleX * 2),\n scaleY: Math.abs(scaleY * 2),\n });\n\n this._icon.setCoords();\n canvas.renderAll();\n }\n\n /**\n * MouseUp event handler on canvas\n * @private\n */\n _onFabricMouseUp() {\n const canvas = this.getCanvas();\n\n this.fire(events.OBJECT_ADDED, this.graphics.createObjectProperties(this._icon));\n\n this._icon = null;\n\n canvas.off('mouse:down', this._handlers.mousedown);\n canvas.off('mouse:move', this._handlers.mousemove);\n canvas.off('mouse:up', this._handlers.mouseup);\n }\n}\n\nexport default Icon;\n","/**\n * @author NHN. FE Development Team \n * @fileoverview Add filter module\n */\nimport { isUndefined, extend, forEach, filter } from 'tui-code-snippet';\nimport fabric from 'fabric';\nimport Component from '@/interface/component';\nimport { Promise } from '@/util';\nimport { rejectMessages, componentNames } from '@/consts';\nimport Mask from '@/extension/mask';\nimport Sharpen from '@/extension/sharpen';\nimport Emboss from '@/extension/emboss';\nimport ColorFilter from '@/extension/colorFilter';\n\nconst { filters } = fabric.Image;\n\nfilters.Mask = Mask;\nfilters.Sharpen = Sharpen;\nfilters.Emboss = Emboss;\nfilters.ColorFilter = ColorFilter;\n\n/**\n * Filter\n * @class Filter\n * @param {Graphics} graphics - Graphics instance\n * @extends {Component}\n * @ignore\n */\nclass Filter extends Component {\n constructor(graphics) {\n super(componentNames.FILTER, graphics);\n }\n\n /**\n * Add filter to source image (a specific filter is added on fabric.js)\n * @param {string} type - Filter type\n * @param {Object} [options] - Options of filter\n * @returns {Promise}\n */\n add(type, options) {\n return new Promise((resolve, reject) => {\n const sourceImg = this._getSourceImage();\n const canvas = this.getCanvas();\n let imgFilter = this._getFilter(sourceImg, type);\n if (!imgFilter) {\n imgFilter = this._createFilter(sourceImg, type, options);\n }\n\n if (!imgFilter) {\n reject(rejectMessages.invalidParameters);\n }\n\n this._changeFilterValues(imgFilter, options);\n\n this._apply(sourceImg, () => {\n canvas.renderAll();\n resolve({\n type,\n action: 'add',\n options,\n });\n });\n });\n }\n\n /**\n * Remove filter to source image\n * @param {string} type - Filter type\n * @returns {Promise}\n */\n remove(type) {\n return new Promise((resolve, reject) => {\n const sourceImg = this._getSourceImage();\n const canvas = this.getCanvas();\n const options = this.getOptions(type);\n\n if (!sourceImg.filters.length) {\n reject(rejectMessages.unsupportedOperation);\n }\n\n this._removeFilter(sourceImg, type);\n\n this._apply(sourceImg, () => {\n canvas.renderAll();\n resolve({\n type,\n action: 'remove',\n options,\n });\n });\n });\n }\n\n /**\n * Whether this has the filter or not\n * @param {string} type - Filter type\n * @returns {boolean} true if it has the filter\n */\n hasFilter(type) {\n return !!this._getFilter(this._getSourceImage(), type);\n }\n\n /**\n * Get a filter options\n * @param {string} type - Filter type\n * @returns {Object} filter options or null if there is no that filter\n */\n getOptions(type) {\n const sourceImg = this._getSourceImage();\n const imgFilter = this._getFilter(sourceImg, type);\n if (!imgFilter) {\n return null;\n }\n\n return extend({}, imgFilter.options);\n }\n\n /**\n * Change filter values\n * @param {Object} imgFilter object of filter\n * @param {Object} options object\n * @private\n */\n _changeFilterValues(imgFilter, options) {\n forEach(options, (value, key) => {\n if (!isUndefined(imgFilter[key])) {\n imgFilter[key] = value;\n }\n });\n forEach(imgFilter.options, (value, key) => {\n if (!isUndefined(options[key])) {\n imgFilter.options[key] = options[key];\n }\n });\n }\n\n /**\n * Apply filter\n * @param {fabric.Image} sourceImg - Source image to apply filter\n * @param {function} callback - Executed function after applying filter\n * @private\n */\n _apply(sourceImg, callback) {\n sourceImg.filters.push();\n const result = sourceImg.applyFilters();\n if (result) {\n callback();\n }\n }\n\n /**\n * Get source image on canvas\n * @returns {fabric.Image} Current source image on canvas\n * @private\n */\n _getSourceImage() {\n return this.getCanvasImage();\n }\n\n /**\n * Create filter instance\n * @param {fabric.Image} sourceImg - Source image to apply filter\n * @param {string} type - Filter type\n * @param {Object} [options] - Options of filter\n * @returns {Object} Fabric object of filter\n * @private\n */\n _createFilter(sourceImg, type, options) {\n let filterObj;\n // capitalize first letter for matching with fabric image filter name\n const fabricType = this._getFabricFilterType(type);\n const ImageFilter = fabric.Image.filters[fabricType];\n if (ImageFilter) {\n filterObj = new ImageFilter(options);\n filterObj.options = options;\n sourceImg.filters.push(filterObj);\n }\n\n return filterObj;\n }\n\n /**\n * Get applied filter instance\n * @param {fabric.Image} sourceImg - Source image to apply filter\n * @param {string} type - Filter type\n * @returns {Object} Fabric object of filter\n * @private\n */\n _getFilter(sourceImg, type) {\n let imgFilter = null;\n\n if (sourceImg) {\n const fabricType = this._getFabricFilterType(type);\n const { length } = sourceImg.filters;\n let item, i;\n\n for (i = 0; i < length; i += 1) {\n item = sourceImg.filters[i];\n if (item.type === fabricType) {\n imgFilter = item;\n break;\n }\n }\n }\n\n return imgFilter;\n }\n\n /**\n * Remove applied filter instance\n * @param {fabric.Image} sourceImg - Source image to apply filter\n * @param {string} type - Filter type\n * @private\n */\n _removeFilter(sourceImg, type) {\n const fabricType = this._getFabricFilterType(type);\n sourceImg.filters = filter(sourceImg.filters, (value) => value.type !== fabricType);\n }\n\n /**\n * Change filter class name to fabric's, especially capitalizing first letter\n * @param {string} type - Filter type\n * @example\n * 'grayscale' -> 'Grayscale'\n * @returns {string} Fabric filter class name\n */\n _getFabricFilterType(type) {\n return type.charAt(0).toUpperCase() + type.slice(1);\n }\n}\n\nexport default Filter;\n","/**\n * @author NHN. FE Development Team \n * @fileoverview Mask extending fabric.Image.filters.Mask\n */\nimport fabric from 'fabric';\n\n/**\n * Mask object\n * @class Mask\n * @extends {fabric.Image.filters.BlendImage}\n * @ignore\n */\nconst Mask = fabric.util.createClass(\n fabric.Image.filters.BlendImage,\n /** @lends Mask.prototype */ {\n /**\n * Apply filter to canvas element\n * @param {Object} pipelineState - Canvas element to apply filter\n * @override\n */\n applyTo(pipelineState) {\n if (!this.mask) {\n return;\n }\n\n const canvas = pipelineState.canvasEl;\n const { width, height } = canvas;\n const maskCanvasEl = this._createCanvasOfMask(width, height);\n const ctx = canvas.getContext('2d');\n const maskCtx = maskCanvasEl.getContext('2d');\n const imageData = ctx.getImageData(0, 0, width, height);\n\n this._drawMask(maskCtx, canvas, ctx);\n this._mapData(maskCtx, imageData, width, height);\n\n pipelineState.imageData = imageData;\n },\n\n /**\n * Create canvas of mask image\n * @param {number} width - Width of main canvas\n * @param {number} height - Height of main canvas\n * @returns {HTMLElement} Canvas element\n * @private\n */\n _createCanvasOfMask(width, height) {\n const maskCanvasEl = fabric.util.createCanvasElement();\n\n maskCanvasEl.width = width;\n maskCanvasEl.height = height;\n\n return maskCanvasEl;\n },\n\n /**\n * Draw mask image on canvas element\n * @param {Object} maskCtx - Context of mask canvas\n * @private\n */\n _drawMask(maskCtx) {\n const { mask } = this;\n const maskImg = mask.getElement();\n const { angle, left, scaleX, scaleY, top } = mask;\n\n maskCtx.save();\n maskCtx.translate(left, top);\n maskCtx.rotate((angle * Math.PI) / 180);\n maskCtx.scale(scaleX, scaleY);\n maskCtx.drawImage(maskImg, -maskImg.width / 2, -maskImg.height / 2);\n maskCtx.restore();\n },\n\n /**\n * Map mask image data to source image data\n * @param {Object} maskCtx - Context of mask canvas\n * @param {Object} imageData - Data of source image\n * @param {number} width - Width of main canvas\n * @param {number} height - Height of main canvas\n * @private\n */\n _mapData(maskCtx, imageData, width, height) {\n const { data, height: imgHeight, width: imgWidth } = imageData;\n const sourceData = data;\n const len = imgWidth * imgHeight * 4;\n const maskData = maskCtx.getImageData(0, 0, width, height).data;\n\n for (let i = 0; i < len; i += 4) {\n sourceData[i + 3] = maskData[i]; // adjust value of alpha data\n }\n },\n }\n);\n\nexport default Mask;\n","/**\n * @author NHN. FE Development Team \n * @fileoverview Sharpen extending fabric.Image.filters.Convolute\n */\nimport fabric from 'fabric';\n\n/**\n * Sharpen object\n * @class Sharpen\n * @extends {fabric.Image.filters.Convolute}\n * @ignore\n */\nconst Sharpen = fabric.util.createClass(\n fabric.Image.filters.Convolute,\n /** @lends Convolute.prototype */ {\n /**\n * Filter type\n * @param {String} type\n * @default\n */\n type: 'Sharpen',\n\n /**\n * constructor\n * @override\n */\n initialize() {\n this.matrix = [0, -1, 0, -1, 5, -1, 0, -1, 0];\n },\n }\n);\n\nexport default Sharpen;\n","/**\n * @author NHN. FE Development Team \n * @fileoverview Emboss extending fabric.Image.filters.Convolute\n */\nimport fabric from 'fabric';\n\n/**\n * Emboss object\n * @class Emboss\n * @extends {fabric.Image.filters.Convolute}\n * @ignore\n */\nconst Emboss = fabric.util.createClass(\n fabric.Image.filters.Convolute,\n /** @lends Convolute.prototype */ {\n /**\n * Filter type\n * @param {String} type\n * @default\n */\n type: 'Emboss',\n\n /**\n * constructor\n * @override\n */\n initialize() {\n this.matrix = [1, 1, 1, 1, 0.7, -1, -1, -1, -1];\n },\n }\n);\n\nexport default Emboss;\n","/**\n * @author NHN. FE Development Team \n * @fileoverview ColorFilter extending fabric.Image.filters.BaseFilter\n */\nimport fabric from 'fabric';\n\n/**\n * ColorFilter object\n * @class ColorFilter\n * @extends {fabric.Image.filters.BaseFilter}\n * @ignore\n */\nconst ColorFilter = fabric.util.createClass(\n fabric.Image.filters.BaseFilter,\n /** @lends BaseFilter.prototype */ {\n /**\n * Filter type\n * @param {String} type\n * @default\n */\n type: 'ColorFilter',\n\n /**\n * Constructor\n * @member fabric.Image.filters.ColorFilter.prototype\n * @param {Object} [options] Options object\n * @param {Number} [options.color='#FFFFFF'] Value of color (0...255)\n * @param {Number} [options.threshold=45] Value of threshold (0...255)\n * @override\n */\n initialize(options) {\n if (!options) {\n options = {};\n }\n this.color = options.color || '#FFFFFF';\n this.threshold = options.threshold || 45;\n this.x = options.x || null;\n this.y = options.y || null;\n },\n\n /**\n * Applies filter to canvas element\n * @param {Object} canvas Canvas object passed by fabric\n */\n // eslint-disable-next-line complexity\n applyTo(canvas) {\n const { canvasEl } = canvas;\n const context = canvasEl.getContext('2d');\n const imageData = context.getImageData(0, 0, canvasEl.width, canvasEl.height);\n const { data } = imageData;\n const { threshold } = this;\n let filterColor = fabric.Color.sourceFromHex(this.color);\n let i, len;\n\n if (this.x && this.y) {\n filterColor = this._getColor(imageData, this.x, this.y);\n }\n\n for (i = 0, len = data.length; i < len; i += 4) {\n if (\n this._isOutsideThreshold(data[i], filterColor[0], threshold) ||\n this._isOutsideThreshold(data[i + 1], filterColor[1], threshold) ||\n this._isOutsideThreshold(data[i + 2], filterColor[2], threshold)\n ) {\n continue;\n }\n data[i] = data[i + 1] = data[i + 2] = data[i + 3] = 0;\n }\n context.putImageData(imageData, 0, 0);\n },\n\n /**\n * Check color if it is within threshold\n * @param {Number} color1 source color\n * @param {Number} color2 filtering color\n * @param {Number} threshold threshold\n * @returns {boolean} true if within threshold or false\n */\n _isOutsideThreshold(color1, color2, threshold) {\n const diff = color1 - color2;\n\n return Math.abs(diff) > threshold;\n },\n\n /**\n * Get color at (x, y)\n * @param {Object} imageData of canvas\n * @param {Number} x left position\n * @param {Number} y top position\n * @returns {Array} color array\n */\n _getColor(imageData, x, y) {\n const color = [0, 0, 0, 0];\n const { data, width } = imageData;\n const bytes = 4;\n const position = (width * y + x) * bytes;\n\n color[0] = data[position];\n color[1] = data[position + 1];\n color[2] = data[position + 2];\n color[3] = data[position + 3];\n\n return color;\n },\n }\n);\n\nexport default ColorFilter;\n","/**\n * @author NHN. FE Development Team \n * @fileoverview Shape component\n */\nimport { extend } from 'tui-code-snippet';\nimport fabric from 'fabric';\nimport Component from '@/interface/component';\nimport resizeHelper from '@/helper/shapeResizeHelper';\nimport {\n getFillImageFromShape,\n rePositionFilterTypeFillImage,\n reMakePatternImageSource,\n makeFillPatternForFilter,\n makeFilterOptionFromFabricImage,\n resetFillPatternCanvas,\n} from '@/helper/shapeFilterFillHelper';\nimport {\n Promise,\n changeOrigin,\n getCustomProperty,\n getFillTypeFromOption,\n getFillTypeFromObject,\n isShape,\n} from '@/util';\nimport {\n rejectMessages,\n eventNames,\n keyCodes as KEY_CODES,\n componentNames,\n fObjectOptions,\n SHAPE_DEFAULT_OPTIONS,\n SHAPE_FILL_TYPE,\n} from '@/consts';\n\nconst SHAPE_INIT_OPTIONS = extend(\n {\n strokeWidth: 1,\n stroke: '#000000',\n fill: '#ffffff',\n width: 1,\n height: 1,\n rx: 0,\n ry: 0,\n },\n SHAPE_DEFAULT_OPTIONS\n);\nconst DEFAULT_TYPE = 'rect';\nconst DEFAULT_WIDTH = 20;\nconst DEFAULT_HEIGHT = 20;\n\n/**\n * Make fill option\n * @param {Object} options - Options to create the shape\n * @param {Object.Image} canvasImage - canvas background image\n * @param {Function} createStaticCanvas - static canvas creater\n * @returns {Object} - shape option\n * @private\n */\nfunction makeFabricFillOption(options, canvasImage, createStaticCanvas) {\n const fillOption = options.fill;\n const fillType = getFillTypeFromOption(options.fill);\n let fill = fillOption;\n\n if (fillOption.color) {\n fill = fillOption.color;\n }\n\n let extOption = null;\n if (fillType === 'filter') {\n const newStaticCanvas = createStaticCanvas();\n extOption = makeFillPatternForFilter(canvasImage, fillOption.filter, newStaticCanvas);\n } else {\n extOption = { fill };\n }\n\n return extend({}, options, extOption);\n}\n\n/**\n * Shape\n * @class Shape\n * @param {Graphics} graphics - Graphics instance\n * @extends {Component}\n * @ignore\n */\nexport default class Shape extends Component {\n constructor(graphics) {\n super(componentNames.SHAPE, graphics);\n\n /**\n * Object of The drawing shape\n * @type {fabric.Object}\n * @private\n */\n this._shapeObj = null;\n\n /**\n * Type of the drawing shape\n * @type {string}\n * @private\n */\n this._type = DEFAULT_TYPE;\n\n /**\n * Options to draw the shape\n * @type {Object}\n * @private\n */\n this._options = extend({}, SHAPE_INIT_OPTIONS);\n\n /**\n * Whether the shape object is selected or not\n * @type {boolean}\n * @private\n */\n this._isSelected = false;\n\n /**\n * Pointer for drawing shape (x, y)\n * @type {Object}\n * @private\n */\n this._startPoint = {};\n\n /**\n * Using shortcut on drawing shape\n * @type {boolean}\n * @private\n */\n this._withShiftKey = false;\n\n /**\n * Event handler list\n * @type {Object}\n * @private\n */\n this._handlers = {\n mousedown: this._onFabricMouseDown.bind(this),\n mousemove: this._onFabricMouseMove.bind(this),\n mouseup: this._onFabricMouseUp.bind(this),\n keydown: this._onKeyDown.bind(this),\n keyup: this._onKeyUp.bind(this),\n };\n }\n\n /**\n * Start to draw the shape on canvas\n * @ignore\n */\n start() {\n const canvas = this.getCanvas();\n\n this._isSelected = false;\n\n canvas.defaultCursor = 'crosshair';\n canvas.selection = false;\n canvas.uniformScaling = true;\n canvas.on({\n 'mouse:down': this._handlers.mousedown,\n });\n\n fabric.util.addListener(document, 'keydown', this._handlers.keydown);\n fabric.util.addListener(document, 'keyup', this._handlers.keyup);\n }\n\n /**\n * End to draw the shape on canvas\n * @ignore\n */\n end() {\n const canvas = this.getCanvas();\n\n this._isSelected = false;\n\n canvas.defaultCursor = 'default';\n\n canvas.selection = true;\n canvas.uniformScaling = false;\n canvas.off({\n 'mouse:down': this._handlers.mousedown,\n });\n\n fabric.util.removeListener(document, 'keydown', this._handlers.keydown);\n fabric.util.removeListener(document, 'keyup', this._handlers.keyup);\n }\n\n /**\n * Set states of the current drawing shape\n * @ignore\n * @param {string} type - Shape type (ex: 'rect', 'circle')\n * @param {Object} [options] - Shape options\n * @param {(ShapeFillOption | string)} [options.fill] - {@link ShapeFillOption} or\n * Shape foreground color (ex: '#fff', 'transparent')\n * @param {string} [options.stoke] - Shape outline color\n * @param {number} [options.strokeWidth] - Shape outline width\n * @param {number} [options.width] - Width value (When type option is 'rect', this options can use)\n * @param {number} [options.height] - Height value (When type option is 'rect', this options can use)\n * @param {number} [options.rx] - Radius x value (When type option is 'circle', this options can use)\n * @param {number} [options.ry] - Radius y value (When type option is 'circle', this options can use)\n */\n setStates(type, options) {\n this._type = type;\n\n if (options) {\n this._options = extend(this._options, options);\n }\n }\n\n /**\n * Add the shape\n * @ignore\n * @param {string} type - Shape type (ex: 'rect', 'circle')\n * @param {Object} options - Shape options\n * @param {(ShapeFillOption | string)} [options.fill] - ShapeFillOption or Shape foreground color (ex: '#fff', 'transparent') or ShapeFillOption object\n * @param {string} [options.stroke] - Shape outline color\n * @param {number} [options.strokeWidth] - Shape outline width\n * @param {number} [options.width] - Width value (When type option is 'rect', this options can use)\n * @param {number} [options.height] - Height value (When type option is 'rect', this options can use)\n * @param {number} [options.rx] - Radius x value (When type option is 'circle', this options can use)\n * @param {number} [options.ry] - Radius y value (When type option is 'circle', this options can use)\n * @param {number} [options.isRegular] - Whether scaling shape has 1:1 ratio or not\n * @returns {Promise}\n */\n add(type, options) {\n return new Promise((resolve) => {\n const canvas = this.getCanvas();\n const extendOption = this._extendOptions(options);\n\n const shapeObj = this._createInstance(type, extendOption);\n const objectProperties = this.graphics.createObjectProperties(shapeObj);\n\n this._bindEventOnShape(shapeObj);\n\n canvas.add(shapeObj).setActiveObject(shapeObj);\n\n this._resetPositionFillFilter(shapeObj);\n\n resolve(objectProperties);\n });\n }\n\n /**\n * Change the shape\n * @ignore\n * @param {fabric.Object} shapeObj - Selected shape object on canvas\n * @param {Object} options - Shape options\n * @param {(ShapeFillOption | string)} [options.fill] - {@link ShapeFillOption} or\n * Shape foreground color (ex: '#fff', 'transparent')\n * @param {string} [options.stroke] - Shape outline color\n * @param {number} [options.strokeWidth] - Shape outline width\n * @param {number} [options.width] - Width value (When type option is 'rect', this options can use)\n * @param {number} [options.height] - Height value (When type option is 'rect', this options can use)\n * @param {number} [options.rx] - Radius x value (When type option is 'circle', this options can use)\n * @param {number} [options.ry] - Radius y value (When type option is 'circle', this options can use)\n * @param {number} [options.isRegular] - Whether scaling shape has 1:1 ratio or not\n * @returns {Promise}\n */\n change(shapeObj, options) {\n return new Promise((resolve, reject) => {\n if (!isShape(shapeObj)) {\n reject(rejectMessages.unsupportedType);\n }\n const hasFillOption = getFillTypeFromOption(options.fill) === 'filter';\n const { canvasImage, createStaticCanvas } = this.graphics;\n\n shapeObj.set(\n hasFillOption ? makeFabricFillOption(options, canvasImage, createStaticCanvas) : options\n );\n\n if (hasFillOption) {\n this._resetPositionFillFilter(shapeObj);\n }\n\n this.getCanvas().renderAll();\n resolve();\n });\n }\n\n /**\n * make fill property for user event\n * @param {fabric.Object} shapeObj - fabric object\n * @returns {Object}\n */\n makeFillPropertyForUserEvent(shapeObj) {\n const fillType = getFillTypeFromObject(shapeObj);\n const fillProp = {};\n\n if (fillType === SHAPE_FILL_TYPE.FILTER) {\n const fillImage = getFillImageFromShape(shapeObj);\n const filterOption = makeFilterOptionFromFabricImage(fillImage);\n\n fillProp.type = fillType;\n fillProp.filter = filterOption;\n } else {\n fillProp.type = SHAPE_FILL_TYPE.COLOR;\n fillProp.color = shapeObj.fill || 'transparent';\n }\n\n return fillProp;\n }\n\n /**\n * Copy object handling.\n * @param {fabric.Object} shapeObj - Shape object\n * @param {fabric.Object} originalShapeObj - Shape object\n */\n processForCopiedObject(shapeObj, originalShapeObj) {\n this._bindEventOnShape(shapeObj);\n\n if (getFillTypeFromObject(shapeObj) === 'filter') {\n const fillImage = getFillImageFromShape(originalShapeObj);\n const filterOption = makeFilterOptionFromFabricImage(fillImage);\n const newStaticCanvas = this.graphics.createStaticCanvas();\n\n shapeObj.set(\n makeFillPatternForFilter(this.graphics.canvasImage, filterOption, newStaticCanvas)\n );\n this._resetPositionFillFilter(shapeObj);\n }\n }\n\n /**\n * Create the instance of shape\n * @param {string} type - Shape type\n * @param {Object} options - Options to creat the shape\n * @returns {fabric.Object} Shape instance\n * @private\n */\n _createInstance(type, options) {\n let instance;\n\n switch (type) {\n case 'rect':\n instance = new fabric.Rect(options);\n break;\n case 'circle':\n instance = new fabric.Ellipse(\n extend(\n {\n type: 'circle',\n },\n options\n )\n );\n break;\n case 'triangle':\n instance = new fabric.Triangle(options);\n break;\n default:\n instance = {};\n }\n\n return instance;\n }\n\n /**\n * Get the options to create the shape\n * @param {Object} options - Options to creat the shape\n * @returns {Object} Shape options\n * @private\n */\n _extendOptions(options) {\n const selectionStyles = fObjectOptions.SELECTION_STYLE;\n const { canvasImage, createStaticCanvas } = this.graphics;\n\n options = extend({}, SHAPE_INIT_OPTIONS, this._options, selectionStyles, options);\n\n return makeFabricFillOption(options, canvasImage, createStaticCanvas);\n }\n\n /**\n * Bind fabric events on the creating shape object\n * @param {fabric.Object} shapeObj - Shape object\n * @private\n */\n _bindEventOnShape(shapeObj) {\n const self = this;\n const canvas = this.getCanvas();\n\n shapeObj.on({\n added() {\n self._shapeObj = this;\n resizeHelper.setOrigins(self._shapeObj);\n },\n selected() {\n self._isSelected = true;\n self._shapeObj = this;\n canvas.uniformScaling = true;\n canvas.defaultCursor = 'default';\n resizeHelper.setOrigins(self._shapeObj);\n },\n deselected() {\n self._isSelected = false;\n self._shapeObj = null;\n canvas.defaultCursor = 'crosshair';\n canvas.uniformScaling = false;\n },\n modified() {\n const currentObj = self._shapeObj;\n\n resizeHelper.adjustOriginToCenter(currentObj);\n resizeHelper.setOrigins(currentObj);\n },\n modifiedInGroup(activeSelection) {\n self._fillFilterRePositionInGroupSelection(shapeObj, activeSelection);\n },\n moving() {\n self._resetPositionFillFilter(this);\n },\n rotating() {\n self._resetPositionFillFilter(this);\n },\n scaling(fEvent) {\n const pointer = canvas.getPointer(fEvent.e);\n const currentObj = self._shapeObj;\n\n canvas.setCursor('crosshair');\n resizeHelper.resize(currentObj, pointer, true);\n\n self._resetPositionFillFilter(this);\n },\n });\n }\n\n /**\n * MouseDown event handler on canvas\n * @param {{target: fabric.Object, e: MouseEvent}} fEvent - Fabric event object\n * @private\n */\n _onFabricMouseDown(fEvent) {\n if (!fEvent.target) {\n this._isSelected = false;\n this._shapeObj = false;\n }\n\n if (!this._isSelected && !this._shapeObj) {\n const canvas = this.getCanvas();\n this._startPoint = canvas.getPointer(fEvent.e);\n\n canvas.on({\n 'mouse:move': this._handlers.mousemove,\n 'mouse:up': this._handlers.mouseup,\n });\n }\n }\n\n /**\n * MouseDown event handler on canvas\n * @param {{target: fabric.Object, e: MouseEvent}} fEvent - Fabric event object\n * @private\n */\n _onFabricMouseMove(fEvent) {\n const canvas = this.getCanvas();\n const pointer = canvas.getPointer(fEvent.e);\n const startPointX = this._startPoint.x;\n const startPointY = this._startPoint.y;\n const width = startPointX - pointer.x;\n const height = startPointY - pointer.y;\n const shape = this._shapeObj;\n\n if (!shape) {\n this.add(this._type, {\n left: startPointX,\n top: startPointY,\n width,\n height,\n }).then((objectProps) => {\n this.fire(eventNames.ADD_OBJECT, objectProps);\n });\n } else {\n this._shapeObj.set({\n isRegular: this._withShiftKey,\n });\n\n resizeHelper.resize(shape, pointer);\n canvas.renderAll();\n\n this._resetPositionFillFilter(shape);\n }\n }\n\n /**\n * MouseUp event handler on canvas\n * @private\n */\n _onFabricMouseUp() {\n const canvas = this.getCanvas();\n const startPointX = this._startPoint.x;\n const startPointY = this._startPoint.y;\n const shape = this._shapeObj;\n\n if (!shape) {\n this.add(this._type, {\n left: startPointX,\n top: startPointY,\n width: DEFAULT_WIDTH,\n height: DEFAULT_HEIGHT,\n }).then((objectProps) => {\n this.fire(eventNames.ADD_OBJECT, objectProps);\n });\n } else if (shape) {\n resizeHelper.adjustOriginToCenter(shape);\n this.fire(eventNames.OBJECT_ADDED, this.graphics.createObjectProperties(shape));\n }\n\n canvas.off({\n 'mouse:move': this._handlers.mousemove,\n 'mouse:up': this._handlers.mouseup,\n });\n }\n\n /**\n * Keydown event handler on document\n * @param {KeyboardEvent} e - Event object\n * @private\n */\n _onKeyDown(e) {\n if (e.keyCode === KEY_CODES.SHIFT) {\n this._withShiftKey = true;\n\n if (this._shapeObj) {\n this._shapeObj.isRegular = true;\n }\n }\n }\n\n /**\n * Keyup event handler on document\n * @param {KeyboardEvent} e - Event object\n * @private\n */\n _onKeyUp(e) {\n if (e.keyCode === KEY_CODES.SHIFT) {\n this._withShiftKey = false;\n\n if (this._shapeObj) {\n this._shapeObj.isRegular = false;\n }\n }\n }\n\n /**\n * Reset shape position and internal proportions in the filter type fill area.\n * @param {fabric.Object} shapeObj - Shape object\n * @private\n */\n _resetPositionFillFilter(shapeObj) {\n if (getFillTypeFromObject(shapeObj) !== 'filter') {\n return;\n }\n\n const { patternSourceCanvas } = getCustomProperty(shapeObj, 'patternSourceCanvas');\n\n const fillImage = getFillImageFromShape(shapeObj);\n const { originalAngle } = getCustomProperty(fillImage, 'originalAngle');\n\n if (this.graphics.canvasImage.angle !== originalAngle) {\n reMakePatternImageSource(shapeObj, this.graphics.canvasImage);\n }\n const { originX, originY } = shapeObj;\n\n resizeHelper.adjustOriginToCenter(shapeObj);\n\n shapeObj.width *= shapeObj.scaleX;\n shapeObj.height *= shapeObj.scaleY;\n shapeObj.rx *= shapeObj.scaleX;\n shapeObj.ry *= shapeObj.scaleY;\n shapeObj.scaleX = 1;\n shapeObj.scaleY = 1;\n\n rePositionFilterTypeFillImage(shapeObj);\n\n changeOrigin(shapeObj, {\n originX,\n originY,\n });\n\n resetFillPatternCanvas(patternSourceCanvas);\n }\n\n /**\n * Reset filter area position within group selection.\n * @param {fabric.Object} shapeObj - Shape object\n * @param {fabric.ActiveSelection} activeSelection - Shape object\n * @private\n */\n _fillFilterRePositionInGroupSelection(shapeObj, activeSelection) {\n if (activeSelection.scaleX !== 1 || activeSelection.scaleY !== 1) {\n // This is necessary because the group's scale transition state affects the relative size of the fill area.\n // The only way to reset the object transformation scale state to neutral.\n // {@link https://github.com/fabricjs/fabric.js/issues/5372}\n activeSelection.addWithUpdate();\n }\n\n const { angle, left, top } = shapeObj;\n\n activeSelection.realizeTransform(shapeObj);\n this._resetPositionFillFilter(shapeObj);\n\n shapeObj.set({\n angle,\n left,\n top,\n });\n }\n}\n","/**\n * @author NHN. FE Development Team \n * @fileoverview Shape resize helper\n */\nimport { forEach, map, extend } from 'tui-code-snippet';\nimport resizeHelper from '@/helper/shapeResizeHelper';\nimport { capitalizeString, flipObject, setCustomProperty, getCustomProperty } from '@/util';\n\nconst FILTER_OPTION_MAP = {\n pixelate: 'blocksize',\n blur: 'blur',\n};\nconst POSITION_DIMENSION_MAP = {\n x: 'width',\n y: 'height',\n};\n\nconst FILTER_NAME_VALUE_MAP = flipObject(FILTER_OPTION_MAP);\n\n/**\n * Cached canvas image element for fill image\n * @type {boolean}\n * @private\n */\nlet cachedCanvasImageElement = null;\n\n/**\n * Get background image of fill\n * @param {fabric.Object} shapeObj - Shape object\n * @returns {fabric.Image}\n * @private\n */\nexport function getFillImageFromShape(shapeObj) {\n const { patternSourceCanvas } = getCustomProperty(shapeObj, 'patternSourceCanvas');\n const [fillImage] = patternSourceCanvas.getObjects();\n\n return fillImage;\n}\n\n/**\n * Reset the image position in the filter type fill area.\n * @param {fabric.Object} shapeObj - Shape object\n * @private\n */\nexport function rePositionFilterTypeFillImage(shapeObj) {\n const { angle, flipX, flipY } = shapeObj;\n const fillImage = getFillImageFromShape(shapeObj);\n const rotatedShapeCornerDimension = getRotatedDimension(shapeObj);\n const { right, bottom } = rotatedShapeCornerDimension;\n let { width, height } = rotatedShapeCornerDimension;\n const diffLeft = (width - shapeObj.width) / 2;\n const diffTop = (height - shapeObj.height) / 2;\n const cropX = shapeObj.left - shapeObj.width / 2 - diffLeft;\n const cropY = shapeObj.top - shapeObj.height / 2 - diffTop;\n let left = width / 2 - diffLeft;\n let top = height / 2 - diffTop;\n const fillImageMaxSize = Math.max(width, height) + Math.max(diffLeft, diffTop);\n\n [left, top, width, height] = calculateFillImageDimensionOutsideCanvas({\n shapeObj,\n left,\n top,\n width,\n height,\n cropX,\n cropY,\n flipX,\n flipY,\n right,\n bottom,\n });\n\n fillImage.set({\n angle: flipX === flipY ? -angle : angle,\n left,\n top,\n width,\n height,\n cropX,\n cropY,\n flipX,\n flipY,\n });\n\n setCustomProperty(fillImage, { fillImageMaxSize });\n}\n\n/**\n * Make filter option from fabric image\n * @param {fabric.Image} imageObject - fabric image object\n * @returns {object}\n */\nexport function makeFilterOptionFromFabricImage(imageObject) {\n return map(imageObject.filters, (filter) => {\n const [key] = Object.keys(filter);\n\n return {\n [FILTER_NAME_VALUE_MAP[key]]: filter[key],\n };\n });\n}\n\n/**\n * Calculate fill image position and size for out of Canvas\n * @param {Object} options - options for position dimension calculate\n * @param {fabric.Object} shapeObj - shape object\n * @param {number} left - original left position\n * @param {number} top - original top position\n * @param {number} width - image width\n * @param {number} height - image height\n * @param {number} cropX - image cropX\n * @param {number} cropY - image cropY\n * @param {boolean} flipX - shape flipX\n * @param {boolean} flipY - shape flipY\n * @returns {Object}\n */\nfunction calculateFillImageDimensionOutsideCanvas({\n shapeObj,\n left,\n top,\n width,\n height,\n cropX,\n cropY,\n flipX,\n flipY,\n right,\n bottom,\n}) {\n const overflowAreaPositionFixer = (type, outDistance, imageLeft, imageTop) =>\n calculateDistanceOverflowPart({\n type,\n outDistance,\n shapeObj,\n flipX,\n flipY,\n left: imageLeft,\n top: imageTop,\n });\n const [originalWidth, originalHeight] = [width, height];\n\n [left, top, width, height] = calculateDimensionLeftTopEdge(overflowAreaPositionFixer, {\n left,\n top,\n width,\n height,\n cropX,\n cropY,\n });\n\n [left, top, width, height] = calculateDimensionRightBottomEdge(overflowAreaPositionFixer, {\n left,\n top,\n insideCanvasRealImageWidth: width,\n insideCanvasRealImageHeight: height,\n right,\n bottom,\n cropX,\n cropY,\n originalWidth,\n originalHeight,\n });\n\n return [left, top, width, height];\n}\n\n/**\n * Calculate fill image position and size for for right bottom edge\n * @param {Function} overflowAreaPositionFixer - position fixer\n * @param {Object} options - options for position dimension calculate\n * @param {fabric.Object} shapeObj - shape object\n * @param {number} left - original left position\n * @param {number} top - original top position\n * @param {number} width - image width\n * @param {number} height - image height\n * @param {number} right - image right\n * @param {number} bottom - image bottom\n * @param {number} cropX - image cropX\n * @param {number} cropY - image cropY\n * @param {boolean} originalWidth - image original width\n * @param {boolean} originalHeight - image original height\n * @returns {Object}\n */\nfunction calculateDimensionRightBottomEdge(\n overflowAreaPositionFixer,\n {\n left,\n top,\n insideCanvasRealImageWidth,\n insideCanvasRealImageHeight,\n right,\n bottom,\n cropX,\n cropY,\n originalWidth,\n originalHeight,\n }\n) {\n let [width, height] = [insideCanvasRealImageWidth, insideCanvasRealImageHeight];\n const { width: canvasWidth, height: canvasHeight } = cachedCanvasImageElement;\n\n if (right > canvasWidth && cropX > 0) {\n width = originalWidth - Math.abs(right - canvasWidth);\n }\n if (bottom > canvasHeight && cropY > 0) {\n height = originalHeight - Math.abs(bottom - canvasHeight);\n }\n\n const diff = {\n x: (insideCanvasRealImageWidth - width) / 2,\n y: (insideCanvasRealImageHeight - height) / 2,\n };\n\n forEach(['x', 'y'], (type) => {\n const cropDistance2 = diff[type];\n if (cropDistance2 > 0) {\n [left, top] = overflowAreaPositionFixer(type, cropDistance2, left, top);\n }\n });\n\n return [left, top, width, height];\n}\n\n/**\n * Calculate fill image position and size for for left top\n * @param {Function} overflowAreaPositionFixer - position fixer\n * @param {Object} options - options for position dimension calculate\n * @param {fabric.Object} shapeObj - shape object\n * @param {number} left - original left position\n * @param {number} top - original top position\n * @param {number} width - image width\n * @param {number} height - image height\n * @param {number} cropX - image cropX\n * @param {number} cropY - image cropY\n * @returns {Object}\n */\nfunction calculateDimensionLeftTopEdge(\n overflowAreaPositionFixer,\n { left, top, width, height, cropX, cropY }\n) {\n const dimension = {\n width,\n height,\n };\n\n forEach(['x', 'y'], (type) => {\n const cropDistance = type === 'x' ? cropX : cropY;\n const compareSize = dimension[POSITION_DIMENSION_MAP[type]];\n const standardSize = cachedCanvasImageElement[POSITION_DIMENSION_MAP[type]];\n\n if (compareSize > standardSize) {\n const outDistance = (compareSize - standardSize) / 2;\n\n dimension[POSITION_DIMENSION_MAP[type]] = standardSize;\n [left, top] = overflowAreaPositionFixer(type, outDistance, left, top);\n }\n if (cropDistance < 0) {\n [left, top] = overflowAreaPositionFixer(type, cropDistance, left, top);\n }\n });\n\n return [left, top, dimension.width, dimension.height];\n}\n\n/**\n * Make fill property of dynamic pattern type\n * @param {fabric.Image} canvasImage - canvas background image\n * @param {Array} filterOption - filter option\n * @param {fabric.StaticCanvas} patternSourceCanvas - fabric static canvas\n * @returns {Object}\n */\nexport function makeFillPatternForFilter(canvasImage, filterOption, patternSourceCanvas) {\n const copiedCanvasElement = getCachedCanvasImageElement(canvasImage);\n const fillImage = makeFillImage(copiedCanvasElement, canvasImage.angle, filterOption);\n patternSourceCanvas.add(fillImage);\n\n const fabricProperty = {\n fill: new fabric.Pattern({\n source: patternSourceCanvas.getElement(),\n repeat: 'no-repeat',\n }),\n };\n\n setCustomProperty(fabricProperty, { patternSourceCanvas });\n\n return fabricProperty;\n}\n\n/**\n * Reset fill pattern canvas\n * @param {fabric.StaticCanvas} patternSourceCanvas - fabric static canvas\n */\nexport function resetFillPatternCanvas(patternSourceCanvas) {\n const [innerImage] = patternSourceCanvas.getObjects();\n let { fillImageMaxSize } = getCustomProperty(innerImage, 'fillImageMaxSize');\n fillImageMaxSize = Math.max(1, fillImageMaxSize);\n\n patternSourceCanvas.setDimensions({\n width: fillImageMaxSize,\n height: fillImageMaxSize,\n });\n patternSourceCanvas.renderAll();\n}\n\n/**\n * Remake filter pattern image source\n * @param {fabric.Object} shapeObj - Shape object\n * @param {fabric.Image} canvasImage - canvas background image\n */\nexport function reMakePatternImageSource(shapeObj, canvasImage) {\n const { patternSourceCanvas } = getCustomProperty(shapeObj, 'patternSourceCanvas');\n const [fillImage] = patternSourceCanvas.getObjects();\n const filterOption = makeFilterOptionFromFabricImage(fillImage);\n\n patternSourceCanvas.remove(fillImage);\n\n const copiedCanvasElement = getCachedCanvasImageElement(canvasImage, true);\n const newFillImage = makeFillImage(copiedCanvasElement, canvasImage.angle, filterOption);\n\n patternSourceCanvas.add(newFillImage);\n}\n\n/**\n * Calculate a point line outside the canvas.\n * @param {fabric.Image} canvasImage - canvas background image\n * @param {boolean} reset - default is false\n * @returns {HTMLImageElement}\n */\nexport function getCachedCanvasImageElement(canvasImage, reset = false) {\n if (!cachedCanvasImageElement || reset) {\n cachedCanvasImageElement = canvasImage.toCanvasElement();\n }\n\n return cachedCanvasImageElement;\n}\n\n/**\n * Calculate fill image position for out of Canvas\n * @param {string} type - 'x' or 'y'\n * @param {fabric.Object} shapeObj - shape object\n * @param {number} outDistance - distance away\n * @param {number} left - original left position\n * @param {number} top - original top position\n * @returns {Array}\n */\nfunction calculateDistanceOverflowPart({ type, shapeObj, outDistance, left, top, flipX, flipY }) {\n const shapePointNavigation = getShapeEdgePoint(shapeObj);\n const shapeNeighborPointNavigation = [\n [1, 2],\n [0, 3],\n [0, 3],\n [1, 2],\n ];\n const linePointsOutsideCanvas = calculateLinePointsOutsideCanvas(\n type,\n shapePointNavigation,\n shapeNeighborPointNavigation\n );\n const reatAngles = calculateLineAngleOfOutsideCanvas(\n type,\n shapePointNavigation,\n linePointsOutsideCanvas\n );\n const { startPointIndex } = linePointsOutsideCanvas;\n const diffPosition = getReversePositionForFlip({\n outDistance,\n startPointIndex,\n flipX,\n flipY,\n reatAngles,\n });\n\n return [left + diffPosition.left, top + diffPosition.top];\n}\n\n/**\n * Calculate fill image position for out of Canvas\n * @param {number} outDistance - distance away\n * @param {boolean} flipX - flip x statux\n * @param {boolean} flipY - flip y statux\n * @param {Array} reatAngles - Line angle of the rectangle vertex.\n * @returns {Object} diffPosition\n */\nfunction getReversePositionForFlip({ outDistance, startPointIndex, flipX, flipY, reatAngles }) {\n const rotationChangePoint1 = outDistance * Math.cos((reatAngles[0] * Math.PI) / 180);\n const rotationChangePoint2 = outDistance * Math.cos((reatAngles[1] * Math.PI) / 180);\n const isForward = startPointIndex === 2 || startPointIndex === 3;\n const diffPosition = {\n top: isForward ? rotationChangePoint1 : rotationChangePoint2,\n left: isForward ? rotationChangePoint2 : rotationChangePoint1,\n };\n\n if (isReverseLeftPositionForFlip(startPointIndex, flipX, flipY)) {\n diffPosition.left = diffPosition.left * -1;\n }\n if (isReverseTopPositionForFlip(startPointIndex, flipX, flipY)) {\n diffPosition.top = diffPosition.top * -1;\n }\n\n return diffPosition;\n}\n\n/**\n * Calculate a point line outside the canvas.\n * @param {string} type - 'x' or 'y'\n * @param {Array} shapePointNavigation - shape edge positions\n * @param {Object} shapePointNavigation.lefttop - left top position\n * @param {Object} shapePointNavigation.righttop - right top position\n * @param {Object} shapePointNavigation.leftbottom - lefttop position\n * @param {Object} shapePointNavigation.rightbottom - rightbottom position\n * @param {Array} shapeNeighborPointNavigation - Array to find adjacent edges.\n * @returns {Object}\n */\nfunction calculateLinePointsOutsideCanvas(\n type,\n shapePointNavigation,\n shapeNeighborPointNavigation\n) {\n let minimumPoint = 0;\n let minimumPointIndex = 0;\n forEach(shapePointNavigation, (point, index) => {\n if (point[type] < minimumPoint) {\n minimumPoint = point[type];\n minimumPointIndex = index;\n }\n });\n\n const [endPointIndex1, endPointIndex2] = shapeNeighborPointNavigation[minimumPointIndex];\n\n return {\n startPointIndex: minimumPointIndex,\n endPointIndex1,\n endPointIndex2,\n };\n}\n\n/**\n * Calculate a point line outside the canvas.\n * @param {string} type - 'x' or 'y'\n * @param {Array} shapePointNavigation - shape edge positions\n * @param {object} shapePointNavigation.lefttop - left top position\n * @param {object} shapePointNavigation.righttop - right top position\n * @param {object} shapePointNavigation.leftbottom - lefttop position\n * @param {object} shapePointNavigation.rightbottom - rightbottom position\n * @param {Object} linePointsOfOneVertexIndex - Line point of one vertex\n * @param {Object} linePointsOfOneVertexIndex.startPoint - start point index\n * @param {Object} linePointsOfOneVertexIndex.endPointIndex1 - end point index\n * @param {Object} linePointsOfOneVertexIndex.endPointIndex2 - end point index\n * @returns {Object}\n */\nfunction calculateLineAngleOfOutsideCanvas(type, shapePointNavigation, linePointsOfOneVertexIndex) {\n const { startPointIndex, endPointIndex1, endPointIndex2 } = linePointsOfOneVertexIndex;\n const horizontalVerticalAngle = type === 'x' ? 180 : 270;\n\n return map([endPointIndex1, endPointIndex2], (pointIndex) => {\n const startPoint = shapePointNavigation[startPointIndex];\n const endPoint = shapePointNavigation[pointIndex];\n const diffY = startPoint.y - endPoint.y;\n const diffX = startPoint.x - endPoint.x;\n\n return (Math.atan2(diffY, diffX) * 180) / Math.PI - horizontalVerticalAngle;\n });\n}\n\n/* eslint-disable complexity */\n/**\n * Calculate a point line outside the canvas for horizontal.\n * @param {number} startPointIndex - start point index\n * @param {boolean} flipX - flip x statux\n * @param {boolean} flipY - flip y statux\n * @returns {boolean} flipY - flip y statux\n */\nfunction isReverseLeftPositionForFlip(startPointIndex, flipX, flipY) {\n return (\n (((!flipX && flipY) || (!flipX && !flipY)) && startPointIndex === 0) ||\n (((flipX && flipY) || (flipX && !flipY)) && startPointIndex === 1) ||\n (((!flipX && !flipY) || (!flipX && flipY)) && startPointIndex === 2) ||\n (((flipX && !flipY) || (flipX && flipY)) && startPointIndex === 3)\n );\n}\n/* eslint-enable complexity */\n\n/* eslint-disable complexity */\n/**\n * Calculate a point line outside the canvas for vertical.\n * @param {number} startPointIndex - start point index\n * @param {boolean} flipX - flip x statux\n * @param {boolean} flipY - flip y statux\n * @returns {boolean} flipY - flip y statux\n */\nfunction isReverseTopPositionForFlip(startPointIndex, flipX, flipY) {\n return (\n (((flipX && !flipY) || (!flipX && !flipY)) && startPointIndex === 0) ||\n (((!flipX && !flipY) || (flipX && !flipY)) && startPointIndex === 1) ||\n (((flipX && flipY) || (!flipX && flipY)) && startPointIndex === 2) ||\n (((!flipX && flipY) || (flipX && flipY)) && startPointIndex === 3)\n );\n}\n/* eslint-enable complexity */\n\n/**\n * Shape edge points\n * @param {fabric.Object} shapeObj - Selected shape object on canvas\n * @returns {Array} shapeEdgePoint - shape edge positions\n */\nfunction getShapeEdgePoint(shapeObj) {\n return [\n shapeObj.getPointByOrigin('left', 'top'),\n shapeObj.getPointByOrigin('right', 'top'),\n shapeObj.getPointByOrigin('left', 'bottom'),\n shapeObj.getPointByOrigin('right', 'bottom'),\n ];\n}\n\n/**\n * Rotated shape dimension\n * @param {fabric.Object} shapeObj - Shape object\n * @returns {Object} Rotated shape dimension\n */\nfunction getRotatedDimension(shapeObj) {\n const [\n { x: ax, y: ay },\n { x: bx, y: by },\n { x: cx, y: cy },\n { x: dx, y: dy },\n ] = getShapeEdgePoint(shapeObj);\n\n const left = Math.min(ax, bx, cx, dx);\n const top = Math.min(ay, by, cy, dy);\n const right = Math.max(ax, bx, cx, dx);\n const bottom = Math.max(ay, by, cy, dy);\n\n return {\n left,\n top,\n right,\n bottom,\n width: right - left,\n height: bottom - top,\n };\n}\n\n/**\n * Make fill image\n * @param {HTMLImageElement} copiedCanvasElement - html image element\n * @param {number} currentCanvasImageAngle - current canvas angle\n * @param {Array} filterOption - filter option\n * @returns {fabric.Image}\n * @private\n */\nfunction makeFillImage(copiedCanvasElement, currentCanvasImageAngle, filterOption) {\n const fillImage = new fabric.Image(copiedCanvasElement);\n\n forEach(extend({}, ...filterOption), (value, key) => {\n const fabricFilterClassName = capitalizeString(key);\n const filter = new fabric.Image.filters[fabricFilterClassName]({\n [FILTER_OPTION_MAP[key]]: value,\n });\n fillImage.filters.push(filter);\n });\n fillImage.applyFilters();\n\n setCustomProperty(fillImage, {\n originalAngle: currentCanvasImageAngle,\n fillImageMaxSize: Math.max(fillImage.width, fillImage.height),\n });\n resizeHelper.adjustOriginToCenter(fillImage);\n\n return fillImage;\n}\n","/**\n * @author NHN. FE Development Team \n * @fileoverview Image zoom module (start zoom, end zoom)\n */\nimport fabric from 'fabric';\nimport Component from '@/interface/component';\nimport { clamp } from '@/util';\nimport { componentNames, eventNames, keyCodes, zoomModes } from '@/consts';\n\nconst MOUSE_MOVE_THRESHOLD = 10;\nconst DEFAULT_SCROLL_OPTION = {\n left: 0,\n top: 0,\n width: 0,\n height: 0,\n stroke: '#000000',\n strokeWidth: 0,\n fill: '#000000',\n opacity: 0.4,\n evented: false,\n selectable: false,\n hoverCursor: 'auto',\n};\nconst DEFAULT_VERTICAL_SCROLL_RATIO = {\n SIZE: 0.0045,\n MARGIN: 0.003,\n BORDER_RADIUS: 0.003,\n};\nconst DEFAULT_HORIZONTAL_SCROLL_RATIO = {\n SIZE: 0.0066,\n MARGIN: 0.0044,\n BORDER_RADIUS: 0.003,\n};\nconst DEFAULT_ZOOM_LEVEL = 1.0;\n\n/**\n * Zoom components\n * @param {Graphics} graphics - Graphics instance\n * @extends {Component}\n * @class Zoom\n * @ignore\n */\nclass Zoom extends Component {\n constructor(graphics) {\n super(componentNames.ZOOM, graphics);\n\n /**\n * zoomArea\n * @type {?fabric.Rect}\n * @private\n */\n this.zoomArea = null;\n\n /**\n * Start point of zoom area\n * @type {?{x: number, y: number}}\n */\n this._startPoint = null;\n\n /**\n * Center point of every zoom\n * @type {Array.<{prevZoomLevel: number, zoomLevel: number, x: number, y: number}>}\n */\n this._centerPoints = [];\n\n /**\n * Zoom level (default: 100%(1.0), max: 400%(4.0))\n * @type {number}\n */\n this.zoomLevel = DEFAULT_ZOOM_LEVEL;\n\n /**\n * Zoom mode ('normal', 'zoom', 'hand')\n * @type {string}\n */\n this.zoomMode = zoomModes.DEFAULT;\n\n /**\n * Listeners\n * @type {Object.}\n * @private\n */\n this._listeners = {\n startZoom: this._onMouseDownWithZoomMode.bind(this),\n moveZoom: this._onMouseMoveWithZoomMode.bind(this),\n stopZoom: this._onMouseUpWithZoomMode.bind(this),\n startHand: this._onMouseDownWithHandMode.bind(this),\n moveHand: this._onMouseMoveWithHandMode.bind(this),\n stopHand: this._onMouseUpWithHandMode.bind(this),\n zoomChanged: this._changeScrollState.bind(this),\n keydown: this._onKeyDown.bind(this),\n keyup: this._onKeyUp.bind(this),\n };\n\n const canvas = this.getCanvas();\n\n /**\n * Width:Height ratio (ex. width=1.5, height=1 -> aspectRatio=1.5)\n * @private\n */\n this.aspectRatio = canvas.width / canvas.height;\n\n /**\n * vertical scroll bar\n * @type {fabric.Rect}\n * @private\n */\n this._verticalScroll = new fabric.Rect(DEFAULT_SCROLL_OPTION);\n\n /**\n * horizontal scroll bar\n * @type {fabric.Rect}\n * @private\n */\n this._horizontalScroll = new fabric.Rect(DEFAULT_SCROLL_OPTION);\n\n canvas.on(eventNames.ZOOM_CHANGED, this._listeners.zoomChanged);\n\n fabric.util.addListener(document, 'keydown', this._listeners.keydown);\n fabric.util.addListener(document, 'keyup', this._listeners.keyup);\n }\n\n /**\n * Keydown event handler\n * @param {KeyboardEvent} e - Event object\n * @private\n */\n _onKeyDown(e) {\n if (this.withSpace) {\n return;\n }\n\n if (e.keyCode === keyCodes.SPACE) {\n e.preventDefault();\n this.withSpace = true;\n this.startHandMode();\n }\n }\n\n /**\n * Keyup event handler\n * @param {KeyboardEvent} e - Event object\n * @private\n */\n _onKeyUp(e) {\n if (e.keyCode === keyCodes.SPACE) {\n e.preventDefault();\n this.withSpace = false;\n this.endHandMode();\n }\n }\n\n /**\n * Start zoom-in mode\n */\n startZoomInMode() {\n if (this.zoomArea) {\n return;\n }\n this.endHandMode();\n this.zoomMode = zoomModes.ZOOM;\n\n const canvas = this.getCanvas();\n\n this._changeObjectsEventedState(false);\n\n this.zoomArea = new fabric.Rect({\n left: 0,\n top: 0,\n width: 0.5,\n height: 0.5,\n stroke: 'black',\n strokeWidth: 1,\n fill: 'transparent',\n hoverCursor: 'zoom-in',\n });\n\n canvas.discardActiveObject();\n canvas.add(this.zoomArea);\n canvas.on('mouse:down', this._listeners.startZoom);\n canvas.selection = false;\n canvas.defaultCursor = 'zoom-in';\n }\n\n /**\n * End zoom-in mode\n */\n endZoomInMode() {\n this.zoomMode = zoomModes.DEFAULT;\n\n const canvas = this.getCanvas();\n const { startZoom, moveZoom, stopZoom } = this._listeners;\n\n canvas.selection = true;\n canvas.defaultCursor = 'auto';\n canvas.off({\n 'mouse:down': startZoom,\n 'mouse:move': moveZoom,\n 'mouse:up': stopZoom,\n });\n\n this._changeObjectsEventedState(true);\n\n canvas.remove(this.zoomArea);\n this.zoomArea = null;\n }\n\n /**\n * Start zoom drawing mode\n */\n start() {\n this.zoomArea = null;\n this._startPoint = null;\n this._startHandPoint = null;\n }\n\n /**\n * Stop zoom drawing mode\n */\n end() {\n this.endZoomInMode();\n this.endHandMode();\n }\n\n /**\n * Start hand mode\n */\n startHandMode() {\n this.endZoomInMode();\n this.zoomMode = zoomModes.HAND;\n\n const canvas = this.getCanvas();\n\n this._changeObjectsEventedState(false);\n\n canvas.discardActiveObject();\n canvas.off('mouse:down', this._listeners.startHand);\n canvas.on('mouse:down', this._listeners.startHand);\n canvas.selection = false;\n canvas.defaultCursor = 'grab';\n\n canvas.fire(eventNames.HAND_STARTED);\n }\n\n /**\n * Stop hand mode\n */\n endHandMode() {\n this.zoomMode = zoomModes.DEFAULT;\n const canvas = this.getCanvas();\n\n this._changeObjectsEventedState(true);\n\n canvas.off('mouse:down', this._listeners.startHand);\n canvas.selection = true;\n canvas.defaultCursor = 'auto';\n\n this._startHandPoint = null;\n\n canvas.fire(eventNames.HAND_STOPPED);\n }\n\n /**\n * onMousedown handler in fabric canvas\n * @param {{target: fabric.Object, e: MouseEvent}} fEvent - Fabric event\n * @private\n */\n _onMouseDownWithZoomMode({ target, e }) {\n if (target) {\n return;\n }\n\n const canvas = this.getCanvas();\n\n canvas.selection = false;\n\n this._startPoint = canvas.getPointer(e);\n this.zoomArea.set({ width: 0, height: 0 });\n\n const { moveZoom, stopZoom } = this._listeners;\n canvas.on({\n 'mouse:move': moveZoom,\n 'mouse:up': stopZoom,\n });\n }\n\n /**\n * onMousemove handler in fabric canvas\n * @param {{e: MouseEvent}} fEvent - Fabric event\n * @private\n */\n _onMouseMoveWithZoomMode({ e }) {\n const canvas = this.getCanvas();\n const pointer = canvas.getPointer(e);\n const { x, y } = pointer;\n const { zoomArea, _startPoint } = this;\n const deltaX = Math.abs(x - _startPoint.x);\n const deltaY = Math.abs(y - _startPoint.y);\n\n if (deltaX + deltaY > MOUSE_MOVE_THRESHOLD) {\n canvas.remove(zoomArea);\n zoomArea.set(this._calcRectDimensionFromPoint(x, y));\n canvas.add(zoomArea);\n }\n }\n\n /**\n * Get rect dimension setting from Canvas-Mouse-Position(x, y)\n * @param {number} x - Canvas-Mouse-Position x\n * @param {number} y - Canvas-Mouse-Position Y\n * @returns {{left: number, top: number, width: number, height: number}}\n * @private\n */\n _calcRectDimensionFromPoint(x, y) {\n const canvas = this.getCanvas();\n const canvasWidth = canvas.getWidth();\n const canvasHeight = canvas.getHeight();\n const { x: startX, y: startY } = this._startPoint;\n const { min } = Math;\n\n const left = min(startX, x);\n const top = min(startY, y);\n const width = clamp(x, startX, canvasWidth) - left; // (startX <= x(mouse) <= canvasWidth) - left\n const height = clamp(y, startY, canvasHeight) - top; // (startY <= y(mouse) <= canvasHeight) - top\n\n return { left, top, width, height };\n }\n\n /**\n * onMouseup handler in fabric canvas\n * @private\n */\n _onMouseUpWithZoomMode() {\n let { zoomLevel } = this;\n const { zoomArea } = this;\n const { moveZoom, stopZoom } = this._listeners;\n const canvas = this.getCanvas();\n const center = this._getCenterPoint();\n const { x, y } = center;\n\n if (!this._isMaxZoomLevel()) {\n this._centerPoints.push({\n x,\n y,\n prevZoomLevel: zoomLevel,\n zoomLevel: zoomLevel + 1,\n });\n zoomLevel += 1;\n canvas.zoomToPoint({ x, y }, zoomLevel);\n\n this._fireZoomChanged(canvas, zoomLevel);\n\n this.zoomLevel = zoomLevel;\n }\n\n canvas.off({\n 'mouse:move': moveZoom,\n 'mouse:up': stopZoom,\n });\n\n canvas.remove(zoomArea);\n this._startPoint = null;\n }\n\n /**\n * Get center point\n * @returns {{x: number, y: number}}\n * @private\n */\n _getCenterPoint() {\n const { left, top, width, height } = this.zoomArea;\n const { x, y } = this._startPoint;\n const { aspectRatio } = this;\n\n if (width < MOUSE_MOVE_THRESHOLD && height < MOUSE_MOVE_THRESHOLD) {\n return { x, y };\n }\n\n return width > height\n ? { x: left + (aspectRatio * height) / 2, y: top + height / 2 }\n : { x: left + width / 2, y: top + width / aspectRatio / 2 };\n }\n\n /**\n * Zoom the canvas\n * @param {{x: number, y: number}} center - center of zoom\n * @param {?number} zoomLevel - zoom level\n */\n zoom({ x, y }, zoomLevel = this.zoomLevel) {\n const canvas = this.getCanvas();\n const centerPoints = this._centerPoints;\n\n for (let i = centerPoints.length - 1; i >= 0; i -= 1) {\n if (centerPoints[i].zoomLevel < zoomLevel) {\n break;\n }\n\n const { x: prevX, y: prevY, prevZoomLevel } = centerPoints.pop();\n\n canvas.zoomToPoint({ x: prevX, y: prevY }, prevZoomLevel);\n this.zoomLevel = prevZoomLevel;\n }\n\n canvas.zoomToPoint({ x, y }, zoomLevel);\n if (!this._isDefaultZoomLevel(zoomLevel)) {\n this._centerPoints.push({\n x,\n y,\n zoomLevel,\n prevZoomLevel: this.zoomLevel,\n });\n }\n this.zoomLevel = zoomLevel;\n\n this._fireZoomChanged(canvas, zoomLevel);\n }\n\n /**\n * Zoom out one step\n */\n zoomOut() {\n const centerPoints = this._centerPoints;\n\n if (!centerPoints.length) {\n return;\n }\n\n const canvas = this.getCanvas();\n const point = centerPoints.pop();\n const { x, y, prevZoomLevel } = point;\n\n if (this._isDefaultZoomLevel(prevZoomLevel)) {\n canvas.setViewportTransform([1, 0, 0, 1, 0, 0]);\n } else {\n canvas.zoomToPoint({ x, y }, prevZoomLevel);\n }\n\n this.zoomLevel = prevZoomLevel;\n\n this._fireZoomChanged(canvas, this.zoomLevel);\n }\n\n /**\n * Zoom reset\n */\n resetZoom() {\n const canvas = this.getCanvas();\n\n canvas.setViewportTransform([1, 0, 0, 1, 0, 0]);\n\n this.zoomLevel = DEFAULT_ZOOM_LEVEL;\n this._centerPoints = [];\n\n this._fireZoomChanged(canvas, this.zoomLevel);\n }\n\n /**\n * Whether zoom level is max (5.0)\n * @returns {boolean}\n * @private\n */\n _isMaxZoomLevel() {\n return this.zoomLevel >= 5.0;\n }\n\n /**\n * Move point of zoom\n * @param {{x: number, y: number}} delta - move amount\n * @private\n */\n _movePointOfZoom({ x: deltaX, y: deltaY }) {\n const centerPoints = this._centerPoints;\n\n if (!centerPoints.length) {\n return;\n }\n\n const canvas = this.getCanvas();\n const { zoomLevel } = this;\n\n const point = centerPoints.pop();\n const { x: originX, y: originY, prevZoomLevel } = point;\n const x = originX - deltaX;\n const y = originY - deltaY;\n\n canvas.zoomToPoint({ x: originX, y: originY }, prevZoomLevel);\n canvas.zoomToPoint({ x, y }, zoomLevel);\n centerPoints.push({ x, y, prevZoomLevel, zoomLevel });\n\n this._fireZoomChanged(canvas, zoomLevel);\n }\n\n /**\n * onMouseDown handler in fabric canvas\n * @param {{target: fabric.Object, e: MouseEvent}} fEvent - Fabric event\n * @private\n */\n _onMouseDownWithHandMode({ target, e }) {\n if (target) {\n return;\n }\n\n const canvas = this.getCanvas();\n\n if (this.zoomLevel <= DEFAULT_ZOOM_LEVEL) {\n return;\n }\n\n canvas.selection = false;\n\n this._startHandPoint = canvas.getPointer(e);\n\n const { moveHand, stopHand } = this._listeners;\n canvas.on({\n 'mouse:move': moveHand,\n 'mouse:up': stopHand,\n });\n }\n\n /**\n * onMouseMove handler in fabric canvas\n * @param {{e: MouseEvent}} fEvent - Fabric event\n * @private\n */\n _onMouseMoveWithHandMode({ e }) {\n const canvas = this.getCanvas();\n const { x, y } = canvas.getPointer(e);\n const deltaX = x - this._startHandPoint.x;\n const deltaY = y - this._startHandPoint.y;\n\n this._movePointOfZoom({ x: deltaX, y: deltaY });\n }\n\n /**\n * onMouseUp handler in fabric canvas\n * @private\n */\n _onMouseUpWithHandMode() {\n const canvas = this.getCanvas();\n const { moveHand, stopHand } = this._listeners;\n\n canvas.off({\n 'mouse:move': moveHand,\n 'mouse:up': stopHand,\n });\n\n this._startHandPoint = null;\n }\n\n /**\n * onChangeZoom handler in fabric canvas\n * @private\n */\n _changeScrollState({ viewport, zoomLevel }) {\n const canvas = this.getCanvas();\n\n canvas.remove(this._verticalScroll);\n canvas.remove(this._horizontalScroll);\n\n if (this._isDefaultZoomLevel(zoomLevel)) {\n return;\n }\n\n const canvasWidth = canvas.width;\n const canvasHeight = canvas.height;\n\n const { tl, tr, bl } = viewport;\n const viewportWidth = tr.x - tl.x;\n const viewportHeight = bl.y - tl.y;\n\n const horizontalScrollWidth = (viewportWidth * viewportWidth) / canvasWidth;\n const horizontalScrollHeight = viewportHeight * DEFAULT_HORIZONTAL_SCROLL_RATIO.SIZE;\n const horizontalScrollLeft = clamp(\n tl.x + (tl.x / canvasWidth) * viewportWidth,\n tl.x,\n tr.x - horizontalScrollWidth\n );\n const horizontalScrollMargin = viewportHeight * DEFAULT_HORIZONTAL_SCROLL_RATIO.MARGIN;\n const horizontalScrollBorderRadius =\n viewportHeight * DEFAULT_HORIZONTAL_SCROLL_RATIO.BORDER_RADIUS;\n\n this._horizontalScroll.set({\n left: horizontalScrollLeft,\n top: bl.y - horizontalScrollHeight - horizontalScrollMargin,\n width: horizontalScrollWidth,\n height: horizontalScrollHeight,\n rx: horizontalScrollBorderRadius,\n ry: horizontalScrollBorderRadius,\n });\n\n const verticalScrollWidth = viewportWidth * DEFAULT_VERTICAL_SCROLL_RATIO.SIZE;\n const verticalScrollHeight = (viewportHeight * viewportHeight) / canvasHeight;\n const verticalScrollTop = clamp(\n tl.y + (tl.y / canvasHeight) * viewportHeight,\n tr.y,\n bl.y - verticalScrollHeight\n );\n const verticalScrollMargin = viewportWidth * DEFAULT_VERTICAL_SCROLL_RATIO.MARGIN;\n const verticalScrollBorderRadius = viewportWidth * DEFAULT_VERTICAL_SCROLL_RATIO.BORDER_RADIUS;\n\n this._verticalScroll.set({\n left: tr.x - verticalScrollWidth - verticalScrollMargin,\n top: verticalScrollTop,\n width: verticalScrollWidth,\n height: verticalScrollHeight,\n rx: verticalScrollBorderRadius,\n ry: verticalScrollBorderRadius,\n });\n\n this._addScrollBar();\n }\n\n /**\n * Change objects 'evented' state\n * @param {boolean} [evented=true] - objects 'evented' state\n */\n _changeObjectsEventedState(evented = true) {\n const canvas = this.getCanvas();\n\n canvas.forEachObject((obj) => {\n // {@link http://fabricjs.com/docs/fabric.Object.html#evented}\n obj.evented = evented;\n });\n }\n\n /**\n * Add scroll bar and set remove timer\n */\n _addScrollBar() {\n const canvas = this.getCanvas();\n\n canvas.add(this._horizontalScroll);\n canvas.add(this._verticalScroll);\n\n if (this.scrollBarTid) {\n clearTimeout(this.scrollBarTid);\n }\n\n this.scrollBarTid = setTimeout(() => {\n canvas.remove(this._horizontalScroll);\n canvas.remove(this._verticalScroll);\n }, 3000);\n }\n\n /**\n * Check zoom level is default zoom level (1.0)\n * @param {number} zoomLevel - zoom level\n * @returns {boolean} - whether zoom level is 1.0\n */\n _isDefaultZoomLevel(zoomLevel) {\n return zoomLevel === DEFAULT_ZOOM_LEVEL;\n }\n\n /**\n * Fire 'zoomChanged' event\n * @param {fabric.Canvas} canvas - fabric canvas\n * @param {number} zoomLevel - 'zoomChanged' event params\n */\n _fireZoomChanged(canvas, zoomLevel) {\n canvas.fire(eventNames.ZOOM_CHANGED, { viewport: canvas.calcViewportBoundaries(), zoomLevel });\n }\n\n /**\n * Get zoom mode\n */\n get mode() {\n return this.zoomMode;\n }\n}\n\nexport default Zoom;\n","/**\n * @author NHN. FE Development Team \n * @fileoverview CropperDrawingMode class\n */\nimport DrawingMode from '@/interface/drawingMode';\nimport { drawingModes, componentNames as components } from '@/consts';\n\n/**\n * CropperDrawingMode class\n * @class\n * @ignore\n */\nclass CropperDrawingMode extends DrawingMode {\n constructor() {\n super(drawingModes.CROPPER);\n }\n\n /**\n * start this drawing mode\n * @param {Graphics} graphics - Graphics instance\n * @override\n */\n start(graphics) {\n const cropper = graphics.getComponent(components.CROPPER);\n cropper.start();\n }\n\n /**\n * stop this drawing mode\n * @param {Graphics} graphics - Graphics instance\n * @override\n */\n end(graphics) {\n const cropper = graphics.getComponent(components.CROPPER);\n cropper.end();\n }\n}\n\nexport default CropperDrawingMode;\n","/**\n * @author NHN. FE Development Team \n * @fileoverview FreeDrawingMode class\n */\nimport DrawingMode from '@/interface/drawingMode';\nimport { drawingModes, componentNames as components } from '@/consts';\n\n/**\n * FreeDrawingMode class\n * @class\n * @ignore\n */\nclass FreeDrawingMode extends DrawingMode {\n constructor() {\n super(drawingModes.FREE_DRAWING);\n }\n\n /**\n * start this drawing mode\n * @param {Graphics} graphics - Graphics instance\n * @param {{width: ?number, color: ?string}} [options] - Brush width & color\n * @override\n */\n start(graphics, options) {\n const freeDrawing = graphics.getComponent(components.FREE_DRAWING);\n freeDrawing.start(options);\n }\n\n /**\n * stop this drawing mode\n * @param {Graphics} graphics - Graphics instance\n * @override\n */\n end(graphics) {\n const freeDrawing = graphics.getComponent(components.FREE_DRAWING);\n freeDrawing.end();\n }\n}\n\nexport default FreeDrawingMode;\n","/**\n * @author NHN. FE Development Team \n * @fileoverview LineDrawingMode class\n */\nimport DrawingMode from '@/interface/drawingMode';\nimport { drawingModes, componentNames as components } from '@/consts';\n\n/**\n * LineDrawingMode class\n * @class\n * @ignore\n */\nclass LineDrawingMode extends DrawingMode {\n constructor() {\n super(drawingModes.LINE_DRAWING);\n }\n\n /**\n * start this drawing mode\n * @param {Graphics} graphics - Graphics instance\n * @param {{width: ?number, color: ?string}} [options] - Brush width & color\n * @override\n */\n start(graphics, options) {\n const lineDrawing = graphics.getComponent(components.LINE);\n lineDrawing.start(options);\n }\n\n /**\n * stop this drawing mode\n * @param {Graphics} graphics - Graphics instance\n * @override\n */\n end(graphics) {\n const lineDrawing = graphics.getComponent(components.LINE);\n lineDrawing.end();\n }\n}\n\nexport default LineDrawingMode;\n","/**\n * @author NHN. FE Development Team \n * @fileoverview ShapeDrawingMode class\n */\nimport DrawingMode from '@/interface/drawingMode';\nimport { drawingModes, componentNames as components } from '@/consts';\n\n/**\n * ShapeDrawingMode class\n * @class\n * @ignore\n */\nclass ShapeDrawingMode extends DrawingMode {\n constructor() {\n super(drawingModes.SHAPE);\n }\n\n /**\n * start this drawing mode\n * @param {Graphics} graphics - Graphics instance\n * @override\n */\n start(graphics) {\n const shape = graphics.getComponent(components.SHAPE);\n shape.start();\n }\n\n /**\n * stop this drawing mode\n * @param {Graphics} graphics - Graphics instance\n * @override\n */\n end(graphics) {\n const shape = graphics.getComponent(components.SHAPE);\n shape.end();\n }\n}\n\nexport default ShapeDrawingMode;\n","/**\n * @author NHN. FE Development Team \n * @fileoverview TextDrawingMode class\n */\nimport DrawingMode from '@/interface/drawingMode';\nimport { drawingModes, componentNames as components } from '@/consts';\n\n/**\n * TextDrawingMode class\n * @class\n * @ignore\n */\nclass TextDrawingMode extends DrawingMode {\n constructor() {\n super(drawingModes.TEXT);\n }\n\n /**\n * start this drawing mode\n * @param {Graphics} graphics - Graphics instance\n * @override\n */\n start(graphics) {\n const text = graphics.getComponent(components.TEXT);\n text.start();\n }\n\n /**\n * stop this drawing mode\n * @param {Graphics} graphics - Graphics instance\n * @override\n */\n end(graphics) {\n const text = graphics.getComponent(components.TEXT);\n text.end();\n }\n}\n\nexport default TextDrawingMode;\n","/**\n * @author NHN. FE Development Team \n * @fileoverview IconDrawingMode class\n */\nimport DrawingMode from '@/interface/drawingMode';\nimport { drawingModes, componentNames as components } from '@/consts';\n\n/**\n * IconDrawingMode class\n * @class\n * @ignore\n */\nclass IconDrawingMode extends DrawingMode {\n constructor() {\n super(drawingModes.ICON);\n }\n\n /**\n * start this drawing mode\n * @param {Graphics} graphics - Graphics instance\n * @override\n */\n start(graphics) {\n const icon = graphics.getComponent(components.ICON);\n icon.start();\n }\n\n /**\n * stop this drawing mode\n * @param {Graphics} graphics - Graphics instance\n * @override\n */\n end(graphics) {\n const icon = graphics.getComponent(components.ICON);\n icon.end();\n }\n}\n\nexport default IconDrawingMode;\n","/**\n * @author NHN. FE Development Team \n * @fileoverview ZoomDrawingMode class\n */\nimport DrawingMode from '@/interface/drawingMode';\nimport { drawingModes, componentNames as components } from '@/consts';\n\n/**\n * ZoomDrawingMode class\n * @class\n * @ignore\n */\nclass ZoomDrawingMode extends DrawingMode {\n constructor() {\n super(drawingModes.ZOOM);\n }\n\n /**\n * start this drawing mode\n * @param {Graphics} graphics - Graphics instance\n * @override\n */\n start(graphics) {\n const zoom = graphics.getComponent(components.ZOOM);\n\n zoom.start();\n }\n\n /**\n * stop this drawing mode\n * @param {Graphics} graphics - Graphics instance\n * @override\n */\n end(graphics) {\n const zoom = graphics.getComponent(components.ZOOM);\n\n zoom.end();\n }\n}\n\nexport default ZoomDrawingMode;\n","/**\n * @author NHN. FE Development Team \n * @fileoverview Add an icon\n */\nimport commandFactory from '@/factory/command';\nimport { Promise } from '@/util';\nimport { componentNames, commandNames } from '@/consts';\n\nconst { ICON } = componentNames;\n\nconst command = {\n name: commandNames.ADD_ICON,\n\n /**\n * Add an icon\n * @param {Graphics} graphics - Graphics instance\n * @param {string} type - Icon type ('arrow', 'cancel', custom icon name)\n * @param {Object} options - Icon options\n * @param {string} [options.fill] - Icon foreground color\n * @param {string} [options.left] - Icon x position\n * @param {string} [options.top] - Icon y position\n * @returns {Promise}\n */\n execute(graphics, type, options) {\n const iconComp = graphics.getComponent(ICON);\n\n return iconComp.add(type, options).then((objectProps) => {\n this.undoData.object = graphics.getObject(objectProps.id);\n\n return objectProps;\n });\n },\n\n /**\n * @param {Graphics} graphics - Graphics instance\n * @returns {Promise}\n */\n undo(graphics) {\n graphics.remove(this.undoData.object);\n\n return Promise.resolve();\n },\n};\n\ncommandFactory.register(command);\n\nexport default command;\n","/**\n * @author NHN. FE Development Team \n * @fileoverview Add an image object\n */\nimport commandFactory from '@/factory/command';\nimport { Promise } from '@/util';\nimport { commandNames } from '@/consts';\n\nconst command = {\n name: commandNames.ADD_IMAGE_OBJECT,\n\n /**\n * Add an image object\n * @param {Graphics} graphics - Graphics instance\n * @param {string} imgUrl - Image url to make object\n * @returns {Promise}\n */\n execute(graphics, imgUrl) {\n return graphics.addImageObject(imgUrl).then((objectProps) => {\n this.undoData.object = graphics.getObject(objectProps.id);\n\n return objectProps;\n });\n },\n\n /**\n * @param {Graphics} graphics - Graphics instance\n * @returns {Promise}\n */\n undo(graphics) {\n graphics.remove(this.undoData.object);\n\n return Promise.resolve();\n },\n};\n\ncommandFactory.register(command);\n\nexport default command;\n","/**\n * @author NHN. FE Development Team \n * @fileoverview Add an object\n */\nimport commandFactory from '@/factory/command';\nimport { Promise } from '@/util';\nimport { commandNames, rejectMessages } from '@/consts';\n\nconst command = {\n name: commandNames.ADD_OBJECT,\n\n /**\n * Add an object\n * @param {Graphics} graphics - Graphics instance\n * @param {Object} object - Fabric object\n * @returns {Promise}\n */\n execute(graphics, object) {\n return new Promise((resolve, reject) => {\n if (!graphics.contains(object)) {\n graphics.add(object);\n resolve(object);\n } else {\n reject(rejectMessages.addedObject);\n }\n });\n },\n\n /**\n * @param {Graphics} graphics - Graphics instance\n * @param {Object} object - Fabric object\n * @returns {Promise}\n */\n undo(graphics, object) {\n return new Promise((resolve, reject) => {\n if (graphics.contains(object)) {\n graphics.remove(object);\n resolve(object);\n } else {\n reject(rejectMessages.noObject);\n }\n });\n },\n};\n\ncommandFactory.register(command);\n\nexport default command;\n","/**\n * @author NHN. FE Development Team \n * @fileoverview Add a shape\n */\nimport commandFactory from '@/factory/command';\nimport { Promise } from '@/util';\nimport { componentNames, commandNames } from '@/consts';\n\nconst { SHAPE } = componentNames;\n\nconst command = {\n name: commandNames.ADD_SHAPE,\n\n /**\n * Add a shape\n * @param {Graphics} graphics - Graphics instance\n * @param {string} type - Shape type (ex: 'rect', 'circle', 'triangle')\n * @param {Object} options - Shape options\n * @param {string} [options.fill] - Shape foreground color (ex: '#fff', 'transparent')\n * @param {string} [options.stroke] - Shape outline color\n * @param {number} [options.strokeWidth] - Shape outline width\n * @param {number} [options.width] - Width value (When type option is 'rect', this options can use)\n * @param {number} [options.height] - Height value (When type option is 'rect', this options can use)\n * @param {number} [options.rx] - Radius x value (When type option is 'circle', this options can use)\n * @param {number} [options.ry] - Radius y value (When type option is 'circle', this options can use)\n * @param {number} [options.left] - Shape x position\n * @param {number} [options.top] - Shape y position\n * @param {number} [options.isRegular] - Whether resizing shape has 1:1 ratio or not\n * @returns {Promise}\n */\n execute(graphics, type, options) {\n const shapeComp = graphics.getComponent(SHAPE);\n\n return shapeComp.add(type, options).then((objectProps) => {\n const { id } = objectProps;\n\n this.undoData.object = graphics.getObject(id);\n\n return objectProps;\n });\n },\n\n /**\n * @param {Graphics} graphics - Graphics instance\n * @returns {Promise}\n */\n undo(graphics) {\n graphics.remove(this.undoData.object);\n\n return Promise.resolve();\n },\n};\n\ncommandFactory.register(command);\n\nexport default command;\n","/**\n * @author NHN. FE Development Team \n * @fileoverview Add a text object\n */\nimport commandFactory from '@/factory/command';\nimport { Promise } from '@/util';\nimport { componentNames, commandNames, rejectMessages } from '@/consts';\nimport {\n setCachedUndoDataForDimension,\n makeSelectionUndoData,\n makeSelectionUndoDatum,\n} from '@/helper/selectionModifyHelper';\n\nconst { TEXT } = componentNames;\n\nconst command = {\n name: commandNames.ADD_TEXT,\n\n /**\n * Add a text object\n * @param {Graphics} graphics - Graphics instance\n * @param {string} text - Initial input text\n * @param {Object} [options] Options for text styles\n * @param {Object} [options.styles] Initial styles\n * @param {string} [options.styles.fill] Color\n * @param {string} [options.styles.fontFamily] Font type for text\n * @param {number} [options.styles.fontSize] Size\n * @param {string} [options.styles.fontStyle] Type of inclination (normal / italic)\n * @param {string} [options.styles.fontWeight] Type of thicker or thinner looking (normal / bold)\n * @param {string} [options.styles.textAlign] Type of text align (left / center / right)\n * @param {string} [options.styles.textDecoration] Type of line (underline / line-through / overline)\n * @param {{x: number, y: number}} [options.position] - Initial position\n * @returns {Promise}\n */\n execute(graphics, text, options) {\n const textComp = graphics.getComponent(TEXT);\n\n if (this.undoData.object) {\n const undoObject = this.undoData.object;\n\n return new Promise((resolve, reject) => {\n if (!graphics.contains(undoObject)) {\n graphics.add(undoObject);\n resolve(undoObject);\n } else {\n reject(rejectMessages.redo);\n }\n });\n }\n\n return textComp.add(text, options).then((objectProps) => {\n const { id } = objectProps;\n const textObject = graphics.getObject(id);\n\n this.undoData.object = textObject;\n\n setCachedUndoDataForDimension(\n makeSelectionUndoData(textObject, () => makeSelectionUndoDatum(id, textObject, false))\n );\n\n return objectProps;\n });\n },\n\n /**\n * @param {Graphics} graphics - Graphics instance\n * @returns {Promise}\n */\n undo(graphics) {\n graphics.remove(this.undoData.object);\n\n return Promise.resolve();\n },\n};\n\ncommandFactory.register(command);\n\nexport default command;\n","/**\n * @author NHN. FE Development Team \n * @fileoverview Apply a filter into an image\n */\nimport snippet from 'tui-code-snippet';\nimport commandFactory from '@/factory/command';\nimport { componentNames, rejectMessages, commandNames } from '@/consts';\n\nconst { FILTER } = componentNames;\n\n/**\n * Cached data for undo\n * @type {Object}\n */\nlet cachedUndoDataForSilent = null;\n\n/**\n * Make undoData\n * @param {string} type - Filter type\n * @param {Object} prevfilterOption - prev Filter options\n * @param {Object} options - Filter options\n * @returns {object} - undo data\n */\nfunction makeUndoData(type, prevfilterOption, options) {\n const undoData = {};\n\n if (type === 'mask') {\n undoData.object = options.mask;\n }\n\n undoData.options = prevfilterOption;\n\n return undoData;\n}\n\nconst command = {\n name: commandNames.APPLY_FILTER,\n\n /**\n * Apply a filter into an image\n * @param {Graphics} graphics - Graphics instance\n * @param {string} type - Filter type\n * @param {Object} options - Filter options\n * @param {number} options.maskObjId - masking image object id\n * @param {boolean} isSilent - is silent execution or not\n * @returns {Promise}\n */\n execute(graphics, type, options, isSilent) {\n const filterComp = graphics.getComponent(FILTER);\n\n if (type === 'mask') {\n const maskObj = graphics.getObject(options.maskObjId);\n\n if (!(maskObj && maskObj.isType('image'))) {\n return Promise.reject(rejectMessages.invalidParameters);\n }\n\n snippet.extend(options, { mask: maskObj });\n graphics.remove(options.mask);\n }\n if (!this.isRedo) {\n const prevfilterOption = filterComp.getOptions(type);\n const undoData = makeUndoData(type, prevfilterOption, options);\n\n cachedUndoDataForSilent = this.setUndoData(undoData, cachedUndoDataForSilent, isSilent);\n }\n\n return filterComp.add(type, options);\n },\n\n /**\n * @param {Graphics} graphics - Graphics instance\n * @param {string} type - Filter type\n * @returns {Promise}\n */\n undo(graphics, type) {\n const filterComp = graphics.getComponent(FILTER);\n\n if (type === 'mask') {\n const mask = this.undoData.object;\n graphics.add(mask);\n graphics.setActiveObject(mask);\n\n return filterComp.remove(type);\n }\n\n // options changed case\n if (this.undoData.options) {\n return filterComp.add(type, this.undoData.options);\n }\n\n // filter added case\n return filterComp.remove(type);\n },\n};\n\ncommandFactory.register(command);\n\nexport default command;\n","/**\n * @author NHN. FE Development Team \n * @fileoverview Change icon color\n */\nimport commandFactory from '@/factory/command';\nimport { Promise } from '@/util';\nimport { componentNames, rejectMessages, commandNames } from '@/consts';\n\nconst { ICON } = componentNames;\n\nconst command = {\n name: commandNames.CHANGE_ICON_COLOR,\n\n /**\n * Change icon color\n * @param {Graphics} graphics - Graphics instance\n * @param {number} id - object id\n * @param {string} color - Color for icon\n * @returns {Promise}\n */\n execute(graphics, id, color) {\n return new Promise((resolve, reject) => {\n const iconComp = graphics.getComponent(ICON);\n const targetObj = graphics.getObject(id);\n\n if (!targetObj) {\n reject(rejectMessages.noObject);\n }\n\n this.undoData.object = targetObj;\n this.undoData.color = iconComp.getColor(targetObj);\n iconComp.setColor(color, targetObj);\n resolve();\n });\n },\n\n /**\n * @param {Graphics} graphics - Graphics instance\n * @returns {Promise}\n */\n undo(graphics) {\n const iconComp = graphics.getComponent(ICON);\n const { object: icon, color } = this.undoData;\n\n iconComp.setColor(color, icon);\n\n return Promise.resolve();\n },\n};\n\ncommandFactory.register(command);\n\nexport default command;\n","/**\n * @author NHN. FE Development Team \n * @fileoverview change a shape\n */\nimport snippet from 'tui-code-snippet';\nimport commandFactory from '@/factory/command';\nimport { Promise } from '@/util';\nimport { componentNames, rejectMessages, commandNames } from '@/consts';\n\nconst { SHAPE } = componentNames;\n\n/**\n * Cached data for undo\n * @type {Object}\n */\nlet cachedUndoDataForSilent = null;\n\n/**\n * Make undoData\n * @param {object} options - shape options\n * @param {Component} targetObj - shape component\n * @returns {object} - undo data\n */\nfunction makeUndoData(options, targetObj) {\n const undoData = {\n object: targetObj,\n options: {},\n };\n\n snippet.forEachOwnProperties(options, (value, key) => {\n undoData.options[key] = targetObj[key];\n });\n\n return undoData;\n}\n\nconst command = {\n name: commandNames.CHANGE_SHAPE,\n\n /**\n * Change a shape\n * @param {Graphics} graphics - Graphics instance\n * @param {number} id - object id\n * @param {Object} options - Shape options\n * @param {string} [options.fill] - Shape foreground color (ex: '#fff', 'transparent')\n * @param {string} [options.stroke] - Shape outline color\n * @param {number} [options.strokeWidth] - Shape outline width\n * @param {number} [options.width] - Width value (When type option is 'rect', this options can use)\n * @param {number} [options.height] - Height value (When type option is 'rect', this options can use)\n * @param {number} [options.rx] - Radius x value (When type option is 'circle', this options can use)\n * @param {number} [options.ry] - Radius y value (When type option is 'circle', this options can use)\n * @param {number} [options.left] - Shape x position\n * @param {number} [options.top] - Shape y position\n * @param {number} [options.isRegular] - Whether resizing shape has 1:1 ratio or not\n * @param {boolean} isSilent - is silent execution or not\n * @returns {Promise}\n */\n execute(graphics, id, options, isSilent) {\n const shapeComp = graphics.getComponent(SHAPE);\n const targetObj = graphics.getObject(id);\n\n if (!targetObj) {\n return Promise.reject(rejectMessages.noObject);\n }\n\n if (!this.isRedo) {\n const undoData = makeUndoData(options, targetObj);\n\n cachedUndoDataForSilent = this.setUndoData(undoData, cachedUndoDataForSilent, isSilent);\n }\n\n return shapeComp.change(targetObj, options);\n },\n\n /**\n * @param {Graphics} graphics - Graphics instance\n * @returns {Promise}\n */\n undo(graphics) {\n const shapeComp = graphics.getComponent(SHAPE);\n const { object: shape, options } = this.undoData;\n\n return shapeComp.change(shape, options);\n },\n};\n\ncommandFactory.register(command);\n\nexport default command;\n","/**\n * @author NHN. FE Development Team \n * @fileoverview Change a text\n */\nimport commandFactory from '@/factory/command';\nimport { Promise } from '@/util';\nimport { componentNames, rejectMessages, commandNames } from '@/consts';\n\nconst { TEXT } = componentNames;\n\nconst command = {\n name: commandNames.CHANGE_TEXT,\n\n /**\n * Change a text\n * @param {Graphics} graphics - Graphics instance\n * @param {number} id - object id\n * @param {string} text - Changing text\n * @returns {Promise}\n */\n execute(graphics, id, text) {\n const textComp = graphics.getComponent(TEXT);\n const targetObj = graphics.getObject(id);\n\n if (!targetObj) {\n return Promise.reject(rejectMessages.noObject);\n }\n\n this.undoData.object = targetObj;\n this.undoData.text = textComp.getText(targetObj);\n\n return textComp.change(targetObj, text);\n },\n\n /**\n * @param {Graphics} graphics - Graphics instance\n * @returns {Promise}\n */\n undo(graphics) {\n const textComp = graphics.getComponent(TEXT);\n const { object: textObj, text } = this.undoData;\n\n return textComp.change(textObj, text);\n },\n};\n\ncommandFactory.register(command);\n\nexport default command;\n","/**\n * @author NHN. FE Development Team \n * @fileoverview Change text styles\n */\nimport snippet from 'tui-code-snippet';\nimport commandFactory from '@/factory/command';\nimport { Promise } from '@/util';\nimport { componentNames, rejectMessages, commandNames } from '@/consts';\n\nconst { TEXT } = componentNames;\n\n/**\n * Cached data for undo\n * @type {Object}\n */\nlet cachedUndoDataForSilent = null;\n\n/**\n * Make undoData\n * @param {object} styles - text styles\n * @param {Component} targetObj - text component\n * @returns {object} - undo data\n */\nfunction makeUndoData(styles, targetObj) {\n const undoData = {\n object: targetObj,\n styles: {},\n };\n snippet.forEachOwnProperties(styles, (value, key) => {\n const undoValue = targetObj[key];\n undoData.styles[key] = undoValue;\n });\n\n return undoData;\n}\n\nconst command = {\n name: commandNames.CHANGE_TEXT_STYLE,\n\n /**\n * Change text styles\n * @param {Graphics} graphics - Graphics instance\n * @param {number} id - object id\n * @param {Object} styles - text styles\n * @param {string} [styles.fill] Color\n * @param {string} [styles.fontFamily] Font type for text\n * @param {number} [styles.fontSize] Size\n * @param {string} [styles.fontStyle] Type of inclination (normal / italic)\n * @param {string} [styles.fontWeight] Type of thicker or thinner looking (normal / bold)\n * @param {string} [styles.textAlign] Type of text align (left / center / right)\n * @param {string} [styles.textDecoration] Type of line (underline / line-through / overline)\n * @param {boolean} isSilent - is silent execution or not\n * @returns {Promise}\n */\n execute(graphics, id, styles, isSilent) {\n const textComp = graphics.getComponent(TEXT);\n const targetObj = graphics.getObject(id);\n\n if (!targetObj) {\n return Promise.reject(rejectMessages.noObject);\n }\n if (!this.isRedo) {\n const undoData = makeUndoData(styles, targetObj);\n\n cachedUndoDataForSilent = this.setUndoData(undoData, cachedUndoDataForSilent, isSilent);\n }\n\n return textComp.setStyle(targetObj, styles);\n },\n\n /**\n * @param {Graphics} graphics - Graphics instance\n * @returns {Promise}\n */\n undo(graphics) {\n const textComp = graphics.getComponent(TEXT);\n const { object: textObj, styles } = this.undoData;\n\n return textComp.setStyle(textObj, styles);\n },\n};\n\ncommandFactory.register(command);\n\nexport default command;\n","/**\n * @author NHN. FE Development Team \n * @fileoverview Clear all objects\n */\nimport commandFactory from '@/factory/command';\nimport { Promise } from '@/util';\nimport { commandNames } from '@/consts';\n\nconst command = {\n name: commandNames.CLEAR_OBJECTS,\n\n /**\n * Clear all objects without background (main) image\n * @param {Graphics} graphics - Graphics instance\n * @returns {Promise}\n */\n execute(graphics) {\n return new Promise((resolve) => {\n this.undoData.objects = graphics.removeAll();\n resolve();\n });\n },\n\n /**\n * @param {Graphics} graphics - Graphics instance\n * @returns {Promise}\n * @ignore\n */\n undo(graphics) {\n graphics.add(this.undoData.objects);\n\n return Promise.resolve();\n },\n};\n\ncommandFactory.register(command);\n\nexport default command;\n","/**\n * @author NHN. FE Development Team \n * @fileoverview Flip an image\n */\nimport commandFactory from '@/factory/command';\nimport { componentNames, commandNames } from '@/consts';\n\nconst { FLIP } = componentNames;\n\nconst command = {\n name: commandNames.FLIP_IMAGE,\n\n /**\n * flip an image\n * @param {Graphics} graphics - Graphics instance\n * @param {string} type - 'flipX' or 'flipY' or 'reset'\n * @returns {Promise}\n */\n execute(graphics, type) {\n const flipComp = graphics.getComponent(FLIP);\n\n this.undoData.setting = flipComp.getCurrentSetting();\n\n return flipComp[type]();\n },\n\n /**\n * @param {Graphics} graphics - Graphics instance\n * @returns {Promise}\n */\n undo(graphics) {\n const flipComp = graphics.getComponent(FLIP);\n\n return flipComp.set(this.undoData.setting);\n },\n};\n\ncommandFactory.register(command);\n\nexport default command;\n","/**\n * @author NHN. FE Development Team \n * @fileoverview Load a background (main) image\n */\nimport commandFactory from '@/factory/command';\nimport { componentNames, commandNames } from '@/consts';\n\nconst { IMAGE_LOADER } = componentNames;\n\nconst command = {\n name: commandNames.LOAD_IMAGE,\n\n /**\n * Load a background (main) image\n * @param {Graphics} graphics - Graphics instance\n * @param {string} imageName - Image name\n * @param {string} imgUrl - Image Url\n * @returns {Promise}\n */\n execute(graphics, imageName, imgUrl) {\n const loader = graphics.getComponent(IMAGE_LOADER);\n const prevImage = loader.getCanvasImage();\n const prevImageWidth = prevImage ? prevImage.width : 0;\n const prevImageHeight = prevImage ? prevImage.height : 0;\n const objects = graphics.removeAll(true).filter((objectItem) => objectItem.type !== 'cropzone');\n\n objects.forEach((objectItem) => {\n objectItem.evented = true;\n });\n\n this.undoData = {\n name: loader.getImageName(),\n image: prevImage,\n objects,\n };\n\n return loader.load(imageName, imgUrl).then((newImage) => ({\n oldWidth: prevImageWidth,\n oldHeight: prevImageHeight,\n newWidth: newImage.width,\n newHeight: newImage.height,\n }));\n },\n\n /**\n * @param {Graphics} graphics - Graphics instance\n * @returns {Promise}\n */\n undo(graphics) {\n const loader = graphics.getComponent(IMAGE_LOADER);\n const { objects, name, image } = this.undoData;\n\n graphics.removeAll(true);\n graphics.add(objects);\n\n return loader.load(name, image);\n },\n};\n\ncommandFactory.register(command);\n\nexport default command;\n","/**\n * @author NHN. FE Development Team \n * @fileoverview Remove a filter from an image\n */\nimport commandFactory from '@/factory/command';\nimport { componentNames, commandNames } from '@/consts';\n\nconst { FILTER } = componentNames;\n\nconst command = {\n name: commandNames.REMOVE_FILTER,\n\n /**\n * Remove a filter from an image\n * @param {Graphics} graphics - Graphics instance\n * @param {string} type - Filter type\n * @returns {Promise}\n */\n execute(graphics, type) {\n const filterComp = graphics.getComponent(FILTER);\n\n this.undoData.options = filterComp.getOptions(type);\n\n return filterComp.remove(type);\n },\n\n /**\n * @param {Graphics} graphics - Graphics instance\n * @param {string} type - Filter type\n * @returns {Promise}\n */\n undo(graphics, type) {\n const filterComp = graphics.getComponent(FILTER);\n const { options } = this.undoData;\n\n return filterComp.add(type, options);\n },\n};\n\ncommandFactory.register(command);\n\nexport default command;\n","/**\n * @author NHN. FE Development Team \n * @fileoverview Remove an object\n */\nimport commandFactory from '@/factory/command';\nimport { Promise } from '@/util';\nimport { commandNames, rejectMessages } from '@/consts';\n\nconst command = {\n name: commandNames.REMOVE_OBJECT,\n\n /**\n * Remove an object\n * @param {Graphics} graphics - Graphics instance\n * @param {number} id - object id\n * @returns {Promise}\n */\n execute(graphics, id) {\n return new Promise((resolve, reject) => {\n this.undoData.objects = graphics.removeObjectById(id);\n if (this.undoData.objects.length) {\n resolve();\n } else {\n reject(rejectMessages.noObject);\n }\n });\n },\n\n /**\n * @param {Graphics} graphics - Graphics instance\n * @returns {Promise}\n */\n undo(graphics) {\n graphics.add(this.undoData.objects);\n\n return Promise.resolve();\n },\n};\n\ncommandFactory.register(command);\n\nexport default command;\n","/**\n * @author NHN. FE Development Team \n * @fileoverview Resize a canvas\n */\nimport commandFactory from '@/factory/command';\nimport { Promise } from '@/util';\nimport { commandNames } from '@/consts';\n\nconst command = {\n name: commandNames.RESIZE_CANVAS_DIMENSION,\n\n /**\n * resize the canvas with given dimension\n * @param {Graphics} graphics - Graphics instance\n * @param {{width: number, height: number}} dimension - Max width & height\n * @returns {Promise}\n */\n execute(graphics, dimension) {\n return new Promise((resolve) => {\n this.undoData.size = {\n width: graphics.cssMaxWidth,\n height: graphics.cssMaxHeight,\n };\n\n graphics.setCssMaxDimension(dimension);\n graphics.adjustCanvasDimension();\n resolve();\n });\n },\n\n /**\n * @param {Graphics} graphics - Graphics instance\n * @returns {Promise}\n */\n undo(graphics) {\n graphics.setCssMaxDimension(this.undoData.size);\n graphics.adjustCanvasDimension();\n\n return Promise.resolve();\n },\n};\n\ncommandFactory.register(command);\n\nexport default command;\n","/**\n * @author NHN. FE Development Team \n * @fileoverview Rotate an image\n */\nimport commandFactory from '@/factory/command';\nimport { componentNames, commandNames } from '@/consts';\n\nconst { ROTATION } = componentNames;\n\n/**\n * Cached data for undo\n * @type {Object}\n */\nlet cachedUndoDataForSilent = null;\n\n/**\n * Make undo data\n * @param {Component} rotationComp - rotation component\n * @returns {object} - undodata\n */\nfunction makeUndoData(rotationComp) {\n return {\n angle: rotationComp.getCurrentAngle(),\n };\n}\n\nconst command = {\n name: commandNames.ROTATE_IMAGE,\n\n /**\n * Rotate an image\n * @param {Graphics} graphics - Graphics instance\n * @param {string} type - 'rotate' or 'setAngle'\n * @param {number} angle - angle value (degree)\n * @param {boolean} isSilent - is silent execution or not\n * @returns {Promise}\n */\n execute(graphics, type, angle, isSilent) {\n const rotationComp = graphics.getComponent(ROTATION);\n\n if (!this.isRedo) {\n const undoData = makeUndoData(rotationComp);\n\n cachedUndoDataForSilent = this.setUndoData(undoData, cachedUndoDataForSilent, isSilent);\n }\n\n return rotationComp[type](angle);\n },\n\n /**\n * @param {Graphics} graphics - Graphics instance\n * @returns {Promise}\n */\n undo(graphics) {\n const rotationComp = graphics.getComponent(ROTATION);\n const [, type, angle] = this.args;\n\n if (type === 'setAngle') {\n return rotationComp[type](this.undoData.angle);\n }\n\n return rotationComp.rotate(-angle);\n },\n};\n\ncommandFactory.register(command);\n\nexport default command;\n","/**\n * @author NHN. FE Development Team \n * @fileoverview Set object properties\n */\nimport snippet from 'tui-code-snippet';\nimport commandFactory from '@/factory/command';\nimport { Promise } from '@/util';\nimport { commandNames, rejectMessages } from '@/consts';\n\nconst command = {\n name: commandNames.SET_OBJECT_PROPERTIES,\n\n /**\n * Set object properties\n * @param {Graphics} graphics - Graphics instance\n * @param {number} id - object id\n * @param {Object} props - properties\n * @param {string} [props.fill] Color\n * @param {string} [props.fontFamily] Font type for text\n * @param {number} [props.fontSize] Size\n * @param {string} [props.fontStyle] Type of inclination (normal / italic)\n * @param {string} [props.fontWeight] Type of thicker or thinner looking (normal / bold)\n * @param {string} [props.textAlign] Type of text align (left / center / right)\n * @param {string} [props.textDecoration] Type of line (underline / line-through / overline)\n * @returns {Promise}\n */\n execute(graphics, id, props) {\n const targetObj = graphics.getObject(id);\n\n if (!targetObj) {\n return Promise.reject(rejectMessages.noObject);\n }\n\n this.undoData.props = {};\n snippet.forEachOwnProperties(props, (value, key) => {\n this.undoData.props[key] = targetObj[key];\n });\n\n graphics.setObjectProperties(id, props);\n\n return Promise.resolve();\n },\n\n /**\n * @param {Graphics} graphics - Graphics instance\n * @param {number} id - object id\n * @returns {Promise}\n */\n undo(graphics, id) {\n const { props } = this.undoData;\n\n graphics.setObjectProperties(id, props);\n\n return Promise.resolve();\n },\n};\n\ncommandFactory.register(command);\n\nexport default command;\n","/**\n * @author NHN. FE Development Team \n * @fileoverview Set object properties\n */\nimport commandFactory from '@/factory/command';\nimport { Promise } from '@/util';\nimport { commandNames, rejectMessages } from '@/consts';\n\nconst command = {\n name: commandNames.SET_OBJECT_POSITION,\n\n /**\n * Set object properties\n * @param {Graphics} graphics - Graphics instance\n * @param {number} id - object id\n * @param {Object} posInfo - position object\n * @param {number} posInfo.x - x position\n * @param {number} posInfo.y - y position\n * @param {string} posInfo.originX - can be 'left', 'center', 'right'\n * @param {string} posInfo.originY - can be 'top', 'center', 'bottom'\n * @returns {Promise}\n */\n execute(graphics, id, posInfo) {\n const targetObj = graphics.getObject(id);\n\n if (!targetObj) {\n return Promise.reject(rejectMessages.noObject);\n }\n\n this.undoData.objectId = id;\n this.undoData.props = graphics.getObjectProperties(id, ['left', 'top']);\n\n graphics.setObjectPosition(id, posInfo);\n graphics.renderAll();\n\n return Promise.resolve();\n },\n\n /**\n * @param {Graphics} graphics - Graphics instance\n * @returns {Promise}\n */\n undo(graphics) {\n const { objectId, props } = this.undoData;\n\n graphics.setObjectProperties(objectId, props);\n graphics.renderAll();\n\n return Promise.resolve();\n },\n};\n\ncommandFactory.register(command);\n\nexport default command;\n","/**\n * @author NHN. FE Development Team \n * @fileoverview change selection\n */\nimport commandFactory from '@/factory/command';\nimport { Promise } from '@/util';\nimport { commandNames } from '@/consts';\nimport { getCachedUndoDataForDimension } from '@/helper/selectionModifyHelper';\n\nconst command = {\n name: commandNames.CHANGE_SELECTION,\n\n execute(graphics, props) {\n if (this.isRedo) {\n props.forEach((prop) => {\n graphics.setObjectProperties(prop.id, prop);\n });\n } else {\n this.undoData = getCachedUndoDataForDimension();\n }\n\n return Promise.resolve();\n },\n\n undo(graphics) {\n this.undoData.forEach((datum) => {\n graphics.setObjectProperties(datum.id, datum);\n });\n\n return Promise.resolve();\n },\n};\n\ncommandFactory.register(command);\n\nexport default command;\n"],"sourceRoot":""} \ No newline at end of file +{"version":3,"sources":["webpack://tui.ImageEditor/webpack/universalModuleDefinition","webpack://tui.ImageEditor/webpack/bootstrap","webpack://tui.ImageEditor/./src/js/consts.js","webpack://tui.ImageEditor/./src/js/util.js","webpack://tui.ImageEditor/external {\"commonjs\":\"tui-code-snippet\",\"commonjs2\":\"tui-code-snippet\",\"amd\":\"tui-code-snippet\",\"root\":[\"tui\",\"util\"]}","webpack://tui.ImageEditor/./src/js/factory/command.js","webpack://tui.ImageEditor/external {\"commonjs\":[\"fabric\",\"fabric\"],\"commonjs2\":[\"fabric\",\"fabric\"],\"amd\":\"fabric\",\"root\":\"fabric\"}","webpack://tui.ImageEditor/./node_modules/core-js-pure/internals/global.js","webpack://tui.ImageEditor/./node_modules/core-js-pure/internals/well-known-symbol.js","webpack://tui.ImageEditor/./src/js/interface/component.js","webpack://tui.ImageEditor/./node_modules/core-js-pure/internals/create-non-enumerable-property.js","webpack://tui.ImageEditor/./src/js/ui/submenuBase.js","webpack://tui.ImageEditor/./node_modules/core-js-pure/internals/fails.js","webpack://tui.ImageEditor/./node_modules/core-js-pure/internals/an-object.js","webpack://tui.ImageEditor/./node_modules/core-js-pure/internals/has.js","webpack://tui.ImageEditor/./node_modules/core-js-pure/internals/descriptors.js","webpack://tui.ImageEditor/./node_modules/core-js-pure/internals/is-object.js","webpack://tui.ImageEditor/./node_modules/core-js-pure/internals/export.js","webpack://tui.ImageEditor/./src/js/interface/drawingMode.js","webpack://tui.ImageEditor/./node_modules/core-js-pure/internals/a-function.js","webpack://tui.ImageEditor/./node_modules/core-js-pure/internals/get-built-in.js","webpack://tui.ImageEditor/./node_modules/core-js-pure/internals/iterators.js","webpack://tui.ImageEditor/./node_modules/core-js-pure/internals/object-define-property.js","webpack://tui.ImageEditor/./node_modules/core-js-pure/internals/is-pure.js","webpack://tui.ImageEditor/./node_modules/core-js-pure/internals/classof-raw.js","webpack://tui.ImageEditor/./node_modules/core-js-pure/internals/new-promise-capability.js","webpack://tui.ImageEditor/./src/js/ui/tools/colorpicker.js","webpack://tui.ImageEditor/./src/js/ui/tools/range.js","webpack://tui.ImageEditor/./node_modules/core-js-pure/internals/internal-state.js","webpack://tui.ImageEditor/./node_modules/core-js-pure/internals/create-property-descriptor.js","webpack://tui.ImageEditor/./node_modules/core-js-pure/internals/to-indexed-object.js","webpack://tui.ImageEditor/./node_modules/core-js-pure/internals/redefine.js","webpack://tui.ImageEditor/./node_modules/core-js-pure/internals/iterate.js","webpack://tui.ImageEditor/./node_modules/core-js-pure/internals/perform.js","webpack://tui.ImageEditor/./src/js/helper/selectionModifyHelper.js","webpack://tui.ImageEditor/./node_modules/core-js-pure/internals/to-integer.js","webpack://tui.ImageEditor/./node_modules/core-js-pure/internals/require-object-coercible.js","webpack://tui.ImageEditor/./node_modules/core-js-pure/internals/document-create-element.js","webpack://tui.ImageEditor/./node_modules/core-js-pure/internals/shared-key.js","webpack://tui.ImageEditor/./node_modules/core-js-pure/internals/hidden-keys.js","webpack://tui.ImageEditor/./node_modules/core-js-pure/internals/path.js","webpack://tui.ImageEditor/./node_modules/core-js-pure/internals/function-bind-context.js","webpack://tui.ImageEditor/./node_modules/core-js-pure/internals/object-get-prototype-of.js","webpack://tui.ImageEditor/./node_modules/core-js-pure/internals/set-to-string-tag.js","webpack://tui.ImageEditor/./node_modules/core-js-pure/internals/to-string-tag-support.js","webpack://tui.ImageEditor/./node_modules/core-js-pure/internals/classof.js","webpack://tui.ImageEditor/./src/js/factory/errorMessage.js","webpack://tui.ImageEditor/./node_modules/core-js-pure/internals/inspect-source.js","webpack://tui.ImageEditor/./node_modules/core-js-pure/internals/shared-store.js","webpack://tui.ImageEditor/./node_modules/core-js-pure/internals/ie8-dom-define.js","webpack://tui.ImageEditor/./node_modules/core-js-pure/internals/to-primitive.js","webpack://tui.ImageEditor/./node_modules/core-js-pure/internals/shared.js","webpack://tui.ImageEditor/./node_modules/core-js-pure/internals/uid.js","webpack://tui.ImageEditor/./node_modules/core-js-pure/internals/define-iterator.js","webpack://tui.ImageEditor/./node_modules/core-js-pure/internals/object-get-own-property-descriptor.js","webpack://tui.ImageEditor/./node_modules/core-js-pure/internals/is-forced.js","webpack://tui.ImageEditor/./node_modules/core-js-pure/internals/iterators-core.js","webpack://tui.ImageEditor/./node_modules/core-js-pure/internals/native-symbol.js","webpack://tui.ImageEditor/./node_modules/core-js-pure/internals/object-create.js","webpack://tui.ImageEditor/./node_modules/core-js-pure/internals/to-length.js","webpack://tui.ImageEditor/./node_modules/core-js-pure/internals/enum-bug-keys.js","webpack://tui.ImageEditor/./node_modules/core-js-pure/internals/html.js","webpack://tui.ImageEditor/./node_modules/core-js-pure/internals/object-set-prototype-of.js","webpack://tui.ImageEditor/./node_modules/core-js-pure/internals/native-promise-constructor.js","webpack://tui.ImageEditor/./node_modules/core-js-pure/internals/species-constructor.js","webpack://tui.ImageEditor/./node_modules/core-js-pure/internals/task.js","webpack://tui.ImageEditor/./node_modules/core-js-pure/internals/engine-is-ios.js","webpack://tui.ImageEditor/./node_modules/core-js-pure/internals/engine-user-agent.js","webpack://tui.ImageEditor/./node_modules/core-js-pure/internals/promise-resolve.js","webpack://tui.ImageEditor/./node_modules/core-js-pure/modules/es.promise.all-settled.js","webpack://tui.ImageEditor/./src/js/helper/shapeResizeHelper.js","webpack://tui.ImageEditor/./src/index.js","webpack://tui.ImageEditor/./src/js/polyfill.js","webpack://tui.ImageEditor/./src/js/imageEditor.js","webpack://tui.ImageEditor/./src/js/invoker.js","webpack://tui.ImageEditor/./src/js/interface/command.js","webpack://tui.ImageEditor/./node_modules/core-js-pure/features/promise/index.js","webpack://tui.ImageEditor/./node_modules/core-js-pure/es/promise/index.js","webpack://tui.ImageEditor/./node_modules/core-js-pure/modules/es.string.iterator.js","webpack://tui.ImageEditor/./node_modules/core-js-pure/internals/string-multibyte.js","webpack://tui.ImageEditor/./node_modules/core-js-pure/internals/native-weak-map.js","webpack://tui.ImageEditor/(webpack)/buildin/global.js","webpack://tui.ImageEditor/./node_modules/core-js-pure/internals/set-global.js","webpack://tui.ImageEditor/./node_modules/core-js-pure/internals/object-property-is-enumerable.js","webpack://tui.ImageEditor/./node_modules/core-js-pure/internals/indexed-object.js","webpack://tui.ImageEditor/./node_modules/core-js-pure/internals/create-iterator-constructor.js","webpack://tui.ImageEditor/./node_modules/core-js-pure/internals/to-object.js","webpack://tui.ImageEditor/./node_modules/core-js-pure/internals/correct-prototype-getter.js","webpack://tui.ImageEditor/./node_modules/core-js-pure/internals/use-symbol-as-uid.js","webpack://tui.ImageEditor/./node_modules/core-js-pure/internals/object-define-properties.js","webpack://tui.ImageEditor/./node_modules/core-js-pure/internals/object-keys.js","webpack://tui.ImageEditor/./node_modules/core-js-pure/internals/object-keys-internal.js","webpack://tui.ImageEditor/./node_modules/core-js-pure/internals/array-includes.js","webpack://tui.ImageEditor/./node_modules/core-js-pure/internals/to-absolute-index.js","webpack://tui.ImageEditor/./node_modules/core-js-pure/internals/object-to-string.js","webpack://tui.ImageEditor/./node_modules/core-js-pure/internals/a-possible-prototype.js","webpack://tui.ImageEditor/./node_modules/core-js-pure/modules/web.dom-collections.iterator.js","webpack://tui.ImageEditor/./node_modules/core-js-pure/modules/es.array.iterator.js","webpack://tui.ImageEditor/./node_modules/core-js-pure/internals/add-to-unscopables.js","webpack://tui.ImageEditor/./node_modules/core-js-pure/internals/dom-iterables.js","webpack://tui.ImageEditor/./node_modules/core-js-pure/modules/es.promise.js","webpack://tui.ImageEditor/./node_modules/core-js-pure/internals/redefine-all.js","webpack://tui.ImageEditor/./node_modules/core-js-pure/internals/set-species.js","webpack://tui.ImageEditor/./node_modules/core-js-pure/internals/an-instance.js","webpack://tui.ImageEditor/./node_modules/core-js-pure/internals/is-array-iterator-method.js","webpack://tui.ImageEditor/./node_modules/core-js-pure/internals/get-iterator-method.js","webpack://tui.ImageEditor/./node_modules/core-js-pure/internals/call-with-safe-iteration-closing.js","webpack://tui.ImageEditor/./node_modules/core-js-pure/internals/check-correctness-of-iteration.js","webpack://tui.ImageEditor/./node_modules/core-js-pure/internals/microtask.js","webpack://tui.ImageEditor/./node_modules/core-js-pure/internals/host-report-errors.js","webpack://tui.ImageEditor/./node_modules/core-js-pure/internals/engine-v8-version.js","webpack://tui.ImageEditor/./node_modules/core-js-pure/modules/es.promise.finally.js","webpack://tui.ImageEditor/./node_modules/core-js-pure/modules/esnext.aggregate-error.js","webpack://tui.ImageEditor/./node_modules/core-js-pure/modules/esnext.promise.all-settled.js","webpack://tui.ImageEditor/./node_modules/core-js-pure/modules/esnext.promise.try.js","webpack://tui.ImageEditor/./node_modules/core-js-pure/modules/esnext.promise.any.js","webpack://tui.ImageEditor/./src/js/ui.js","webpack://tui.ImageEditor/./src/js/ui/template/mainContainer.js","webpack://tui.ImageEditor/./src/js/ui/template/controls.js","webpack://tui.ImageEditor/./src/js/ui/theme/theme.js","webpack://tui.ImageEditor/./src/js/ui/template/style.js","webpack://tui.ImageEditor/./src/js/ui/theme/standard.js","webpack://tui.ImageEditor/./src/svg/default.svg","webpack://tui.ImageEditor/./src/js/ui/shape.js","webpack://tui.ImageEditor/external {\"commonjs\":\"tui-color-picker\",\"commonjs2\":\"tui-color-picker\",\"amd\":\"tui-color-picker\",\"root\":[\"tui\",\"colorPicker\"]}","webpack://tui.ImageEditor/./src/js/ui/template/submenu/shape.js","webpack://tui.ImageEditor/./src/js/ui/crop.js","webpack://tui.ImageEditor/./src/js/ui/template/submenu/crop.js","webpack://tui.ImageEditor/./src/js/ui/flip.js","webpack://tui.ImageEditor/./src/js/ui/template/submenu/flip.js","webpack://tui.ImageEditor/./src/js/ui/rotate.js","webpack://tui.ImageEditor/./src/js/ui/template/submenu/rotate.js","webpack://tui.ImageEditor/./src/js/ui/text.js","webpack://tui.ImageEditor/./src/js/ui/template/submenu/text.js","webpack://tui.ImageEditor/./src/js/ui/mask.js","webpack://tui.ImageEditor/./src/js/ui/template/submenu/mask.js","webpack://tui.ImageEditor/./src/js/ui/icon.js","webpack://tui.ImageEditor/./src/js/ui/template/submenu/icon.js","webpack://tui.ImageEditor/./src/js/ui/draw.js","webpack://tui.ImageEditor/./src/js/ui/template/submenu/draw.js","webpack://tui.ImageEditor/./src/js/ui/filter.js","webpack://tui.ImageEditor/./src/js/ui/template/submenu/filter.js","webpack://tui.ImageEditor/./src/js/ui/history.js","webpack://tui.ImageEditor/./src/js/ui/panelMenu.js","webpack://tui.ImageEditor/./src/js/ui/template/submenu/history.js","webpack://tui.ImageEditor/./src/js/ui/locale/locale.js","webpack://tui.ImageEditor/./src/js/action.js","webpack://tui.ImageEditor/./src/js/helper/imagetracer.js","webpack://tui.ImageEditor/./src/js/graphics.js","webpack://tui.ImageEditor/./src/js/component/imageLoader.js","webpack://tui.ImageEditor/./src/js/component/cropper.js","webpack://tui.ImageEditor/./src/js/extension/cropzone.js","webpack://tui.ImageEditor/./src/js/component/flip.js","webpack://tui.ImageEditor/./src/js/component/rotation.js","webpack://tui.ImageEditor/./src/js/component/freeDrawing.js","webpack://tui.ImageEditor/./src/js/component/line.js","webpack://tui.ImageEditor/./src/js/extension/arrowLine.js","webpack://tui.ImageEditor/./src/js/component/text.js","webpack://tui.ImageEditor/./src/js/component/icon.js","webpack://tui.ImageEditor/./src/js/component/filter.js","webpack://tui.ImageEditor/./src/js/extension/mask.js","webpack://tui.ImageEditor/./src/js/extension/sharpen.js","webpack://tui.ImageEditor/./src/js/extension/emboss.js","webpack://tui.ImageEditor/./src/js/extension/colorFilter.js","webpack://tui.ImageEditor/./src/js/component/shape.js","webpack://tui.ImageEditor/./src/js/helper/shapeFilterFillHelper.js","webpack://tui.ImageEditor/./src/js/component/zoom.js","webpack://tui.ImageEditor/./src/js/drawingMode/cropper.js","webpack://tui.ImageEditor/./src/js/drawingMode/freeDrawing.js","webpack://tui.ImageEditor/./src/js/drawingMode/lineDrawing.js","webpack://tui.ImageEditor/./src/js/drawingMode/shape.js","webpack://tui.ImageEditor/./src/js/drawingMode/text.js","webpack://tui.ImageEditor/./src/js/drawingMode/icon.js","webpack://tui.ImageEditor/./src/js/drawingMode/zoom.js","webpack://tui.ImageEditor/./src/js/command/addIcon.js","webpack://tui.ImageEditor/./src/js/command/addImageObject.js","webpack://tui.ImageEditor/./src/js/command/addObject.js","webpack://tui.ImageEditor/./src/js/command/addShape.js","webpack://tui.ImageEditor/./src/js/command/addText.js","webpack://tui.ImageEditor/./src/js/command/applyFilter.js","webpack://tui.ImageEditor/./src/js/command/changeIconColor.js","webpack://tui.ImageEditor/./src/js/command/changeShape.js","webpack://tui.ImageEditor/./src/js/command/changeText.js","webpack://tui.ImageEditor/./src/js/command/changeTextStyle.js","webpack://tui.ImageEditor/./src/js/command/clearObjects.js","webpack://tui.ImageEditor/./src/js/command/flip.js","webpack://tui.ImageEditor/./src/js/command/loadImage.js","webpack://tui.ImageEditor/./src/js/command/removeFilter.js","webpack://tui.ImageEditor/./src/js/command/removeObject.js","webpack://tui.ImageEditor/./src/js/command/resizeCanvasDimension.js","webpack://tui.ImageEditor/./src/js/command/rotate.js","webpack://tui.ImageEditor/./src/js/command/setObjectProperties.js","webpack://tui.ImageEditor/./src/js/command/setObjectPosition.js","webpack://tui.ImageEditor/./src/js/command/changeSelection.js"],"names":["root","factory","exports","module","require","define","amd","window","__WEBPACK_EXTERNAL_MODULE__2__","__WEBPACK_EXTERNAL_MODULE__4__","__WEBPACK_EXTERNAL_MODULE__123__","installedModules","__webpack_require__","m","ZOOM_HELP_MENUS","COMMAND_HELP_MENUS","DELETE_HELP_MENUS","HELP_MENUS","SHAPE_FILL_TYPE","FILTER","COLOR","SHAPE_TYPE","OBJ_TYPE","CROPZONE","filterType","VINTAGE","SEPIA2","REMOVE_COLOR","COLOR_FILTER","REMOVE_WHITE","BLEND_COLOR","BLEND","componentNames","keyMirror","SHAPE_DEFAULT_OPTIONS","lockSkewingX","lockSkewingY","bringForward","isRegular","CROPZONE_DEFAULT_OPTIONS","hasRotatingPoint","hasBorders","lockScalingFlip","lockRotation","commandNames","CLEAR_OBJECTS","LOAD_IMAGE","FLIP_IMAGE","ROTATE_IMAGE","ADD_OBJECT","REMOVE_OBJECT","APPLY_FILTER","REMOVE_FILTER","ADD_ICON","CHANGE_ICON_COLOR","ADD_SHAPE","CHANGE_SHAPE","ADD_TEXT","CHANGE_TEXT","CHANGE_TEXT_STYLE","ADD_IMAGE_OBJECT","RESIZE_CANVAS_DIMENSION","SET_OBJECT_PROPERTIES","SET_OBJECT_POSITION","CHANGE_SELECTION","eventNames","OBJECT_ACTIVATED","OBJECT_MOVED","OBJECT_SCALED","OBJECT_CREATED","OBJECT_ROTATED","OBJECT_ADDED","OBJECT_MODIFIED","TEXT_EDITING","TEXT_CHANGED","ICON_CREATE_RESIZE","ICON_CREATE_END","ADD_OBJECT_AFTER","MOUSE_DOWN","MOUSE_UP","MOUSE_MOVE","REDO_STACK_CHANGED","UNDO_STACK_CHANGED","SELECTION_CLEARED","SELECTION_CREATED","EXECUTE_COMMAND","AFTER_UNDO","AFTER_REDO","ZOOM_CHANGED","HAND_STARTED","HAND_STOPPED","KEY_DOWN","KEY_UP","historyNames","LOAD_MASK_IMAGE","ADD_MASK_IMAGE","CROP","drawingModes","drawingMenuNames","TEXT","SHAPE","ZOOM","zoomModes","DEFAULT","HAND","keyCodes","Z","Y","C","V","SHIFT","BACKSPACE","DEL","ARROW_DOWN","ARROW_UP","SPACE","fObjectOptions","SELECTION_STYLE","borderColor","cornerColor","cornerSize","originX","originY","transparentCorners","rejectMessages","addedObject","flip","invalidDrawingMode","invalidParameters","isLock","loadImage","loadingImageFailed","noActiveObject","noObject","redo","rotation","undo","unsupportedOperation","unsupportedType","defaultIconPath","defaultRotateRangeValues","realTimeEvent","min","max","value","defaultDrawRangeValues","defaultShapeStrokeValues","defaultTextRangeValues","defaultFilterRangeValues","tintOpacityRange","useDecimal","removewhiteDistanceRange","brightnessRange","noiseRange","pixelateRange","colorfilterThresholdRange","blurFilterRange","emptyCropRectValues","LEFT","TOP","WIDTH","HEIGHT","clamp","minValue","maxValue","obj","args","forEach","key","makeStyleText","styleObj","styleStr","prop","getProperties","keys","props","length","i","toInteger","parseInt","toCamelCase","targetString","replace","$0","$1","toUpperCase","isSupportFileApi","File","FileList","FileReader","getRgb","color","alpha","slice","r","g","b","sendHostName","hostnameSent","sendHostname","styleLoad","styleBuffer","tagId","head","document","getElementsByTagName","linkElement","createElement","styleData","encodeURIComponent","id","setAttribute","appendChild","getSelector","targetElement","str","querySelector","base64ToBlob","data","mimeString","raw","uInt8Array","header","imageType","rawLength","atob","Uint8Array","charCodeAt","Blob","type","fixFloatingPoint","Number","toFixed","FLOATING_POINT_DIGIT","assignmentForDestroy","targetObject","cls","prefix","charAt","CSS_PREFIX","changeOrigin","fObject","origin","getPointByOrigin","left","x","top","y","set","setCoords","flipObject","result","Object","setCustomProperty","customProps","extend","getCustomProperty","propNames","resultObject","isString","propName","capitalizeString","includes","getFillTypeFromOption","fillOption","pick","getFillTypeFromObject","shapeObj","fill","source","isShape","inArray","get","getObjectType","toStartOfCapital","isSilentCommand","command","name","getHistoryTitle","historyInfo","detail","useAlpha","mode","filterName","getFilterType","getHelpMenuBarPosition","position","isEmptyCropzone","cropRect","width","height","Math","targetArray","compareValue","indexOf","first","Promise","commands","create","actions","Command","register","it","check","globalThis","self","global","Function","shared","has","uid","NATIVE_SYMBOL","USE_SYMBOL_AS_UID","WellKnownSymbolsStore","Symbol","createWellKnownSymbol","withoutSetter","Component","context","this","graphics","fire","apply","oImage","setCanvasImage","getCanvasElement","getCanvas","getCanvasImage","getImageName","getEditor","setting","withRendering","setImageProperties","dimension","setCanvasCssDimension","setCanvasBackstoreDimension","adjustCanvasDimension","DESCRIPTORS","definePropertyModule","createPropertyDescriptor","object","f","Submenu","selectName","subMenuElement","occurredControl","colorPickerControls","pickerControl","hide","button","buttonNames","className","match","RegExp","join","target","removeClass","addClass","classList","remove","add","locale","iconStyle","makeSvgIcon","templateHtml","iconSubMenu","innerHTML","menuBarPosition","usageStatistics","toggleDirection","eventHandler","_makeSubMenuElement","exec","error","isObject","TypeError","String","hasOwnProperty","call","fails","defineProperty","wrapConstructor","NativeConstructor","Wrapper","a","c","arguments","prototype","getOwnPropertyDescriptor","isForced","path","bind","createNonEnumerableProperty","options","USE_NATIVE","VIRTUAL_PROTOTYPE","sourceProperty","targetProperty","nativeProperty","resultProperty","descriptor","TARGET","GLOBAL","STATIC","stat","PROTO","proto","nativeSource","targetPrototype","forced","noTargetGet","wrap","sham","real","createMessage","errorMessage","errorTypes","types","DrawingMode","Error","UN_IMPLEMENTATION","aFunction","variable","undefined","namespace","method","IE8_DOM_DEFINE","anObject","toPrimitive","nativeDefineProperty","O","P","Attributes","toString","PromiseCapability","resolve","reject","promise","$$resolve","$$reject","PICKER_COLOR","Colorpicker","_removeEvent","picker","destroy","colorpickerElement","snippet","colorElement","style","backgroundColor","defaultColor","title","label","triangle","pickerElement","on","_changeColorElement","_color","pickerToggle","_pickerToggleEventHandler","pickerHide","addEventListener","body","removeEventListener","off","event","isInPickerControl","_isElementInColorPickerControl","_isPaletteButton","_show","display","_setPickerControlPosition","stopPropagation","element","parentNode","controlStyle","halfPickerWidth","_colorpickerElement","clientWidth","offsetWidth","offsetHeight","_toggleDirection","_makePickerButtonElement","_makePickerLayerElement","getAttribute","tuiColorPicker","container","preset","_addEvent","CustomEvents","mixin","INPUT_FILTER_REGEXP","Range","_removeClickEvent","_removeDragEvent","_removeInputEvent","rangeElement","_value","getElementWidth","getComputedStyle","pointer","bar","subbar","rangeInputElement","changeInputWithArrow","changeInput","changeInputFinally","keyCode","_valueUpDownForKeyEvent","_min","_max","clampValue","step","_useDecimal","isLast","stringValue","_filterForInputText","waitForChange","isNaN","changeSlideFinally","startChangingSlide","diffPosition","screenX","firstPosition","touchPx","firstLeft","rangeWidth","right","ratio","resultValue","_absMax","offsetX","changeSlide","stopChangingSlide","inputValue","leftPosition","rangeElements","slider","input","_drawRangeElement","_getRangeWidth","_startChangingSlide","_stopChangingSlide","_changeSlide","_changeSlideFinally","_changeValueWithInput","_changeValueWithInputKeyEvent","_addClickEvent","_addDragEvent","_addInputEvent","trigger","NATIVE_WEAK_MAP","objectHas","sharedKey","hiddenKeys","WeakMap","store","wmget","wmhas","wmset","metadata","STATE","enforce","getterFor","TYPE","state","bitmap","enumerable","configurable","writable","IndexedObject","requireObjectCoercible","Result","stopped","isArrayIteratorMethod","toLength","getIteratorMethod","callWithSafeIterationClosing","iterable","fn","that","AS_ENTRIES","IS_ITERATOR","iterator","iterFn","index","next","boundFunction","done","stop","setCachedUndoDataForDimension","undoData","cachedUndoDataForChangeDimension","getCachedUndoDataForDimension","makeSelectionUndoData","undoDatumMaker","getObjects","map","item","angle","scaleX","scaleY","realizeTransform","makeSelectionUndoDatum","isSelection","ceil","floor","argument","EXISTS","toObject","CORRECT_PROTOTYPE_GETTER","IE_PROTO","ObjectPrototype","getPrototypeOf","constructor","TO_STRING_TAG_SUPPORT","TO_STRING_TAG","wellKnownSymbol","TAG","SET_METHOD","test","classofRaw","CORRECT_ARGUMENTS","tag","tryGet","callee","messages","methodName","NO_COMPONENT_NAME","toLowerCase","func","functionToString","inspectSource","setGlobal","SHARED","PREFERRED_STRING","val","valueOf","IS_PURE","push","version","copyright","postfix","random","returnThis","$","createIteratorConstructor","setPrototypeOf","setToStringTag","redefine","Iterators","IteratorsCore","IteratorPrototype","BUGGY_SAFARI_ITERATORS","ITERATOR","VALUES","ENTRIES","Iterable","NAME","IteratorConstructor","IS_SET","FORCED","getIterationMethod","KIND","defaultIterator","IterablePrototype","CurrentIteratorPrototype","methods","KEY","INCORRECT_VALUES_NAME","nativeIterator","anyNativeIterator","entries","values","propertyIsEnumerableModule","toIndexedObject","nativeGetOwnPropertyDescriptor","feature","detection","normalize","POLYFILL","NATIVE","replacement","string","PrototypeOfArrayIteratorPrototype","arrayIterator","getOwnPropertySymbols","EmptyConstructor","scriptTag","content","LT","SCRIPT","activeXDocument","defineProperties","enumBugKeys","html","documentCreateElement","PROTOTYPE","NullProtoObject","domain","ActiveXObject","iframeDocument","iframe","write","close","temp","parentWindow","NullProtoObjectViaActiveX","src","contentWindow","open","F","Properties","getBuiltIn","aPossiblePrototype","setter","CORRECT_SETTER","Array","__proto__","SPECIES","defaultConstructor","S","run","queue","runner","listener","post","postMessage","location","protocol","host","defer","channel","port","classof","IS_IOS","setImmediate","clear","clearImmediate","process","MessageChannel","Dispatch","counter","ONREADYSTATECHANGE","nextTick","now","port2","port1","onmessage","importScripts","removeChild","setTimeout","userAgent","newPromiseCapability","promiseCapability","newPromiseCapabilityModule","perform","iterate","allSettled","capability","promiseResolve","remaining","alreadyCalled","then","status","e","reason","DIVISOR","rect","circle","DIMENSION_KEYS","w","h","getPositionsOfRotatedOrigin","sx","sy","px","py","PI","cos","sin","setOrigins","shape","leftTopPoint","rightTopPoint","rightBottomPoint","leftBottomPoint","origins","lt","rt","rb","lb","resize","isScaling","originKey","centerPoint","originPositions","strokeWidth","divisor","dimensionKeys","isTriangle","substring","startPoint","maxScale","hasControls","adjustDimensionOnScaling","abs","sqrt","setPositionByOrigin","adjustOriginToCenter","ImageEditor","Element","matches","msMatchesSelector","webkitMatchesSelector","closest","s","el","documentElement","contains","parentElement","nodeType","createElementNS","view","classListProp","protoProp","elemCtrProto","objCtr","strTrim","trim","arrIndexOf","len","DOMEx","message","code","DOMException","checkTokenAndGetIndex","token","ClassList","elem","trimmedClasses","classes","split","_updateClassName","classListProto","classListGetter","tokens","l","updated","splice","toggle","force","classListPropDesc","ex","number","__defineGetter__","testElement","createMethod","original","DOMTokenList","_toggle","checkUseElems","tid","winLoad","cache","debouncedCheck","clearTimeout","unobserveChanges","xlinkNS","base","bcr","hash","href","isHidden","url","uses","xhr","Request","origin2","inProgressCount","observeIfDone","observer","MutationObserver","observe","childList","subtree","attributes","disconnect","ignore","attrUpdateFunc","spec","useEl","setAttributeNS","hasAttribute","onloadFunc","svg","onload","responseText","overflow","insertBefore","firstChild","onErrorTimeout","onerror","ontimeout","getBoundingClientRect","getAttributeNS","bottom","XMLHttpRequest","getOrigin","withCredentials","XDomainRequest","send","abort","loc","readyState","isUndefined","events","selectionStyle","applyCropSelectionStyle","applyGroupSelectionStyle","_graphics","setSelectionStyle","setCropSelectionStyle","eventTarget","_invoker","ui","canvas","_handlers","mousedown","objectMoved","objectScaled","objectRotated","objectActivated","objectAdded","objectModified","addText","addObject","textEditing","textChanged","iconCreateResize","iconCreateEnd","selectionCleared","selectionCreated","keydown","ctrlKey","metaKey","resetTargetObjectForCopyPaste","pasteObject","clearRedoStack","isDeleteKey","isReadyRemoveObject","preventDefault","removeActiveObject","activeObjectId","getActiveObjectIdForRemove","removeObject","originPointer","commandFactory","pushUndoStack","getObjectId","execute","getDrawingMode","deactivateAll","renderAll","discardSelection","selectable","changeSelectableAll","initHistory","clearHistory","commandName","theArgs","concat","executeSilent","iterationCount","zoomLevel","zoom","resetZoom","imgFile","imageName","imgUrl","URL","createObjectURL","loadImageFromURL","revokeObjectURL","option","startDrawingMode","stopDrawingMode","getCroppedImageData","getCropzoneRect","setCropzoneRect","_flip","isSilent","_rotate","setBrush","setDrawingShape","iconColor","setIconStyle","_setPositions","text","originPosition","clientPosition","objectProps","getObject","_pushAddObjectCommand","_pushModifyObjectCommand","infos","registerPaths","cursorType","changeCursor","hasFilter","toDataURL","clearUndoStack","isEmptyUndoStack","isEmptyRedoStack","_detachDomEvents","centerPosition","getCenter","keyValue","setObjectProperties","getObjectProperties","getCanvasSize","getObjectPosition","posInfo","wrapper","includeUI","UIOption","UI","getActions","setUiDefaultSelectionStyle","Invoker","Graphics","getEditorArea","cssMaxWidth","cssMaxHeight","_onKeyDown","_onMouseDown","_onObjectActivated","_onObjectMoved","_onObjectScaled","_onObjectRotated","_onObjectAdded","_onObjectModified","createdPath","_onCreatedPath","_onAddText","_onAddObject","_onTextEditing","_onTextChanged","_onIconCreateResize","_onIconCreateEnd","_selectionCleared","_selectionCreated","_attachInvokerEvents","_attachGraphicsEvents","_attachDomEvents","_setSelectionStyle","initCanvas","setReAction","fabric","enableGLFiltering","action","isFunction","isRedo","lock","_isSilent","unlock","executeCallback","pushRedoStack","undoCallback","_redoStack","_undoStack","_isLocked","_invokeExecution","pop","_fireUndoStackChanged","_invokeUndo","_fireRedoStackChanged","cachedUndoDataForSilent","callback","parent","InternalStateModule","defineIterator","STRING_ITERATOR","setInternalState","getInternalState","iterated","point","CONVERT_TO_STRING","$this","pos","second","size","codeAt","nativePropertyIsEnumerable","propertyIsEnumerable","NASHORN_BUG","1","objectKeys","internalObjectKeys","names","IS_INCLUDES","fromIndex","toAbsoluteIndex","integer","DOMIterables","COLLECTION_NAME","Collection","CollectionPrototype","addToUnscopables","ARRAY_ITERATOR","kind","Arguments","CSSRuleList","CSSStyleDeclaration","CSSValueList","ClientRectList","DOMRectList","DOMStringList","DataTransferItemList","HTMLAllCollection","HTMLCollection","HTMLFormElement","HTMLSelectElement","MediaList","MimeTypeArray","NamedNodeMap","NodeList","PaintRequestList","Plugin","PluginArray","SVGLengthList","SVGNumberList","SVGPathSegList","SVGPointList","SVGStringList","SVGTransformList","SourceBufferList","StyleSheetList","TextTrackCueList","TextTrackList","TouchList","isThenable","notify","isReject","notified","chain","reactions","microtask","ok","exited","reaction","handler","fail","rejection","onHandleUnhandled","enter","exit","onUnhandled","dispatchEvent","DISPATCH_EVENT","createEvent","initEvent","UNHANDLED_REJECTION","hostReportErrors","unwrap","internalReject","Internal","OwnPromiseCapability","PromiseWrapper","nativeThen","NativePromise","redefineAll","setSpecies","anInstance","checkCorrectnessOfIteration","speciesConstructor","task","V8_VERSION","PROMISE","getInternalPromiseState","PromiseConstructor","$fetch","newGenericPromiseCapability","IS_NODE","PromiseRejectionEvent","FakePromise","INCORRECT_ITERATION","all","isUnhandled","emit","internalResolve","executor","onFulfilled","onRejected","unsafe","fetch","$promiseResolve","race","CONSTRUCTOR_NAME","Constructor","ArrayPrototype","returnMethod","SAFE_CLOSING","called","iteratorWithReturn","from","SKIP_CLOSING","ITERATION_SUPPORT","flush","last","node","macrotask","WebKitMutationObserver","queueMicrotaskDescriptor","queueMicrotask","createTextNode","characterData","console","versions","v8","onFinally","getInternalAggregateErrorState","$AggregateError","errors","errorsArray","AggregateError","callbackfn","PROMISE_ANY_ERROR","any","alreadyResolved","alreadyRejected","SUB_UI_COMPONENT","Shape","Crop","Flip","Rotate","Text","Mask","Icon","Draw","Filter","HISTORY_MENU","CLASS_NAME_ON","ZOOM_BUTTON_TYPE","Ui","_removeUiEvent","_destroyAllMenu","_selectedElement","cornerStyle","cornerStrokeColor","lineWidth","uiSize","imageSize","_setUiSize","_getCanvasMaxDimension","editorElementStyle","_editorElement","_setEditorPosition","_editorElementWrap","selectElementClassList","_buttonElements","enabled","buttonType","enableStatus","menuIconPath","menu","initMenu","elementDimension","menuName","SubComponentClass","_makeMenuElement","_menuBarElement","_subMenuElement","_locale","theme","makeMenSvgIconSet","_addHistory","_selectPrevHistory","_selectNextHistory","offZoomInButtonStatus","changeHandButtonStatus","selectedElement","selector","biImage","getStyle","loadButtonStyle","downloadButtonStyle","commonStyle","headerStyle","submenuStyle","_mainElement","_helpMenuBarElement","download","querySelectorAll","load","_addHelpMenus","_historyMenu","History","_activateZoomMenus","changeHelpButtonEnabled","helpMenuWithPartition","_makeHelpMenuWithPartition","_makeMenuPartitionElement","partitionElement","partitionInnerElement","useIconTypes","menuType","btnElement","menuItemHtml","_addTooltipAttribute","helpName","_actions","main","historyTitle","init","prev","tooltipName","localize","files","changeMenu","addEvent","_addMainMenuEvent","_addSubMenuEvent","_initMenuEvent","_addHelpActionEvent","_addDownloadEvent","_addMenuEvent","_initMenu","history","_removeHelpActionEvent","_removeDownloadEvent","_removeLoadEvent","_removeMainMenuEvent","removeEvent","loadImageInfo","_getLoadImage","initLoadImage","activeMenuEvent","_addLoadEvent","gridVisual","grid","_editorContainerElement","_submenuChangeTransection","_changeMenu","submenu","changeStandbyMode","changeStartMode","resizeEditor","evt","icon","registerDefaultIcon","maxWidth","maxHeight","parseFloat","scrollHeight","scrollWidth","_initializeOption","Locale","Theme","_makeUiElement","_makeSubMenu","_attachHistoryEvent","_attachZoomEvent","firstProperty","styles","image","active","normal","hover","disabled","_makeCssText","vertical","borderLeft","horizontal","borderBottom","submenuLabelStyle","submenuPartitionStyle","subMenuLabelActive","subMenuLabelNormal","submenuPartitionVertical","submenuPartitionHorizontal","biSize","subMenuRangeTitle","submenuRangePointer","submenuRangeBar","submenuRangeSubbar","submenuDisabledRangePointer","submenuDisabledRangeBar","submenuDisabledRangeSubbar","submenuRangeValue","submenuColorpickerTitle","submenuColorpickerButton","submenuCheckbox","menuIconSize","submenuIconSize","menuIconStyle","submenuIconStyle","styleOptions","styleObject","keyExplode","property","subProperty","converterStack","_toUnderScore","getElementById","dom","DOMParser","parseFromString","iconType","isSubmenu","_makeSvgIconPrefix","_makeIconClassName","_makeSvgItem","customTheme","_changeToObject","standardTheme","_styleMaker","_loadDefaultSvgIcon","SHAPE_DEFAULT_OPTION","stroke","_els","strokeRange","fillColorpicker","strokeColorpicker","shapeTypeSelected","_changeShapeHandler","shapeSelectButton","_changeStrokeRangeHandler","_changeFillColorHandler","_changeStrokeColorHandler","colorPickerChangeShow","strokeColor","fillColor","strokeMaxValue","shapeType","getButtonType","currentTarget","modeChange","changeShape","shapeColorButton","_applyEventHandler","cancel","_cancelEventHandler","cropzonePreset","_cropzonePresetEventHandler","crop","presetType","_setPresetButtonActive","defaultPresetButton","presetButton","changeFlip","_changeFlip","flipButton","flipType","flipStatus","flipClassList","rotateRange","resultAngle","_setRangeBarRatio","rotationAngleChanged","_changeRotateForButton","rotateButton","_changeRotateForRange","setAngle","rotateAngle","clockwise","counterclockwise","newAngle","rotate","textColorpicker","textRange","setTextEffect","_setTextEffectHandler","setTextAlign","_setTextAlignHandler","textEffectButton","textAlignButton","_changeTextRnageHandler","_changeColorHandler","textStyle","fontSize","fontStyle","fontWeight","textDecoration","textAlign","textColor","setEffectState","setAlignState","effectName","effectValue","effect","align","styleType","bold","italic","underline","changeTextStyle","loadMaskFile","_loadMaskFile","applyMask","_applyMask","maskImageButton","applyButton","applyFilter","alert","file","iconColorpicker","registerIcon","_registerIconHandler","addIcon","_addIconHandler","registerIconButton","addIconButton","registerDefaultIcons","clearIconType","cancelAddIcon","changeColor","registerCustomIcon","_iconMap","drawColorPicker","drawRange","changeDrawType","_changeDrawType","lineSelectButton","_changeDrawColor","_changeDrawRange","setDrawMode","lineType","BLEND_OPTIONS","FILTER_OPTIONS","filterNameMap","grayscale","invert","sepia","blur","sharpen","emboss","removeWhite","brightness","contrast","saturation","vintage","polaroid","noise","pixelate","colorFilter","tint","multiply","blend","hue","gamma","RANGE_INSTANCE_NAMES","COLORPICKER_INSTANCE_NAMES","_destroyToolInstance","filter","filterCheckElement","filterNameCamelCase","instanceName","blendType","changeBlendFilter","changeFilterState","_changeFilterState","changeFilterStateForRange","blandTypeClick","checkedMap","filterBlendColor","filterMultiplyColor","filterTintColor","tintOpacity","changedFilterInfos","_getFilterNameFromOptions","isRemove","_setFilterState","checked","distance","blocksize","isExisty","checkboxGroup","_getFilterOption","blurRange","FILTER_RANGE","_pickerWithRange","_pickerWithSelectbox","rangeWrap","rangeLabel","selectlistWrap","selectlist","optionlist","_makeSelectOptionList","_drawSelectOptionList","_pickerWithSelectboxForAddEvent","optionElement","optionValue","fireEvent","selected","selectBoxShow","selectOption","_makeControlElement","selectedClassName","disabledClassName","Panel","_hasDisabledItem","deleteListItemElement","_historyIndex","getListLength","makeListItemElement","pushListItemElement","_selectItem","_eventHandler","_clickHistoryItem","listElement","count","_addHistoryEventListener","_removeHistoryEventListener","menuElement","panel","list","listItem","items","scrollTop","start","end","panelElement","_makePanelElement","_makeListElement","_mainAction","_shapeAction","_cropAction","_flipAction","_rotateAction","_textAction","mask","_maskAction","draw","_drawAction","_iconAction","_filterAction","_historyAction","exitCropOnAction","onEndUndoRedo","filterOptions","setRangeBarAngle","setFilterState","imagePath","sizeValue","initializeImgUrl","reset","_initHistory","delete","deleteAll","clearObjects","loadImageFromFile","_clearHistory","dataURL","blob","saveAs","toggleHistoryMenu","zoomIn","zoomMode","toggleZoomButtonStatus","getZoomMode","startZoomInMode","endZoomInMode","zoomOut","hand","startHandMode","endHandMode","_commonAction","changeIconColor","setDrawingIcon","iconObj","registerIcons","Imagetracer","imageToSVG","svgstr","svgPath","tracerDefaultOption","settings","setColor","addImageObject","maskObjId","changeShapeObject","changeApplyButtonStatus","applying","removeFilter","undoStackChanged","redoStackChanged","setShapeStatus","setMaxStrokeValue","setTextStyleStateOnAction","setIconPickerColor","fontFamily","addObjectAfter","strokeValue","getStrokeValue","setStrokeValue","CROPPER","_changeActivateMode","ImageTracer","pathomit","ltres","qtres","scale","strokewidth","viewbox","linefilter","desc","rightangleenhance","pal","checkoptions","imagedataToSVG","getImgdata","imgd","td","imagedataToTracedata","getsvgstring","ii","colorquantization","tracedata","layering","layers","palette","array","colornum","tracedlayer","batchtracepaths","internodes","pathscan","layeringstep","ls","layercontainerid","drawLayers","specpalette","bps","batchpathscan","bis","batchinternodes","batchtracelayers","optionpresets","k","arr","idx","cd","cdl","ci","paletteacc","pixelnum","j","cnt","colorsampling","generatepalette","numberofcolors","samplepalette","samplepalette2","blurradius","blurdelta","colorquantcycles","n","mincolorratio","ni","nj","vx","vy","rcnt","gcnt","bcnt","graystep","colorqnum","pow","colorstep","rndnum","ah","aw","n1","n2","n3","n4","n5","n6","n7","n8","cnum","layer","paths","pacnt","pcnt","dir","pathfinished","holepath","lookuprow","points","boundingbox","holechildren","t","pathscan_combined_lookup","isholepath","parentidx","parentbbox","parentcnt","boundingboxincludes","childbbox","bpaths","ins","palen","nextidx","nextidx2","previdx","previdx2","testrightangle","linesegment","getdirection","idx1","idx2","idx3","idx4","idx5","x1","y1","x2","y2","binternodes","segtype1","segtype2","seqend","smp","segments","fitseq","seqstart","errorpoint","errorval","curvepass","dist2","tl","pl","fitpoint","t1","t2","t3","cpx","cpy","x3","y3","splitpoint","internodepaths","btracedpaths","tracepath","btbis","places","lnum","pathnum","tosvgcolorstr","roundcoords","roundtodec","hcnt","hsmp","lcpr","qcpr","versionnumber","lcnt","svgpathstring","parentid","div","radius","delta","racc","gacc","bacc","aacc","wacc","imgd2","thisgk","gks","himgd","Uint8ClampedArray","img","Image","corsenabled","crossOrigin","getContext","drawImage","getImageData","fillStyle","torgbastr","fillRect","default","posterized1","posterized2","curvy","sharp","detailed","smoothed","fixedpalette","randomsampling1","randomsampling2","artistic1","artistic2","artistic3","artistic4","posterized3","stamp","isArray","forEachArray","forEachOwnProperties","cssOnly","backstoreOnly","wrapperEl","_canvas","discardActiveObject","objects","_objects","includesBackground","isType","isEmpty","forEachObject","_activeObject","activeObject","getActiveObject","group","Group","_addFabricObject","isEditing","ActiveSelection","setActiveObject","cropSelectionStyle","_componentMap","_drawingMode","_isSameDrawingMode","drawingModeInstance","_getDrawingModeInstance","NORMAL","getComponent","components","cropper","changeVisibility","dataUrl","canvasImage","maxDimension","getBoundingRect","_calcMaxDimension","centerObject","setDimensions","getElement","_callbackAfterLoadingImageObject","fromURL","createObjectProperties","drawingMode","compName","FREE_DRAWING","LINE_DRAWING","LINE","setStates","ICON","pathInfos","defaultCursor","clone","targetObj","targetOrigin","centerOrigin","diffX","diffY","staticCanvas","StaticCanvas","enableRetinaScaling","modeName","_drawingModeMap","objectCaching","canvasElement","nodeName","Canvas","containerClass","_register","CropperDrawingMode","FreeDrawingMode","LineDrawingMode","ShapeDrawingMode","TextDrawingMode","IconDrawingMode","ZoomDrawingMode","ImageLoader","Cropper","Rotation","FreeDrawing","Line","Zoom","getName","wScaleFactor","hScaleFactor","centerPos","getCenterPoint","_handler","onMouseDown","onObjectAdded","onObjectRemoved","onObjectMoved","onObjectScaled","onObjectModified","onObjectRotated","onPathCreated","onSelectionCleared","onSelectionCreated","onObjectSelected","fEvent","getPointer","_removeFabricObject","_lazyFire","eventName","paramsMaker","delegationState","canvasEventDelegation","canvasEventRegister","params","hoverCursor","_createTextProperties","shapeComp","makeFillPropertyForUserEvent","targetObjectForCopyPaste","targetObjects","newTargetObject","_cloneObject","addedObjects","getActiveSelectionFromObjects","_cloneObjectItem","_copyFabricObjectForPaste","clonedObject","objectProperties","addExtraPx","isReverse","_copyFabricObject","canvasWidth","canvasHeight","rightEdge","bottomEdge","cloned","processForCopiedObject","_onObjectRemoved","_onObjectSelected","_onPathCreated","_onSelectionCleared","_onSelectionCreated","_setObjectCachingToFalse","_setCanvasElement","_createDrawingModeInstances","_createComponents","_attachCanvasEvents","imageOption","padding","_setBackgroundImage","backgroundImage","setBackgroundImage","IMAGE_LOADER","DEFAULT_OPTION","presetRatio","_cropzone","evented","Cropzone","_listeners","selection","util","addListener","keyup","cropzone","removeListener","visible","coord","_startX","_startY","mousemove","mouseup","_calcRectDimensionFromPoint","getWidth","getHeight","startX","startY","_withShiftKey","listeners","containsCropzone","imageData","isValid","_getPresetPropertiesForCropSize","getScale","orignalValue","originalWidth","originalHeight","standardSize","scaleWidth","scaleHeight","_onKeyUp","_onFabricMouseDown","_onFabricMouseMove","_onFabricMouseUp","NOOP_FUNCTION","CORNER_TYPE_LIST","getScaleBasis","createClass","Rect","initialize","extendsOptions","callSuper","_addEventHandler","canvasEventTrigger","eventTrigger","moving","_onMoving","scaling","_onScaling","_renderCropzone","ctx","originalFlipX","flipX","originalFlipY","flipY","originalScaleX","originalScaleY","_fillOuterRect","_fillInnerRect","_strokeBorder","lineDashWidth","lineDashOffset","_render","_getCoordinates","save","beginPath","moveTo","lineTo","closePath","restore","outerX","outerY","_caculateInnerPosition","strokeStyle","outer","halfWidth","halfHeight","setLineDash","maxLeft","maxTop","selectedCorner","transform","corner","_calcScalingSizeFromPointer","_resizeCropZone","adjustRatioCropzoneSize","leftMaker","topMaker","scaleTo","maxScaleFactor","v","_getCropzoneRectInfo","rectTop","rectLeft","rectWidth","rectHeight","rectRight","rectBottom","resizeInfoMap","newWidth","newHeight","tr","mt","ml","mr","mb","bl","br","newSetting","getCurrentSetting","isChangingFlipX","isChangingFlipY","_invertAngle","_flipObjects","current","FLIP","oldAngle","getCurrentAngle","oldImageCenter","newImageCenter","_rotateForEachObject","angleDiff","centerDiff","objCenter","radian","degreesToRadians","newObjCenter","rotatePoint","additionalAngle","ROTATION","isDrawingMode","brush","freeDrawingBrush","oColor","Color","toRgba","arrowType","tail","_arrowType","setHeadOption","_width","_oColor","_line","ArrowLine","_createLineEventObjectProperties","startPosition","endPosition","calcLinePoints","linePosition","fromX","fromY","toX","toY","_renderBasicLinePath","_drawDecoratorPath","_renderStroke","_drawDecoratorPathType","_drawTrianglePath","_drawChevronPath","decorateSize","rotatedPosition","changeAngle","getRotatePosition","standardX","standardY","compareX","compareY","atan2","referencePosition","defaultStyles","resetStyles","select","selectClear","adjustOriginPosition","setCanvasRatio","editStatus","newText","_defaultStyles","_setInitPos","autofocus","IText","enterEditing","selectAll","isPrevEditing","activeObj","_getTextDecorationAdaptObject","_selectedObj","_isSelected","cssWidth","originWidth","_ratio","linethrough","overline","getCanvasRatio","_editingObj","textareaStyle","_textarea","editingObj","editingObjInfos","_editingObjInfos","textContent","transWidth","transHeight","scrollLeft","getSelectedObj","setSelectedInfo","_fireAddText","clientX","clientY","newClickTime","Date","getTime","_isDoubleClick","_lastClickTime","_onFabricSelect","_onFabricSelectClear","_onFabricScaling","_onFabricTextChanged","pathMap","arrow","_type","_iconColor","_pathMap","_createIcon","_icon","Path","_startPoint","moveOriginPointer","filters","Sharpen","Emboss","ColorFilter","sourceImg","_getSourceImage","imgFilter","_getFilter","_createFilter","_changeFilterValues","_apply","getOptions","_removeFilter","applyFilters","filterObj","fabricType","_getFabricFilterType","ImageFilter","BlendImage","applyTo","pipelineState","canvasEl","maskCanvasEl","_createCanvasOfMask","maskCtx","_drawMask","_mapData","createCanvasElement","maskImg","translate","imgHeight","sourceData","maskData","Convolute","matrix","BaseFilter","threshold","filterColor","sourceFromHex","_getColor","_isOutsideThreshold","putImageData","color1","color2","diff","SHAPE_INIT_OPTIONS","rx","ry","makeFabricFillOption","createStaticCanvas","fillType","extOption","newStaticCanvas","makeFillPatternForFilter","uniformScaling","_options","extendOption","_extendOptions","_createInstance","_bindEventOnShape","_resetPositionFillFilter","hasFillOption","fillProp","fillImage","getFillImageFromShape","filterOption","makeFilterOptionFromFabricImage","originalShapeObj","instance","Ellipse","Triangle","selectionStyles","added","_shapeObj","resizeHelper","deselected","modified","currentObj","modifiedInGroup","activeSelection","_fillFilterRePositionInGroupSelection","rotating","setCursor","startPointX","startPointY","KEY_CODES","patternSourceCanvas","originalAngle","reMakePatternImageSource","rePositionFilterTypeFillImage","resetFillPatternCanvas","addWithUpdate","rotatedShapeCornerDimension","getShapeEdgePoint","ax","ay","bx","by","cx","cy","dx","dy","getRotatedDimension","diffLeft","diffTop","cropX","cropY","fillImageMaxSize","overflowAreaPositionFixer","outDistance","imageLeft","imageTop","shapePointNavigation","linePointsOutsideCanvas","shapeNeighborPointNavigation","minimumPoint","minimumPointIndex","endPointIndex1","endPointIndex2","startPointIndex","calculateLinePointsOutsideCanvas","reatAngles","linePointsOfOneVertexIndex","horizontalVerticalAngle","pointIndex","endPoint","calculateLineAngleOfOutsideCanvas","rotationChangePoint1","rotationChangePoint2","isForward","isReverseLeftPositionForFlip","isReverseTopPositionForFlip","getReversePositionForFlip","cropDistance","compareSize","POSITION_DIMENSION_MAP","cachedCanvasImageElement","calculateDimensionLeftTopEdge","insideCanvasRealImageWidth","insideCanvasRealImageHeight","cropDistance2","calculateDimensionRightBottomEdge","calculateFillImageDimensionOutsideCanvas","makeFillImage","getCachedCanvasImageElement","fabricProperty","Pattern","repeat","innerImage","newFillImage","FILTER_OPTION_MAP","FILTER_NAME_VALUE_MAP","imageObject","toCanvasElement","copiedCanvasElement","currentCanvasImageAngle","fabricFilterClassName","DEFAULT_SCROLL_OPTION","opacity","DEFAULT_VERTICAL_SCROLL_RATIO","DEFAULT_HORIZONTAL_SCROLL_RATIO","isTextEditing","withSpace","zoomArea","_changeObjectsEventedState","startZoom","moveZoom","stopZoom","_startHandPoint","startHand","center","_getCenterPoint","_isMaxZoomLevel","_centerPoints","prevZoomLevel","zoomToPoint","_fireZoomChanged","aspectRatio","centerPoints","prevX","prevY","_isDefaultZoomLevel","setViewportTransform","deltaX","deltaY","moveHand","stopHand","_movePointOfZoom","viewport","_verticalScroll","_horizontalScroll","viewportWidth","viewportHeight","horizontalScrollWidth","horizontalScrollHeight","horizontalScrollLeft","horizontalScrollMargin","horizontalScrollBorderRadius","verticalScrollWidth","verticalScrollHeight","verticalScrollTop","verticalScrollMargin","verticalScrollBorderRadius","_addScrollBar","scrollBarTid","calcViewportBoundaries","_onMouseDownWithZoomMode","_onMouseMoveWithZoomMode","_onMouseUpWithZoomMode","_onMouseDownWithHandMode","_onMouseMoveWithHandMode","_onMouseUpWithHandMode","zoomChanged","_changeScrollState","_startHandModeWithSpaceBar","_endHandModeWithSpaceBar","_startTextEditingHandler","_stopTextEditingHandler","textComp","undoObject","textObject","prevfilterOption","filterComp","maskObj","setUndoData","iconComp","getColor","change","getText","textObj","undoValue","setStyle","removeAll","flipComp","loader","prevImage","prevImageWidth","prevImageHeight","objectItem","newImage","oldWidth","oldHeight","removeObjectById","setCssMaxDimension","rotationComp","objectId","setObjectPosition","datum","d","getter","o","toStringTag","__esModule","ns","p","moduleId","modules"],"mappings":";;;;;;CAAA,SAA2CA,EAAMC,GAC1B,iBAAZC,SAA0C,iBAAXC,OACxCA,OAAOD,QAAUD,EAAQG,QAAQ,oBAAqBA,QAAQ,UAAkB,OAAGA,QAAQ,qBAClE,mBAAXC,QAAyBA,OAAOC,IAC9CD,OAAO,CAAC,mBAAoB,SAAU,oBAAqBJ,GACjC,iBAAZC,QACdA,QAAqB,YAAID,EAA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6mE,EAAI,UAAW,CAAEl7D,YAAY,EAAMva,MAAOA,IACtD,EAAP0I,GAA4B,iBAAT1I,EAAmB,IAAI,IAAIwB,KAAOxB,EAAOpI,EAAoBw9E,EAAEK,EAAIj0E,EAAK,SAASA,GAAO,OAAOxB,EAAMwB,IAAQ+N,KAAK,KAAM/N,IAC9I,OAAOi0E,GAIR79E,EAAoBitD,EAAI,SAAS1tD,GAChC,IAAIk+E,EAASl+E,GAAUA,EAAOq+E,WAC7B,WAAwB,OAAOr+E,EAAgB,SAC/C,WAA8B,OAAOA,GAEtC,OADAS,EAAoBw9E,EAAEC,EAAQ,IAAKA,GAC5BA,GAIRz9E,EAAoB09E,EAAI,SAASlpE,EAAQoiC,GAAY,OAAO5nC,OAAOuI,UAAUV,eAAeC,KAAKtC,EAAQoiC,IAGzG52C,EAAoB89E,EAAI,QAIjB99E,EAAoBA,EAAoBoyB,EAAI,IA9EnD,SAASpyB,EAAoB+9E,GAG5B,GAAGh+E,EAAiBg+E,GACnB,OAAOh+E,EAAiBg+E,GAAUz+E,QAGnC,IAAIC,EAASQ,EAAiBg+E,GAAY,CACzC1zE,EAAG0zE,EACH5pD,GAAG,EACH70B,QAAS,IAUV,OANA0+E,EAAQD,GAAUjnE,KAAKvX,EAAOD,QAASC,EAAQA,EAAOD,QAASU,GAG/DT,EAAO40B,GAAI,EAGJ50B,EAAOD,Q,MAvBXS","file":"tui-image-editor.min.js","sourcesContent":["(function webpackUniversalModuleDefinition(root, factory) {\n\tif(typeof exports === 'object' && typeof module === 'object')\n\t\tmodule.exports = factory(require(\"tui-code-snippet\"), require(\"fabric\")[\"fabric\"], require(\"tui-color-picker\"));\n\telse if(typeof define === 'function' && define.amd)\n\t\tdefine([\"tui-code-snippet\", \"fabric\", \"tui-color-picker\"], factory);\n\telse if(typeof exports === 'object')\n\t\texports[\"ImageEditor\"] = factory(require(\"tui-code-snippet\"), require(\"fabric\")[\"fabric\"], require(\"tui-color-picker\"));\n\telse\n\t\troot[\"tui\"] = root[\"tui\"] || {}, root[\"tui\"][\"ImageEditor\"] = factory(root[\"tui\"][\"util\"], root[\"fabric\"], root[\"tui\"][\"colorPicker\"]);\n})(window, function(__WEBPACK_EXTERNAL_MODULE__2__, __WEBPACK_EXTERNAL_MODULE__4__, __WEBPACK_EXTERNAL_MODULE__123__) {\nreturn "," \t// The module cache\n \tvar installedModules = {};\n\n \t// The require function\n \tfunction __webpack_require__(moduleId) {\n\n \t\t// Check if module is in cache\n \t\tif(installedModules[moduleId]) {\n \t\t\treturn installedModules[moduleId].exports;\n \t\t}\n \t\t// Create a new module (and put it into the cache)\n \t\tvar module = installedModules[moduleId] = {\n \t\t\ti: moduleId,\n \t\t\tl: false,\n \t\t\texports: {}\n \t\t};\n\n \t\t// Execute the module function\n \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n \t\t// Flag the module as loaded\n \t\tmodule.l = true;\n\n \t\t// Return the exports of the module\n \t\treturn module.exports;\n \t}\n\n\n \t// expose the modules object (__webpack_modules__)\n \t__webpack_require__.m = modules;\n\n \t// expose the module cache\n \t__webpack_require__.c = installedModules;\n\n \t// define getter function for harmony exports\n \t__webpack_require__.d = function(exports, name, getter) {\n \t\tif(!__webpack_require__.o(exports, name)) {\n \t\t\tObject.defineProperty(exports, name, { enumerable: true, get: getter });\n \t\t}\n \t};\n\n \t// define __esModule on exports\n \t__webpack_require__.r = function(exports) {\n \t\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n \t\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n \t\t}\n \t\tObject.defineProperty(exports, '__esModule', { value: true });\n \t};\n\n \t// create a fake namespace object\n \t// mode & 1: value is a module id, require it\n \t// mode & 2: merge all properties of value into the ns\n \t// mode & 4: return value when already ns object\n \t// mode & 8|1: behave like require\n \t__webpack_require__.t = function(value, mode) {\n \t\tif(mode & 1) value = __webpack_require__(value);\n \t\tif(mode & 8) return value;\n \t\tif((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;\n \t\tvar ns = Object.create(null);\n \t\t__webpack_require__.r(ns);\n \t\tObject.defineProperty(ns, 'default', { enumerable: true, value: value });\n \t\tif(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));\n \t\treturn ns;\n \t};\n\n \t// getDefaultExport function for compatibility with non-harmony modules\n \t__webpack_require__.n = function(module) {\n \t\tvar getter = module && module.__esModule ?\n \t\t\tfunction getDefault() { return module['default']; } :\n \t\t\tfunction getModuleExports() { return module; };\n \t\t__webpack_require__.d(getter, 'a', getter);\n \t\treturn getter;\n \t};\n\n \t// Object.prototype.hasOwnProperty.call\n \t__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };\n\n \t// __webpack_public_path__\n \t__webpack_require__.p = \"/dist\";\n\n\n \t// Load entry module and return exports\n \treturn __webpack_require__(__webpack_require__.s = 69);\n","/**\n * @author NHN. FE Development Team \n * @fileoverview Constants\n */\nimport { keyMirror } from '@/util';\n\n/**\n * Help features for zoom\n * @type {Array.}\n */\nexport const ZOOM_HELP_MENUS = ['zoomIn', 'zoomOut', 'hand'];\n\n/**\n * Help features for command\n * @type {Array.}\n */\nexport const COMMAND_HELP_MENUS = ['history', 'undo', 'redo', 'reset'];\n\n/**\n * Help features for delete\n * @type {Array.}\n */\nexport const DELETE_HELP_MENUS = ['delete', 'deleteAll'];\n\n/**\n * Editor help features\n * @type {Array.}\n */\nexport const HELP_MENUS = [...ZOOM_HELP_MENUS, ...COMMAND_HELP_MENUS, ...DELETE_HELP_MENUS];\n\n/**\n * Fill type for shape\n * @type {Object.}\n */\nexport const SHAPE_FILL_TYPE = {\n FILTER: 'filter',\n COLOR: 'color',\n};\n\n/**\n * Shape type list\n * @type {Array.}\n */\nexport const SHAPE_TYPE = ['rect', 'circle', 'triangle'];\n\n/**\n * Object type\n * @type {Object.}\n */\nexport const OBJ_TYPE = {\n CROPZONE: 'cropzone',\n};\n\n/**\n * Filter type map\n * @type {Object.}\n */\nexport const filterType = {\n VINTAGE: 'vintage',\n SEPIA2: 'sepia2',\n REMOVE_COLOR: 'removeColor',\n COLOR_FILTER: 'colorFilter',\n REMOVE_WHITE: 'removeWhite',\n BLEND_COLOR: 'blendColor',\n BLEND: 'blend',\n};\n\n/**\n * Component names\n * @type {Object.}\n */\nexport const componentNames = keyMirror(\n 'IMAGE_LOADER',\n 'CROPPER',\n 'FLIP',\n 'ROTATION',\n 'FREE_DRAWING',\n 'LINE',\n 'TEXT',\n 'ICON',\n 'FILTER',\n 'SHAPE',\n 'ZOOM'\n);\n\n/**\n * Shape default option\n * @type {Object}\n */\nexport const SHAPE_DEFAULT_OPTIONS = {\n lockSkewingX: true,\n lockSkewingY: true,\n bringForward: true,\n isRegular: false,\n};\n\n/**\n * Cropzone default option\n * @type {Object}\n */\nexport const CROPZONE_DEFAULT_OPTIONS = {\n hasRotatingPoint: false,\n hasBorders: false,\n lockScalingFlip: true,\n lockRotation: true,\n lockSkewingX: true,\n lockSkewingY: true,\n};\n\n/**\n * Command names\n * @type {Object.}\n */\nexport const commandNames = {\n CLEAR_OBJECTS: 'clearObjects',\n LOAD_IMAGE: 'loadImage',\n FLIP_IMAGE: 'flip',\n ROTATE_IMAGE: 'rotate',\n ADD_OBJECT: 'addObject',\n REMOVE_OBJECT: 'removeObject',\n APPLY_FILTER: 'applyFilter',\n REMOVE_FILTER: 'removeFilter',\n ADD_ICON: 'addIcon',\n CHANGE_ICON_COLOR: 'changeIconColor',\n ADD_SHAPE: 'addShape',\n CHANGE_SHAPE: 'changeShape',\n ADD_TEXT: 'addText',\n CHANGE_TEXT: 'changeText',\n CHANGE_TEXT_STYLE: 'changeTextStyle',\n ADD_IMAGE_OBJECT: 'addImageObject',\n RESIZE_CANVAS_DIMENSION: 'resizeCanvasDimension',\n SET_OBJECT_PROPERTIES: 'setObjectProperties',\n SET_OBJECT_POSITION: 'setObjectPosition',\n CHANGE_SELECTION: 'changeSelection',\n};\n\n/**\n * Event names\n * @type {Object.}\n */\nexport const eventNames = {\n OBJECT_ACTIVATED: 'objectActivated',\n OBJECT_MOVED: 'objectMoved',\n OBJECT_SCALED: 'objectScaled',\n OBJECT_CREATED: 'objectCreated',\n OBJECT_ROTATED: 'objectRotated',\n OBJECT_ADDED: 'objectAdded',\n OBJECT_MODIFIED: 'objectModified',\n TEXT_EDITING: 'textEditing',\n TEXT_CHANGED: 'textChanged',\n ICON_CREATE_RESIZE: 'iconCreateResize',\n ICON_CREATE_END: 'iconCreateEnd',\n ADD_TEXT: 'addText',\n ADD_OBJECT: 'addObject',\n ADD_OBJECT_AFTER: 'addObjectAfter',\n MOUSE_DOWN: 'mousedown',\n MOUSE_UP: 'mouseup',\n MOUSE_MOVE: 'mousemove',\n // UNDO/REDO Events\n REDO_STACK_CHANGED: 'redoStackChanged',\n UNDO_STACK_CHANGED: 'undoStackChanged',\n SELECTION_CLEARED: 'selectionCleared',\n SELECTION_CREATED: 'selectionCreated',\n EXECUTE_COMMAND: 'executeCommand',\n AFTER_UNDO: 'afterUndo',\n AFTER_REDO: 'afterRedo',\n ZOOM_CHANGED: 'zoomChanged',\n HAND_STARTED: 'handStarted',\n HAND_STOPPED: 'handStopped',\n KEY_DOWN: 'keydown',\n KEY_UP: 'keyup',\n};\n\n/**\n * History names\n * @type {Object.}\n */\nexport const historyNames = {\n LOAD_IMAGE: 'Load',\n LOAD_MASK_IMAGE: 'Mask',\n ADD_MASK_IMAGE: 'Mask',\n ADD_IMAGE_OBJECT: 'Mask',\n CROP: 'Crop',\n APPLY_FILTER: 'Filter',\n REMOVE_FILTER: 'Filter',\n CHANGE_SHAPE: 'Shape',\n CHANGE_ICON_COLOR: 'Icon',\n ADD_TEXT: 'Text',\n CHANGE_TEXT_STYLE: 'Text',\n REMOVE_OBJECT: 'Delete',\n CLEAR_OBJECTS: 'Delete',\n};\n\n/**\n * Editor states\n * @type {Object.}\n */\nexport const drawingModes = keyMirror(\n 'NORMAL',\n 'CROPPER',\n 'FREE_DRAWING',\n 'LINE_DRAWING',\n 'TEXT',\n 'SHAPE',\n 'ICON',\n 'ZOOM'\n);\n\n/**\n * Menu names with drawing mode\n * @type {Object.}\n */\nexport const drawingMenuNames = {\n TEXT: 'text',\n CROP: 'crop',\n SHAPE: 'shape',\n ZOOM: 'zoom',\n};\n\n/**\n * Zoom modes\n * @type {Object.}\n */\nexport const zoomModes = {\n DEFAULT: 'normal',\n ZOOM: 'zoom',\n HAND: 'hand',\n};\n\n/**\n * Shortcut key values\n * @type {Object.}\n */\nexport const keyCodes = {\n Z: 90,\n Y: 89,\n C: 67,\n V: 86,\n SHIFT: 16,\n BACKSPACE: 8,\n DEL: 46,\n ARROW_DOWN: 40,\n ARROW_UP: 38,\n SPACE: 32,\n};\n\n/**\n * Fabric object options\n * @type {Object.}\n */\nexport const fObjectOptions = {\n SELECTION_STYLE: {\n borderColor: 'red',\n cornerColor: 'green',\n cornerSize: 10,\n originX: 'center',\n originY: 'center',\n transparentCorners: false,\n },\n};\n\n/**\n * Promise reject messages\n * @type {Object.}\n */\nexport const rejectMessages = {\n addedObject: 'The object is already added.',\n flip: 'The flipX and flipY setting values are not changed.',\n invalidDrawingMode: 'This operation is not supported in the drawing mode.',\n invalidParameters: 'Invalid parameters.',\n isLock: 'The executing command state is locked.',\n loadImage: 'The background image is empty.',\n loadingImageFailed: 'Invalid image loaded.',\n noActiveObject: 'There is no active object.',\n noObject: 'The object is not in canvas.',\n redo: 'The promise of redo command is reject.',\n rotation: 'The current angle is same the old angle.',\n undo: 'The promise of undo command is reject.',\n unsupportedOperation: 'Unsupported operation.',\n unsupportedType: 'Unsupported object type.',\n};\n\n/**\n * Default icon menu svg path\n * @type {Object.}\n */\nexport const defaultIconPath = {\n 'icon-arrow': 'M40 12V0l24 24-24 24V36H0V12h40z',\n 'icon-arrow-2': 'M49,32 H3 V22 h46 l-18,-18 h12 l23,23 L43,50 h-12 l18,-18 z ',\n 'icon-arrow-3':\n 'M43.349998,27 L17.354,53 H1.949999 l25.996,-26 L1.949999,1 h15.404 L43.349998,27 z ',\n 'icon-star':\n 'M35,54.557999 l-19.912001,10.468 l3.804,-22.172001 l-16.108,-15.7 l22.26,-3.236 L35,3.746 l9.956,20.172001 l22.26,3.236 l-16.108,15.7 l3.804,22.172001 z ',\n 'icon-star-2':\n 'M17,31.212 l-7.194,4.08 l-4.728,-6.83 l-8.234,0.524 l-1.328,-8.226 l-7.644,-3.14 l2.338,-7.992 l-5.54,-6.18 l5.54,-6.176 l-2.338,-7.994 l7.644,-3.138 l1.328,-8.226 l8.234,0.522 l4.728,-6.83 L17,-24.312 l7.194,-4.08 l4.728,6.83 l8.234,-0.522 l1.328,8.226 l7.644,3.14 l-2.338,7.992 l5.54,6.178 l-5.54,6.178 l2.338,7.992 l-7.644,3.14 l-1.328,8.226 l-8.234,-0.524 l-4.728,6.83 z ',\n 'icon-polygon': 'M3,31 L19,3 h32 l16,28 l-16,28 H19 z ',\n 'icon-location':\n 'M24 62C8 45.503 0 32.837 0 24 0 10.745 10.745 0 24 0s24 10.745 24 24c0 8.837-8 21.503-24 38zm0-28c5.523 0 10-4.477 10-10s-4.477-10-10-10-10 4.477-10 10 4.477 10 10 10z',\n 'icon-heart':\n 'M49.994999,91.349998 l-6.96,-6.333 C18.324001,62.606995 2.01,47.829002 2.01,29.690998 C2.01,14.912998 13.619999,3.299999 28.401001,3.299999 c8.349,0 16.362,5.859 21.594,12 c5.229,-6.141 13.242001,-12 21.591,-12 c14.778,0 26.390999,11.61 26.390999,26.390999 c0,18.138 -16.314001,32.916 -41.025002,55.374001 l-6.96,6.285 z ',\n 'icon-bubble':\n 'M44 48L34 58V48H12C5.373 48 0 42.627 0 36V12C0 5.373 5.373 0 12 0h40c6.627 0 12 5.373 12 12v24c0 6.627-5.373 12-12 12h-8z',\n};\n\nexport const defaultRotateRangeValues = {\n realTimeEvent: true,\n min: -360,\n max: 360,\n value: 0,\n};\n\nexport const defaultDrawRangeValues = {\n min: 5,\n max: 30,\n value: 12,\n};\n\nexport const defaultShapeStrokeValues = {\n realTimeEvent: true,\n min: 2,\n max: 300,\n value: 3,\n};\n\nexport const defaultTextRangeValues = {\n realTimeEvent: true,\n min: 10,\n max: 100,\n value: 50,\n};\n\nexport const defaultFilterRangeValues = {\n tintOpacityRange: {\n realTimeEvent: true,\n min: 0,\n max: 1,\n value: 0.7,\n useDecimal: true,\n },\n removewhiteDistanceRange: {\n realTimeEvent: true,\n min: 0,\n max: 1,\n value: 0.2,\n useDecimal: true,\n },\n brightnessRange: {\n realTimeEvent: true,\n min: -1,\n max: 1,\n value: 0,\n useDecimal: true,\n },\n noiseRange: {\n realTimeEvent: true,\n min: 0,\n max: 1000,\n value: 100,\n },\n pixelateRange: {\n realTimeEvent: true,\n min: 2,\n max: 20,\n value: 4,\n },\n colorfilterThresholdRange: {\n realTimeEvent: true,\n min: 0,\n max: 1,\n value: 0.2,\n useDecimal: true,\n },\n blurFilterRange: {\n value: 0.1,\n },\n};\n\nexport const emptyCropRectValues = {\n LEFT: 0,\n TOP: 0,\n WIDTH: 0.5,\n HEIGHT: 0.5,\n};\n","/**\n * @author NHN. FE Development Team \n * @fileoverview Util\n */\nimport { forEach, sendHostname, extend, isString, pick, inArray } from 'tui-code-snippet';\nimport Promise from 'core-js-pure/features/promise';\nimport {\n commandNames,\n filterType,\n historyNames,\n SHAPE_FILL_TYPE,\n SHAPE_TYPE,\n emptyCropRectValues,\n} from '@/consts';\n\nconst FLOATING_POINT_DIGIT = 2;\nconst CSS_PREFIX = 'tui-image-editor-';\nconst { min, max } = Math;\nlet hostnameSent = false;\n\n/**\n * Export Promise Class (for simplified module path)\n * @returns {Promise} promise class\n */\nexport { Promise };\n\n/**\n * Clamp value\n * @param {number} value - Value\n * @param {number} minValue - Minimum value\n * @param {number} maxValue - Maximum value\n * @returns {number} clamped value\n */\nexport function clamp(value, minValue, maxValue) {\n if (minValue > maxValue) {\n [minValue, maxValue] = [maxValue, minValue];\n }\n\n return max(minValue, min(value, maxValue));\n}\n\n/**\n * Make key-value object from arguments\n * @returns {object.}\n */\nexport function keyMirror(...args) {\n const obj = {};\n\n forEach(args, (key) => {\n obj[key] = key;\n });\n\n return obj;\n}\n\n/**\n * Make CSSText\n * @param {Object} styleObj - Style info object\n * @returns {string} Connected string of style\n */\nexport function makeStyleText(styleObj) {\n let styleStr = '';\n\n forEach(styleObj, (value, prop) => {\n styleStr += `${prop}: ${value};`;\n });\n\n return styleStr;\n}\n\n/**\n * Get object's properties\n * @param {Object} obj - object\n * @param {Array} keys - keys\n * @returns {Object} properties object\n */\nexport function getProperties(obj, keys) {\n const props = {};\n const { length } = keys;\n let i = 0;\n let key;\n\n for (i = 0; i < length; i += 1) {\n key = keys[i];\n props[key] = obj[key];\n }\n\n return props;\n}\n\n/**\n * ParseInt simpliment\n * @param {number} value - Value\n * @returns {number}\n */\nexport function toInteger(value) {\n return parseInt(value, 10);\n}\n\n/**\n * String to camelcase string\n * @param {string} targetString - change target\n * @returns {string}\n * @private\n */\nexport function toCamelCase(targetString) {\n return targetString.replace(/-([a-z])/g, ($0, $1) => $1.toUpperCase());\n}\n\n/**\n * Check browser file api support\n * @returns {boolean}\n * @private\n */\nexport function isSupportFileApi() {\n return !!(window.File && window.FileList && window.FileReader);\n}\n\n/**\n * hex to rgb\n * @param {string} color - hex color\n * @param {string} alpha - color alpha value\n * @returns {string} rgb expression\n */\nexport function getRgb(color, alpha) {\n if (color.length === 4) {\n color = `${color}${color.slice(1, 4)}`;\n }\n const r = parseInt(color.slice(1, 3), 16);\n const g = parseInt(color.slice(3, 5), 16);\n const b = parseInt(color.slice(5, 7), 16);\n const a = alpha || 1;\n\n return `rgba(${r}, ${g}, ${b}, ${a})`;\n}\n\n/**\n * send hostname\n */\nexport function sendHostName() {\n if (hostnameSent) {\n return;\n }\n hostnameSent = true;\n\n sendHostname('image-editor', 'UA-129999381-1');\n}\n\n/**\n * Apply css resource\n * @param {string} styleBuffer - serialized css text\n * @param {string} tagId - style tag id\n */\nexport function styleLoad(styleBuffer, tagId) {\n const [head] = document.getElementsByTagName('head');\n const linkElement = document.createElement('link');\n const styleData = encodeURIComponent(styleBuffer);\n if (tagId) {\n linkElement.id = tagId;\n // linkElement.id = 'tui-image-editor-theme-style';\n }\n linkElement.setAttribute('rel', 'stylesheet');\n linkElement.setAttribute('type', 'text/css');\n linkElement.setAttribute('href', `data:text/css;charset=UTF-8,${styleData}`);\n head.appendChild(linkElement);\n}\n\n/**\n * Get selector\n * @param {HTMLElement} targetElement - target element\n * @returns {Function} selector\n */\nexport function getSelector(targetElement) {\n return (str) => targetElement.querySelector(str);\n}\n\n/**\n * Change base64 to blob\n * @param {String} data - base64 string data\n * @returns {Blob} Blob Data\n */\nexport function base64ToBlob(data) {\n const rImageType = /data:(image\\/.+);base64,/;\n let mimeString = '';\n let raw, uInt8Array, i;\n\n raw = data.replace(rImageType, (header, imageType) => {\n mimeString = imageType;\n\n return '';\n });\n\n raw = atob(raw);\n const rawLength = raw.length;\n uInt8Array = new Uint8Array(rawLength); // eslint-disable-line\n\n for (i = 0; i < rawLength; i += 1) {\n uInt8Array[i] = raw.charCodeAt(i);\n }\n\n return new Blob([uInt8Array], { type: mimeString });\n}\n\n/**\n * Fix floating point diff.\n * @param {number} value - original value\n * @returns {number} fixed value\n */\nexport function fixFloatingPoint(value) {\n return Number(value.toFixed(FLOATING_POINT_DIGIT));\n}\n\n/**\n * Assignment for destroying objects.\n * @param {Object} targetObject - object to be removed.\n */\nexport function assignmentForDestroy(targetObject) {\n forEach(targetObject, (value, key) => {\n targetObject[key] = null;\n });\n}\n\n/**\n * Make class name for ui\n * @param {String} str - main string of className\n * @param {String} prefix - prefix string of className\n * @returns {String} class name\n */\nexport function cls(str = '', prefix = '') {\n if (str.charAt(0) === '.') {\n return `.${CSS_PREFIX}${prefix}${str.slice(1)}`;\n }\n\n return `${CSS_PREFIX}${prefix}${str}`;\n}\n\n/**\n * Change object origin\n * @param {fabric.Object} fObject - fabric object\n * @param {Object} origin - origin of fabric object\n * @param {string} originX - horizontal basis.\n * @param {string} originY - vertical basis.\n */\nexport function changeOrigin(fObject, origin) {\n const { originX, originY } = origin;\n const { x: left, y: top } = fObject.getPointByOrigin(originX, originY);\n\n fObject.set({\n left,\n top,\n originX,\n originY,\n });\n\n fObject.setCoords();\n}\n\n/**\n * Object key value flip\n * @param {Object} targetObject - The data object of the key value.\n * @returns {Object}\n */\nexport function flipObject(targetObject) {\n const result = {};\n\n Object.keys(targetObject).forEach((key) => {\n result[targetObject[key]] = key;\n });\n\n return result;\n}\n\n/**\n * Set custom properties\n * @param {Object} targetObject - target object\n * @param {Object} props - custom props object\n */\nexport function setCustomProperty(targetObject, props) {\n targetObject.customProps = targetObject.customProps || {};\n extend(targetObject.customProps, props);\n}\n\n/**\n * Get custom property\n * @param {fabric.Object} fObject - fabric object\n * @param {Array|string} propNames - prop name array\n * @returns {object | number | string}\n */\nexport function getCustomProperty(fObject, propNames) {\n const resultObject = {};\n if (isString(propNames)) {\n propNames = [propNames];\n }\n forEach(propNames, (propName) => {\n resultObject[propName] = fObject.customProps[propName];\n });\n\n return resultObject;\n}\n\n/**\n * Capitalize string\n * @param {string} targetString - target string\n * @returns {string}\n */\nexport function capitalizeString(targetString) {\n return targetString.charAt(0).toUpperCase() + targetString.slice(1);\n}\n\n/**\n * Array includes check\n * @param {Array} targetArray - target array\n * @param {string|number} compareValue - compare value\n * @returns {boolean}\n */\nexport function includes(targetArray, compareValue) {\n return targetArray.indexOf(compareValue) >= 0;\n}\n\n/**\n * Get fill type\n * @param {Object | string} fillOption - shape fill option\n * @returns {string} 'color' or 'filter'\n */\nexport function getFillTypeFromOption(fillOption = {}) {\n return pick(fillOption, 'type') || SHAPE_FILL_TYPE.COLOR;\n}\n\n/**\n * Get fill type of shape type object\n * @param {fabric.Object} shapeObj - fabric object\n * @returns {string} 'transparent' or 'color' or 'filter'\n */\nexport function getFillTypeFromObject(shapeObj) {\n const { fill = {} } = shapeObj;\n if (fill.source) {\n return SHAPE_FILL_TYPE.FILTER;\n }\n\n return SHAPE_FILL_TYPE.COLOR;\n}\n\n/**\n * Check if the object is a shape object.\n * @param {fabric.Object} obj - fabric object\n * @returns {boolean}\n */\nexport function isShape(obj) {\n return inArray(obj.get('type'), SHAPE_TYPE) >= 0;\n}\n\n/**\n * Get object type\n * @param {string} type - fabric object type\n * @returns {string} type of object (ex: shape, icon, ...)\n */\nexport function getObjectType(type) {\n if (includes(SHAPE_TYPE, type)) {\n return 'Shape';\n }\n\n switch (type) {\n case 'i-text':\n return 'Text';\n case 'path':\n case 'line':\n return 'Draw';\n case 'activeSelection':\n return 'Group';\n default:\n return toStartOfCapital(type);\n }\n}\n\n/**\n * Get filter type\n * @param {string} type - fabric filter type\n * @param {object} [options] - filter type options\n * @param {boolean} [options.useAlpha=true] - usage of alpha(true is 'color filter', false is 'remove white')\n * @param {string} [options.mode] - mode of blendColor\n * @returns {string} type of filter (ex: sepia, blur, ...)\n */\nfunction getFilterType(type, { useAlpha = true, mode } = {}) {\n const {\n VINTAGE,\n REMOVE_COLOR,\n BLEND_COLOR,\n SEPIA2,\n COLOR_FILTER,\n REMOVE_WHITE,\n BLEND,\n } = filterType;\n\n let filterName;\n\n switch (type) {\n case VINTAGE:\n filterName = SEPIA2;\n break;\n case REMOVE_COLOR:\n filterName = useAlpha ? COLOR_FILTER : REMOVE_WHITE;\n break;\n case BLEND_COLOR:\n filterName = mode === 'add' ? BLEND : mode;\n break;\n default:\n filterName = type;\n }\n\n return toStartOfCapital(filterName);\n}\n\n/**\n * Check if command is silent command\n * @param {Command|string} command - command or command name\n * @returns {boolean}\n */\nexport function isSilentCommand(command) {\n const { LOAD_IMAGE } = commandNames;\n\n return typeof command === 'string' ? LOAD_IMAGE === command : LOAD_IMAGE === command.name;\n}\n\n/**\n * Get command name\n * @param {Command|string} command - command or command name\n * @returns {{name: string, ?detail: string}}\n */\n// eslint-disable-next-line complexity, require-jsdoc\nexport function getHistoryTitle(command) {\n const {\n FLIP_IMAGE,\n ROTATE_IMAGE,\n ADD_TEXT,\n APPLY_FILTER,\n REMOVE_FILTER,\n CHANGE_SHAPE,\n CHANGE_ICON_COLOR,\n CHANGE_TEXT_STYLE,\n CLEAR_OBJECTS,\n ADD_IMAGE_OBJECT,\n REMOVE_OBJECT,\n } = commandNames;\n const { name, args } = command;\n let historyInfo;\n\n switch (name) {\n case FLIP_IMAGE:\n historyInfo = { name, detail: args[1] === 'reset' ? args[1] : args[1].slice(4) };\n break;\n case ROTATE_IMAGE:\n historyInfo = { name, detail: args[2] };\n break;\n case APPLY_FILTER:\n historyInfo = { name: historyNames.APPLY_FILTER, detail: getFilterType(args[1], args[2]) };\n break;\n case REMOVE_FILTER:\n historyInfo = { name: historyNames.REMOVE_FILTER, detail: 'Remove' };\n break;\n case CHANGE_SHAPE:\n historyInfo = { name: historyNames.CHANGE_SHAPE, detail: 'Change' };\n break;\n case CHANGE_ICON_COLOR:\n historyInfo = { name: historyNames.CHANGE_ICON_COLOR, detail: 'Change' };\n break;\n case CHANGE_TEXT_STYLE:\n historyInfo = { name: historyNames.CHANGE_TEXT_STYLE, detail: 'Change' };\n break;\n case REMOVE_OBJECT:\n historyInfo = { name: historyNames.REMOVE_OBJECT, detail: args[2] };\n break;\n case CLEAR_OBJECTS:\n historyInfo = { name: historyNames.CLEAR_OBJECTS, detail: 'All' };\n break;\n case ADD_IMAGE_OBJECT:\n historyInfo = { name: historyNames.ADD_IMAGE_OBJECT, detail: 'Add' };\n break;\n case ADD_TEXT:\n historyInfo = { name: historyNames.ADD_TEXT };\n break;\n\n default:\n historyInfo = { name };\n break;\n }\n\n if (args[1] === 'mask') {\n historyInfo = { name: historyNames.LOAD_MASK_IMAGE, detail: 'Apply' };\n }\n\n return historyInfo;\n}\n\n/**\n * Get help menubar position(opposite of menubar)\n * @param {string} position - position of menubar\n * @returns {string} position of help menubar\n */\nexport function getHelpMenuBarPosition(position) {\n if (position === 'top') {\n return 'bottom';\n }\n if (position === 'left') {\n return 'right';\n }\n if (position === 'right') {\n return 'left';\n }\n\n return 'top';\n}\n\n/**\n * Change to capital start letter\n * @param {string} str - string to change\n * @returns {string}\n */\nfunction toStartOfCapital(str) {\n return str.replace(/[a-z]/, (first) => first.toUpperCase());\n}\n\n/**\n * Check if cropRect is Empty.\n * @param {Object} cropRect - cropRect object\n * @param {Number} cropRect.left - cropRect left position value\n * @param {Number} cropRect.top - cropRect top position value\n * @param {Number} cropRect.width - cropRect width value\n * @param {Number} cropRect.height - cropRect height value\n * @returns {boolean}\n */\nexport function isEmptyCropzone(cropRect) {\n const { left, top, width, height } = cropRect;\n const { LEFT, TOP, WIDTH, HEIGHT } = emptyCropRectValues;\n\n return left === LEFT && top === TOP && width === WIDTH && height === HEIGHT;\n}\n","module.exports = __WEBPACK_EXTERNAL_MODULE__2__;","/**\n * @author NHN. FE Development Team \n * @fileoverview Command factory\n */\nimport Command from '@/interface/command';\n\nconst commands = {};\n\n/**\n * Create a command\n * @param {string} name - Command name\n * @param {...*} args - Arguments for creating command\n * @returns {Command}\n * @ignore\n */\nfunction create(name, ...args) {\n const actions = commands[name];\n if (actions) {\n return new Command(actions, args);\n }\n\n return null;\n}\n\n/**\n * Register a command with name as a key\n * @param {Object} command - {name:{string}, execute: {function}, undo: {function}}\n * @param {string} command.name - command name\n * @param {function} command.execute - executable function\n * @param {function} command.undo - undo function\n * @ignore\n */\nfunction register(command) {\n commands[command.name] = command;\n}\n\nexport default {\n create,\n register,\n};\n","module.exports = __WEBPACK_EXTERNAL_MODULE__4__;","var check = function (it) {\n return it && it.Math == Math && it;\n};\n\n// https://github.com/zloirock/core-js/issues/86#issuecomment-115759028\nmodule.exports =\n // eslint-disable-next-line no-undef\n check(typeof globalThis == 'object' && globalThis) ||\n check(typeof window == 'object' && window) ||\n check(typeof self == 'object' && self) ||\n check(typeof global == 'object' && global) ||\n // eslint-disable-next-line no-new-func\n Function('return this')();\n","var global = require('../internals/global');\nvar shared = require('../internals/shared');\nvar has = require('../internals/has');\nvar uid = require('../internals/uid');\nvar NATIVE_SYMBOL = require('../internals/native-symbol');\nvar USE_SYMBOL_AS_UID = require('../internals/use-symbol-as-uid');\n\nvar WellKnownSymbolsStore = shared('wks');\nvar Symbol = global.Symbol;\nvar createWellKnownSymbol = USE_SYMBOL_AS_UID ? Symbol : Symbol && Symbol.withoutSetter || uid;\n\nmodule.exports = function (name) {\n if (!has(WellKnownSymbolsStore, name)) {\n if (NATIVE_SYMBOL && has(Symbol, name)) WellKnownSymbolsStore[name] = Symbol[name];\n else WellKnownSymbolsStore[name] = createWellKnownSymbol('Symbol.' + name);\n } return WellKnownSymbolsStore[name];\n};\n","/**\n * @author NHN. FE Development Team \n * @fileoverview Component interface\n */\n\n/**\n * Component interface\n * @class\n * @param {string} name - component name\n * @param {Graphics} graphics - Graphics instance\n * @ignore\n */\nclass Component {\n constructor(name, graphics) {\n /**\n * Component name\n * @type {string}\n */\n this.name = name;\n\n /**\n * Graphics instance\n * @type {Graphics}\n */\n this.graphics = graphics;\n }\n\n /**\n * Fire Graphics event\n * @returns {Object} return value\n */\n fire(...args) {\n const context = this.graphics;\n\n return this.graphics.fire.apply(context, args);\n }\n\n /**\n * Save image(background) of canvas\n * @param {string} name - Name of image\n * @param {fabric.Image} oImage - Fabric image instance\n */\n setCanvasImage(name, oImage) {\n this.graphics.setCanvasImage(name, oImage);\n }\n\n /**\n * Returns canvas element of fabric.Canvas[[lower-canvas]]\n * @returns {HTMLCanvasElement}\n */\n getCanvasElement() {\n return this.graphics.getCanvasElement();\n }\n\n /**\n * Get fabric.Canvas instance\n * @returns {fabric.Canvas}\n */\n getCanvas() {\n return this.graphics.getCanvas();\n }\n\n /**\n * Get canvasImage (fabric.Image instance)\n * @returns {fabric.Image}\n */\n getCanvasImage() {\n return this.graphics.getCanvasImage();\n }\n\n /**\n * Get image name\n * @returns {string}\n */\n getImageName() {\n return this.graphics.getImageName();\n }\n\n /**\n * Get image editor\n * @returns {ImageEditor}\n */\n getEditor() {\n return this.graphics.getEditor();\n }\n\n /**\n * Return component name\n * @returns {string}\n */\n getName() {\n return this.name;\n }\n\n /**\n * Set image properties\n * @param {Object} setting - Image properties\n * @param {boolean} [withRendering] - If true, The changed image will be reflected in the canvas\n */\n setImageProperties(setting, withRendering) {\n this.graphics.setImageProperties(setting, withRendering);\n }\n\n /**\n * Set canvas dimension - css only\n * @param {Object} dimension - Canvas css dimension\n */\n setCanvasCssDimension(dimension) {\n this.graphics.setCanvasCssDimension(dimension);\n }\n\n /**\n * Set canvas dimension - css only\n * @param {Object} dimension - Canvas backstore dimension\n */\n setCanvasBackstoreDimension(dimension) {\n this.graphics.setCanvasBackstoreDimension(dimension);\n }\n\n /**\n * Adjust canvas dimension with scaling image\n */\n adjustCanvasDimension() {\n this.graphics.adjustCanvasDimension();\n }\n}\n\nexport default Component;\n","var DESCRIPTORS = require('../internals/descriptors');\nvar definePropertyModule = require('../internals/object-define-property');\nvar createPropertyDescriptor = require('../internals/create-property-descriptor');\n\nmodule.exports = DESCRIPTORS ? function (object, key, value) {\n return definePropertyModule.f(object, key, createPropertyDescriptor(1, value));\n} : function (object, key, value) {\n object[key] = value;\n return object;\n};\n","/**\n * Submenu Base Class\n * @class\n * @ignore\n */\nclass Submenu {\n /**\n * @param {HTMLElement} subMenuElement - submenu dom element\n * @param {Locale} locale - translate text\n * @param {string} name - name of sub menu\n * @param {Object} iconStyle - style of icon\n * @param {string} menuBarPosition - position of menu\n * @param {*} templateHtml - template for SubMenuElement\n * @param {boolean} [usageStatistics=false] - template for SubMenuElement\n */\n constructor(\n subMenuElement,\n { locale, name, makeSvgIcon, menuBarPosition, templateHtml, usageStatistics }\n ) {\n this.subMenuElement = subMenuElement;\n this.menuBarPosition = menuBarPosition;\n this.toggleDirection = menuBarPosition === 'top' ? 'down' : 'up';\n this.colorPickerControls = [];\n this.usageStatistics = usageStatistics;\n this.eventHandler = {};\n this._makeSubMenuElement({\n locale,\n name,\n makeSvgIcon,\n templateHtml,\n });\n }\n\n /**\n * editor dom ui query selector\n * @param {string} selectName - query selector string name\n * @returns {HTMLElement}\n */\n selector(selectName) {\n return this.subMenuElement.querySelector(selectName);\n }\n\n /**\n * change show state change for colorpicker instance\n * @param {Colorpicker} occurredControl - target Colorpicker Instance\n */\n colorPickerChangeShow(occurredControl) {\n this.colorPickerControls.forEach((pickerControl) => {\n if (occurredControl !== pickerControl) {\n pickerControl.hide();\n }\n });\n }\n\n /**\n * Get button type\n * @param {HTMLElement} button - event target element\n * @param {array} buttonNames - Array of button names\n * @returns {string} - button type\n */\n getButtonType(button, buttonNames) {\n return button.className.match(RegExp(`(${buttonNames.join('|')})`))[0];\n }\n\n /**\n * Get button type\n * @param {HTMLElement} target - event target element\n * @param {string} removeClass - remove class name\n * @param {string} addClass - add class name\n */\n changeClass(target, removeClass, addClass) {\n target.classList.remove(removeClass);\n target.classList.add(addClass);\n }\n\n /**\n * Interface method whose implementation is optional.\n * Returns the menu to its default state.\n */\n changeStandbyMode() {}\n\n /**\n * Interface method whose implementation is optional.\n * Executed when the menu starts.\n */\n changeStartMode() {}\n\n /**\n * Make submenu dom element\n * @param {Locale} locale - translate text\n * @param {string} name - submenu name\n * @param {Object} iconStyle - icon style\n * @param {*} templateHtml - template for SubMenuElement\n * @private\n */\n _makeSubMenuElement({ locale, name, iconStyle, makeSvgIcon, templateHtml }) {\n const iconSubMenu = document.createElement('div');\n iconSubMenu.className = `tui-image-editor-menu-${name}`;\n iconSubMenu.innerHTML = templateHtml({\n locale,\n iconStyle,\n makeSvgIcon,\n });\n\n this.subMenuElement.appendChild(iconSubMenu);\n }\n}\n\nexport default Submenu;\n","module.exports = function (exec) {\n try {\n return !!exec();\n } catch (error) {\n return true;\n }\n};\n","var isObject = require('../internals/is-object');\n\nmodule.exports = function (it) {\n if (!isObject(it)) {\n throw TypeError(String(it) + ' is not an object');\n } return it;\n};\n","var hasOwnProperty = {}.hasOwnProperty;\n\nmodule.exports = function (it, key) {\n return hasOwnProperty.call(it, key);\n};\n","var fails = require('../internals/fails');\n\n// Thank's IE8 for his funny defineProperty\nmodule.exports = !fails(function () {\n return Object.defineProperty({}, 1, { get: function () { return 7; } })[1] != 7;\n});\n","module.exports = function (it) {\n return typeof it === 'object' ? it !== null : typeof it === 'function';\n};\n","'use strict';\nvar global = require('../internals/global');\nvar getOwnPropertyDescriptor = require('../internals/object-get-own-property-descriptor').f;\nvar isForced = require('../internals/is-forced');\nvar path = require('../internals/path');\nvar bind = require('../internals/function-bind-context');\nvar createNonEnumerableProperty = require('../internals/create-non-enumerable-property');\nvar has = require('../internals/has');\n\nvar wrapConstructor = function (NativeConstructor) {\n var Wrapper = function (a, b, c) {\n if (this instanceof NativeConstructor) {\n switch (arguments.length) {\n case 0: return new NativeConstructor();\n case 1: return new NativeConstructor(a);\n case 2: return new NativeConstructor(a, b);\n } return new NativeConstructor(a, b, c);\n } return NativeConstructor.apply(this, arguments);\n };\n Wrapper.prototype = NativeConstructor.prototype;\n return Wrapper;\n};\n\n/*\n options.target - name of the target object\n options.global - target is the global object\n options.stat - export as static methods of target\n options.proto - export as prototype methods of target\n options.real - real prototype method for the `pure` version\n options.forced - export even if the native feature is available\n options.bind - bind methods to the target, required for the `pure` version\n options.wrap - wrap constructors to preventing global pollution, required for the `pure` version\n options.unsafe - use the simple assignment of property instead of delete + defineProperty\n options.sham - add a flag to not completely full polyfills\n options.enumerable - export as enumerable property\n options.noTargetGet - prevent calling a getter on target\n*/\nmodule.exports = function (options, source) {\n var TARGET = options.target;\n var GLOBAL = options.global;\n var STATIC = options.stat;\n var PROTO = options.proto;\n\n var nativeSource = GLOBAL ? global : STATIC ? global[TARGET] : (global[TARGET] || {}).prototype;\n\n var target = GLOBAL ? path : path[TARGET] || (path[TARGET] = {});\n var targetPrototype = target.prototype;\n\n var FORCED, USE_NATIVE, VIRTUAL_PROTOTYPE;\n var key, sourceProperty, targetProperty, nativeProperty, resultProperty, descriptor;\n\n for (key in source) {\n FORCED = isForced(GLOBAL ? key : TARGET + (STATIC ? '.' : '#') + key, options.forced);\n // contains in native\n USE_NATIVE = !FORCED && nativeSource && has(nativeSource, key);\n\n targetProperty = target[key];\n\n if (USE_NATIVE) if (options.noTargetGet) {\n descriptor = getOwnPropertyDescriptor(nativeSource, key);\n nativeProperty = descriptor && descriptor.value;\n } else nativeProperty = nativeSource[key];\n\n // export native or implementation\n sourceProperty = (USE_NATIVE && nativeProperty) ? nativeProperty : source[key];\n\n if (USE_NATIVE && typeof targetProperty === typeof sourceProperty) continue;\n\n // bind timers to global for call from export context\n if (options.bind && USE_NATIVE) resultProperty = bind(sourceProperty, global);\n // wrap global constructors for prevent changs in this version\n else if (options.wrap && USE_NATIVE) resultProperty = wrapConstructor(sourceProperty);\n // make static versions for prototype methods\n else if (PROTO && typeof sourceProperty == 'function') resultProperty = bind(Function.call, sourceProperty);\n // default case\n else resultProperty = sourceProperty;\n\n // add a flag to not completely full polyfills\n if (options.sham || (sourceProperty && sourceProperty.sham) || (targetProperty && targetProperty.sham)) {\n createNonEnumerableProperty(resultProperty, 'sham', true);\n }\n\n target[key] = resultProperty;\n\n if (PROTO) {\n VIRTUAL_PROTOTYPE = TARGET + 'Prototype';\n if (!has(path, VIRTUAL_PROTOTYPE)) {\n createNonEnumerableProperty(path, VIRTUAL_PROTOTYPE, {});\n }\n // export virtual prototype methods\n path[VIRTUAL_PROTOTYPE][key] = sourceProperty;\n // export real prototype methods\n if (options.real && targetPrototype && !targetPrototype[key]) {\n createNonEnumerableProperty(targetPrototype, key, sourceProperty);\n }\n }\n }\n};\n","/**\n * @author NHN. FE Development Team \n * @fileoverview DrawingMode interface\n */\nimport errorMessage from '@/factory/errorMessage';\n\nconst createMessage = errorMessage.create;\nconst errorTypes = errorMessage.types;\n\n/**\n * DrawingMode interface\n * @class\n * @param {string} name - drawing mode name\n * @ignore\n */\nclass DrawingMode {\n constructor(name) {\n /**\n * the name of drawing mode\n * @type {string}\n */\n this.name = name;\n }\n\n /**\n * Get this drawing mode name;\n * @returns {string} drawing mode name\n */\n getName() {\n return this.name;\n }\n\n /**\n * start this drawing mode\n * @param {Object} options - drawing mode options\n * @abstract\n */\n start() {\n throw new Error(createMessage(errorTypes.UN_IMPLEMENTATION, 'start'));\n }\n\n /**\n * stop this drawing mode\n * @abstract\n */\n end() {\n throw new Error(createMessage(errorTypes.UN_IMPLEMENTATION, 'stop'));\n }\n}\n\nexport default DrawingMode;\n","module.exports = function (it) {\n if (typeof it != 'function') {\n throw TypeError(String(it) + ' is not a function');\n } return it;\n};\n","var path = require('../internals/path');\nvar global = require('../internals/global');\n\nvar aFunction = function (variable) {\n return typeof variable == 'function' ? variable : undefined;\n};\n\nmodule.exports = function (namespace, method) {\n return arguments.length < 2 ? aFunction(path[namespace]) || aFunction(global[namespace])\n : path[namespace] && path[namespace][method] || global[namespace] && global[namespace][method];\n};\n","module.exports = {};\n","var DESCRIPTORS = require('../internals/descriptors');\nvar IE8_DOM_DEFINE = require('../internals/ie8-dom-define');\nvar anObject = require('../internals/an-object');\nvar toPrimitive = require('../internals/to-primitive');\n\nvar nativeDefineProperty = Object.defineProperty;\n\n// `Object.defineProperty` method\n// https://tc39.github.io/ecma262/#sec-object.defineproperty\nexports.f = DESCRIPTORS ? nativeDefineProperty : function defineProperty(O, P, Attributes) {\n anObject(O);\n P = toPrimitive(P, true);\n anObject(Attributes);\n if (IE8_DOM_DEFINE) try {\n return nativeDefineProperty(O, P, Attributes);\n } catch (error) { /* empty */ }\n if ('get' in Attributes || 'set' in Attributes) throw TypeError('Accessors not supported');\n if ('value' in Attributes) O[P] = Attributes.value;\n return O;\n};\n","module.exports = true;\n","var toString = {}.toString;\n\nmodule.exports = function (it) {\n return toString.call(it).slice(8, -1);\n};\n","'use strict';\nvar aFunction = require('../internals/a-function');\n\nvar PromiseCapability = function (C) {\n var resolve, reject;\n this.promise = new C(function ($$resolve, $$reject) {\n if (resolve !== undefined || reject !== undefined) throw TypeError('Bad Promise constructor');\n resolve = $$resolve;\n reject = $$reject;\n });\n this.resolve = aFunction(resolve);\n this.reject = aFunction(reject);\n};\n\n// 25.4.1.5 NewPromiseCapability(C)\nmodule.exports.f = function (C) {\n return new PromiseCapability(C);\n};\n","import snippet from 'tui-code-snippet';\nimport tuiColorPicker from 'tui-color-picker';\n\nconst PICKER_COLOR = [\n '#000000',\n '#2a2a2a',\n '#545454',\n '#7e7e7e',\n '#a8a8a8',\n '#d2d2d2',\n '#ffffff',\n '',\n '#ff4040',\n '#ff6518',\n '#ffbb3b',\n '#03bd9e',\n '#00a9ff',\n '#515ce6',\n '#9e5fff',\n '#ff5583',\n];\n\n/**\n * Colorpicker control class\n * @class\n * @ignore\n */\nclass Colorpicker {\n constructor(\n colorpickerElement,\n defaultColor = '#7e7e7e',\n toggleDirection = 'up',\n usageStatistics\n ) {\n this.colorpickerElement = colorpickerElement;\n this.usageStatistics = usageStatistics;\n\n this._show = false;\n\n this._colorpickerElement = colorpickerElement;\n this._toggleDirection = toggleDirection;\n this._makePickerButtonElement(defaultColor);\n this._makePickerLayerElement(colorpickerElement, colorpickerElement.getAttribute('title'));\n this._color = defaultColor;\n this.picker = tuiColorPicker.create({\n container: this.pickerElement,\n preset: PICKER_COLOR,\n color: defaultColor,\n usageStatistics: this.usageStatistics,\n });\n\n this._addEvent();\n }\n\n /**\n * Destroys the instance.\n */\n destroy() {\n this._removeEvent();\n this.picker.destroy();\n this.colorpickerElement.innerHTML = '';\n snippet.forEach(this, (value, key) => {\n this[key] = null;\n });\n }\n\n /**\n * Get color\n * @returns {Number} color value\n */\n get color() {\n return this._color;\n }\n\n /**\n * Set color\n * @param {string} color color value\n */\n set color(color) {\n this._color = color;\n this._changeColorElement(color);\n }\n\n /**\n * Change color element\n * @param {string} color color value\n * #private\n */\n _changeColorElement(color) {\n if (color) {\n this.colorElement.classList.remove('transparent');\n this.colorElement.style.backgroundColor = color;\n } else {\n this.colorElement.style.backgroundColor = '#fff';\n this.colorElement.classList.add('transparent');\n }\n }\n\n /**\n * Make picker button element\n * @param {string} defaultColor color value\n * @private\n */\n _makePickerButtonElement(defaultColor) {\n this.colorpickerElement.classList.add('tui-image-editor-button');\n\n this.colorElement = document.createElement('div');\n this.colorElement.className = 'color-picker-value';\n if (defaultColor) {\n this.colorElement.style.backgroundColor = defaultColor;\n } else {\n this.colorElement.classList.add('transparent');\n }\n }\n\n /**\n * Make picker layer element\n * @param {HTMLElement} colorpickerElement color picker element\n * @param {string} title picker title\n * @private\n */\n _makePickerLayerElement(colorpickerElement, title) {\n const label = document.createElement('label');\n const triangle = document.createElement('div');\n\n this.pickerControl = document.createElement('div');\n this.pickerControl.className = 'color-picker-control';\n\n this.pickerElement = document.createElement('div');\n this.pickerElement.className = 'color-picker';\n\n label.innerHTML = title;\n triangle.className = 'triangle';\n\n this.pickerControl.appendChild(this.pickerElement);\n this.pickerControl.appendChild(triangle);\n\n colorpickerElement.appendChild(this.pickerControl);\n colorpickerElement.appendChild(this.colorElement);\n colorpickerElement.appendChild(label);\n }\n\n /**\n * Add event\n * @private\n */\n _addEvent() {\n this.picker.on('selectColor', (value) => {\n this._changeColorElement(value.color);\n this._color = value.color;\n this.fire('change', value.color);\n });\n\n this.eventHandler = {\n pickerToggle: this._pickerToggleEventHandler.bind(this),\n pickerHide: () => this.hide(),\n };\n\n this.colorpickerElement.addEventListener('click', this.eventHandler.pickerToggle);\n document.body.addEventListener('click', this.eventHandler.pickerHide);\n }\n\n /**\n * Remove event\n * @private\n */\n _removeEvent() {\n this.colorpickerElement.removeEventListener('click', this.eventHandler.pickerToggle);\n document.body.removeEventListener('click', this.eventHandler.pickerHide);\n this.picker.off();\n }\n\n /**\n * Picker toggle event handler\n * @param {object} event - change event\n * @private\n */\n _pickerToggleEventHandler(event) {\n const { target } = event;\n const isInPickerControl = target && this._isElementInColorPickerControl(target);\n\n if (!isInPickerControl || (isInPickerControl && this._isPaletteButton(target))) {\n this._show = !this._show;\n this.pickerControl.style.display = this._show ? 'block' : 'none';\n this._setPickerControlPosition();\n this.fire('changeShow', this);\n }\n event.stopPropagation();\n }\n\n /**\n * Check hex input or not\n * @param {Element} target - Event target element\n * @returns {boolean}\n * @private\n */\n _isPaletteButton(target) {\n return target.className === 'tui-colorpicker-palette-button';\n }\n\n /**\n * Check given element is in pickerControl element\n * @param {Element} element - element to check\n * @returns {boolean}\n * @private\n */\n _isElementInColorPickerControl(element) {\n let parentNode = element;\n\n while (parentNode !== document.body) {\n if (!parentNode) {\n break;\n }\n\n if (parentNode === this.pickerControl) {\n return true;\n }\n\n parentNode = parentNode.parentNode;\n }\n\n return false;\n }\n\n hide() {\n this._show = false;\n this.pickerControl.style.display = 'none';\n }\n\n /**\n * Set picker control position\n * @private\n */\n _setPickerControlPosition() {\n const controlStyle = this.pickerControl.style;\n const halfPickerWidth = this._colorpickerElement.clientWidth / 2 + 2;\n const left = this.pickerControl.offsetWidth / 2 - halfPickerWidth;\n let top = (this.pickerControl.offsetHeight + 10) * -1;\n\n if (this._toggleDirection === 'down') {\n top = 30;\n }\n\n controlStyle.top = `${top}px`;\n controlStyle.left = `-${left}px`;\n }\n}\n\nsnippet.CustomEvents.mixin(Colorpicker);\nexport default Colorpicker;\n","import snippet from 'tui-code-snippet';\nimport { toInteger, clamp } from '@/util';\nimport { keyCodes } from '@/consts';\n\nconst INPUT_FILTER_REGEXP = /(-?)([0-9]*)[^0-9]*([0-9]*)/g;\n\n/**\n * Range control class\n * @class\n * @ignore\n */\nclass Range {\n /**\n * @constructor\n * @extends {View}\n * @param {Object} rangeElements - Html resources for creating sliders\n * @param {HTMLElement} rangeElements.slider - b\n * @param {HTMLElement} [rangeElements.input] - c\n * @param {Object} options - Slider make options\n * @param {number} options.min - min value\n * @param {number} options.max - max value\n * @param {number} options.value - default value\n * @param {number} [options.useDecimal] - Decimal point processing.\n * @param {boolean} [options.realTimeEvent] - Reflect live events.\n */\n constructor(rangeElements, options = {}) {\n this._value = options.value || 0;\n\n this.rangeElement = rangeElements.slider;\n this.rangeInputElement = rangeElements.input;\n\n this._drawRangeElement();\n\n this.rangeWidth = this._getRangeWidth();\n this._min = options.min || 0;\n this._max = options.max || 100;\n this._useDecimal = options.useDecimal;\n this._absMax = this._min * -1 + this._max;\n this.realTimeEvent = options.realTimeEvent || false;\n\n this.eventHandler = {\n startChangingSlide: this._startChangingSlide.bind(this),\n stopChangingSlide: this._stopChangingSlide.bind(this),\n changeSlide: this._changeSlide.bind(this),\n changeSlideFinally: this._changeSlideFinally.bind(this),\n changeInput: this._changeValueWithInput.bind(this, false),\n changeInputFinally: this._changeValueWithInput.bind(this, true),\n changeInputWithArrow: this._changeValueWithInputKeyEvent.bind(this),\n };\n\n this._addClickEvent();\n this._addDragEvent();\n this._addInputEvent();\n this.value = options.value;\n this.trigger('change');\n }\n\n /**\n * Destroys the instance.\n */\n destroy() {\n this._removeClickEvent();\n this._removeDragEvent();\n this._removeInputEvent();\n this.rangeElement.innerHTML = '';\n snippet.forEach(this, (value, key) => {\n this[key] = null;\n });\n }\n\n /**\n * Set range max value and re position cursor\n * @param {number} maxValue - max value\n */\n set max(maxValue) {\n this._max = maxValue;\n this._absMax = this._min * -1 + this._max;\n this.value = this._value;\n }\n\n get max() {\n return this._max;\n }\n\n /**\n * Get range value\n * @returns {Number} range value\n */\n get value() {\n return this._value;\n }\n\n /**\n * Set range value\n * @param {Number} value range value\n */\n set value(value) {\n value = this._useDecimal ? value : toInteger(value);\n\n const absValue = value - this._min;\n let leftPosition = (absValue * this.rangeWidth) / this._absMax;\n\n if (this.rangeWidth < leftPosition) {\n leftPosition = this.rangeWidth;\n }\n\n this.pointer.style.left = `${leftPosition}px`;\n this.subbar.style.right = `${this.rangeWidth - leftPosition}px`;\n\n this._value = value;\n if (this.rangeInputElement) {\n this.rangeInputElement.value = value;\n }\n }\n\n /**\n * event trigger\n * @param {string} type - type\n */\n trigger(type) {\n this.fire(type, this._value);\n }\n\n /**\n * Calculate slider width\n * @returns {number} - slider width\n */\n _getRangeWidth() {\n const getElementWidth = (element) => toInteger(window.getComputedStyle(element, null).width);\n\n return getElementWidth(this.rangeElement) - getElementWidth(this.pointer);\n }\n\n /**\n * Make range element\n * @private\n */\n _drawRangeElement() {\n this.rangeElement.classList.add('tui-image-editor-range');\n\n this.bar = document.createElement('div');\n this.bar.className = 'tui-image-editor-virtual-range-bar';\n\n this.subbar = document.createElement('div');\n this.subbar.className = 'tui-image-editor-virtual-range-subbar';\n\n this.pointer = document.createElement('div');\n this.pointer.className = 'tui-image-editor-virtual-range-pointer';\n\n this.bar.appendChild(this.subbar);\n this.bar.appendChild(this.pointer);\n this.rangeElement.appendChild(this.bar);\n }\n\n /**\n * Add range input editing event\n * @private\n */\n _addInputEvent() {\n if (this.rangeInputElement) {\n this.rangeInputElement.addEventListener('keydown', this.eventHandler.changeInputWithArrow);\n this.rangeInputElement.addEventListener('keyup', this.eventHandler.changeInput);\n this.rangeInputElement.addEventListener('blur', this.eventHandler.changeInputFinally);\n }\n }\n\n /**\n * Remove range input editing event\n * @private\n */\n _removeInputEvent() {\n if (this.rangeInputElement) {\n this.rangeInputElement.removeEventListener('keydown', this.eventHandler.changeInputWithArrow);\n this.rangeInputElement.removeEventListener('keyup', this.eventHandler.changeInput);\n this.rangeInputElement.removeEventListener('blur', this.eventHandler.changeInputFinally);\n }\n }\n\n /**\n * change angle event\n * @param {object} event - key event\n * @private\n */\n _changeValueWithInputKeyEvent(event) {\n const { keyCode, target } = event;\n\n if ([keyCodes.ARROW_UP, keyCodes.ARROW_DOWN].indexOf(keyCode) < 0) {\n return;\n }\n\n let value = Number(target.value);\n\n value = this._valueUpDownForKeyEvent(value, keyCode);\n\n const unChanged = value < this._min || value > this._max;\n\n if (!unChanged) {\n const clampValue = clamp(value, this._min, this.max);\n this.value = clampValue;\n this.fire('change', clampValue, false);\n }\n }\n\n /**\n * value up down for input\n * @param {number} value - original value number\n * @param {number} keyCode - input event key code\n * @returns {number} value - changed value\n * @private\n */\n _valueUpDownForKeyEvent(value, keyCode) {\n const step = this._useDecimal ? 0.1 : 1;\n\n if (keyCode === keyCodes.ARROW_UP) {\n value += step;\n } else if (keyCode === keyCodes.ARROW_DOWN) {\n value -= step;\n }\n\n return value;\n }\n\n /**\n * change angle event\n * @param {boolean} isLast - Is last change\n * @param {object} event - key event\n * @private\n */\n _changeValueWithInput(isLast, event) {\n const { keyCode, target } = event;\n\n if ([keyCodes.ARROW_UP, keyCodes.ARROW_DOWN].indexOf(keyCode) >= 0) {\n return;\n }\n\n const stringValue = this._filterForInputText(target.value);\n const waitForChange = !stringValue || isNaN(stringValue);\n target.value = stringValue;\n\n if (!waitForChange) {\n let value = this._useDecimal ? Number(stringValue) : toInteger(stringValue);\n value = clamp(value, this._min, this.max);\n\n this.value = value;\n this.fire('change', value, isLast);\n }\n }\n\n /**\n * Add Range click event\n * @private\n */\n _addClickEvent() {\n this.rangeElement.addEventListener('click', this.eventHandler.changeSlideFinally);\n }\n\n /**\n * Remove Range click event\n * @private\n */\n _removeClickEvent() {\n this.rangeElement.removeEventListener('click', this.eventHandler.changeSlideFinally);\n }\n\n /**\n * Add Range drag event\n * @private\n */\n _addDragEvent() {\n this.pointer.addEventListener('mousedown', this.eventHandler.startChangingSlide);\n }\n\n /**\n * Remove Range drag event\n * @private\n */\n _removeDragEvent() {\n this.pointer.removeEventListener('mousedown', this.eventHandler.startChangingSlide);\n }\n\n /**\n * change angle event\n * @param {object} event - change event\n * @private\n */\n _changeSlide(event) {\n const changePosition = event.screenX;\n const diffPosition = changePosition - this.firstPosition;\n let touchPx = this.firstLeft + diffPosition;\n touchPx = touchPx > this.rangeWidth ? this.rangeWidth : touchPx;\n touchPx = touchPx < 0 ? 0 : touchPx;\n\n this.pointer.style.left = `${touchPx}px`;\n this.subbar.style.right = `${this.rangeWidth - touchPx}px`;\n\n const ratio = touchPx / this.rangeWidth;\n const resultValue = this._absMax * ratio + this._min;\n const value = this._useDecimal ? resultValue : toInteger(resultValue);\n const isValueChanged = this.value !== value;\n\n if (isValueChanged) {\n this.value = value;\n if (this.realTimeEvent) {\n this.fire('change', this._value, false);\n }\n }\n }\n\n _changeSlideFinally(event) {\n event.stopPropagation();\n if (event.target.className !== 'tui-image-editor-range') {\n return;\n }\n const touchPx = event.offsetX;\n const ratio = touchPx / this.rangeWidth;\n const value = this._absMax * ratio + this._min;\n this.pointer.style.left = `${ratio * this.rangeWidth}px`;\n this.subbar.style.right = `${(1 - ratio) * this.rangeWidth}px`;\n this.value = value;\n\n this.fire('change', value, true);\n }\n\n _startChangingSlide(event) {\n this.firstPosition = event.screenX;\n this.firstLeft = toInteger(this.pointer.style.left) || 0;\n\n document.addEventListener('mousemove', this.eventHandler.changeSlide);\n document.addEventListener('mouseup', this.eventHandler.stopChangingSlide);\n }\n\n /**\n * stop change angle event\n * @private\n */\n _stopChangingSlide() {\n this.fire('change', this._value, true);\n\n document.removeEventListener('mousemove', this.eventHandler.changeSlide);\n document.removeEventListener('mouseup', this.eventHandler.stopChangingSlide);\n }\n\n /**\n * Unnecessary string filtering.\n * @param {string} inputValue - origin string of input\n * @returns {string} filtered string\n * @private\n */\n _filterForInputText(inputValue) {\n return inputValue.replace(INPUT_FILTER_REGEXP, '$1$2$3');\n }\n}\n\nsnippet.CustomEvents.mixin(Range);\n\nexport default Range;\n","var NATIVE_WEAK_MAP = require('../internals/native-weak-map');\nvar global = require('../internals/global');\nvar isObject = require('../internals/is-object');\nvar createNonEnumerableProperty = require('../internals/create-non-enumerable-property');\nvar objectHas = require('../internals/has');\nvar sharedKey = require('../internals/shared-key');\nvar hiddenKeys = require('../internals/hidden-keys');\n\nvar WeakMap = global.WeakMap;\nvar set, get, has;\n\nvar enforce = function (it) {\n return has(it) ? get(it) : set(it, {});\n};\n\nvar getterFor = function (TYPE) {\n return function (it) {\n var state;\n if (!isObject(it) || (state = get(it)).type !== TYPE) {\n throw TypeError('Incompatible receiver, ' + TYPE + ' required');\n } return state;\n };\n};\n\nif (NATIVE_WEAK_MAP) {\n var store = new WeakMap();\n var wmget = store.get;\n var wmhas = store.has;\n var wmset = store.set;\n set = function (it, metadata) {\n wmset.call(store, it, metadata);\n return metadata;\n };\n get = function (it) {\n return wmget.call(store, it) || {};\n };\n has = function (it) {\n return wmhas.call(store, it);\n };\n} else {\n var STATE = sharedKey('state');\n hiddenKeys[STATE] = true;\n set = function (it, metadata) {\n createNonEnumerableProperty(it, STATE, metadata);\n return metadata;\n };\n get = function (it) {\n return objectHas(it, STATE) ? it[STATE] : {};\n };\n has = function (it) {\n return objectHas(it, STATE);\n };\n}\n\nmodule.exports = {\n set: set,\n get: get,\n has: has,\n enforce: enforce,\n getterFor: getterFor\n};\n","module.exports = function (bitmap, value) {\n return {\n enumerable: !(bitmap & 1),\n configurable: !(bitmap & 2),\n writable: !(bitmap & 4),\n value: value\n };\n};\n","// toObject with fallback for non-array-like ES3 strings\nvar IndexedObject = require('../internals/indexed-object');\nvar requireObjectCoercible = require('../internals/require-object-coercible');\n\nmodule.exports = function (it) {\n return IndexedObject(requireObjectCoercible(it));\n};\n","var createNonEnumerableProperty = require('../internals/create-non-enumerable-property');\n\nmodule.exports = function (target, key, value, options) {\n if (options && options.enumerable) target[key] = value;\n else createNonEnumerableProperty(target, key, value);\n};\n","var anObject = require('../internals/an-object');\nvar isArrayIteratorMethod = require('../internals/is-array-iterator-method');\nvar toLength = require('../internals/to-length');\nvar bind = require('../internals/function-bind-context');\nvar getIteratorMethod = require('../internals/get-iterator-method');\nvar callWithSafeIterationClosing = require('../internals/call-with-safe-iteration-closing');\n\nvar Result = function (stopped, result) {\n this.stopped = stopped;\n this.result = result;\n};\n\nvar iterate = module.exports = function (iterable, fn, that, AS_ENTRIES, IS_ITERATOR) {\n var boundFunction = bind(fn, that, AS_ENTRIES ? 2 : 1);\n var iterator, iterFn, index, length, result, next, step;\n\n if (IS_ITERATOR) {\n iterator = iterable;\n } else {\n iterFn = getIteratorMethod(iterable);\n if (typeof iterFn != 'function') throw TypeError('Target is not iterable');\n // optimisation for array iterators\n if (isArrayIteratorMethod(iterFn)) {\n for (index = 0, length = toLength(iterable.length); length > index; index++) {\n result = AS_ENTRIES\n ? boundFunction(anObject(step = iterable[index])[0], step[1])\n : boundFunction(iterable[index]);\n if (result && result instanceof Result) return result;\n } return new Result(false);\n }\n iterator = iterFn.call(iterable);\n }\n\n next = iterator.next;\n while (!(step = next.call(iterator)).done) {\n result = callWithSafeIterationClosing(iterator, boundFunction, step.value, AS_ENTRIES);\n if (typeof result == 'object' && result && result instanceof Result) return result;\n } return new Result(false);\n};\n\niterate.stop = function (result) {\n return new Result(true, result);\n};\n","module.exports = function (exec) {\n try {\n return { error: false, value: exec() };\n } catch (error) {\n return { error: true, value: error };\n }\n};\n","/**\n * @author NHN. FE Development Team \n * @fileoverview Selection modification helper\n */\n\nimport { extend } from 'tui-code-snippet';\n\n/**\n * Cached selection's info\n * @type {Array}\n * @private\n */\nlet cachedUndoDataForChangeDimension = null;\n\n/**\n * Set cached undo data\n * @param {Array} undoData - selection object\n * @private\n */\nexport function setCachedUndoDataForDimension(undoData) {\n cachedUndoDataForChangeDimension = undoData;\n}\n\n/**\n * Get cached undo data\n * @returns {Object} cached undo data\n * @private\n */\nexport function getCachedUndoDataForDimension() {\n return cachedUndoDataForChangeDimension;\n}\n\n/**\n * Make undo data\n * @param {fabric.Object} obj - selection object\n * @param {Function} undoDatumMaker - make undo datum\n * @returns {Array} undoData\n * @private\n */\nexport function makeSelectionUndoData(obj, undoDatumMaker) {\n let undoData;\n\n if (obj.type === 'activeSelection') {\n undoData = obj.getObjects().map((item) => {\n const { angle, left, top, scaleX, scaleY, width, height } = item;\n\n obj.realizeTransform(item);\n const result = undoDatumMaker(item);\n\n item.set({\n angle,\n left,\n top,\n width,\n height,\n scaleX,\n scaleY,\n });\n\n return result;\n });\n } else {\n undoData = [undoDatumMaker(obj)];\n }\n\n return undoData;\n}\n\n/**\n * Make undo datum\n * @param {number} id - object id\n * @param {fabric.Object} obj - selection object\n * @param {boolean} isSelection - whether or not object is selection\n * @returns {Object} undo datum\n * @private\n */\nexport function makeSelectionUndoDatum(id, obj, isSelection) {\n return isSelection\n ? {\n id,\n width: obj.width,\n height: obj.height,\n top: obj.top,\n left: obj.left,\n angle: obj.angle,\n scaleX: obj.scaleX,\n scaleY: obj.scaleY,\n }\n : extend({ id }, obj);\n}\n","var ceil = Math.ceil;\nvar floor = Math.floor;\n\n// `ToInteger` abstract operation\n// https://tc39.github.io/ecma262/#sec-tointeger\nmodule.exports = function (argument) {\n return isNaN(argument = +argument) ? 0 : (argument > 0 ? floor : ceil)(argument);\n};\n","// `RequireObjectCoercible` abstract operation\n// https://tc39.github.io/ecma262/#sec-requireobjectcoercible\nmodule.exports = function (it) {\n if (it == undefined) throw TypeError(\"Can't call method on \" + it);\n return it;\n};\n","var global = require('../internals/global');\nvar isObject = require('../internals/is-object');\n\nvar document = global.document;\n// typeof document.createElement is 'object' in old IE\nvar EXISTS = isObject(document) && isObject(document.createElement);\n\nmodule.exports = function (it) {\n return EXISTS ? document.createElement(it) : {};\n};\n","var shared = require('../internals/shared');\nvar uid = require('../internals/uid');\n\nvar keys = shared('keys');\n\nmodule.exports = function (key) {\n return keys[key] || (keys[key] = uid(key));\n};\n","module.exports = {};\n","module.exports = {};\n","var aFunction = require('../internals/a-function');\n\n// optional / simple context binding\nmodule.exports = function (fn, that, length) {\n aFunction(fn);\n if (that === undefined) return fn;\n switch (length) {\n case 0: return function () {\n return fn.call(that);\n };\n case 1: return function (a) {\n return fn.call(that, a);\n };\n case 2: return function (a, b) {\n return fn.call(that, a, b);\n };\n case 3: return function (a, b, c) {\n return fn.call(that, a, b, c);\n };\n }\n return function (/* ...args */) {\n return fn.apply(that, arguments);\n };\n};\n","var has = require('../internals/has');\nvar toObject = require('../internals/to-object');\nvar sharedKey = require('../internals/shared-key');\nvar CORRECT_PROTOTYPE_GETTER = require('../internals/correct-prototype-getter');\n\nvar IE_PROTO = sharedKey('IE_PROTO');\nvar ObjectPrototype = Object.prototype;\n\n// `Object.getPrototypeOf` method\n// https://tc39.github.io/ecma262/#sec-object.getprototypeof\nmodule.exports = CORRECT_PROTOTYPE_GETTER ? Object.getPrototypeOf : function (O) {\n O = toObject(O);\n if (has(O, IE_PROTO)) return O[IE_PROTO];\n if (typeof O.constructor == 'function' && O instanceof O.constructor) {\n return O.constructor.prototype;\n } return O instanceof Object ? ObjectPrototype : null;\n};\n","var TO_STRING_TAG_SUPPORT = require('../internals/to-string-tag-support');\nvar defineProperty = require('../internals/object-define-property').f;\nvar createNonEnumerableProperty = require('../internals/create-non-enumerable-property');\nvar has = require('../internals/has');\nvar toString = require('../internals/object-to-string');\nvar wellKnownSymbol = require('../internals/well-known-symbol');\n\nvar TO_STRING_TAG = wellKnownSymbol('toStringTag');\n\nmodule.exports = function (it, TAG, STATIC, SET_METHOD) {\n if (it) {\n var target = STATIC ? it : it.prototype;\n if (!has(target, TO_STRING_TAG)) {\n defineProperty(target, TO_STRING_TAG, { configurable: true, value: TAG });\n }\n if (SET_METHOD && !TO_STRING_TAG_SUPPORT) {\n createNonEnumerableProperty(target, 'toString', toString);\n }\n }\n};\n","var wellKnownSymbol = require('../internals/well-known-symbol');\n\nvar TO_STRING_TAG = wellKnownSymbol('toStringTag');\nvar test = {};\n\ntest[TO_STRING_TAG] = 'z';\n\nmodule.exports = String(test) === '[object z]';\n","var TO_STRING_TAG_SUPPORT = require('../internals/to-string-tag-support');\nvar classofRaw = require('../internals/classof-raw');\nvar wellKnownSymbol = require('../internals/well-known-symbol');\n\nvar TO_STRING_TAG = wellKnownSymbol('toStringTag');\n// ES3 wrong here\nvar CORRECT_ARGUMENTS = classofRaw(function () { return arguments; }()) == 'Arguments';\n\n// fallback for IE11 Script Access Denied error\nvar tryGet = function (it, key) {\n try {\n return it[key];\n } catch (error) { /* empty */ }\n};\n\n// getting tag from ES6+ `Object.prototype.toString`\nmodule.exports = TO_STRING_TAG_SUPPORT ? classofRaw : function (it) {\n var O, tag, result;\n return it === undefined ? 'Undefined' : it === null ? 'Null'\n // @@toStringTag case\n : typeof (tag = tryGet(O = Object(it), TO_STRING_TAG)) == 'string' ? tag\n // builtinTag case\n : CORRECT_ARGUMENTS ? classofRaw(O)\n // ES3 arguments fallback\n : (result = classofRaw(O)) == 'Object' && typeof O.callee == 'function' ? 'Arguments' : result;\n};\n","/**\n * @author NHN. FE Development Team \n * @fileoverview Error-message factory\n */\nimport snippet from 'tui-code-snippet';\nimport { keyMirror } from '@/util';\n\nconst types = keyMirror('UN_IMPLEMENTATION', 'NO_COMPONENT_NAME');\nconst messages = {\n UN_IMPLEMENTATION: 'Should implement a method: ',\n NO_COMPONENT_NAME: 'Should set a component name',\n};\nconst map = {\n UN_IMPLEMENTATION(methodName) {\n return messages.UN_IMPLEMENTATION + methodName;\n },\n NO_COMPONENT_NAME() {\n return messages.NO_COMPONENT_NAME;\n },\n};\n\nexport default {\n types: snippet.extend({}, types),\n\n create(type, ...args) {\n type = type.toLowerCase();\n const func = map[type];\n\n return func(...args);\n },\n};\n","var store = require('../internals/shared-store');\n\nvar functionToString = Function.toString;\n\n// this helper broken in `3.4.1-3.4.4`, so we can't use `shared` helper\nif (typeof store.inspectSource != 'function') {\n store.inspectSource = function (it) {\n return functionToString.call(it);\n };\n}\n\nmodule.exports = store.inspectSource;\n","var global = require('../internals/global');\nvar setGlobal = require('../internals/set-global');\n\nvar SHARED = '__core-js_shared__';\nvar store = global[SHARED] || setGlobal(SHARED, {});\n\nmodule.exports = store;\n","var DESCRIPTORS = require('../internals/descriptors');\nvar fails = require('../internals/fails');\nvar createElement = require('../internals/document-create-element');\n\n// Thank's IE8 for his funny defineProperty\nmodule.exports = !DESCRIPTORS && !fails(function () {\n return Object.defineProperty(createElement('div'), 'a', {\n get: function () { return 7; }\n }).a != 7;\n});\n","var isObject = require('../internals/is-object');\n\n// `ToPrimitive` abstract operation\n// https://tc39.github.io/ecma262/#sec-toprimitive\n// instead of the ES6 spec version, we didn't implement @@toPrimitive case\n// and the second argument - flag - preferred type is a string\nmodule.exports = function (input, PREFERRED_STRING) {\n if (!isObject(input)) return input;\n var fn, val;\n if (PREFERRED_STRING && typeof (fn = input.toString) == 'function' && !isObject(val = fn.call(input))) return val;\n if (typeof (fn = input.valueOf) == 'function' && !isObject(val = fn.call(input))) return val;\n if (!PREFERRED_STRING && typeof (fn = input.toString) == 'function' && !isObject(val = fn.call(input))) return val;\n throw TypeError(\"Can't convert object to primitive value\");\n};\n","var IS_PURE = require('../internals/is-pure');\nvar store = require('../internals/shared-store');\n\n(module.exports = function (key, value) {\n return store[key] || (store[key] = value !== undefined ? value : {});\n})('versions', []).push({\n version: '3.6.4',\n mode: IS_PURE ? 'pure' : 'global',\n copyright: '© 2020 Denis Pushkarev (zloirock.ru)'\n});\n","var id = 0;\nvar postfix = Math.random();\n\nmodule.exports = function (key) {\n return 'Symbol(' + String(key === undefined ? '' : key) + ')_' + (++id + postfix).toString(36);\n};\n","'use strict';\nvar $ = require('../internals/export');\nvar createIteratorConstructor = require('../internals/create-iterator-constructor');\nvar getPrototypeOf = require('../internals/object-get-prototype-of');\nvar setPrototypeOf = require('../internals/object-set-prototype-of');\nvar setToStringTag = require('../internals/set-to-string-tag');\nvar createNonEnumerableProperty = require('../internals/create-non-enumerable-property');\nvar redefine = require('../internals/redefine');\nvar wellKnownSymbol = require('../internals/well-known-symbol');\nvar IS_PURE = require('../internals/is-pure');\nvar Iterators = require('../internals/iterators');\nvar IteratorsCore = require('../internals/iterators-core');\n\nvar IteratorPrototype = IteratorsCore.IteratorPrototype;\nvar BUGGY_SAFARI_ITERATORS = IteratorsCore.BUGGY_SAFARI_ITERATORS;\nvar ITERATOR = wellKnownSymbol('iterator');\nvar KEYS = 'keys';\nvar VALUES = 'values';\nvar ENTRIES = 'entries';\n\nvar returnThis = function () { return this; };\n\nmodule.exports = function (Iterable, NAME, IteratorConstructor, next, DEFAULT, IS_SET, FORCED) {\n createIteratorConstructor(IteratorConstructor, NAME, next);\n\n var getIterationMethod = function (KIND) {\n if (KIND === DEFAULT && defaultIterator) return defaultIterator;\n if (!BUGGY_SAFARI_ITERATORS && KIND in IterablePrototype) return IterablePrototype[KIND];\n switch (KIND) {\n case KEYS: return function keys() { return new IteratorConstructor(this, KIND); };\n case VALUES: return function values() { return new IteratorConstructor(this, KIND); };\n case ENTRIES: return function entries() { return new IteratorConstructor(this, KIND); };\n } return function () { return new IteratorConstructor(this); };\n };\n\n var TO_STRING_TAG = NAME + ' Iterator';\n var INCORRECT_VALUES_NAME = false;\n var IterablePrototype = Iterable.prototype;\n var nativeIterator = IterablePrototype[ITERATOR]\n || IterablePrototype['@@iterator']\n || DEFAULT && IterablePrototype[DEFAULT];\n var defaultIterator = !BUGGY_SAFARI_ITERATORS && nativeIterator || getIterationMethod(DEFAULT);\n var anyNativeIterator = NAME == 'Array' ? IterablePrototype.entries || nativeIterator : nativeIterator;\n var CurrentIteratorPrototype, methods, KEY;\n\n // fix native\n if (anyNativeIterator) {\n CurrentIteratorPrototype = getPrototypeOf(anyNativeIterator.call(new Iterable()));\n if (IteratorPrototype !== Object.prototype && CurrentIteratorPrototype.next) {\n if (!IS_PURE && getPrototypeOf(CurrentIteratorPrototype) !== IteratorPrototype) {\n if (setPrototypeOf) {\n setPrototypeOf(CurrentIteratorPrototype, IteratorPrototype);\n } else if (typeof CurrentIteratorPrototype[ITERATOR] != 'function') {\n createNonEnumerableProperty(CurrentIteratorPrototype, ITERATOR, returnThis);\n }\n }\n // Set @@toStringTag to native iterators\n setToStringTag(CurrentIteratorPrototype, TO_STRING_TAG, true, true);\n if (IS_PURE) Iterators[TO_STRING_TAG] = returnThis;\n }\n }\n\n // fix Array#{values, @@iterator}.name in V8 / FF\n if (DEFAULT == VALUES && nativeIterator && nativeIterator.name !== VALUES) {\n INCORRECT_VALUES_NAME = true;\n defaultIterator = function values() { return nativeIterator.call(this); };\n }\n\n // define iterator\n if ((!IS_PURE || FORCED) && IterablePrototype[ITERATOR] !== defaultIterator) {\n createNonEnumerableProperty(IterablePrototype, ITERATOR, defaultIterator);\n }\n Iterators[NAME] = defaultIterator;\n\n // export additional methods\n if (DEFAULT) {\n methods = {\n values: getIterationMethod(VALUES),\n keys: IS_SET ? defaultIterator : getIterationMethod(KEYS),\n entries: getIterationMethod(ENTRIES)\n };\n if (FORCED) for (KEY in methods) {\n if (BUGGY_SAFARI_ITERATORS || INCORRECT_VALUES_NAME || !(KEY in IterablePrototype)) {\n redefine(IterablePrototype, KEY, methods[KEY]);\n }\n } else $({ target: NAME, proto: true, forced: BUGGY_SAFARI_ITERATORS || INCORRECT_VALUES_NAME }, methods);\n }\n\n return methods;\n};\n","var DESCRIPTORS = require('../internals/descriptors');\nvar propertyIsEnumerableModule = require('../internals/object-property-is-enumerable');\nvar createPropertyDescriptor = require('../internals/create-property-descriptor');\nvar toIndexedObject = require('../internals/to-indexed-object');\nvar toPrimitive = require('../internals/to-primitive');\nvar has = require('../internals/has');\nvar IE8_DOM_DEFINE = require('../internals/ie8-dom-define');\n\nvar nativeGetOwnPropertyDescriptor = Object.getOwnPropertyDescriptor;\n\n// `Object.getOwnPropertyDescriptor` method\n// https://tc39.github.io/ecma262/#sec-object.getownpropertydescriptor\nexports.f = DESCRIPTORS ? nativeGetOwnPropertyDescriptor : function getOwnPropertyDescriptor(O, P) {\n O = toIndexedObject(O);\n P = toPrimitive(P, true);\n if (IE8_DOM_DEFINE) try {\n return nativeGetOwnPropertyDescriptor(O, P);\n } catch (error) { /* empty */ }\n if (has(O, P)) return createPropertyDescriptor(!propertyIsEnumerableModule.f.call(O, P), O[P]);\n};\n","var fails = require('../internals/fails');\n\nvar replacement = /#|\\.prototype\\./;\n\nvar isForced = function (feature, detection) {\n var value = data[normalize(feature)];\n return value == POLYFILL ? true\n : value == NATIVE ? false\n : typeof detection == 'function' ? fails(detection)\n : !!detection;\n};\n\nvar normalize = isForced.normalize = function (string) {\n return String(string).replace(replacement, '.').toLowerCase();\n};\n\nvar data = isForced.data = {};\nvar NATIVE = isForced.NATIVE = 'N';\nvar POLYFILL = isForced.POLYFILL = 'P';\n\nmodule.exports = isForced;\n","'use strict';\nvar getPrototypeOf = require('../internals/object-get-prototype-of');\nvar createNonEnumerableProperty = require('../internals/create-non-enumerable-property');\nvar has = require('../internals/has');\nvar wellKnownSymbol = require('../internals/well-known-symbol');\nvar IS_PURE = require('../internals/is-pure');\n\nvar ITERATOR = wellKnownSymbol('iterator');\nvar BUGGY_SAFARI_ITERATORS = false;\n\nvar returnThis = function () { return this; };\n\n// `%IteratorPrototype%` object\n// https://tc39.github.io/ecma262/#sec-%iteratorprototype%-object\nvar IteratorPrototype, PrototypeOfArrayIteratorPrototype, arrayIterator;\n\nif ([].keys) {\n arrayIterator = [].keys();\n // Safari 8 has buggy iterators w/o `next`\n if (!('next' in arrayIterator)) BUGGY_SAFARI_ITERATORS = true;\n else {\n PrototypeOfArrayIteratorPrototype = getPrototypeOf(getPrototypeOf(arrayIterator));\n if (PrototypeOfArrayIteratorPrototype !== Object.prototype) IteratorPrototype = PrototypeOfArrayIteratorPrototype;\n }\n}\n\nif (IteratorPrototype == undefined) IteratorPrototype = {};\n\n// 25.1.2.1.1 %IteratorPrototype%[@@iterator]()\nif (!IS_PURE && !has(IteratorPrototype, ITERATOR)) {\n createNonEnumerableProperty(IteratorPrototype, ITERATOR, returnThis);\n}\n\nmodule.exports = {\n IteratorPrototype: IteratorPrototype,\n BUGGY_SAFARI_ITERATORS: BUGGY_SAFARI_ITERATORS\n};\n","var fails = require('../internals/fails');\n\nmodule.exports = !!Object.getOwnPropertySymbols && !fails(function () {\n // Chrome 38 Symbol has incorrect toString conversion\n // eslint-disable-next-line no-undef\n return !String(Symbol());\n});\n","var anObject = require('../internals/an-object');\nvar defineProperties = require('../internals/object-define-properties');\nvar enumBugKeys = require('../internals/enum-bug-keys');\nvar hiddenKeys = require('../internals/hidden-keys');\nvar html = require('../internals/html');\nvar documentCreateElement = require('../internals/document-create-element');\nvar sharedKey = require('../internals/shared-key');\n\nvar GT = '>';\nvar LT = '<';\nvar PROTOTYPE = 'prototype';\nvar SCRIPT = 'script';\nvar IE_PROTO = sharedKey('IE_PROTO');\n\nvar EmptyConstructor = function () { /* empty */ };\n\nvar scriptTag = function (content) {\n return LT + SCRIPT + GT + content + LT + '/' + SCRIPT + GT;\n};\n\n// Create object with fake `null` prototype: use ActiveX Object with cleared prototype\nvar NullProtoObjectViaActiveX = function (activeXDocument) {\n activeXDocument.write(scriptTag(''));\n activeXDocument.close();\n var temp = activeXDocument.parentWindow.Object;\n activeXDocument = null; // avoid memory leak\n return temp;\n};\n\n// Create object with fake `null` prototype: use iframe Object with cleared prototype\nvar NullProtoObjectViaIFrame = function () {\n // Thrash, waste and sodomy: IE GC bug\n var iframe = documentCreateElement('iframe');\n var JS = 'java' + SCRIPT + ':';\n var iframeDocument;\n iframe.style.display = 'none';\n html.appendChild(iframe);\n // https://github.com/zloirock/core-js/issues/475\n iframe.src = String(JS);\n iframeDocument = iframe.contentWindow.document;\n iframeDocument.open();\n iframeDocument.write(scriptTag('document.F=Object'));\n iframeDocument.close();\n return iframeDocument.F;\n};\n\n// Check for document.domain and active x support\n// No need to use active x approach when document.domain is not set\n// see https://github.com/es-shims/es5-shim/issues/150\n// variation of https://github.com/kitcambridge/es5-shim/commit/4f738ac066346\n// avoid IE GC bug\nvar activeXDocument;\nvar NullProtoObject = function () {\n try {\n /* global ActiveXObject */\n activeXDocument = document.domain && new ActiveXObject('htmlfile');\n } catch (error) { /* ignore */ }\n NullProtoObject = activeXDocument ? NullProtoObjectViaActiveX(activeXDocument) : NullProtoObjectViaIFrame();\n var length = enumBugKeys.length;\n while (length--) delete NullProtoObject[PROTOTYPE][enumBugKeys[length]];\n return NullProtoObject();\n};\n\nhiddenKeys[IE_PROTO] = true;\n\n// `Object.create` method\n// https://tc39.github.io/ecma262/#sec-object.create\nmodule.exports = Object.create || function create(O, Properties) {\n var result;\n if (O !== null) {\n EmptyConstructor[PROTOTYPE] = anObject(O);\n result = new EmptyConstructor();\n EmptyConstructor[PROTOTYPE] = null;\n // add \"__proto__\" for Object.getPrototypeOf polyfill\n result[IE_PROTO] = O;\n } else result = NullProtoObject();\n return Properties === undefined ? result : defineProperties(result, Properties);\n};\n","var toInteger = require('../internals/to-integer');\n\nvar min = Math.min;\n\n// `ToLength` abstract operation\n// https://tc39.github.io/ecma262/#sec-tolength\nmodule.exports = function (argument) {\n return argument > 0 ? min(toInteger(argument), 0x1FFFFFFFFFFFFF) : 0; // 2 ** 53 - 1 == 9007199254740991\n};\n","// IE8- don't enum bug keys\nmodule.exports = [\n 'constructor',\n 'hasOwnProperty',\n 'isPrototypeOf',\n 'propertyIsEnumerable',\n 'toLocaleString',\n 'toString',\n 'valueOf'\n];\n","var getBuiltIn = require('../internals/get-built-in');\n\nmodule.exports = getBuiltIn('document', 'documentElement');\n","var anObject = require('../internals/an-object');\nvar aPossiblePrototype = require('../internals/a-possible-prototype');\n\n// `Object.setPrototypeOf` method\n// https://tc39.github.io/ecma262/#sec-object.setprototypeof\n// Works with __proto__ only. Old v8 can't work with null proto objects.\n/* eslint-disable no-proto */\nmodule.exports = Object.setPrototypeOf || ('__proto__' in {} ? function () {\n var CORRECT_SETTER = false;\n var test = {};\n var setter;\n try {\n setter = Object.getOwnPropertyDescriptor(Object.prototype, '__proto__').set;\n setter.call(test, []);\n CORRECT_SETTER = test instanceof Array;\n } catch (error) { /* empty */ }\n return function setPrototypeOf(O, proto) {\n anObject(O);\n aPossiblePrototype(proto);\n if (CORRECT_SETTER) setter.call(O, proto);\n else O.__proto__ = proto;\n return O;\n };\n}() : undefined);\n","var global = require('../internals/global');\n\nmodule.exports = global.Promise;\n","var anObject = require('../internals/an-object');\nvar aFunction = require('../internals/a-function');\nvar wellKnownSymbol = require('../internals/well-known-symbol');\n\nvar SPECIES = wellKnownSymbol('species');\n\n// `SpeciesConstructor` abstract operation\n// https://tc39.github.io/ecma262/#sec-speciesconstructor\nmodule.exports = function (O, defaultConstructor) {\n var C = anObject(O).constructor;\n var S;\n return C === undefined || (S = anObject(C)[SPECIES]) == undefined ? defaultConstructor : aFunction(S);\n};\n","var global = require('../internals/global');\nvar fails = require('../internals/fails');\nvar classof = require('../internals/classof-raw');\nvar bind = require('../internals/function-bind-context');\nvar html = require('../internals/html');\nvar createElement = require('../internals/document-create-element');\nvar IS_IOS = require('../internals/engine-is-ios');\n\nvar location = global.location;\nvar set = global.setImmediate;\nvar clear = global.clearImmediate;\nvar process = global.process;\nvar MessageChannel = global.MessageChannel;\nvar Dispatch = global.Dispatch;\nvar counter = 0;\nvar queue = {};\nvar ONREADYSTATECHANGE = 'onreadystatechange';\nvar defer, channel, port;\n\nvar run = function (id) {\n // eslint-disable-next-line no-prototype-builtins\n if (queue.hasOwnProperty(id)) {\n var fn = queue[id];\n delete queue[id];\n fn();\n }\n};\n\nvar runner = function (id) {\n return function () {\n run(id);\n };\n};\n\nvar listener = function (event) {\n run(event.data);\n};\n\nvar post = function (id) {\n // old engines have not location.origin\n global.postMessage(id + '', location.protocol + '//' + location.host);\n};\n\n// Node.js 0.9+ & IE10+ has setImmediate, otherwise:\nif (!set || !clear) {\n set = function setImmediate(fn) {\n var args = [];\n var i = 1;\n while (arguments.length > i) args.push(arguments[i++]);\n queue[++counter] = function () {\n // eslint-disable-next-line no-new-func\n (typeof fn == 'function' ? fn : Function(fn)).apply(undefined, args);\n };\n defer(counter);\n return counter;\n };\n clear = function clearImmediate(id) {\n delete queue[id];\n };\n // Node.js 0.8-\n if (classof(process) == 'process') {\n defer = function (id) {\n process.nextTick(runner(id));\n };\n // Sphere (JS game engine) Dispatch API\n } else if (Dispatch && Dispatch.now) {\n defer = function (id) {\n Dispatch.now(runner(id));\n };\n // Browsers with MessageChannel, includes WebWorkers\n // except iOS - https://github.com/zloirock/core-js/issues/624\n } else if (MessageChannel && !IS_IOS) {\n channel = new MessageChannel();\n port = channel.port2;\n channel.port1.onmessage = listener;\n defer = bind(port.postMessage, port, 1);\n // Browsers with postMessage, skip WebWorkers\n // IE8 has postMessage, but it's sync & typeof its postMessage is 'object'\n } else if (global.addEventListener && typeof postMessage == 'function' && !global.importScripts && !fails(post)) {\n defer = post;\n global.addEventListener('message', listener, false);\n // IE8-\n } else if (ONREADYSTATECHANGE in createElement('script')) {\n defer = function (id) {\n html.appendChild(createElement('script'))[ONREADYSTATECHANGE] = function () {\n html.removeChild(this);\n run(id);\n };\n };\n // Rest old browsers\n } else {\n defer = function (id) {\n setTimeout(runner(id), 0);\n };\n }\n}\n\nmodule.exports = {\n set: set,\n clear: clear\n};\n","var userAgent = require('../internals/engine-user-agent');\n\nmodule.exports = /(iphone|ipod|ipad).*applewebkit/i.test(userAgent);\n","var getBuiltIn = require('../internals/get-built-in');\n\nmodule.exports = getBuiltIn('navigator', 'userAgent') || '';\n","var anObject = require('../internals/an-object');\nvar isObject = require('../internals/is-object');\nvar newPromiseCapability = require('../internals/new-promise-capability');\n\nmodule.exports = function (C, x) {\n anObject(C);\n if (isObject(x) && x.constructor === C) return x;\n var promiseCapability = newPromiseCapability.f(C);\n var resolve = promiseCapability.resolve;\n resolve(x);\n return promiseCapability.promise;\n};\n","'use strict';\nvar $ = require('../internals/export');\nvar aFunction = require('../internals/a-function');\nvar newPromiseCapabilityModule = require('../internals/new-promise-capability');\nvar perform = require('../internals/perform');\nvar iterate = require('../internals/iterate');\n\n// `Promise.allSettled` method\n// https://github.com/tc39/proposal-promise-allSettled\n$({ target: 'Promise', stat: true }, {\n allSettled: function allSettled(iterable) {\n var C = this;\n var capability = newPromiseCapabilityModule.f(C);\n var resolve = capability.resolve;\n var reject = capability.reject;\n var result = perform(function () {\n var promiseResolve = aFunction(C.resolve);\n var values = [];\n var counter = 0;\n var remaining = 1;\n iterate(iterable, function (promise) {\n var index = counter++;\n var alreadyCalled = false;\n values.push(undefined);\n remaining++;\n promiseResolve.call(C, promise).then(function (value) {\n if (alreadyCalled) return;\n alreadyCalled = true;\n values[index] = { status: 'fulfilled', value: value };\n --remaining || resolve(values);\n }, function (e) {\n if (alreadyCalled) return;\n alreadyCalled = true;\n values[index] = { status: 'rejected', reason: e };\n --remaining || resolve(values);\n });\n });\n --remaining || resolve(values);\n });\n if (result.error) reject(result.value);\n return capability.promise;\n }\n});\n","/**\n * @author NHN. FE Development Team \n * @fileoverview Shape resize helper\n */\nconst DIVISOR = {\n rect: 1,\n circle: 2,\n triangle: 1,\n};\nconst DIMENSION_KEYS = {\n rect: {\n w: 'width',\n h: 'height',\n },\n circle: {\n w: 'rx',\n h: 'ry',\n },\n triangle: {\n w: 'width',\n h: 'height',\n },\n};\n\n/**\n * Set the start point value to the shape object\n * @param {fabric.Object} shape - Shape object\n * @ignore\n */\nfunction setStartPoint(shape) {\n const { originX, originY } = shape;\n const originKey = originX.substring(0, 1) + originY.substring(0, 1);\n\n shape.startPoint = shape.origins[originKey];\n}\n\n/**\n * Get the positions of ratated origin by the pointer value\n * @param {{x: number, y: number}} origin - Origin value\n * @param {{x: number, y: number}} pointer - Pointer value\n * @param {number} angle - Rotating angle\n * @returns {Object} Postions of origin\n * @ignore\n */\nfunction getPositionsOfRotatedOrigin(origin, pointer, angle) {\n const sx = origin.x;\n const sy = origin.y;\n const px = pointer.x;\n const py = pointer.y;\n const r = (angle * Math.PI) / 180;\n const rx = (px - sx) * Math.cos(r) - (py - sy) * Math.sin(r) + sx;\n const ry = (px - sx) * Math.sin(r) + (py - sy) * Math.cos(r) + sy;\n\n return {\n originX: sx > rx ? 'right' : 'left',\n originY: sy > ry ? 'bottom' : 'top',\n };\n}\n\n/**\n * Whether the shape has the center origin or not\n * @param {fabric.Object} shape - Shape object\n * @returns {boolean} State\n * @ignore\n */\nfunction hasCenterOrigin(shape) {\n return shape.originX === 'center' && shape.originY === 'center';\n}\n\n/**\n * Adjust the origin of shape by the start point\n * @param {{x: number, y: number}} pointer - Pointer value\n * @param {fabric.Object} shape - Shape object\n * @ignore\n */\nfunction adjustOriginByStartPoint(pointer, shape) {\n const centerPoint = shape.getPointByOrigin('center', 'center');\n const angle = -shape.angle;\n const originPositions = getPositionsOfRotatedOrigin(centerPoint, pointer, angle);\n const { originX, originY } = originPositions;\n const origin = shape.getPointByOrigin(originX, originY);\n const left = shape.left - (centerPoint.x - origin.x);\n const top = shape.top - (centerPoint.y - origin.y);\n\n shape.set({\n originX,\n originY,\n left,\n top,\n });\n\n shape.setCoords();\n}\n\n/**\n * Adjust the origin of shape by the moving pointer value\n * @param {{x: number, y: number}} pointer - Pointer value\n * @param {fabric.Object} shape - Shape object\n * @ignore\n */\nfunction adjustOriginByMovingPointer(pointer, shape) {\n const origin = shape.startPoint;\n const angle = -shape.angle;\n const originPositions = getPositionsOfRotatedOrigin(origin, pointer, angle);\n const { originX, originY } = originPositions;\n\n shape.setPositionByOrigin(origin, originX, originY);\n shape.setCoords();\n}\n\n/**\n * Adjust the dimension of shape on firing scaling event\n * @param {fabric.Object} shape - Shape object\n * @ignore\n */\nfunction adjustDimensionOnScaling(shape) {\n const { type, scaleX, scaleY } = shape;\n const dimensionKeys = DIMENSION_KEYS[type];\n let width = shape[dimensionKeys.w] * scaleX;\n let height = shape[dimensionKeys.h] * scaleY;\n\n if (shape.isRegular) {\n const maxScale = Math.max(scaleX, scaleY);\n\n width = shape[dimensionKeys.w] * maxScale;\n height = shape[dimensionKeys.h] * maxScale;\n }\n\n const options = {\n hasControls: false,\n hasBorders: false,\n scaleX: 1,\n scaleY: 1,\n };\n\n options[dimensionKeys.w] = width;\n options[dimensionKeys.h] = height;\n\n shape.set(options);\n}\n\n/**\n * Adjust the dimension of shape on firing mouse move event\n * @param {{x: number, y: number}} pointer - Pointer value\n * @param {fabric.Object} shape - Shape object\n * @ignore\n */\nfunction adjustDimensionOnMouseMove(pointer, shape) {\n const { type, strokeWidth, startPoint: origin } = shape;\n const divisor = DIVISOR[type];\n const dimensionKeys = DIMENSION_KEYS[type];\n const isTriangle = !!(shape.type === 'triangle');\n const options = {};\n let width = Math.abs(origin.x - pointer.x) / divisor;\n let height = Math.abs(origin.y - pointer.y) / divisor;\n\n if (width > strokeWidth) {\n width -= strokeWidth / divisor;\n }\n\n if (height > strokeWidth) {\n height -= strokeWidth / divisor;\n }\n\n if (shape.isRegular) {\n width = height = Math.max(width, height);\n\n if (isTriangle) {\n height = (Math.sqrt(3) / 2) * width;\n }\n }\n\n options[dimensionKeys.w] = width;\n options[dimensionKeys.h] = height;\n\n shape.set(options);\n}\n\nmodule.exports = {\n /**\n * Set each origin value to shape\n * @param {fabric.Object} shape - Shape object\n */\n setOrigins(shape) {\n const leftTopPoint = shape.getPointByOrigin('left', 'top');\n const rightTopPoint = shape.getPointByOrigin('right', 'top');\n const rightBottomPoint = shape.getPointByOrigin('right', 'bottom');\n const leftBottomPoint = shape.getPointByOrigin('left', 'bottom');\n\n shape.origins = {\n lt: leftTopPoint,\n rt: rightTopPoint,\n rb: rightBottomPoint,\n lb: leftBottomPoint,\n };\n },\n\n /**\n * Resize the shape\n * @param {fabric.Object} shape - Shape object\n * @param {{x: number, y: number}} pointer - Mouse pointer values on canvas\n * @param {boolean} isScaling - Whether the resizing action is scaling or not\n */\n resize(shape, pointer, isScaling) {\n if (hasCenterOrigin(shape)) {\n adjustOriginByStartPoint(pointer, shape);\n setStartPoint(shape);\n }\n\n if (isScaling) {\n adjustDimensionOnScaling(shape, pointer);\n } else {\n adjustDimensionOnMouseMove(pointer, shape);\n }\n\n adjustOriginByMovingPointer(pointer, shape);\n },\n\n /**\n * Adjust the origin position of shape to center\n * @param {fabric.Object} shape - Shape object\n */\n adjustOriginToCenter(shape) {\n const centerPoint = shape.getPointByOrigin('center', 'center');\n const { originX, originY } = shape;\n const origin = shape.getPointByOrigin(originX, originY);\n const left = shape.left + (centerPoint.x - origin.x);\n const top = shape.top + (centerPoint.y - origin.y);\n\n shape.set({\n hasControls: true,\n hasBorders: true,\n originX: 'center',\n originY: 'center',\n left,\n top,\n });\n\n shape.setCoords(); // For left, top properties\n },\n};\n","import '@/polyfill';\nimport ImageEditor from '@/imageEditor';\nimport '@css/index.styl';\n\n// commands\nimport '@/command/addIcon';\nimport '@/command/addImageObject';\nimport '@/command/addObject';\nimport '@/command/addShape';\nimport '@/command/addText';\nimport '@/command/applyFilter';\nimport '@/command/changeIconColor';\nimport '@/command/changeShape';\nimport '@/command/changeText';\nimport '@/command/changeTextStyle';\nimport '@/command/clearObjects';\nimport '@/command/flip';\nimport '@/command/loadImage';\nimport '@/command/removeFilter';\nimport '@/command/removeObject';\nimport '@/command/resizeCanvasDimension';\nimport '@/command/rotate';\nimport '@/command/setObjectProperties';\nimport '@/command/setObjectPosition';\nimport '@/command/changeSelection';\n\nmodule.exports = ImageEditor;\n","// https://developer.mozilla.org/en-US/docs/Web/API/Element/closest\n// Any copyright is dedicated to the Public Domain. http://creativecommons.org/publicdomain/zero/1.0/if (!Element.prototype.matches)\nElement.prototype.matches =\n Element.prototype.msMatchesSelector || Element.prototype.webkitMatchesSelector;\n\nif (!Element.prototype.closest)\n Element.prototype.closest = function (s) {\n var el = this;\n if (!document.documentElement.contains(el)) return null;\n do {\n if (el.matches(s)) return el;\n el = el.parentElement || el.parentNode;\n } while (el !== null && el.nodeType === 1);\n return null;\n };\n\n/*\n * classList.js: Cross-browser full element.classList implementation.\n * 1.1.20170427\n *\n * By Eli Grey, http://eligrey.com\n * License: Dedicated to the public domain.\n * See https://github.com/eligrey/classList.js/blob/master/LICENSE.md\n */\n\n/*global self, document, DOMException */\n\n/*! @source http://purl.eligrey.com/github/classList.js/blob/master/classList.js */\n\nif ('document' in window.self) {\n // Full polyfill for browsers with no classList support\n // Including IE < Edge missing SVGElement.classList\n if (\n !('classList' in document.createElement('_')) ||\n (document.createElementNS &&\n !('classList' in document.createElementNS('http://www.w3.org/2000/svg', 'g')))\n ) {\n (function (view) {\n 'use strict';\n\n if (!('Element' in view)) return;\n\n var classListProp = 'classList',\n protoProp = 'prototype',\n elemCtrProto = view.Element[protoProp],\n objCtr = Object,\n strTrim =\n String[protoProp].trim ||\n function () {\n return this.replace(/^\\s+|\\s+$/g, '');\n },\n arrIndexOf =\n Array[protoProp].indexOf ||\n function (item) {\n var i = 0,\n len = this.length;\n for (; i < len; i++) {\n if (i in this && this[i] === item) {\n return i;\n }\n }\n return -1;\n },\n // Vendors: please allow content code to instantiate DOMExceptions\n DOMEx = function (type, message) {\n this.name = type;\n this.code = DOMException[type];\n this.message = message;\n },\n checkTokenAndGetIndex = function (classList, token) {\n if (token === '') {\n throw new DOMEx('SYNTAX_ERR', 'An invalid or illegal string was specified');\n }\n if (/\\s/.test(token)) {\n throw new DOMEx('INVALID_CHARACTER_ERR', 'String contains an invalid character');\n }\n return arrIndexOf.call(classList, token);\n },\n ClassList = function (elem) {\n var trimmedClasses = strTrim.call(elem.getAttribute('class') || ''),\n classes = trimmedClasses ? trimmedClasses.split(/\\s+/) : [],\n i = 0,\n len = classes.length;\n for (; i < len; i++) {\n this.push(classes[i]);\n }\n this._updateClassName = function () {\n elem.setAttribute('class', this.toString());\n };\n },\n classListProto = (ClassList[protoProp] = []),\n classListGetter = function () {\n return new ClassList(this);\n };\n // Most DOMException implementations don't allow calling DOMException's toString()\n // on non-DOMExceptions. Error's toString() is sufficient here.\n DOMEx[protoProp] = Error[protoProp];\n classListProto.item = function (i) {\n return this[i] || null;\n };\n classListProto.contains = function (token) {\n token += '';\n return checkTokenAndGetIndex(this, token) !== -1;\n };\n classListProto.add = function () {\n var tokens = arguments,\n i = 0,\n l = tokens.length,\n token,\n updated = false;\n do {\n token = tokens[i] + '';\n if (checkTokenAndGetIndex(this, token) === -1) {\n this.push(token);\n updated = true;\n }\n } while (++i < l);\n\n if (updated) {\n this._updateClassName();\n }\n };\n classListProto.remove = function () {\n var tokens = arguments,\n i = 0,\n l = tokens.length,\n token,\n updated = false,\n index;\n do {\n token = tokens[i] + '';\n index = checkTokenAndGetIndex(this, token);\n while (index !== -1) {\n this.splice(index, 1);\n updated = true;\n index = checkTokenAndGetIndex(this, token);\n }\n } while (++i < l);\n\n if (updated) {\n this._updateClassName();\n }\n };\n classListProto.toggle = function (token, force) {\n token += '';\n\n var result = this.contains(token),\n method = result ? force !== true && 'remove' : force !== false && 'add';\n if (method) {\n this[method](token);\n }\n\n if (force === true || force === false) {\n return force;\n } else {\n return !result;\n }\n };\n classListProto.toString = function () {\n return this.join(' ');\n };\n\n if (objCtr.defineProperty) {\n var classListPropDesc = {\n get: classListGetter,\n enumerable: true,\n configurable: true,\n };\n try {\n objCtr.defineProperty(elemCtrProto, classListProp, classListPropDesc);\n } catch (ex) {\n // IE 8 doesn't support enumerable:true\n // adding undefined to fight this issue https://github.com/eligrey/classList.js/issues/36\n // modernie IE8-MSW7 machine has IE8 8.0.6001.18702 and is affected\n if (ex.number === undefined || ex.number === -0x7ff5ec54) {\n classListPropDesc.enumerable = false;\n objCtr.defineProperty(elemCtrProto, classListProp, classListPropDesc);\n }\n }\n } else if (objCtr[protoProp].__defineGetter__) {\n elemCtrProto.__defineGetter__(classListProp, classListGetter);\n }\n })(window.self);\n }\n\n // There is full or partial native classList support, so just check if we need\n // to normalize the add/remove and toggle APIs.\n\n (function () {\n 'use strict';\n\n var testElement = document.createElement('_');\n\n testElement.classList.add('c1', 'c2');\n\n // Polyfill for IE 10/11 and Firefox <26, where classList.add and\n // classList.remove exist but support only one argument at a time.\n if (!testElement.classList.contains('c2')) {\n var createMethod = function (method) {\n var original = DOMTokenList.prototype[method];\n\n DOMTokenList.prototype[method] = function (token) {\n var i,\n len = arguments.length;\n\n for (i = 0; i < len; i++) {\n token = arguments[i];\n original.call(this, token);\n }\n };\n };\n createMethod('add');\n createMethod('remove');\n }\n\n testElement.classList.toggle('c3', false);\n\n // Polyfill for IE 10 and Firefox <24, where classList.toggle does not\n // support the second argument.\n if (testElement.classList.contains('c3')) {\n var _toggle = DOMTokenList.prototype.toggle;\n\n DOMTokenList.prototype.toggle = function (token, force) {\n if (1 in arguments && !this.contains(token) === !force) {\n return force;\n } else {\n return _toggle.call(this, token);\n }\n };\n }\n\n testElement = null;\n })();\n}\n\n/*!\n * @copyright Copyright (c) 2017 IcoMoon.io\n * @license Licensed under MIT license\n * See https://github.com/Keyamoon/svgxuse\n * @version 1.2.6\n */\n/*jslint browser: true */\n/*global XDomainRequest, MutationObserver, window */\n(function () {\n 'use strict';\n if (typeof window !== 'undefined' && window.addEventListener) {\n var cache = Object.create(null); // holds xhr objects to prevent multiple requests\n var checkUseElems;\n var tid; // timeout id\n var debouncedCheck = function () {\n clearTimeout(tid);\n tid = setTimeout(checkUseElems, 100);\n };\n var unobserveChanges = function () {\n return;\n };\n var observeChanges = function () {\n var observer;\n window.addEventListener('resize', debouncedCheck, false);\n window.addEventListener('orientationchange', debouncedCheck, false);\n if (window.MutationObserver) {\n observer = new MutationObserver(debouncedCheck);\n observer.observe(document.documentElement, {\n childList: true,\n subtree: true,\n attributes: true,\n });\n unobserveChanges = function () {\n try {\n observer.disconnect();\n window.removeEventListener('resize', debouncedCheck, false);\n window.removeEventListener('orientationchange', debouncedCheck, false);\n } catch (ignore) {}\n };\n } else {\n document.documentElement.addEventListener('DOMSubtreeModified', debouncedCheck, false);\n unobserveChanges = function () {\n document.documentElement.removeEventListener('DOMSubtreeModified', debouncedCheck, false);\n window.removeEventListener('resize', debouncedCheck, false);\n window.removeEventListener('orientationchange', debouncedCheck, false);\n };\n }\n };\n var createRequest = function (url) {\n // In IE 9, cross origin requests can only be sent using XDomainRequest.\n // XDomainRequest would fail if CORS headers are not set.\n // Therefore, XDomainRequest should only be used with cross origin requests.\n function getOrigin(loc) {\n var a;\n if (loc.protocol !== undefined) {\n a = loc;\n } else {\n a = document.createElement('a');\n a.href = loc;\n }\n return a.protocol.replace(/:/g, '') + a.host;\n }\n var Request;\n var origin;\n var origin2;\n if (window.XMLHttpRequest) {\n Request = new XMLHttpRequest();\n origin = getOrigin(location);\n origin2 = getOrigin(url);\n if (Request.withCredentials === undefined && origin2 !== '' && origin2 !== origin) {\n Request = XDomainRequest || undefined;\n } else {\n Request = XMLHttpRequest;\n }\n }\n return Request;\n };\n var xlinkNS = 'http://www.w3.org/1999/xlink';\n checkUseElems = function () {\n var base;\n var bcr;\n var fallback = ''; // optional fallback URL in case no base path to SVG file was given and no symbol definition was found.\n var hash;\n var href;\n var i;\n var inProgressCount = 0;\n var isHidden;\n var Request;\n var url;\n var uses;\n var xhr;\n function observeIfDone() {\n // If done with making changes, start watching for chagnes in DOM again\n inProgressCount -= 1;\n if (inProgressCount === 0) {\n // if all xhrs were resolved\n unobserveChanges(); // make sure to remove old handlers\n observeChanges(); // watch for changes to DOM\n }\n }\n function attrUpdateFunc(spec) {\n return function () {\n if (cache[spec.base] !== true) {\n spec.useEl.setAttributeNS(xlinkNS, 'xlink:href', '#' + spec.hash);\n if (spec.useEl.hasAttribute('href')) {\n spec.useEl.setAttribute('href', '#' + spec.hash);\n }\n }\n };\n }\n function onloadFunc(xhr) {\n return function () {\n var body = document.body;\n var x = document.createElement('x');\n var svg;\n xhr.onload = null;\n x.innerHTML = xhr.responseText;\n svg = x.getElementsByTagName('svg')[0];\n if (svg) {\n svg.setAttribute('aria-hidden', 'true');\n svg.style.position = 'absolute';\n svg.style.width = 0;\n svg.style.height = 0;\n svg.style.overflow = 'hidden';\n body.insertBefore(svg, body.firstChild);\n }\n observeIfDone();\n };\n }\n function onErrorTimeout(xhr) {\n return function () {\n xhr.onerror = null;\n xhr.ontimeout = null;\n observeIfDone();\n };\n }\n unobserveChanges(); // stop watching for changes to DOM\n // find all use elements\n uses = document.getElementsByTagName('use');\n for (i = 0; i < uses.length; i += 1) {\n try {\n bcr = uses[i].getBoundingClientRect();\n } catch (ignore) {\n // failed to get bounding rectangle of the use element\n bcr = false;\n }\n href =\n uses[i].getAttribute('href') ||\n uses[i].getAttributeNS(xlinkNS, 'href') ||\n uses[i].getAttribute('xlink:href');\n if (href && href.split) {\n url = href.split('#');\n } else {\n url = ['', ''];\n }\n base = url[0];\n hash = url[1];\n isHidden = bcr && bcr.left === 0 && bcr.right === 0 && bcr.top === 0 && bcr.bottom === 0;\n if (bcr && bcr.width === 0 && bcr.height === 0 && !isHidden) {\n // the use element is empty\n // if there is a reference to an external SVG, try to fetch it\n // use the optional fallback URL if there is no reference to an external SVG\n if (fallback && !base.length && hash && !document.getElementById(hash)) {\n base = fallback;\n }\n if (uses[i].hasAttribute('href')) {\n uses[i].setAttributeNS(xlinkNS, 'xlink:href', href);\n }\n if (base.length) {\n // schedule updating xlink:href\n xhr = cache[base];\n if (xhr !== true) {\n // true signifies that prepending the SVG was not required\n setTimeout(\n attrUpdateFunc({\n useEl: uses[i],\n base: base,\n hash: hash,\n }),\n 0\n );\n }\n if (xhr === undefined) {\n Request = createRequest(base);\n if (Request !== undefined) {\n xhr = new Request();\n cache[base] = xhr;\n xhr.onload = onloadFunc(xhr);\n xhr.onerror = onErrorTimeout(xhr);\n xhr.ontimeout = onErrorTimeout(xhr);\n xhr.open('GET', base);\n xhr.send();\n inProgressCount += 1;\n }\n }\n }\n } else {\n if (!isHidden) {\n if (cache[base] === undefined) {\n // remember this URL if the use element was not empty and no request was sent\n cache[base] = true;\n } else if (cache[base].onload) {\n // if it turns out that prepending the SVG is not necessary,\n // abort the in-progress xhr.\n cache[base].abort();\n delete cache[base].onload;\n cache[base] = true;\n }\n } else if (base.length && cache[base]) {\n setTimeout(\n attrUpdateFunc({\n useEl: uses[i],\n base: base,\n hash: hash,\n }),\n 0\n );\n }\n }\n }\n uses = '';\n inProgressCount += 1;\n observeIfDone();\n };\n var winLoad;\n winLoad = function () {\n window.removeEventListener('load', winLoad, false); // to prevent memory leaks\n tid = setTimeout(checkUseElems, 0);\n };\n if (document.readyState !== 'complete') {\n // The load event fires when all resources have finished loading, which allows detecting whether SVG use elements are empty.\n window.addEventListener('load', winLoad, false);\n } else {\n // No need to add a listener if the document is already loaded, initialize immediately.\n winLoad();\n }\n }\n})();\n","/**\n * @author NHN. FE Development Team \n * @fileoverview Image-editor application class\n */\nimport snippet from 'tui-code-snippet';\nimport Invoker from '@/invoker';\nimport UI from '@/ui';\nimport action from '@/action';\nimport commandFactory from '@/factory/command';\nimport Graphics from '@/graphics';\nimport { makeSelectionUndoData, makeSelectionUndoDatum } from '@/helper/selectionModifyHelper';\nimport { sendHostName, Promise, getObjectType } from '@/util';\nimport {\n eventNames as events,\n commandNames as commands,\n keyCodes,\n rejectMessages,\n OBJ_TYPE,\n} from '@/consts';\n\nconst { isUndefined, forEach, CustomEvents } = snippet;\n\nconst {\n MOUSE_DOWN,\n OBJECT_MOVED,\n OBJECT_SCALED,\n OBJECT_ACTIVATED,\n OBJECT_ROTATED,\n OBJECT_ADDED,\n OBJECT_MODIFIED,\n ADD_TEXT,\n ADD_OBJECT,\n TEXT_EDITING,\n TEXT_CHANGED,\n ICON_CREATE_RESIZE,\n ICON_CREATE_END,\n SELECTION_CLEARED,\n SELECTION_CREATED,\n ADD_OBJECT_AFTER,\n} = events;\n\n/**\n * Image filter result\n * @typedef {object} FilterResult\n * @property {string} type - filter type like 'mask', 'Grayscale' and so on\n * @property {string} action - action type like 'add', 'remove'\n */\n\n/**\n * Flip status\n * @typedef {object} FlipStatus\n * @property {boolean} flipX - x axis\n * @property {boolean} flipY - y axis\n * @property {Number} angle - angle\n */\n/**\n * Rotation status\n * @typedef {Number} RotateStatus\n * @property {Number} angle - angle\n */\n\n/**\n * Old and new Size\n * @typedef {object} SizeChange\n * @property {Number} oldWidth - old width\n * @property {Number} oldHeight - old height\n * @property {Number} newWidth - new width\n * @property {Number} newHeight - new height\n */\n\n/**\n * @typedef {string} ErrorMsg - {string} error message\n */\n\n/**\n * @typedef {object} ObjectProps - graphics object properties\n * @property {number} id - object id\n * @property {string} type - object type\n * @property {string} text - text content\n * @property {(string | number)} left - Left\n * @property {(string | number)} top - Top\n * @property {(string | number)} width - Width\n * @property {(string | number)} height - Height\n * @property {string} fill - Color\n * @property {string} stroke - Stroke\n * @property {(string | number)} strokeWidth - StrokeWidth\n * @property {string} fontFamily - Font type for text\n * @property {number} fontSize - Font Size\n * @property {string} fontStyle - Type of inclination (normal / italic)\n * @property {string} fontWeight - Type of thicker or thinner looking (normal / bold)\n * @property {string} textAlign - Type of text align (left / center / right)\n * @property {string} textDecoration - Type of line (underline / line-through / overline)\n */\n\n/**\n * Shape filter option\n * @typedef {object.} ShapeFilterOption\n */\n\n/**\n * Shape filter option\n * @typedef {object} ShapeFillOption - fill option of shape\n * @property {string} type - fill type ('color' or 'filter')\n * @property {Array.} [filter] - {@link ShapeFilterOption} List.\n * only applies to filter types\n * (ex: \\[\\{pixelate: 20\\}, \\{blur: 0.3\\}\\])\n * @property {string} [color] - Shape foreground color (ex: '#fff', 'transparent')\n */\n\n/**\n * Image editor\n * @class\n * @param {string|HTMLElement} wrapper - Wrapper's element or selector\n * @param {Object} [options] - Canvas max width & height of css\n * @param {number} [options.includeUI] - Use the provided UI\n * @param {Object} [options.includeUI.loadImage] - Basic editing image\n * @param {string} options.includeUI.loadImage.path - image path\n * @param {string} options.includeUI.loadImage.name - image name\n * @param {Object} [options.includeUI.theme] - Theme object\n * @param {Array} [options.includeUI.menu] - It can be selected when only specific menu is used, Default values are \\['crop', 'flip', 'rotate', 'draw', 'shape', 'icon', 'text', 'mask', 'filter'\\].\n * @param {string} [options.includeUI.initMenu] - The first menu to be selected and started.\n * @param {Object} [options.includeUI.uiSize] - ui size of editor\n * @param {string} options.includeUI.uiSize.width - width of ui\n * @param {string} options.includeUI.uiSize.height - height of ui\n * @param {string} [options.includeUI.menuBarPosition=bottom] - Menu bar position('top', 'bottom', 'left', 'right')\n * @param {number} options.cssMaxWidth - Canvas css-max-width\n * @param {number} options.cssMaxHeight - Canvas css-max-height\n * @param {Object} [options.selectionStyle] - selection style\n * @param {string} [options.selectionStyle.cornerStyle] - selection corner style\n * @param {number} [options.selectionStyle.cornerSize] - selection corner size\n * @param {string} [options.selectionStyle.cornerColor] - selection corner color\n * @param {string} [options.selectionStyle.cornerStrokeColor] = selection corner stroke color\n * @param {boolean} [options.selectionStyle.transparentCorners] - selection corner transparent\n * @param {number} [options.selectionStyle.lineWidth] - selection line width\n * @param {string} [options.selectionStyle.borderColor] - selection border color\n * @param {number} [options.selectionStyle.rotatingPointOffset] - selection rotating point length\n * @param {Boolean} [options.usageStatistics=true] - Let us know the hostname. If you don't want to send the hostname, please set to false.\n * @example\n * var ImageEditor = require('tui-image-editor');\n * var blackTheme = require('./js/theme/black-theme.js');\n * var instance = new ImageEditor(document.querySelector('#tui-image-editor'), {\n * includeUI: {\n * loadImage: {\n * path: 'img/sampleImage.jpg',\n * name: 'SampleImage'\n * },\n * theme: blackTheme, // or whiteTheme\n * menu: ['shape', 'filter'],\n * initMenu: 'filter',\n * uiSize: {\n * width: '1000px',\n * height: '700px'\n * },\n * menuBarPosition: 'bottom'\n * },\n * cssMaxWidth: 700,\n * cssMaxHeight: 500,\n * selectionStyle: {\n * cornerSize: 20,\n * rotatingPointOffset: 70\n * }\n * });\n */\nclass ImageEditor {\n constructor(wrapper, options) {\n options = snippet.extend(\n {\n includeUI: false,\n usageStatistics: true,\n },\n options\n );\n\n this.mode = null;\n\n this.activeObjectId = null;\n\n /**\n * UI instance\n * @type {Ui}\n */\n if (options.includeUI) {\n const UIOption = options.includeUI;\n UIOption.usageStatistics = options.usageStatistics;\n\n this.ui = new UI(wrapper, UIOption, this.getActions());\n options = this.ui.setUiDefaultSelectionStyle(options);\n }\n\n /**\n * Invoker\n * @type {Invoker}\n * @private\n */\n this._invoker = new Invoker();\n\n /**\n * Graphics instance\n * @type {Graphics}\n * @private\n */\n this._graphics = new Graphics(this.ui ? this.ui.getEditorArea() : wrapper, {\n cssMaxWidth: options.cssMaxWidth,\n cssMaxHeight: options.cssMaxHeight,\n });\n\n /**\n * Event handler list\n * @type {Object}\n * @private\n */\n this._handlers = {\n keydown: this._onKeyDown.bind(this),\n mousedown: this._onMouseDown.bind(this),\n objectActivated: this._onObjectActivated.bind(this),\n objectMoved: this._onObjectMoved.bind(this),\n objectScaled: this._onObjectScaled.bind(this),\n objectRotated: this._onObjectRotated.bind(this),\n objectAdded: this._onObjectAdded.bind(this),\n objectModified: this._onObjectModified.bind(this),\n createdPath: this._onCreatedPath,\n addText: this._onAddText.bind(this),\n addObject: this._onAddObject.bind(this),\n textEditing: this._onTextEditing.bind(this),\n textChanged: this._onTextChanged.bind(this),\n iconCreateResize: this._onIconCreateResize.bind(this),\n iconCreateEnd: this._onIconCreateEnd.bind(this),\n selectionCleared: this._selectionCleared.bind(this),\n selectionCreated: this._selectionCreated.bind(this),\n };\n\n this._attachInvokerEvents();\n this._attachGraphicsEvents();\n this._attachDomEvents();\n this._setSelectionStyle(options.selectionStyle, {\n applyCropSelectionStyle: options.applyCropSelectionStyle,\n applyGroupSelectionStyle: options.applyGroupSelectionStyle,\n });\n\n if (options.usageStatistics) {\n sendHostName();\n }\n\n if (this.ui) {\n this.ui.initCanvas();\n this.setReAction();\n }\n fabric.enableGLFiltering = false;\n }\n\n /**\n * Set selection style by init option\n * @param {Object} selectionStyle - Selection styles\n * @param {Object} applyTargets - Selection apply targets\n * @param {boolean} applyCropSelectionStyle - whether apply with crop selection style or not\n * @param {boolean} applyGroupSelectionStyle - whether apply with group selection style or not\n * @private\n */\n _setSelectionStyle(selectionStyle, { applyCropSelectionStyle, applyGroupSelectionStyle }) {\n if (selectionStyle) {\n this._graphics.setSelectionStyle(selectionStyle);\n }\n\n if (applyCropSelectionStyle) {\n this._graphics.setCropSelectionStyle(selectionStyle);\n }\n\n if (applyGroupSelectionStyle) {\n this.on('selectionCreated', (eventTarget) => {\n if (eventTarget.type === 'activeSelection') {\n eventTarget.set(selectionStyle);\n }\n });\n }\n }\n\n /**\n * Attach invoker events\n * @private\n */\n _attachInvokerEvents() {\n const {\n UNDO_STACK_CHANGED,\n REDO_STACK_CHANGED,\n EXECUTE_COMMAND,\n AFTER_UNDO,\n AFTER_REDO,\n HAND_STARTED,\n HAND_STOPPED,\n } = events;\n\n /**\n * Undo stack changed event\n * @event ImageEditor#undoStackChanged\n * @param {Number} length - undo stack length\n * @example\n * imageEditor.on('undoStackChanged', function(length) {\n * console.log(length);\n * });\n */\n this._invoker.on(UNDO_STACK_CHANGED, this.fire.bind(this, UNDO_STACK_CHANGED));\n /**\n * Redo stack changed event\n * @event ImageEditor#redoStackChanged\n * @param {Number} length - redo stack length\n * @example\n * imageEditor.on('redoStackChanged', function(length) {\n * console.log(length);\n * });\n */\n this._invoker.on(REDO_STACK_CHANGED, this.fire.bind(this, REDO_STACK_CHANGED));\n\n if (this.ui) {\n const canvas = this._graphics.getCanvas();\n\n this._invoker.on(EXECUTE_COMMAND, (command) => this.ui.fire(EXECUTE_COMMAND, command));\n this._invoker.on(AFTER_UNDO, (command) => this.ui.fire(AFTER_UNDO, command));\n this._invoker.on(AFTER_REDO, (command) => this.ui.fire(AFTER_REDO, command));\n\n canvas.on(HAND_STARTED, () => this.ui.fire(HAND_STARTED));\n canvas.on(HAND_STOPPED, () => this.ui.fire(HAND_STOPPED));\n }\n }\n\n /**\n * Attach canvas events\n * @private\n */\n _attachGraphicsEvents() {\n this._graphics.on({\n [MOUSE_DOWN]: this._handlers.mousedown,\n [OBJECT_MOVED]: this._handlers.objectMoved,\n [OBJECT_SCALED]: this._handlers.objectScaled,\n [OBJECT_ROTATED]: this._handlers.objectRotated,\n [OBJECT_ACTIVATED]: this._handlers.objectActivated,\n [OBJECT_ADDED]: this._handlers.objectAdded,\n [OBJECT_MODIFIED]: this._handlers.objectModified,\n [ADD_TEXT]: this._handlers.addText,\n [ADD_OBJECT]: this._handlers.addObject,\n [TEXT_EDITING]: this._handlers.textEditing,\n [TEXT_CHANGED]: this._handlers.textChanged,\n [ICON_CREATE_RESIZE]: this._handlers.iconCreateResize,\n [ICON_CREATE_END]: this._handlers.iconCreateEnd,\n [SELECTION_CLEARED]: this._handlers.selectionCleared,\n [SELECTION_CREATED]: this._handlers.selectionCreated,\n });\n }\n\n /**\n * Attach dom events\n * @private\n */\n _attachDomEvents() {\n // ImageEditor supports IE 9 higher\n document.addEventListener('keydown', this._handlers.keydown);\n }\n\n /**\n * Detach dom events\n * @private\n */\n _detachDomEvents() {\n // ImageEditor supports IE 9 higher\n document.removeEventListener('keydown', this._handlers.keydown);\n }\n\n /**\n * Keydown event handler\n * @param {KeyboardEvent} e - Event object\n * @private\n */\n /* eslint-disable complexity */\n _onKeyDown(e) {\n const { ctrlKey, keyCode, metaKey } = e;\n const isModifierKey = ctrlKey || metaKey;\n\n if (isModifierKey) {\n if (keyCode === keyCodes.C) {\n this._graphics.resetTargetObjectForCopyPaste();\n } else if (keyCode === keyCodes.V) {\n this._graphics.pasteObject();\n this.clearRedoStack();\n } else if (keyCode === keyCodes.Z) {\n // There is no error message on shortcut when it's empty\n this.undo()['catch'](() => {});\n } else if (keyCode === keyCodes.Y) {\n // There is no error message on shortcut when it's empty\n this.redo()['catch'](() => {});\n }\n }\n\n const isDeleteKey = keyCode === keyCodes.BACKSPACE || keyCode === keyCodes.DEL;\n const isRemoveReady = this._graphics.isReadyRemoveObject();\n\n if (isRemoveReady && isDeleteKey) {\n e.preventDefault();\n this.removeActiveObject();\n }\n }\n\n /**\n * Remove Active Object\n */\n removeActiveObject() {\n const activeObjectId = this._graphics.getActiveObjectIdForRemove();\n\n this.removeObject(activeObjectId);\n }\n\n /**\n * mouse down event handler\n * @param {Event} event - mouse down event\n * @param {Object} originPointer - origin pointer\n * @param {Number} originPointer.x x position\n * @param {Number} originPointer.y y position\n * @private\n */\n _onMouseDown(event, originPointer) {\n /**\n * The mouse down event with position x, y on canvas\n * @event ImageEditor#mousedown\n * @param {Object} event - browser mouse event object\n * @param {Object} originPointer origin pointer\n * @param {Number} originPointer.x x position\n * @param {Number} originPointer.y y position\n * @example\n * imageEditor.on('mousedown', function(event, originPointer) {\n * console.log(event);\n * console.log(originPointer);\n * if (imageEditor.hasFilter('colorFilter')) {\n * imageEditor.applyFilter('colorFilter', {\n * x: parseInt(originPointer.x, 10),\n * y: parseInt(originPointer.y, 10)\n * });\n * }\n * });\n */\n\n this.fire(events.MOUSE_DOWN, event, originPointer);\n }\n\n /**\n * Add a 'addObject' command\n * @param {Object} obj - Fabric object\n * @private\n */\n _pushAddObjectCommand(obj) {\n const command = commandFactory.create(commands.ADD_OBJECT, this._graphics, obj);\n this._invoker.pushUndoStack(command);\n }\n\n /**\n * Add a 'changeSelection' command\n * @param {fabric.Object} obj - selection object\n * @private\n */\n _pushModifyObjectCommand(obj) {\n const { type } = obj;\n const props = makeSelectionUndoData(obj, (item) =>\n makeSelectionUndoDatum(this._graphics.getObjectId(item), item, type === 'activeSelection')\n );\n const command = commandFactory.create(commands.CHANGE_SELECTION, this._graphics, props);\n command.execute(this._graphics, props);\n\n this._invoker.pushUndoStack(command);\n }\n\n /**\n * 'objectActivated' event handler\n * @param {ObjectProps} props - object properties\n * @private\n */\n _onObjectActivated(props) {\n /**\n * The event when object is selected(aka activated).\n * @event ImageEditor#objectActivated\n * @param {ObjectProps} objectProps - object properties\n * @example\n * imageEditor.on('objectActivated', function(props) {\n * console.log(props);\n * console.log(props.type);\n * console.log(props.id);\n * });\n */\n this.fire(events.OBJECT_ACTIVATED, props);\n }\n\n /**\n * 'objectMoved' event handler\n * @param {ObjectProps} props - object properties\n * @private\n */\n _onObjectMoved(props) {\n /**\n * The event when object is moved\n * @event ImageEditor#objectMoved\n * @param {ObjectProps} props - object properties\n * @example\n * imageEditor.on('objectMoved', function(props) {\n * console.log(props);\n * console.log(props.type);\n * });\n */\n this.fire(events.OBJECT_MOVED, props);\n }\n\n /**\n * 'objectScaled' event handler\n * @param {ObjectProps} props - object properties\n * @private\n */\n _onObjectScaled(props) {\n /**\n * The event when scale factor is changed\n * @event ImageEditor#objectScaled\n * @param {ObjectProps} props - object properties\n * @example\n * imageEditor.on('objectScaled', function(props) {\n * console.log(props);\n * console.log(props.type);\n * });\n */\n this.fire(events.OBJECT_SCALED, props);\n }\n\n /**\n * 'objectRotated' event handler\n * @param {ObjectProps} props - object properties\n * @private\n */\n _onObjectRotated(props) {\n /**\n * The event when object angle is changed\n * @event ImageEditor#objectRotated\n * @param {ObjectProps} props - object properties\n * @example\n * imageEditor.on('objectRotated', function(props) {\n * console.log(props);\n * console.log(props.type);\n * });\n */\n this.fire(events.OBJECT_ROTATED, props);\n }\n\n /**\n * Get current drawing mode\n * @returns {string}\n * @example\n * // Image editor drawing mode\n * //\n * // NORMAL: 'NORMAL'\n * // CROPPER: 'CROPPER'\n * // FREE_DRAWING: 'FREE_DRAWING'\n * // LINE_DRAWING: 'LINE_DRAWING'\n * // TEXT: 'TEXT'\n * //\n * if (imageEditor.getDrawingMode() === 'FREE_DRAWING') {\n * imageEditor.stopDrawingMode();\n * }\n */\n getDrawingMode() {\n return this._graphics.getDrawingMode();\n }\n\n /**\n * Clear all objects\n * @returns {Promise}\n * @example\n * imageEditor.clearObjects();\n */\n clearObjects() {\n return this.execute(commands.CLEAR_OBJECTS);\n }\n\n /**\n * Deactivate all objects\n * @example\n * imageEditor.deactivateAll();\n */\n deactivateAll() {\n this._graphics.deactivateAll();\n this._graphics.renderAll();\n }\n\n /**\n * discard selction\n * @example\n * imageEditor.discardSelection();\n */\n discardSelection() {\n this._graphics.discardSelection();\n }\n\n /**\n * selectable status change\n * @param {boolean} selectable - selectable status\n * @example\n * imageEditor.changeSelectableAll(false); // or true\n */\n changeSelectableAll(selectable) {\n this._graphics.changeSelectableAll(selectable);\n }\n\n /**\n * Init history\n */\n _initHistory() {\n if (this.ui) {\n this.ui.initHistory();\n }\n }\n\n /**\n * Clear history\n */\n _clearHistory() {\n if (this.ui) {\n this.ui.clearHistory();\n }\n }\n\n /**\n * Invoke command\n * @param {String} commandName - Command name\n * @param {...*} args - Arguments for creating command\n * @returns {Promise}\n * @private\n */\n execute(commandName, ...args) {\n // Inject an Graphics instance as first parameter\n const theArgs = [this._graphics].concat(args);\n\n return this._invoker.execute(commandName, ...theArgs);\n }\n\n /**\n * Invoke command\n * @param {String} commandName - Command name\n * @param {...*} args - Arguments for creating command\n * @returns {Promise}\n * @private\n */\n executeSilent(commandName, ...args) {\n // Inject an Graphics instance as first parameter\n const theArgs = [this._graphics].concat(args);\n\n return this._invoker.executeSilent(commandName, ...theArgs);\n }\n\n /**\n * Undo\n * @param {number} [iterationCount=1] - Iteration count of undo\n * @returns {Promise}\n * @example\n * imageEditor.undo();\n */\n undo(iterationCount = 1) {\n let promise = Promise.resolve();\n\n for (let i = 0; i < iterationCount; i += 1) {\n promise = promise.then(() => this._invoker.undo());\n }\n\n return promise;\n }\n\n /**\n * Redo\n * @param {number} [iterationCount=1] - Iteration count of redo\n * @returns {Promise}\n * @example\n * imageEditor.redo();\n */\n redo(iterationCount = 1) {\n let promise = Promise.resolve();\n\n for (let i = 0; i < iterationCount; i += 1) {\n promise = promise.then(() => this._invoker.redo());\n }\n\n return promise;\n }\n\n /**\n * Zoom\n * @param {number} x - x axis of center point for zoom\n * @param {number} y - y axis of center point for zoom\n * @param {number} zoomLevel - level of zoom(1.0 ~ 5.0)\n */\n zoom({ x, y, zoomLevel }) {\n this._graphics.zoom({ x, y }, zoomLevel);\n }\n\n /**\n * Reset zoom. Change zoom level to 1.0\n */\n resetZoom() {\n this._graphics.resetZoom();\n }\n\n /**\n * Load image from file\n * @param {File} imgFile - Image file\n * @param {string} [imageName] - imageName\n * @returns {Promise}\n * @example\n * imageEditor.loadImageFromFile(file).then(result => {\n * console.log('old : ' + result.oldWidth + ', ' + result.oldHeight);\n * console.log('new : ' + result.newWidth + ', ' + result.newHeight);\n * });\n */\n loadImageFromFile(imgFile, imageName) {\n if (!imgFile) {\n return Promise.reject(rejectMessages.invalidParameters);\n }\n\n const imgUrl = URL.createObjectURL(imgFile);\n imageName = imageName || imgFile.name;\n\n return this.loadImageFromURL(imgUrl, imageName).then((value) => {\n URL.revokeObjectURL(imgFile);\n\n return value;\n });\n }\n\n /**\n * Load image from url\n * @param {string} url - File url\n * @param {string} imageName - imageName\n * @returns {Promise}\n * @example\n * imageEditor.loadImageFromURL('http://url/testImage.png', 'lena').then(result => {\n * console.log('old : ' + result.oldWidth + ', ' + result.oldHeight);\n * console.log('new : ' + result.newWidth + ', ' + result.newHeight);\n * });\n */\n loadImageFromURL(url, imageName) {\n if (!imageName || !url) {\n return Promise.reject(rejectMessages.invalidParameters);\n }\n\n return this.execute(commands.LOAD_IMAGE, imageName, url);\n }\n\n /**\n * Add image object on canvas\n * @param {string} imgUrl - Image url to make object\n * @returns {Promise}\n * @example\n * imageEditor.addImageObject('path/fileName.jpg').then(objectProps => {\n * console.log(ojectProps.id);\n * });\n */\n addImageObject(imgUrl) {\n if (!imgUrl) {\n return Promise.reject(rejectMessages.invalidParameters);\n }\n\n return this.execute(commands.ADD_IMAGE_OBJECT, imgUrl);\n }\n\n /**\n * Start a drawing mode. If the current mode is not 'NORMAL', 'stopDrawingMode()' will be called first.\n * @param {String} mode Can be one of 'CROPPER', 'FREE_DRAWING', 'LINE_DRAWING', 'TEXT', 'SHAPE'\n * @param {Object} [option] parameters of drawing mode, it's available with 'FREE_DRAWING', 'LINE_DRAWING'\n * @param {Number} [option.width] brush width\n * @param {String} [option.color] brush color\n * @param {Object} [option.arrowType] arrow decorate\n * @param {string} [option.arrowType.tail] arrow decorate for tail. 'chevron' or 'triangle'\n * @param {string} [option.arrowType.head] arrow decorate for head. 'chevron' or 'triangle'\n * @returns {boolean} true if success or false\n * @example\n * imageEditor.startDrawingMode('FREE_DRAWING', {\n * width: 10,\n * color: 'rgba(255,0,0,0.5)'\n * });\n * imageEditor.startDrawingMode('LINE_DRAWING', {\n * width: 10,\n * color: 'rgba(255,0,0,0.5)',\n * arrowType: {\n * tail: 'chevron' // triangle\n * }\n * });\n *\n */\n startDrawingMode(mode, option) {\n return this._graphics.startDrawingMode(mode, option);\n }\n\n /**\n * Stop the current drawing mode and back to the 'NORMAL' mode\n * @example\n * imageEditor.stopDrawingMode();\n */\n stopDrawingMode() {\n this._graphics.stopDrawingMode();\n }\n\n /**\n * Crop this image with rect\n * @param {Object} rect crop rect\n * @param {Number} rect.left left position\n * @param {Number} rect.top top position\n * @param {Number} rect.width width\n * @param {Number} rect.height height\n * @returns {Promise}\n * @example\n * imageEditor.crop(imageEditor.getCropzoneRect());\n */\n crop(rect) {\n const data = this._graphics.getCroppedImageData(rect);\n if (!data) {\n return Promise.reject(rejectMessages.invalidParameters);\n }\n\n return this.loadImageFromURL(data.url, data.imageName);\n }\n\n /**\n * Get the cropping rect\n * @returns {Object} {{left: number, top: number, width: number, height: number}} rect\n */\n getCropzoneRect() {\n return this._graphics.getCropzoneRect();\n }\n\n /**\n * Set the cropping rect\n * @param {number} [mode] crop rect mode [1, 1.5, 1.3333333333333333, 1.25, 1.7777777777777777]\n */\n setCropzoneRect(mode) {\n this._graphics.setCropzoneRect(mode);\n }\n\n /**\n * Flip\n * @returns {Promise}\n * @param {string} type - 'flipX' or 'flipY' or 'reset'\n * @returns {Promise}\n * @private\n */\n _flip(type) {\n return this.execute(commands.FLIP_IMAGE, type);\n }\n\n /**\n * Flip x\n * @returns {Promise}\n * @example\n * imageEditor.flipX().then((status => {\n * console.log('flipX: ', status.flipX);\n * console.log('flipY: ', status.flipY);\n * console.log('angle: ', status.angle);\n * }).catch(message => {\n * console.log('error: ', message);\n * });\n */\n flipX() {\n return this._flip('flipX');\n }\n\n /**\n * Flip y\n * @returns {Promise}\n * @example\n * imageEditor.flipY().then(status => {\n * console.log('flipX: ', status.flipX);\n * console.log('flipY: ', status.flipY);\n * console.log('angle: ', status.angle);\n * }).catch(message => {\n * console.log('error: ', message);\n * });\n */\n flipY() {\n return this._flip('flipY');\n }\n\n /**\n * Reset flip\n * @returns {Promise}\n * @example\n * imageEditor.resetFlip().then(status => {\n * console.log('flipX: ', status.flipX);\n * console.log('flipY: ', status.flipY);\n * console.log('angle: ', status.angle);\n * }).catch(message => {\n * console.log('error: ', message);\n * });;\n */\n resetFlip() {\n return this._flip('reset');\n }\n\n /**\n * @param {string} type - 'rotate' or 'setAngle'\n * @param {number} angle - angle value (degree)\n * @param {boolean} isSilent - is silent execution or not\n * @returns {Promise}\n * @private\n */\n _rotate(type, angle, isSilent) {\n let result = null;\n\n if (isSilent) {\n result = this.executeSilent(commands.ROTATE_IMAGE, type, angle);\n } else {\n result = this.execute(commands.ROTATE_IMAGE, type, angle);\n }\n\n return result;\n }\n\n /**\n * Rotate image\n * @returns {Promise}\n * @param {number} angle - Additional angle to rotate image\n * @param {boolean} isSilent - is silent execution or not\n * @returns {Promise}\n * @example\n * imageEditor.rotate(10); // angle = 10\n * imageEditor.rotate(10); // angle = 20\n * imageEditor.rotate(5); // angle = 5\n * imageEditor.rotate(-95); // angle = -90\n * imageEditor.rotate(10).then(status => {\n * console.log('angle: ', status.angle);\n * })).catch(message => {\n * console.log('error: ', message);\n * });\n */\n rotate(angle, isSilent) {\n return this._rotate('rotate', angle, isSilent);\n }\n\n /**\n * Set angle\n * @param {number} angle - Angle of image\n * @param {boolean} isSilent - is silent execution or not\n * @returns {Promise}\n * @example\n * imageEditor.setAngle(10); // angle = 10\n * imageEditor.rotate(10); // angle = 20\n * imageEditor.setAngle(5); // angle = 5\n * imageEditor.rotate(50); // angle = 55\n * imageEditor.setAngle(-40); // angle = -40\n * imageEditor.setAngle(10).then(status => {\n * console.log('angle: ', status.angle);\n * })).catch(message => {\n * console.log('error: ', message);\n * });\n */\n setAngle(angle, isSilent) {\n return this._rotate('setAngle', angle, isSilent);\n }\n\n /**\n * Set drawing brush\n * @param {Object} option brush option\n * @param {Number} option.width width\n * @param {String} option.color color like 'FFFFFF', 'rgba(0, 0, 0, 0.5)'\n * @example\n * imageEditor.startDrawingMode('FREE_DRAWING');\n * imageEditor.setBrush({\n * width: 12,\n * color: 'rgba(0, 0, 0, 0.5)'\n * });\n * imageEditor.setBrush({\n * width: 8,\n * color: 'FFFFFF'\n * });\n */\n setBrush(option) {\n this._graphics.setBrush(option);\n }\n\n /**\n * Set states of current drawing shape\n * @param {string} type - Shape type (ex: 'rect', 'circle', 'triangle')\n * @param {Object} [options] - Shape options\n * @param {(ShapeFillOption | string)} [options.fill] - {@link ShapeFillOption} or\n * Shape foreground color (ex: '#fff', 'transparent')\n * @param {string} [options.stoke] - Shape outline color\n * @param {number} [options.strokeWidth] - Shape outline width\n * @param {number} [options.width] - Width value (When type option is 'rect', this options can use)\n * @param {number} [options.height] - Height value (When type option is 'rect', this options can use)\n * @param {number} [options.rx] - Radius x value (When type option is 'circle', this options can use)\n * @param {number} [options.ry] - Radius y value (When type option is 'circle', this options can use)\n * @param {number} [options.isRegular] - Whether resizing shape has 1:1 ratio or not\n * @example\n * imageEditor.setDrawingShape('rect', {\n * fill: 'red',\n * width: 100,\n * height: 200\n * });\n * @example\n * imageEditor.setDrawingShape('rect', {\n * fill: {\n * type: 'filter',\n * filter: [{blur: 0.3}, {pixelate: 20}]\n * },\n * width: 100,\n * height: 200\n * });\n * @example\n * imageEditor.setDrawingShape('circle', {\n * fill: 'transparent',\n * stroke: 'blue',\n * strokeWidth: 3,\n * rx: 10,\n * ry: 100\n * });\n * @example\n * imageEditor.setDrawingShape('triangle', { // When resizing, the shape keep the 1:1 ratio\n * width: 1,\n * height: 1,\n * isRegular: true\n * });\n * @example\n * imageEditor.setDrawingShape('circle', { // When resizing, the shape keep the 1:1 ratio\n * rx: 10,\n * ry: 10,\n * isRegular: true\n * });\n */\n setDrawingShape(type, options) {\n this._graphics.setDrawingShape(type, options);\n }\n\n setDrawingIcon(type, iconColor) {\n this._graphics.setIconStyle(type, iconColor);\n }\n\n /**\n * Add shape\n * @param {string} type - Shape type (ex: 'rect', 'circle', 'triangle')\n * @param {Object} options - Shape options\n * @param {(ShapeFillOption | string)} [options.fill] - {@link ShapeFillOption} or\n * Shape foreground color (ex: '#fff', 'transparent')\n * @param {string} [options.stroke] - Shape outline color\n * @param {number} [options.strokeWidth] - Shape outline width\n * @param {number} [options.width] - Width value (When type option is 'rect', this options can use)\n * @param {number} [options.height] - Height value (When type option is 'rect', this options can use)\n * @param {number} [options.rx] - Radius x value (When type option is 'circle', this options can use)\n * @param {number} [options.ry] - Radius y value (When type option is 'circle', this options can use)\n * @param {number} [options.left] - Shape x position\n * @param {number} [options.top] - Shape y position\n * @param {boolean} [options.isRegular] - Whether resizing shape has 1:1 ratio or not\n * @returns {Promise}\n * @example\n * imageEditor.addShape('rect', {\n * fill: 'red',\n * stroke: 'blue',\n * strokeWidth: 3,\n * width: 100,\n * height: 200,\n * left: 10,\n * top: 10,\n * isRegular: true\n * });\n * @example\n * imageEditor.addShape('circle', {\n * fill: 'red',\n * stroke: 'blue',\n * strokeWidth: 3,\n * rx: 10,\n * ry: 100,\n * isRegular: false\n * }).then(objectProps => {\n * console.log(objectProps.id);\n * });\n * @example\n * imageEditor.addShape('rect', {\n * fill: {\n * type: 'filter',\n * filter: [{blur: 0.3}, {pixelate: 20}]\n * },\n * stroke: 'blue',\n * strokeWidth: 3,\n * rx: 10,\n * ry: 100,\n * isRegular: false\n * }).then(objectProps => {\n * console.log(objectProps.id);\n * });\n */\n addShape(type, options) {\n options = options || {};\n\n this._setPositions(options);\n\n return this.execute(commands.ADD_SHAPE, type, options);\n }\n\n /**\n * Change shape\n * @param {number} id - object id\n * @param {Object} options - Shape options\n * @param {(ShapeFillOption | string)} [options.fill] - {@link ShapeFillOption} or\n * Shape foreground color (ex: '#fff', 'transparent')\n * @param {string} [options.stroke] - Shape outline color\n * @param {number} [options.strokeWidth] - Shape outline width\n * @param {number} [options.width] - Width value (When type option is 'rect', this options can use)\n * @param {number} [options.height] - Height value (When type option is 'rect', this options can use)\n * @param {number} [options.rx] - Radius x value (When type option is 'circle', this options can use)\n * @param {number} [options.ry] - Radius y value (When type option is 'circle', this options can use)\n * @param {boolean} [options.isRegular] - Whether resizing shape has 1:1 ratio or not\n * @param {boolean} isSilent - is silent execution or not\n * @returns {Promise}\n * @example\n * // call after selecting shape object on canvas\n * imageEditor.changeShape(id, { // change rectagle or triangle\n * fill: 'red',\n * stroke: 'blue',\n * strokeWidth: 3,\n * width: 100,\n * height: 200\n * });\n * @example\n * // call after selecting shape object on canvas\n * imageEditor.changeShape(id, { // change circle\n * fill: 'red',\n * stroke: 'blue',\n * strokeWidth: 3,\n * rx: 10,\n * ry: 100\n * });\n */\n changeShape(id, options, isSilent) {\n const executeMethodName = isSilent ? 'executeSilent' : 'execute';\n\n return this[executeMethodName](commands.CHANGE_SHAPE, id, options);\n }\n\n /**\n * Add text on image\n * @param {string} text - Initial input text\n * @param {Object} [options] Options for generating text\n * @param {Object} [options.styles] Initial styles\n * @param {string} [options.styles.fill] Color\n * @param {string} [options.styles.fontFamily] Font type for text\n * @param {number} [options.styles.fontSize] Size\n * @param {string} [options.styles.fontStyle] Type of inclination (normal / italic)\n * @param {string} [options.styles.fontWeight] Type of thicker or thinner looking (normal / bold)\n * @param {string} [options.styles.textAlign] Type of text align (left / center / right)\n * @param {string} [options.styles.textDecoration] Type of line (underline / line-through / overline)\n * @param {{x: number, y: number}} [options.position] - Initial position\n * @param {boolean} [options.autofocus] - text autofocus, default is true\n * @returns {Promise}\n * @example\n * imageEditor.addText('init text');\n * @example\n * imageEditor.addText('init text', {\n * styles: {\n * fill: '#000',\n * fontSize: 20,\n * fontWeight: 'bold'\n * },\n * position: {\n * x: 10,\n * y: 10\n * }\n * }).then(objectProps => {\n * console.log(objectProps.id);\n * });\n */\n addText(text, options) {\n text = text || '';\n options = options || {};\n\n return this.execute(commands.ADD_TEXT, text, options);\n }\n\n /**\n * Change contents of selected text object on image\n * @param {number} id - object id\n * @param {string} text - Changing text\n * @returns {Promise}\n * @example\n * imageEditor.changeText(id, 'change text');\n */\n changeText(id, text) {\n text = text || '';\n\n return this.execute(commands.CHANGE_TEXT, id, text);\n }\n\n /**\n * Set style\n * @param {number} id - object id\n * @param {Object} styleObj - text styles\n * @param {string} [styleObj.fill] Color\n * @param {string} [styleObj.fontFamily] Font type for text\n * @param {number} [styleObj.fontSize] Size\n * @param {string} [styleObj.fontStyle] Type of inclination (normal / italic)\n * @param {string} [styleObj.fontWeight] Type of thicker or thinner looking (normal / bold)\n * @param {string} [styleObj.textAlign] Type of text align (left / center / right)\n * @param {string} [styleObj.textDecoration] Type of line (underline / line-through / overline)\n * @param {boolean} isSilent - is silent execution or not\n * @returns {Promise}\n * @example\n * imageEditor.changeTextStyle(id, {\n * fontStyle: 'italic'\n * });\n */\n changeTextStyle(id, styleObj, isSilent) {\n const executeMethodName = isSilent ? 'executeSilent' : 'execute';\n\n return this[executeMethodName](commands.CHANGE_TEXT_STYLE, id, styleObj);\n }\n\n /**\n * change text mode\n * @param {string} type - change type\n * @private\n */\n _changeActivateMode(type) {\n if (type !== 'ICON' && this.getDrawingMode() !== type) {\n this.startDrawingMode(type);\n }\n }\n\n /**\n * 'textChanged' event handler\n * @param {Object} target - changed text object\n * @private\n */\n _onTextChanged(target) {\n this.fire(events.TEXT_CHANGED, target);\n }\n\n /**\n * 'iconCreateResize' event handler\n * @param {Object} originPointer origin pointer\n * @param {Number} originPointer.x x position\n * @param {Number} originPointer.y y position\n * @private\n */\n _onIconCreateResize(originPointer) {\n this.fire(events.ICON_CREATE_RESIZE, originPointer);\n }\n\n /**\n * 'iconCreateEnd' event handler\n * @param {Object} originPointer origin pointer\n * @param {Number} originPointer.x x position\n * @param {Number} originPointer.y y position\n * @private\n */\n _onIconCreateEnd(originPointer) {\n this.fire(events.ICON_CREATE_END, originPointer);\n }\n\n /**\n * 'textEditing' event handler\n * @private\n */\n _onTextEditing() {\n /**\n * The event which starts to edit text object\n * @event ImageEditor#textEditing\n * @example\n * imageEditor.on('textEditing', function() {\n * console.log('text editing');\n * });\n */\n\n this.fire(events.TEXT_EDITING);\n }\n\n /**\n * Mousedown event handler in case of 'TEXT' drawing mode\n * @param {fabric.Event} event - Current mousedown event object\n * @private\n */\n _onAddText(event) {\n /**\n * The event when 'TEXT' drawing mode is enabled and click non-object area.\n * @event ImageEditor#addText\n * @param {Object} pos\n * @param {Object} pos.originPosition - Current position on origin canvas\n * @param {Number} pos.originPosition.x - x\n * @param {Number} pos.originPosition.y - y\n * @param {Object} pos.clientPosition - Current position on client area\n * @param {Number} pos.clientPosition.x - x\n * @param {Number} pos.clientPosition.y - y\n * @example\n * imageEditor.on('addText', function(pos) {\n * console.log('text position on canvas: ' + pos.originPosition);\n * console.log('text position on brwoser: ' + pos.clientPosition);\n * });\n */\n\n this.fire(events.ADD_TEXT, {\n originPosition: event.originPosition,\n clientPosition: event.clientPosition,\n });\n }\n\n /**\n * 'addObject' event handler\n * @param {Object} objectProps added object properties\n * @private\n */\n _onAddObject(objectProps) {\n const obj = this._graphics.getObject(objectProps.id);\n this._invoker.fire(events.EXECUTE_COMMAND, getObjectType(obj.type));\n this._pushAddObjectCommand(obj);\n }\n\n /**\n * 'objectAdded' event handler\n * @param {Object} objectProps added object properties\n * @private\n */\n _onObjectAdded(objectProps) {\n /**\n * The event when object added\n * @event ImageEditor#objectAdded\n * @param {ObjectProps} props - object properties\n * @example\n * imageEditor.on('objectAdded', function(props) {\n * console.log(props);\n * });\n */\n this.fire(OBJECT_ADDED, objectProps);\n\n /**\n * The event when object added (deprecated)\n * @event ImageEditor#addObjectAfter\n * @param {ObjectProps} props - object properties\n * @deprecated\n */\n this.fire(ADD_OBJECT_AFTER, objectProps);\n }\n\n /**\n * 'objectModified' event handler\n * @param {fabric.Object} obj - selection object\n * @private\n */\n _onObjectModified(obj) {\n if (obj.type !== OBJ_TYPE.CROPZONE) {\n this._invoker.fire(events.EXECUTE_COMMAND, getObjectType(obj.type));\n this._pushModifyObjectCommand(obj);\n }\n }\n\n /**\n * 'selectionCleared' event handler\n * @private\n */\n _selectionCleared() {\n this.fire(SELECTION_CLEARED);\n }\n\n /**\n * 'selectionCreated' event handler\n * @param {Object} eventTarget - Fabric object\n * @private\n */\n _selectionCreated(eventTarget) {\n this.fire(SELECTION_CREATED, eventTarget);\n }\n\n /**\n * Register custom icons\n * @param {{iconType: string, pathValue: string}} infos - Infos to register icons\n * @example\n * imageEditor.registerIcons({\n * customIcon: 'M 0 0 L 20 20 L 10 10 Z',\n * customArrow: 'M 60 0 L 120 60 H 90 L 75 45 V 180 H 45 V 45 L 30 60 H 0 Z'\n * });\n */\n registerIcons(infos) {\n this._graphics.registerPaths(infos);\n }\n\n /**\n * Change canvas cursor type\n * @param {string} cursorType - cursor type\n * @example\n * imageEditor.changeCursor('crosshair');\n */\n changeCursor(cursorType) {\n this._graphics.changeCursor(cursorType);\n }\n\n /**\n * Add icon on canvas\n * @param {string} type - Icon type ('arrow', 'cancel', custom icon name)\n * @param {Object} options - Icon options\n * @param {string} [options.fill] - Icon foreground color\n * @param {number} [options.left] - Icon x position\n * @param {number} [options.top] - Icon y position\n * @returns {Promise}\n * @example\n * imageEditor.addIcon('arrow'); // The position is center on canvas\n * @example\n * imageEditor.addIcon('arrow', {\n * left: 100,\n * top: 100\n * }).then(objectProps => {\n * console.log(objectProps.id);\n * });\n */\n addIcon(type, options) {\n options = options || {};\n\n this._setPositions(options);\n\n return this.execute(commands.ADD_ICON, type, options);\n }\n\n /**\n * Change icon color\n * @param {number} id - object id\n * @param {string} color - Color for icon\n * @returns {Promise}\n * @example\n * imageEditor.changeIconColor(id, '#000000');\n */\n changeIconColor(id, color) {\n return this.execute(commands.CHANGE_ICON_COLOR, id, color);\n }\n\n /**\n * Remove an object or group by id\n * @param {number} id - object id\n * @returns {Promise}\n * @example\n * imageEditor.removeObject(id);\n */\n removeObject(id) {\n const { type } = this._graphics.getObject(id);\n\n return this.execute(commands.REMOVE_OBJECT, id, getObjectType(type));\n }\n\n /**\n * Whether it has the filter or not\n * @param {string} type - Filter type\n * @returns {boolean} true if it has the filter\n */\n hasFilter(type) {\n return this._graphics.hasFilter(type);\n }\n\n /**\n * Remove filter on canvas image\n * @param {string} type - Filter type\n * @returns {Promise}\n * @example\n * imageEditor.removeFilter('Grayscale').then(obj => {\n * console.log('filterType: ', obj.type);\n * console.log('actType: ', obj.action);\n * }).catch(message => {\n * console.log('error: ', message);\n * });\n */\n removeFilter(type) {\n return this.execute(commands.REMOVE_FILTER, type);\n }\n\n /**\n * Apply filter on canvas image\n * @param {string} type - Filter type\n * @param {object} options - Options to apply filter\n * @param {boolean} isSilent - is silent execution or not\n * @returns {Promise}\n * @example\n * imageEditor.applyFilter('Grayscale');\n * @example\n * imageEditor.applyFilter('mask', {maskObjId: id}).then(obj => {\n * console.log('filterType: ', obj.type);\n * console.log('actType: ', obj.action);\n * }).catch(message => {\n * console.log('error: ', message);\n * });;\n */\n applyFilter(type, options, isSilent) {\n const executeMethodName = isSilent ? 'executeSilent' : 'execute';\n\n return this[executeMethodName](commands.APPLY_FILTER, type, options);\n }\n\n /**\n * Get data url\n * @param {Object} options - options for toDataURL\n * @param {String} [options.format=png] The format of the output image. Either \"jpeg\" or \"png\"\n * @param {Number} [options.quality=1] Quality level (0..1). Only used for jpeg.\n * @param {Number} [options.multiplier=1] Multiplier to scale by\n * @param {Number} [options.left] Cropping left offset. Introduced in fabric v1.2.14\n * @param {Number} [options.top] Cropping top offset. Introduced in fabric v1.2.14\n * @param {Number} [options.width] Cropping width. Introduced in fabric v1.2.14\n * @param {Number} [options.height] Cropping height. Introduced in fabric v1.2.14\n * @returns {string} A DOMString containing the requested data URI\n * @example\n * imgEl.src = imageEditor.toDataURL();\n *\n * imageEditor.loadImageFromURL(imageEditor.toDataURL(), 'FilterImage').then(() => {\n * imageEditor.addImageObject(imgUrl);\n * });\n */\n toDataURL(options) {\n return this._graphics.toDataURL(options);\n }\n\n /**\n * Get image name\n * @returns {string} image name\n * @example\n * console.log(imageEditor.getImageName());\n */\n getImageName() {\n return this._graphics.getImageName();\n }\n\n /**\n * Clear undoStack\n * @example\n * imageEditor.clearUndoStack();\n */\n clearUndoStack() {\n this._invoker.clearUndoStack();\n }\n\n /**\n * Clear redoStack\n * @example\n * imageEditor.clearRedoStack();\n */\n clearRedoStack() {\n this._invoker.clearRedoStack();\n }\n\n /**\n * Whehter the undo stack is empty or not\n * @returns {boolean}\n * imageEditor.isEmptyUndoStack();\n */\n isEmptyUndoStack() {\n return this._invoker.isEmptyUndoStack();\n }\n\n /**\n * Whehter the redo stack is empty or not\n * @returns {boolean}\n * imageEditor.isEmptyRedoStack();\n */\n isEmptyRedoStack() {\n return this._invoker.isEmptyRedoStack();\n }\n\n /**\n * Resize canvas dimension\n * @param {{width: number, height: number}} dimension - Max width & height\n * @returns {Promise}\n */\n resizeCanvasDimension(dimension) {\n if (!dimension) {\n return Promise.reject(rejectMessages.invalidParameters);\n }\n\n return this.execute(commands.RESIZE_CANVAS_DIMENSION, dimension);\n }\n\n /**\n * Destroy\n */\n destroy() {\n this.stopDrawingMode();\n this._detachDomEvents();\n this._graphics.destroy();\n this._graphics = null;\n\n if (this.ui) {\n this.ui.destroy();\n }\n\n forEach(\n this,\n (value, key) => {\n this[key] = null;\n },\n this\n );\n }\n\n /**\n * Set position\n * @param {Object} options - Position options (left or top)\n * @private\n */\n _setPositions(options) {\n const centerPosition = this._graphics.getCenter();\n\n if (isUndefined(options.left)) {\n options.left = centerPosition.left;\n }\n\n if (isUndefined(options.top)) {\n options.top = centerPosition.top;\n }\n }\n\n /**\n * Set properties of active object\n * @param {number} id - object id\n * @param {Object} keyValue - key & value\n * @returns {Promise}\n * @example\n * imageEditor.setObjectProperties(id, {\n * left:100,\n * top:100,\n * width: 200,\n * height: 200,\n * opacity: 0.5\n * });\n */\n setObjectProperties(id, keyValue) {\n return this.execute(commands.SET_OBJECT_PROPERTIES, id, keyValue);\n }\n\n /**\n * Set properties of active object, Do not leave an invoke history.\n * @param {number} id - object id\n * @param {Object} keyValue - key & value\n * @example\n * imageEditor.setObjectPropertiesQuietly(id, {\n * left:100,\n * top:100,\n * width: 200,\n * height: 200,\n * opacity: 0.5\n * });\n */\n setObjectPropertiesQuietly(id, keyValue) {\n this._graphics.setObjectProperties(id, keyValue);\n }\n\n /**\n * Get properties of active object corresponding key\n * @param {number} id - object id\n * @param {Array|ObjectProps|string} keys - property's key\n * @returns {ObjectProps} properties if id is valid or null\n * @example\n * var props = imageEditor.getObjectProperties(id, 'left');\n * console.log(props);\n * @example\n * var props = imageEditor.getObjectProperties(id, ['left', 'top', 'width', 'height']);\n * console.log(props);\n * @example\n * var props = imageEditor.getObjectProperties(id, {\n * left: null,\n * top: null,\n * width: null,\n * height: null,\n * opacity: null\n * });\n * console.log(props);\n */\n getObjectProperties(id, keys) {\n const object = this._graphics.getObject(id);\n if (!object) {\n return null;\n }\n\n return this._graphics.getObjectProperties(id, keys);\n }\n\n /**\n * Get the canvas size\n * @returns {Object} {{width: number, height: number}} canvas size\n * @example\n * var canvasSize = imageEditor.getCanvasSize();\n * console.log(canvasSize.width);\n * console.height(canvasSize.height);\n */\n getCanvasSize() {\n return this._graphics.getCanvasSize();\n }\n\n /**\n * Get object position by originX, originY\n * @param {number} id - object id\n * @param {string} originX - can be 'left', 'center', 'right'\n * @param {string} originY - can be 'top', 'center', 'bottom'\n * @returns {Object} {{x:number, y: number}} position by origin if id is valid, or null\n * @example\n * var position = imageEditor.getObjectPosition(id, 'left', 'top');\n * console.log(position);\n */\n getObjectPosition(id, originX, originY) {\n return this._graphics.getObjectPosition(id, originX, originY);\n }\n\n /**\n * Set object position by originX, originY\n * @param {number} id - object id\n * @param {Object} posInfo - position object\n * @param {number} posInfo.x - x position\n * @param {number} posInfo.y - y position\n * @param {string} posInfo.originX - can be 'left', 'center', 'right'\n * @param {string} posInfo.originY - can be 'top', 'center', 'bottom'\n * @returns {Promise}\n * @example\n * // align the object to 'left', 'top'\n * imageEditor.setObjectPosition(id, {\n * x: 0,\n * y: 0,\n * originX: 'left',\n * originY: 'top'\n * });\n * @example\n * // align the object to 'right', 'top'\n * var canvasSize = imageEditor.getCanvasSize();\n * imageEditor.setObjectPosition(id, {\n * x: canvasSize.width,\n * y: 0,\n * originX: 'right',\n * originY: 'top'\n * });\n * @example\n * // align the object to 'left', 'bottom'\n * var canvasSize = imageEditor.getCanvasSize();\n * imageEditor.setObjectPosition(id, {\n * x: 0,\n * y: canvasSize.height,\n * originX: 'left',\n * originY: 'bottom'\n * });\n * @example\n * // align the object to 'right', 'bottom'\n * var canvasSize = imageEditor.getCanvasSize();\n * imageEditor.setObjectPosition(id, {\n * x: canvasSize.width,\n * y: canvasSize.height,\n * originX: 'right',\n * originY: 'bottom'\n * });\n */\n setObjectPosition(id, posInfo) {\n return this.execute(commands.SET_OBJECT_POSITION, id, posInfo);\n }\n}\n\naction.mixin(ImageEditor);\nCustomEvents.mixin(ImageEditor);\n\nexport default ImageEditor;\n","/**\n * @author NHN. FE Development Team \n * @fileoverview Invoker - invoke commands\n */\nimport snippet from 'tui-code-snippet';\nimport commandFactory from '@/factory/command';\nimport { Promise } from '@/util';\nimport { eventNames, rejectMessages } from '@/consts';\n\nconst { isFunction, isString, CustomEvents } = snippet;\n\n/**\n * Invoker\n * @class\n * @ignore\n */\nclass Invoker {\n constructor() {\n /**\n * Undo stack\n * @type {Array.}\n * @private\n */\n this._undoStack = [];\n\n /**\n * Redo stack\n * @type {Array.}\n * @private\n */\n this._redoStack = [];\n\n /**\n * Lock-flag for executing command\n * @type {boolean}\n * @private\n */\n this._isLocked = false;\n\n this._isSilent = false;\n }\n\n /**\n * Invoke command execution\n * @param {Command} command - Command\n * @param {boolean} [isRedo=false] - check if command is redo\n * @returns {Promise}\n * @private\n */\n _invokeExecution(command, isRedo = false) {\n this.lock();\n\n let { args } = command;\n if (!args) {\n args = [];\n }\n\n return command\n .execute(...args)\n .then((value) => {\n if (!this._isSilent) {\n this.pushUndoStack(command);\n\n this.fire(isRedo ? eventNames.AFTER_REDO : eventNames.EXECUTE_COMMAND, command);\n }\n this.unlock();\n if (isFunction(command.executeCallback)) {\n command.executeCallback(value);\n }\n\n return value;\n })\n ['catch']((message) => {\n this.unlock();\n\n return Promise.reject(message);\n });\n }\n\n /**\n * Invoke command undo\n * @param {Command} command - Command\n * @returns {Promise}\n * @private\n */\n _invokeUndo(command) {\n this.lock();\n\n let { args } = command;\n if (!args) {\n args = [];\n }\n\n return command\n .undo(...args)\n .then((value) => {\n this.pushRedoStack(command);\n this.fire(eventNames.AFTER_UNDO, command);\n this.unlock();\n if (isFunction(command.undoCallback)) {\n command.undoCallback(value);\n }\n\n return value;\n })\n ['catch']((message) => {\n this.unlock();\n\n return Promise.reject(message);\n });\n }\n\n /**\n * fire REDO_STACK_CHANGED event\n * @private\n */\n _fireRedoStackChanged() {\n this.fire(eventNames.REDO_STACK_CHANGED, this._redoStack.length);\n }\n\n /**\n * fire UNDO_STACK_CHANGED event\n * @private\n */\n _fireUndoStackChanged() {\n this.fire(eventNames.UNDO_STACK_CHANGED, this._undoStack.length);\n }\n\n /**\n * Lock this invoker\n */\n lock() {\n this._isLocked = true;\n }\n\n /**\n * Unlock this invoker\n */\n unlock() {\n this._isLocked = false;\n }\n\n executeSilent(...args) {\n this._isSilent = true;\n\n return this.execute(...args, this._isSilent).then(() => {\n this._isSilent = false;\n });\n }\n\n /**\n * Invoke command\n * Store the command to the undoStack\n * Clear the redoStack\n * @param {String} commandName - Command name\n * @param {...*} args - Arguments for creating command\n * @returns {Promise}\n */\n execute(...args) {\n if (this._isLocked) {\n return Promise.reject(rejectMessages.isLock);\n }\n\n let [command] = args;\n if (isString(command)) {\n command = commandFactory.create(...args);\n }\n\n return this._invokeExecution(command).then((value) => {\n this.clearRedoStack();\n\n return value;\n });\n }\n\n /**\n * Undo command\n * @returns {Promise}\n */\n undo() {\n let command = this._undoStack.pop();\n let promise;\n let message = '';\n\n if (command && this._isLocked) {\n this.pushUndoStack(command, true);\n command = null;\n }\n if (command) {\n if (this.isEmptyUndoStack()) {\n this._fireUndoStackChanged();\n }\n promise = this._invokeUndo(command);\n } else {\n message = rejectMessages.undo;\n if (this._isLocked) {\n message = `${message} Because ${rejectMessages.isLock}`;\n }\n promise = Promise.reject(message);\n }\n\n return promise;\n }\n\n /**\n * Redo command\n * @returns {Promise}\n */\n redo() {\n let command = this._redoStack.pop();\n let promise;\n let message = '';\n\n if (command && this._isLocked) {\n this.pushRedoStack(command, true);\n command = null;\n }\n if (command) {\n if (this.isEmptyRedoStack()) {\n this._fireRedoStackChanged();\n }\n promise = this._invokeExecution(command, true);\n } else {\n message = rejectMessages.redo;\n if (this._isLocked) {\n message = `${message} Because ${rejectMessages.isLock}`;\n }\n promise = Promise.reject(message);\n }\n\n return promise;\n }\n\n /**\n * Push undo stack\n * @param {Command} command - command\n * @param {boolean} [isSilent] - Fire event or not\n */\n pushUndoStack(command, isSilent) {\n this._undoStack.push(command);\n if (!isSilent) {\n this._fireUndoStackChanged();\n }\n }\n\n /**\n * Push redo stack\n * @param {Command} command - command\n * @param {boolean} [isSilent] - Fire event or not\n */\n pushRedoStack(command, isSilent) {\n this._redoStack.push(command);\n if (!isSilent) {\n this._fireRedoStackChanged();\n }\n }\n\n /**\n * Return whether the redoStack is empty\n * @returns {boolean}\n */\n isEmptyRedoStack() {\n return this._redoStack.length === 0;\n }\n\n /**\n * Return whether the undoStack is empty\n * @returns {boolean}\n */\n isEmptyUndoStack() {\n return this._undoStack.length === 0;\n }\n\n /**\n * Clear undoStack\n */\n clearUndoStack() {\n if (!this.isEmptyUndoStack()) {\n this._undoStack = [];\n this._fireUndoStackChanged();\n }\n }\n\n /**\n * Clear redoStack\n */\n clearRedoStack() {\n if (!this.isEmptyRedoStack()) {\n this._redoStack = [];\n this._fireRedoStackChanged();\n }\n }\n}\n\nCustomEvents.mixin(Invoker);\n\nexport default Invoker;\n","/**\n * @author NHN. FE Development Team \n * @fileoverview Command interface\n */\nimport snippet from 'tui-code-snippet';\nimport errorMessage from '@/factory/errorMessage';\n\nconst createMessage = errorMessage.create;\nconst errorTypes = errorMessage.types;\n\n/**\n * Command class\n * @class\n * @param {{name:function, execute: function, undo: function,\n * executeCallback: function, undoCallback: function}} actions - Command actions\n * @param {Array} args - passing arguments on execute, undo\n * @ignore\n */\nclass Command {\n constructor(actions, args) {\n /**\n * command name\n * @type {string}\n */\n this.name = actions.name;\n\n /**\n * arguments\n * @type {Array}\n */\n this.args = args;\n\n /**\n * Execute function\n * @type {function}\n */\n this.execute = actions.execute;\n\n /**\n * Undo function\n * @type {function}\n */\n this.undo = actions.undo;\n\n /**\n * executeCallback\n * @type {function}\n */\n this.executeCallback = actions.executeCallback || null;\n\n /**\n * undoCallback\n * @type {function}\n */\n this.undoCallback = actions.undoCallback || null;\n\n /**\n * data for undo\n * @type {Object}\n */\n this.undoData = {};\n }\n\n /**\n * Execute action\n * @param {Object.} compMap - Components injection\n * @abstract\n */\n execute() {\n throw new Error(createMessage(errorTypes.UN_IMPLEMENTATION, 'execute'));\n }\n\n /**\n * Undo action\n * @param {Object.} compMap - Components injection\n * @abstract\n */\n undo() {\n throw new Error(createMessage(errorTypes.UN_IMPLEMENTATION, 'undo'));\n }\n\n /**\n * command for redo if undoData exists\n * @returns {boolean} isRedo\n */\n get isRedo() {\n return Object.keys(this.undoData).length > 0;\n }\n\n /**\n * Set undoData action\n * @param {Object} undoData - maked undo data\n * @param {Object} cachedUndoDataForSilent - cached undo data\n * @param {boolean} isSilent - is silent execution or not\n * @returns {Object} cachedUndoDataForSilent\n */\n setUndoData(undoData, cachedUndoDataForSilent, isSilent) {\n if (cachedUndoDataForSilent) {\n undoData = cachedUndoDataForSilent;\n }\n\n if (!isSilent) {\n snippet.extend(this.undoData, undoData);\n cachedUndoDataForSilent = null;\n } else if (!cachedUndoDataForSilent) {\n cachedUndoDataForSilent = undoData;\n }\n\n return cachedUndoDataForSilent;\n }\n\n /**\n * Attach execute callabck\n * @param {function} callback - Callback after execution\n * @returns {Command} this\n */\n setExecuteCallback(callback) {\n this.executeCallback = callback;\n\n return this;\n }\n\n /**\n * Attach undo callback\n * @param {function} callback - Callback after undo\n * @returns {Command} this\n */\n setUndoCallback(callback) {\n this.undoCallback = callback;\n\n return this;\n }\n}\n\nexport default Command;\n","var parent = require('../../es/promise');\nrequire('../../modules/esnext.aggregate-error');\n// TODO: Remove from `core-js@4`\nrequire('../../modules/esnext.promise.all-settled');\nrequire('../../modules/esnext.promise.try');\nrequire('../../modules/esnext.promise.any');\n\nmodule.exports = parent;\n","require('../../modules/es.object.to-string');\nrequire('../../modules/es.string.iterator');\nrequire('../../modules/web.dom-collections.iterator');\nrequire('../../modules/es.promise');\nrequire('../../modules/es.promise.all-settled');\nrequire('../../modules/es.promise.finally');\nvar path = require('../../internals/path');\n\nmodule.exports = path.Promise;\n","'use strict';\nvar charAt = require('../internals/string-multibyte').charAt;\nvar InternalStateModule = require('../internals/internal-state');\nvar defineIterator = require('../internals/define-iterator');\n\nvar STRING_ITERATOR = 'String Iterator';\nvar setInternalState = InternalStateModule.set;\nvar getInternalState = InternalStateModule.getterFor(STRING_ITERATOR);\n\n// `String.prototype[@@iterator]` method\n// https://tc39.github.io/ecma262/#sec-string.prototype-@@iterator\ndefineIterator(String, 'String', function (iterated) {\n setInternalState(this, {\n type: STRING_ITERATOR,\n string: String(iterated),\n index: 0\n });\n// `%StringIteratorPrototype%.next` method\n// https://tc39.github.io/ecma262/#sec-%stringiteratorprototype%.next\n}, function next() {\n var state = getInternalState(this);\n var string = state.string;\n var index = state.index;\n var point;\n if (index >= string.length) return { value: undefined, done: true };\n point = charAt(string, index);\n state.index += point.length;\n return { value: point, done: false };\n});\n","var toInteger = require('../internals/to-integer');\nvar requireObjectCoercible = require('../internals/require-object-coercible');\n\n// `String.prototype.{ codePointAt, at }` methods implementation\nvar createMethod = function (CONVERT_TO_STRING) {\n return function ($this, pos) {\n var S = String(requireObjectCoercible($this));\n var position = toInteger(pos);\n var size = S.length;\n var first, second;\n if (position < 0 || position >= size) return CONVERT_TO_STRING ? '' : undefined;\n first = S.charCodeAt(position);\n return first < 0xD800 || first > 0xDBFF || position + 1 === size\n || (second = S.charCodeAt(position + 1)) < 0xDC00 || second > 0xDFFF\n ? CONVERT_TO_STRING ? S.charAt(position) : first\n : CONVERT_TO_STRING ? S.slice(position, position + 2) : (first - 0xD800 << 10) + (second - 0xDC00) + 0x10000;\n };\n};\n\nmodule.exports = {\n // `String.prototype.codePointAt` method\n // https://tc39.github.io/ecma262/#sec-string.prototype.codepointat\n codeAt: createMethod(false),\n // `String.prototype.at` method\n // https://github.com/mathiasbynens/String.prototype.at\n charAt: createMethod(true)\n};\n","var global = require('../internals/global');\nvar inspectSource = require('../internals/inspect-source');\n\nvar WeakMap = global.WeakMap;\n\nmodule.exports = typeof WeakMap === 'function' && /native code/.test(inspectSource(WeakMap));\n","var g;\n\n// This works in non-strict mode\ng = (function() {\n\treturn this;\n})();\n\ntry {\n\t// This works if eval is allowed (see CSP)\n\tg = g || new Function(\"return this\")();\n} catch (e) {\n\t// This works if the window reference is available\n\tif (typeof window === \"object\") g = window;\n}\n\n// g can still be undefined, but nothing to do about it...\n// We return undefined, instead of nothing here, so it's\n// easier to handle this case. if(!global) { ...}\n\nmodule.exports = g;\n","var global = require('../internals/global');\nvar createNonEnumerableProperty = require('../internals/create-non-enumerable-property');\n\nmodule.exports = function (key, value) {\n try {\n createNonEnumerableProperty(global, key, value);\n } catch (error) {\n global[key] = value;\n } return value;\n};\n","'use strict';\nvar nativePropertyIsEnumerable = {}.propertyIsEnumerable;\nvar getOwnPropertyDescriptor = Object.getOwnPropertyDescriptor;\n\n// Nashorn ~ JDK8 bug\nvar NASHORN_BUG = getOwnPropertyDescriptor && !nativePropertyIsEnumerable.call({ 1: 2 }, 1);\n\n// `Object.prototype.propertyIsEnumerable` method implementation\n// https://tc39.github.io/ecma262/#sec-object.prototype.propertyisenumerable\nexports.f = NASHORN_BUG ? function propertyIsEnumerable(V) {\n var descriptor = getOwnPropertyDescriptor(this, V);\n return !!descriptor && descriptor.enumerable;\n} : nativePropertyIsEnumerable;\n","var fails = require('../internals/fails');\nvar classof = require('../internals/classof-raw');\n\nvar split = ''.split;\n\n// fallback for non-array-like ES3 and non-enumerable old V8 strings\nmodule.exports = fails(function () {\n // throws an error in rhino, see https://github.com/mozilla/rhino/issues/346\n // eslint-disable-next-line no-prototype-builtins\n return !Object('z').propertyIsEnumerable(0);\n}) ? function (it) {\n return classof(it) == 'String' ? split.call(it, '') : Object(it);\n} : Object;\n","'use strict';\nvar IteratorPrototype = require('../internals/iterators-core').IteratorPrototype;\nvar create = require('../internals/object-create');\nvar createPropertyDescriptor = require('../internals/create-property-descriptor');\nvar setToStringTag = require('../internals/set-to-string-tag');\nvar Iterators = require('../internals/iterators');\n\nvar returnThis = function () { return this; };\n\nmodule.exports = function (IteratorConstructor, NAME, next) {\n var TO_STRING_TAG = NAME + ' Iterator';\n IteratorConstructor.prototype = create(IteratorPrototype, { next: createPropertyDescriptor(1, next) });\n setToStringTag(IteratorConstructor, TO_STRING_TAG, false, true);\n Iterators[TO_STRING_TAG] = returnThis;\n return IteratorConstructor;\n};\n","var requireObjectCoercible = require('../internals/require-object-coercible');\n\n// `ToObject` abstract operation\n// https://tc39.github.io/ecma262/#sec-toobject\nmodule.exports = function (argument) {\n return Object(requireObjectCoercible(argument));\n};\n","var fails = require('../internals/fails');\n\nmodule.exports = !fails(function () {\n function F() { /* empty */ }\n F.prototype.constructor = null;\n return Object.getPrototypeOf(new F()) !== F.prototype;\n});\n","var NATIVE_SYMBOL = require('../internals/native-symbol');\n\nmodule.exports = NATIVE_SYMBOL\n // eslint-disable-next-line no-undef\n && !Symbol.sham\n // eslint-disable-next-line no-undef\n && typeof Symbol.iterator == 'symbol';\n","var DESCRIPTORS = require('../internals/descriptors');\nvar definePropertyModule = require('../internals/object-define-property');\nvar anObject = require('../internals/an-object');\nvar objectKeys = require('../internals/object-keys');\n\n// `Object.defineProperties` method\n// https://tc39.github.io/ecma262/#sec-object.defineproperties\nmodule.exports = DESCRIPTORS ? Object.defineProperties : function defineProperties(O, Properties) {\n anObject(O);\n var keys = objectKeys(Properties);\n var length = keys.length;\n var index = 0;\n var key;\n while (length > index) definePropertyModule.f(O, key = keys[index++], Properties[key]);\n return O;\n};\n","var internalObjectKeys = require('../internals/object-keys-internal');\nvar enumBugKeys = require('../internals/enum-bug-keys');\n\n// `Object.keys` method\n// https://tc39.github.io/ecma262/#sec-object.keys\nmodule.exports = Object.keys || function keys(O) {\n return internalObjectKeys(O, enumBugKeys);\n};\n","var has = require('../internals/has');\nvar toIndexedObject = require('../internals/to-indexed-object');\nvar indexOf = require('../internals/array-includes').indexOf;\nvar hiddenKeys = require('../internals/hidden-keys');\n\nmodule.exports = function (object, names) {\n var O = toIndexedObject(object);\n var i = 0;\n var result = [];\n var key;\n for (key in O) !has(hiddenKeys, key) && has(O, key) && result.push(key);\n // Don't enum bug & hidden keys\n while (names.length > i) if (has(O, key = names[i++])) {\n ~indexOf(result, key) || result.push(key);\n }\n return result;\n};\n","var toIndexedObject = require('../internals/to-indexed-object');\nvar toLength = require('../internals/to-length');\nvar toAbsoluteIndex = require('../internals/to-absolute-index');\n\n// `Array.prototype.{ indexOf, includes }` methods implementation\nvar createMethod = function (IS_INCLUDES) {\n return function ($this, el, fromIndex) {\n var O = toIndexedObject($this);\n var length = toLength(O.length);\n var index = toAbsoluteIndex(fromIndex, length);\n var value;\n // Array#includes uses SameValueZero equality algorithm\n // eslint-disable-next-line no-self-compare\n if (IS_INCLUDES && el != el) while (length > index) {\n value = O[index++];\n // eslint-disable-next-line no-self-compare\n if (value != value) return true;\n // Array#indexOf ignores holes, Array#includes - not\n } else for (;length > index; index++) {\n if ((IS_INCLUDES || index in O) && O[index] === el) return IS_INCLUDES || index || 0;\n } return !IS_INCLUDES && -1;\n };\n};\n\nmodule.exports = {\n // `Array.prototype.includes` method\n // https://tc39.github.io/ecma262/#sec-array.prototype.includes\n includes: createMethod(true),\n // `Array.prototype.indexOf` method\n // https://tc39.github.io/ecma262/#sec-array.prototype.indexof\n indexOf: createMethod(false)\n};\n","var toInteger = require('../internals/to-integer');\n\nvar max = Math.max;\nvar min = Math.min;\n\n// Helper for a popular repeating case of the spec:\n// Let integer be ? ToInteger(index).\n// If integer < 0, let result be max((length + integer), 0); else let result be min(integer, length).\nmodule.exports = function (index, length) {\n var integer = toInteger(index);\n return integer < 0 ? max(integer + length, 0) : min(integer, length);\n};\n","'use strict';\nvar TO_STRING_TAG_SUPPORT = require('../internals/to-string-tag-support');\nvar classof = require('../internals/classof');\n\n// `Object.prototype.toString` method implementation\n// https://tc39.github.io/ecma262/#sec-object.prototype.tostring\nmodule.exports = TO_STRING_TAG_SUPPORT ? {}.toString : function toString() {\n return '[object ' + classof(this) + ']';\n};\n","var isObject = require('../internals/is-object');\n\nmodule.exports = function (it) {\n if (!isObject(it) && it !== null) {\n throw TypeError(\"Can't set \" + String(it) + ' as a prototype');\n } return it;\n};\n","require('./es.array.iterator');\nvar DOMIterables = require('../internals/dom-iterables');\nvar global = require('../internals/global');\nvar classof = require('../internals/classof');\nvar createNonEnumerableProperty = require('../internals/create-non-enumerable-property');\nvar Iterators = require('../internals/iterators');\nvar wellKnownSymbol = require('../internals/well-known-symbol');\n\nvar TO_STRING_TAG = wellKnownSymbol('toStringTag');\n\nfor (var COLLECTION_NAME in DOMIterables) {\n var Collection = global[COLLECTION_NAME];\n var CollectionPrototype = Collection && Collection.prototype;\n if (CollectionPrototype && classof(CollectionPrototype) !== TO_STRING_TAG) {\n createNonEnumerableProperty(CollectionPrototype, TO_STRING_TAG, COLLECTION_NAME);\n }\n Iterators[COLLECTION_NAME] = Iterators.Array;\n}\n","'use strict';\nvar toIndexedObject = require('../internals/to-indexed-object');\nvar addToUnscopables = require('../internals/add-to-unscopables');\nvar Iterators = require('../internals/iterators');\nvar InternalStateModule = require('../internals/internal-state');\nvar defineIterator = require('../internals/define-iterator');\n\nvar ARRAY_ITERATOR = 'Array Iterator';\nvar setInternalState = InternalStateModule.set;\nvar getInternalState = InternalStateModule.getterFor(ARRAY_ITERATOR);\n\n// `Array.prototype.entries` method\n// https://tc39.github.io/ecma262/#sec-array.prototype.entries\n// `Array.prototype.keys` method\n// https://tc39.github.io/ecma262/#sec-array.prototype.keys\n// `Array.prototype.values` method\n// https://tc39.github.io/ecma262/#sec-array.prototype.values\n// `Array.prototype[@@iterator]` method\n// https://tc39.github.io/ecma262/#sec-array.prototype-@@iterator\n// `CreateArrayIterator` internal method\n// https://tc39.github.io/ecma262/#sec-createarrayiterator\nmodule.exports = defineIterator(Array, 'Array', function (iterated, kind) {\n setInternalState(this, {\n type: ARRAY_ITERATOR,\n target: toIndexedObject(iterated), // target\n index: 0, // next index\n kind: kind // kind\n });\n// `%ArrayIteratorPrototype%.next` method\n// https://tc39.github.io/ecma262/#sec-%arrayiteratorprototype%.next\n}, function () {\n var state = getInternalState(this);\n var target = state.target;\n var kind = state.kind;\n var index = state.index++;\n if (!target || index >= target.length) {\n state.target = undefined;\n return { value: undefined, done: true };\n }\n if (kind == 'keys') return { value: index, done: false };\n if (kind == 'values') return { value: target[index], done: false };\n return { value: [index, target[index]], done: false };\n}, 'values');\n\n// argumentsList[@@iterator] is %ArrayProto_values%\n// https://tc39.github.io/ecma262/#sec-createunmappedargumentsobject\n// https://tc39.github.io/ecma262/#sec-createmappedargumentsobject\nIterators.Arguments = Iterators.Array;\n\n// https://tc39.github.io/ecma262/#sec-array.prototype-@@unscopables\naddToUnscopables('keys');\naddToUnscopables('values');\naddToUnscopables('entries');\n","module.exports = function () { /* empty */ };\n","// iterable DOM collections\n// flag - `iterable` interface - 'entries', 'keys', 'values', 'forEach' methods\nmodule.exports = {\n CSSRuleList: 0,\n CSSStyleDeclaration: 0,\n CSSValueList: 0,\n ClientRectList: 0,\n DOMRectList: 0,\n DOMStringList: 0,\n DOMTokenList: 1,\n DataTransferItemList: 0,\n FileList: 0,\n HTMLAllCollection: 0,\n HTMLCollection: 0,\n HTMLFormElement: 0,\n HTMLSelectElement: 0,\n MediaList: 0,\n MimeTypeArray: 0,\n NamedNodeMap: 0,\n NodeList: 1,\n PaintRequestList: 0,\n Plugin: 0,\n PluginArray: 0,\n SVGLengthList: 0,\n SVGNumberList: 0,\n SVGPathSegList: 0,\n SVGPointList: 0,\n SVGStringList: 0,\n SVGTransformList: 0,\n SourceBufferList: 0,\n StyleSheetList: 0,\n TextTrackCueList: 0,\n TextTrackList: 0,\n TouchList: 0\n};\n","'use strict';\nvar $ = require('../internals/export');\nvar IS_PURE = require('../internals/is-pure');\nvar global = require('../internals/global');\nvar getBuiltIn = require('../internals/get-built-in');\nvar NativePromise = require('../internals/native-promise-constructor');\nvar redefine = require('../internals/redefine');\nvar redefineAll = require('../internals/redefine-all');\nvar setToStringTag = require('../internals/set-to-string-tag');\nvar setSpecies = require('../internals/set-species');\nvar isObject = require('../internals/is-object');\nvar aFunction = require('../internals/a-function');\nvar anInstance = require('../internals/an-instance');\nvar classof = require('../internals/classof-raw');\nvar inspectSource = require('../internals/inspect-source');\nvar iterate = require('../internals/iterate');\nvar checkCorrectnessOfIteration = require('../internals/check-correctness-of-iteration');\nvar speciesConstructor = require('../internals/species-constructor');\nvar task = require('../internals/task').set;\nvar microtask = require('../internals/microtask');\nvar promiseResolve = require('../internals/promise-resolve');\nvar hostReportErrors = require('../internals/host-report-errors');\nvar newPromiseCapabilityModule = require('../internals/new-promise-capability');\nvar perform = require('../internals/perform');\nvar InternalStateModule = require('../internals/internal-state');\nvar isForced = require('../internals/is-forced');\nvar wellKnownSymbol = require('../internals/well-known-symbol');\nvar V8_VERSION = require('../internals/engine-v8-version');\n\nvar SPECIES = wellKnownSymbol('species');\nvar PROMISE = 'Promise';\nvar getInternalState = InternalStateModule.get;\nvar setInternalState = InternalStateModule.set;\nvar getInternalPromiseState = InternalStateModule.getterFor(PROMISE);\nvar PromiseConstructor = NativePromise;\nvar TypeError = global.TypeError;\nvar document = global.document;\nvar process = global.process;\nvar $fetch = getBuiltIn('fetch');\nvar newPromiseCapability = newPromiseCapabilityModule.f;\nvar newGenericPromiseCapability = newPromiseCapability;\nvar IS_NODE = classof(process) == 'process';\nvar DISPATCH_EVENT = !!(document && document.createEvent && global.dispatchEvent);\nvar UNHANDLED_REJECTION = 'unhandledrejection';\nvar REJECTION_HANDLED = 'rejectionhandled';\nvar PENDING = 0;\nvar FULFILLED = 1;\nvar REJECTED = 2;\nvar HANDLED = 1;\nvar UNHANDLED = 2;\nvar Internal, OwnPromiseCapability, PromiseWrapper, nativeThen;\n\nvar FORCED = isForced(PROMISE, function () {\n var GLOBAL_CORE_JS_PROMISE = inspectSource(PromiseConstructor) !== String(PromiseConstructor);\n if (!GLOBAL_CORE_JS_PROMISE) {\n // V8 6.6 (Node 10 and Chrome 66) have a bug with resolving custom thenables\n // https://bugs.chromium.org/p/chromium/issues/detail?id=830565\n // We can't detect it synchronously, so just check versions\n if (V8_VERSION === 66) return true;\n // Unhandled rejections tracking support, NodeJS Promise without it fails @@species test\n if (!IS_NODE && typeof PromiseRejectionEvent != 'function') return true;\n }\n // We need Promise#finally in the pure version for preventing prototype pollution\n if (IS_PURE && !PromiseConstructor.prototype['finally']) return true;\n // We can't use @@species feature detection in V8 since it causes\n // deoptimization and performance degradation\n // https://github.com/zloirock/core-js/issues/679\n if (V8_VERSION >= 51 && /native code/.test(PromiseConstructor)) return false;\n // Detect correctness of subclassing with @@species support\n var promise = PromiseConstructor.resolve(1);\n var FakePromise = function (exec) {\n exec(function () { /* empty */ }, function () { /* empty */ });\n };\n var constructor = promise.constructor = {};\n constructor[SPECIES] = FakePromise;\n return !(promise.then(function () { /* empty */ }) instanceof FakePromise);\n});\n\nvar INCORRECT_ITERATION = FORCED || !checkCorrectnessOfIteration(function (iterable) {\n PromiseConstructor.all(iterable)['catch'](function () { /* empty */ });\n});\n\n// helpers\nvar isThenable = function (it) {\n var then;\n return isObject(it) && typeof (then = it.then) == 'function' ? then : false;\n};\n\nvar notify = function (promise, state, isReject) {\n if (state.notified) return;\n state.notified = true;\n var chain = state.reactions;\n microtask(function () {\n var value = state.value;\n var ok = state.state == FULFILLED;\n var index = 0;\n // variable length - can't use forEach\n while (chain.length > index) {\n var reaction = chain[index++];\n var handler = ok ? reaction.ok : reaction.fail;\n var resolve = reaction.resolve;\n var reject = reaction.reject;\n var domain = reaction.domain;\n var result, then, exited;\n try {\n if (handler) {\n if (!ok) {\n if (state.rejection === UNHANDLED) onHandleUnhandled(promise, state);\n state.rejection = HANDLED;\n }\n if (handler === true) result = value;\n else {\n if (domain) domain.enter();\n result = handler(value); // can throw\n if (domain) {\n domain.exit();\n exited = true;\n }\n }\n if (result === reaction.promise) {\n reject(TypeError('Promise-chain cycle'));\n } else if (then = isThenable(result)) {\n then.call(result, resolve, reject);\n } else resolve(result);\n } else reject(value);\n } catch (error) {\n if (domain && !exited) domain.exit();\n reject(error);\n }\n }\n state.reactions = [];\n state.notified = false;\n if (isReject && !state.rejection) onUnhandled(promise, state);\n });\n};\n\nvar dispatchEvent = function (name, promise, reason) {\n var event, handler;\n if (DISPATCH_EVENT) {\n event = document.createEvent('Event');\n event.promise = promise;\n event.reason = reason;\n event.initEvent(name, false, true);\n global.dispatchEvent(event);\n } else event = { promise: promise, reason: reason };\n if (handler = global['on' + name]) handler(event);\n else if (name === UNHANDLED_REJECTION) hostReportErrors('Unhandled promise rejection', reason);\n};\n\nvar onUnhandled = function (promise, state) {\n task.call(global, function () {\n var value = state.value;\n var IS_UNHANDLED = isUnhandled(state);\n var result;\n if (IS_UNHANDLED) {\n result = perform(function () {\n if (IS_NODE) {\n process.emit('unhandledRejection', value, promise);\n } else dispatchEvent(UNHANDLED_REJECTION, promise, value);\n });\n // Browsers should not trigger `rejectionHandled` event if it was handled here, NodeJS - should\n state.rejection = IS_NODE || isUnhandled(state) ? UNHANDLED : HANDLED;\n if (result.error) throw result.value;\n }\n });\n};\n\nvar isUnhandled = function (state) {\n return state.rejection !== HANDLED && !state.parent;\n};\n\nvar onHandleUnhandled = function (promise, state) {\n task.call(global, function () {\n if (IS_NODE) {\n process.emit('rejectionHandled', promise);\n } else dispatchEvent(REJECTION_HANDLED, promise, state.value);\n });\n};\n\nvar bind = function (fn, promise, state, unwrap) {\n return function (value) {\n fn(promise, state, value, unwrap);\n };\n};\n\nvar internalReject = function (promise, state, value, unwrap) {\n if (state.done) return;\n state.done = true;\n if (unwrap) state = unwrap;\n state.value = value;\n state.state = REJECTED;\n notify(promise, state, true);\n};\n\nvar internalResolve = function (promise, state, value, unwrap) {\n if (state.done) return;\n state.done = true;\n if (unwrap) state = unwrap;\n try {\n if (promise === value) throw TypeError(\"Promise can't be resolved itself\");\n var then = isThenable(value);\n if (then) {\n microtask(function () {\n var wrapper = { done: false };\n try {\n then.call(value,\n bind(internalResolve, promise, wrapper, state),\n bind(internalReject, promise, wrapper, state)\n );\n } catch (error) {\n internalReject(promise, wrapper, error, state);\n }\n });\n } else {\n state.value = value;\n state.state = FULFILLED;\n notify(promise, state, false);\n }\n } catch (error) {\n internalReject(promise, { done: false }, error, state);\n }\n};\n\n// constructor polyfill\nif (FORCED) {\n // 25.4.3.1 Promise(executor)\n PromiseConstructor = function Promise(executor) {\n anInstance(this, PromiseConstructor, PROMISE);\n aFunction(executor);\n Internal.call(this);\n var state = getInternalState(this);\n try {\n executor(bind(internalResolve, this, state), bind(internalReject, this, state));\n } catch (error) {\n internalReject(this, state, error);\n }\n };\n // eslint-disable-next-line no-unused-vars\n Internal = function Promise(executor) {\n setInternalState(this, {\n type: PROMISE,\n done: false,\n notified: false,\n parent: false,\n reactions: [],\n rejection: false,\n state: PENDING,\n value: undefined\n });\n };\n Internal.prototype = redefineAll(PromiseConstructor.prototype, {\n // `Promise.prototype.then` method\n // https://tc39.github.io/ecma262/#sec-promise.prototype.then\n then: function then(onFulfilled, onRejected) {\n var state = getInternalPromiseState(this);\n var reaction = newPromiseCapability(speciesConstructor(this, PromiseConstructor));\n reaction.ok = typeof onFulfilled == 'function' ? onFulfilled : true;\n reaction.fail = typeof onRejected == 'function' && onRejected;\n reaction.domain = IS_NODE ? process.domain : undefined;\n state.parent = true;\n state.reactions.push(reaction);\n if (state.state != PENDING) notify(this, state, false);\n return reaction.promise;\n },\n // `Promise.prototype.catch` method\n // https://tc39.github.io/ecma262/#sec-promise.prototype.catch\n 'catch': function (onRejected) {\n return this.then(undefined, onRejected);\n }\n });\n OwnPromiseCapability = function () {\n var promise = new Internal();\n var state = getInternalState(promise);\n this.promise = promise;\n this.resolve = bind(internalResolve, promise, state);\n this.reject = bind(internalReject, promise, state);\n };\n newPromiseCapabilityModule.f = newPromiseCapability = function (C) {\n return C === PromiseConstructor || C === PromiseWrapper\n ? new OwnPromiseCapability(C)\n : newGenericPromiseCapability(C);\n };\n\n if (!IS_PURE && typeof NativePromise == 'function') {\n nativeThen = NativePromise.prototype.then;\n\n // wrap native Promise#then for native async functions\n redefine(NativePromise.prototype, 'then', function then(onFulfilled, onRejected) {\n var that = this;\n return new PromiseConstructor(function (resolve, reject) {\n nativeThen.call(that, resolve, reject);\n }).then(onFulfilled, onRejected);\n // https://github.com/zloirock/core-js/issues/640\n }, { unsafe: true });\n\n // wrap fetch result\n if (typeof $fetch == 'function') $({ global: true, enumerable: true, forced: true }, {\n // eslint-disable-next-line no-unused-vars\n fetch: function fetch(input /* , init */) {\n return promiseResolve(PromiseConstructor, $fetch.apply(global, arguments));\n }\n });\n }\n}\n\n$({ global: true, wrap: true, forced: FORCED }, {\n Promise: PromiseConstructor\n});\n\nsetToStringTag(PromiseConstructor, PROMISE, false, true);\nsetSpecies(PROMISE);\n\nPromiseWrapper = getBuiltIn(PROMISE);\n\n// statics\n$({ target: PROMISE, stat: true, forced: FORCED }, {\n // `Promise.reject` method\n // https://tc39.github.io/ecma262/#sec-promise.reject\n reject: function reject(r) {\n var capability = newPromiseCapability(this);\n capability.reject.call(undefined, r);\n return capability.promise;\n }\n});\n\n$({ target: PROMISE, stat: true, forced: IS_PURE || FORCED }, {\n // `Promise.resolve` method\n // https://tc39.github.io/ecma262/#sec-promise.resolve\n resolve: function resolve(x) {\n return promiseResolve(IS_PURE && this === PromiseWrapper ? PromiseConstructor : this, x);\n }\n});\n\n$({ target: PROMISE, stat: true, forced: INCORRECT_ITERATION }, {\n // `Promise.all` method\n // https://tc39.github.io/ecma262/#sec-promise.all\n all: function all(iterable) {\n var C = this;\n var capability = newPromiseCapability(C);\n var resolve = capability.resolve;\n var reject = capability.reject;\n var result = perform(function () {\n var $promiseResolve = aFunction(C.resolve);\n var values = [];\n var counter = 0;\n var remaining = 1;\n iterate(iterable, function (promise) {\n var index = counter++;\n var alreadyCalled = false;\n values.push(undefined);\n remaining++;\n $promiseResolve.call(C, promise).then(function (value) {\n if (alreadyCalled) return;\n alreadyCalled = true;\n values[index] = value;\n --remaining || resolve(values);\n }, reject);\n });\n --remaining || resolve(values);\n });\n if (result.error) reject(result.value);\n return capability.promise;\n },\n // `Promise.race` method\n // https://tc39.github.io/ecma262/#sec-promise.race\n race: function race(iterable) {\n var C = this;\n var capability = newPromiseCapability(C);\n var reject = capability.reject;\n var result = perform(function () {\n var $promiseResolve = aFunction(C.resolve);\n iterate(iterable, function (promise) {\n $promiseResolve.call(C, promise).then(capability.resolve, reject);\n });\n });\n if (result.error) reject(result.value);\n return capability.promise;\n }\n});\n","var redefine = require('../internals/redefine');\n\nmodule.exports = function (target, src, options) {\n for (var key in src) {\n if (options && options.unsafe && target[key]) target[key] = src[key];\n else redefine(target, key, src[key], options);\n } return target;\n};\n","'use strict';\nvar getBuiltIn = require('../internals/get-built-in');\nvar definePropertyModule = require('../internals/object-define-property');\nvar wellKnownSymbol = require('../internals/well-known-symbol');\nvar DESCRIPTORS = require('../internals/descriptors');\n\nvar SPECIES = wellKnownSymbol('species');\n\nmodule.exports = function (CONSTRUCTOR_NAME) {\n var Constructor = getBuiltIn(CONSTRUCTOR_NAME);\n var defineProperty = definePropertyModule.f;\n\n if (DESCRIPTORS && Constructor && !Constructor[SPECIES]) {\n defineProperty(Constructor, SPECIES, {\n configurable: true,\n get: function () { return this; }\n });\n }\n};\n","module.exports = function (it, Constructor, name) {\n if (!(it instanceof Constructor)) {\n throw TypeError('Incorrect ' + (name ? name + ' ' : '') + 'invocation');\n } return it;\n};\n","var wellKnownSymbol = require('../internals/well-known-symbol');\nvar Iterators = require('../internals/iterators');\n\nvar ITERATOR = wellKnownSymbol('iterator');\nvar ArrayPrototype = Array.prototype;\n\n// check on default Array iterator\nmodule.exports = function (it) {\n return it !== undefined && (Iterators.Array === it || ArrayPrototype[ITERATOR] === it);\n};\n","var classof = require('../internals/classof');\nvar Iterators = require('../internals/iterators');\nvar wellKnownSymbol = require('../internals/well-known-symbol');\n\nvar ITERATOR = wellKnownSymbol('iterator');\n\nmodule.exports = function (it) {\n if (it != undefined) return it[ITERATOR]\n || it['@@iterator']\n || Iterators[classof(it)];\n};\n","var anObject = require('../internals/an-object');\n\n// call something on iterator step with safe closing on error\nmodule.exports = function (iterator, fn, value, ENTRIES) {\n try {\n return ENTRIES ? fn(anObject(value)[0], value[1]) : fn(value);\n // 7.4.6 IteratorClose(iterator, completion)\n } catch (error) {\n var returnMethod = iterator['return'];\n if (returnMethod !== undefined) anObject(returnMethod.call(iterator));\n throw error;\n }\n};\n","var wellKnownSymbol = require('../internals/well-known-symbol');\n\nvar ITERATOR = wellKnownSymbol('iterator');\nvar SAFE_CLOSING = false;\n\ntry {\n var called = 0;\n var iteratorWithReturn = {\n next: function () {\n return { done: !!called++ };\n },\n 'return': function () {\n SAFE_CLOSING = true;\n }\n };\n iteratorWithReturn[ITERATOR] = function () {\n return this;\n };\n // eslint-disable-next-line no-throw-literal\n Array.from(iteratorWithReturn, function () { throw 2; });\n} catch (error) { /* empty */ }\n\nmodule.exports = function (exec, SKIP_CLOSING) {\n if (!SKIP_CLOSING && !SAFE_CLOSING) return false;\n var ITERATION_SUPPORT = false;\n try {\n var object = {};\n object[ITERATOR] = function () {\n return {\n next: function () {\n return { done: ITERATION_SUPPORT = true };\n }\n };\n };\n exec(object);\n } catch (error) { /* empty */ }\n return ITERATION_SUPPORT;\n};\n","var global = require('../internals/global');\nvar getOwnPropertyDescriptor = require('../internals/object-get-own-property-descriptor').f;\nvar classof = require('../internals/classof-raw');\nvar macrotask = require('../internals/task').set;\nvar IS_IOS = require('../internals/engine-is-ios');\n\nvar MutationObserver = global.MutationObserver || global.WebKitMutationObserver;\nvar process = global.process;\nvar Promise = global.Promise;\nvar IS_NODE = classof(process) == 'process';\n// Node.js 11 shows ExperimentalWarning on getting `queueMicrotask`\nvar queueMicrotaskDescriptor = getOwnPropertyDescriptor(global, 'queueMicrotask');\nvar queueMicrotask = queueMicrotaskDescriptor && queueMicrotaskDescriptor.value;\n\nvar flush, head, last, notify, toggle, node, promise, then;\n\n// modern engines have queueMicrotask method\nif (!queueMicrotask) {\n flush = function () {\n var parent, fn;\n if (IS_NODE && (parent = process.domain)) parent.exit();\n while (head) {\n fn = head.fn;\n head = head.next;\n try {\n fn();\n } catch (error) {\n if (head) notify();\n else last = undefined;\n throw error;\n }\n } last = undefined;\n if (parent) parent.enter();\n };\n\n // Node.js\n if (IS_NODE) {\n notify = function () {\n process.nextTick(flush);\n };\n // browsers with MutationObserver, except iOS - https://github.com/zloirock/core-js/issues/339\n } else if (MutationObserver && !IS_IOS) {\n toggle = true;\n node = document.createTextNode('');\n new MutationObserver(flush).observe(node, { characterData: true });\n notify = function () {\n node.data = toggle = !toggle;\n };\n // environments with maybe non-completely correct, but existent Promise\n } else if (Promise && Promise.resolve) {\n // Promise.resolve without an argument throws an error in LG WebOS 2\n promise = Promise.resolve(undefined);\n then = promise.then;\n notify = function () {\n then.call(promise, flush);\n };\n // for other environments - macrotask based on:\n // - setImmediate\n // - MessageChannel\n // - window.postMessag\n // - onreadystatechange\n // - setTimeout\n } else {\n notify = function () {\n // strange IE + webpack dev server bug - use .call(global)\n macrotask.call(global, flush);\n };\n }\n}\n\nmodule.exports = queueMicrotask || function (fn) {\n var task = { fn: fn, next: undefined };\n if (last) last.next = task;\n if (!head) {\n head = task;\n notify();\n } last = task;\n};\n","var global = require('../internals/global');\n\nmodule.exports = function (a, b) {\n var console = global.console;\n if (console && console.error) {\n arguments.length === 1 ? console.error(a) : console.error(a, b);\n }\n};\n","var global = require('../internals/global');\nvar userAgent = require('../internals/engine-user-agent');\n\nvar process = global.process;\nvar versions = process && process.versions;\nvar v8 = versions && versions.v8;\nvar match, version;\n\nif (v8) {\n match = v8.split('.');\n version = match[0] + match[1];\n} else if (userAgent) {\n match = userAgent.match(/Edge\\/(\\d+)/);\n if (!match || match[1] >= 74) {\n match = userAgent.match(/Chrome\\/(\\d+)/);\n if (match) version = match[1];\n }\n}\n\nmodule.exports = version && +version;\n","'use strict';\nvar $ = require('../internals/export');\nvar IS_PURE = require('../internals/is-pure');\nvar NativePromise = require('../internals/native-promise-constructor');\nvar fails = require('../internals/fails');\nvar getBuiltIn = require('../internals/get-built-in');\nvar speciesConstructor = require('../internals/species-constructor');\nvar promiseResolve = require('../internals/promise-resolve');\nvar redefine = require('../internals/redefine');\n\n// Safari bug https://bugs.webkit.org/show_bug.cgi?id=200829\nvar NON_GENERIC = !!NativePromise && fails(function () {\n NativePromise.prototype['finally'].call({ then: function () { /* empty */ } }, function () { /* empty */ });\n});\n\n// `Promise.prototype.finally` method\n// https://tc39.github.io/ecma262/#sec-promise.prototype.finally\n$({ target: 'Promise', proto: true, real: true, forced: NON_GENERIC }, {\n 'finally': function (onFinally) {\n var C = speciesConstructor(this, getBuiltIn('Promise'));\n var isFunction = typeof onFinally == 'function';\n return this.then(\n isFunction ? function (x) {\n return promiseResolve(C, onFinally()).then(function () { return x; });\n } : onFinally,\n isFunction ? function (e) {\n return promiseResolve(C, onFinally()).then(function () { throw e; });\n } : onFinally\n );\n }\n});\n\n// patch native Promise.prototype for native async functions\nif (!IS_PURE && typeof NativePromise == 'function' && !NativePromise.prototype['finally']) {\n redefine(NativePromise.prototype, 'finally', getBuiltIn('Promise').prototype['finally']);\n}\n","'use strict';\nvar $ = require('../internals/export');\nvar DESCRIPTORS = require('../internals/descriptors');\nvar getPrototypeOf = require('../internals/object-get-prototype-of');\nvar setPrototypeOf = require('../internals/object-set-prototype-of');\nvar create = require('../internals/object-create');\nvar defineProperty = require('../internals/object-define-property');\nvar createPropertyDescriptor = require('../internals/create-property-descriptor');\nvar iterate = require('../internals/iterate');\nvar createNonEnumerableProperty = require('../internals/create-non-enumerable-property');\nvar InternalStateModule = require('../internals/internal-state');\n\nvar setInternalState = InternalStateModule.set;\nvar getInternalAggregateErrorState = InternalStateModule.getterFor('AggregateError');\n\nvar $AggregateError = function AggregateError(errors, message) {\n var that = this;\n if (!(that instanceof $AggregateError)) return new $AggregateError(errors, message);\n if (setPrototypeOf) {\n that = setPrototypeOf(new Error(message), getPrototypeOf(that));\n }\n var errorsArray = [];\n iterate(errors, errorsArray.push, errorsArray);\n if (DESCRIPTORS) setInternalState(that, { errors: errorsArray, type: 'AggregateError' });\n else that.errors = errorsArray;\n if (message !== undefined) createNonEnumerableProperty(that, 'message', String(message));\n return that;\n};\n\n$AggregateError.prototype = create(Error.prototype, {\n constructor: createPropertyDescriptor(5, $AggregateError),\n message: createPropertyDescriptor(5, ''),\n name: createPropertyDescriptor(5, 'AggregateError')\n});\n\nif (DESCRIPTORS) defineProperty.f($AggregateError.prototype, 'errors', {\n get: function () {\n return getInternalAggregateErrorState(this).errors;\n },\n configurable: true\n});\n\n$({ global: true }, {\n AggregateError: $AggregateError\n});\n","// TODO: Remove from `core-js@4`\nrequire('./es.promise.all-settled.js');\n","'use strict';\nvar $ = require('../internals/export');\nvar newPromiseCapabilityModule = require('../internals/new-promise-capability');\nvar perform = require('../internals/perform');\n\n// `Promise.try` method\n// https://github.com/tc39/proposal-promise-try\n$({ target: 'Promise', stat: true }, {\n 'try': function (callbackfn) {\n var promiseCapability = newPromiseCapabilityModule.f(this);\n var result = perform(callbackfn);\n (result.error ? promiseCapability.reject : promiseCapability.resolve)(result.value);\n return promiseCapability.promise;\n }\n});\n","'use strict';\nvar $ = require('../internals/export');\nvar aFunction = require('../internals/a-function');\nvar getBuiltIn = require('../internals/get-built-in');\nvar newPromiseCapabilityModule = require('../internals/new-promise-capability');\nvar perform = require('../internals/perform');\nvar iterate = require('../internals/iterate');\n\nvar PROMISE_ANY_ERROR = 'No one promise resolved';\n\n// `Promise.any` method\n// https://github.com/tc39/proposal-promise-any\n$({ target: 'Promise', stat: true }, {\n any: function any(iterable) {\n var C = this;\n var capability = newPromiseCapabilityModule.f(C);\n var resolve = capability.resolve;\n var reject = capability.reject;\n var result = perform(function () {\n var promiseResolve = aFunction(C.resolve);\n var errors = [];\n var counter = 0;\n var remaining = 1;\n var alreadyResolved = false;\n iterate(iterable, function (promise) {\n var index = counter++;\n var alreadyRejected = false;\n errors.push(undefined);\n remaining++;\n promiseResolve.call(C, promise).then(function (value) {\n if (alreadyRejected || alreadyResolved) return;\n alreadyResolved = true;\n resolve(value);\n }, function (e) {\n if (alreadyRejected || alreadyResolved) return;\n alreadyRejected = true;\n errors[index] = e;\n --remaining || reject(new (getBuiltIn('AggregateError'))(errors, PROMISE_ANY_ERROR));\n });\n });\n --remaining || reject(new (getBuiltIn('AggregateError'))(errors, PROMISE_ANY_ERROR));\n });\n if (result.error) reject(result.value);\n return capability.promise;\n }\n});\n","import snippet from 'tui-code-snippet';\nimport { getSelector, assignmentForDestroy, cls, getHistoryTitle, isSilentCommand } from '@/util';\nimport {\n ZOOM_HELP_MENUS,\n COMMAND_HELP_MENUS,\n DELETE_HELP_MENUS,\n eventNames,\n HELP_MENUS,\n} from '@/consts';\nimport mainContainer from '@/ui/template/mainContainer';\nimport controls from '@/ui/template/controls';\n\nimport Theme from '@/ui/theme/theme';\nimport Shape from '@/ui/shape';\nimport Crop from '@/ui/crop';\nimport Flip from '@/ui/flip';\nimport Rotate from '@/ui/rotate';\nimport Text from '@/ui/text';\nimport Mask from '@/ui/mask';\nimport Icon from '@/ui/icon';\nimport Draw from '@/ui/draw';\nimport Filter from '@/ui/filter';\nimport History from '@/ui/history';\nimport Locale from '@/ui/locale/locale';\n\nconst SUB_UI_COMPONENT = {\n Shape,\n Crop,\n Flip,\n Rotate,\n Text,\n Mask,\n Icon,\n Draw,\n Filter,\n};\n\nconst { CustomEvents } = snippet;\n\nconst BI_EXPRESSION_MINSIZE_WHEN_TOP_POSITION = '1300';\nconst HISTORY_MENU = 'history';\nconst HISTORY_PANEL_CLASS_NAME = 'tie-panel-history';\n\nconst CLASS_NAME_ON = 'on';\nconst ZOOM_BUTTON_TYPE = {\n ZOOM_IN: 'zoomIn',\n HAND: 'hand',\n};\n\n/**\n * Default UI Class\n * @class\n * @param {string|HTMLElement} element - Wrapper's element or selector\n * @param {Object} [options] - Ui setting options\n * @param {number} options.loadImage - Init default load image\n * @param {number} options.initMenu - Init start menu\n * @param {Boolean} [options.menuBarPosition=bottom] - Let\n * @param {Boolean} [options.applyCropSelectionStyle=false] - Let\n * @param {Boolean} [options.usageStatistics=false] - Use statistics or not\n * @param {Object} [options.uiSize] - ui size of editor\n * @param {string} options.uiSize.width - width of ui\n * @param {string} options.uiSize.height - height of ui\n * @param {Object} actions - ui action instance\n */\nclass Ui {\n constructor(element, options, actions) {\n this.options = this._initializeOption(options);\n this._actions = actions;\n this.submenu = false;\n this.imageSize = {};\n this.uiSize = {};\n this._locale = new Locale(this.options.locale);\n this.theme = new Theme(this.options.theme);\n this.eventHandler = {};\n this._submenuChangeTransection = false;\n this._selectedElement = null;\n this._mainElement = null;\n this._editorElementWrap = null;\n this._editorElement = null;\n this._menuBarElement = null;\n this._subMenuElement = null;\n this._makeUiElement(element);\n this._setUiSize();\n this._initMenuEvent = false;\n\n this._makeSubMenu();\n\n this._attachHistoryEvent();\n this._attachZoomEvent();\n }\n\n /**\n * Destroys the instance.\n */\n destroy() {\n this._removeUiEvent();\n this._destroyAllMenu();\n this._selectedElement.innerHTML = '';\n\n assignmentForDestroy(this);\n }\n\n /**\n * Set Default Selection for includeUI\n * @param {Object} option - imageEditor options\n * @returns {Object} - extends selectionStyle option\n * @ignore\n */\n setUiDefaultSelectionStyle(option) {\n return snippet.extend(\n {\n applyCropSelectionStyle: true,\n applyGroupSelectionStyle: true,\n selectionStyle: {\n cornerStyle: 'circle',\n cornerSize: 16,\n cornerColor: '#fff',\n cornerStrokeColor: '#fff',\n transparentCorners: false,\n lineWidth: 2,\n borderColor: '#fff',\n },\n },\n option\n );\n }\n\n /**\n * Change editor size\n * @param {Object} resizeInfo - ui & image size info\n * @param {Object} [resizeInfo.uiSize] - image size dimension\n * @param {string} resizeInfo.uiSize.width - ui width\n * @param {string} resizeInfo.uiSize.height - ui height\n * @param {Object} [resizeInfo.imageSize] - image size dimension\n * @param {Number} resizeInfo.imageSize.oldWidth - old width\n * @param {Number} resizeInfo.imageSize.oldHeight - old height\n * @param {Number} resizeInfo.imageSize.newWidth - new width\n * @param {Number} resizeInfo.imageSize.newHeight - new height\n * @example\n * // Change the image size and ui size, and change the affected ui state together.\n * imageEditor.ui.resizeEditor({\n * imageSize: {oldWidth: 100, oldHeight: 100, newWidth: 700, newHeight: 700},\n * uiSize: {width: 1000, height: 1000}\n * });\n * @example\n * // Apply the ui state while preserving the previous attribute (for example, if responsive Ui)\n * imageEditor.ui.resizeEditor();\n */\n resizeEditor({ uiSize, imageSize = this.imageSize } = {}) {\n if (imageSize !== this.imageSize) {\n this.imageSize = imageSize;\n }\n if (uiSize) {\n this._setUiSize(uiSize);\n }\n\n const { width, height } = this._getCanvasMaxDimension();\n const editorElementStyle = this._editorElement.style;\n const { menuBarPosition } = this.options;\n\n editorElementStyle.height = `${height}px`;\n editorElementStyle.width = `${width}px`;\n\n this._setEditorPosition(menuBarPosition);\n\n this._editorElementWrap.style.bottom = `0px`;\n this._editorElementWrap.style.top = `0px`;\n this._editorElementWrap.style.left = `0px`;\n this._editorElementWrap.style.width = `100%`;\n\n const selectElementClassList = this._selectedElement.classList;\n\n if (\n menuBarPosition === 'top' &&\n this._selectedElement.offsetWidth < BI_EXPRESSION_MINSIZE_WHEN_TOP_POSITION\n ) {\n selectElementClassList.add('tui-image-editor-top-optimization');\n } else {\n selectElementClassList.remove('tui-image-editor-top-optimization');\n }\n }\n\n /**\n * Toggle zoom button status\n * @param {string} type - type of zoom button\n */\n toggleZoomButtonStatus(type) {\n const targetClassList = this._buttonElements[type].classList;\n\n targetClassList.toggle(CLASS_NAME_ON);\n\n if (type === ZOOM_BUTTON_TYPE.ZOOM_IN) {\n this._buttonElements[ZOOM_BUTTON_TYPE.HAND].classList.remove(CLASS_NAME_ON);\n } else {\n this._buttonElements[ZOOM_BUTTON_TYPE.ZOOM_IN].classList.remove(CLASS_NAME_ON);\n }\n }\n\n /**\n * Turn off zoom-in button status\n */\n offZoomInButtonStatus() {\n const zoomInClassList = this._buttonElements[ZOOM_BUTTON_TYPE.ZOOM_IN].classList;\n\n zoomInClassList.remove(CLASS_NAME_ON);\n }\n\n /**\n * Change hand button status\n * @param {boolean} enabled - status to change\n */\n changeHandButtonStatus(enabled) {\n const handClassList = this._buttonElements[ZOOM_BUTTON_TYPE.HAND].classList;\n\n handClassList[enabled ? 'add' : 'remove'](CLASS_NAME_ON);\n }\n\n /**\n * Change help button status\n * @param {string} buttonType - target button type\n * @param {Boolean} enableStatus - enabled status\n * @ignore\n */\n changeHelpButtonEnabled(buttonType, enableStatus) {\n const buttonClassList = this._buttonElements[buttonType].classList;\n\n buttonClassList[enableStatus ? 'add' : 'remove']('enabled');\n }\n\n /**\n * Change delete button status\n * @param {Object} [options] - Ui setting options\n * @param {object} [options.loadImage] - Init default load image\n * @param {string} [options.initMenu] - Init start menu\n * @param {string} [options.menuBarPosition=bottom] - Let\n * @param {boolean} [options.applyCropSelectionStyle=false] - Let\n * @param {boolean} [options.usageStatistics=false] - Send statistics ping or not\n * @returns {Object} initialize option\n * @private\n */\n _initializeOption(options) {\n return snippet.extend(\n {\n loadImage: {\n path: '',\n name: '',\n },\n locale: {},\n menuIconPath: '',\n menu: ['crop', 'flip', 'rotate', 'draw', 'shape', 'icon', 'text', 'mask', 'filter'],\n initMenu: '',\n uiSize: {\n width: '100%',\n height: '100%',\n },\n menuBarPosition: 'bottom',\n },\n options\n );\n }\n\n /**\n * Set ui container size\n * @param {Object} uiSize - ui dimension\n * @param {string} uiSize.width - css width property\n * @param {string} uiSize.height - css height property\n * @private\n */\n _setUiSize(uiSize = this.options.uiSize) {\n const elementDimension = this._selectedElement.style;\n elementDimension.width = uiSize.width;\n elementDimension.height = uiSize.height;\n }\n\n /**\n * Make submenu dom element\n * @private\n */\n _makeSubMenu() {\n snippet.forEach(this.options.menu, (menuName) => {\n const SubComponentClass =\n SUB_UI_COMPONENT[menuName.replace(/^[a-z]/, ($0) => $0.toUpperCase())];\n\n // make menu element\n this._makeMenuElement(menuName);\n\n // menu btn element\n this._buttonElements[menuName] = this._menuBarElement.querySelector(`.tie-btn-${menuName}`);\n\n // submenu ui instance\n this[menuName] = new SubComponentClass(this._subMenuElement, {\n locale: this._locale,\n makeSvgIcon: this.theme.makeMenSvgIconSet.bind(this.theme),\n menuBarPosition: this.options.menuBarPosition,\n usageStatistics: this.options.usageStatistics,\n });\n });\n }\n\n /**\n * Attach history event\n * @private\n */\n _attachHistoryEvent() {\n this.on(eventNames.EXECUTE_COMMAND, this._addHistory.bind(this));\n this.on(eventNames.AFTER_UNDO, this._selectPrevHistory.bind(this));\n this.on(eventNames.AFTER_REDO, this._selectNextHistory.bind(this));\n }\n\n /**\n * Attach zoom event\n * @private\n */\n _attachZoomEvent() {\n this.on(eventNames.HAND_STARTED, () => {\n this.offZoomInButtonStatus();\n this.changeHandButtonStatus(true);\n });\n this.on(eventNames.HAND_STOPPED, () => this.changeHandButtonStatus(false));\n }\n\n /**\n * Make primary ui dom element\n * @param {string|HTMLElement} element - Wrapper's element or selector\n * @private\n */\n _makeUiElement(element) {\n let selectedElement;\n\n window.snippet = snippet;\n\n if (element.nodeType) {\n selectedElement = element;\n } else {\n selectedElement = document.querySelector(element);\n }\n const selector = getSelector(selectedElement);\n\n selectedElement.classList.add('tui-image-editor-container');\n selectedElement.innerHTML =\n controls({\n locale: this._locale,\n biImage: this.theme.getStyle('common.bi'),\n loadButtonStyle: this.theme.getStyle('loadButton'),\n downloadButtonStyle: this.theme.getStyle('downloadButton'),\n menuBarPosition: this.options.menuBarPosition,\n }) +\n mainContainer({\n locale: this._locale,\n biImage: this.theme.getStyle('common.bi'),\n commonStyle: this.theme.getStyle('common'),\n headerStyle: this.theme.getStyle('header'),\n loadButtonStyle: this.theme.getStyle('loadButton'),\n downloadButtonStyle: this.theme.getStyle('downloadButton'),\n submenuStyle: this.theme.getStyle('submenu'),\n });\n\n this._selectedElement = selectedElement;\n this._selectedElement.classList.add(this.options.menuBarPosition);\n\n this._mainElement = selector('.tui-image-editor-main');\n this._editorElementWrap = selector('.tui-image-editor-wrap');\n this._editorElement = selector('.tui-image-editor');\n this._helpMenuBarElement = selector('.tui-image-editor-help-menu');\n this._menuBarElement = selector('.tui-image-editor-menu');\n this._subMenuElement = selector('.tui-image-editor-submenu');\n this._buttonElements = {\n download: this._selectedElement.querySelectorAll('.tui-image-editor-download-btn'),\n load: this._selectedElement.querySelectorAll('.tui-image-editor-load-btn'),\n };\n\n this._addHelpMenus();\n\n this._historyMenu = new History(this._buttonElements[HISTORY_MENU], {\n locale: this._locale,\n makeSvgIcon: this.theme.makeMenSvgIconSet.bind(this.theme),\n });\n\n this._activateZoomMenus();\n }\n\n /**\n * Activate help menus for zoom.\n * @private\n */\n _activateZoomMenus() {\n snippet.forEach(ZOOM_HELP_MENUS, (menu) => {\n this.changeHelpButtonEnabled(menu, true);\n });\n }\n\n /**\n * make array for help menu output, including partitions.\n * @returns {Array}\n * @private\n */\n _makeHelpMenuWithPartition() {\n return [...ZOOM_HELP_MENUS, '', ...COMMAND_HELP_MENUS, '', ...DELETE_HELP_MENUS];\n }\n\n /**\n * Add help menu\n * @private\n */\n _addHelpMenus() {\n const helpMenuWithPartition = this._makeHelpMenuWithPartition();\n\n snippet.forEach(helpMenuWithPartition, (menuName) => {\n if (!menuName) {\n this._makeMenuPartitionElement();\n } else {\n this._makeMenuElement(menuName, ['normal', 'disabled', 'hover'], 'help');\n\n this._buttonElements[menuName] = this._helpMenuBarElement.querySelector(\n `.tie-btn-${menuName}`\n );\n }\n });\n }\n\n /**\n * Make menu partition element\n * @private\n */\n _makeMenuPartitionElement() {\n const partitionElement = document.createElement('li');\n const partitionInnerElement = document.createElement('div');\n partitionElement.className = cls('item');\n partitionInnerElement.className = cls('icpartition');\n partitionElement.appendChild(partitionInnerElement);\n\n this._helpMenuBarElement.appendChild(partitionElement);\n }\n\n /**\n * Make menu button element\n * @param {string} menuName - menu name\n * @param {Array} useIconTypes - Possible values are \\['normal', 'active', 'hover', 'disabled'\\]\n * @param {string} menuType - 'normal' or 'help'\n * @private\n */\n _makeMenuElement(menuName, useIconTypes = ['normal', 'active', 'hover'], menuType = 'normal') {\n const btnElement = document.createElement('li');\n const menuItemHtml = this.theme.makeMenSvgIconSet(useIconTypes, menuName);\n\n this._addTooltipAttribute(btnElement, menuName);\n btnElement.className = `tie-btn-${menuName} ${cls('item')} ${menuType}`;\n btnElement.innerHTML = menuItemHtml;\n\n if (menuType === 'normal') {\n this._menuBarElement.appendChild(btnElement);\n } else {\n this._helpMenuBarElement.appendChild(btnElement);\n }\n }\n\n /**\n * Add help action event\n * @private\n */\n _addHelpActionEvent() {\n snippet.forEach(HELP_MENUS, (helpName) => {\n this.eventHandler[helpName] = (event) => this._actions.main[helpName](event);\n this._buttonElements[helpName].addEventListener('click', this.eventHandler[helpName]);\n });\n }\n\n /**\n * Remove help action event\n * @private\n */\n _removeHelpActionEvent() {\n snippet.forEach(HELP_MENUS, (helpName) => {\n this._buttonElements[helpName].removeEventListener('click', this.eventHandler[helpName]);\n });\n }\n\n /**\n * Add history\n * @param {Command|string} command - command or command name\n */\n _addHistory(command) {\n if (!isSilentCommand(command)) {\n const historyTitle =\n typeof command === 'string' ? { name: command } : getHistoryTitle(command);\n\n this._historyMenu.add(historyTitle);\n }\n }\n\n /**\n * Init history\n */\n initHistory() {\n this._historyMenu.init();\n }\n\n /**\n * Clear history\n */\n clearHistory() {\n this._historyMenu.clear();\n }\n\n /**\n * Select prev history\n */\n _selectPrevHistory() {\n this._historyMenu.prev();\n }\n\n /**\n * Select next history\n */\n _selectNextHistory() {\n this._historyMenu.next();\n }\n\n /**\n * Toggle history menu\n * @param {object} event - event object\n */\n toggleHistoryMenu(event) {\n const { target } = event;\n const item = target.closest(`.${HISTORY_PANEL_CLASS_NAME}`);\n\n if (item) {\n return;\n }\n\n const historyButtonClassList = this._buttonElements[HISTORY_MENU].classList;\n\n historyButtonClassList.toggle('opened');\n }\n\n /**\n * Add attribute for menu tooltip\n * @param {HTMLElement} element - menu element\n * @param {string} tooltipName - tooltipName\n * @private\n */\n _addTooltipAttribute(element, tooltipName) {\n element.setAttribute(\n 'tooltip-content',\n this._locale.localize(tooltipName.replace(/^[a-z]/g, ($0) => $0.toUpperCase()))\n );\n }\n\n /**\n * Add download event\n * @private\n */\n _addDownloadEvent() {\n this.eventHandler.download = () => this._actions.main.download();\n snippet.forEach(this._buttonElements.download, (element) => {\n element.addEventListener('click', this.eventHandler.download);\n });\n }\n\n _removeDownloadEvent() {\n snippet.forEach(this._buttonElements.download, (element) => {\n element.removeEventListener('click', this.eventHandler.download);\n });\n }\n\n /**\n * Add load event\n * @private\n */\n _addLoadEvent() {\n this.eventHandler.loadImage = (event) => this._actions.main.load(event.target.files[0]);\n\n snippet.forEach(this._buttonElements.load, (element) => {\n element.addEventListener('change', this.eventHandler.loadImage);\n });\n }\n\n /**\n * Remove load event\n * @private\n */\n _removeLoadEvent() {\n snippet.forEach(this._buttonElements.load, (element) => {\n element.removeEventListener('change', this.eventHandler.loadImage);\n });\n }\n\n /**\n * Add menu event\n * @param {string} menuName - menu name\n * @private\n */\n _addMainMenuEvent(menuName) {\n this.eventHandler[menuName] = () => this.changeMenu(menuName);\n this._buttonElements[menuName].addEventListener('click', this.eventHandler[menuName]);\n }\n\n /**\n * Add menu event\n * @param {string} menuName - menu name\n * @private\n */\n _addSubMenuEvent(menuName) {\n this[menuName].addEvent(this._actions[menuName]);\n }\n\n /**\n * Add menu event\n * @private\n */\n _addMenuEvent() {\n snippet.forEach(this.options.menu, (menuName) => {\n this._addMainMenuEvent(menuName);\n this._addSubMenuEvent(menuName);\n });\n }\n\n /**\n * Remove menu event\n * @private\n */\n _removeMainMenuEvent() {\n snippet.forEach(this.options.menu, (menuName) => {\n this._buttonElements[menuName].removeEventListener('click', this.eventHandler[menuName]);\n });\n }\n\n /**\n * Get editor area element\n * @returns {HTMLElement} editor area html element\n * @ignore\n */\n getEditorArea() {\n return this._editorElement;\n }\n\n /**\n * Add event for menu items\n * @ignore\n */\n activeMenuEvent() {\n if (this._initMenuEvent) {\n return;\n }\n\n this._addHelpActionEvent();\n this._addDownloadEvent();\n this._addMenuEvent();\n this._initMenu();\n this._historyMenu.addEvent(this._actions.history);\n this._initMenuEvent = true;\n }\n\n /**\n * Remove ui event\n * @private\n */\n _removeUiEvent() {\n this._removeHelpActionEvent();\n this._removeDownloadEvent();\n this._removeLoadEvent();\n this._removeMainMenuEvent();\n this._historyMenu.removeEvent();\n }\n\n /**\n * Destroy all menu instance\n * @private\n */\n _destroyAllMenu() {\n snippet.forEach(this.options.menu, (menuName) => {\n this[menuName].destroy();\n });\n\n this._historyMenu.destroy();\n }\n\n /**\n * Init canvas\n * @ignore\n */\n initCanvas() {\n const loadImageInfo = this._getLoadImage();\n if (loadImageInfo.path) {\n this._actions.main.initLoadImage(loadImageInfo.path, loadImageInfo.name).then(() => {\n this.activeMenuEvent();\n });\n }\n\n this._addLoadEvent();\n\n const gridVisual = document.createElement('div');\n\n gridVisual.className = cls('grid-visual');\n const grid = `\n \n \n \n
                      `;\n gridVisual.innerHTML = grid;\n this._editorContainerElement = this._editorElement.querySelector(\n '.tui-image-editor-canvas-container'\n );\n this._editorContainerElement.appendChild(gridVisual);\n }\n\n /**\n * get editor area element\n * @returns {Object} load image option\n * @private\n */\n _getLoadImage() {\n return this.options.loadImage;\n }\n\n /**\n * change menu\n * @param {string} menuName - menu name\n * @param {boolean} toggle - whether toogle or not\n * @param {boolean} discardSelection - discard selection\n * @ignore\n */\n changeMenu(menuName, toggle = true, discardSelection = true) {\n if (!this._submenuChangeTransection) {\n this._submenuChangeTransection = true;\n this._changeMenu(menuName, toggle, discardSelection);\n this._submenuChangeTransection = false;\n }\n }\n\n /**\n * change menu\n * @param {string} menuName - menu name\n * @param {boolean} toggle - whether toggle or not\n * @param {boolean} discardSelection - discard selection\n * @private\n */\n _changeMenu(menuName, toggle, discardSelection) {\n if (this.submenu) {\n this._buttonElements[this.submenu].classList.remove('active');\n this._mainElement.classList.remove(`tui-image-editor-menu-${this.submenu}`);\n if (discardSelection) {\n this._actions.main.discardSelection();\n }\n this._actions.main.changeSelectableAll(true);\n this[this.submenu].changeStandbyMode();\n }\n\n if (this.submenu === menuName && toggle) {\n this.submenu = null;\n } else {\n this._buttonElements[menuName].classList.add('active');\n this._mainElement.classList.add(`tui-image-editor-menu-${menuName}`);\n this.submenu = menuName;\n this[this.submenu].changeStartMode();\n }\n\n this.resizeEditor();\n }\n\n /**\n * Init menu\n * @private\n */\n _initMenu() {\n if (this.options.initMenu) {\n const evt = document.createEvent('MouseEvents');\n evt.initEvent('click', true, false);\n this._buttonElements[this.options.initMenu].dispatchEvent(evt);\n }\n\n if (this.icon) {\n this.icon.registerDefaultIcon();\n }\n }\n\n /**\n * Get canvas max Dimension\n * @returns {Object} - width & height of editor\n * @private\n */\n _getCanvasMaxDimension() {\n const { maxWidth, maxHeight } = this._editorContainerElement.style;\n const width = parseFloat(maxWidth);\n const height = parseFloat(maxHeight);\n\n return {\n width,\n height,\n };\n }\n\n /**\n * Set editor position\n * @param {string} menuBarPosition - top or right or bottom or left\n * @private\n */\n // eslint-disable-next-line complexity\n _setEditorPosition(menuBarPosition) {\n const { width, height } = this._getCanvasMaxDimension();\n const editorElementStyle = this._editorElement.style;\n let top = 0;\n let left = 0;\n\n if (this.submenu) {\n if (menuBarPosition === 'bottom') {\n if (height > this._editorElementWrap.scrollHeight - 150) {\n top = (height - this._editorElementWrap.scrollHeight) / 2;\n } else {\n top = (150 / 2) * -1;\n }\n } else if (menuBarPosition === 'top') {\n if (height > this._editorElementWrap.offsetHeight - 150) {\n top = 150 / 2 - (height - (this._editorElementWrap.offsetHeight - 150)) / 2;\n } else {\n top = 150 / 2;\n }\n } else if (menuBarPosition === 'left') {\n if (width > this._editorElementWrap.offsetWidth - 248) {\n left = 248 / 2 - (width - (this._editorElementWrap.offsetWidth - 248)) / 2;\n } else {\n left = 248 / 2;\n }\n } else if (menuBarPosition === 'right') {\n if (width > this._editorElementWrap.scrollWidth - 248) {\n left = (width - this._editorElementWrap.scrollWidth) / 2;\n } else {\n left = (248 / 2) * -1;\n }\n }\n }\n editorElementStyle.top = `${top}px`;\n editorElementStyle.left = `${left}px`;\n }\n}\n\nCustomEvents.mixin(Ui);\n\nexport default Ui;\n","export default ({\n locale,\n biImage,\n commonStyle,\n headerStyle,\n loadButtonStyle,\n downloadButtonStyle,\n submenuStyle,\n}) => `\n
                      \n
                      \n
                      \n \n
                      \n
                      \n
                      \n ${locale.localize('Load')}\n \n
                      \n \n
                      \n
                      \n
                      \n
                      \n
                      \n
                      \n
                      \n
                      \n
                      \n
                      \n
                      \n
                      \n
                      \n
                      \n
                      \n`;\n","import { getHelpMenuBarPosition } from '@/util';\n\nexport default ({ locale, biImage, loadButtonStyle, downloadButtonStyle, menuBarPosition }) => `\n
                        \n
                        \n
                        \n \n
                        \n
                          \n\n
                          \n
                          \n ${locale.localize('Load')}\n \n
                          \n \n
                          \n
                          \n`;\n","import { extend, forEach, map } from 'tui-code-snippet';\nimport style from '@/ui/template/style';\nimport standardTheme from '@/ui/theme/standard';\nimport icon from '@svg/default.svg';\nimport { styleLoad } from '@/util';\n\n/**\n * Theme manager\n * @class\n * @param {Object} customTheme - custom theme\n * @ignore\n */\nclass Theme {\n constructor(customTheme) {\n this.styles = this._changeToObject(extend({}, standardTheme, customTheme));\n styleLoad(this._styleMaker());\n\n this._loadDefaultSvgIcon();\n }\n\n /**\n * Get a Style cssText or StyleObject\n * @param {string} type - style type\n * @returns {string|object} - cssText or StyleObject\n */\n // eslint-disable-next-line complexity\n getStyle(type) {\n let result = null;\n const firstProperty = type.replace(/\\..+$/, '');\n const option = this.styles[type];\n switch (type) {\n case 'common.bi':\n result = this.styles[type].image;\n break;\n case 'menu.icon':\n result = {\n active: this.styles[`${firstProperty}.activeIcon`],\n normal: this.styles[`${firstProperty}.normalIcon`],\n hover: this.styles[`${firstProperty}.hoverIcon`],\n disabled: this.styles[`${firstProperty}.disabledIcon`],\n };\n break;\n case 'submenu.icon':\n result = {\n active: this.styles[`${firstProperty}.activeIcon`],\n normal: this.styles[`${firstProperty}.normalIcon`],\n };\n break;\n case 'submenu.label':\n result = {\n active: this._makeCssText(this.styles[`${firstProperty}.activeLabel`]),\n normal: this._makeCssText(this.styles[`${firstProperty}.normalLabel`]),\n };\n break;\n case 'submenu.partition':\n result = {\n vertical: this._makeCssText(\n extend({}, option, { borderLeft: `1px solid ${option.color}` })\n ),\n horizontal: this._makeCssText(\n extend({}, option, { borderBottom: `1px solid ${option.color}` })\n ),\n };\n break;\n\n case 'range.disabledPointer':\n case 'range.disabledBar':\n case 'range.disabledSubbar':\n case 'range.pointer':\n case 'range.bar':\n case 'range.subbar':\n option.backgroundColor = option.color;\n result = this._makeCssText(option);\n break;\n default:\n result = this._makeCssText(option);\n break;\n }\n\n return result;\n }\n\n /**\n * Make css resource\n * @returns {string} - serialized css text\n * @private\n */\n _styleMaker() {\n const submenuLabelStyle = this.getStyle('submenu.label');\n const submenuPartitionStyle = this.getStyle('submenu.partition');\n\n return style({\n subMenuLabelActive: submenuLabelStyle.active,\n subMenuLabelNormal: submenuLabelStyle.normal,\n submenuPartitionVertical: submenuPartitionStyle.vertical,\n submenuPartitionHorizontal: submenuPartitionStyle.horizontal,\n biSize: this.getStyle('common.bisize'),\n subMenuRangeTitle: this.getStyle('range.title'),\n submenuRangePointer: this.getStyle('range.pointer'),\n submenuRangeBar: this.getStyle('range.bar'),\n submenuRangeSubbar: this.getStyle('range.subbar'),\n\n submenuDisabledRangePointer: this.getStyle('range.disabledPointer'),\n submenuDisabledRangeBar: this.getStyle('range.disabledBar'),\n submenuDisabledRangeSubbar: this.getStyle('range.disabledSubbar'),\n\n submenuRangeValue: this.getStyle('range.value'),\n submenuColorpickerTitle: this.getStyle('colorpicker.title'),\n submenuColorpickerButton: this.getStyle('colorpicker.button'),\n submenuCheckbox: this.getStyle('checkbox'),\n menuIconSize: this.getStyle('menu.iconSize'),\n submenuIconSize: this.getStyle('submenu.iconSize'),\n menuIconStyle: this.getStyle('menu.icon'),\n submenuIconStyle: this.getStyle('submenu.icon'),\n });\n }\n\n /**\n * Change to low dimensional object.\n * @param {object} styleOptions - style object of user interface\n * @returns {object} low level object for style apply\n * @private\n */\n _changeToObject(styleOptions) {\n const styleObject = {};\n forEach(styleOptions, (value, key) => {\n const keyExplode = key.match(/^(.+)\\.([a-z]+)$/i);\n const [, property, subProperty] = keyExplode;\n\n if (!styleObject[property]) {\n styleObject[property] = {};\n }\n styleObject[property][subProperty] = value;\n });\n\n return styleObject;\n }\n\n /**\n * Style object to Csstext serialize\n * @param {object} styleObject - style object\n * @returns {string} - css text string\n * @private\n */\n _makeCssText(styleObject) {\n const converterStack = [];\n\n forEach(styleObject, (value, key) => {\n if (['backgroundImage'].indexOf(key) > -1 && value !== 'none') {\n value = `url(${value})`;\n }\n\n converterStack.push(`${this._toUnderScore(key)}: ${value}`);\n });\n\n return converterStack.join(';');\n }\n\n /**\n * Camel key string to Underscore string\n * @param {string} targetString - change target\n * @returns {string}\n * @private\n */\n _toUnderScore(targetString) {\n return targetString.replace(/([A-Z])/g, ($0, $1) => `-${$1.toLowerCase()}`);\n }\n\n /**\n * Load default svg icon\n * @private\n */\n _loadDefaultSvgIcon() {\n if (!document.getElementById('tui-image-editor-svg-default-icons')) {\n const parser = new DOMParser();\n const dom = parser.parseFromString(icon, 'text/xml');\n\n document.body.appendChild(dom.documentElement);\n }\n }\n\n /**\n * Make className for svg icon\n * @param {string} iconType - normal' or 'active' or 'hover' or 'disabled\n * @param {boolean} isSubmenu - submenu icon or not.\n * @returns {string}\n * @private\n */\n _makeIconClassName(iconType, isSubmenu) {\n const iconStyleInfo = isSubmenu ? this.getStyle('submenu.icon') : this.getStyle('menu.icon');\n const { path, name } = iconStyleInfo[iconType];\n\n return path && name ? iconType : `${iconType} use-default`;\n }\n\n /**\n * Make svg use link path name\n * @param {string} iconType - normal' or 'active' or 'hover' or 'disabled\n * @param {boolean} isSubmenu - submenu icon or not.\n * @returns {string}\n * @private\n */\n _makeSvgIconPrefix(iconType, isSubmenu) {\n const iconStyleInfo = isSubmenu ? this.getStyle('submenu.icon') : this.getStyle('menu.icon');\n const { path, name } = iconStyleInfo[iconType];\n\n return path && name ? `${path}#${name}-` : '#';\n }\n\n /**\n * Make svg use link path name\n * @param {Array.} useIconTypes - normal' or 'active' or 'hover' or 'disabled\n * @param {string} menuName - menu name\n * @param {boolean} isSubmenu - submenu icon or not.\n * @returns {string}\n * @private\n */\n _makeSvgItem(useIconTypes, menuName, isSubmenu) {\n return map(useIconTypes, (iconType) => {\n const svgIconPrefix = this._makeSvgIconPrefix(iconType, isSubmenu);\n const iconName = this._toUnderScore(menuName);\n const svgIconClassName = this._makeIconClassName(iconType, isSubmenu);\n\n return ``;\n }).join('');\n }\n\n /**\n * Make svg icon set\n * @param {Array.} useIconTypes - normal' or 'active' or 'hover' or 'disabled\n * @param {string} menuName - menu name\n * @param {boolean} isSubmenu - submenu icon or not.\n * @returns {string}\n */\n makeMenSvgIconSet(useIconTypes, menuName, isSubmenu = false) {\n return `${this._makeSvgItem(\n useIconTypes,\n menuName,\n isSubmenu\n )}`;\n }\n}\n\nexport default Theme;\n","export default ({\n subMenuLabelActive,\n subMenuLabelNormal,\n subMenuRangeTitle,\n submenuPartitionVertical,\n submenuPartitionHorizontal,\n submenuCheckbox,\n submenuRangePointer,\n submenuRangeValue,\n submenuColorpickerTitle,\n submenuColorpickerButton,\n submenuRangeBar,\n submenuRangeSubbar,\n submenuDisabledRangePointer,\n submenuDisabledRangeBar,\n submenuDisabledRangeSubbar,\n submenuIconSize,\n menuIconSize,\n biSize,\n menuIconStyle,\n submenuIconStyle,\n}) => `\n .tie-icon-add-button.icon-bubble .tui-image-editor-button[data-icontype=\"icon-bubble\"] label,\n .tie-icon-add-button.icon-heart .tui-image-editor-button[data-icontype=\"icon-heart\"] label,\n .tie-icon-add-button.icon-location .tui-image-editor-button[data-icontype=\"icon-location\"] label,\n .tie-icon-add-button.icon-polygon .tui-image-editor-button[data-icontype=\"icon-polygon\"] label,\n .tie-icon-add-button.icon-star .tui-image-editor-button[data-icontype=\"icon-star\"] label,\n .tie-icon-add-button.icon-star-2 .tui-image-editor-button[data-icontype=\"icon-star-2\"] label,\n .tie-icon-add-button.icon-arrow-3 .tui-image-editor-button[data-icontype=\"icon-arrow-3\"] label,\n .tie-icon-add-button.icon-arrow-2 .tui-image-editor-button[data-icontype=\"icon-arrow-2\"] label,\n .tie-icon-add-button.icon-arrow .tui-image-editor-button[data-icontype=\"icon-arrow\"] label,\n .tie-icon-add-button.icon-bubble .tui-image-editor-button[data-icontype=\"icon-bubble\"] label,\n .tie-draw-line-select-button.line .tui-image-editor-button.line label,\n .tie-draw-line-select-button.free .tui-image-editor-button.free label,\n .tie-flip-button.flipX .tui-image-editor-button.flipX label,\n .tie-flip-button.flipY .tui-image-editor-button.flipY label,\n .tie-flip-button.resetFlip .tui-image-editor-button.resetFlip label,\n .tie-crop-button .tui-image-editor-button.apply.active label,\n .tie-crop-preset-button .tui-image-editor-button.preset.active label,\n .tie-shape-button.rect .tui-image-editor-button.rect label,\n .tie-shape-button.circle .tui-image-editor-button.circle label,\n .tie-shape-button.triangle .tui-image-editor-button.triangle label,\n .tie-text-effect-button .tui-image-editor-button.active label,\n .tie-text-align-button.left .tui-image-editor-button.left label,\n .tie-text-align-button.center .tui-image-editor-button.center label,\n .tie-text-align-button.right .tui-image-editor-button.right label,\n .tie-mask-apply.apply.active .tui-image-editor-button.apply label,\n .tui-image-editor-container .tui-image-editor-submenu .tui-image-editor-button:hover > label,\n .tui-image-editor-container .tui-image-editor-checkbox label > span {\n ${subMenuLabelActive}\n }\n .tui-image-editor-container .tui-image-editor-submenu .tui-image-editor-button > label,\n .tui-image-editor-container .tui-image-editor-range-wrap.tui-image-editor-newline.short label,\n .tui-image-editor-container .tui-image-editor-range-wrap.tui-image-editor-newline.short label > span {\n ${subMenuLabelNormal}\n }\n .tui-image-editor-container .tui-image-editor-range-wrap label > span {\n ${subMenuRangeTitle}\n }\n .tui-image-editor-container .tui-image-editor-partition > div {\n ${submenuPartitionVertical}\n }\n .tui-image-editor-container.left .tui-image-editor-submenu .tui-image-editor-partition > div,\n .tui-image-editor-container.right .tui-image-editor-submenu .tui-image-editor-partition > div {\n ${submenuPartitionHorizontal}\n }\n .tui-image-editor-container .tui-image-editor-checkbox label > span:before {\n ${submenuCheckbox}\n }\n .tui-image-editor-container .tui-image-editor-checkbox label > input:checked + span:before {\n border: 0;\n }\n .tui-image-editor-container .tui-image-editor-virtual-range-pointer {\n ${submenuRangePointer}\n }\n .tui-image-editor-container .tui-image-editor-virtual-range-bar {\n ${submenuRangeBar}\n }\n .tui-image-editor-container .tui-image-editor-virtual-range-subbar {\n ${submenuRangeSubbar}\n }\n .tui-image-editor-container .tui-image-editor-disabled .tui-image-editor-virtual-range-pointer {\n ${submenuDisabledRangePointer}\n }\n .tui-image-editor-container .tui-image-editor-disabled .tui-image-editor-virtual-range-subbar {\n ${submenuDisabledRangeSubbar}\n }\n .tui-image-editor-container .tui-image-editor-disabled .tui-image-editor-virtual-range-bar {\n ${submenuDisabledRangeBar}\n }\n .tui-image-editor-container .tui-image-editor-range-value {\n ${submenuRangeValue}\n }\n .tui-image-editor-container .tui-image-editor-submenu .tui-image-editor-button .color-picker-value + label {\n ${submenuColorpickerTitle}\n }\n .tui-image-editor-container .tui-image-editor-submenu .tui-image-editor-button .color-picker-value {\n ${submenuColorpickerButton}\n }\n .tui-image-editor-container .svg_ic-menu {\n ${menuIconSize}\n }\n .tui-image-editor-container .svg_ic-submenu {\n ${submenuIconSize}\n }\n .tui-image-editor-container .tui-image-editor-controls-logo > img,\n .tui-image-editor-container .tui-image-editor-header-logo > img {\n ${biSize}\n }\n .tui-image-editor-menu use.normal.use-default,\n .tui-image-editor-help-menu use.normal.use-default {\n fill-rule: evenodd;\n fill: ${menuIconStyle.normal.color};\n stroke: ${menuIconStyle.normal.color};\n }\n .tui-image-editor-menu use.active.use-default,\n .tui-image-editor-help-menu use.active.use-default {\n fill-rule: evenodd;\n fill: ${menuIconStyle.active.color};\n stroke: ${menuIconStyle.active.color};\n }\n .tui-image-editor-menu use.hover.use-default,\n .tui-image-editor-help-menu use.hover.use-default {\n fill-rule: evenodd;\n fill: ${menuIconStyle.hover.color};\n stroke: ${menuIconStyle.hover.color};\n }\n .tui-image-editor-menu use.disabled.use-default,\n .tui-image-editor-help-menu use.disabled.use-default {\n fill-rule: evenodd;\n fill: ${menuIconStyle.disabled.color};\n stroke: ${menuIconStyle.disabled.color};\n }\n .tui-image-editor-submenu use.normal.use-default {\n fill-rule: evenodd;\n fill: ${submenuIconStyle.normal.color};\n stroke: ${submenuIconStyle.normal.color};\n }\n .tui-image-editor-submenu use.active.use-default {\n fill-rule: evenodd;\n fill: ${submenuIconStyle.active.color};\n stroke: ${submenuIconStyle.active.color};\n }\n`;\n","/**\n * @author NHN. FE Development Team \n * @fileoverview The standard theme\n */\n\n/**\n * Full configuration for theme.
                          \n * @typedef {object} themeConfig\n * @property {string} common.bi.image - Brand icon image\n * @property {string} common.bisize.width - Icon image width\n * @property {string} common.bisize.height - Icon Image Height\n * @property {string} common.backgroundImage - Background image\n * @property {string} common.backgroundColor - Background color\n * @property {string} common.border - Full area border style\n * @property {string} header.backgroundImage - header area background\n * @property {string} header.backgroundColor - header area background color\n * @property {string} header.border - header area border style\n * @property {string} loadButton.backgroundColor - load button background color\n * @property {string} loadButton.border - load button border style\n * @property {string} loadButton.color - load button foreground color\n * @property {string} loadButton.fontFamily - load button font type\n * @property {string} loadButton.fontSize - load button font size\n * @property {string} downloadButton.backgroundColor - download button background color\n * @property {string} downloadButton.border - download button border style\n * @property {string} downloadButton.color - download button foreground color\n * @property {string} downloadButton.fontFamily - download button font type\n * @property {string} downloadButton.fontSize - download button font size\n * @property {string} menu.normalIcon.color - Menu normal color for default icon\n * @property {string} menu.normalIcon.path - Menu normal icon svg bundle file path\n * @property {string} menu.normalIcon.name - Menu normal icon svg bundle name\n * @property {string} menu.activeIcon.color - Menu active color for default icon\n * @property {string} menu.activeIcon.path - Menu active icon svg bundle file path\n * @property {string} menu.activeIcon.name - Menu active icon svg bundle name\n * @property {string} menu.disabled.color - Menu disabled color for default icon\n * @property {string} menu.disabled.path - Menu disabled icon svg bundle file path\n * @property {string} menu.disabled.name - Menu disabled icon svg bundle name\n * @property {string} menu.hover.color - Menu default icon hover color\n * @property {string} menu.hover.path - Menu hover icon svg bundle file path\n * @property {string} menu.hover.name - Menu hover icon svg bundle name\n * @property {string} menu.iconSize.width - Menu icon Size Width\n * @property {string} menu.iconSize.height - Menu Icon Size Height\n * @property {string} submenu.backgroundColor - Sub-menu area background color\n * @property {string} submenu.partition.color - Submenu partition line color\n * @property {string} submenu.normalIcon.color - Submenu normal color for default icon\n * @property {string} submenu.normalIcon.path - Submenu default icon svg bundle file path\n * @property {string} submenu.normalIcon.name - Submenu default icon svg bundle name\n * @property {string} submenu.activeIcon.color - Submenu active color for default icon\n * @property {string} submenu.activeIcon.path - Submenu active icon svg bundle file path\n * @property {string} submenu.activeIcon.name - Submenu active icon svg bundle name\n * @property {string} submenu.iconSize.width - Submenu icon Size Width\n * @property {string} submenu.iconSize.height - Submenu Icon Size Height\n * @property {string} submenu.normalLabel.color - Submenu default label color\n * @property {string} submenu.normalLabel.fontWeight - Sub Menu Default Label Font Thickness\n * @property {string} submenu.activeLabel.color - Submenu active label color\n * @property {string} submenu.activeLabel.fontWeight - Submenu active label Font thickness\n * @property {string} checkbox.border - Checkbox border style\n * @property {string} checkbox.backgroundColor - Checkbox background color\n * @property {string} range.pointer.color - range control pointer color\n * @property {string} range.bar.color - range control bar color\n * @property {string} range.subbar.color - range control subbar color\n * @property {string} range.value.color - range number box font color\n * @property {string} range.value.fontWeight - range number box font thickness\n * @property {string} range.value.fontSize - range number box font size\n * @property {string} range.value.border - range number box border style\n * @property {string} range.value.backgroundColor - range number box background color\n * @property {string} range.title.color - range title font color\n * @property {string} range.title.fontWeight - range title font weight\n * @property {string} colorpicker.button.border - colorpicker button border style\n * @property {string} colorpicker.title.color - colorpicker button title font color\n * @example\n // default keys and styles\n var customTheme = {\n 'common.bi.image': 'https://uicdn.toast.com/toastui/img/tui-image-editor-bi.png',\n 'common.bisize.width': '251px',\n 'common.bisize.height': '21px',\n 'common.backgroundImage': 'none',\n 'common.backgroundColor': '#1e1e1e',\n 'common.border': '0px',\n\n // header\n 'header.backgroundImage': 'none',\n 'header.backgroundColor': 'transparent',\n 'header.border': '0px',\n\n // load button\n 'loadButton.backgroundColor': '#fff',\n 'loadButton.border': '1px solid #ddd',\n 'loadButton.color': '#222',\n 'loadButton.fontFamily': 'NotoSans, sans-serif',\n 'loadButton.fontSize': '12px',\n\n // download button\n 'downloadButton.backgroundColor': '#fdba3b',\n 'downloadButton.border': '1px solid #fdba3b',\n 'downloadButton.color': '#fff',\n 'downloadButton.fontFamily': 'NotoSans, sans-serif',\n 'downloadButton.fontSize': '12px',\n\n // icons default\n 'menu.normalIcon.color': '#8a8a8a',\n 'menu.activeIcon.color': '#555555',\n 'menu.disabledIcon.color': '#434343',\n 'menu.hoverIcon.color': '#e9e9e9',\n 'submenu.normalIcon.color': '#8a8a8a',\n 'submenu.activeIcon.color': '#e9e9e9',\n\n 'menu.iconSize.width': '24px',\n 'menu.iconSize.height': '24px',\n 'submenu.iconSize.width': '32px',\n 'submenu.iconSize.height': '32px',\n\n // submenu primary color\n 'submenu.backgroundColor': '#1e1e1e',\n 'submenu.partition.color': '#858585',\n\n // submenu labels\n 'submenu.normalLabel.color': '#858585',\n 'submenu.normalLabel.fontWeight': 'lighter',\n 'submenu.activeLabel.color': '#fff',\n 'submenu.activeLabel.fontWeight': 'lighter',\n\n // checkbox style\n 'checkbox.border': '1px solid #ccc',\n 'checkbox.backgroundColor': '#fff',\n\n // rango style\n 'range.pointer.color': '#fff',\n 'range.bar.color': '#666',\n 'range.subbar.color': '#d1d1d1',\n\n 'range.disabledPointer.color': '#414141',\n 'range.disabledBar.color': '#282828',\n 'range.disabledSubbar.color': '#414141',\n\n 'range.value.color': '#fff',\n 'range.value.fontWeight': 'lighter',\n 'range.value.fontSize': '11px',\n 'range.value.border': '1px solid #353535',\n 'range.value.backgroundColor': '#151515',\n 'range.title.color': '#fff',\n 'range.title.fontWeight': 'lighter',\n\n // colorpicker style\n 'colorpicker.button.border': '1px solid #1e1e1e',\n 'colorpicker.title.color': '#fff'\n};\n */\nexport default {\n 'common.bi.image': 'https://uicdn.toast.com/toastui/img/tui-image-editor-bi.png',\n 'common.bisize.width': '251px',\n 'common.bisize.height': '21px',\n 'common.backgroundImage': 'none',\n 'common.backgroundColor': '#1e1e1e',\n 'common.border': '0px',\n\n // header\n 'header.backgroundImage': 'none',\n 'header.backgroundColor': 'transparent',\n 'header.border': '0px',\n\n // load button\n 'loadButton.backgroundColor': '#fff',\n 'loadButton.border': '1px solid #ddd',\n 'loadButton.color': '#222',\n 'loadButton.fontFamily': \"'Noto Sans', sans-serif\",\n 'loadButton.fontSize': '12px',\n\n // download button\n 'downloadButton.backgroundColor': '#fdba3b',\n 'downloadButton.border': '1px solid #fdba3b',\n 'downloadButton.color': '#fff',\n 'downloadButton.fontFamily': \"'Noto Sans', sans-serif\",\n 'downloadButton.fontSize': '12px',\n\n // main icons\n 'menu.normalIcon.color': '#8a8a8a',\n 'menu.activeIcon.color': '#555555',\n 'menu.disabledIcon.color': '#434343',\n 'menu.hoverIcon.color': '#e9e9e9',\n\n // submenu icons\n 'submenu.normalIcon.color': '#8a8a8a',\n 'submenu.activeIcon.color': '#e9e9e9',\n\n 'menu.iconSize.width': '24px',\n 'menu.iconSize.height': '24px',\n\n 'submenu.iconSize.width': '32px',\n 'submenu.iconSize.height': '32px',\n\n // submenu primary color\n 'submenu.backgroundColor': '#1e1e1e',\n 'submenu.partition.color': '#3c3c3c',\n\n // submenu labels\n 'submenu.normalLabel.color': '#8a8a8a',\n 'submenu.normalLabel.fontWeight': 'lighter',\n 'submenu.activeLabel.color': '#fff',\n 'submenu.activeLabel.fontWeight': 'lighter',\n\n // checkbox style\n 'checkbox.border': '0px',\n 'checkbox.backgroundColor': '#fff',\n\n // range style\n 'range.pointer.color': '#fff',\n 'range.bar.color': '#666',\n 'range.subbar.color': '#d1d1d1',\n\n 'range.disabledPointer.color': '#414141',\n 'range.disabledBar.color': '#282828',\n 'range.disabledSubbar.color': '#414141',\n\n 'range.value.color': '#fff',\n 'range.value.fontWeight': 'lighter',\n 'range.value.fontSize': '11px',\n 'range.value.border': '1px solid #353535',\n 'range.value.backgroundColor': '#151515',\n 'range.title.color': '#fff',\n 'range.title.fontWeight': 'lighter',\n\n // colorpicker style\n 'colorpicker.button.border': '1px solid #1e1e1e',\n 'colorpicker.title.color': '#fff',\n};\n","module.exports = \"\"","import Colorpicker from '@/ui/tools/colorpicker';\nimport Range from '@/ui/tools/range';\nimport Submenu from '@/ui/submenuBase';\nimport templateHtml from '@/ui/template/submenu/shape';\nimport { toInteger, assignmentForDestroy } from '@/util';\nimport { defaultShapeStrokeValues } from '@/consts';\n\nconst SHAPE_DEFAULT_OPTION = {\n stroke: '#ffbb3b',\n fill: '',\n strokeWidth: 3,\n};\n\n/**\n * Shape ui class\n * @class\n * @ignore\n */\nclass Shape extends Submenu {\n constructor(subMenuElement, { locale, makeSvgIcon, menuBarPosition, usageStatistics }) {\n super(subMenuElement, {\n locale,\n name: 'shape',\n makeSvgIcon,\n menuBarPosition,\n templateHtml,\n usageStatistics,\n });\n this.type = null;\n this.options = SHAPE_DEFAULT_OPTION;\n\n this._els = {\n shapeSelectButton: this.selector('.tie-shape-button'),\n shapeColorButton: this.selector('.tie-shape-color-button'),\n strokeRange: new Range(\n {\n slider: this.selector('.tie-stroke-range'),\n input: this.selector('.tie-stroke-range-value'),\n },\n defaultShapeStrokeValues\n ),\n fillColorpicker: new Colorpicker(\n this.selector('.tie-color-fill'),\n '',\n this.toggleDirection,\n this.usageStatistics\n ),\n strokeColorpicker: new Colorpicker(\n this.selector('.tie-color-stroke'),\n '#ffbb3b',\n this.toggleDirection,\n this.usageStatistics\n ),\n };\n\n this.colorPickerControls.push(this._els.fillColorpicker);\n this.colorPickerControls.push(this._els.strokeColorpicker);\n }\n\n /**\n * Destroys the instance.\n */\n destroy() {\n this._removeEvent();\n this._els.strokeRange.destroy();\n this._els.fillColorpicker.destroy();\n this._els.strokeColorpicker.destroy();\n\n assignmentForDestroy(this);\n }\n\n /**\n * Add event for shape\n * @param {Object} actions - actions for shape\n * @param {Function} actions.changeShape - change shape mode\n * @param {Function} actions.setDrawingShape - set drawing shape\n */\n addEvent(actions) {\n this.eventHandler.shapeTypeSelected = this._changeShapeHandler.bind(this);\n this.actions = actions;\n\n this._els.shapeSelectButton.addEventListener('click', this.eventHandler.shapeTypeSelected);\n this._els.strokeRange.on('change', this._changeStrokeRangeHandler.bind(this));\n this._els.fillColorpicker.on('change', this._changeFillColorHandler.bind(this));\n this._els.strokeColorpicker.on('change', this._changeStrokeColorHandler.bind(this));\n this._els.fillColorpicker.on('changeShow', this.colorPickerChangeShow.bind(this));\n this._els.strokeColorpicker.on('changeShow', this.colorPickerChangeShow.bind(this));\n }\n\n /**\n * Remove event\n * @private\n */\n _removeEvent() {\n this._els.shapeSelectButton.removeEventListener('click', this.eventHandler.shapeTypeSelected);\n this._els.strokeRange.off();\n this._els.fillColorpicker.off();\n this._els.strokeColorpicker.off();\n }\n\n /**\n * Set Shape status\n * @param {Object} options - options of shape status\n * @param {string} strokeWidth - stroke width\n * @param {string} strokeColor - stroke color\n * @param {string} fillColor - fill color\n */\n setShapeStatus({ strokeWidth, strokeColor, fillColor }) {\n this._els.strokeRange.value = strokeWidth;\n this._els.strokeColorpicker.color = strokeColor;\n this._els.fillColorpicker.color = fillColor;\n this.options.stroke = strokeColor;\n this.options.fill = fillColor;\n this.options.strokeWidth = strokeWidth;\n\n this.actions.setDrawingShape(this.type, { strokeWidth });\n }\n\n /**\n * Executed when the menu starts.\n */\n changeStartMode() {\n this.actions.stopDrawingMode();\n }\n\n /**\n * Returns the menu to its default state.\n */\n changeStandbyMode() {\n this.type = null;\n this.actions.changeSelectableAll(true);\n this._els.shapeSelectButton.classList.remove('circle');\n this._els.shapeSelectButton.classList.remove('triangle');\n this._els.shapeSelectButton.classList.remove('rect');\n }\n\n /**\n * set range stroke max value\n * @param {number} maxValue - expect max value for change\n */\n setMaxStrokeValue(maxValue) {\n let strokeMaxValue = maxValue;\n if (strokeMaxValue <= 0) {\n strokeMaxValue = defaultShapeStrokeValues.max;\n }\n this._els.strokeRange.max = strokeMaxValue;\n }\n\n /**\n * Set stroke value\n * @param {number} value - expect value for strokeRange change\n */\n setStrokeValue(value) {\n this._els.strokeRange.value = value;\n this._els.strokeRange.trigger('change');\n }\n\n /**\n * Get stroke value\n * @returns {number} - stroke range value\n */\n getStrokeValue() {\n return this._els.strokeRange.value;\n }\n\n /**\n * Change icon color\n * @param {object} event - add button event object\n * @private\n */\n _changeShapeHandler(event) {\n const button = event.target.closest('.tui-image-editor-button');\n if (button) {\n this.actions.stopDrawingMode();\n this.actions.discardSelection();\n const shapeType = this.getButtonType(button, ['circle', 'triangle', 'rect']);\n\n if (this.type === shapeType) {\n this.changeStandbyMode();\n\n return;\n }\n this.changeStandbyMode();\n this.type = shapeType;\n event.currentTarget.classList.add(shapeType);\n this.actions.changeSelectableAll(false);\n this.actions.modeChange('shape');\n }\n }\n\n /**\n * Change stroke range\n * @param {number} value - stroke range value\n * @param {boolean} isLast - Is last change\n * @private\n */\n _changeStrokeRangeHandler(value, isLast) {\n this.options.strokeWidth = toInteger(value);\n this.actions.changeShape(\n {\n strokeWidth: value,\n },\n !isLast\n );\n\n this.actions.setDrawingShape(this.type, this.options);\n }\n\n /**\n * Change shape color\n * @param {string} color - fill color\n * @private\n */\n _changeFillColorHandler(color) {\n color = color || 'transparent';\n this.options.fill = color;\n this.actions.changeShape({\n fill: color,\n });\n }\n\n /**\n * Change shape stroke color\n * @param {string} color - fill color\n * @private\n */\n _changeStrokeColorHandler(color) {\n color = color || 'transparent';\n this.options.stroke = color;\n this.actions.changeShape({\n stroke: color,\n });\n }\n}\n\nexport default Shape;\n","module.exports = __WEBPACK_EXTERNAL_MODULE__123__;","/**\n * @param {Object} submenuInfo - submenu info for make template\n * @param {Locale} locale - Translate text\n * @param {Function} makeSvgIcon - svg icon generator\n * @returns {string}\n */\nexport default ({ locale, makeSvgIcon }) => `\n
                            \n
                          • \n
                            \n
                            \n ${makeSvgIcon(['normal', 'active'], 'shape-rectangle', true)}\n
                            \n \n
                            \n
                            \n
                            \n ${makeSvgIcon(['normal', 'active'], 'shape-circle', true)}\n
                            \n \n
                            \n
                            \n
                            \n ${makeSvgIcon(['normal', 'active'], 'shape-triangle', true)}\n
                            \n \n
                            \n
                          • \n
                          • \n
                            \n
                          • \n
                          • \n
                            \n
                            \n
                          • \n
                          • \n
                            \n
                          • \n
                          • \n \n
                            \n \n
                          • \n
                          \n`;\n","import snippet from 'tui-code-snippet';\nimport Submenu from '@/ui/submenuBase';\nimport templateHtml from '@/ui/template/submenu/crop';\nimport { assignmentForDestroy } from '@/util';\n\n/**\n * Crop ui class\n * @class\n * @ignore\n */\nclass Crop extends Submenu {\n constructor(subMenuElement, { locale, makeSvgIcon, menuBarPosition, usageStatistics }) {\n super(subMenuElement, {\n locale,\n name: 'crop',\n makeSvgIcon,\n menuBarPosition,\n templateHtml,\n usageStatistics,\n });\n\n this.status = 'active';\n\n this._els = {\n apply: this.selector('.tie-crop-button .apply'),\n cancel: this.selector('.tie-crop-button .cancel'),\n preset: this.selector('.tie-crop-preset-button'),\n };\n\n this.defaultPresetButton = this._els.preset.querySelector('.preset-none');\n }\n\n /**\n * Destroys the instance.\n */\n destroy() {\n this._removeEvent();\n\n assignmentForDestroy(this);\n }\n\n /**\n * Add event for crop\n * @param {Object} actions - actions for crop\n * @param {Function} actions.crop - crop action\n * @param {Function} actions.cancel - cancel action\n * @param {Function} actions.preset - draw rectzone at a predefined ratio\n */\n addEvent(actions) {\n const apply = this._applyEventHandler.bind(this);\n const cancel = this._cancelEventHandler.bind(this);\n const cropzonePreset = this._cropzonePresetEventHandler.bind(this);\n\n this.eventHandler = {\n apply,\n cancel,\n cropzonePreset,\n };\n\n this.actions = actions;\n this._els.apply.addEventListener('click', apply);\n this._els.cancel.addEventListener('click', cancel);\n this._els.preset.addEventListener('click', cropzonePreset);\n }\n\n /**\n * Remove event\n * @private\n */\n _removeEvent() {\n this._els.apply.removeEventListener('click', this.eventHandler.apply);\n this._els.cancel.removeEventListener('click', this.eventHandler.cancel);\n this._els.preset.removeEventListener('click', this.eventHandler.cropzonePreset);\n }\n\n _applyEventHandler() {\n this.actions.crop();\n this._els.apply.classList.remove('active');\n }\n\n _cancelEventHandler() {\n this.actions.cancel();\n this._els.apply.classList.remove('active');\n }\n\n _cropzonePresetEventHandler(event) {\n const button = event.target.closest('.tui-image-editor-button.preset');\n if (button) {\n const [presetType] = button.className.match(/preset-[^\\s]+/);\n\n this._setPresetButtonActive(button);\n this.actions.preset(presetType);\n }\n }\n\n /**\n * Executed when the menu starts.\n */\n changeStartMode() {\n this.actions.modeChange('crop');\n }\n\n /**\n * Returns the menu to its default state.\n */\n changeStandbyMode() {\n this.actions.stopDrawingMode();\n this._setPresetButtonActive();\n }\n\n /**\n * Change apply button status\n * @param {Boolean} enableStatus - apply button status\n */\n changeApplyButtonStatus(enableStatus) {\n if (enableStatus) {\n this._els.apply.classList.add('active');\n } else {\n this._els.apply.classList.remove('active');\n }\n }\n\n /**\n * Set preset button to active status\n * @param {HTMLElement} button - event target element\n * @private\n */\n _setPresetButtonActive(button = this.defaultPresetButton) {\n snippet.forEach([].slice.call(this._els.preset.querySelectorAll('.preset')), (presetButton) => {\n presetButton.classList.remove('active');\n });\n\n if (button) {\n button.classList.add('active');\n }\n }\n}\n\nexport default Crop;\n","/**\n * @param {Object} submenuInfo - submenu info for make template\n * @param {Locale} locale - Translate text\n * @param {Function} makeSvgIcon - svg icon generator\n * @returns {string}\n */\nexport default ({ locale, makeSvgIcon }) => `\n
                            \n
                          • \n
                            \n
                            \n ${makeSvgIcon(['normal', 'active'], 'shape-rectangle', true)}\n
                            \n \n
                            \n
                            \n
                            \n ${makeSvgIcon(['normal', 'active'], 'crop', true)}\n
                            \n \n
                            \n
                            \n
                            \n ${makeSvgIcon(['normal', 'active'], 'crop', true)}\n
                            \n \n
                            \n
                            \n
                            \n ${makeSvgIcon(['normal', 'active'], 'crop', true)}\n
                            \n \n
                            \n
                            \n
                            \n ${makeSvgIcon(['normal', 'active'], 'crop', true)}\n
                            \n \n
                            \n
                            \n
                            \n ${makeSvgIcon(['normal', 'active'], 'crop', true)}\n
                            \n \n
                            \n
                            \n
                            \n ${makeSvgIcon(['normal', 'active'], 'crop', true)}\n
                            \n \n
                            \n
                          • \n
                          • \n
                          • \n
                          • \n
                            \n
                          • \n
                          • \n
                            \n ${makeSvgIcon(['normal', 'active'], 'apply')}\n \n
                            \n
                            \n ${makeSvgIcon(['normal', 'active'], 'cancel')}\n \n
                            \n
                          • \n
                          \n`;\n","import snippet from 'tui-code-snippet';\nimport Submenu from '@/ui/submenuBase';\nimport templateHtml from '@/ui/template/submenu/flip';\nimport { assignmentForDestroy } from '@/util';\n\n/**\n * Flip ui class\n * @class\n * @ignore\n */\nclass Flip extends Submenu {\n constructor(subMenuElement, { locale, makeSvgIcon, menuBarPosition, usageStatistics }) {\n super(subMenuElement, {\n locale,\n name: 'flip',\n makeSvgIcon,\n menuBarPosition,\n templateHtml,\n usageStatistics,\n });\n this.flipStatus = false;\n\n this._els = {\n flipButton: this.selector('.tie-flip-button'),\n };\n }\n\n /**\n * Destroys the instance.\n */\n destroy() {\n this._removeEvent();\n\n assignmentForDestroy(this);\n }\n\n /**\n * Add event for flip\n * @param {Object} actions - actions for flip\n * @param {Function} actions.flip - flip action\n */\n addEvent(actions) {\n this.eventHandler.changeFlip = this._changeFlip.bind(this);\n this._actions = actions;\n this._els.flipButton.addEventListener('click', this.eventHandler.changeFlip);\n }\n\n /**\n * Remove event\n * @private\n */\n _removeEvent() {\n this._els.flipButton.removeEventListener('click', this.eventHandler.changeFlip);\n }\n\n /**\n * change Flip status\n * @param {object} event - change event\n * @private\n */\n _changeFlip(event) {\n const button = event.target.closest('.tui-image-editor-button');\n if (button) {\n const flipType = this.getButtonType(button, ['flipX', 'flipY', 'resetFlip']);\n if (!this.flipStatus && flipType === 'resetFlip') {\n return;\n }\n\n this._actions.flip(flipType).then((flipStatus) => {\n const flipClassList = this._els.flipButton.classList;\n this.flipStatus = false;\n\n flipClassList.remove('resetFlip');\n snippet.forEach(['flipX', 'flipY'], (type) => {\n flipClassList.remove(type);\n if (flipStatus[type]) {\n flipClassList.add(type);\n flipClassList.add('resetFlip');\n this.flipStatus = true;\n }\n });\n });\n }\n }\n}\n\nexport default Flip;\n","/**\n * @param {Object} submenuInfo - submenu info for make template\n * @param {Locale} locale - Translate text\n * @param {Function} makeSvgIcon - svg icon generator\n * @returns {string}\n */\nexport default ({ locale, makeSvgIcon }) => `\n
                            \n
                          • \n
                            \n
                            \n ${makeSvgIcon(['normal', 'active'], 'flip-x', true)}\n
                            \n \n
                            \n
                            \n
                            \n ${makeSvgIcon(['normal', 'active'], 'flip-y', true)}\n
                            \n \n
                            \n
                          • \n
                          • \n
                            \n
                          • \n
                          • \n
                            \n
                            \n ${makeSvgIcon(['normal', 'active'], 'flip-reset', true)}\n
                            \n \n
                            \n
                          • \n
                          \n`;\n","import Range from '@/ui/tools/range';\nimport Submenu from '@/ui/submenuBase';\nimport templateHtml from '@/ui/template/submenu/rotate';\nimport { toInteger, assignmentForDestroy } from '@/util';\nimport { defaultRotateRangeValues } from '@/consts';\n\nconst CLOCKWISE = 30;\nconst COUNTERCLOCKWISE = -30;\n\n/**\n * Rotate ui class\n * @class\n * @ignore\n */\nclass Rotate extends Submenu {\n constructor(subMenuElement, { locale, makeSvgIcon, menuBarPosition, usageStatistics }) {\n super(subMenuElement, {\n locale,\n name: 'rotate',\n makeSvgIcon,\n menuBarPosition,\n templateHtml,\n usageStatistics,\n });\n this._value = 0;\n\n this._els = {\n rotateButton: this.selector('.tie-rotate-button'),\n rotateRange: new Range(\n {\n slider: this.selector('.tie-rotate-range'),\n input: this.selector('.tie-rotate-range-value'),\n },\n defaultRotateRangeValues\n ),\n };\n }\n\n /**\n * Destroys the instance.\n */\n destroy() {\n this._removeEvent();\n this._els.rotateRange.destroy();\n\n assignmentForDestroy(this);\n }\n\n setRangeBarAngle(type, angle) {\n let resultAngle = angle;\n\n if (type === 'rotate') {\n resultAngle = parseInt(this._els.rotateRange.value, 10) + angle;\n }\n\n this._setRangeBarRatio(resultAngle);\n }\n\n _setRangeBarRatio(angle) {\n this._els.rotateRange.value = angle;\n }\n\n /**\n * Add event for rotate\n * @param {Object} actions - actions for crop\n * @param {Function} actions.rotate - rotate action\n * @param {Function} actions.setAngle - set angle action\n */\n addEvent(actions) {\n this.eventHandler.rotationAngleChanged = this._changeRotateForButton.bind(this);\n\n // {rotate, setAngle}\n this.actions = actions;\n this._els.rotateButton.addEventListener('click', this.eventHandler.rotationAngleChanged);\n this._els.rotateRange.on('change', this._changeRotateForRange.bind(this));\n }\n\n /**\n * Remove event\n * @private\n */\n _removeEvent() {\n this._els.rotateButton.removeEventListener('click', this.eventHandler.rotationAngleChanged);\n this._els.rotateRange.off();\n }\n\n /**\n * Change rotate for range\n * @param {number} value - angle value\n * @param {boolean} isLast - Is last change\n * @private\n */\n _changeRotateForRange(value, isLast) {\n const angle = toInteger(value);\n this.actions.setAngle(angle, !isLast);\n this._value = angle;\n }\n\n /**\n * Change rotate for button\n * @param {object} event - add button event object\n * @private\n */\n _changeRotateForButton(event) {\n const button = event.target.closest('.tui-image-editor-button');\n const angle = this._els.rotateRange.value;\n\n if (button) {\n const rotateType = this.getButtonType(button, ['counterclockwise', 'clockwise']);\n const rotateAngle = {\n clockwise: CLOCKWISE,\n counterclockwise: COUNTERCLOCKWISE,\n }[rotateType];\n const newAngle = parseInt(angle, 10) + rotateAngle;\n const isRotatable = newAngle >= -360 && newAngle <= 360;\n if (isRotatable) {\n this.actions.rotate(rotateAngle);\n }\n }\n }\n}\n\nexport default Rotate;\n","/**\n * @param {Object} submenuInfo - submenu info for make template\n * @param {Locale} locale - Translate text\n * @param {Function} makeSvgIcon - svg icon generator\n * @returns {string}\n */\nexport default ({ locale, makeSvgIcon }) => `\n
                            \n
                          • \n
                            \n
                            \n ${makeSvgIcon(['normal', 'active'], 'rotate-clockwise', true)}\n
                            \n \n
                            \n
                            \n
                            \n ${makeSvgIcon(['normal', 'active'], 'rotate-counterclockwise', true)}\n
                            \n \n
                            \n
                          • \n
                          • \n
                            \n
                          • \n
                          • \n \n
                            \n \n
                          • \n
                          \n`;\n","import Range from '@/ui/tools/range';\nimport Colorpicker from '@/ui/tools/colorpicker';\nimport Submenu from '@/ui/submenuBase';\nimport templateHtml from '@/ui/template/submenu/text';\nimport { assignmentForDestroy } from '@/util';\nimport { defaultTextRangeValues } from '@/consts';\n\n/**\n * Crop ui class\n * @class\n * @ignore\n */\nexport default class Text extends Submenu {\n constructor(subMenuElement, { locale, makeSvgIcon, menuBarPosition, usageStatistics }) {\n super(subMenuElement, {\n locale,\n name: 'text',\n makeSvgIcon,\n menuBarPosition,\n templateHtml,\n usageStatistics,\n });\n this.effect = {\n bold: false,\n italic: false,\n underline: false,\n };\n this.align = 'left';\n this._els = {\n textEffectButton: this.selector('.tie-text-effect-button'),\n textAlignButton: this.selector('.tie-text-align-button'),\n textColorpicker: new Colorpicker(\n this.selector('.tie-text-color'),\n '#ffbb3b',\n this.toggleDirection,\n this.usageStatistics\n ),\n textRange: new Range(\n {\n slider: this.selector('.tie-text-range'),\n input: this.selector('.tie-text-range-value'),\n },\n defaultTextRangeValues\n ),\n };\n }\n\n /**\n * Destroys the instance.\n */\n destroy() {\n this._removeEvent();\n this._els.textColorpicker.destroy();\n this._els.textRange.destroy();\n\n assignmentForDestroy(this);\n }\n\n /**\n * Add event for text\n * @param {Object} actions - actions for text\n * @param {Function} actions.changeTextStyle - change text style\n */\n addEvent(actions) {\n const setTextEffect = this._setTextEffectHandler.bind(this);\n const setTextAlign = this._setTextAlignHandler.bind(this);\n\n this.eventHandler = {\n setTextEffect,\n setTextAlign,\n };\n\n this.actions = actions;\n this._els.textEffectButton.addEventListener('click', setTextEffect);\n this._els.textAlignButton.addEventListener('click', setTextAlign);\n this._els.textRange.on('change', this._changeTextRnageHandler.bind(this));\n this._els.textColorpicker.on('change', this._changeColorHandler.bind(this));\n }\n\n /**\n * Remove event\n * @private\n */\n _removeEvent() {\n const { setTextEffect, setTextAlign } = this.eventHandler;\n\n this._els.textEffectButton.removeEventListener('click', setTextEffect);\n this._els.textAlignButton.removeEventListener('click', setTextAlign);\n this._els.textRange.off();\n this._els.textColorpicker.off();\n }\n\n /**\n * Returns the menu to its default state.\n */\n changeStandbyMode() {\n this.actions.stopDrawingMode();\n }\n\n /**\n * Executed when the menu starts.\n */\n changeStartMode() {\n this.actions.modeChange('text');\n }\n\n set textColor(color) {\n this._els.textColorpicker.color = color;\n }\n\n /**\n * Get text color\n * @returns {string} - text color\n */\n get textColor() {\n return this._els.textColorpicker.color;\n }\n\n /**\n * Get text size\n * @returns {string} - text size\n */\n get fontSize() {\n return this._els.textRange.value;\n }\n\n /**\n * Set text size\n * @param {Number} value - text size\n */\n set fontSize(value) {\n this._els.textRange.value = value;\n }\n\n /**\n * get font style\n * @returns {string} - font style\n */\n get fontStyle() {\n return this.effect.italic ? 'italic' : 'normal';\n }\n\n /**\n * get font weight\n * @returns {string} - font weight\n */\n get fontWeight() {\n return this.effect.bold ? 'bold' : 'normal';\n }\n\n /**\n * get text underline text underline\n * @returns {boolean} - true or false\n */\n get underline() {\n return this.effect.underline;\n }\n\n setTextStyleStateOnAction(textStyle = {}) {\n const { fill, fontSize, fontStyle, fontWeight, textDecoration, textAlign } = textStyle;\n\n this.textColor = fill;\n this.fontSize = fontSize;\n this.setEffectState('italic', fontStyle);\n this.setEffectState('bold', fontWeight);\n this.setEffectState('underline', textDecoration);\n this.setAlignState(textAlign);\n }\n\n setEffectState(effectName, value) {\n const effectValue = value === 'italic' || value === 'bold' || value === 'underline';\n const button = this._els.textEffectButton.querySelector(\n `.tui-image-editor-button.${effectName}`\n );\n\n this.effect[effectName] = effectValue;\n\n button.classList[effectValue ? 'add' : 'remove']('active');\n }\n\n setAlignState(value) {\n const button = this._els.textAlignButton;\n button.classList.remove(this.align);\n button.classList.add(value);\n this.align = value;\n }\n\n /**\n * text effect set handler\n * @param {object} event - add button event object\n * @private\n */\n _setTextEffectHandler(event) {\n const button = event.target.closest('.tui-image-editor-button');\n if (button) {\n const [styleType] = button.className.match(/(bold|italic|underline)/);\n const styleObj = {\n bold: { fontWeight: 'bold' },\n italic: { fontStyle: 'italic' },\n underline: { textDecoration: 'underline' },\n }[styleType];\n\n this.effect[styleType] = !this.effect[styleType];\n button.classList.toggle('active');\n this.actions.changeTextStyle(styleObj);\n }\n }\n\n /**\n * text effect set handler\n * @param {object} event - add button event object\n * @private\n */\n _setTextAlignHandler(event) {\n const button = event.target.closest('.tui-image-editor-button');\n if (button) {\n const styleType = this.getButtonType(button, ['left', 'center', 'right']);\n\n event.currentTarget.classList.remove(this.align);\n if (this.align !== styleType) {\n event.currentTarget.classList.add(styleType);\n }\n this.actions.changeTextStyle({ textAlign: styleType });\n\n this.align = styleType;\n }\n }\n\n /**\n * text align set handler\n * @param {number} value - range value\n * @param {boolean} isLast - Is last change\n * @private\n */\n _changeTextRnageHandler(value, isLast) {\n this.actions.changeTextStyle(\n {\n fontSize: value,\n },\n !isLast\n );\n }\n\n /**\n * change color handler\n * @param {string} color - change color string\n * @private\n */\n _changeColorHandler(color) {\n color = color || 'transparent';\n this.actions.changeTextStyle({\n fill: color,\n });\n }\n}\n","/**\n * @param {Object} submenuInfo - submenu info for make template\n * @param {Locale} locale - Translate text\n * @param {Function} makeSvgIcon - svg icon generator\n * @returns {string}\n */\nexport default ({ locale, makeSvgIcon }) => `\n
                            \n
                          • \n
                            \n
                            \n ${makeSvgIcon(['normal', 'active'], 'text-bold', true)}\n
                            \n \n
                            \n
                            \n
                            \n ${makeSvgIcon(['normal', 'active'], 'text-italic', true)}\n
                            \n \n
                            \n
                            \n
                            \n ${makeSvgIcon(['normal', 'active'], 'text-underline', true)}\n
                            \n \n
                            \n
                          • \n
                          • \n
                            \n
                          • \n
                          • \n
                            \n
                            \n ${makeSvgIcon(['normal', 'active'], 'text-align-left', true)}\n
                            \n \n
                            \n
                            \n
                            \n ${makeSvgIcon(['normal', 'active'], 'text-align-center', true)}\n
                            \n \n
                            \n
                            \n
                            \n ${makeSvgIcon(['normal', 'active'], 'text-align-right', true)}\n
                            \n \n
                            \n
                          • \n
                          • \n
                            \n
                          • \n
                          • \n
                            \n
                          • \n
                          • \n
                            \n
                          • \n
                          • \n \n
                            \n \n
                          • \n
                          \n`;\n","import Submenu from '@/ui/submenuBase';\nimport templateHtml from '@/ui/template/submenu/mask';\nimport { assignmentForDestroy, isSupportFileApi } from '@/util';\n\n/**\n * Mask ui class\n * @class\n * @ignore\n */\nclass Mask extends Submenu {\n constructor(subMenuElement, { locale, makeSvgIcon, menuBarPosition, usageStatistics }) {\n super(subMenuElement, {\n locale,\n name: 'mask',\n makeSvgIcon,\n menuBarPosition,\n templateHtml,\n usageStatistics,\n });\n\n this._els = {\n applyButton: this.selector('.tie-mask-apply'),\n maskImageButton: this.selector('.tie-mask-image-file'),\n };\n }\n\n /**\n * Destroys the instance.\n */\n destroy() {\n this._removeEvent();\n\n assignmentForDestroy(this);\n }\n\n /**\n * Add event for mask\n * @param {Object} actions - actions for crop\n * @param {Function} actions.loadImageFromURL - load image action\n * @param {Function} actions.applyFilter - apply filter action\n */\n addEvent(actions) {\n const loadMaskFile = this._loadMaskFile.bind(this);\n const applyMask = this._applyMask.bind(this);\n\n this.eventHandler = {\n loadMaskFile,\n applyMask,\n };\n\n this.actions = actions;\n this._els.maskImageButton.addEventListener('change', loadMaskFile);\n this._els.applyButton.addEventListener('click', applyMask);\n }\n\n /**\n * Remove event\n * @private\n */\n _removeEvent() {\n this._els.maskImageButton.removeEventListener('change', this.eventHandler.loadMaskFile);\n this._els.applyButton.removeEventListener('click', this.eventHandler.applyMask);\n }\n\n /**\n * Apply mask\n * @private\n */\n _applyMask() {\n this.actions.applyFilter();\n this._els.applyButton.classList.remove('active');\n }\n\n /**\n * Load mask file\n * @param {object} event - File change event object\n * @private\n */\n _loadMaskFile(event) {\n let imgUrl;\n\n if (!isSupportFileApi()) {\n alert('This browser does not support file-api');\n }\n\n const [file] = event.target.files;\n\n if (file) {\n imgUrl = URL.createObjectURL(file);\n this.actions.loadImageFromURL(imgUrl, file);\n this._els.applyButton.classList.add('active');\n }\n }\n}\n\nexport default Mask;\n","/**\n * @param {Object} submenuInfo - submenu info for make template\n * @param {Locale} locale - Translate text\n * @param {Function} makeSvgIcon - svg icon generator\n * @returns {string}\n */\nexport default ({ locale, makeSvgIcon }) => `\n
                            \n
                          • \n
                            \n
                            \n \n ${makeSvgIcon(['normal', 'active'], 'mask-load', true)}\n
                            \n \n
                            \n
                          • \n
                          • \n
                            \n
                          • \n
                          • \n
                            \n ${makeSvgIcon(['normal', 'active'], 'apply')}\n \n
                            \n
                          • \n
                          \n`;\n","import snippet from 'tui-code-snippet';\nimport Colorpicker from '@/ui/tools/colorpicker';\nimport Submenu from '@/ui/submenuBase';\nimport templateHtml from '@/ui/template/submenu/icon';\nimport { isSupportFileApi, assignmentForDestroy } from '@/util';\nimport { defaultIconPath } from '@/consts';\n\n/**\n * Icon ui class\n * @class\n * @ignore\n */\nclass Icon extends Submenu {\n constructor(subMenuElement, { locale, makeSvgIcon, menuBarPosition, usageStatistics }) {\n super(subMenuElement, {\n locale,\n name: 'icon',\n makeSvgIcon,\n menuBarPosition,\n templateHtml,\n usageStatistics,\n });\n\n this.iconType = null;\n this._iconMap = {};\n\n this._els = {\n registerIconButton: this.selector('.tie-icon-image-file'),\n addIconButton: this.selector('.tie-icon-add-button'),\n iconColorpicker: new Colorpicker(\n this.selector('.tie-icon-color'),\n '#ffbb3b',\n this.toggleDirection,\n this.usageStatistics\n ),\n };\n }\n\n /**\n * Destroys the instance.\n */\n destroy() {\n this._removeEvent();\n this._els.iconColorpicker.destroy();\n\n assignmentForDestroy(this);\n }\n\n /**\n * Add event for icon\n * @param {Object} actions - actions for icon\n * @param {Function} actions.registerCustomIcon - register icon\n * @param {Function} actions.addIcon - add icon\n * @param {Function} actions.changeColor - change icon color\n */\n addEvent(actions) {\n const registerIcon = this._registerIconHandler.bind(this);\n const addIcon = this._addIconHandler.bind(this);\n\n this.eventHandler = {\n registerIcon,\n addIcon,\n };\n\n this.actions = actions;\n this._els.iconColorpicker.on('change', this._changeColorHandler.bind(this));\n this._els.registerIconButton.addEventListener('change', registerIcon);\n this._els.addIconButton.addEventListener('click', addIcon);\n }\n\n /**\n * Remove event\n * @private\n */\n _removeEvent() {\n this._els.iconColorpicker.off();\n this._els.registerIconButton.removeEventListener('change', this.eventHandler.registerIcon);\n this._els.addIconButton.removeEventListener('click', this.eventHandler.addIcon);\n }\n\n /**\n * Clear icon type\n */\n clearIconType() {\n this._els.addIconButton.classList.remove(this.iconType);\n this.iconType = null;\n }\n\n /**\n * Register default icon\n */\n registerDefaultIcon() {\n snippet.forEach(defaultIconPath, (path, type) => {\n this.actions.registerDefaultIcons(type, path);\n });\n }\n\n /**\n * Set icon picker color\n * @param {string} iconColor - rgb color string\n */\n setIconPickerColor(iconColor) {\n this._els.iconColorpicker.color = iconColor;\n }\n\n /**\n * Returns the menu to its default state.\n */\n changeStandbyMode() {\n this.clearIconType();\n this.actions.cancelAddIcon();\n }\n\n /**\n * Change icon color\n * @param {string} color - color for change\n * @private\n */\n _changeColorHandler(color) {\n color = color || 'transparent';\n this.actions.changeColor(color);\n }\n\n /**\n * Change icon color\n * @param {object} event - add button event object\n * @private\n */\n _addIconHandler(event) {\n const button = event.target.closest('.tui-image-editor-button');\n\n if (button) {\n const iconType = button.getAttribute('data-icontype');\n const iconColor = this._els.iconColorpicker.color;\n this.actions.discardSelection();\n this.actions.changeSelectableAll(false);\n this._els.addIconButton.classList.remove(this.iconType);\n this._els.addIconButton.classList.add(iconType);\n\n if (this.iconType === iconType) {\n this.changeStandbyMode();\n } else {\n this.actions.addIcon(iconType, iconColor);\n this.iconType = iconType;\n }\n }\n }\n\n /**\n * register icon\n * @param {object} event - file change event object\n * @private\n */\n _registerIconHandler(event) {\n let imgUrl;\n\n if (!isSupportFileApi) {\n alert('This browser does not support file-api');\n }\n\n const [file] = event.target.files;\n\n if (file) {\n imgUrl = URL.createObjectURL(file);\n this.actions.registerCustomIcon(imgUrl, file);\n }\n }\n}\n\nexport default Icon;\n","/**\n * @param {Object} submenuInfo - submenu info for make template\n * @param {Locale} locale - Translate text\n * @param {Function} makeSvgIcon - svg icon generator\n * @returns {string}\n */\nexport default ({ locale, makeSvgIcon }) => `\n
                            \n
                          • \n
                            \n
                            \n ${makeSvgIcon(['normal', 'active'], 'icon-arrow', true)}\n
                            \n \n
                            \n
                            \n
                            \n ${makeSvgIcon(['normal', 'active'], 'icon-arrow-2', true)}\n
                            \n \n
                            \n
                            \n
                            \n ${makeSvgIcon(['normal', 'active'], 'icon-arrow-3', true)}\n
                            \n \n
                            \n
                            \n
                            \n ${makeSvgIcon(['normal', 'active'], 'icon-star', true)}\n
                            \n \n
                            \n
                            \n
                            \n ${makeSvgIcon(['normal', 'active'], 'icon-star-2', true)}\n
                            \n \n
                            \n\n
                            \n
                            \n ${makeSvgIcon(['normal', 'active'], 'icon-polygon', true)}\n
                            \n \n
                            \n\n
                            \n
                            \n ${makeSvgIcon(['normal', 'active'], 'icon-location', true)}\n
                            \n \n
                            \n\n
                            \n
                            \n ${makeSvgIcon(['normal', 'active'], 'icon-heart', true)}\n
                            \n \n
                            \n\n
                            \n
                            \n ${makeSvgIcon(['normal', 'active'], 'icon-bubble', true)}\n
                            \n \n
                            \n
                          • \n
                          • \n
                            \n
                          • \n
                          • \n
                            \n
                            \n \n ${makeSvgIcon(['normal', 'active'], 'icon-load', true)}\n
                            \n \n
                            \n
                          • \n
                          • \n
                            \n
                          • \n
                          • \n
                            \n
                          • \n
                          \n`;\n","import Colorpicker from '@/ui/tools/colorpicker';\nimport Range from '@/ui/tools/range';\nimport Submenu from '@/ui/submenuBase';\nimport templateHtml from '@/ui/template/submenu/draw';\nimport { assignmentForDestroy, getRgb } from '@/util';\nimport { defaultDrawRangeValues } from '@/consts';\n\nconst DRAW_OPACITY = 0.7;\n\n/**\n * Draw ui class\n * @class\n * @ignore\n */\nclass Draw extends Submenu {\n constructor(subMenuElement, { locale, makeSvgIcon, menuBarPosition, usageStatistics }) {\n super(subMenuElement, {\n locale,\n name: 'draw',\n makeSvgIcon,\n menuBarPosition,\n templateHtml,\n usageStatistics,\n });\n\n this._els = {\n lineSelectButton: this.selector('.tie-draw-line-select-button'),\n drawColorPicker: new Colorpicker(\n this.selector('.tie-draw-color'),\n '#00a9ff',\n this.toggleDirection,\n this.usageStatistics\n ),\n drawRange: new Range(\n {\n slider: this.selector('.tie-draw-range'),\n input: this.selector('.tie-draw-range-value'),\n },\n defaultDrawRangeValues\n ),\n };\n\n this.type = null;\n this.color = this._els.drawColorPicker.color;\n this.width = this._els.drawRange.value;\n }\n\n /**\n * Destroys the instance.\n */\n destroy() {\n this._removeEvent();\n this._els.drawColorPicker.destroy();\n this._els.drawRange.destroy();\n\n assignmentForDestroy(this);\n }\n\n /**\n * Add event for draw\n * @param {Object} actions - actions for crop\n * @param {Function} actions.setDrawMode - set draw mode\n */\n addEvent(actions) {\n this.eventHandler.changeDrawType = this._changeDrawType.bind(this);\n\n this.actions = actions;\n this._els.lineSelectButton.addEventListener('click', this.eventHandler.changeDrawType);\n this._els.drawColorPicker.on('change', this._changeDrawColor.bind(this));\n this._els.drawRange.on('change', this._changeDrawRange.bind(this));\n }\n\n /**\n * Remove event\n * @private\n */\n _removeEvent() {\n this._els.lineSelectButton.removeEventListener('click', this.eventHandler.changeDrawType);\n this._els.drawColorPicker.off();\n this._els.drawRange.off();\n }\n\n /**\n * set draw mode - action runner\n */\n setDrawMode() {\n this.actions.setDrawMode(this.type, {\n width: this.width,\n color: getRgb(this.color, DRAW_OPACITY),\n });\n }\n\n /**\n * Returns the menu to its default state.\n */\n changeStandbyMode() {\n this.type = null;\n this.actions.stopDrawingMode();\n this.actions.changeSelectableAll(true);\n this._els.lineSelectButton.classList.remove('free');\n this._els.lineSelectButton.classList.remove('line');\n }\n\n /**\n * Executed when the menu starts.\n */\n changeStartMode() {\n this.type = 'free';\n this._els.lineSelectButton.classList.add('free');\n this.setDrawMode();\n }\n\n /**\n * Change draw type event\n * @param {object} event - line select event\n * @private\n */\n _changeDrawType(event) {\n const button = event.target.closest('.tui-image-editor-button');\n if (button) {\n const lineType = this.getButtonType(button, ['free', 'line']);\n this.actions.discardSelection();\n\n if (this.type === lineType) {\n this.changeStandbyMode();\n\n return;\n }\n\n this.changeStandbyMode();\n this.type = lineType;\n this._els.lineSelectButton.classList.add(lineType);\n this.setDrawMode();\n }\n }\n\n /**\n * Change drawing color\n * @param {string} color - select drawing color\n * @private\n */\n _changeDrawColor(color) {\n this.color = color || 'transparent';\n if (!this.type) {\n this.changeStartMode();\n } else {\n this.setDrawMode();\n }\n }\n\n /**\n * Change drawing Range\n * @param {number} value - select drawing range\n * @private\n */\n _changeDrawRange(value) {\n this.width = value;\n if (!this.type) {\n this.changeStartMode();\n } else {\n this.setDrawMode();\n }\n }\n}\n\nexport default Draw;\n","/**\n * @param {Object} submenuInfo - submenu info for make template\n * @param {Locale} locale - Translate text\n * @param {Function} makeSvgIcon - svg icon generator\n * @returns {string}\n */\nexport default ({ locale, makeSvgIcon }) => `\n
                            \n
                          • \n
                            \n
                            \n ${makeSvgIcon(['normal', 'active'], 'draw-free', true)}\n
                            \n \n
                            \n
                            \n
                            \n ${makeSvgIcon(['normal', 'active'], 'draw-line', true)}\n
                            \n \n
                            \n
                          • \n
                          • \n
                            \n
                          • \n
                          • \n
                            \n
                          • \n
                          • \n
                            \n
                          • \n
                          • \n \n
                            \n \n
                          • \n
                          \n`;\n","import snippet from 'tui-code-snippet';\nimport Colorpicker from '@/ui/tools/colorpicker';\nimport Range from '@/ui/tools/range';\nimport Submenu from '@/ui/submenuBase';\nimport templateHtml from '@/ui/template/submenu/filter';\nimport { toInteger, toCamelCase, assignmentForDestroy } from '@/util';\nimport { defaultFilterRangeValues as FILTER_RANGE } from '@/consts';\n\nconst PICKER_CONTROL_HEIGHT = '130px';\nconst BLEND_OPTIONS = ['add', 'diff', 'subtract', 'multiply', 'screen', 'lighten', 'darken'];\nconst FILTER_OPTIONS = [\n 'grayscale',\n 'invert',\n 'sepia',\n 'vintage',\n 'blur',\n 'sharpen',\n 'emboss',\n 'remove-white',\n 'brightness',\n 'noise',\n 'pixelate',\n 'color-filter',\n 'tint',\n 'multiply',\n 'blend',\n];\nconst filterNameMap = {\n grayscale: 'grayscale',\n invert: 'invert',\n sepia: 'sepia',\n blur: 'blur',\n sharpen: 'sharpen',\n emboss: 'emboss',\n removeWhite: 'removeColor',\n brightness: 'brightness',\n contrast: 'contrast',\n saturation: 'saturation',\n vintage: 'vintage',\n polaroid: 'polaroid',\n noise: 'noise',\n pixelate: 'pixelate',\n colorFilter: 'removeColor',\n tint: 'blendColor',\n multiply: 'blendColor',\n blend: 'blendColor',\n hue: 'hue',\n gamma: 'gamma',\n};\nconst RANGE_INSTANCE_NAMES = [\n 'removewhiteDistanceRange',\n 'colorfilterThresholdRange',\n 'pixelateRange',\n 'noiseRange',\n 'brightnessRange',\n 'tintOpacity',\n];\nconst COLORPICKER_INSTANCE_NAMES = ['filterBlendColor', 'filterMultiplyColor', 'filterTintColor'];\n\n/**\n * Filter ui class\n * @class\n * @ignore\n */\nclass Filter extends Submenu {\n constructor(subMenuElement, { locale, menuBarPosition, usageStatistics }) {\n super(subMenuElement, {\n locale,\n name: 'filter',\n menuBarPosition,\n templateHtml,\n usageStatistics,\n });\n\n this.selectBoxShow = false;\n\n this.checkedMap = {};\n this._makeControlElement();\n }\n\n /**\n * Destroys the instance.\n */\n destroy() {\n this._removeEvent();\n this._destroyToolInstance();\n\n assignmentForDestroy(this);\n }\n\n /**\n * Remove event for filter\n */\n _removeEvent() {\n snippet.forEach(FILTER_OPTIONS, (filter) => {\n const filterCheckElement = this.selector(`.tie-${filter}`);\n const filterNameCamelCase = toCamelCase(filter);\n\n filterCheckElement.removeEventListener('change', this.eventHandler[filterNameCamelCase]);\n });\n\n snippet.forEach([...RANGE_INSTANCE_NAMES, ...COLORPICKER_INSTANCE_NAMES], (instanceName) => {\n this._els[instanceName].off();\n });\n\n this._els.blendType.removeEventListener('change', this.eventHandler.changeBlendFilter);\n this._els.blendType.removeEventListener('click', this.eventHandler.changeBlendFilter);\n }\n\n _destroyToolInstance() {\n snippet.forEach([...RANGE_INSTANCE_NAMES, ...COLORPICKER_INSTANCE_NAMES], (instanceName) => {\n this._els[instanceName].destroy();\n });\n }\n\n /**\n * Add event for filter\n * @param {Object} actions - actions for crop\n * @param {Function} actions.applyFilter - apply filter option\n */\n addEvent({ applyFilter }) {\n const changeFilterState = (filterName) =>\n this._changeFilterState.bind(this, applyFilter, filterName);\n const changeFilterStateForRange = (filterName) => (value, isLast) =>\n this._changeFilterState(applyFilter, filterName, isLast);\n\n this.eventHandler = {\n changeBlendFilter: changeFilterState('blend'),\n blandTypeClick: (event) => event.stopPropagation(),\n };\n\n snippet.forEach(FILTER_OPTIONS, (filter) => {\n const filterCheckElement = this.selector(`.tie-${filter}`);\n const filterNameCamelCase = toCamelCase(filter);\n this.checkedMap[filterNameCamelCase] = filterCheckElement;\n this.eventHandler[filterNameCamelCase] = changeFilterState(filterNameCamelCase);\n\n filterCheckElement.addEventListener('change', this.eventHandler[filterNameCamelCase]);\n });\n\n this._els.removewhiteDistanceRange.on('change', changeFilterStateForRange('removeWhite'));\n this._els.colorfilterThresholdRange.on('change', changeFilterStateForRange('colorFilter'));\n this._els.pixelateRange.on('change', changeFilterStateForRange('pixelate'));\n this._els.noiseRange.on('change', changeFilterStateForRange('noise'));\n this._els.brightnessRange.on('change', changeFilterStateForRange('brightness'));\n\n this._els.filterBlendColor.on('change', this.eventHandler.changeBlendFilter);\n this._els.filterMultiplyColor.on('change', changeFilterState('multiply'));\n this._els.filterTintColor.on('change', changeFilterState('tint'));\n this._els.tintOpacity.on('change', changeFilterStateForRange('tint'));\n this._els.filterMultiplyColor.on('changeShow', this.colorPickerChangeShow.bind(this));\n this._els.filterTintColor.on('changeShow', this.colorPickerChangeShow.bind(this));\n this._els.filterBlendColor.on('changeShow', this.colorPickerChangeShow.bind(this));\n\n this._els.blendType.addEventListener('change', this.eventHandler.changeBlendFilter);\n this._els.blendType.addEventListener('click', this.eventHandler.blandTypeClick);\n }\n\n /**\n * Set filter for undo changed\n * @param {Object} changedFilterInfos - changed command infos\n * @param {string} type - filter type\n * @param {string} action - add or remove\n * @param {Object} options - filter options\n */\n setFilterState(changedFilterInfos) {\n const { type, options, action } = changedFilterInfos;\n const filterName = this._getFilterNameFromOptions(type, options);\n const isRemove = action === 'remove';\n\n if (!isRemove) {\n this._setFilterState(filterName, options);\n }\n\n this.checkedMap[filterName].checked = !isRemove;\n }\n\n /**\n * Set filter for undo changed\n * @param {string} filterName - filter name\n * @param {Object} options - filter options\n * @private\n */\n // eslint-disable-next-line complexity\n _setFilterState(filterName, options) {\n if (filterName === 'colorFilter') {\n this._els.colorfilterThresholdRange.value = options.distance;\n } else if (filterName === 'removeWhite') {\n this._els.removewhiteDistanceRange.value = options.distance;\n } else if (filterName === 'pixelate') {\n this._els.pixelateRange.value = options.blocksize;\n } else if (filterName === 'brightness') {\n this._els.brightnessRange.value = options.brightness;\n } else if (filterName === 'noise') {\n this._els.noiseRange.value = options.noise;\n } else if (filterName === 'tint') {\n this._els.tintOpacity.value = options.alpha;\n this._els.filterTintColor.color = options.color;\n } else if (filterName === 'blend') {\n this._els.filterBlendColor.color = options.color;\n } else if (filterName === 'multiply') {\n this._els.filterMultiplyColor.color = options.color;\n }\n }\n\n /**\n * Get filter name\n * @param {string} type - filter type\n * @param {Object} options - filter options\n * @returns {string} filter name\n * @private\n */\n _getFilterNameFromOptions(type, options) {\n let filterName = type;\n\n if (type === 'removeColor') {\n filterName = snippet.isExisty(options.useAlpha) ? 'removeWhite' : 'colorFilter';\n } else if (type === 'blendColor') {\n filterName = {\n add: 'blend',\n multiply: 'multiply',\n tint: 'tint',\n }[options.mode];\n }\n\n return filterName;\n }\n\n /**\n * Add event for filter\n * @param {Function} applyFilter - actions for firter\n * @param {string} filterName - filter name\n * @param {boolean} [isLast] - Is last change\n */\n _changeFilterState(applyFilter, filterName, isLast = true) {\n const apply = this.checkedMap[filterName].checked;\n const type = filterNameMap[filterName];\n\n const checkboxGroup = this.checkedMap[filterName].closest('.tui-image-editor-checkbox-group');\n if (checkboxGroup) {\n if (apply) {\n checkboxGroup.classList.remove('tui-image-editor-disabled');\n } else {\n checkboxGroup.classList.add('tui-image-editor-disabled');\n }\n }\n applyFilter(apply, type, this._getFilterOption(filterName), !isLast);\n }\n\n /**\n * Get filter option\n * @param {String} type - filter type\n * @returns {Object} filter option object\n * @private\n */\n // eslint-disable-next-line complexity\n _getFilterOption(type) {\n const option = {};\n switch (type) {\n case 'removeWhite':\n option.color = '#FFFFFF';\n option.useAlpha = false;\n option.distance = parseFloat(this._els.removewhiteDistanceRange.value);\n break;\n case 'colorFilter':\n option.color = '#FFFFFF';\n option.distance = parseFloat(this._els.colorfilterThresholdRange.value);\n break;\n case 'pixelate':\n option.blocksize = toInteger(this._els.pixelateRange.value);\n break;\n case 'noise':\n option.noise = toInteger(this._els.noiseRange.value);\n break;\n case 'brightness':\n option.brightness = parseFloat(this._els.brightnessRange.value);\n break;\n case 'blend':\n option.mode = 'add';\n option.color = this._els.filterBlendColor.color;\n option.mode = this._els.blendType.value;\n break;\n case 'multiply':\n option.mode = 'multiply';\n option.color = this._els.filterMultiplyColor.color;\n break;\n case 'tint':\n option.mode = 'tint';\n option.color = this._els.filterTintColor.color;\n option.alpha = this._els.tintOpacity.value;\n break;\n case 'blur':\n option.blur = this._els.blurRange.value;\n break;\n default:\n break;\n }\n\n return option;\n }\n\n /**\n * Make submenu range and colorpicker control\n * @private\n */\n _makeControlElement() {\n this._els = {\n removewhiteDistanceRange: new Range(\n { slider: this.selector('.tie-removewhite-distance-range') },\n FILTER_RANGE.removewhiteDistanceRange\n ),\n brightnessRange: new Range(\n { slider: this.selector('.tie-brightness-range') },\n FILTER_RANGE.brightnessRange\n ),\n noiseRange: new Range({ slider: this.selector('.tie-noise-range') }, FILTER_RANGE.noiseRange),\n pixelateRange: new Range(\n { slider: this.selector('.tie-pixelate-range') },\n FILTER_RANGE.pixelateRange\n ),\n colorfilterThresholdRange: new Range(\n { slider: this.selector('.tie-colorfilter-threshold-range') },\n FILTER_RANGE.colorfilterThresholdRange\n ),\n filterTintColor: new Colorpicker(\n this.selector('.tie-filter-tint-color'),\n '#03bd9e',\n this.toggleDirection,\n this.usageStatistics\n ),\n filterMultiplyColor: new Colorpicker(\n this.selector('.tie-filter-multiply-color'),\n '#515ce6',\n this.toggleDirection,\n this.usageStatistics\n ),\n filterBlendColor: new Colorpicker(\n this.selector('.tie-filter-blend-color'),\n '#ffbb3b',\n this.toggleDirection,\n this.usageStatistics\n ),\n blurRange: FILTER_RANGE.blurFilterRange,\n };\n\n this._els.tintOpacity = this._pickerWithRange(this._els.filterTintColor.pickerControl);\n this._els.blendType = this._pickerWithSelectbox(this._els.filterBlendColor.pickerControl);\n\n this.colorPickerControls.push(this._els.filterTintColor);\n this.colorPickerControls.push(this._els.filterMultiplyColor);\n this.colorPickerControls.push(this._els.filterBlendColor);\n }\n\n /**\n * Make submenu control for picker & range mixin\n * @param {HTMLElement} pickerControl - pickerControl dom element\n * @returns {Range}\n * @private\n */\n _pickerWithRange(pickerControl) {\n const rangeWrap = document.createElement('div');\n const rangeLabel = document.createElement('label');\n const slider = document.createElement('div');\n\n slider.id = 'tie-filter-tint-opacity';\n rangeLabel.innerHTML = 'Opacity';\n rangeWrap.appendChild(rangeLabel);\n rangeWrap.appendChild(slider);\n pickerControl.appendChild(rangeWrap);\n pickerControl.style.height = PICKER_CONTROL_HEIGHT;\n\n return new Range({ slider }, FILTER_RANGE.tintOpacityRange);\n }\n\n /**\n * Make submenu control for picker & selectbox\n * @param {HTMLElement} pickerControl - pickerControl dom element\n * @returns {HTMLElement}\n * @private\n */\n _pickerWithSelectbox(pickerControl) {\n const selectlistWrap = document.createElement('div');\n const selectlist = document.createElement('select');\n const optionlist = document.createElement('ul');\n\n selectlistWrap.className = 'tui-image-editor-selectlist-wrap';\n optionlist.className = 'tui-image-editor-selectlist';\n\n selectlistWrap.appendChild(selectlist);\n selectlistWrap.appendChild(optionlist);\n\n this._makeSelectOptionList(selectlist);\n\n pickerControl.appendChild(selectlistWrap);\n pickerControl.style.height = PICKER_CONTROL_HEIGHT;\n\n this._drawSelectOptionList(selectlist, optionlist);\n this._pickerWithSelectboxForAddEvent(selectlist, optionlist);\n\n return selectlist;\n }\n\n /**\n * Make selectbox option list custom style\n * @param {HTMLElement} selectlist - selectbox element\n * @param {HTMLElement} optionlist - custom option list item element\n * @private\n */\n _drawSelectOptionList(selectlist, optionlist) {\n const options = selectlist.querySelectorAll('option');\n snippet.forEach(options, (option) => {\n const optionElement = document.createElement('li');\n optionElement.innerHTML = option.innerHTML;\n optionElement.setAttribute('data-item', option.value);\n optionlist.appendChild(optionElement);\n });\n }\n\n /**\n * custom selectbox custom event\n * @param {HTMLElement} selectlist - selectbox element\n * @param {HTMLElement} optionlist - custom option list item element\n * @private\n */\n _pickerWithSelectboxForAddEvent(selectlist, optionlist) {\n optionlist.addEventListener('click', (event) => {\n const optionValue = event.target.getAttribute('data-item');\n const fireEvent = document.createEvent('HTMLEvents');\n\n selectlist.querySelector(`[value=\"${optionValue}\"]`).selected = true;\n fireEvent.initEvent('change', true, true);\n\n selectlist.dispatchEvent(fireEvent);\n\n this.selectBoxShow = false;\n optionlist.style.display = 'none';\n });\n\n selectlist.addEventListener('mousedown', (event) => {\n event.preventDefault();\n this.selectBoxShow = !this.selectBoxShow;\n optionlist.style.display = this.selectBoxShow ? 'block' : 'none';\n optionlist.setAttribute('data-selectitem', selectlist.value);\n optionlist.querySelector(`[data-item='${selectlist.value}']`).classList.add('active');\n });\n }\n\n /**\n * Make option list for select control\n * @param {HTMLElement} selectlist - blend option select list element\n * @private\n */\n _makeSelectOptionList(selectlist) {\n snippet.forEach(BLEND_OPTIONS, (option) => {\n const selectOption = document.createElement('option');\n selectOption.setAttribute('value', option);\n selectOption.innerHTML = option.replace(/^[a-z]/, ($0) => $0.toUpperCase());\n selectlist.appendChild(selectOption);\n });\n }\n}\n\nexport default Filter;\n","/**\n * @param {Locale} locale - Translate text\n * @returns {string}\n */\nexport default ({ locale }) => `\n
                            \n
                          • \n
                            \n
                            \n \n
                            \n
                            \n \n
                            \n
                            \n \n
                            \n
                            \n \n
                            \n
                            \n \n
                            \n
                            \n \n
                            \n
                            \n \n
                            \n
                            \n
                          • \n
                          • \n
                            \n
                          • \n
                          • \n
                            \n
                            \n
                            \n \n
                            \n
                            \n
                            \n \n
                            \n
                            \n
                            \n
                            \n
                            \n \n
                            \n
                            \n
                            \n
                            \n
                            \n
                            \n
                            \n \n
                            \n
                            \n
                            \n
                            \n
                            \n
                          • \n
                          • \n
                            \n
                          • \n
                          • \n
                            \n
                            \n \n
                            \n
                            \n
                            \n
                            \n
                            \n
                            \n
                            \n
                            \n \n
                            \n
                            \n
                            \n \n
                            \n
                            \n
                            \n
                          • \n
                          • \n
                            \n
                          • \n
                          • \n
                            \n
                            \n
                            \n \n
                            \n
                            \n
                            \n
                            \n
                            \n \n
                            \n
                            \n
                            \n
                            \n
                            \n \n
                            \n
                            \n
                          • \n
                          \n`;\n","import Panel from '@/ui/panelMenu';\nimport templateHtml from '@/ui/template/submenu/history';\nimport { assignmentForDestroy } from '@/util';\n\nconst historyClassName = 'history-item';\nconst selectedClassName = 'selected-item';\nconst disabledClassName = 'disabled-item';\n\n/**\n * History ui class\n * @class\n * @ignore\n */\nclass History extends Panel {\n constructor(menuElement, { locale, makeSvgIcon }) {\n super(menuElement, { name: 'history' });\n menuElement.classList.add('enabled');\n\n this.locale = locale;\n this.makeSvgIcon = makeSvgIcon;\n this._eventHandler = {};\n this._historyIndex = this.getListLength();\n }\n\n /**\n * Add history\n * @param {string} name - name of history\n * @param {?string} detail - detail information of history\n */\n add({ name, detail }) {\n if (this._hasDisabledItem()) {\n this.deleteListItemElement(this._historyIndex + 1, this.getListLength());\n }\n\n const html = templateHtml({ locale: this.locale, makeSvgIcon: this.makeSvgIcon, name, detail });\n const item = this.makeListItemElement(html);\n\n this.pushListItemElement(item);\n this._historyIndex = this.getListLength() - 1;\n this._selectItem(this._historyIndex);\n }\n\n /**\n * Init history\n */\n init() {\n this.deleteListItemElement(1, this.getListLength());\n this._historyIndex = 0;\n this._selectItem(this._historyIndex);\n }\n\n /**\n * Clear history\n */\n clear() {\n this.deleteListItemElement(0, this.getListLength());\n this._historyIndex = -1;\n }\n\n /**\n * Select previous history of current selected history\n */\n prev() {\n this._historyIndex -= 1;\n this._selectItem(this._historyIndex);\n }\n\n /**\n * Select next history of current selected history\n */\n next() {\n this._historyIndex += 1;\n this._selectItem(this._historyIndex);\n }\n\n /**\n * Whether history menu has disabled item\n * @returns {boolean}\n */\n _hasDisabledItem() {\n return this.getListLength() - 1 > this._historyIndex;\n }\n\n /**\n * Add history menu event\n * @private\n */\n _addHistoryEventListener() {\n this._eventHandler.history = (event) => this._clickHistoryItem(event);\n this.listElement.addEventListener('click', this._eventHandler.history);\n }\n\n /**\n * Remove history menu event\n * @private\n */\n _removeHistoryEventListener() {\n this.listElement.removeEventListener('click', this._eventHandler.history);\n }\n\n /**\n * onClick history menu event listener\n * @param {object} event - event object\n * @private\n */\n _clickHistoryItem(event) {\n const { target } = event;\n const item = target.closest(`.${historyClassName}`);\n\n if (!item) {\n return;\n }\n\n const index = Number.parseInt(item.getAttribute('data-index'), 10);\n\n if (index !== this._historyIndex) {\n const count = Math.abs(index - this._historyIndex);\n\n if (index < this._historyIndex) {\n this._actions.undo(count);\n } else {\n this._actions.redo(count);\n }\n }\n }\n\n /**\n * Change item's state to selected state\n * @param {number} index - index of selected item\n */\n _selectItem(index) {\n for (let i = 0; i < this.getListLength(); i += 1) {\n this.removeClass(i, selectedClassName);\n this.removeClass(i, disabledClassName);\n if (i > index) {\n this.addClass(i, disabledClassName);\n }\n }\n this.addClass(index, selectedClassName);\n }\n\n /**\n * Destroys the instance.\n */\n destroy() {\n this.removeEvent();\n\n assignmentForDestroy(this);\n }\n\n /**\n * Add event for history\n * @param {Object} actions - actions for crop\n * @param {Function} actions.undo - undo action\n * @param {Function} actions.redo - redo action\n */\n addEvent(actions) {\n this._actions = actions;\n this._addHistoryEventListener();\n }\n\n /**\n * Remove event\n * @private\n */\n removeEvent() {\n this._removeHistoryEventListener();\n }\n}\n\nexport default History;\n","/**\n * Menu Panel Class\n * @class\n * @ignore\n */\n\nclass Panel {\n /**\n * @param {HTMLElement} menuElement - menu dom element\n * @param {Object} options - menu options\n * @param {string} options.name - name of panel menu\n */\n constructor(menuElement, { name }) {\n this.name = name;\n this.items = [];\n\n this.panelElement = this._makePanelElement();\n this.listElement = this._makeListElement();\n\n this.panelElement.appendChild(this.listElement);\n menuElement.appendChild(this.panelElement);\n }\n\n /**\n * Make Panel element\n * @returns {HTMLElement}\n */\n _makePanelElement() {\n const panel = document.createElement('div');\n\n panel.className = `tie-panel-${this.name}`;\n\n return panel;\n }\n\n /**\n * Make list element\n * @returns {HTMLElement} list element\n * @private\n */\n _makeListElement() {\n const list = document.createElement('ol');\n\n list.className = `${this.name}-list`;\n\n return list;\n }\n\n /**\n * Make list item element\n * @param {string} html - history list item html\n * @returns {HTMLElement} list item element\n */\n makeListItemElement(html) {\n const listItem = document.createElement('li');\n\n listItem.innerHTML = html;\n listItem.className = `${this.name}-item`;\n listItem.setAttribute('data-index', this.items.length);\n\n return listItem;\n }\n\n /**\n * Push list item element\n * @param {HTMLElement} item - list item element to add to the list\n */\n pushListItemElement(item) {\n this.listElement.appendChild(item);\n this.listElement.scrollTop += item.offsetHeight;\n this.items.push(item);\n }\n\n /**\n * Delete list item element\n * @param {number} start - start index to delete\n * @param {number} end - end index to delete\n */\n deleteListItemElement(start, end) {\n const { items } = this;\n\n for (let i = start; i < end; i += 1) {\n this.listElement.removeChild(items[i]);\n }\n items.splice(start, end - start + 1);\n }\n\n /**\n * Get list's length\n * @returns {number}\n */\n getListLength() {\n return this.items.length;\n }\n\n /**\n * Add class name of item\n * @param {number} index - index of item\n * @param {string} className - class name to add\n */\n addClass(index, className) {\n if (this.items[index]) {\n this.items[index].classList.add(className);\n }\n }\n\n /**\n * Remove class name of item\n * @param {number} index - index of item\n * @param {string} className - class name to remove\n */\n removeClass(index, className) {\n if (this.items[index]) {\n this.items[index].classList.remove(className);\n }\n }\n\n /**\n * Toggle class name of item\n * @param {number} index - index of item\n * @param {string} className - class name to remove\n */\n toggleClass(index, className) {\n if (this.items[index]) {\n this.items[index].classList.toggle(className);\n }\n }\n}\n\nexport default Panel;\n","/**\n * @param {Object} submenuInfo - submenu info for make template\n * @param {Locale} locale - Translate text\n * @param {Function} makeSvgIcon - svg icon generator\n * @param {string} name - history name\n * @param {string} detail - history detail information\n * @returns {string}\n */\nexport default ({ locale, makeSvgIcon, name, detail }) => `\n
                          \n
                          \n ${makeSvgIcon(['normal', 'active'], `history-${name.toLowerCase()}`, true)}\n
                          \n \n ${locale.localize(name)}\n ${detail ? `(${locale.localize(detail)})` : ''}\n \n
                          \n ${makeSvgIcon(['normal'], 'history-check', true)}\n
                          \n
                          \n`;\n","/**\n * Translate messages\n */\nclass Locale {\n /**\n * @constructor\n * @param {Object} locale - Locale object for initialise\n */\n constructor(locale) {\n this._locale = locale;\n }\n\n /**\n * localize message\n * @param {string} message - message who will be localized\n * @returns {string}\n */\n localize(message) {\n return this._locale[message] || message;\n }\n}\n\nexport default Locale;\n","import { extend } from 'tui-code-snippet';\nimport Imagetracer from '@/helper/imagetracer';\nimport { isSupportFileApi, base64ToBlob, toInteger, isEmptyCropzone } from '@/util';\nimport { eventNames, historyNames, drawingModes, drawingMenuNames, zoomModes } from '@/consts';\n\nexport default {\n /**\n * Get ui actions\n * @returns {Object} actions for ui\n * @private\n */\n getActions() {\n return {\n main: this._mainAction(),\n shape: this._shapeAction(),\n crop: this._cropAction(),\n flip: this._flipAction(),\n rotate: this._rotateAction(),\n text: this._textAction(),\n mask: this._maskAction(),\n draw: this._drawAction(),\n icon: this._iconAction(),\n filter: this._filterAction(),\n history: this._historyAction(),\n };\n },\n\n /**\n * Main Action\n * @returns {Object} actions for ui main\n * @private\n */\n _mainAction() {\n const exitCropOnAction = () => {\n if (this.ui.submenu === 'crop') {\n this.stopDrawingMode();\n this.ui.changeMenu('crop');\n }\n };\n const setAngleRangeBarOnAction = (angle) => {\n if (this.ui.submenu === 'rotate') {\n this.ui.rotate.setRangeBarAngle('setAngle', angle);\n }\n };\n const setFilterStateRangeBarOnAction = (filterOptions) => {\n if (this.ui.submenu === 'filter') {\n this.ui.filter.setFilterState(filterOptions);\n }\n };\n const onEndUndoRedo = (result) => {\n setAngleRangeBarOnAction(result);\n setFilterStateRangeBarOnAction(result);\n\n return result;\n };\n const toggleZoomMode = () => {\n const zoomMode = this._graphics.getZoomMode();\n\n this.stopDrawingMode();\n if (zoomMode !== zoomModes.ZOOM) {\n this.startDrawingMode(drawingModes.ZOOM);\n this._graphics.startZoomInMode();\n } else {\n this._graphics.endZoomInMode();\n }\n };\n const toggleHandMode = () => {\n const zoomMode = this._graphics.getZoomMode();\n\n this.stopDrawingMode();\n if (zoomMode !== zoomModes.HAND) {\n this.startDrawingMode(drawingModes.ZOOM);\n this._graphics.startHandMode();\n } else {\n this._graphics.endHandMode();\n }\n };\n\n return extend(\n {\n initLoadImage: (imagePath, imageName) =>\n this.loadImageFromURL(imagePath, imageName).then((sizeValue) => {\n exitCropOnAction();\n this.ui.initializeImgUrl = imagePath;\n this.ui.resizeEditor({ imageSize: sizeValue });\n this.clearUndoStack();\n this._invoker.fire(eventNames.EXECUTE_COMMAND, historyNames.LOAD_IMAGE);\n }),\n undo: () => {\n if (!this.isEmptyUndoStack()) {\n exitCropOnAction();\n this.deactivateAll();\n this.undo().then(onEndUndoRedo);\n }\n },\n redo: () => {\n if (!this.isEmptyRedoStack()) {\n exitCropOnAction();\n this.deactivateAll();\n this.redo().then(onEndUndoRedo);\n }\n },\n reset: () => {\n exitCropOnAction();\n this.loadImageFromURL(this.ui.initializeImgUrl, 'resetImage').then((sizeValue) => {\n exitCropOnAction();\n this.ui.resizeEditor({ imageSize: sizeValue });\n this.clearUndoStack();\n this._initHistory();\n });\n },\n delete: () => {\n this.ui.changeHelpButtonEnabled('delete', false);\n exitCropOnAction();\n this.removeActiveObject();\n this.activeObjectId = null;\n },\n deleteAll: () => {\n exitCropOnAction();\n this.clearObjects();\n this.ui.changeHelpButtonEnabled('delete', false);\n this.ui.changeHelpButtonEnabled('deleteAll', false);\n },\n load: (file) => {\n if (!isSupportFileApi()) {\n alert('This browser does not support file-api');\n }\n\n this.ui.initializeImgUrl = URL.createObjectURL(file);\n this.loadImageFromFile(file)\n .then((sizeValue) => {\n exitCropOnAction();\n this.clearUndoStack();\n this.ui.activeMenuEvent();\n this.ui.resizeEditor({ imageSize: sizeValue });\n this._clearHistory();\n this._invoker.fire(eventNames.EXECUTE_COMMAND, historyNames.LOAD_IMAGE);\n })\n ['catch']((message) => Promise.reject(message));\n },\n download: () => {\n const dataURL = this.toDataURL();\n let imageName = this.getImageName();\n let blob, type, w;\n\n if (isSupportFileApi() && window.saveAs) {\n blob = base64ToBlob(dataURL);\n type = blob.type.split('/')[1];\n if (imageName.split('.').pop() !== type) {\n imageName += `.${type}`;\n }\n saveAs(blob, imageName); // eslint-disable-line\n } else {\n w = window.open();\n w.document.body.innerHTML = ``;\n }\n },\n history: (event) => {\n this.ui.toggleHistoryMenu(event);\n },\n zoomIn: () => {\n this.ui.toggleZoomButtonStatus('zoomIn');\n this.deactivateAll();\n toggleZoomMode();\n },\n zoomOut: () => {\n this._graphics.zoomOut();\n },\n hand: () => {\n this.ui.offZoomInButtonStatus();\n this.ui.toggleZoomButtonStatus('hand');\n this.deactivateAll();\n toggleHandMode();\n },\n },\n this._commonAction()\n );\n },\n\n /**\n * Icon Action\n * @returns {Object} actions for ui icon\n * @private\n */\n _iconAction() {\n return extend(\n {\n changeColor: (color) => {\n if (this.activeObjectId) {\n this.changeIconColor(this.activeObjectId, color);\n }\n },\n addIcon: (iconType, iconColor) => {\n this.startDrawingMode('ICON');\n this.setDrawingIcon(iconType, iconColor);\n },\n cancelAddIcon: () => {\n this.ui.icon.clearIconType();\n this.changeSelectableAll(true);\n this.changeCursor('default');\n this.stopDrawingMode();\n },\n registerDefaultIcons: (type, path) => {\n const iconObj = {};\n iconObj[type] = path;\n this.registerIcons(iconObj);\n },\n registerCustomIcon: (imgUrl, file) => {\n const imagetracer = new Imagetracer();\n imagetracer.imageToSVG(\n imgUrl,\n (svgstr) => {\n const [, svgPath] = svgstr.match(/path[^>]*d=\"([^\"]*)\"/);\n const iconObj = {};\n iconObj[file.name] = svgPath;\n this.registerIcons(iconObj);\n this.addIcon(file.name, {\n left: 100,\n top: 100,\n });\n },\n Imagetracer.tracerDefaultOption()\n );\n },\n },\n this._commonAction()\n );\n },\n\n /**\n * Draw Action\n * @returns {Object} actions for ui draw\n * @private\n */\n _drawAction() {\n return extend(\n {\n setDrawMode: (type, settings) => {\n this.stopDrawingMode();\n if (type === 'free') {\n this.startDrawingMode('FREE_DRAWING', settings);\n } else {\n this.startDrawingMode('LINE_DRAWING', settings);\n }\n },\n setColor: (color) => {\n this.setBrush({\n color,\n });\n },\n },\n this._commonAction()\n );\n },\n\n /**\n * Mask Action\n * @returns {Object} actions for ui mask\n * @private\n */\n _maskAction() {\n return extend(\n {\n loadImageFromURL: (imgUrl, file) => {\n return this.loadImageFromURL(this.toDataURL(), 'FilterImage').then(() => {\n this.addImageObject(imgUrl).then(() => {\n URL.revokeObjectURL(file);\n });\n this._invoker.fire(eventNames.EXECUTE_COMMAND, historyNames.LOAD_MASK_IMAGE);\n });\n },\n applyFilter: () => {\n this.applyFilter('mask', {\n maskObjId: this.activeObjectId,\n });\n },\n },\n this._commonAction()\n );\n },\n\n /**\n * Text Action\n * @returns {Object} actions for ui text\n * @private\n */\n _textAction() {\n return extend(\n {\n changeTextStyle: (styleObj, isSilent) => {\n if (this.activeObjectId) {\n this.changeTextStyle(this.activeObjectId, styleObj, isSilent);\n }\n },\n },\n this._commonAction()\n );\n },\n\n /**\n * Rotate Action\n * @returns {Object} actions for ui rotate\n * @private\n */\n _rotateAction() {\n return extend(\n {\n rotate: (angle, isSilent) => {\n this.rotate(angle, isSilent);\n this.ui.resizeEditor();\n this.ui.rotate.setRangeBarAngle('rotate', angle);\n },\n setAngle: (angle, isSilent) => {\n this.setAngle(angle, isSilent);\n this.ui.resizeEditor();\n this.ui.rotate.setRangeBarAngle('setAngle', angle);\n },\n },\n this._commonAction()\n );\n },\n\n /**\n * Shape Action\n * @returns {Object} actions for ui shape\n * @private\n */\n _shapeAction() {\n return extend(\n {\n changeShape: (changeShapeObject, isSilent) => {\n if (this.activeObjectId) {\n this.changeShape(this.activeObjectId, changeShapeObject, isSilent);\n }\n },\n setDrawingShape: (shapeType) => {\n this.setDrawingShape(shapeType);\n },\n },\n this._commonAction()\n );\n },\n\n /**\n * Crop Action\n * @returns {Object} actions for ui crop\n * @private\n */\n _cropAction() {\n return extend(\n {\n crop: () => {\n const cropRect = this.getCropzoneRect();\n if (cropRect && !isEmptyCropzone(cropRect)) {\n this.crop(cropRect)\n .then(() => {\n this.stopDrawingMode();\n this.ui.resizeEditor();\n this.ui.changeMenu('crop');\n this._invoker.fire(eventNames.EXECUTE_COMMAND, historyNames.CROP);\n })\n ['catch']((message) => Promise.reject(message));\n }\n },\n cancel: () => {\n this.stopDrawingMode();\n this.ui.changeMenu('crop');\n },\n /* eslint-disable */\n preset: (presetType) => {\n switch (presetType) {\n case 'preset-square':\n this.setCropzoneRect(1 / 1);\n break;\n case 'preset-3-2':\n this.setCropzoneRect(3 / 2);\n break;\n case 'preset-4-3':\n this.setCropzoneRect(4 / 3);\n break;\n case 'preset-5-4':\n this.setCropzoneRect(5 / 4);\n break;\n case 'preset-7-5':\n this.setCropzoneRect(7 / 5);\n break;\n case 'preset-16-9':\n this.setCropzoneRect(16 / 9);\n break;\n default:\n this.setCropzoneRect();\n this.ui.crop.changeApplyButtonStatus(false);\n break;\n }\n },\n },\n this._commonAction()\n );\n },\n\n /**\n * Flip Action\n * @returns {Object} actions for ui flip\n * @private\n */\n _flipAction() {\n return extend(\n {\n flip: (flipType) => this[flipType](),\n },\n this._commonAction()\n );\n },\n\n /**\n * Filter Action\n * @returns {Object} actions for ui filter\n * @private\n */\n _filterAction() {\n return extend(\n {\n applyFilter: (applying, type, options, isSilent) => {\n if (applying) {\n this.applyFilter(type, options, isSilent);\n } else if (this.hasFilter(type)) {\n this.removeFilter(type);\n }\n },\n },\n this._commonAction()\n );\n },\n\n /**\n * Image Editor Event Observer\n */\n setReAction() {\n this.on({\n undoStackChanged: (length) => {\n if (length) {\n this.ui.changeHelpButtonEnabled('undo', true);\n this.ui.changeHelpButtonEnabled('reset', true);\n } else {\n this.ui.changeHelpButtonEnabled('undo', false);\n this.ui.changeHelpButtonEnabled('reset', false);\n }\n this.ui.resizeEditor();\n },\n redoStackChanged: (length) => {\n if (length) {\n this.ui.changeHelpButtonEnabled('redo', true);\n } else {\n this.ui.changeHelpButtonEnabled('redo', false);\n }\n this.ui.resizeEditor();\n },\n /* eslint-disable complexity */\n objectActivated: (obj) => {\n this.activeObjectId = obj.id;\n\n this.ui.changeHelpButtonEnabled('delete', true);\n this.ui.changeHelpButtonEnabled('deleteAll', true);\n\n if (obj.type === 'cropzone') {\n this.ui.crop.changeApplyButtonStatus(true);\n } else if (['rect', 'circle', 'triangle'].indexOf(obj.type) > -1) {\n this.stopDrawingMode();\n if (this.ui.submenu !== 'shape') {\n this.ui.changeMenu('shape', false, false);\n }\n this.ui.shape.setShapeStatus({\n strokeColor: obj.stroke,\n strokeWidth: obj.strokeWidth,\n fillColor: obj.fill,\n });\n\n this.ui.shape.setMaxStrokeValue(Math.min(obj.width, obj.height));\n } else if (obj.type === 'path' || obj.type === 'line') {\n if (this.ui.submenu !== 'draw') {\n this.ui.changeMenu('draw', false, false);\n this.ui.draw.changeStandbyMode();\n }\n } else if (['i-text', 'text'].indexOf(obj.type) > -1) {\n if (this.ui.submenu !== 'text') {\n this.ui.changeMenu('text', false, false);\n }\n\n this.ui.text.setTextStyleStateOnAction(obj);\n } else if (obj.type === 'icon') {\n this.stopDrawingMode();\n if (this.ui.submenu !== 'icon') {\n this.ui.changeMenu('icon', false, false);\n }\n this.ui.icon.setIconPickerColor(obj.fill);\n }\n },\n /* eslint-enable complexity */\n addText: (pos) => {\n const { textColor: fill, fontSize, fontStyle, fontWeight, underline } = this.ui.text;\n const fontFamily = 'Noto Sans';\n\n this.addText('Double Click', {\n position: pos.originPosition,\n styles: { fill, fontSize, fontFamily, fontStyle, fontWeight, underline },\n }).then(() => {\n this.changeCursor('default');\n });\n },\n addObjectAfter: (obj) => {\n if (obj.type === 'icon') {\n this.ui.icon.changeStandbyMode();\n } else if (['rect', 'circle', 'triangle'].indexOf(obj.type) > -1) {\n this.ui.shape.setMaxStrokeValue(Math.min(obj.width, obj.height));\n this.ui.shape.changeStandbyMode();\n }\n },\n objectScaled: (obj) => {\n if (['i-text', 'text'].indexOf(obj.type) > -1) {\n this.ui.text.fontSize = toInteger(obj.fontSize);\n } else if (['rect', 'circle', 'triangle'].indexOf(obj.type) >= 0) {\n const { width, height } = obj;\n const strokeValue = this.ui.shape.getStrokeValue();\n\n if (width < strokeValue) {\n this.ui.shape.setStrokeValue(width);\n }\n if (height < strokeValue) {\n this.ui.shape.setStrokeValue(height);\n }\n }\n },\n selectionCleared: () => {\n this.activeObjectId = null;\n if (this.ui.submenu === 'text') {\n this.changeCursor('text');\n } else if (this.ui.submenu !== 'draw' && this.ui.submenu !== 'crop') {\n this.stopDrawingMode();\n }\n },\n });\n },\n\n /**\n * History Action\n * @returns {Object} history actions for ui\n * @private\n */\n _historyAction() {\n return {\n undo: (count) => this.undo(count),\n redo: (count) => this.redo(count),\n };\n },\n\n /**\n * Common Action\n * @returns {Object} common actions for ui\n * @private\n */\n _commonAction() {\n const { TEXT, CROPPER, SHAPE, ZOOM } = drawingModes;\n\n return {\n modeChange: (menu) => {\n switch (menu) {\n case drawingMenuNames.TEXT:\n this._changeActivateMode(TEXT);\n break;\n case drawingMenuNames.CROP:\n this.startDrawingMode(CROPPER);\n break;\n case drawingMenuNames.SHAPE:\n this._changeActivateMode(SHAPE);\n this.setDrawingShape(this.ui.shape.type, this.ui.shape.options);\n break;\n case drawingMenuNames.ZOOM:\n this.startDrawingMode(ZOOM);\n break;\n default:\n break;\n }\n },\n deactivateAll: this.deactivateAll.bind(this),\n changeSelectableAll: this.changeSelectableAll.bind(this),\n discardSelection: this.discardSelection.bind(this),\n stopDrawingMode: this.stopDrawingMode.bind(this),\n };\n },\n\n /**\n * Mixin\n * @param {ImageEditor} ImageEditor instance\n */\n mixin(ImageEditor) {\n extend(ImageEditor.prototype, this);\n },\n};\n","/*\n imagetracer.js version 1.2.4\n Simple raster image tracer and vectorizer written in JavaScript.\n andras@jankovics.net\n*/\n\n/*\n The Unlicense / PUBLIC DOMAIN\n This is free and unencumbered software released into the public domain.\n Anyone is free to copy, modify, publish, use, compile, sell, or\n distribute this software, either in source code form or as a compiled\n binary, for any purpose, commercial or non-commercial, and by any\n means.\n In jurisdictions that recognize copyright laws, the author or authors\n of this software dedicate any and all copyright interest in the\n software to the public domain. We make this dedication for the benefit\n of the public at large and to the detriment of our heirs and\n successors. We intend this dedication to be an overt act of\n relinquishment in perpetuity of all present and future rights to this\n software under copyright law.\n THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\n EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\n MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.\n IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR\n OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,\n ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR\n OTHER DEALINGS IN THE SOFTWARE.\n For more information, please refer to http://unlicense.org/\n*/\nexport default class ImageTracer {\n static tracerDefaultOption() {\n return {\n pathomit: 100,\n ltres: 0.1,\n qtres: 1,\n\n scale: 1,\n strokewidth: 5,\n viewbox: false,\n linefilter: true,\n desc: false,\n rightangleenhance: false,\n pal: [\n {\n r: 0,\n g: 0,\n b: 0,\n a: 255,\n },\n {\n r: 255,\n g: 255,\n b: 255,\n a: 255,\n },\n ],\n };\n }\n /* eslint-disable */\n constructor() {\n this.versionnumber = '1.2.4';\n this.optionpresets = {\n default: {\n corsenabled: false,\n ltres: 1,\n qtres: 1,\n pathomit: 8,\n rightangleenhance: true,\n colorsampling: 2,\n numberofcolors: 16,\n mincolorratio: 0,\n colorquantcycles: 3,\n layering: 0,\n strokewidth: 1,\n linefilter: false,\n scale: 1,\n roundcoords: 1,\n viewbox: false,\n desc: false,\n lcpr: 0,\n qcpr: 0,\n blurradius: 0,\n blurdelta: 20,\n },\n posterized1: {\n colorsampling: 0,\n numberofcolors: 2,\n },\n posterized2: {\n numberofcolors: 4,\n blurradius: 5,\n },\n curvy: {\n ltres: 0.01,\n linefilter: true,\n rightangleenhance: false,\n },\n sharp: { qtres: 0.01, linefilter: false },\n detailed: { pathomit: 0, roundcoords: 2, ltres: 0.5, qtres: 0.5, numberofcolors: 64 },\n smoothed: { blurradius: 5, blurdelta: 64 },\n grayscale: { colorsampling: 0, colorquantcycles: 1, numberofcolors: 7 },\n fixedpalette: { colorsampling: 0, colorquantcycles: 1, numberofcolors: 27 },\n randomsampling1: { colorsampling: 1, numberofcolors: 8 },\n randomsampling2: { colorsampling: 1, numberofcolors: 64 },\n artistic1: {\n colorsampling: 0,\n colorquantcycles: 1,\n pathomit: 0,\n blurradius: 5,\n blurdelta: 64,\n ltres: 0.01,\n linefilter: true,\n numberofcolors: 16,\n strokewidth: 2,\n },\n artistic2: {\n qtres: 0.01,\n colorsampling: 0,\n colorquantcycles: 1,\n numberofcolors: 4,\n strokewidth: 0,\n },\n artistic3: { qtres: 10, ltres: 10, numberofcolors: 8 },\n artistic4: {\n qtres: 10,\n ltres: 10,\n numberofcolors: 64,\n blurradius: 5,\n blurdelta: 256,\n strokewidth: 2,\n },\n posterized3: {\n ltres: 1,\n qtres: 1,\n pathomit: 20,\n rightangleenhance: true,\n colorsampling: 0,\n numberofcolors: 3,\n mincolorratio: 0,\n colorquantcycles: 3,\n blurradius: 3,\n blurdelta: 20,\n strokewidth: 0,\n linefilter: false,\n roundcoords: 1,\n pal: [\n { r: 0, g: 0, b: 100, a: 255 },\n { r: 255, g: 255, b: 255, a: 255 },\n ],\n },\n };\n\n this.pathscan_combined_lookup = [\n [\n [-1, -1, -1, -1],\n [-1, -1, -1, -1],\n [-1, -1, -1, -1],\n [-1, -1, -1, -1],\n ],\n [\n [0, 1, 0, -1],\n [-1, -1, -1, -1],\n [-1, -1, -1, -1],\n [0, 2, -1, 0],\n ],\n [\n [-1, -1, -1, -1],\n [-1, -1, -1, -1],\n [0, 1, 0, -1],\n [0, 0, 1, 0],\n ],\n [\n [0, 0, 1, 0],\n [-1, -1, -1, -1],\n [0, 2, -1, 0],\n [-1, -1, -1, -1],\n ],\n [\n [-1, -1, -1, -1],\n [0, 0, 1, 0],\n [0, 3, 0, 1],\n [-1, -1, -1, -1],\n ],\n [\n [13, 3, 0, 1],\n [13, 2, -1, 0],\n [7, 1, 0, -1],\n [7, 0, 1, 0],\n ],\n [\n [-1, -1, -1, -1],\n [0, 1, 0, -1],\n [-1, -1, -1, -1],\n [0, 3, 0, 1],\n ],\n [\n [0, 3, 0, 1],\n [0, 2, -1, 0],\n [-1, -1, -1, -1],\n [-1, -1, -1, -1],\n ],\n [\n [0, 3, 0, 1],\n [0, 2, -1, 0],\n [-1, -1, -1, -1],\n [-1, -1, -1, -1],\n ],\n [\n [-1, -1, -1, -1],\n [0, 1, 0, -1],\n [-1, -1, -1, -1],\n [0, 3, 0, 1],\n ],\n [\n [11, 1, 0, -1],\n [14, 0, 1, 0],\n [14, 3, 0, 1],\n [11, 2, -1, 0],\n ],\n [\n [-1, -1, -1, -1],\n [0, 0, 1, 0],\n [0, 3, 0, 1],\n [-1, -1, -1, -1],\n ],\n [\n [0, 0, 1, 0],\n [-1, -1, -1, -1],\n [0, 2, -1, 0],\n [-1, -1, -1, -1],\n ],\n [\n [-1, -1, -1, -1],\n [-1, -1, -1, -1],\n [0, 1, 0, -1],\n [0, 0, 1, 0],\n ],\n [\n [0, 1, 0, -1],\n [-1, -1, -1, -1],\n [-1, -1, -1, -1],\n [0, 2, -1, 0],\n ],\n [\n [-1, -1, -1, -1],\n [-1, -1, -1, -1],\n [-1, -1, -1, -1],\n [-1, -1, -1, -1],\n ],\n ];\n\n this.gks = [\n [0.27901, 0.44198, 0.27901],\n [0.135336, 0.228569, 0.272192, 0.228569, 0.135336],\n [0.086776, 0.136394, 0.178908, 0.195843, 0.178908, 0.136394, 0.086776],\n [0.063327, 0.093095, 0.122589, 0.144599, 0.152781, 0.144599, 0.122589, 0.093095, 0.063327],\n [\n 0.049692,\n 0.069304,\n 0.089767,\n 0.107988,\n 0.120651,\n 0.125194,\n 0.120651,\n 0.107988,\n 0.089767,\n 0.069304,\n 0.049692,\n ],\n ];\n\n this.specpalette = [\n { r: 0, g: 0, b: 0, a: 255 },\n { r: 128, g: 128, b: 128, a: 255 },\n { r: 0, g: 0, b: 128, a: 255 },\n { r: 64, g: 64, b: 128, a: 255 },\n { r: 192, g: 192, b: 192, a: 255 },\n { r: 255, g: 255, b: 255, a: 255 },\n { r: 128, g: 128, b: 192, a: 255 },\n { r: 0, g: 0, b: 192, a: 255 },\n { r: 128, g: 0, b: 0, a: 255 },\n { r: 128, g: 64, b: 64, a: 255 },\n { r: 128, g: 0, b: 128, a: 255 },\n { r: 168, g: 168, b: 168, a: 255 },\n { r: 192, g: 128, b: 128, a: 255 },\n { r: 192, g: 0, b: 0, a: 255 },\n { r: 255, g: 255, b: 255, a: 255 },\n { r: 0, g: 128, b: 0, a: 255 },\n ];\n }\n\n imageToSVG(url, callback, options) {\n options = this.checkoptions(options);\n this.loadImage(\n url,\n (canvas) => {\n callback(this.imagedataToSVG(this.getImgdata(canvas), options));\n },\n options\n );\n }\n\n imagedataToSVG(imgd, options) {\n options = this.checkoptions(options);\n const td = this.imagedataToTracedata(imgd, options);\n\n return this.getsvgstring(td, options);\n }\n\n imageToTracedata(url, callback, options) {\n options = this.checkoptions(options);\n this.loadImage(\n url,\n (canvas) => {\n callback(this.imagedataToTracedata(this.getImgdata(canvas), options));\n },\n options\n );\n }\n\n imagedataToTracedata(imgd, options) {\n options = this.checkoptions(options);\n const ii = this.colorquantization(imgd, options);\n let tracedata;\n if (options.layering === 0) {\n tracedata = {\n layers: [],\n palette: ii.palette,\n width: ii.array[0].length - 2,\n height: ii.array.length - 2,\n };\n\n for (let colornum = 0; colornum < ii.palette.length; colornum += 1) {\n const tracedlayer = this.batchtracepaths(\n this.internodes(\n this.pathscan(this.layeringstep(ii, colornum), options.pathomit),\n options\n ),\n options.ltres,\n options.qtres\n );\n tracedata.layers.push(tracedlayer);\n }\n } else {\n const ls = this.layering(ii);\n if (options.layercontainerid) {\n this.drawLayers(ls, this.specpalette, options.scale, options.layercontainerid);\n }\n const bps = this.batchpathscan(ls, options.pathomit);\n const bis = this.batchinternodes(bps, options);\n tracedata = {\n layers: this.batchtracelayers(bis, options.ltres, options.qtres),\n palette: ii.palette,\n width: imgd.width,\n height: imgd.height,\n };\n }\n\n return tracedata;\n }\n\n checkoptions(options) {\n options = options || {};\n if (typeof options === 'string') {\n options = options.toLowerCase();\n if (this.optionpresets[options]) {\n options = this.optionpresets[options];\n } else {\n options = {};\n }\n }\n const ok = Object.keys(this.optionpresets['default']);\n for (let k = 0; k < ok.length; k += 1) {\n if (!options.hasOwnProperty(ok[k])) {\n options[ok[k]] = this.optionpresets['default'][ok[k]];\n }\n }\n\n return options;\n }\n\n colorquantization(imgd, options) {\n const arr = [];\n let idx = 0;\n let cd;\n let cdl;\n let ci;\n const paletteacc = [];\n const pixelnum = imgd.width * imgd.height;\n let i;\n let j;\n let k;\n let cnt;\n let palette;\n\n for (j = 0; j < imgd.height + 2; j += 1) {\n arr[j] = [];\n for (i = 0; i < imgd.width + 2; i += 1) {\n arr[j][i] = -1;\n }\n }\n if (options.pal) {\n palette = options.pal;\n } else if (options.colorsampling === 0) {\n palette = this.generatepalette(options.numberofcolors);\n } else if (options.colorsampling === 1) {\n palette = this.samplepalette(options.numberofcolors, imgd);\n } else {\n palette = this.samplepalette2(options.numberofcolors, imgd);\n }\n if (options.blurradius > 0) {\n imgd = this.blur(imgd, options.blurradius, options.blurdelta);\n }\n for (cnt = 0; cnt < options.colorquantcycles; cnt += 1) {\n if (cnt > 0) {\n for (k = 0; k < palette.length; k += 1) {\n if (paletteacc[k].n > 0) {\n palette[k] = {\n r: Math.floor(paletteacc[k].r / paletteacc[k].n),\n g: Math.floor(paletteacc[k].g / paletteacc[k].n),\n b: Math.floor(paletteacc[k].b / paletteacc[k].n),\n a: Math.floor(paletteacc[k].a / paletteacc[k].n),\n };\n }\n\n if (\n paletteacc[k].n / pixelnum < options.mincolorratio &&\n cnt < options.colorquantcycles - 1\n ) {\n palette[k] = {\n r: Math.floor(Math.random() * 255),\n g: Math.floor(Math.random() * 255),\n b: Math.floor(Math.random() * 255),\n a: Math.floor(Math.random() * 255),\n };\n }\n }\n }\n\n for (i = 0; i < palette.length; i += 1) {\n paletteacc[i] = { r: 0, g: 0, b: 0, a: 0, n: 0 };\n }\n\n for (j = 0; j < imgd.height; j += 1) {\n for (i = 0; i < imgd.width; i += 1) {\n idx = (j * imgd.width + i) * 4;\n\n ci = 0;\n cdl = 1024;\n for (k = 0; k < palette.length; k += 1) {\n cd =\n Math.abs(palette[k].r - imgd.data[idx]) +\n Math.abs(palette[k].g - imgd.data[idx + 1]) +\n Math.abs(palette[k].b - imgd.data[idx + 2]) +\n Math.abs(palette[k].a - imgd.data[idx + 3]);\n\n if (cd < cdl) {\n cdl = cd;\n ci = k;\n }\n }\n\n paletteacc[ci].r += imgd.data[idx];\n paletteacc[ci].g += imgd.data[idx + 1];\n paletteacc[ci].b += imgd.data[idx + 2];\n paletteacc[ci].a += imgd.data[idx + 3];\n paletteacc[ci].n += 1;\n\n arr[j + 1][i + 1] = ci;\n }\n }\n }\n\n return { array: arr, palette };\n }\n\n samplepalette(numberofcolors, imgd) {\n let idx;\n const palette = [];\n for (let i = 0; i < numberofcolors; i += 1) {\n idx = Math.floor((Math.random() * imgd.data.length) / 4) * 4;\n palette.push({\n r: imgd.data[idx],\n g: imgd.data[idx + 1],\n b: imgd.data[idx + 2],\n a: imgd.data[idx + 3],\n });\n }\n\n return palette;\n }\n\n samplepalette2(numberofcolors, imgd) {\n let idx;\n const palette = [];\n const ni = Math.ceil(Math.sqrt(numberofcolors));\n const nj = Math.ceil(numberofcolors / ni);\n const vx = imgd.width / (ni + 1);\n const vy = imgd.height / (nj + 1);\n for (let j = 0; j < nj; j += 1) {\n for (let i = 0; i < ni; i += 1) {\n if (palette.length === numberofcolors) {\n break;\n } else {\n idx = Math.floor((j + 1) * vy * imgd.width + (i + 1) * vx) * 4;\n palette.push({\n r: imgd.data[idx],\n g: imgd.data[idx + 1],\n b: imgd.data[idx + 2],\n a: imgd.data[idx + 3],\n });\n }\n }\n }\n\n return palette;\n }\n\n generatepalette(numberofcolors) {\n const palette = [];\n let rcnt;\n let gcnt;\n let bcnt;\n if (numberofcolors < 8) {\n const graystep = Math.floor(255 / (numberofcolors - 1));\n for (let i = 0; i < numberofcolors; i += 1) {\n palette.push({ r: i * graystep, g: i * graystep, b: i * graystep, a: 255 });\n }\n } else {\n const colorqnum = Math.floor(Math.pow(numberofcolors, 1 / 3));\n const colorstep = Math.floor(255 / (colorqnum - 1));\n const rndnum = numberofcolors - colorqnum * colorqnum * colorqnum;\n for (rcnt = 0; rcnt < colorqnum; rcnt += 1) {\n for (gcnt = 0; gcnt < colorqnum; gcnt += 1) {\n for (bcnt = 0; bcnt < colorqnum; bcnt += 1) {\n palette.push({ r: rcnt * colorstep, g: gcnt * colorstep, b: bcnt * colorstep, a: 255 });\n }\n }\n }\n for (rcnt = 0; rcnt < rndnum; rcnt += 1) {\n palette.push({\n r: Math.floor(Math.random() * 255),\n g: Math.floor(Math.random() * 255),\n b: Math.floor(Math.random() * 255),\n a: Math.floor(Math.random() * 255),\n });\n }\n }\n\n return palette;\n }\n\n layering(ii) {\n const layers = [];\n let val = 0;\n const ah = ii.array.length;\n const aw = ii.array[0].length;\n let n1;\n let n2;\n let n3;\n let n4;\n let n5;\n let n6;\n let n7;\n let n8;\n let i;\n let j;\n let k;\n for (k = 0; k < ii.palette.length; k += 1) {\n layers[k] = [];\n for (j = 0; j < ah; j += 1) {\n layers[k][j] = [];\n for (i = 0; i < aw; i += 1) {\n layers[k][j][i] = 0;\n }\n }\n }\n for (j = 1; j < ah - 1; j += 1) {\n for (i = 1; i < aw - 1; i += 1) {\n val = ii.array[j][i];\n\n n1 = ii.array[j - 1][i - 1] === val ? 1 : 0;\n n2 = ii.array[j - 1][i] === val ? 1 : 0;\n n3 = ii.array[j - 1][i + 1] === val ? 1 : 0;\n n4 = ii.array[j][i - 1] === val ? 1 : 0;\n n5 = ii.array[j][i + 1] === val ? 1 : 0;\n n6 = ii.array[j + 1][i - 1] === val ? 1 : 0;\n n7 = ii.array[j + 1][i] === val ? 1 : 0;\n n8 = ii.array[j + 1][i + 1] === val ? 1 : 0;\n\n layers[val][j + 1][i + 1] = 1 + n5 * 2 + n8 * 4 + n7 * 8;\n if (!n4) {\n layers[val][j + 1][i] = 0 + 2 + n7 * 4 + n6 * 8;\n }\n if (!n2) {\n layers[val][j][i + 1] = 0 + n3 * 2 + n5 * 4 + 8;\n }\n if (!n1) {\n layers[val][j][i] = 0 + n2 * 2 + 4 + n4 * 8;\n }\n }\n }\n\n return layers;\n }\n\n layeringstep(ii, cnum) {\n const layer = [];\n const ah = ii.array.length;\n const aw = ii.array[0].length;\n let i;\n let j;\n for (j = 0; j < ah; j += 1) {\n layer[j] = [];\n for (i = 0; i < aw; i += 1) {\n layer[j][i] = 0;\n }\n }\n for (j = 1; j < ah; j += 1) {\n for (i = 1; i < aw; i += 1) {\n layer[j][i] =\n (ii.array[j - 1][i - 1] === cnum ? 1 : 0) +\n (ii.array[j - 1][i] === cnum ? 2 : 0) +\n (ii.array[j][i - 1] === cnum ? 8 : 0) +\n (ii.array[j][i] === cnum ? 4 : 0);\n }\n }\n\n return layer;\n }\n\n pathscan(arr, pathomit) {\n const paths = [];\n let pacnt = 0;\n let pcnt = 0;\n let px = 0;\n let py = 0;\n const w = arr[0].length;\n const h = arr.length;\n let dir = 0;\n let pathfinished = true;\n let holepath = false;\n let lookuprow;\n for (let j = 0; j < h; j += 1) {\n for (let i = 0; i < w; i += 1) {\n if (arr[j][i] === 4 || arr[j][i] === 11) {\n px = i;\n py = j;\n paths[pacnt] = {};\n paths[pacnt].points = [];\n paths[pacnt].boundingbox = [px, py, px, py];\n paths[pacnt].holechildren = [];\n pathfinished = false;\n pcnt = 0;\n holepath = arr[j][i] === 11;\n dir = 1;\n\n while (!pathfinished) {\n paths[pacnt].points[pcnt] = {};\n paths[pacnt].points[pcnt].x = px - 1;\n paths[pacnt].points[pcnt].y = py - 1;\n paths[pacnt].points[pcnt].t = arr[py][px];\n\n if (px - 1 < paths[pacnt].boundingbox[0]) {\n paths[pacnt].boundingbox[0] = px - 1;\n }\n if (px - 1 > paths[pacnt].boundingbox[2]) {\n paths[pacnt].boundingbox[2] = px - 1;\n }\n if (py - 1 < paths[pacnt].boundingbox[1]) {\n paths[pacnt].boundingbox[1] = py - 1;\n }\n if (py - 1 > paths[pacnt].boundingbox[3]) {\n paths[pacnt].boundingbox[3] = py - 1;\n }\n\n lookuprow = this.pathscan_combined_lookup[arr[py][px]][dir];\n arr[py][px] = lookuprow[0];\n dir = lookuprow[1];\n px += lookuprow[2];\n py += lookuprow[3];\n\n if (px - 1 === paths[pacnt].points[0].x && py - 1 === paths[pacnt].points[0].y) {\n pathfinished = true;\n\n if (paths[pacnt].points.length < pathomit) {\n paths.pop();\n } else {\n paths[pacnt].isholepath = !!holepath;\n\n if (holepath) {\n let parentidx = 0,\n parentbbox = [-1, -1, w + 1, h + 1];\n for (let parentcnt = 0; parentcnt < pacnt; parentcnt++) {\n if (\n !paths[parentcnt].isholepath &&\n this.boundingboxincludes(\n paths[parentcnt].boundingbox,\n paths[pacnt].boundingbox\n ) &&\n this.boundingboxincludes(parentbbox, paths[parentcnt].boundingbox)\n ) {\n parentidx = parentcnt;\n parentbbox = paths[parentcnt].boundingbox;\n }\n }\n paths[parentidx].holechildren.push(pacnt);\n }\n pacnt += 1;\n }\n }\n pcnt += 1;\n }\n }\n }\n }\n\n return paths;\n }\n\n boundingboxincludes(parentbbox, childbbox) {\n return (\n parentbbox[0] < childbbox[0] &&\n parentbbox[1] < childbbox[1] &&\n parentbbox[2] > childbbox[2] &&\n parentbbox[3] > childbbox[3]\n );\n }\n\n batchpathscan(layers, pathomit) {\n const bpaths = [];\n for (const k in layers) {\n if (!layers.hasOwnProperty(k)) {\n continue;\n }\n bpaths[k] = this.pathscan(layers[k], pathomit);\n }\n\n return bpaths;\n }\n\n internodes(paths, options) {\n const ins = [];\n let palen = 0;\n let nextidx = 0;\n let nextidx2 = 0;\n let previdx = 0;\n let previdx2 = 0;\n let pacnt;\n let pcnt;\n for (pacnt = 0; pacnt < paths.length; pacnt += 1) {\n ins[pacnt] = {};\n ins[pacnt].points = [];\n ins[pacnt].boundingbox = paths[pacnt].boundingbox;\n ins[pacnt].holechildren = paths[pacnt].holechildren;\n ins[pacnt].isholepath = paths[pacnt].isholepath;\n palen = paths[pacnt].points.length;\n\n for (pcnt = 0; pcnt < palen; pcnt += 1) {\n nextidx = (pcnt + 1) % palen;\n nextidx2 = (pcnt + 2) % palen;\n previdx = (pcnt - 1 + palen) % palen;\n previdx2 = (pcnt - 2 + palen) % palen;\n\n if (\n options.rightangleenhance &&\n this.testrightangle(paths[pacnt], previdx2, previdx, pcnt, nextidx, nextidx2)\n ) {\n if (ins[pacnt].points.length > 0) {\n ins[pacnt].points[ins[pacnt].points.length - 1].linesegment = this.getdirection(\n ins[pacnt].points[ins[pacnt].points.length - 1].x,\n ins[pacnt].points[ins[pacnt].points.length - 1].y,\n paths[pacnt].points[pcnt].x,\n paths[pacnt].points[pcnt].y\n );\n }\n\n ins[pacnt].points.push({\n x: paths[pacnt].points[pcnt].x,\n y: paths[pacnt].points[pcnt].y,\n linesegment: this.getdirection(\n paths[pacnt].points[pcnt].x,\n paths[pacnt].points[pcnt].y,\n (paths[pacnt].points[pcnt].x + paths[pacnt].points[nextidx].x) / 2,\n (paths[pacnt].points[pcnt].y + paths[pacnt].points[nextidx].y) / 2\n ),\n });\n }\n\n ins[pacnt].points.push({\n x: (paths[pacnt].points[pcnt].x + paths[pacnt].points[nextidx].x) / 2,\n y: (paths[pacnt].points[pcnt].y + paths[pacnt].points[nextidx].y) / 2,\n linesegment: this.getdirection(\n (paths[pacnt].points[pcnt].x + paths[pacnt].points[nextidx].x) / 2,\n (paths[pacnt].points[pcnt].y + paths[pacnt].points[nextidx].y) / 2,\n (paths[pacnt].points[nextidx].x + paths[pacnt].points[nextidx2].x) / 2,\n (paths[pacnt].points[nextidx].y + paths[pacnt].points[nextidx2].y) / 2\n ),\n });\n }\n }\n\n return ins;\n }\n\n testrightangle(path, idx1, idx2, idx3, idx4, idx5) {\n return (\n (path.points[idx3].x === path.points[idx1].x &&\n path.points[idx3].x === path.points[idx2].x &&\n path.points[idx3].y === path.points[idx4].y &&\n path.points[idx3].y === path.points[idx5].y) ||\n (path.points[idx3].y === path.points[idx1].y &&\n path.points[idx3].y === path.points[idx2].y &&\n path.points[idx3].x === path.points[idx4].x &&\n path.points[idx3].x === path.points[idx5].x)\n );\n }\n\n getdirection(x1, y1, x2, y2) {\n let val = 8;\n if (x1 < x2) {\n if (y1 < y2) {\n val = 1;\n } else if (y1 > y2) {\n val = 7;\n } else {\n val = 0;\n }\n } else if (x1 > x2) {\n if (y1 < y2) {\n val = 3;\n } else if (y1 > y2) {\n val = 5;\n } else {\n val = 4;\n }\n } else if (y1 < y2) {\n val = 2;\n } else if (y1 > y2) {\n val = 6;\n } else {\n val = 8;\n }\n\n return val;\n }\n\n batchinternodes(bpaths, options) {\n const binternodes = [];\n for (const k in bpaths) {\n if (!bpaths.hasOwnProperty(k)) {\n continue;\n }\n binternodes[k] = this.internodes(bpaths[k], options);\n }\n\n return binternodes;\n }\n\n tracepath(path, ltres, qtres) {\n let pcnt = 0;\n let segtype1;\n let segtype2;\n let seqend;\n const smp = {};\n smp.segments = [];\n smp.boundingbox = path.boundingbox;\n smp.holechildren = path.holechildren;\n smp.isholepath = path.isholepath;\n\n while (pcnt < path.points.length) {\n segtype1 = path.points[pcnt].linesegment;\n segtype2 = -1;\n seqend = pcnt + 1;\n while (\n (path.points[seqend].linesegment === segtype1 ||\n path.points[seqend].linesegment === segtype2 ||\n segtype2 === -1) &&\n seqend < path.points.length - 1\n ) {\n if (path.points[seqend].linesegment !== segtype1 && segtype2 === -1) {\n segtype2 = path.points[seqend].linesegment;\n }\n seqend += 1;\n }\n if (seqend === path.points.length - 1) {\n seqend = 0;\n }\n\n smp.segments = smp.segments.concat(this.fitseq(path, ltres, qtres, pcnt, seqend));\n\n if (seqend > 0) {\n pcnt = seqend;\n } else {\n pcnt = path.points.length;\n }\n }\n\n return smp;\n }\n\n fitseq(path, ltres, qtres, seqstart, seqend) {\n if (seqend > path.points.length || seqend < 0) {\n return [];\n }\n let errorpoint = seqstart,\n errorval = 0,\n curvepass = true,\n px,\n py,\n dist2;\n let tl = seqend - seqstart;\n if (tl < 0) {\n tl += path.points.length;\n }\n let vx = (path.points[seqend].x - path.points[seqstart].x) / tl,\n vy = (path.points[seqend].y - path.points[seqstart].y) / tl;\n let pcnt = (seqstart + 1) % path.points.length,\n pl;\n while (pcnt != seqend) {\n pl = pcnt - seqstart;\n if (pl < 0) {\n pl += path.points.length;\n }\n px = path.points[seqstart].x + vx * pl;\n py = path.points[seqstart].y + vy * pl;\n dist2 =\n (path.points[pcnt].x - px) * (path.points[pcnt].x - px) +\n (path.points[pcnt].y - py) * (path.points[pcnt].y - py);\n if (dist2 > ltres) {\n curvepass = false;\n }\n if (dist2 > errorval) {\n errorpoint = pcnt;\n errorval = dist2;\n }\n pcnt = (pcnt + 1) % path.points.length;\n }\n if (curvepass) {\n return [\n {\n type: 'L',\n x1: path.points[seqstart].x,\n y1: path.points[seqstart].y,\n x2: path.points[seqend].x,\n y2: path.points[seqend].y,\n },\n ];\n }\n const fitpoint = errorpoint;\n curvepass = true;\n errorval = 0;\n let t = (fitpoint - seqstart) / tl,\n t1 = (1 - t) * (1 - t),\n t2 = 2 * (1 - t) * t,\n t3 = t * t;\n let cpx =\n (t1 * path.points[seqstart].x + t3 * path.points[seqend].x - path.points[fitpoint].x) / -t2,\n cpy =\n (t1 * path.points[seqstart].y + t3 * path.points[seqend].y - path.points[fitpoint].y) / -t2;\n pcnt = seqstart + 1;\n while (pcnt != seqend) {\n t = (pcnt - seqstart) / tl;\n t1 = (1 - t) * (1 - t);\n t2 = 2 * (1 - t) * t;\n t3 = t * t;\n px = t1 * path.points[seqstart].x + t2 * cpx + t3 * path.points[seqend].x;\n py = t1 * path.points[seqstart].y + t2 * cpy + t3 * path.points[seqend].y;\n dist2 =\n (path.points[pcnt].x - px) * (path.points[pcnt].x - px) +\n (path.points[pcnt].y - py) * (path.points[pcnt].y - py);\n if (dist2 > qtres) {\n curvepass = false;\n }\n if (dist2 > errorval) {\n errorpoint = pcnt;\n errorval = dist2;\n }\n pcnt = (pcnt + 1) % path.points.length;\n }\n if (curvepass) {\n return [\n {\n type: 'Q',\n x1: path.points[seqstart].x,\n y1: path.points[seqstart].y,\n x2: cpx,\n y2: cpy,\n x3: path.points[seqend].x,\n y3: path.points[seqend].y,\n },\n ];\n }\n const splitpoint = fitpoint;\n\n return this.fitseq(path, ltres, qtres, seqstart, splitpoint).concat(\n this.fitseq(path, ltres, qtres, splitpoint, seqend)\n );\n }\n\n batchtracepaths(internodepaths, ltres, qtres) {\n const btracedpaths = [];\n for (const k in internodepaths) {\n if (!internodepaths.hasOwnProperty(k)) {\n continue;\n }\n btracedpaths.push(this.tracepath(internodepaths[k], ltres, qtres));\n }\n\n return btracedpaths;\n }\n\n batchtracelayers(binternodes, ltres, qtres) {\n const btbis = [];\n for (const k in binternodes) {\n if (!binternodes.hasOwnProperty(k)) {\n continue;\n }\n btbis[k] = this.batchtracepaths(binternodes[k], ltres, qtres);\n }\n\n return btbis;\n }\n\n roundtodec(val, places) {\n return Number(val.toFixed(places));\n }\n\n svgpathstring(tracedata, lnum, pathnum, options) {\n let layer = tracedata.layers[lnum],\n smp = layer[pathnum],\n str = '',\n pcnt;\n if (options.linefilter && smp.segments.length < 3) {\n return str;\n }\n str = `= 0; pcnt--) {\n str += `${hsmp.segments[pcnt].type} `;\n if (hsmp.segments[pcnt].hasOwnProperty('x3')) {\n str += `${hsmp.segments[pcnt].x2 * options.scale} ${\n hsmp.segments[pcnt].y2 * options.scale\n } `;\n }\n str += `${hsmp.segments[pcnt].x1 * options.scale} ${\n hsmp.segments[pcnt].y1 * options.scale\n } `;\n }\n } else {\n if (hsmp.segments[hsmp.segments.length - 1].hasOwnProperty('x3')) {\n str += `M ${this.roundtodec(\n hsmp.segments[hsmp.segments.length - 1].x3 * options.scale\n )} ${this.roundtodec(hsmp.segments[hsmp.segments.length - 1].y3 * options.scale)} `;\n } else {\n str += `M ${this.roundtodec(\n hsmp.segments[hsmp.segments.length - 1].x2 * options.scale\n )} ${this.roundtodec(hsmp.segments[hsmp.segments.length - 1].y2 * options.scale)} `;\n }\n for (pcnt = hsmp.segments.length - 1; pcnt >= 0; pcnt--) {\n str += `${hsmp.segments[pcnt].type} `;\n if (hsmp.segments[pcnt].hasOwnProperty('x3')) {\n str += `${this.roundtodec(hsmp.segments[pcnt].x2 * options.scale)} ${this.roundtodec(\n hsmp.segments[pcnt].y2 * options.scale\n )} `;\n }\n str += `${this.roundtodec(hsmp.segments[pcnt].x1 * options.scale)} ${this.roundtodec(\n hsmp.segments[pcnt].y1 * options.scale\n )} `;\n }\n }\n str += 'Z ';\n }\n str += '\" />';\n if (options.lcpr || options.qcpr) {\n for (pcnt = 0; pcnt < smp.segments.length; pcnt++) {\n if (smp.segments[pcnt].hasOwnProperty('x3') && options.qcpr) {\n str += ``;\n str += ``;\n str += ``;\n str += ``;\n }\n if (!smp.segments[pcnt].hasOwnProperty('x3') && options.lcpr) {\n str += ``;\n }\n }\n\n for (var hcnt = 0; hcnt < smp.holechildren.length; hcnt++) {\n var hsmp = layer[smp.holechildren[hcnt]];\n for (pcnt = 0; pcnt < hsmp.segments.length; pcnt++) {\n if (hsmp.segments[pcnt].hasOwnProperty('x3') && options.qcpr) {\n str += ``;\n str += ``;\n str += ``;\n str += ``;\n }\n if (!hsmp.segments[pcnt].hasOwnProperty('x3') && options.lcpr) {\n str += ``;\n }\n }\n }\n }\n\n return str;\n }\n\n getsvgstring(tracedata, options) {\n options = this.checkoptions(options);\n const w = tracedata.width * options.scale;\n const h = tracedata.height * options.scale;\n\n let svgstr = ``;\n for (let lcnt = 0; lcnt < tracedata.layers.length; lcnt += 1) {\n for (let pcnt = 0; pcnt < tracedata.layers[lcnt].length; pcnt += 1) {\n if (!tracedata.layers[lcnt][pcnt].isholepath) {\n svgstr += this.svgpathstring(tracedata, lcnt, pcnt, options);\n }\n }\n }\n svgstr += '';\n\n return svgstr;\n }\n\n compareNumbers(a, b) {\n return a - b;\n }\n\n torgbastr(c) {\n return `rgba(${c.r},${c.g},${c.b},${c.a})`;\n }\n\n tosvgcolorstr(c, options) {\n return `fill=\"rgb(${c.r},${c.g},${c.b})\" stroke=\"rgb(${c.r},${c.g},${c.b})\" stroke-width=\"${\n options.strokewidth\n }\" opacity=\"${c.a / 255.0}\" `;\n }\n\n appendSVGString(svgstr, parentid) {\n let div;\n if (parentid) {\n div = document.getElementById(parentid);\n if (!div) {\n div = document.createElement('div');\n div.id = parentid;\n document.body.appendChild(div);\n }\n } else {\n div = document.createElement('div');\n document.body.appendChild(div);\n }\n div.innerHTML += svgstr;\n }\n\n blur(imgd, radius, delta) {\n let i, j, k, d, idx, racc, gacc, bacc, aacc, wacc;\n const imgd2 = { width: imgd.width, height: imgd.height, data: [] };\n radius = Math.floor(radius);\n if (radius < 1) {\n return imgd;\n }\n if (radius > 5) {\n radius = 5;\n }\n delta = Math.abs(delta);\n if (delta > 1024) {\n delta = 1024;\n }\n const thisgk = this.gks[radius - 1];\n for (j = 0; j < imgd.height; j++) {\n for (i = 0; i < imgd.width; i++) {\n racc = 0;\n gacc = 0;\n bacc = 0;\n aacc = 0;\n wacc = 0;\n\n for (k = -radius; k < radius + 1; k++) {\n if (i + k > 0 && i + k < imgd.width) {\n idx = (j * imgd.width + i + k) * 4;\n racc += imgd.data[idx] * thisgk[k + radius];\n gacc += imgd.data[idx + 1] * thisgk[k + radius];\n bacc += imgd.data[idx + 2] * thisgk[k + radius];\n aacc += imgd.data[idx + 3] * thisgk[k + radius];\n wacc += thisgk[k + radius];\n }\n }\n\n idx = (j * imgd.width + i) * 4;\n imgd2.data[idx] = Math.floor(racc / wacc);\n imgd2.data[idx + 1] = Math.floor(gacc / wacc);\n imgd2.data[idx + 2] = Math.floor(bacc / wacc);\n imgd2.data[idx + 3] = Math.floor(aacc / wacc);\n }\n }\n const himgd = new Uint8ClampedArray(imgd2.data);\n for (j = 0; j < imgd.height; j++) {\n for (i = 0; i < imgd.width; i++) {\n racc = 0;\n gacc = 0;\n bacc = 0;\n aacc = 0;\n wacc = 0;\n\n for (k = -radius; k < radius + 1; k++) {\n if (j + k > 0 && j + k < imgd.height) {\n idx = ((j + k) * imgd.width + i) * 4;\n racc += himgd[idx] * thisgk[k + radius];\n gacc += himgd[idx + 1] * thisgk[k + radius];\n bacc += himgd[idx + 2] * thisgk[k + radius];\n aacc += himgd[idx + 3] * thisgk[k + radius];\n wacc += thisgk[k + radius];\n }\n }\n\n idx = (j * imgd.width + i) * 4;\n imgd2.data[idx] = Math.floor(racc / wacc);\n imgd2.data[idx + 1] = Math.floor(gacc / wacc);\n imgd2.data[idx + 2] = Math.floor(bacc / wacc);\n imgd2.data[idx + 3] = Math.floor(aacc / wacc);\n }\n }\n for (j = 0; j < imgd.height; j++) {\n for (i = 0; i < imgd.width; i++) {\n idx = (j * imgd.width + i) * 4;\n\n d =\n Math.abs(imgd2.data[idx] - imgd.data[idx]) +\n Math.abs(imgd2.data[idx + 1] - imgd.data[idx + 1]) +\n Math.abs(imgd2.data[idx + 2] - imgd.data[idx + 2]) +\n Math.abs(imgd2.data[idx + 3] - imgd.data[idx + 3]);\n\n if (d > delta) {\n imgd2.data[idx] = imgd.data[idx];\n imgd2.data[idx + 1] = imgd.data[idx + 1];\n imgd2.data[idx + 2] = imgd.data[idx + 2];\n imgd2.data[idx + 3] = imgd.data[idx + 3];\n }\n }\n }\n\n return imgd2;\n }\n\n loadImage(url, callback, options) {\n const img = new Image();\n if (options && options.corsenabled) {\n img.crossOrigin = 'Anonymous';\n }\n img.src = url;\n img.onload = function () {\n const canvas = document.createElement('canvas');\n canvas.width = img.width;\n canvas.height = img.height;\n const context = canvas.getContext('2d');\n context.drawImage(img, 0, 0);\n callback(canvas);\n };\n }\n\n getImgdata(canvas) {\n const context = canvas.getContext('2d');\n\n return context.getImageData(0, 0, canvas.width, canvas.height);\n }\n\n drawLayers(layers, palette, scale, parentid) {\n scale = scale || 1;\n let w, h, i, j, k;\n let div;\n if (parentid) {\n div = document.getElementById(parentid);\n if (!div) {\n div = document.createElement('div');\n div.id = parentid;\n document.body.appendChild(div);\n }\n } else {\n div = document.createElement('div');\n document.body.appendChild(div);\n }\n for (k in layers) {\n if (!layers.hasOwnProperty(k)) {\n continue;\n }\n\n w = layers[k][0].length;\n h = layers[k].length;\n\n const canvas = document.createElement('canvas');\n canvas.width = w * scale;\n canvas.height = h * scale;\n const context = canvas.getContext('2d');\n\n for (j = 0; j < h; j += 1) {\n for (i = 0; i < w; i += 1) {\n context.fillStyle = this.torgbastr(palette[layers[k][j][i] % palette.length]);\n context.fillRect(i * scale, j * scale, scale, scale);\n }\n }\n\n div.appendChild(canvas);\n }\n }\n}\n","/**\n * @author NHN. FE Development Team \n * @fileoverview Graphics module\n */\nimport snippet from 'tui-code-snippet';\nimport fabric from 'fabric';\nimport ImageLoader from '@/component/imageLoader';\nimport Cropper from '@/component/cropper';\nimport Flip from '@/component/flip';\nimport Rotation from '@/component/rotation';\nimport FreeDrawing from '@/component/freeDrawing';\nimport Line from '@/component/line';\nimport Text from '@/component/text';\nimport Icon from '@/component/icon';\nimport Filter from '@/component/filter';\nimport Shape from '@/component/shape';\nimport Zoom from '@/component/zoom';\nimport CropperDrawingMode from '@/drawingMode/cropper';\nimport FreeDrawingMode from '@/drawingMode/freeDrawing';\nimport LineDrawingMode from '@/drawingMode/lineDrawing';\nimport ShapeDrawingMode from '@/drawingMode/shape';\nimport TextDrawingMode from '@/drawingMode/text';\nimport IconDrawingMode from '@/drawingMode/icon';\nimport ZoomDrawingMode from '@/drawingMode/zoom';\nimport {\n makeSelectionUndoData,\n makeSelectionUndoDatum,\n setCachedUndoDataForDimension,\n} from '@/helper/selectionModifyHelper';\nimport { getProperties, includes, isShape, Promise } from '@/util';\nimport {\n componentNames as components,\n eventNames as events,\n drawingModes,\n fObjectOptions,\n} from '@/consts';\n\nconst {\n extend,\n stamp,\n isArray,\n isString,\n forEachArray,\n forEachOwnProperties,\n CustomEvents,\n} = snippet;\nconst DEFAULT_CSS_MAX_WIDTH = 1000;\nconst DEFAULT_CSS_MAX_HEIGHT = 800;\nconst EXTRA_PX_FOR_PASTE = 10;\n\nconst cssOnly = {\n cssOnly: true,\n};\nconst backstoreOnly = {\n backstoreOnly: true,\n};\n\n/**\n * Graphics class\n * @class\n * @param {string|HTMLElement} wrapper - Wrapper's element or selector\n * @param {Object} [option] - Canvas max width & height of css\n * @param {number} option.cssMaxWidth - Canvas css-max-width\n * @param {number} option.cssMaxHeight - Canvas css-max-height\n * @ignore\n */\nclass Graphics {\n constructor(element, { cssMaxWidth, cssMaxHeight } = {}) {\n /**\n * Fabric image instance\n * @type {fabric.Image}\n */\n this.canvasImage = null;\n\n /**\n * Max width of canvas elements\n * @type {number}\n */\n this.cssMaxWidth = cssMaxWidth || DEFAULT_CSS_MAX_WIDTH;\n\n /**\n * Max height of canvas elements\n * @type {number}\n */\n this.cssMaxHeight = cssMaxHeight || DEFAULT_CSS_MAX_HEIGHT;\n\n /**\n * cropper Selection Style\n * @type {Object}\n */\n this.cropSelectionStyle = {};\n\n /**\n * target fabric object for copy paste feature\n * @type {fabric.Object}\n * @private\n */\n this.targetObjectForCopyPaste = null;\n\n /**\n * Image name\n * @type {string}\n */\n this.imageName = '';\n\n /**\n * Object Map\n * @type {Object}\n * @private\n */\n this._objects = {};\n\n /**\n * Fabric-Canvas instance\n * @type {fabric.Canvas}\n * @private\n */\n this._canvas = null;\n\n /**\n * Drawing mode\n * @type {string}\n * @private\n */\n this._drawingMode = drawingModes.NORMAL;\n\n /**\n * DrawingMode map\n * @type {Object.}\n * @private\n */\n this._drawingModeMap = {};\n\n /**\n * Component map\n * @type {Object.}\n * @private\n */\n this._componentMap = {};\n\n /**\n * fabric event handlers\n * @type {Object.}\n * @private\n */\n this._handler = {\n onMouseDown: this._onMouseDown.bind(this),\n onObjectAdded: this._onObjectAdded.bind(this),\n onObjectRemoved: this._onObjectRemoved.bind(this),\n onObjectMoved: this._onObjectMoved.bind(this),\n onObjectScaled: this._onObjectScaled.bind(this),\n onObjectModified: this._onObjectModified.bind(this),\n onObjectRotated: this._onObjectRotated.bind(this),\n onObjectSelected: this._onObjectSelected.bind(this),\n onPathCreated: this._onPathCreated.bind(this),\n onSelectionCleared: this._onSelectionCleared.bind(this),\n onSelectionCreated: this._onSelectionCreated.bind(this),\n };\n\n this._setObjectCachingToFalse();\n this._setCanvasElement(element);\n this._createDrawingModeInstances();\n this._createComponents();\n this._attachCanvasEvents();\n }\n\n /**\n * Destroy canvas element\n */\n destroy() {\n const { wrapperEl } = this._canvas;\n\n this._canvas.clear();\n\n wrapperEl.parentNode.removeChild(wrapperEl);\n }\n\n /**\n * Deactivates all objects on canvas\n * @returns {Graphics} this\n */\n deactivateAll() {\n this._canvas.discardActiveObject();\n\n return this;\n }\n\n /**\n * Renders all objects on canvas\n * @returns {Graphics} this\n */\n renderAll() {\n this._canvas.renderAll();\n\n return this;\n }\n\n /**\n * Adds objects on canvas\n * @param {Object|Array} objects - objects\n */\n add(objects) {\n let theArgs = [];\n if (isArray(objects)) {\n theArgs = objects;\n } else {\n theArgs.push(objects);\n }\n\n this._canvas.add(...theArgs);\n }\n\n /**\n * Removes the object or group\n * @param {Object} target - graphics object or group\n * @returns {boolean} true if contains or false\n */\n contains(target) {\n return this._canvas.contains(target);\n }\n\n /**\n * Gets all objects or group\n * @returns {Array} all objects, shallow copy\n */\n getObjects() {\n return this._canvas.getObjects().slice();\n }\n\n /**\n * Get an object by id\n * @param {number} id - object id\n * @returns {fabric.Object} object corresponding id\n */\n getObject(id) {\n return this._objects[id];\n }\n\n /**\n * Removes the object or group\n * @param {Object} target - graphics object or group\n */\n remove(target) {\n this._canvas.remove(target);\n }\n\n /**\n * Removes all object or group\n * @param {boolean} includesBackground - remove the background image or not\n * @returns {Array} all objects array which is removed\n */\n removeAll(includesBackground) {\n const canvas = this._canvas;\n const objects = canvas.getObjects().slice();\n canvas.remove(...this._canvas.getObjects());\n\n if (includesBackground) {\n canvas.clear();\n }\n\n return objects;\n }\n\n /**\n * Removes an object or group by id\n * @param {number} id - object id\n * @returns {Array} removed objects\n */\n removeObjectById(id) {\n const objects = [];\n const canvas = this._canvas;\n const target = this.getObject(id);\n const isValidGroup = target && target.isType('group') && !target.isEmpty();\n\n if (isValidGroup) {\n canvas.discardActiveObject(); // restore states for each objects\n target.forEachObject((obj) => {\n objects.push(obj);\n canvas.remove(obj);\n });\n } else if (canvas.contains(target)) {\n objects.push(target);\n canvas.remove(target);\n }\n\n return objects;\n }\n\n /**\n * Get an id by object instance\n * @param {fabric.Object} object object\n * @returns {number} object id if it exists or null\n */\n getObjectId(object) {\n let key = null;\n for (key in this._objects) {\n if (this._objects.hasOwnProperty(key)) {\n if (object === this._objects[key]) {\n return key;\n }\n }\n }\n\n return null;\n }\n\n /**\n * Gets an active object or group\n * @returns {Object} active object or group instance\n */\n getActiveObject() {\n return this._canvas._activeObject;\n }\n\n /**\n * Returns the object ID to delete the object.\n * @returns {number} object id for remove\n */\n getActiveObjectIdForRemove() {\n const activeObject = this.getActiveObject();\n const { type, left, top } = activeObject;\n const isSelection = type === 'activeSelection';\n\n if (isSelection) {\n const group = new fabric.Group([...activeObject.getObjects()], {\n left,\n top,\n });\n\n return this._addFabricObject(group);\n }\n\n return this.getObjectId(activeObject);\n }\n\n /**\n * Verify that you are ready to erase the object.\n * @returns {boolean} ready for object remove\n */\n isReadyRemoveObject() {\n const activeObject = this.getActiveObject();\n\n return activeObject && !activeObject.isEditing;\n }\n\n /**\n * Gets an active group object\n * @returns {Object} active group object instance\n */\n getActiveObjects() {\n const activeObject = this._canvas._activeObject;\n\n return activeObject && activeObject.type === 'activeSelection' ? activeObject : null;\n }\n\n /**\n * Get Active object Selection from object ids\n * @param {Array.} objects - fabric objects\n * @returns {Object} target - target object group\n */\n getActiveSelectionFromObjects(objects) {\n const canvas = this.getCanvas();\n\n return new fabric.ActiveSelection(objects, { canvas });\n }\n\n /**\n * Activates an object or group\n * @param {Object} target - target object or group\n */\n setActiveObject(target) {\n this._canvas.setActiveObject(target);\n }\n\n /**\n * Set Crop selection style\n * @param {Object} style - Selection styles\n */\n setCropSelectionStyle(style) {\n this.cropSelectionStyle = style;\n }\n\n /**\n * Get component\n * @param {string} name - Component name\n * @returns {Component}\n */\n getComponent(name) {\n return this._componentMap[name];\n }\n\n /**\n * Get current drawing mode\n * @returns {string}\n */\n getDrawingMode() {\n return this._drawingMode;\n }\n\n /**\n * Start a drawing mode. If the current mode is not 'NORMAL', 'stopDrawingMode()' will be called first.\n * @param {String} mode Can be one of 'CROPPER', 'FREE_DRAWING', 'LINE', 'TEXT', 'SHAPE'\n * @param {Object} [option] parameters of drawing mode, it's available with 'FREE_DRAWING', 'LINE_DRAWING'\n * @param {Number} [option.width] brush width\n * @param {String} [option.color] brush color\n * @returns {boolean} true if success or false\n */\n startDrawingMode(mode, option) {\n if (this._isSameDrawingMode(mode)) {\n return true;\n }\n\n // If the current mode is not 'NORMAL', 'stopDrawingMode()' will be called first.\n this.stopDrawingMode();\n\n const drawingModeInstance = this._getDrawingModeInstance(mode);\n if (drawingModeInstance && drawingModeInstance.start) {\n drawingModeInstance.start(this, option);\n\n this._drawingMode = mode;\n }\n\n return !!drawingModeInstance;\n }\n\n /**\n * Stop the current drawing mode and back to the 'NORMAL' mode\n */\n stopDrawingMode() {\n if (this._isSameDrawingMode(drawingModes.NORMAL)) {\n return;\n }\n\n const drawingModeInstance = this._getDrawingModeInstance(this.getDrawingMode());\n if (drawingModeInstance && drawingModeInstance.end) {\n drawingModeInstance.end(this);\n }\n this._drawingMode = drawingModes.NORMAL;\n }\n\n /**\n * Change zoom of canvas\n * @param {{x: number, y: number}} center - center of zoom\n * @param {number} zoomLevel - zoom level\n */\n zoom({ x, y }, zoomLevel) {\n const zoom = this.getComponent(components.ZOOM);\n\n zoom.zoom({ x, y }, zoomLevel);\n }\n\n /**\n * Get zoom mode\n * @returns {string}\n */\n getZoomMode() {\n const zoom = this.getComponent(components.ZOOM);\n\n return zoom.mode;\n }\n\n /**\n * Start zoom-in mode\n */\n startZoomInMode() {\n const zoom = this.getComponent(components.ZOOM);\n\n zoom.startZoomInMode();\n }\n\n /**\n * Stop zoom-in mode\n */\n endZoomInMode() {\n const zoom = this.getComponent(components.ZOOM);\n\n zoom.endZoomInMode();\n }\n\n /**\n * Zoom out one step\n */\n zoomOut() {\n const zoom = this.getComponent(components.ZOOM);\n\n zoom.zoomOut();\n }\n\n /**\n * Start hand mode\n */\n startHandMode() {\n const zoom = this.getComponent(components.ZOOM);\n\n zoom.startHandMode();\n }\n\n /**\n * Stop hand mode\n */\n endHandMode() {\n const zoom = this.getComponent(components.ZOOM);\n\n zoom.endHandMode();\n }\n\n /**\n * Zoom reset\n */\n resetZoom() {\n const zoom = this.getComponent(components.ZOOM);\n\n zoom.resetZoom();\n }\n\n /**\n * To data url from canvas\n * @param {Object} options - options for toDataURL\n * @param {String} [options.format=png] The format of the output image. Either \"jpeg\" or \"png\"\n * @param {Number} [options.quality=1] Quality level (0..1). Only used for jpeg.\n * @param {Number} [options.multiplier=1] Multiplier to scale by\n * @param {Number} [options.left] Cropping left offset. Introduced in fabric v1.2.14\n * @param {Number} [options.top] Cropping top offset. Introduced in fabric v1.2.14\n * @param {Number} [options.width] Cropping width. Introduced in fabric v1.2.14\n * @param {Number} [options.height] Cropping height. Introduced in fabric v1.2.14\n * @returns {string} A DOMString containing the requested data URI.\n */\n toDataURL(options) {\n const cropper = this.getComponent(components.CROPPER);\n cropper.changeVisibility(false);\n\n const dataUrl = this._canvas && this._canvas.toDataURL(options);\n cropper.changeVisibility(true);\n\n return dataUrl;\n }\n\n /**\n * Save image(background) of canvas\n * @param {string} name - Name of image\n * @param {?fabric.Image} canvasImage - Fabric image instance\n */\n setCanvasImage(name, canvasImage) {\n if (canvasImage) {\n stamp(canvasImage);\n }\n this.imageName = name;\n this.canvasImage = canvasImage;\n }\n\n /**\n * Set css max dimension\n * @param {{width: number, height: number}} maxDimension - Max width & Max height\n */\n setCssMaxDimension(maxDimension) {\n this.cssMaxWidth = maxDimension.width || this.cssMaxWidth;\n this.cssMaxHeight = maxDimension.height || this.cssMaxHeight;\n }\n\n /**\n * Adjust canvas dimension with scaling image\n */\n adjustCanvasDimension() {\n const canvasImage = this.canvasImage.scale(1);\n const { width, height } = canvasImage.getBoundingRect();\n const maxDimension = this._calcMaxDimension(width, height);\n\n this.setCanvasCssDimension({\n width: '100%',\n height: '100%', // Set height '' for IE9\n 'max-width': `${maxDimension.width}px`,\n 'max-height': `${maxDimension.height}px`,\n });\n\n this.setCanvasBackstoreDimension({\n width,\n height,\n });\n this._canvas.centerObject(canvasImage);\n }\n\n /**\n * Set canvas dimension - css only\n * {@link http://fabricjs.com/docs/fabric.Canvas.html#setDimensions}\n * @param {Object} dimension - Canvas css dimension\n */\n setCanvasCssDimension(dimension) {\n this._canvas.setDimensions(dimension, cssOnly);\n }\n\n /**\n * Set canvas dimension - backstore only\n * {@link http://fabricjs.com/docs/fabric.Canvas.html#setDimensions}\n * @param {Object} dimension - Canvas backstore dimension\n */\n setCanvasBackstoreDimension(dimension) {\n this._canvas.setDimensions(dimension, backstoreOnly);\n }\n\n /**\n * Set image properties\n * {@link http://fabricjs.com/docs/fabric.Image.html#set}\n * @param {Object} setting - Image properties\n * @param {boolean} [withRendering] - If true, The changed image will be reflected in the canvas\n */\n setImageProperties(setting, withRendering) {\n const { canvasImage } = this;\n\n if (!canvasImage) {\n return;\n }\n\n canvasImage.set(setting).setCoords();\n if (withRendering) {\n this._canvas.renderAll();\n }\n }\n\n /**\n * Returns canvas element of fabric.Canvas[[lower-canvas]]\n * @returns {HTMLCanvasElement}\n */\n getCanvasElement() {\n return this._canvas.getElement();\n }\n\n /**\n * Get fabric.Canvas instance\n * @returns {fabric.Canvas}\n */\n getCanvas() {\n return this._canvas;\n }\n\n /**\n * Get canvasImage (fabric.Image instance)\n * @returns {fabric.Image}\n */\n getCanvasImage() {\n return this.canvasImage;\n }\n\n /**\n * Get image name\n * @returns {string}\n */\n getImageName() {\n return this.imageName;\n }\n\n /**\n * Add image object on canvas\n * @param {string} imgUrl - Image url to make object\n * @returns {Promise}\n */\n addImageObject(imgUrl) {\n const callback = this._callbackAfterLoadingImageObject.bind(this);\n\n return new Promise((resolve) => {\n fabric.Image.fromURL(\n imgUrl,\n (image) => {\n callback(image);\n resolve(this.createObjectProperties(image));\n },\n {\n crossOrigin: 'Anonymous',\n }\n );\n });\n }\n\n /**\n * Get center position of canvas\n * @returns {Object} {left, top}\n */\n getCenter() {\n return this._canvas.getCenter();\n }\n\n /**\n * Get cropped rect\n * @returns {Object} rect\n */\n getCropzoneRect() {\n return this.getComponent(components.CROPPER).getCropzoneRect();\n }\n\n /**\n * Get cropped rect\n * @param {number} [mode] cropzone rect mode\n */\n setCropzoneRect(mode) {\n this.getComponent(components.CROPPER).setCropzoneRect(mode);\n }\n\n /**\n * Get cropped image data\n * @param {Object} cropRect cropzone rect\n * @param {Number} cropRect.left left position\n * @param {Number} cropRect.top top position\n * @param {Number} cropRect.width width\n * @param {Number} cropRect.height height\n * @returns {?{imageName: string, url: string}} cropped Image data\n */\n getCroppedImageData(cropRect) {\n return this.getComponent(components.CROPPER).getCroppedImageData(cropRect);\n }\n\n /**\n * Set brush option\n * @param {Object} option brush option\n * @param {Number} option.width width\n * @param {String} option.color color like 'FFFFFF', 'rgba(0, 0, 0, 0.5)'\n */\n setBrush(option) {\n const drawingMode = this._drawingMode;\n let compName = components.FREE_DRAWING;\n\n if (drawingMode === drawingModes.LINE_DRAWING) {\n compName = components.LINE;\n }\n\n this.getComponent(compName).setBrush(option);\n }\n\n /**\n * Set states of current drawing shape\n * @param {string} type - Shape type (ex: 'rect', 'circle', 'triangle')\n * @param {Object} [options] - Shape options\n * @param {(ShapeFillOption | string)} [options.fill] - {@link ShapeFillOption} or\n * Shape foreground color (ex: '#fff', 'transparent')\n * @param {string} [options.stoke] - Shape outline color\n * @param {number} [options.strokeWidth] - Shape outline width\n * @param {number} [options.width] - Width value (When type option is 'rect', this options can use)\n * @param {number} [options.height] - Height value (When type option is 'rect', this options can use)\n * @param {number} [options.rx] - Radius x value (When type option is 'circle', this options can use)\n * @param {number} [options.ry] - Radius y value (When type option is 'circle', this options can use)\n * @param {number} [options.isRegular] - Whether resizing shape has 1:1 ratio or not\n */\n setDrawingShape(type, options) {\n this.getComponent(components.SHAPE).setStates(type, options);\n }\n\n /**\n * Set style of current drawing icon\n * @param {string} type - icon type (ex: 'icon-arrow', 'icon-star')\n * @param {Object} [iconColor] - Icon color\n */\n setIconStyle(type, iconColor) {\n this.getComponent(components.ICON).setStates(type, iconColor);\n }\n\n /**\n * Register icon paths\n * @param {Object} pathInfos - Path infos\n * @param {string} pathInfos.key - key\n * @param {string} pathInfos.value - value\n */\n registerPaths(pathInfos) {\n this.getComponent(components.ICON).registerPaths(pathInfos);\n }\n\n /**\n * Change cursor style\n * @param {string} cursorType - cursor type\n */\n changeCursor(cursorType) {\n const canvas = this.getCanvas();\n canvas.defaultCursor = cursorType;\n canvas.renderAll();\n }\n\n /**\n * Whether it has the filter or not\n * @param {string} type - Filter type\n * @returns {boolean} true if it has the filter\n */\n hasFilter(type) {\n return this.getComponent(components.FILTER).hasFilter(type);\n }\n\n /**\n * Set selection style of fabric object by init option\n * @param {Object} styles - Selection styles\n */\n setSelectionStyle(styles) {\n extend(fObjectOptions.SELECTION_STYLE, styles);\n }\n\n /**\n * Set object properties\n * @param {number} id - object id\n * @param {Object} props - props\n * @param {string} [props.fill] Color\n * @param {string} [props.fontFamily] Font type for text\n * @param {number} [props.fontSize] Size\n * @param {string} [props.fontStyle] Type of inclination (normal / italic)\n * @param {string} [props.fontWeight] Type of thicker or thinner looking (normal / bold)\n * @param {string} [props.textAlign] Type of text align (left / center / right)\n * @param {string} [props.textDecoration] Type of line (underline / line-through / overline)\n * @returns {Object} applied properties\n */\n setObjectProperties(id, props) {\n const object = this.getObject(id);\n const clone = extend({}, props);\n\n object.set(clone);\n\n object.setCoords();\n\n this.getCanvas().renderAll();\n\n return clone;\n }\n\n /**\n * Get object properties corresponding key\n * @param {number} id - object id\n * @param {Array|ObjectProps|string} keys - property's key\n * @returns {Object} properties\n */\n getObjectProperties(id, keys) {\n const object = this.getObject(id);\n const props = {};\n\n if (isString(keys)) {\n props[keys] = object[keys];\n } else if (isArray(keys)) {\n forEachArray(keys, (value) => {\n props[value] = object[value];\n });\n } else {\n forEachOwnProperties(keys, (value, key) => {\n props[key] = object[key];\n });\n }\n\n return props;\n }\n\n /**\n * Get object position by originX, originY\n * @param {number} id - object id\n * @param {string} originX - can be 'left', 'center', 'right'\n * @param {string} originY - can be 'top', 'center', 'bottom'\n * @returns {Object} {{x:number, y: number}} position by origin if id is valid, or null\n */\n getObjectPosition(id, originX, originY) {\n const targetObj = this.getObject(id);\n if (!targetObj) {\n return null;\n }\n\n return targetObj.getPointByOrigin(originX, originY);\n }\n\n /**\n * Set object position by originX, originY\n * @param {number} id - object id\n * @param {Object} posInfo - position object\n * @param {number} posInfo.x - x position\n * @param {number} posInfo.y - y position\n * @param {string} posInfo.originX - can be 'left', 'center', 'right'\n * @param {string} posInfo.originY - can be 'top', 'center', 'bottom'\n * @returns {boolean} true if target id is valid or false\n */\n setObjectPosition(id, posInfo) {\n const targetObj = this.getObject(id);\n const { x, y, originX, originY } = posInfo;\n if (!targetObj) {\n return false;\n }\n\n const targetOrigin = targetObj.getPointByOrigin(originX, originY);\n const centerOrigin = targetObj.getPointByOrigin('center', 'center');\n const diffX = centerOrigin.x - targetOrigin.x;\n const diffY = centerOrigin.y - targetOrigin.y;\n\n targetObj.set({\n left: x + diffX,\n top: y + diffY,\n });\n\n targetObj.setCoords();\n\n return true;\n }\n\n /**\n * Get the canvas size\n * @returns {Object} {{width: number, height: number}} image size\n */\n getCanvasSize() {\n const image = this.getCanvasImage();\n\n return {\n width: image ? image.width : 0,\n height: image ? image.height : 0,\n };\n }\n\n /**\n * Create fabric static canvas\n * @returns {Object} {{width: number, height: number}} image size\n */\n createStaticCanvas() {\n const staticCanvas = new fabric.StaticCanvas();\n\n staticCanvas.set({\n enableRetinaScaling: false,\n });\n\n return staticCanvas;\n }\n\n /**\n * Get a DrawingMode instance\n * @param {string} modeName - DrawingMode Class Name\n * @returns {DrawingMode} DrawingMode instance\n * @private\n */\n _getDrawingModeInstance(modeName) {\n return this._drawingModeMap[modeName];\n }\n\n /**\n * Set object caching to false. This brought many bugs when draw Shape & cropzone\n * @see http://fabricjs.com/fabric-object-caching\n * @private\n */\n _setObjectCachingToFalse() {\n fabric.Object.prototype.objectCaching = false;\n }\n\n /**\n * Set canvas element to fabric.Canvas\n * @param {Element|string} element - Wrapper or canvas element or selector\n * @private\n */\n _setCanvasElement(element) {\n let selectedElement;\n let canvasElement;\n\n if (element.nodeType) {\n selectedElement = element;\n } else {\n selectedElement = document.querySelector(element);\n }\n\n if (selectedElement.nodeName.toUpperCase() !== 'CANVAS') {\n canvasElement = document.createElement('canvas');\n selectedElement.appendChild(canvasElement);\n }\n\n this._canvas = new fabric.Canvas(canvasElement, {\n containerClass: 'tui-image-editor-canvas-container',\n enableRetinaScaling: false,\n });\n }\n\n /**\n * Creates DrawingMode instances\n * @private\n */\n _createDrawingModeInstances() {\n this._register(this._drawingModeMap, new CropperDrawingMode());\n this._register(this._drawingModeMap, new FreeDrawingMode());\n this._register(this._drawingModeMap, new LineDrawingMode());\n this._register(this._drawingModeMap, new ShapeDrawingMode());\n this._register(this._drawingModeMap, new TextDrawingMode());\n this._register(this._drawingModeMap, new IconDrawingMode());\n this._register(this._drawingModeMap, new ZoomDrawingMode());\n }\n\n /**\n * Create components\n * @private\n */\n _createComponents() {\n this._register(this._componentMap, new ImageLoader(this));\n this._register(this._componentMap, new Cropper(this));\n this._register(this._componentMap, new Flip(this));\n this._register(this._componentMap, new Rotation(this));\n this._register(this._componentMap, new FreeDrawing(this));\n this._register(this._componentMap, new Line(this));\n this._register(this._componentMap, new Text(this));\n this._register(this._componentMap, new Icon(this));\n this._register(this._componentMap, new Filter(this));\n this._register(this._componentMap, new Shape(this));\n this._register(this._componentMap, new Zoom(this));\n }\n\n /**\n * Register component\n * @param {Object} map - map object\n * @param {Object} module - module which has getName method\n * @private\n */\n _register(map, module) {\n map[module.getName()] = module;\n }\n\n /**\n * Get the current drawing mode is same with given mode\n * @param {string} mode drawing mode\n * @returns {boolean} true if same or false\n */\n _isSameDrawingMode(mode) {\n return this.getDrawingMode() === mode;\n }\n\n /**\n * Calculate max dimension of canvas\n * The css-max dimension is dynamically decided with maintaining image ratio\n * The css-max dimension is lower than canvas dimension (attribute of canvas, not css)\n * @param {number} width - Canvas width\n * @param {number} height - Canvas height\n * @returns {{width: number, height: number}} - Max width & Max height\n * @private\n */\n _calcMaxDimension(width, height) {\n const wScaleFactor = this.cssMaxWidth / width;\n const hScaleFactor = this.cssMaxHeight / height;\n let cssMaxWidth = Math.min(width, this.cssMaxWidth);\n let cssMaxHeight = Math.min(height, this.cssMaxHeight);\n\n if (wScaleFactor < 1 && wScaleFactor < hScaleFactor) {\n cssMaxWidth = width * wScaleFactor;\n cssMaxHeight = height * wScaleFactor;\n } else if (hScaleFactor < 1 && hScaleFactor < wScaleFactor) {\n cssMaxWidth = width * hScaleFactor;\n cssMaxHeight = height * hScaleFactor;\n }\n\n return {\n width: Math.floor(cssMaxWidth),\n height: Math.floor(cssMaxHeight),\n };\n }\n\n /**\n * Callback function after loading image\n * @param {fabric.Image} obj - Fabric image object\n * @private\n */\n _callbackAfterLoadingImageObject(obj) {\n const centerPos = this.getCanvasImage().getCenterPoint();\n\n obj.set(fObjectOptions.SELECTION_STYLE);\n obj.set({\n left: centerPos.x,\n top: centerPos.y,\n crossOrigin: 'Anonymous',\n });\n\n this.getCanvas().add(obj).setActiveObject(obj);\n }\n\n /**\n * Attach canvas's events\n */\n _attachCanvasEvents() {\n const canvas = this._canvas;\n const handler = this._handler;\n canvas.on({\n 'mouse:down': handler.onMouseDown,\n 'object:added': handler.onObjectAdded,\n 'object:removed': handler.onObjectRemoved,\n 'object:moving': handler.onObjectMoved,\n 'object:scaling': handler.onObjectScaled,\n 'object:modified': handler.onObjectModified,\n 'object:rotating': handler.onObjectRotated,\n 'path:created': handler.onPathCreated,\n 'selection:cleared': handler.onSelectionCleared,\n 'selection:created': handler.onSelectionCreated,\n 'selection:updated': handler.onObjectSelected,\n });\n }\n\n /**\n * \"mouse:down\" canvas event handler\n * @param {{target: fabric.Object, e: MouseEvent}} fEvent - Fabric event\n * @private\n */\n _onMouseDown(fEvent) {\n const { e: event, target } = fEvent;\n const originPointer = this._canvas.getPointer(event);\n\n if (target) {\n const { type } = target;\n const undoData = makeSelectionUndoData(target, (item) =>\n makeSelectionUndoDatum(this.getObjectId(item), item, type === 'activeSelection')\n );\n\n setCachedUndoDataForDimension(undoData);\n }\n\n this.fire(events.MOUSE_DOWN, event, originPointer);\n }\n\n /**\n * \"object:added\" canvas event handler\n * @param {{target: fabric.Object, e: MouseEvent}} fEvent - Fabric event\n * @private\n */\n _onObjectAdded(fEvent) {\n const obj = fEvent.target;\n if (obj.isType('cropzone')) {\n return;\n }\n\n this._addFabricObject(obj);\n }\n\n /**\n * \"object:removed\" canvas event handler\n * @param {{target: fabric.Object, e: MouseEvent}} fEvent - Fabric event\n * @private\n */\n _onObjectRemoved(fEvent) {\n const obj = fEvent.target;\n\n this._removeFabricObject(stamp(obj));\n }\n\n /**\n * \"object:moving\" canvas event handler\n * @param {{target: fabric.Object, e: MouseEvent}} fEvent - Fabric event\n * @private\n */\n _onObjectMoved(fEvent) {\n this._lazyFire(\n events.OBJECT_MOVED,\n (object) => this.createObjectProperties(object),\n fEvent.target\n );\n }\n\n /**\n * \"object:scaling\" canvas event handler\n * @param {{target: fabric.Object, e: MouseEvent}} fEvent - Fabric event\n * @private\n */\n _onObjectScaled(fEvent) {\n this._lazyFire(\n events.OBJECT_SCALED,\n (object) => this.createObjectProperties(object),\n fEvent.target\n );\n }\n\n /**\n * \"object:modified\" canvas event handler\n * @param {{target: fabric.Object, e: MouseEvent}} fEvent - Fabric event\n * @private\n */\n _onObjectModified(fEvent) {\n const { target } = fEvent;\n if (target.type === 'activeSelection') {\n const items = target.getObjects();\n\n items.forEach((item) => item.fire('modifiedInGroup', target));\n }\n\n this.fire(events.OBJECT_MODIFIED, target, this.getObjectId(target));\n }\n\n /**\n * \"object:rotating\" canvas event handler\n * @param {{target: fabric.Object, e: MouseEvent}} fEvent - Fabric event\n * @private\n */\n _onObjectRotated(fEvent) {\n this._lazyFire(\n events.OBJECT_ROTATED,\n (object) => this.createObjectProperties(object),\n fEvent.target\n );\n }\n\n /**\n * Lazy event emitter\n * @param {string} eventName - event name\n * @param {Function} paramsMaker - make param function\n * @param {Object} [target] - Object of the event owner.\n * @private\n */\n _lazyFire(eventName, paramsMaker, target) {\n const existEventDelegation = target && target.canvasEventDelegation;\n const delegationState = existEventDelegation ? target.canvasEventDelegation(eventName) : 'none';\n\n if (delegationState === 'unregistered') {\n target.canvasEventRegister(eventName, (object) => {\n this.fire(eventName, paramsMaker(object));\n });\n }\n\n if (delegationState === 'none') {\n this.fire(eventName, paramsMaker(target));\n }\n }\n\n /**\n * \"object:selected\" canvas event handler\n * @param {{target: fabric.Object, e: MouseEvent}} fEvent - Fabric event\n * @private\n */\n _onObjectSelected(fEvent) {\n const { target } = fEvent;\n const params = this.createObjectProperties(target);\n\n this.fire(events.OBJECT_ACTIVATED, params);\n }\n\n /**\n * \"path:created\" canvas event handler\n * @param {{path: fabric.Path}} obj - Path object\n * @private\n */\n _onPathCreated(obj) {\n const { x: left, y: top } = obj.path.getCenterPoint();\n obj.path.set(\n extend(\n {\n left,\n top,\n },\n fObjectOptions.SELECTION_STYLE\n )\n );\n\n const params = this.createObjectProperties(obj.path);\n\n this.fire(events.ADD_OBJECT, params);\n }\n\n /**\n * \"selction:cleared\" canvas event handler\n * @private\n */\n _onSelectionCleared() {\n this.fire(events.SELECTION_CLEARED);\n }\n\n /**\n * \"selction:created\" canvas event handler\n * @param {{target: fabric.Object, e: MouseEvent}} fEvent - Fabric event\n * @private\n */\n _onSelectionCreated(fEvent) {\n const { target } = fEvent;\n const params = this.createObjectProperties(target);\n\n this.fire(events.OBJECT_ACTIVATED, params);\n this.fire(events.SELECTION_CREATED, fEvent.target);\n }\n\n /**\n * Canvas discard selection all\n */\n discardSelection() {\n this._canvas.discardActiveObject();\n this._canvas.renderAll();\n }\n\n /**\n * Canvas Selectable status change\n * @param {boolean} selectable - expect status\n */\n changeSelectableAll(selectable) {\n this._canvas.forEachObject((obj) => {\n obj.selectable = selectable;\n obj.hoverCursor = selectable ? 'move' : 'crosshair';\n });\n }\n\n /**\n * Return object's properties\n * @param {fabric.Object} obj - fabric object\n * @returns {Object} properties object\n */\n createObjectProperties(obj) {\n const predefinedKeys = [\n 'left',\n 'top',\n 'width',\n 'height',\n 'fill',\n 'stroke',\n 'strokeWidth',\n 'opacity',\n 'angle',\n ];\n const props = {\n id: stamp(obj),\n type: obj.type,\n };\n\n extend(props, getProperties(obj, predefinedKeys));\n\n if (includes(['i-text', 'text'], obj.type)) {\n extend(props, this._createTextProperties(obj, props));\n } else if (includes(['rect', 'triangle', 'circle'], obj.type)) {\n const shapeComp = this.getComponent(components.SHAPE);\n extend(props, {\n fill: shapeComp.makeFillPropertyForUserEvent(obj),\n });\n }\n\n return props;\n }\n\n /**\n * Get text object's properties\n * @param {fabric.Object} obj - fabric text object\n * @param {Object} props - properties\n * @returns {Object} properties object\n */\n _createTextProperties(obj) {\n const predefinedKeys = [\n 'text',\n 'fontFamily',\n 'fontSize',\n 'fontStyle',\n 'textAlign',\n 'textDecoration',\n 'fontWeight',\n ];\n const props = {};\n extend(props, getProperties(obj, predefinedKeys));\n\n return props;\n }\n\n /**\n * Add object array by id\n * @param {fabric.Object} obj - fabric object\n * @returns {number} object id\n */\n _addFabricObject(obj) {\n const id = stamp(obj);\n this._objects[id] = obj;\n\n return id;\n }\n\n /**\n * Remove an object in array yb id\n * @param {number} id - object id\n */\n _removeFabricObject(id) {\n delete this._objects[id];\n }\n\n /**\n * Reset targetObjectForCopyPaste value from activeObject\n */\n resetTargetObjectForCopyPaste() {\n const activeObject = this.getActiveObject();\n\n if (activeObject) {\n this.targetObjectForCopyPaste = activeObject;\n }\n }\n\n /**\n * Paste fabric object\n * @returns {Promise}\n */\n pasteObject() {\n if (!this.targetObjectForCopyPaste) {\n return Promise.resolve([]);\n }\n\n const targetObject = this.targetObjectForCopyPaste;\n const isGroupSelect = targetObject.type === 'activeSelection';\n const targetObjects = isGroupSelect ? targetObject.getObjects() : [targetObject];\n let newTargetObject = null;\n\n this.discardSelection();\n\n return this._cloneObject(targetObjects).then((addedObjects) => {\n if (addedObjects.length > 1) {\n newTargetObject = this.getActiveSelectionFromObjects(addedObjects);\n } else {\n [newTargetObject] = addedObjects;\n }\n this.targetObjectForCopyPaste = newTargetObject;\n this.setActiveObject(newTargetObject);\n });\n }\n\n /**\n * Clone object\n * @param {fabric.Object} targetObjects - fabric object\n * @returns {Promise}\n * @private\n */\n _cloneObject(targetObjects) {\n const addedObjects = snippet.map(targetObjects, (targetObject) =>\n this._cloneObjectItem(targetObject)\n );\n\n return Promise.all(addedObjects);\n }\n\n /**\n * Clone object one item\n * @param {fabric.Object} targetObject - fabric object\n * @returns {Promise}\n * @private\n */\n _cloneObjectItem(targetObject) {\n return this._copyFabricObjectForPaste(targetObject).then((clonedObject) => {\n const objectProperties = this.createObjectProperties(clonedObject);\n this.add(clonedObject);\n\n this.fire(events.ADD_OBJECT, objectProperties);\n\n return clonedObject;\n });\n }\n\n /**\n * Copy fabric object with Changed position for copy and paste\n * @param {fabric.Object} targetObject - fabric object\n * @returns {Promise}\n * @private\n */\n _copyFabricObjectForPaste(targetObject) {\n const addExtraPx = (value, isReverse) =>\n isReverse ? value - EXTRA_PX_FOR_PASTE : value + EXTRA_PX_FOR_PASTE;\n\n return this._copyFabricObject(targetObject).then((clonedObject) => {\n const { left, top, width, height } = clonedObject;\n const { width: canvasWidth, height: canvasHeight } = this.getCanvasSize();\n const rightEdge = left + width / 2;\n const bottomEdge = top + height / 2;\n\n clonedObject.set(\n snippet.extend(\n {\n left: addExtraPx(left, rightEdge + EXTRA_PX_FOR_PASTE > canvasWidth),\n top: addExtraPx(top, bottomEdge + EXTRA_PX_FOR_PASTE > canvasHeight),\n },\n fObjectOptions.SELECTION_STYLE\n )\n );\n\n return clonedObject;\n });\n }\n\n /**\n * Copy fabric object\n * @param {fabric.Object} targetObject - fabric object\n * @returns {Promise}\n * @private\n */\n _copyFabricObject(targetObject) {\n return new Promise((resolve) => {\n targetObject.clone((cloned) => {\n const shapeComp = this.getComponent(components.SHAPE);\n if (isShape(cloned)) {\n shapeComp.processForCopiedObject(cloned, targetObject);\n }\n\n resolve(cloned);\n });\n });\n }\n}\n\nCustomEvents.mixin(Graphics);\n\nexport default Graphics;\n","/**\n * @author NHN. FE Development Team \n * @fileoverview Image loader\n */\nimport Component from '@/interface/component';\nimport { Promise } from '@/util';\nimport { componentNames, rejectMessages } from '@/consts';\n\nconst imageOption = {\n padding: 0,\n crossOrigin: 'Anonymous',\n};\n\n/**\n * ImageLoader components\n * @extends {Component}\n * @class ImageLoader\n * @param {Graphics} graphics - Graphics instance\n * @ignore\n */\nclass ImageLoader extends Component {\n constructor(graphics) {\n super(componentNames.IMAGE_LOADER, graphics);\n }\n\n /**\n * Load image from url\n * @param {?string} imageName - File name\n * @param {?(fabric.Image|string)} img - fabric.Image instance or URL of an image\n * @returns {Promise}\n */\n load(imageName, img) {\n let promise;\n\n if (!imageName && !img) {\n // Back to the initial state, not error.\n const canvas = this.getCanvas();\n\n canvas.backgroundImage = null;\n canvas.renderAll();\n\n promise = new Promise((resolve) => {\n this.setCanvasImage('', null);\n resolve();\n });\n } else {\n promise = this._setBackgroundImage(img).then((oImage) => {\n this.setCanvasImage(imageName, oImage);\n this.adjustCanvasDimension();\n\n return oImage;\n });\n }\n\n return promise;\n }\n\n /**\n * Set background image\n * @param {?(fabric.Image|String)} img fabric.Image instance or URL of an image to set background to\n * @returns {Promise}\n * @private\n */\n _setBackgroundImage(img) {\n if (!img) {\n return Promise.reject(rejectMessages.loadImage);\n }\n\n return new Promise((resolve, reject) => {\n const canvas = this.getCanvas();\n\n canvas.setBackgroundImage(\n img,\n () => {\n const oImage = canvas.backgroundImage;\n\n if (oImage && oImage.getElement()) {\n resolve(oImage);\n } else {\n reject(rejectMessages.loadingImageFailed);\n }\n },\n imageOption\n );\n });\n }\n}\n\nexport default ImageLoader;\n","/**\n * @author NHN. FE Development Team \n * @fileoverview Image crop module (start cropping, end cropping)\n */\nimport snippet from 'tui-code-snippet';\nimport fabric from 'fabric';\nimport Component from '@/interface/component';\nimport Cropzone from '@/extension/cropzone';\nimport { keyCodes, componentNames, CROPZONE_DEFAULT_OPTIONS } from '@/consts';\nimport { clamp, fixFloatingPoint } from '@/util';\n\nconst MOUSE_MOVE_THRESHOLD = 10;\nconst DEFAULT_OPTION = {\n presetRatio: null,\n top: -10,\n left: -10,\n height: 1,\n width: 1,\n};\n\n/**\n * Cropper components\n * @param {Graphics} graphics - Graphics instance\n * @extends {Component}\n * @class Cropper\n * @ignore\n */\nclass Cropper extends Component {\n constructor(graphics) {\n super(componentNames.CROPPER, graphics);\n\n /**\n * Cropzone\n * @type {Cropzone}\n * @private\n */\n this._cropzone = null;\n\n /**\n * StartX of Cropzone\n * @type {number}\n * @private\n */\n this._startX = null;\n\n /**\n * StartY of Cropzone\n * @type {number}\n * @private\n */\n this._startY = null;\n\n /**\n * State whether shortcut key is pressed or not\n * @type {boolean}\n * @private\n */\n this._withShiftKey = false;\n\n /**\n * Listeners\n * @type {object.}\n * @private\n */\n this._listeners = {\n keydown: this._onKeyDown.bind(this),\n keyup: this._onKeyUp.bind(this),\n mousedown: this._onFabricMouseDown.bind(this),\n mousemove: this._onFabricMouseMove.bind(this),\n mouseup: this._onFabricMouseUp.bind(this),\n };\n }\n\n /**\n * Start cropping\n */\n start() {\n if (this._cropzone) {\n return;\n }\n const canvas = this.getCanvas();\n\n canvas.forEachObject((obj) => {\n // {@link http://fabricjs.com/docs/fabric.Object.html#evented}\n obj.evented = false;\n });\n\n this._cropzone = new Cropzone(\n canvas,\n snippet.extend(\n {\n left: 0,\n top: 0,\n width: 0.5,\n height: 0.5,\n strokeWidth: 0, // {@link https://github.com/kangax/fabric.js/issues/2860}\n cornerSize: 10,\n cornerColor: 'black',\n fill: 'transparent',\n },\n CROPZONE_DEFAULT_OPTIONS,\n this.graphics.cropSelectionStyle\n )\n );\n\n canvas.discardActiveObject();\n canvas.add(this._cropzone);\n canvas.on('mouse:down', this._listeners.mousedown);\n canvas.selection = false;\n canvas.defaultCursor = 'crosshair';\n\n fabric.util.addListener(document, 'keydown', this._listeners.keydown);\n fabric.util.addListener(document, 'keyup', this._listeners.keyup);\n }\n\n /**\n * End cropping\n */\n end() {\n const canvas = this.getCanvas();\n const cropzone = this._cropzone;\n\n if (!cropzone) {\n return;\n }\n canvas.remove(cropzone);\n canvas.selection = true;\n canvas.defaultCursor = 'default';\n canvas.off('mouse:down', this._listeners.mousedown);\n canvas.forEachObject((obj) => {\n obj.evented = true;\n });\n\n this._cropzone = null;\n\n fabric.util.removeListener(document, 'keydown', this._listeners.keydown);\n fabric.util.removeListener(document, 'keyup', this._listeners.keyup);\n }\n\n /**\n * Change cropzone visible\n * @param {boolean} visible - cropzone visible state\n */\n changeVisibility(visible) {\n if (this._cropzone) {\n this._cropzone.set({ visible });\n }\n }\n\n /**\n * onMousedown handler in fabric canvas\n * @param {{target: fabric.Object, e: MouseEvent}} fEvent - Fabric event\n * @private\n */\n _onFabricMouseDown(fEvent) {\n const canvas = this.getCanvas();\n\n if (fEvent.target) {\n return;\n }\n\n canvas.selection = false;\n const coord = canvas.getPointer(fEvent.e);\n\n this._startX = coord.x;\n this._startY = coord.y;\n\n canvas.on({\n 'mouse:move': this._listeners.mousemove,\n 'mouse:up': this._listeners.mouseup,\n });\n }\n\n /**\n * onMousemove handler in fabric canvas\n * @param {{target: fabric.Object, e: MouseEvent}} fEvent - Fabric event\n * @private\n */\n _onFabricMouseMove(fEvent) {\n const canvas = this.getCanvas();\n const pointer = canvas.getPointer(fEvent.e);\n const { x, y } = pointer;\n const cropzone = this._cropzone;\n\n if (Math.abs(x - this._startX) + Math.abs(y - this._startY) > MOUSE_MOVE_THRESHOLD) {\n canvas.remove(cropzone);\n cropzone.set(this._calcRectDimensionFromPoint(x, y));\n\n canvas.add(cropzone);\n canvas.setActiveObject(cropzone);\n }\n }\n\n /**\n * Get rect dimension setting from Canvas-Mouse-Position(x, y)\n * @param {number} x - Canvas-Mouse-Position x\n * @param {number} y - Canvas-Mouse-Position Y\n * @returns {{left: number, top: number, width: number, height: number}}\n * @private\n */\n _calcRectDimensionFromPoint(x, y) {\n const canvas = this.getCanvas();\n const canvasWidth = canvas.getWidth();\n const canvasHeight = canvas.getHeight();\n const startX = this._startX;\n const startY = this._startY;\n let left = clamp(x, 0, startX);\n let top = clamp(y, 0, startY);\n let width = clamp(x, startX, canvasWidth) - left; // (startX <= x(mouse) <= canvasWidth) - left\n let height = clamp(y, startY, canvasHeight) - top; // (startY <= y(mouse) <= canvasHeight) - top\n\n if (this._withShiftKey) {\n // make fixed ratio cropzone\n if (width > height) {\n height = width;\n } else if (height > width) {\n width = height;\n }\n\n if (startX >= x) {\n left = startX - width;\n }\n\n if (startY >= y) {\n top = startY - height;\n }\n }\n\n return {\n left,\n top,\n width,\n height,\n };\n }\n\n /**\n * onMouseup handler in fabric canvas\n * @private\n */\n _onFabricMouseUp() {\n const cropzone = this._cropzone;\n const listeners = this._listeners;\n const canvas = this.getCanvas();\n\n canvas.setActiveObject(cropzone);\n canvas.off({\n 'mouse:move': listeners.mousemove,\n 'mouse:up': listeners.mouseup,\n });\n }\n\n /**\n * Get cropped image data\n * @param {Object} cropRect cropzone rect\n * @param {Number} cropRect.left left position\n * @param {Number} cropRect.top top position\n * @param {Number} cropRect.width width\n * @param {Number} cropRect.height height\n * @returns {?{imageName: string, url: string}} cropped Image data\n */\n getCroppedImageData(cropRect) {\n const canvas = this.getCanvas();\n const containsCropzone = canvas.contains(this._cropzone);\n if (!cropRect) {\n return null;\n }\n\n if (containsCropzone) {\n canvas.remove(this._cropzone);\n }\n\n const imageData = {\n imageName: this.getImageName(),\n url: canvas.toDataURL(cropRect),\n };\n\n if (containsCropzone) {\n canvas.add(this._cropzone);\n }\n\n return imageData;\n }\n\n /**\n * Get cropped rect\n * @returns {Object} rect\n */\n getCropzoneRect() {\n const cropzone = this._cropzone;\n\n if (!cropzone.isValid()) {\n return null;\n }\n\n return {\n left: cropzone.left,\n top: cropzone.top,\n width: cropzone.width,\n height: cropzone.height,\n };\n }\n\n /**\n * Set a cropzone square\n * @param {number} [presetRatio] - preset ratio\n */\n setCropzoneRect(presetRatio) {\n const canvas = this.getCanvas();\n const cropzone = this._cropzone;\n\n canvas.discardActiveObject();\n canvas.selection = false;\n canvas.remove(cropzone);\n\n cropzone.set(presetRatio ? this._getPresetPropertiesForCropSize(presetRatio) : DEFAULT_OPTION);\n\n canvas.add(cropzone);\n canvas.selection = true;\n\n if (presetRatio) {\n canvas.setActiveObject(cropzone);\n }\n }\n\n /**\n * get a cropzone square info\n * @param {number} presetRatio - preset ratio\n * @returns {{presetRatio: number, left: number, top: number, width: number, height: number}}\n * @private\n */\n _getPresetPropertiesForCropSize(presetRatio) {\n const canvas = this.getCanvas();\n const originalWidth = canvas.getWidth();\n const originalHeight = canvas.getHeight();\n\n const standardSize = originalWidth >= originalHeight ? originalWidth : originalHeight;\n const getScale = (value, orignalValue) => (value > orignalValue ? orignalValue / value : 1);\n\n let width = standardSize * presetRatio;\n let height = standardSize;\n\n const scaleWidth = getScale(width, originalWidth);\n [width, height] = snippet.map([width, height], (sizeValue) => sizeValue * scaleWidth);\n\n const scaleHeight = getScale(height, originalHeight);\n [width, height] = snippet.map([width, height], (sizeValue) =>\n fixFloatingPoint(sizeValue * scaleHeight)\n );\n\n return {\n presetRatio,\n top: (originalHeight - height) / 2,\n left: (originalWidth - width) / 2,\n width,\n height,\n };\n }\n\n /**\n * Keydown event handler\n * @param {KeyboardEvent} e - Event object\n * @private\n */\n _onKeyDown(e) {\n if (e.keyCode === keyCodes.SHIFT) {\n this._withShiftKey = true;\n }\n }\n\n /**\n * Keyup event handler\n * @param {KeyboardEvent} e - Event object\n * @private\n */\n _onKeyUp(e) {\n if (e.keyCode === keyCodes.SHIFT) {\n this._withShiftKey = false;\n }\n }\n}\n\nexport default Cropper;\n","/**\n * @author NHN. FE Development Team \n * @fileoverview Cropzone extending fabric.Rect\n */\nimport snippet from 'tui-code-snippet';\nimport fabric from 'fabric';\nimport { clamp } from '@/util';\nimport { eventNames as events, keyCodes } from '@/consts';\n\nconst CORNER_TYPE_TOP_LEFT = 'tl';\nconst CORNER_TYPE_TOP_RIGHT = 'tr';\nconst CORNER_TYPE_MIDDLE_TOP = 'mt';\nconst CORNER_TYPE_MIDDLE_LEFT = 'ml';\nconst CORNER_TYPE_MIDDLE_RIGHT = 'mr';\nconst CORNER_TYPE_MIDDLE_BOTTOM = 'mb';\nconst CORNER_TYPE_BOTTOM_LEFT = 'bl';\nconst CORNER_TYPE_BOTTOM_RIGHT = 'br';\nconst CORNER_TYPE_LIST = [\n CORNER_TYPE_TOP_LEFT,\n CORNER_TYPE_TOP_RIGHT,\n CORNER_TYPE_MIDDLE_TOP,\n CORNER_TYPE_MIDDLE_LEFT,\n CORNER_TYPE_MIDDLE_RIGHT,\n CORNER_TYPE_MIDDLE_BOTTOM,\n CORNER_TYPE_BOTTOM_LEFT,\n CORNER_TYPE_BOTTOM_RIGHT,\n];\nconst NOOP_FUNCTION = () => {};\n\n/**\n * Align with cropzone ratio\n * @param {string} selectedCorner - selected corner type\n * @returns {{width: number, height: number}}\n * @private\n */\nfunction cornerTypeValid(selectedCorner) {\n return CORNER_TYPE_LIST.indexOf(selectedCorner) >= 0;\n}\n\n/**\n * return scale basis type\n * @param {number} diffX - X distance of the cursor and corner.\n * @param {number} diffY - Y distance of the cursor and corner.\n * @returns {string}\n * @private\n */\nfunction getScaleBasis(diffX, diffY) {\n return diffX > diffY ? 'width' : 'height';\n}\n\n/**\n * Cropzone object\n * Issue: IE7, 8(with excanvas)\n * - Cropzone is a black zone without transparency.\n * @class Cropzone\n * @extends {fabric.Rect}\n * @ignore\n */\nconst Cropzone = fabric.util.createClass(\n fabric.Rect,\n /** @lends Cropzone.prototype */ {\n /**\n * Constructor\n * @param {Object} canvas canvas\n * @param {Object} options Options object\n * @param {Object} extendsOptions object for extends \"options\"\n * @override\n */\n initialize(canvas, options, extendsOptions) {\n options = snippet.extend(options, extendsOptions);\n options.type = 'cropzone';\n\n this.callSuper('initialize', options);\n this._addEventHandler();\n\n this.canvas = canvas;\n this.options = options;\n },\n canvasEventDelegation(eventName) {\n let delegationState = 'unregistered';\n const isRegistered = this.canvasEventTrigger[eventName] !== NOOP_FUNCTION;\n if (isRegistered) {\n delegationState = 'registered';\n } else if ([events.OBJECT_MOVED, events.OBJECT_SCALED].indexOf(eventName) < 0) {\n delegationState = 'none';\n }\n\n return delegationState;\n },\n canvasEventRegister(eventName, eventTrigger) {\n this.canvasEventTrigger[eventName] = eventTrigger;\n },\n _addEventHandler() {\n this.canvasEventTrigger = {\n [events.OBJECT_MOVED]: NOOP_FUNCTION,\n [events.OBJECT_SCALED]: NOOP_FUNCTION,\n };\n this.on({\n moving: this._onMoving.bind(this),\n scaling: this._onScaling.bind(this),\n });\n fabric.util.addListener(document, 'keydown', this._onKeyDown.bind(this));\n fabric.util.addListener(document, 'keyup', this._onKeyUp.bind(this));\n },\n _renderCropzone(ctx) {\n const cropzoneDashLineWidth = 7;\n const cropzoneDashLineOffset = 7;\n\n // Calc original scale\n const originalFlipX = this.flipX ? -1 : 1;\n const originalFlipY = this.flipY ? -1 : 1;\n const originalScaleX = originalFlipX / this.scaleX;\n const originalScaleY = originalFlipY / this.scaleY;\n\n // Set original scale\n ctx.scale(originalScaleX, originalScaleY);\n\n // Render outer rect\n this._fillOuterRect(ctx, 'rgba(0, 0, 0, 0.5)');\n\n if (this.options.lineWidth) {\n this._fillInnerRect(ctx);\n this._strokeBorder(ctx, 'rgb(255, 255, 255)', {\n lineWidth: this.options.lineWidth,\n });\n } else {\n // Black dash line\n this._strokeBorder(ctx, 'rgb(0, 0, 0)', {\n lineDashWidth: cropzoneDashLineWidth,\n });\n\n // White dash line\n this._strokeBorder(ctx, 'rgb(255, 255, 255)', {\n lineDashWidth: cropzoneDashLineWidth,\n lineDashOffset: cropzoneDashLineOffset,\n });\n }\n\n // Reset scale\n ctx.scale(1 / originalScaleX, 1 / originalScaleY);\n },\n\n /**\n * Render Crop-zone\n * @private\n * @override\n */\n _render(ctx) {\n this.callSuper('_render', ctx);\n\n this._renderCropzone(ctx);\n },\n\n /**\n * Cropzone-coordinates with outer rectangle\n *\n * x0 x1 x2 x3\n * y0 +--------------------------+\n * |///////|//////////|///////| // <--- \"Outer-rectangle\"\n * |///////|//////////|///////|\n * y1 +-------+----------+-------+\n * |///////| Cropzone |///////| Cropzone is the \"Inner-rectangle\"\n * |///////| (0, 0) |///////| Center point (0, 0)\n * y2 +-------+----------+-------+\n * |///////|//////////|///////|\n * |///////|//////////|///////|\n * y3 +--------------------------+\n *\n * @typedef {{x: Array, y: Array}} cropzoneCoordinates\n * @ignore\n */\n\n /**\n * Fill outer rectangle\n * @param {CanvasRenderingContext2D} ctx - Context\n * @param {string|CanvasGradient|CanvasPattern} fillStyle - Fill-style\n * @private\n */\n _fillOuterRect(ctx, fillStyle) {\n const { x, y } = this._getCoordinates();\n\n ctx.save();\n ctx.fillStyle = fillStyle;\n ctx.beginPath();\n\n // Outer rectangle\n // Numbers are +/-1 so that overlay edges don't get blurry.\n ctx.moveTo(x[0] - 1, y[0] - 1);\n ctx.lineTo(x[3] + 1, y[0] - 1);\n ctx.lineTo(x[3] + 1, y[3] + 1);\n ctx.lineTo(x[0] - 1, y[3] + 1);\n ctx.lineTo(x[0] - 1, y[0] - 1);\n ctx.closePath();\n\n // Inner rectangle\n ctx.moveTo(x[1], y[1]);\n ctx.lineTo(x[1], y[2]);\n ctx.lineTo(x[2], y[2]);\n ctx.lineTo(x[2], y[1]);\n ctx.lineTo(x[1], y[1]);\n ctx.closePath();\n\n ctx.fill();\n ctx.restore();\n },\n\n /**\n * Draw Inner grid line\n * @param {CanvasRenderingContext2D} ctx - Context\n * @private\n */\n _fillInnerRect(ctx) {\n const { x: outerX, y: outerY } = this._getCoordinates();\n const x = this._caculateInnerPosition(outerX, (outerX[2] - outerX[1]) / 3);\n const y = this._caculateInnerPosition(outerY, (outerY[2] - outerY[1]) / 3);\n\n ctx.save();\n ctx.strokeStyle = 'rgba(255, 255, 255, 0.7)';\n ctx.lineWidth = this.options.lineWidth;\n ctx.beginPath();\n\n ctx.moveTo(x[0], y[1]);\n ctx.lineTo(x[3], y[1]);\n\n ctx.moveTo(x[0], y[2]);\n ctx.lineTo(x[3], y[2]);\n\n ctx.moveTo(x[1], y[0]);\n ctx.lineTo(x[1], y[3]);\n\n ctx.moveTo(x[2], y[0]);\n ctx.lineTo(x[2], y[3]);\n ctx.stroke();\n ctx.closePath();\n\n ctx.restore();\n },\n\n /**\n * Calculate Inner Position\n * @param {Array} outer - outer position\n * @param {number} size - interval for calculate\n * @returns {Array} - inner position\n * @private\n */\n _caculateInnerPosition(outer, size) {\n const position = [];\n position[0] = outer[1];\n position[1] = outer[1] + size;\n position[2] = outer[1] + size * 2;\n position[3] = outer[2];\n\n return position;\n },\n\n /**\n * Get coordinates\n * @returns {cropzoneCoordinates} - {@link cropzoneCoordinates}\n * @private\n */\n _getCoordinates() {\n const { canvas, width, height, left, top } = this;\n const halfWidth = width / 2;\n const halfHeight = height / 2;\n const canvasHeight = canvas.getHeight(); // fabric object\n const canvasWidth = canvas.getWidth(); // fabric object\n\n return {\n x: snippet.map(\n [\n -(halfWidth + left), // x0\n -halfWidth, // x1\n halfWidth, // x2\n halfWidth + (canvasWidth - left - width), // x3\n ],\n Math.ceil\n ),\n y: snippet.map(\n [\n -(halfHeight + top), // y0\n -halfHeight, // y1\n halfHeight, // y2\n halfHeight + (canvasHeight - top - height), // y3\n ],\n Math.ceil\n ),\n };\n },\n\n /**\n * Stroke border\n * @param {CanvasRenderingContext2D} ctx - Context\n * @param {string|CanvasGradient|CanvasPattern} strokeStyle - Stroke-style\n * @param {number} lineDashWidth - Dash width\n * @param {number} [lineDashOffset] - Dash offset\n * @param {number} [lineWidth] - line width\n * @private\n */\n _strokeBorder(ctx, strokeStyle, { lineDashWidth, lineDashOffset, lineWidth }) {\n const halfWidth = this.width / 2;\n const halfHeight = this.height / 2;\n\n ctx.save();\n ctx.strokeStyle = strokeStyle;\n\n if (ctx.setLineDash) {\n ctx.setLineDash([lineDashWidth, lineDashWidth]);\n }\n if (lineDashOffset) {\n ctx.lineDashOffset = lineDashOffset;\n }\n if (lineWidth) {\n ctx.lineWidth = lineWidth;\n }\n\n ctx.beginPath();\n ctx.moveTo(-halfWidth, -halfHeight);\n ctx.lineTo(halfWidth, -halfHeight);\n ctx.lineTo(halfWidth, halfHeight);\n ctx.lineTo(-halfWidth, halfHeight);\n ctx.lineTo(-halfWidth, -halfHeight);\n ctx.stroke();\n\n ctx.restore();\n },\n\n /**\n * onMoving event listener\n * @private\n */\n _onMoving() {\n const { height, width, left, top } = this;\n const maxLeft = this.canvas.getWidth() - width;\n const maxTop = this.canvas.getHeight() - height;\n\n this.left = clamp(left, 0, maxLeft);\n this.top = clamp(top, 0, maxTop);\n\n this.canvasEventTrigger[events.OBJECT_MOVED](this);\n },\n\n /**\n * onScaling event listener\n * @param {{e: MouseEvent}} fEvent - Fabric event\n * @private\n */\n _onScaling(fEvent) {\n const selectedCorner = fEvent.transform.corner;\n const pointer = this.canvas.getPointer(fEvent.e);\n const settings = this._calcScalingSizeFromPointer(pointer, selectedCorner);\n\n // On scaling cropzone,\n // change real width and height and fix scaleFactor to 1\n this.scale(1).set(settings);\n\n this.canvasEventTrigger[events.OBJECT_SCALED](this);\n },\n\n /**\n * Calc scaled size from mouse pointer with selected corner\n * @param {{x: number, y: number}} pointer - Mouse position\n * @param {string} selectedCorner - selected corner type\n * @returns {Object} Having left or(and) top or(and) width or(and) height.\n * @private\n */\n _calcScalingSizeFromPointer(pointer, selectedCorner) {\n const isCornerTypeValid = cornerTypeValid(selectedCorner);\n\n return isCornerTypeValid && this._resizeCropZone(pointer, selectedCorner);\n },\n\n /**\n * Align with cropzone ratio\n * @param {number} width - cropzone width\n * @param {number} height - cropzone height\n * @param {number} maxWidth - limit max width\n * @param {number} maxHeight - limit max height\n * @param {number} scaleTo - cropzone ratio\n * @returns {{width: number, height: number}}\n * @private\n */\n adjustRatioCropzoneSize({ width, height, leftMaker, topMaker, maxWidth, maxHeight, scaleTo }) {\n width = maxWidth ? clamp(width, 1, maxWidth) : width;\n height = maxHeight ? clamp(height, 1, maxHeight) : height;\n\n if (!this.presetRatio) {\n if (this._withShiftKey) {\n // make fixed ratio cropzone\n if (width > height) {\n height = width;\n } else if (height > width) {\n width = height;\n }\n }\n\n return {\n width,\n height,\n left: leftMaker(width),\n top: topMaker(height),\n };\n }\n\n if (scaleTo === 'width') {\n height = width / this.presetRatio;\n } else {\n width = height * this.presetRatio;\n }\n\n const maxScaleFactor = Math.min(maxWidth / width, maxHeight / height);\n if (maxScaleFactor <= 1) {\n [width, height] = [width, height].map((v) => v * maxScaleFactor);\n }\n\n return {\n width,\n height,\n left: leftMaker(width),\n top: topMaker(height),\n };\n },\n\n /**\n * Get dimension last state cropzone\n * @returns {{rectTop: number, rectLeft: number, rectWidth: number, rectHeight: number}}\n * @private\n */\n _getCropzoneRectInfo() {\n const { width: canvasWidth, height: canvasHeight } = this.canvas;\n const {\n top: rectTop,\n left: rectLeft,\n width: rectWidth,\n height: rectHeight,\n } = this.getBoundingRect(false, true);\n\n return {\n rectTop,\n rectLeft,\n rectWidth,\n rectHeight,\n rectRight: rectLeft + rectWidth,\n rectBottom: rectTop + rectHeight,\n canvasWidth,\n canvasHeight,\n };\n },\n\n /**\n * Calc scaling dimension\n * @param {Object} position - Mouse position\n * @param {string} corner - corner type\n * @returns {{left: number, top: number, width: number, height: number}}\n * @private\n */\n _resizeCropZone({ x, y }, corner) {\n const {\n rectWidth,\n rectHeight,\n rectTop,\n rectLeft,\n rectBottom,\n rectRight,\n canvasWidth,\n canvasHeight,\n } = this._getCropzoneRectInfo();\n\n const resizeInfoMap = {\n tl: {\n width: rectRight - x,\n height: rectBottom - y,\n leftMaker: (newWidth) => rectRight - newWidth,\n topMaker: (newHeight) => rectBottom - newHeight,\n maxWidth: rectRight,\n maxHeight: rectBottom,\n scaleTo: getScaleBasis(rectLeft - x, rectTop - y),\n },\n tr: {\n width: x - rectLeft,\n height: rectBottom - y,\n leftMaker: () => rectLeft,\n topMaker: (newHeight) => rectBottom - newHeight,\n maxWidth: canvasWidth - rectLeft,\n maxHeight: rectBottom,\n scaleTo: getScaleBasis(x - rectRight, rectTop - y),\n },\n mt: {\n width: rectWidth,\n height: rectBottom - y,\n leftMaker: () => rectLeft,\n topMaker: (newHeight) => rectBottom - newHeight,\n maxWidth: canvasWidth - rectLeft,\n maxHeight: rectBottom,\n scaleTo: 'height',\n },\n ml: {\n width: rectRight - x,\n height: rectHeight,\n leftMaker: (newWidth) => rectRight - newWidth,\n topMaker: () => rectTop,\n maxWidth: rectRight,\n maxHeight: canvasHeight - rectTop,\n scaleTo: 'width',\n },\n mr: {\n width: x - rectLeft,\n height: rectHeight,\n leftMaker: () => rectLeft,\n topMaker: () => rectTop,\n maxWidth: canvasWidth - rectLeft,\n maxHeight: canvasHeight - rectTop,\n scaleTo: 'width',\n },\n mb: {\n width: rectWidth,\n height: y - rectTop,\n leftMaker: () => rectLeft,\n topMaker: () => rectTop,\n maxWidth: canvasWidth - rectLeft,\n maxHeight: canvasHeight - rectTop,\n scaleTo: 'height',\n },\n bl: {\n width: rectRight - x,\n height: y - rectTop,\n leftMaker: (newWidth) => rectRight - newWidth,\n topMaker: () => rectTop,\n maxWidth: rectRight,\n maxHeight: canvasHeight - rectTop,\n scaleTo: getScaleBasis(rectLeft - x, y - rectBottom),\n },\n br: {\n width: x - rectLeft,\n height: y - rectTop,\n leftMaker: () => rectLeft,\n topMaker: () => rectTop,\n maxWidth: canvasWidth - rectLeft,\n maxHeight: canvasHeight - rectTop,\n scaleTo: getScaleBasis(x - rectRight, y - rectBottom),\n },\n };\n\n return this.adjustRatioCropzoneSize(resizeInfoMap[corner]);\n },\n\n /**\n * Return the whether this cropzone is valid\n * @returns {boolean}\n */\n isValid() {\n return this.left >= 0 && this.top >= 0 && this.width > 0 && this.height > 0;\n },\n\n /**\n * Keydown event handler\n * @param {{number}} keyCode - Event keyCode\n * @private\n */\n _onKeyDown({ keyCode }) {\n if (keyCode === keyCodes.SHIFT) {\n this._withShiftKey = true;\n }\n },\n\n /**\n * Keyup event handler\n * @param {{number}} keyCode - Event keyCode\n * @private\n */\n _onKeyUp({ keyCode }) {\n if (keyCode === keyCodes.SHIFT) {\n this._withShiftKey = false;\n }\n },\n }\n);\n\nexport default Cropzone;\n","/**\n * @author NHN. FE Development Team \n * @fileoverview Image flip module\n */\nimport snippet from 'tui-code-snippet';\nimport Component from '@/interface/component';\nimport { Promise } from '@/util';\nimport { componentNames, rejectMessages } from '@/consts';\n\n/**\n * Flip\n * @class Flip\n * @param {Graphics} graphics - Graphics instance\n * @extends {Component}\n * @ignore\n */\nclass Flip extends Component {\n constructor(graphics) {\n super(componentNames.FLIP, graphics);\n }\n\n /**\n * Get current flip settings\n * @returns {{flipX: Boolean, flipY: Boolean}}\n */\n getCurrentSetting() {\n const canvasImage = this.getCanvasImage();\n\n return {\n flipX: canvasImage.flipX,\n flipY: canvasImage.flipY,\n };\n }\n\n /**\n * Set flipX, flipY\n * @param {{flipX: Boolean, flipY: Boolean}} newSetting - Flip setting\n * @returns {Promise}\n */\n set(newSetting) {\n const setting = this.getCurrentSetting();\n const isChangingFlipX = setting.flipX !== newSetting.flipX;\n const isChangingFlipY = setting.flipY !== newSetting.flipY;\n\n if (!isChangingFlipX && !isChangingFlipY) {\n return Promise.reject(rejectMessages.flip);\n }\n\n snippet.extend(setting, newSetting);\n this.setImageProperties(setting, true);\n this._invertAngle(isChangingFlipX, isChangingFlipY);\n this._flipObjects(isChangingFlipX, isChangingFlipY);\n\n return Promise.resolve({\n flipX: setting.flipX,\n flipY: setting.flipY,\n angle: this.getCanvasImage().angle,\n });\n }\n\n /**\n * Invert image angle for flip\n * @param {boolean} isChangingFlipX - Change flipX\n * @param {boolean} isChangingFlipY - Change flipY\n */\n _invertAngle(isChangingFlipX, isChangingFlipY) {\n const canvasImage = this.getCanvasImage();\n let { angle } = canvasImage;\n\n if (isChangingFlipX) {\n angle *= -1;\n }\n if (isChangingFlipY) {\n angle *= -1;\n }\n canvasImage.rotate(parseFloat(angle)).setCoords(); // parseFloat for -0 to 0\n }\n\n /**\n * Flip objects\n * @param {boolean} isChangingFlipX - Change flipX\n * @param {boolean} isChangingFlipY - Change flipY\n * @private\n */\n _flipObjects(isChangingFlipX, isChangingFlipY) {\n const canvas = this.getCanvas();\n\n if (isChangingFlipX) {\n canvas.forEachObject((obj) => {\n obj\n .set({\n angle: parseFloat(obj.angle * -1), // parseFloat for -0 to 0\n flipX: !obj.flipX,\n left: canvas.width - obj.left,\n })\n .setCoords();\n });\n }\n if (isChangingFlipY) {\n canvas.forEachObject((obj) => {\n obj\n .set({\n angle: parseFloat(obj.angle * -1), // parseFloat for -0 to 0\n flipY: !obj.flipY,\n top: canvas.height - obj.top,\n })\n .setCoords();\n });\n }\n canvas.renderAll();\n }\n\n /**\n * Reset flip settings\n * @returns {Promise}\n */\n reset() {\n return this.set({\n flipX: false,\n flipY: false,\n });\n }\n\n /**\n * Flip x\n * @returns {Promise}\n */\n flipX() {\n const current = this.getCurrentSetting();\n\n return this.set({\n flipX: !current.flipX,\n flipY: current.flipY,\n });\n }\n\n /**\n * Flip y\n * @returns {Promise}\n */\n flipY() {\n const current = this.getCurrentSetting();\n\n return this.set({\n flipX: current.flipX,\n flipY: !current.flipY,\n });\n }\n}\n\nexport default Flip;\n","/**\n * @author NHN. FE Development Team \n * @fileoverview Image rotation module\n */\nimport fabric from 'fabric';\nimport Component from '@/interface/component';\nimport { Promise } from '@/util';\nimport { componentNames } from '@/consts';\n\n/**\n * Image Rotation component\n * @class Rotation\n * @extends {Component}\n * @param {Graphics} graphics - Graphics instance\n * @ignore\n */\nclass Rotation extends Component {\n constructor(graphics) {\n super(componentNames.ROTATION, graphics);\n }\n\n /**\n * Get current angle\n * @returns {Number}\n */\n getCurrentAngle() {\n return this.getCanvasImage().angle;\n }\n\n /**\n * Set angle of the image\n *\n * Do not call \"this.setImageProperties\" for setting angle directly.\n * Before setting angle, The originX,Y of image should be set to center.\n * See \"http://fabricjs.com/docs/fabric.Object.html#setAngle\"\n *\n * @param {number} angle - Angle value\n * @returns {Promise}\n */\n setAngle(angle) {\n const oldAngle = this.getCurrentAngle() % 360; // The angle is lower than 2*PI(===360 degrees)\n\n angle %= 360;\n\n const canvasImage = this.getCanvasImage();\n const oldImageCenter = canvasImage.getCenterPoint();\n canvasImage.set({ angle }).setCoords();\n this.adjustCanvasDimension();\n const newImageCenter = canvasImage.getCenterPoint();\n this._rotateForEachObject(oldImageCenter, newImageCenter, angle - oldAngle);\n\n return Promise.resolve(angle);\n }\n\n /**\n * Rotate for each object\n * @param {fabric.Point} oldImageCenter - Image center point before rotation\n * @param {fabric.Point} newImageCenter - Image center point after rotation\n * @param {number} angleDiff - Image angle difference after rotation\n * @private\n */\n _rotateForEachObject(oldImageCenter, newImageCenter, angleDiff) {\n const canvas = this.getCanvas();\n const centerDiff = {\n x: oldImageCenter.x - newImageCenter.x,\n y: oldImageCenter.y - newImageCenter.y,\n };\n\n canvas.forEachObject((obj) => {\n const objCenter = obj.getCenterPoint();\n const radian = fabric.util.degreesToRadians(angleDiff);\n const newObjCenter = fabric.util.rotatePoint(objCenter, oldImageCenter, radian);\n\n obj.set({\n left: newObjCenter.x - centerDiff.x,\n top: newObjCenter.y - centerDiff.y,\n angle: (obj.angle + angleDiff) % 360,\n });\n obj.setCoords();\n });\n canvas.renderAll();\n }\n\n /**\n * Rotate the image\n * @param {number} additionalAngle - Additional angle\n * @returns {Promise}\n */\n rotate(additionalAngle) {\n const current = this.getCurrentAngle();\n\n return this.setAngle(current + additionalAngle);\n }\n}\n\nexport default Rotation;\n","/**\n * @author NHN. FE Development Team \n * @fileoverview Free drawing module, Set brush\n */\nimport fabric from 'fabric';\nimport Component from '@/interface/component';\nimport { componentNames } from '@/consts';\n\n/**\n * FreeDrawing\n * @class FreeDrawing\n * @param {Graphics} graphics - Graphics instance\n * @extends {Component}\n * @ignore\n */\nclass FreeDrawing extends Component {\n constructor(graphics) {\n super(componentNames.FREE_DRAWING, graphics);\n\n /**\n * Brush width\n * @type {number}\n */\n this.width = 12;\n\n /**\n * fabric.Color instance for brush color\n * @type {fabric.Color}\n */\n this.oColor = new fabric.Color('rgba(0, 0, 0, 0.5)');\n }\n\n /**\n * Start free drawing mode\n * @param {{width: ?number, color: ?string}} [setting] - Brush width & color\n */\n start(setting) {\n const canvas = this.getCanvas();\n\n canvas.isDrawingMode = true;\n this.setBrush(setting);\n }\n\n /**\n * Set brush\n * @param {{width: ?number, color: ?string}} [setting] - Brush width & color\n */\n setBrush(setting) {\n const brush = this.getCanvas().freeDrawingBrush;\n\n setting = setting || {};\n this.width = setting.width || this.width;\n if (setting.color) {\n this.oColor = new fabric.Color(setting.color);\n }\n brush.width = this.width;\n brush.color = this.oColor.toRgba();\n }\n\n /**\n * End free drawing mode\n */\n end() {\n const canvas = this.getCanvas();\n\n canvas.isDrawingMode = false;\n }\n}\n\nexport default FreeDrawing;\n","/**\n * @author NHN. FE Development Team \n * @fileoverview Free drawing module, Set brush\n */\nimport snippet from 'tui-code-snippet';\nimport fabric from 'fabric';\nimport Component from '@/interface/component';\nimport ArrowLine from '@/extension/arrowLine';\nimport { eventNames, componentNames, fObjectOptions } from '@/consts';\n\n/**\n * Line\n * @class Line\n * @param {Graphics} graphics - Graphics instance\n * @extends {Component}\n * @ignore\n */\nclass Line extends Component {\n constructor(graphics) {\n super(componentNames.LINE, graphics);\n\n /**\n * Brush width\n * @type {number}\n * @private\n */\n this._width = 12;\n\n /**\n * fabric.Color instance for brush color\n * @type {fabric.Color}\n * @private\n */\n this._oColor = new fabric.Color('rgba(0, 0, 0, 0.5)');\n\n /**\n * Listeners\n * @type {object.}\n * @private\n */\n this._listeners = {\n mousedown: this._onFabricMouseDown.bind(this),\n mousemove: this._onFabricMouseMove.bind(this),\n mouseup: this._onFabricMouseUp.bind(this),\n };\n }\n\n /**\n * Start drawing line mode\n * @param {{width: ?number, color: ?string}} [setting] - Brush width & color\n */\n setHeadOption(setting) {\n const {\n arrowType = {\n head: null,\n tail: null,\n },\n } = setting;\n\n this._arrowType = arrowType;\n }\n\n /**\n * Start drawing line mode\n * @param {{width: ?number, color: ?string}} [setting] - Brush width & color\n */\n start(setting = {}) {\n const canvas = this.getCanvas();\n\n canvas.defaultCursor = 'crosshair';\n canvas.selection = false;\n\n this.setHeadOption(setting);\n this.setBrush(setting);\n\n canvas.forEachObject((obj) => {\n obj.set({\n evented: false,\n });\n });\n\n canvas.on({\n 'mouse:down': this._listeners.mousedown,\n });\n }\n\n /**\n * Set brush\n * @param {{width: ?number, color: ?string}} [setting] - Brush width & color\n */\n setBrush(setting) {\n const brush = this.getCanvas().freeDrawingBrush;\n\n setting = setting || {};\n this._width = setting.width || this._width;\n\n if (setting.color) {\n this._oColor = new fabric.Color(setting.color);\n }\n brush.width = this._width;\n brush.color = this._oColor.toRgba();\n }\n\n /**\n * End drawing line mode\n */\n end() {\n const canvas = this.getCanvas();\n\n canvas.defaultCursor = 'default';\n canvas.selection = true;\n\n canvas.forEachObject((obj) => {\n obj.set({\n evented: true,\n });\n });\n\n canvas.off('mouse:down', this._listeners.mousedown);\n }\n\n /**\n * Mousedown event handler in fabric canvas\n * @param {{target: fabric.Object, e: MouseEvent}} fEvent - Fabric event object\n * @private\n */\n _onFabricMouseDown(fEvent) {\n const canvas = this.getCanvas();\n const { x, y } = canvas.getPointer(fEvent.e);\n const points = [x, y, x, y];\n\n this._line = new ArrowLine(points, {\n stroke: this._oColor.toRgba(),\n strokeWidth: this._width,\n arrowType: this._arrowType,\n evented: false,\n });\n\n this._line.set(fObjectOptions.SELECTION_STYLE);\n\n canvas.add(this._line);\n\n canvas.on({\n 'mouse:move': this._listeners.mousemove,\n 'mouse:up': this._listeners.mouseup,\n });\n\n this.fire(eventNames.ADD_OBJECT, this._createLineEventObjectProperties());\n }\n\n /**\n * Mousemove event handler in fabric canvas\n * @param {{target: fabric.Object, e: MouseEvent}} fEvent - Fabric event object\n * @private\n */\n _onFabricMouseMove(fEvent) {\n const canvas = this.getCanvas();\n const pointer = canvas.getPointer(fEvent.e);\n\n this._line.set({\n x2: pointer.x,\n y2: pointer.y,\n });\n\n this._line.setCoords();\n\n canvas.renderAll();\n }\n\n /**\n * Mouseup event handler in fabric canvas\n * @private\n */\n _onFabricMouseUp() {\n const canvas = this.getCanvas();\n\n this.fire(eventNames.OBJECT_ADDED, this._createLineEventObjectProperties());\n\n this._line = null;\n\n canvas.off({\n 'mouse:move': this._listeners.mousemove,\n 'mouse:up': this._listeners.mouseup,\n });\n }\n\n /**\n * create line event object properties\n * @returns {Object} properties line object\n * @private\n */\n _createLineEventObjectProperties() {\n const params = this.graphics.createObjectProperties(this._line);\n const { x1, x2, y1, y2 } = this._line;\n\n return snippet.extend({}, params, {\n startPosition: {\n x: x1,\n y: y1,\n },\n endPosition: {\n x: x2,\n y: y2,\n },\n });\n }\n}\n\nexport default Line;\n","/**\n * @author NHN. FE Development Team \n * @fileoverview Blur extending fabric.Image.filters.Convolute\n */\nimport fabric from 'fabric';\n\nconst ARROW_ANGLE = 30;\nconst CHEVRON_SIZE_RATIO = 2.7;\nconst TRIANGLE_SIZE_RATIO = 1.7;\nconst RADIAN_CONVERSION_VALUE = 180;\n\nconst ArrowLine = fabric.util.createClass(\n fabric.Line,\n /** @lends Convolute.prototype */ {\n /**\n * Line type\n * @param {String} type\n * @default\n */\n type: 'line',\n\n /**\n * Constructor\n * @param {Array} [points] Array of points\n * @param {Object} [options] Options object\n * @override\n */\n initialize(points, options = {}) {\n this.callSuper('initialize', points, options);\n\n this.arrowType = options.arrowType;\n },\n\n /**\n * Render ArrowLine\n * @private\n * @override\n */\n _render(ctx) {\n const { x1: fromX, y1: fromY, x2: toX, y2: toY } = this.calcLinePoints();\n const linePosition = {\n fromX,\n fromY,\n toX,\n toY,\n };\n this.ctx = ctx;\n ctx.lineWidth = this.strokeWidth;\n\n this._renderBasicLinePath(linePosition);\n this._drawDecoratorPath(linePosition);\n\n this._renderStroke(ctx);\n },\n\n /**\n * Render Basic line path\n * @param {Object} linePosition - line position\n * @param {number} option.fromX - line start position x\n * @param {number} option.fromY - line start position y\n * @param {number} option.toX - line end position x\n * @param {number} option.toY - line end position y\n * @private\n */\n _renderBasicLinePath({ fromX, fromY, toX, toY }) {\n this.ctx.beginPath();\n this.ctx.moveTo(fromX, fromY);\n this.ctx.lineTo(toX, toY);\n },\n\n /**\n * Render Arrow Head\n * @param {Object} linePosition - line position\n * @param {number} option.fromX - line start position x\n * @param {number} option.fromY - line start position y\n * @param {number} option.toX - line end position x\n * @param {number} option.toY - line end position y\n * @private\n */\n _drawDecoratorPath(linePosition) {\n this._drawDecoratorPathType('head', linePosition);\n this._drawDecoratorPathType('tail', linePosition);\n },\n\n /**\n * Render Arrow Head\n * @param {string} type - 'head' or 'tail'\n * @param {Object} linePosition - line position\n * @param {number} option.fromX - line start position x\n * @param {number} option.fromY - line start position y\n * @param {number} option.toX - line end position x\n * @param {number} option.toY - line end position y\n * @private\n */\n _drawDecoratorPathType(type, linePosition) {\n switch (this.arrowType[type]) {\n case 'triangle':\n this._drawTrianglePath(type, linePosition);\n break;\n case 'chevron':\n this._drawChevronPath(type, linePosition);\n break;\n default:\n break;\n }\n },\n\n /**\n * Render Triangle Head\n * @param {string} type - 'head' or 'tail'\n * @param {Object} linePosition - line position\n * @param {number} option.fromX - line start position x\n * @param {number} option.fromY - line start position y\n * @param {number} option.toX - line end position x\n * @param {number} option.toY - line end position y\n * @private\n */\n _drawTrianglePath(type, linePosition) {\n const decorateSize = this.ctx.lineWidth * TRIANGLE_SIZE_RATIO;\n\n this._drawChevronPath(type, linePosition, decorateSize);\n this.ctx.closePath();\n },\n\n /**\n * Render Chevron Head\n * @param {string} type - 'head' or 'tail'\n * @param {Object} linePosition - line position\n * @param {number} option.fromX - line start position x\n * @param {number} option.fromY - line start position y\n * @param {number} option.toX - line end position x\n * @param {number} option.toY - line end position y\n * @param {number} decorateSize - decorate size\n * @private\n */\n _drawChevronPath(type, { fromX, fromY, toX, toY }, decorateSize) {\n const { ctx } = this;\n if (!decorateSize) {\n decorateSize = this.ctx.lineWidth * CHEVRON_SIZE_RATIO;\n }\n\n const [standardX, standardY] = type === 'head' ? [fromX, fromY] : [toX, toY];\n const [compareX, compareY] = type === 'head' ? [toX, toY] : [fromX, fromY];\n\n const angle =\n (Math.atan2(compareY - standardY, compareX - standardX) * RADIAN_CONVERSION_VALUE) /\n Math.PI;\n const rotatedPosition = (changeAngle) =>\n this.getRotatePosition(decorateSize, changeAngle, {\n x: standardX,\n y: standardY,\n });\n\n ctx.moveTo(...rotatedPosition(angle + ARROW_ANGLE));\n ctx.lineTo(standardX, standardY);\n ctx.lineTo(...rotatedPosition(angle - ARROW_ANGLE));\n },\n\n /**\n * return position from change angle.\n * @param {number} distance - change distance\n * @param {number} angle - change angle\n * @param {Object} referencePosition - reference position\n * @returns {Array}\n * @private\n */\n getRotatePosition(distance, angle, referencePosition) {\n const radian = (angle * Math.PI) / RADIAN_CONVERSION_VALUE;\n const { x, y } = referencePosition;\n\n return [distance * Math.cos(radian) + x, distance * Math.sin(radian) + y];\n },\n }\n);\n\nexport default ArrowLine;\n","/**\n * @author NHN. FE Development Team \n * @fileoverview Text module\n */\nimport snippet from 'tui-code-snippet';\nimport fabric from 'fabric';\nimport Component from '@/interface/component';\nimport { Promise } from '@/util';\nimport { componentNames, eventNames as events, fObjectOptions } from '@/consts';\n\nconst defaultStyles = {\n fill: '#000000',\n left: 0,\n top: 0,\n};\nconst resetStyles = {\n fill: '#000000',\n fontStyle: 'normal',\n fontWeight: 'normal',\n textAlign: 'left',\n underline: false,\n};\nconst DBCLICK_TIME = 500;\n\n/**\n * Text\n * @class Text\n * @param {Graphics} graphics - Graphics instance\n * @extends {Component}\n * @ignore\n */\nclass Text extends Component {\n constructor(graphics) {\n super(componentNames.TEXT, graphics);\n\n /**\n * Default text style\n * @type {Object}\n */\n this._defaultStyles = defaultStyles;\n\n /**\n * Selected state\n * @type {boolean}\n */\n this._isSelected = false;\n\n /**\n * Selected text object\n * @type {Object}\n */\n this._selectedObj = {};\n\n /**\n * Editing text object\n * @type {Object}\n */\n this._editingObj = {};\n\n /**\n * Listeners for fabric event\n * @type {Object}\n */\n this._listeners = {\n mousedown: this._onFabricMouseDown.bind(this),\n select: this._onFabricSelect.bind(this),\n selectClear: this._onFabricSelectClear.bind(this),\n scaling: this._onFabricScaling.bind(this),\n textChanged: this._onFabricTextChanged.bind(this),\n };\n\n /**\n * Textarea element for editing\n * @type {HTMLElement}\n */\n this._textarea = null;\n\n /**\n * Ratio of current canvas\n * @type {number}\n */\n this._ratio = 1;\n\n /**\n * Last click time\n * @type {Date}\n */\n this._lastClickTime = new Date().getTime();\n\n /**\n * Text object infos before editing\n * @type {Object}\n */\n this._editingObjInfos = {};\n\n /**\n * Previous state of editing\n * @type {boolean}\n */\n this.isPrevEditing = false;\n }\n\n /**\n * Start input text mode\n */\n start() {\n const canvas = this.getCanvas();\n\n canvas.selection = false;\n canvas.defaultCursor = 'text';\n canvas.on({\n 'mouse:down': this._listeners.mousedown,\n 'selection:created': this._listeners.select,\n 'selection:updated': this._listeners.select,\n 'before:selection:cleared': this._listeners.selectClear,\n 'object:scaling': this._listeners.scaling,\n 'text:changed': this._listeners.textChanged,\n });\n\n canvas.forEachObject((obj) => {\n if (obj.type === 'i-text') {\n this.adjustOriginPosition(obj, 'start');\n }\n });\n\n this.setCanvasRatio();\n }\n\n /**\n * End input text mode\n */\n end() {\n const canvas = this.getCanvas();\n\n canvas.selection = true;\n canvas.defaultCursor = 'default';\n\n canvas.forEachObject((obj) => {\n if (obj.type === 'i-text') {\n if (obj.text === '') {\n canvas.remove(obj);\n } else {\n this.adjustOriginPosition(obj, 'end');\n }\n }\n });\n\n canvas.off({\n 'mouse:down': this._listeners.mousedown,\n 'selection:created': this._listeners.select,\n 'selection:updated': this._listeners.select,\n 'before:selection:cleared': this._listeners.selectClear,\n 'object:selected': this._listeners.select,\n 'object:scaling': this._listeners.scaling,\n 'text:changed': this._listeners.textChanged,\n });\n }\n\n /**\n * Adjust the origin position\n * @param {fabric.Object} text - text object\n * @param {string} editStatus - 'start' or 'end'\n */\n adjustOriginPosition(text, editStatus) {\n let [originX, originY] = ['center', 'center'];\n if (editStatus === 'start') {\n [originX, originY] = ['left', 'top'];\n }\n\n const { x: left, y: top } = text.getPointByOrigin(originX, originY);\n text.set({\n left,\n top,\n originX,\n originY,\n });\n text.setCoords();\n }\n\n /**\n * Add new text on canvas image\n * @param {string} text - Initial input text\n * @param {Object} options - Options for generating text\n * @param {Object} [options.styles] Initial styles\n * @param {string} [options.styles.fill] Color\n * @param {string} [options.styles.fontFamily] Font type for text\n * @param {number} [options.styles.fontSize] Size\n * @param {string} [options.styles.fontStyle] Type of inclination (normal / italic)\n * @param {string} [options.styles.fontWeight] Type of thicker or thinner looking (normal / bold)\n * @param {string} [options.styles.textAlign] Type of text align (left / center / right)\n * @param {string} [options.styles.textDecoration] Type of line (underline / line-through / overline)\n * @param {{x: number, y: number}} [options.position] - Initial position\n * @returns {Promise}\n */\n add(text, options) {\n return new Promise((resolve) => {\n const canvas = this.getCanvas();\n let newText = null;\n let selectionStyle = fObjectOptions.SELECTION_STYLE;\n let styles = this._defaultStyles;\n\n this._setInitPos(options.position);\n\n if (options.styles) {\n styles = snippet.extend(styles, options.styles);\n }\n\n if (!snippet.isExisty(options.autofocus)) {\n options.autofocus = true;\n }\n\n newText = new fabric.IText(text, styles);\n selectionStyle = snippet.extend({}, selectionStyle, {\n originX: 'left',\n originY: 'top',\n });\n\n newText.set(selectionStyle);\n newText.on({\n mouseup: this._onFabricMouseUp.bind(this),\n });\n\n canvas.add(newText);\n\n if (options.autofocus) {\n newText.enterEditing();\n newText.selectAll();\n }\n\n if (!canvas.getActiveObject()) {\n canvas.setActiveObject(newText);\n }\n\n this.isPrevEditing = true;\n resolve(this.graphics.createObjectProperties(newText));\n });\n }\n\n /**\n * Change text of activate object on canvas image\n * @param {Object} activeObj - Current selected text object\n * @param {string} text - Changed text\n * @returns {Promise}\n */\n change(activeObj, text) {\n return new Promise((resolve) => {\n activeObj.set('text', text);\n\n this.getCanvas().renderAll();\n resolve();\n });\n }\n\n /**\n * Set style\n * @param {Object} activeObj - Current selected text object\n * @param {Object} styleObj - Initial styles\n * @param {string} [styleObj.fill] Color\n * @param {string} [styleObj.fontFamily] Font type for text\n * @param {number} [styleObj.fontSize] Size\n * @param {string} [styleObj.fontStyle] Type of inclination (normal / italic)\n * @param {string} [styleObj.fontWeight] Type of thicker or thinner looking (normal / bold)\n * @param {string} [styleObj.textAlign] Type of text align (left / center / right)\n * @param {string} [styleObj.textDecoration] Type of line (underline / line-through / overline)\n * @returns {Promise}\n */\n setStyle(activeObj, styleObj) {\n return new Promise((resolve) => {\n snippet.forEach(\n styleObj,\n (val, key) => {\n if (activeObj[key] === val && key !== 'fontSize') {\n styleObj[key] = resetStyles[key] || '';\n }\n },\n this\n );\n\n if ('textDecoration' in styleObj) {\n snippet.extend(styleObj, this._getTextDecorationAdaptObject(styleObj.textDecoration));\n }\n\n activeObj.set(styleObj);\n\n this.getCanvas().renderAll();\n resolve();\n });\n }\n\n /**\n * Get the text\n * @param {Object} activeObj - Current selected text object\n * @returns {String} text\n */\n getText(activeObj) {\n return activeObj.text;\n }\n\n /**\n * Set infos of the current selected object\n * @param {fabric.Text} obj - Current selected text object\n * @param {boolean} state - State of selecting\n */\n setSelectedInfo(obj, state) {\n this._selectedObj = obj;\n this._isSelected = state;\n }\n\n /**\n * Whether object is selected or not\n * @returns {boolean} State of selecting\n */\n isSelected() {\n return this._isSelected;\n }\n\n /**\n * Get current selected text object\n * @returns {fabric.Text} Current selected text object\n */\n getSelectedObj() {\n return this._selectedObj;\n }\n\n /**\n * Set ratio value of canvas\n */\n setCanvasRatio() {\n const canvasElement = this.getCanvasElement();\n const cssWidth = parseInt(canvasElement.style.maxWidth, 10);\n const originWidth = canvasElement.width;\n\n this._ratio = originWidth / cssWidth;\n }\n\n /**\n * Get ratio value of canvas\n * @returns {number} Ratio value\n */\n getCanvasRatio() {\n return this._ratio;\n }\n\n /**\n * Get text decoration adapt object\n * @param {string} textDecoration - text decoration option string\n * @returns {object} adapt object for override\n */\n _getTextDecorationAdaptObject(textDecoration) {\n return {\n underline: textDecoration === 'underline',\n linethrough: textDecoration === 'line-through',\n overline: textDecoration === 'overline',\n };\n }\n\n /**\n * Set initial position on canvas image\n * @param {{x: number, y: number}} [position] - Selected position\n * @private\n */\n _setInitPos(position) {\n position = position || this.getCanvasImage().getCenterPoint();\n\n this._defaultStyles.left = position.x;\n this._defaultStyles.top = position.y;\n }\n\n /**\n * Input event handler\n * @private\n */\n _onInput() {\n const ratio = this.getCanvasRatio();\n const obj = this._editingObj;\n const textareaStyle = this._textarea.style;\n\n textareaStyle.width = `${Math.ceil(obj.width / ratio)}px`;\n textareaStyle.height = `${Math.ceil(obj.height / ratio)}px`;\n }\n\n /**\n * Keydown event handler\n * @private\n */\n _onKeyDown() {\n const ratio = this.getCanvasRatio();\n const obj = this._editingObj;\n const textareaStyle = this._textarea.style;\n\n setTimeout(() => {\n obj.text(this._textarea.value);\n\n textareaStyle.width = `${Math.ceil(obj.width / ratio)}px`;\n textareaStyle.height = `${Math.ceil(obj.height / ratio)}px`;\n }, 0);\n }\n\n /**\n * Blur event handler\n * @private\n */\n _onBlur() {\n const ratio = this.getCanvasRatio();\n const editingObj = this._editingObj;\n const editingObjInfos = this._editingObjInfos;\n const textContent = this._textarea.value;\n let transWidth = editingObj.width / ratio - editingObjInfos.width / ratio;\n let transHeight = editingObj.height / ratio - editingObjInfos.height / ratio;\n\n if (ratio === 1) {\n transWidth /= 2;\n transHeight /= 2;\n }\n\n this._textarea.style.display = 'none';\n\n editingObj.set({\n left: editingObjInfos.left + transWidth,\n top: editingObjInfos.top + transHeight,\n });\n\n if (textContent.length) {\n this.getCanvas().add(editingObj);\n\n const params = {\n id: snippet.stamp(editingObj),\n type: editingObj.type,\n text: textContent,\n };\n\n this.fire(events.TEXT_CHANGED, params);\n }\n }\n\n /**\n * Scroll event handler\n * @private\n */\n _onScroll() {\n this._textarea.scrollLeft = 0;\n this._textarea.scrollTop = 0;\n }\n\n /**\n * Fabric scaling event handler\n * @param {fabric.Event} fEvent - Current scaling event on selected object\n * @private\n */\n _onFabricScaling(fEvent) {\n const obj = fEvent.target;\n\n obj.fontSize = obj.fontSize * obj.scaleY;\n obj.scaleX = 1;\n obj.scaleY = 1;\n }\n\n /**\n * textChanged event handler\n * @param {{target: fabric.Object}} props - changed text object\n * @private\n */\n _onFabricTextChanged(props) {\n this.fire(events.TEXT_CHANGED, props.target);\n }\n\n /**\n * onSelectClear handler in fabric canvas\n * @param {{target: fabric.Object, e: MouseEvent}} fEvent - Fabric event\n * @private\n */\n _onFabricSelectClear(fEvent) {\n const obj = this.getSelectedObj();\n\n this.isPrevEditing = true;\n\n this.setSelectedInfo(fEvent.target, false);\n\n if (obj) {\n // obj is empty object at initial time, will be set fabric object\n if (obj.text === '') {\n this.getCanvas().remove(obj);\n }\n }\n }\n\n /**\n * onSelect handler in fabric canvas\n * @param {{target: fabric.Object, e: MouseEvent}} fEvent - Fabric event\n * @private\n */\n _onFabricSelect(fEvent) {\n this.isPrevEditing = true;\n\n this.setSelectedInfo(fEvent.target, true);\n }\n\n /**\n * Fabric 'mousedown' event handler\n * @param {fabric.Event} fEvent - Current mousedown event on selected object\n * @private\n */\n _onFabricMouseDown(fEvent) {\n const obj = fEvent.target;\n\n if (obj && !obj.isType('text')) {\n return;\n }\n\n if (this.isPrevEditing) {\n this.isPrevEditing = false;\n\n return;\n }\n\n this._fireAddText(fEvent);\n }\n\n /**\n * Fire 'addText' event if object is not selected.\n * @param {fabric.Event} fEvent - Current mousedown event on selected object\n * @private\n */\n _fireAddText(fEvent) {\n const obj = fEvent.target;\n const e = fEvent.e || {};\n const originPointer = this.getCanvas().getPointer(e);\n\n if (!obj) {\n this.fire(events.ADD_TEXT, {\n originPosition: {\n x: originPointer.x,\n y: originPointer.y,\n },\n clientPosition: {\n x: e.clientX || 0,\n y: e.clientY || 0,\n },\n });\n }\n }\n\n /**\n * Fabric mouseup event handler\n * @param {fabric.Event} fEvent - Current mousedown event on selected object\n * @private\n */\n _onFabricMouseUp(fEvent) {\n const { target } = fEvent;\n const newClickTime = new Date().getTime();\n\n if (this._isDoubleClick(newClickTime) && !target.isEditing) {\n target.enterEditing();\n }\n\n if (target.isEditing) {\n this.fire(events.TEXT_EDITING); // fire editing text event\n }\n\n this._lastClickTime = newClickTime;\n }\n\n /**\n * Get state of firing double click event\n * @param {Date} newClickTime - Current clicked time\n * @returns {boolean} Whether double clicked or not\n * @private\n */\n _isDoubleClick(newClickTime) {\n return newClickTime - this._lastClickTime < DBCLICK_TIME;\n }\n}\n\nexport default Text;\n","/**\n * @author NHN. FE Development Team \n * @fileoverview Add icon module\n */\nimport snippet from 'tui-code-snippet';\nimport fabric from 'fabric';\nimport Component from '@/interface/component';\nimport { Promise } from '@/util';\nimport { eventNames as events, rejectMessages, componentNames, fObjectOptions } from '@/consts';\n\nconst pathMap = {\n arrow: 'M 0 90 H 105 V 120 L 160 60 L 105 0 V 30 H 0 Z',\n cancel:\n 'M 0 30 L 30 60 L 0 90 L 30 120 L 60 90 L 90 120 L 120 90 ' +\n 'L 90 60 L 120 30 L 90 0 L 60 30 L 30 0 Z',\n};\n\n/**\n * Icon\n * @class Icon\n * @param {Graphics} graphics - Graphics instance\n * @extends {Component}\n * @ignore\n */\nclass Icon extends Component {\n constructor(graphics) {\n super(componentNames.ICON, graphics);\n\n /**\n * Default icon color\n * @type {string}\n */\n this._oColor = '#000000';\n\n /**\n * Path value of each icon type\n * @type {Object}\n */\n this._pathMap = pathMap;\n\n /**\n * Type of the drawing icon\n * @type {string}\n * @private\n */\n this._type = null;\n\n /**\n * Color of the drawing icon\n * @type {string}\n * @private\n */\n this._iconColor = null;\n\n /**\n * Event handler list\n * @type {Object}\n * @private\n */\n this._handlers = {\n mousedown: this._onFabricMouseDown.bind(this),\n mousemove: this._onFabricMouseMove.bind(this),\n mouseup: this._onFabricMouseUp.bind(this),\n };\n }\n\n /**\n * Set states of the current drawing shape\n * @ignore\n * @param {string} type - Icon type ('arrow', 'cancel', custom icon name)\n * @param {string} iconColor - Icon foreground color\n */\n setStates(type, iconColor) {\n this._type = type;\n this._iconColor = iconColor;\n }\n\n /**\n * Start to draw the icon on canvas\n * @ignore\n */\n start() {\n const canvas = this.getCanvas();\n canvas.selection = false;\n canvas.on('mouse:down', this._handlers.mousedown);\n }\n\n /**\n * End to draw the icon on canvas\n * @ignore\n */\n end() {\n const canvas = this.getCanvas();\n\n canvas.selection = true;\n canvas.off({\n 'mouse:down': this._handlers.mousedown,\n });\n }\n\n /**\n * Add icon\n * @param {string} type - Icon type\n * @param {Object} options - Icon options\n * @param {string} [options.fill] - Icon foreground color\n * @param {string} [options.left] - Icon x position\n * @param {string} [options.top] - Icon y position\n * @returns {Promise}\n */\n add(type, options) {\n return new Promise((resolve, reject) => {\n const canvas = this.getCanvas();\n const path = this._pathMap[type];\n const selectionStyle = fObjectOptions.SELECTION_STYLE;\n const icon = path ? this._createIcon(path) : null;\n this._icon = icon;\n\n if (!icon) {\n reject(rejectMessages.invalidParameters);\n }\n\n icon.set(\n snippet.extend(\n {\n type: 'icon',\n fill: this._oColor,\n },\n selectionStyle,\n options,\n this.graphics.controlStyle\n )\n );\n\n canvas.add(icon).setActiveObject(icon);\n\n resolve(this.graphics.createObjectProperties(icon));\n });\n }\n\n /**\n * Register icon paths\n * @param {{key: string, value: string}} pathInfos - Path infos\n */\n registerPaths(pathInfos) {\n snippet.forEach(\n pathInfos,\n (path, type) => {\n this._pathMap[type] = path;\n },\n this\n );\n }\n\n /**\n * Set icon object color\n * @param {string} color - Color to set\n * @param {fabric.Path}[obj] - Current activated path object\n */\n setColor(color, obj) {\n this._oColor = color;\n\n if (obj && obj.get('type') === 'icon') {\n obj.set({ fill: this._oColor });\n this.getCanvas().renderAll();\n }\n }\n\n /**\n * Get icon color\n * @param {fabric.Path}[obj] - Current activated path object\n * @returns {string} color\n */\n getColor(obj) {\n return obj.fill;\n }\n\n /**\n * Create icon object\n * @param {string} path - Path value to create icon\n * @returns {fabric.Path} Path object\n */\n _createIcon(path) {\n return new fabric.Path(path);\n }\n\n /**\n * MouseDown event handler on canvas\n * @param {{target: fabric.Object, e: MouseEvent}} fEvent - Fabric event object\n * @private\n */\n _onFabricMouseDown(fEvent) {\n const canvas = this.getCanvas();\n\n this._startPoint = canvas.getPointer(fEvent.e);\n const { x: left, y: top } = this._startPoint;\n\n this.add(this._type, {\n left,\n top,\n fill: this._iconColor,\n }).then(() => {\n this.fire(events.ADD_OBJECT, this.graphics.createObjectProperties(this._icon));\n canvas.on('mouse:move', this._handlers.mousemove);\n canvas.on('mouse:up', this._handlers.mouseup);\n });\n }\n\n /**\n * MouseMove event handler on canvas\n * @param {{target: fabric.Object, e: MouseEvent}} fEvent - Fabric event object\n * @private\n */\n _onFabricMouseMove(fEvent) {\n const canvas = this.getCanvas();\n\n if (!this._icon) {\n return;\n }\n const moveOriginPointer = canvas.getPointer(fEvent.e);\n\n const scaleX = (moveOriginPointer.x - this._startPoint.x) / this._icon.width;\n const scaleY = (moveOriginPointer.y - this._startPoint.y) / this._icon.height;\n\n this._icon.set({\n scaleX: Math.abs(scaleX * 2),\n scaleY: Math.abs(scaleY * 2),\n });\n\n this._icon.setCoords();\n canvas.renderAll();\n }\n\n /**\n * MouseUp event handler on canvas\n * @private\n */\n _onFabricMouseUp() {\n const canvas = this.getCanvas();\n\n this.fire(events.OBJECT_ADDED, this.graphics.createObjectProperties(this._icon));\n\n this._icon = null;\n\n canvas.off('mouse:down', this._handlers.mousedown);\n canvas.off('mouse:move', this._handlers.mousemove);\n canvas.off('mouse:up', this._handlers.mouseup);\n }\n}\n\nexport default Icon;\n","/**\n * @author NHN. FE Development Team \n * @fileoverview Add filter module\n */\nimport { isUndefined, extend, forEach, filter } from 'tui-code-snippet';\nimport fabric from 'fabric';\nimport Component from '@/interface/component';\nimport { Promise } from '@/util';\nimport { rejectMessages, componentNames } from '@/consts';\nimport Mask from '@/extension/mask';\nimport Sharpen from '@/extension/sharpen';\nimport Emboss from '@/extension/emboss';\nimport ColorFilter from '@/extension/colorFilter';\n\nconst { filters } = fabric.Image;\n\nfilters.Mask = Mask;\nfilters.Sharpen = Sharpen;\nfilters.Emboss = Emboss;\nfilters.ColorFilter = ColorFilter;\n\n/**\n * Filter\n * @class Filter\n * @param {Graphics} graphics - Graphics instance\n * @extends {Component}\n * @ignore\n */\nclass Filter extends Component {\n constructor(graphics) {\n super(componentNames.FILTER, graphics);\n }\n\n /**\n * Add filter to source image (a specific filter is added on fabric.js)\n * @param {string} type - Filter type\n * @param {Object} [options] - Options of filter\n * @returns {Promise}\n */\n add(type, options) {\n return new Promise((resolve, reject) => {\n const sourceImg = this._getSourceImage();\n const canvas = this.getCanvas();\n let imgFilter = this._getFilter(sourceImg, type);\n if (!imgFilter) {\n imgFilter = this._createFilter(sourceImg, type, options);\n }\n\n if (!imgFilter) {\n reject(rejectMessages.invalidParameters);\n }\n\n this._changeFilterValues(imgFilter, options);\n\n this._apply(sourceImg, () => {\n canvas.renderAll();\n resolve({\n type,\n action: 'add',\n options,\n });\n });\n });\n }\n\n /**\n * Remove filter to source image\n * @param {string} type - Filter type\n * @returns {Promise}\n */\n remove(type) {\n return new Promise((resolve, reject) => {\n const sourceImg = this._getSourceImage();\n const canvas = this.getCanvas();\n const options = this.getOptions(type);\n\n if (!sourceImg.filters.length) {\n reject(rejectMessages.unsupportedOperation);\n }\n\n this._removeFilter(sourceImg, type);\n\n this._apply(sourceImg, () => {\n canvas.renderAll();\n resolve({\n type,\n action: 'remove',\n options,\n });\n });\n });\n }\n\n /**\n * Whether this has the filter or not\n * @param {string} type - Filter type\n * @returns {boolean} true if it has the filter\n */\n hasFilter(type) {\n return !!this._getFilter(this._getSourceImage(), type);\n }\n\n /**\n * Get a filter options\n * @param {string} type - Filter type\n * @returns {Object} filter options or null if there is no that filter\n */\n getOptions(type) {\n const sourceImg = this._getSourceImage();\n const imgFilter = this._getFilter(sourceImg, type);\n if (!imgFilter) {\n return null;\n }\n\n return extend({}, imgFilter.options);\n }\n\n /**\n * Change filter values\n * @param {Object} imgFilter object of filter\n * @param {Object} options object\n * @private\n */\n _changeFilterValues(imgFilter, options) {\n forEach(options, (value, key) => {\n if (!isUndefined(imgFilter[key])) {\n imgFilter[key] = value;\n }\n });\n forEach(imgFilter.options, (value, key) => {\n if (!isUndefined(options[key])) {\n imgFilter.options[key] = options[key];\n }\n });\n }\n\n /**\n * Apply filter\n * @param {fabric.Image} sourceImg - Source image to apply filter\n * @param {function} callback - Executed function after applying filter\n * @private\n */\n _apply(sourceImg, callback) {\n sourceImg.filters.push();\n const result = sourceImg.applyFilters();\n if (result) {\n callback();\n }\n }\n\n /**\n * Get source image on canvas\n * @returns {fabric.Image} Current source image on canvas\n * @private\n */\n _getSourceImage() {\n return this.getCanvasImage();\n }\n\n /**\n * Create filter instance\n * @param {fabric.Image} sourceImg - Source image to apply filter\n * @param {string} type - Filter type\n * @param {Object} [options] - Options of filter\n * @returns {Object} Fabric object of filter\n * @private\n */\n _createFilter(sourceImg, type, options) {\n let filterObj;\n // capitalize first letter for matching with fabric image filter name\n const fabricType = this._getFabricFilterType(type);\n const ImageFilter = fabric.Image.filters[fabricType];\n if (ImageFilter) {\n filterObj = new ImageFilter(options);\n filterObj.options = options;\n sourceImg.filters.push(filterObj);\n }\n\n return filterObj;\n }\n\n /**\n * Get applied filter instance\n * @param {fabric.Image} sourceImg - Source image to apply filter\n * @param {string} type - Filter type\n * @returns {Object} Fabric object of filter\n * @private\n */\n _getFilter(sourceImg, type) {\n let imgFilter = null;\n\n if (sourceImg) {\n const fabricType = this._getFabricFilterType(type);\n const { length } = sourceImg.filters;\n let item, i;\n\n for (i = 0; i < length; i += 1) {\n item = sourceImg.filters[i];\n if (item.type === fabricType) {\n imgFilter = item;\n break;\n }\n }\n }\n\n return imgFilter;\n }\n\n /**\n * Remove applied filter instance\n * @param {fabric.Image} sourceImg - Source image to apply filter\n * @param {string} type - Filter type\n * @private\n */\n _removeFilter(sourceImg, type) {\n const fabricType = this._getFabricFilterType(type);\n sourceImg.filters = filter(sourceImg.filters, (value) => value.type !== fabricType);\n }\n\n /**\n * Change filter class name to fabric's, especially capitalizing first letter\n * @param {string} type - Filter type\n * @example\n * 'grayscale' -> 'Grayscale'\n * @returns {string} Fabric filter class name\n */\n _getFabricFilterType(type) {\n return type.charAt(0).toUpperCase() + type.slice(1);\n }\n}\n\nexport default Filter;\n","/**\n * @author NHN. FE Development Team \n * @fileoverview Mask extending fabric.Image.filters.Mask\n */\nimport fabric from 'fabric';\n\n/**\n * Mask object\n * @class Mask\n * @extends {fabric.Image.filters.BlendImage}\n * @ignore\n */\nconst Mask = fabric.util.createClass(\n fabric.Image.filters.BlendImage,\n /** @lends Mask.prototype */ {\n /**\n * Apply filter to canvas element\n * @param {Object} pipelineState - Canvas element to apply filter\n * @override\n */\n applyTo(pipelineState) {\n if (!this.mask) {\n return;\n }\n\n const canvas = pipelineState.canvasEl;\n const { width, height } = canvas;\n const maskCanvasEl = this._createCanvasOfMask(width, height);\n const ctx = canvas.getContext('2d');\n const maskCtx = maskCanvasEl.getContext('2d');\n const imageData = ctx.getImageData(0, 0, width, height);\n\n this._drawMask(maskCtx, canvas, ctx);\n this._mapData(maskCtx, imageData, width, height);\n\n pipelineState.imageData = imageData;\n },\n\n /**\n * Create canvas of mask image\n * @param {number} width - Width of main canvas\n * @param {number} height - Height of main canvas\n * @returns {HTMLElement} Canvas element\n * @private\n */\n _createCanvasOfMask(width, height) {\n const maskCanvasEl = fabric.util.createCanvasElement();\n\n maskCanvasEl.width = width;\n maskCanvasEl.height = height;\n\n return maskCanvasEl;\n },\n\n /**\n * Draw mask image on canvas element\n * @param {Object} maskCtx - Context of mask canvas\n * @private\n */\n _drawMask(maskCtx) {\n const { mask } = this;\n const maskImg = mask.getElement();\n const { angle, left, scaleX, scaleY, top } = mask;\n\n maskCtx.save();\n maskCtx.translate(left, top);\n maskCtx.rotate((angle * Math.PI) / 180);\n maskCtx.scale(scaleX, scaleY);\n maskCtx.drawImage(maskImg, -maskImg.width / 2, -maskImg.height / 2);\n maskCtx.restore();\n },\n\n /**\n * Map mask image data to source image data\n * @param {Object} maskCtx - Context of mask canvas\n * @param {Object} imageData - Data of source image\n * @param {number} width - Width of main canvas\n * @param {number} height - Height of main canvas\n * @private\n */\n _mapData(maskCtx, imageData, width, height) {\n const { data, height: imgHeight, width: imgWidth } = imageData;\n const sourceData = data;\n const len = imgWidth * imgHeight * 4;\n const maskData = maskCtx.getImageData(0, 0, width, height).data;\n\n for (let i = 0; i < len; i += 4) {\n sourceData[i + 3] = maskData[i]; // adjust value of alpha data\n }\n },\n }\n);\n\nexport default Mask;\n","/**\n * @author NHN. FE Development Team \n * @fileoverview Sharpen extending fabric.Image.filters.Convolute\n */\nimport fabric from 'fabric';\n\n/**\n * Sharpen object\n * @class Sharpen\n * @extends {fabric.Image.filters.Convolute}\n * @ignore\n */\nconst Sharpen = fabric.util.createClass(\n fabric.Image.filters.Convolute,\n /** @lends Convolute.prototype */ {\n /**\n * Filter type\n * @param {String} type\n * @default\n */\n type: 'Sharpen',\n\n /**\n * constructor\n * @override\n */\n initialize() {\n this.matrix = [0, -1, 0, -1, 5, -1, 0, -1, 0];\n },\n }\n);\n\nexport default Sharpen;\n","/**\n * @author NHN. FE Development Team \n * @fileoverview Emboss extending fabric.Image.filters.Convolute\n */\nimport fabric from 'fabric';\n\n/**\n * Emboss object\n * @class Emboss\n * @extends {fabric.Image.filters.Convolute}\n * @ignore\n */\nconst Emboss = fabric.util.createClass(\n fabric.Image.filters.Convolute,\n /** @lends Convolute.prototype */ {\n /**\n * Filter type\n * @param {String} type\n * @default\n */\n type: 'Emboss',\n\n /**\n * constructor\n * @override\n */\n initialize() {\n this.matrix = [1, 1, 1, 1, 0.7, -1, -1, -1, -1];\n },\n }\n);\n\nexport default Emboss;\n","/**\n * @author NHN. FE Development Team \n * @fileoverview ColorFilter extending fabric.Image.filters.BaseFilter\n */\nimport fabric from 'fabric';\n\n/**\n * ColorFilter object\n * @class ColorFilter\n * @extends {fabric.Image.filters.BaseFilter}\n * @ignore\n */\nconst ColorFilter = fabric.util.createClass(\n fabric.Image.filters.BaseFilter,\n /** @lends BaseFilter.prototype */ {\n /**\n * Filter type\n * @param {String} type\n * @default\n */\n type: 'ColorFilter',\n\n /**\n * Constructor\n * @member fabric.Image.filters.ColorFilter.prototype\n * @param {Object} [options] Options object\n * @param {Number} [options.color='#FFFFFF'] Value of color (0...255)\n * @param {Number} [options.threshold=45] Value of threshold (0...255)\n * @override\n */\n initialize(options) {\n if (!options) {\n options = {};\n }\n this.color = options.color || '#FFFFFF';\n this.threshold = options.threshold || 45;\n this.x = options.x || null;\n this.y = options.y || null;\n },\n\n /**\n * Applies filter to canvas element\n * @param {Object} canvas Canvas object passed by fabric\n */\n // eslint-disable-next-line complexity\n applyTo(canvas) {\n const { canvasEl } = canvas;\n const context = canvasEl.getContext('2d');\n const imageData = context.getImageData(0, 0, canvasEl.width, canvasEl.height);\n const { data } = imageData;\n const { threshold } = this;\n let filterColor = fabric.Color.sourceFromHex(this.color);\n let i, len;\n\n if (this.x && this.y) {\n filterColor = this._getColor(imageData, this.x, this.y);\n }\n\n for (i = 0, len = data.length; i < len; i += 4) {\n if (\n this._isOutsideThreshold(data[i], filterColor[0], threshold) ||\n this._isOutsideThreshold(data[i + 1], filterColor[1], threshold) ||\n this._isOutsideThreshold(data[i + 2], filterColor[2], threshold)\n ) {\n continue;\n }\n data[i] = data[i + 1] = data[i + 2] = data[i + 3] = 0;\n }\n context.putImageData(imageData, 0, 0);\n },\n\n /**\n * Check color if it is within threshold\n * @param {Number} color1 source color\n * @param {Number} color2 filtering color\n * @param {Number} threshold threshold\n * @returns {boolean} true if within threshold or false\n */\n _isOutsideThreshold(color1, color2, threshold) {\n const diff = color1 - color2;\n\n return Math.abs(diff) > threshold;\n },\n\n /**\n * Get color at (x, y)\n * @param {Object} imageData of canvas\n * @param {Number} x left position\n * @param {Number} y top position\n * @returns {Array} color array\n */\n _getColor(imageData, x, y) {\n const color = [0, 0, 0, 0];\n const { data, width } = imageData;\n const bytes = 4;\n const position = (width * y + x) * bytes;\n\n color[0] = data[position];\n color[1] = data[position + 1];\n color[2] = data[position + 2];\n color[3] = data[position + 3];\n\n return color;\n },\n }\n);\n\nexport default ColorFilter;\n","/**\n * @author NHN. FE Development Team \n * @fileoverview Shape component\n */\nimport { extend } from 'tui-code-snippet';\nimport fabric from 'fabric';\nimport Component from '@/interface/component';\nimport resizeHelper from '@/helper/shapeResizeHelper';\nimport {\n getFillImageFromShape,\n rePositionFilterTypeFillImage,\n reMakePatternImageSource,\n makeFillPatternForFilter,\n makeFilterOptionFromFabricImage,\n resetFillPatternCanvas,\n} from '@/helper/shapeFilterFillHelper';\nimport {\n Promise,\n changeOrigin,\n getCustomProperty,\n getFillTypeFromOption,\n getFillTypeFromObject,\n isShape,\n} from '@/util';\nimport {\n rejectMessages,\n eventNames,\n keyCodes as KEY_CODES,\n componentNames,\n fObjectOptions,\n SHAPE_DEFAULT_OPTIONS,\n SHAPE_FILL_TYPE,\n} from '@/consts';\n\nconst SHAPE_INIT_OPTIONS = extend(\n {\n strokeWidth: 1,\n stroke: '#000000',\n fill: '#ffffff',\n width: 1,\n height: 1,\n rx: 0,\n ry: 0,\n },\n SHAPE_DEFAULT_OPTIONS\n);\nconst DEFAULT_TYPE = 'rect';\nconst DEFAULT_WIDTH = 20;\nconst DEFAULT_HEIGHT = 20;\n\n/**\n * Make fill option\n * @param {Object} options - Options to create the shape\n * @param {Object.Image} canvasImage - canvas background image\n * @param {Function} createStaticCanvas - static canvas creater\n * @returns {Object} - shape option\n * @private\n */\nfunction makeFabricFillOption(options, canvasImage, createStaticCanvas) {\n const fillOption = options.fill;\n const fillType = getFillTypeFromOption(options.fill);\n let fill = fillOption;\n\n if (fillOption.color) {\n fill = fillOption.color;\n }\n\n let extOption = null;\n if (fillType === 'filter') {\n const newStaticCanvas = createStaticCanvas();\n extOption = makeFillPatternForFilter(canvasImage, fillOption.filter, newStaticCanvas);\n } else {\n extOption = { fill };\n }\n\n return extend({}, options, extOption);\n}\n\n/**\n * Shape\n * @class Shape\n * @param {Graphics} graphics - Graphics instance\n * @extends {Component}\n * @ignore\n */\nexport default class Shape extends Component {\n constructor(graphics) {\n super(componentNames.SHAPE, graphics);\n\n /**\n * Object of The drawing shape\n * @type {fabric.Object}\n * @private\n */\n this._shapeObj = null;\n\n /**\n * Type of the drawing shape\n * @type {string}\n * @private\n */\n this._type = DEFAULT_TYPE;\n\n /**\n * Options to draw the shape\n * @type {Object}\n * @private\n */\n this._options = extend({}, SHAPE_INIT_OPTIONS);\n\n /**\n * Whether the shape object is selected or not\n * @type {boolean}\n * @private\n */\n this._isSelected = false;\n\n /**\n * Pointer for drawing shape (x, y)\n * @type {Object}\n * @private\n */\n this._startPoint = {};\n\n /**\n * Using shortcut on drawing shape\n * @type {boolean}\n * @private\n */\n this._withShiftKey = false;\n\n /**\n * Event handler list\n * @type {Object}\n * @private\n */\n this._handlers = {\n mousedown: this._onFabricMouseDown.bind(this),\n mousemove: this._onFabricMouseMove.bind(this),\n mouseup: this._onFabricMouseUp.bind(this),\n keydown: this._onKeyDown.bind(this),\n keyup: this._onKeyUp.bind(this),\n };\n }\n\n /**\n * Start to draw the shape on canvas\n * @ignore\n */\n start() {\n const canvas = this.getCanvas();\n\n this._isSelected = false;\n\n canvas.defaultCursor = 'crosshair';\n canvas.selection = false;\n canvas.uniformScaling = true;\n canvas.on({\n 'mouse:down': this._handlers.mousedown,\n });\n\n fabric.util.addListener(document, 'keydown', this._handlers.keydown);\n fabric.util.addListener(document, 'keyup', this._handlers.keyup);\n }\n\n /**\n * End to draw the shape on canvas\n * @ignore\n */\n end() {\n const canvas = this.getCanvas();\n\n this._isSelected = false;\n\n canvas.defaultCursor = 'default';\n\n canvas.selection = true;\n canvas.uniformScaling = false;\n canvas.off({\n 'mouse:down': this._handlers.mousedown,\n });\n\n fabric.util.removeListener(document, 'keydown', this._handlers.keydown);\n fabric.util.removeListener(document, 'keyup', this._handlers.keyup);\n }\n\n /**\n * Set states of the current drawing shape\n * @ignore\n * @param {string} type - Shape type (ex: 'rect', 'circle')\n * @param {Object} [options] - Shape options\n * @param {(ShapeFillOption | string)} [options.fill] - {@link ShapeFillOption} or\n * Shape foreground color (ex: '#fff', 'transparent')\n * @param {string} [options.stoke] - Shape outline color\n * @param {number} [options.strokeWidth] - Shape outline width\n * @param {number} [options.width] - Width value (When type option is 'rect', this options can use)\n * @param {number} [options.height] - Height value (When type option is 'rect', this options can use)\n * @param {number} [options.rx] - Radius x value (When type option is 'circle', this options can use)\n * @param {number} [options.ry] - Radius y value (When type option is 'circle', this options can use)\n */\n setStates(type, options) {\n this._type = type;\n\n if (options) {\n this._options = extend(this._options, options);\n }\n }\n\n /**\n * Add the shape\n * @ignore\n * @param {string} type - Shape type (ex: 'rect', 'circle')\n * @param {Object} options - Shape options\n * @param {(ShapeFillOption | string)} [options.fill] - ShapeFillOption or Shape foreground color (ex: '#fff', 'transparent') or ShapeFillOption object\n * @param {string} [options.stroke] - Shape outline color\n * @param {number} [options.strokeWidth] - Shape outline width\n * @param {number} [options.width] - Width value (When type option is 'rect', this options can use)\n * @param {number} [options.height] - Height value (When type option is 'rect', this options can use)\n * @param {number} [options.rx] - Radius x value (When type option is 'circle', this options can use)\n * @param {number} [options.ry] - Radius y value (When type option is 'circle', this options can use)\n * @param {number} [options.isRegular] - Whether scaling shape has 1:1 ratio or not\n * @returns {Promise}\n */\n add(type, options) {\n return new Promise((resolve) => {\n const canvas = this.getCanvas();\n const extendOption = this._extendOptions(options);\n\n const shapeObj = this._createInstance(type, extendOption);\n const objectProperties = this.graphics.createObjectProperties(shapeObj);\n\n this._bindEventOnShape(shapeObj);\n\n canvas.add(shapeObj).setActiveObject(shapeObj);\n\n this._resetPositionFillFilter(shapeObj);\n\n resolve(objectProperties);\n });\n }\n\n /**\n * Change the shape\n * @ignore\n * @param {fabric.Object} shapeObj - Selected shape object on canvas\n * @param {Object} options - Shape options\n * @param {(ShapeFillOption | string)} [options.fill] - {@link ShapeFillOption} or\n * Shape foreground color (ex: '#fff', 'transparent')\n * @param {string} [options.stroke] - Shape outline color\n * @param {number} [options.strokeWidth] - Shape outline width\n * @param {number} [options.width] - Width value (When type option is 'rect', this options can use)\n * @param {number} [options.height] - Height value (When type option is 'rect', this options can use)\n * @param {number} [options.rx] - Radius x value (When type option is 'circle', this options can use)\n * @param {number} [options.ry] - Radius y value (When type option is 'circle', this options can use)\n * @param {number} [options.isRegular] - Whether scaling shape has 1:1 ratio or not\n * @returns {Promise}\n */\n change(shapeObj, options) {\n return new Promise((resolve, reject) => {\n if (!isShape(shapeObj)) {\n reject(rejectMessages.unsupportedType);\n }\n const hasFillOption = getFillTypeFromOption(options.fill) === 'filter';\n const { canvasImage, createStaticCanvas } = this.graphics;\n\n shapeObj.set(\n hasFillOption ? makeFabricFillOption(options, canvasImage, createStaticCanvas) : options\n );\n\n if (hasFillOption) {\n this._resetPositionFillFilter(shapeObj);\n }\n\n this.getCanvas().renderAll();\n resolve();\n });\n }\n\n /**\n * make fill property for user event\n * @param {fabric.Object} shapeObj - fabric object\n * @returns {Object}\n */\n makeFillPropertyForUserEvent(shapeObj) {\n const fillType = getFillTypeFromObject(shapeObj);\n const fillProp = {};\n\n if (fillType === SHAPE_FILL_TYPE.FILTER) {\n const fillImage = getFillImageFromShape(shapeObj);\n const filterOption = makeFilterOptionFromFabricImage(fillImage);\n\n fillProp.type = fillType;\n fillProp.filter = filterOption;\n } else {\n fillProp.type = SHAPE_FILL_TYPE.COLOR;\n fillProp.color = shapeObj.fill || 'transparent';\n }\n\n return fillProp;\n }\n\n /**\n * Copy object handling.\n * @param {fabric.Object} shapeObj - Shape object\n * @param {fabric.Object} originalShapeObj - Shape object\n */\n processForCopiedObject(shapeObj, originalShapeObj) {\n this._bindEventOnShape(shapeObj);\n\n if (getFillTypeFromObject(shapeObj) === 'filter') {\n const fillImage = getFillImageFromShape(originalShapeObj);\n const filterOption = makeFilterOptionFromFabricImage(fillImage);\n const newStaticCanvas = this.graphics.createStaticCanvas();\n\n shapeObj.set(\n makeFillPatternForFilter(this.graphics.canvasImage, filterOption, newStaticCanvas)\n );\n this._resetPositionFillFilter(shapeObj);\n }\n }\n\n /**\n * Create the instance of shape\n * @param {string} type - Shape type\n * @param {Object} options - Options to creat the shape\n * @returns {fabric.Object} Shape instance\n * @private\n */\n _createInstance(type, options) {\n let instance;\n\n switch (type) {\n case 'rect':\n instance = new fabric.Rect(options);\n break;\n case 'circle':\n instance = new fabric.Ellipse(\n extend(\n {\n type: 'circle',\n },\n options\n )\n );\n break;\n case 'triangle':\n instance = new fabric.Triangle(options);\n break;\n default:\n instance = {};\n }\n\n return instance;\n }\n\n /**\n * Get the options to create the shape\n * @param {Object} options - Options to creat the shape\n * @returns {Object} Shape options\n * @private\n */\n _extendOptions(options) {\n const selectionStyles = fObjectOptions.SELECTION_STYLE;\n const { canvasImage, createStaticCanvas } = this.graphics;\n\n options = extend({}, SHAPE_INIT_OPTIONS, this._options, selectionStyles, options);\n\n return makeFabricFillOption(options, canvasImage, createStaticCanvas);\n }\n\n /**\n * Bind fabric events on the creating shape object\n * @param {fabric.Object} shapeObj - Shape object\n * @private\n */\n _bindEventOnShape(shapeObj) {\n const self = this;\n const canvas = this.getCanvas();\n\n shapeObj.on({\n added() {\n self._shapeObj = this;\n resizeHelper.setOrigins(self._shapeObj);\n },\n selected() {\n self._isSelected = true;\n self._shapeObj = this;\n canvas.uniformScaling = true;\n canvas.defaultCursor = 'default';\n resizeHelper.setOrigins(self._shapeObj);\n },\n deselected() {\n self._isSelected = false;\n self._shapeObj = null;\n canvas.defaultCursor = 'crosshair';\n canvas.uniformScaling = false;\n },\n modified() {\n const currentObj = self._shapeObj;\n\n resizeHelper.adjustOriginToCenter(currentObj);\n resizeHelper.setOrigins(currentObj);\n },\n modifiedInGroup(activeSelection) {\n self._fillFilterRePositionInGroupSelection(shapeObj, activeSelection);\n },\n moving() {\n self._resetPositionFillFilter(this);\n },\n rotating() {\n self._resetPositionFillFilter(this);\n },\n scaling(fEvent) {\n const pointer = canvas.getPointer(fEvent.e);\n const currentObj = self._shapeObj;\n\n canvas.setCursor('crosshair');\n resizeHelper.resize(currentObj, pointer, true);\n\n self._resetPositionFillFilter(this);\n },\n });\n }\n\n /**\n * MouseDown event handler on canvas\n * @param {{target: fabric.Object, e: MouseEvent}} fEvent - Fabric event object\n * @private\n */\n _onFabricMouseDown(fEvent) {\n if (!fEvent.target) {\n this._isSelected = false;\n this._shapeObj = false;\n }\n\n if (!this._isSelected && !this._shapeObj) {\n const canvas = this.getCanvas();\n this._startPoint = canvas.getPointer(fEvent.e);\n\n canvas.on({\n 'mouse:move': this._handlers.mousemove,\n 'mouse:up': this._handlers.mouseup,\n });\n }\n }\n\n /**\n * MouseDown event handler on canvas\n * @param {{target: fabric.Object, e: MouseEvent}} fEvent - Fabric event object\n * @private\n */\n _onFabricMouseMove(fEvent) {\n const canvas = this.getCanvas();\n const pointer = canvas.getPointer(fEvent.e);\n const startPointX = this._startPoint.x;\n const startPointY = this._startPoint.y;\n const width = startPointX - pointer.x;\n const height = startPointY - pointer.y;\n const shape = this._shapeObj;\n\n if (!shape) {\n this.add(this._type, {\n left: startPointX,\n top: startPointY,\n width,\n height,\n }).then((objectProps) => {\n this.fire(eventNames.ADD_OBJECT, objectProps);\n });\n } else {\n this._shapeObj.set({\n isRegular: this._withShiftKey,\n });\n\n resizeHelper.resize(shape, pointer);\n canvas.renderAll();\n\n this._resetPositionFillFilter(shape);\n }\n }\n\n /**\n * MouseUp event handler on canvas\n * @private\n */\n _onFabricMouseUp() {\n const canvas = this.getCanvas();\n const startPointX = this._startPoint.x;\n const startPointY = this._startPoint.y;\n const shape = this._shapeObj;\n\n if (!shape) {\n this.add(this._type, {\n left: startPointX,\n top: startPointY,\n width: DEFAULT_WIDTH,\n height: DEFAULT_HEIGHT,\n }).then((objectProps) => {\n this.fire(eventNames.ADD_OBJECT, objectProps);\n });\n } else if (shape) {\n resizeHelper.adjustOriginToCenter(shape);\n this.fire(eventNames.OBJECT_ADDED, this.graphics.createObjectProperties(shape));\n }\n\n canvas.off({\n 'mouse:move': this._handlers.mousemove,\n 'mouse:up': this._handlers.mouseup,\n });\n }\n\n /**\n * Keydown event handler on document\n * @param {KeyboardEvent} e - Event object\n * @private\n */\n _onKeyDown(e) {\n if (e.keyCode === KEY_CODES.SHIFT) {\n this._withShiftKey = true;\n\n if (this._shapeObj) {\n this._shapeObj.isRegular = true;\n }\n }\n }\n\n /**\n * Keyup event handler on document\n * @param {KeyboardEvent} e - Event object\n * @private\n */\n _onKeyUp(e) {\n if (e.keyCode === KEY_CODES.SHIFT) {\n this._withShiftKey = false;\n\n if (this._shapeObj) {\n this._shapeObj.isRegular = false;\n }\n }\n }\n\n /**\n * Reset shape position and internal proportions in the filter type fill area.\n * @param {fabric.Object} shapeObj - Shape object\n * @private\n */\n _resetPositionFillFilter(shapeObj) {\n if (getFillTypeFromObject(shapeObj) !== 'filter') {\n return;\n }\n\n const { patternSourceCanvas } = getCustomProperty(shapeObj, 'patternSourceCanvas');\n\n const fillImage = getFillImageFromShape(shapeObj);\n const { originalAngle } = getCustomProperty(fillImage, 'originalAngle');\n\n if (this.graphics.canvasImage.angle !== originalAngle) {\n reMakePatternImageSource(shapeObj, this.graphics.canvasImage);\n }\n const { originX, originY } = shapeObj;\n\n resizeHelper.adjustOriginToCenter(shapeObj);\n\n shapeObj.width *= shapeObj.scaleX;\n shapeObj.height *= shapeObj.scaleY;\n shapeObj.rx *= shapeObj.scaleX;\n shapeObj.ry *= shapeObj.scaleY;\n shapeObj.scaleX = 1;\n shapeObj.scaleY = 1;\n\n rePositionFilterTypeFillImage(shapeObj);\n\n changeOrigin(shapeObj, {\n originX,\n originY,\n });\n\n resetFillPatternCanvas(patternSourceCanvas);\n }\n\n /**\n * Reset filter area position within group selection.\n * @param {fabric.Object} shapeObj - Shape object\n * @param {fabric.ActiveSelection} activeSelection - Shape object\n * @private\n */\n _fillFilterRePositionInGroupSelection(shapeObj, activeSelection) {\n if (activeSelection.scaleX !== 1 || activeSelection.scaleY !== 1) {\n // This is necessary because the group's scale transition state affects the relative size of the fill area.\n // The only way to reset the object transformation scale state to neutral.\n // {@link https://github.com/fabricjs/fabric.js/issues/5372}\n activeSelection.addWithUpdate();\n }\n\n const { angle, left, top } = shapeObj;\n\n activeSelection.realizeTransform(shapeObj);\n this._resetPositionFillFilter(shapeObj);\n\n shapeObj.set({\n angle,\n left,\n top,\n });\n }\n}\n","/**\n * @author NHN. FE Development Team \n * @fileoverview Shape resize helper\n */\nimport { forEach, map, extend } from 'tui-code-snippet';\nimport resizeHelper from '@/helper/shapeResizeHelper';\nimport { capitalizeString, flipObject, setCustomProperty, getCustomProperty } from '@/util';\n\nconst FILTER_OPTION_MAP = {\n pixelate: 'blocksize',\n blur: 'blur',\n};\nconst POSITION_DIMENSION_MAP = {\n x: 'width',\n y: 'height',\n};\n\nconst FILTER_NAME_VALUE_MAP = flipObject(FILTER_OPTION_MAP);\n\n/**\n * Cached canvas image element for fill image\n * @type {boolean}\n * @private\n */\nlet cachedCanvasImageElement = null;\n\n/**\n * Get background image of fill\n * @param {fabric.Object} shapeObj - Shape object\n * @returns {fabric.Image}\n * @private\n */\nexport function getFillImageFromShape(shapeObj) {\n const { patternSourceCanvas } = getCustomProperty(shapeObj, 'patternSourceCanvas');\n const [fillImage] = patternSourceCanvas.getObjects();\n\n return fillImage;\n}\n\n/**\n * Reset the image position in the filter type fill area.\n * @param {fabric.Object} shapeObj - Shape object\n * @private\n */\nexport function rePositionFilterTypeFillImage(shapeObj) {\n const { angle, flipX, flipY } = shapeObj;\n const fillImage = getFillImageFromShape(shapeObj);\n const rotatedShapeCornerDimension = getRotatedDimension(shapeObj);\n const { right, bottom } = rotatedShapeCornerDimension;\n let { width, height } = rotatedShapeCornerDimension;\n const diffLeft = (width - shapeObj.width) / 2;\n const diffTop = (height - shapeObj.height) / 2;\n const cropX = shapeObj.left - shapeObj.width / 2 - diffLeft;\n const cropY = shapeObj.top - shapeObj.height / 2 - diffTop;\n let left = width / 2 - diffLeft;\n let top = height / 2 - diffTop;\n const fillImageMaxSize = Math.max(width, height) + Math.max(diffLeft, diffTop);\n\n [left, top, width, height] = calculateFillImageDimensionOutsideCanvas({\n shapeObj,\n left,\n top,\n width,\n height,\n cropX,\n cropY,\n flipX,\n flipY,\n right,\n bottom,\n });\n\n fillImage.set({\n angle: flipX === flipY ? -angle : angle,\n left,\n top,\n width,\n height,\n cropX,\n cropY,\n flipX,\n flipY,\n });\n\n setCustomProperty(fillImage, { fillImageMaxSize });\n}\n\n/**\n * Make filter option from fabric image\n * @param {fabric.Image} imageObject - fabric image object\n * @returns {object}\n */\nexport function makeFilterOptionFromFabricImage(imageObject) {\n return map(imageObject.filters, (filter) => {\n const [key] = Object.keys(filter);\n\n return {\n [FILTER_NAME_VALUE_MAP[key]]: filter[key],\n };\n });\n}\n\n/**\n * Calculate fill image position and size for out of Canvas\n * @param {Object} options - options for position dimension calculate\n * @param {fabric.Object} shapeObj - shape object\n * @param {number} left - original left position\n * @param {number} top - original top position\n * @param {number} width - image width\n * @param {number} height - image height\n * @param {number} cropX - image cropX\n * @param {number} cropY - image cropY\n * @param {boolean} flipX - shape flipX\n * @param {boolean} flipY - shape flipY\n * @returns {Object}\n */\nfunction calculateFillImageDimensionOutsideCanvas({\n shapeObj,\n left,\n top,\n width,\n height,\n cropX,\n cropY,\n flipX,\n flipY,\n right,\n bottom,\n}) {\n const overflowAreaPositionFixer = (type, outDistance, imageLeft, imageTop) =>\n calculateDistanceOverflowPart({\n type,\n outDistance,\n shapeObj,\n flipX,\n flipY,\n left: imageLeft,\n top: imageTop,\n });\n const [originalWidth, originalHeight] = [width, height];\n\n [left, top, width, height] = calculateDimensionLeftTopEdge(overflowAreaPositionFixer, {\n left,\n top,\n width,\n height,\n cropX,\n cropY,\n });\n\n [left, top, width, height] = calculateDimensionRightBottomEdge(overflowAreaPositionFixer, {\n left,\n top,\n insideCanvasRealImageWidth: width,\n insideCanvasRealImageHeight: height,\n right,\n bottom,\n cropX,\n cropY,\n originalWidth,\n originalHeight,\n });\n\n return [left, top, width, height];\n}\n\n/**\n * Calculate fill image position and size for for right bottom edge\n * @param {Function} overflowAreaPositionFixer - position fixer\n * @param {Object} options - options for position dimension calculate\n * @param {fabric.Object} shapeObj - shape object\n * @param {number} left - original left position\n * @param {number} top - original top position\n * @param {number} width - image width\n * @param {number} height - image height\n * @param {number} right - image right\n * @param {number} bottom - image bottom\n * @param {number} cropX - image cropX\n * @param {number} cropY - image cropY\n * @param {boolean} originalWidth - image original width\n * @param {boolean} originalHeight - image original height\n * @returns {Object}\n */\nfunction calculateDimensionRightBottomEdge(\n overflowAreaPositionFixer,\n {\n left,\n top,\n insideCanvasRealImageWidth,\n insideCanvasRealImageHeight,\n right,\n bottom,\n cropX,\n cropY,\n originalWidth,\n originalHeight,\n }\n) {\n let [width, height] = [insideCanvasRealImageWidth, insideCanvasRealImageHeight];\n const { width: canvasWidth, height: canvasHeight } = cachedCanvasImageElement;\n\n if (right > canvasWidth && cropX > 0) {\n width = originalWidth - Math.abs(right - canvasWidth);\n }\n if (bottom > canvasHeight && cropY > 0) {\n height = originalHeight - Math.abs(bottom - canvasHeight);\n }\n\n const diff = {\n x: (insideCanvasRealImageWidth - width) / 2,\n y: (insideCanvasRealImageHeight - height) / 2,\n };\n\n forEach(['x', 'y'], (type) => {\n const cropDistance2 = diff[type];\n if (cropDistance2 > 0) {\n [left, top] = overflowAreaPositionFixer(type, cropDistance2, left, top);\n }\n });\n\n return [left, top, width, height];\n}\n\n/**\n * Calculate fill image position and size for for left top\n * @param {Function} overflowAreaPositionFixer - position fixer\n * @param {Object} options - options for position dimension calculate\n * @param {fabric.Object} shapeObj - shape object\n * @param {number} left - original left position\n * @param {number} top - original top position\n * @param {number} width - image width\n * @param {number} height - image height\n * @param {number} cropX - image cropX\n * @param {number} cropY - image cropY\n * @returns {Object}\n */\nfunction calculateDimensionLeftTopEdge(\n overflowAreaPositionFixer,\n { left, top, width, height, cropX, cropY }\n) {\n const dimension = {\n width,\n height,\n };\n\n forEach(['x', 'y'], (type) => {\n const cropDistance = type === 'x' ? cropX : cropY;\n const compareSize = dimension[POSITION_DIMENSION_MAP[type]];\n const standardSize = cachedCanvasImageElement[POSITION_DIMENSION_MAP[type]];\n\n if (compareSize > standardSize) {\n const outDistance = (compareSize - standardSize) / 2;\n\n dimension[POSITION_DIMENSION_MAP[type]] = standardSize;\n [left, top] = overflowAreaPositionFixer(type, outDistance, left, top);\n }\n if (cropDistance < 0) {\n [left, top] = overflowAreaPositionFixer(type, cropDistance, left, top);\n }\n });\n\n return [left, top, dimension.width, dimension.height];\n}\n\n/**\n * Make fill property of dynamic pattern type\n * @param {fabric.Image} canvasImage - canvas background image\n * @param {Array} filterOption - filter option\n * @param {fabric.StaticCanvas} patternSourceCanvas - fabric static canvas\n * @returns {Object}\n */\nexport function makeFillPatternForFilter(canvasImage, filterOption, patternSourceCanvas) {\n const copiedCanvasElement = getCachedCanvasImageElement(canvasImage);\n const fillImage = makeFillImage(copiedCanvasElement, canvasImage.angle, filterOption);\n patternSourceCanvas.add(fillImage);\n\n const fabricProperty = {\n fill: new fabric.Pattern({\n source: patternSourceCanvas.getElement(),\n repeat: 'no-repeat',\n }),\n };\n\n setCustomProperty(fabricProperty, { patternSourceCanvas });\n\n return fabricProperty;\n}\n\n/**\n * Reset fill pattern canvas\n * @param {fabric.StaticCanvas} patternSourceCanvas - fabric static canvas\n */\nexport function resetFillPatternCanvas(patternSourceCanvas) {\n const [innerImage] = patternSourceCanvas.getObjects();\n let { fillImageMaxSize } = getCustomProperty(innerImage, 'fillImageMaxSize');\n fillImageMaxSize = Math.max(1, fillImageMaxSize);\n\n patternSourceCanvas.setDimensions({\n width: fillImageMaxSize,\n height: fillImageMaxSize,\n });\n patternSourceCanvas.renderAll();\n}\n\n/**\n * Remake filter pattern image source\n * @param {fabric.Object} shapeObj - Shape object\n * @param {fabric.Image} canvasImage - canvas background image\n */\nexport function reMakePatternImageSource(shapeObj, canvasImage) {\n const { patternSourceCanvas } = getCustomProperty(shapeObj, 'patternSourceCanvas');\n const [fillImage] = patternSourceCanvas.getObjects();\n const filterOption = makeFilterOptionFromFabricImage(fillImage);\n\n patternSourceCanvas.remove(fillImage);\n\n const copiedCanvasElement = getCachedCanvasImageElement(canvasImage, true);\n const newFillImage = makeFillImage(copiedCanvasElement, canvasImage.angle, filterOption);\n\n patternSourceCanvas.add(newFillImage);\n}\n\n/**\n * Calculate a point line outside the canvas.\n * @param {fabric.Image} canvasImage - canvas background image\n * @param {boolean} reset - default is false\n * @returns {HTMLImageElement}\n */\nexport function getCachedCanvasImageElement(canvasImage, reset = false) {\n if (!cachedCanvasImageElement || reset) {\n cachedCanvasImageElement = canvasImage.toCanvasElement();\n }\n\n return cachedCanvasImageElement;\n}\n\n/**\n * Calculate fill image position for out of Canvas\n * @param {string} type - 'x' or 'y'\n * @param {fabric.Object} shapeObj - shape object\n * @param {number} outDistance - distance away\n * @param {number} left - original left position\n * @param {number} top - original top position\n * @returns {Array}\n */\nfunction calculateDistanceOverflowPart({ type, shapeObj, outDistance, left, top, flipX, flipY }) {\n const shapePointNavigation = getShapeEdgePoint(shapeObj);\n const shapeNeighborPointNavigation = [\n [1, 2],\n [0, 3],\n [0, 3],\n [1, 2],\n ];\n const linePointsOutsideCanvas = calculateLinePointsOutsideCanvas(\n type,\n shapePointNavigation,\n shapeNeighborPointNavigation\n );\n const reatAngles = calculateLineAngleOfOutsideCanvas(\n type,\n shapePointNavigation,\n linePointsOutsideCanvas\n );\n const { startPointIndex } = linePointsOutsideCanvas;\n const diffPosition = getReversePositionForFlip({\n outDistance,\n startPointIndex,\n flipX,\n flipY,\n reatAngles,\n });\n\n return [left + diffPosition.left, top + diffPosition.top];\n}\n\n/**\n * Calculate fill image position for out of Canvas\n * @param {number} outDistance - distance away\n * @param {boolean} flipX - flip x statux\n * @param {boolean} flipY - flip y statux\n * @param {Array} reatAngles - Line angle of the rectangle vertex.\n * @returns {Object} diffPosition\n */\nfunction getReversePositionForFlip({ outDistance, startPointIndex, flipX, flipY, reatAngles }) {\n const rotationChangePoint1 = outDistance * Math.cos((reatAngles[0] * Math.PI) / 180);\n const rotationChangePoint2 = outDistance * Math.cos((reatAngles[1] * Math.PI) / 180);\n const isForward = startPointIndex === 2 || startPointIndex === 3;\n const diffPosition = {\n top: isForward ? rotationChangePoint1 : rotationChangePoint2,\n left: isForward ? rotationChangePoint2 : rotationChangePoint1,\n };\n\n if (isReverseLeftPositionForFlip(startPointIndex, flipX, flipY)) {\n diffPosition.left = diffPosition.left * -1;\n }\n if (isReverseTopPositionForFlip(startPointIndex, flipX, flipY)) {\n diffPosition.top = diffPosition.top * -1;\n }\n\n return diffPosition;\n}\n\n/**\n * Calculate a point line outside the canvas.\n * @param {string} type - 'x' or 'y'\n * @param {Array} shapePointNavigation - shape edge positions\n * @param {Object} shapePointNavigation.lefttop - left top position\n * @param {Object} shapePointNavigation.righttop - right top position\n * @param {Object} shapePointNavigation.leftbottom - lefttop position\n * @param {Object} shapePointNavigation.rightbottom - rightbottom position\n * @param {Array} shapeNeighborPointNavigation - Array to find adjacent edges.\n * @returns {Object}\n */\nfunction calculateLinePointsOutsideCanvas(\n type,\n shapePointNavigation,\n shapeNeighborPointNavigation\n) {\n let minimumPoint = 0;\n let minimumPointIndex = 0;\n forEach(shapePointNavigation, (point, index) => {\n if (point[type] < minimumPoint) {\n minimumPoint = point[type];\n minimumPointIndex = index;\n }\n });\n\n const [endPointIndex1, endPointIndex2] = shapeNeighborPointNavigation[minimumPointIndex];\n\n return {\n startPointIndex: minimumPointIndex,\n endPointIndex1,\n endPointIndex2,\n };\n}\n\n/**\n * Calculate a point line outside the canvas.\n * @param {string} type - 'x' or 'y'\n * @param {Array} shapePointNavigation - shape edge positions\n * @param {object} shapePointNavigation.lefttop - left top position\n * @param {object} shapePointNavigation.righttop - right top position\n * @param {object} shapePointNavigation.leftbottom - lefttop position\n * @param {object} shapePointNavigation.rightbottom - rightbottom position\n * @param {Object} linePointsOfOneVertexIndex - Line point of one vertex\n * @param {Object} linePointsOfOneVertexIndex.startPoint - start point index\n * @param {Object} linePointsOfOneVertexIndex.endPointIndex1 - end point index\n * @param {Object} linePointsOfOneVertexIndex.endPointIndex2 - end point index\n * @returns {Object}\n */\nfunction calculateLineAngleOfOutsideCanvas(type, shapePointNavigation, linePointsOfOneVertexIndex) {\n const { startPointIndex, endPointIndex1, endPointIndex2 } = linePointsOfOneVertexIndex;\n const horizontalVerticalAngle = type === 'x' ? 180 : 270;\n\n return map([endPointIndex1, endPointIndex2], (pointIndex) => {\n const startPoint = shapePointNavigation[startPointIndex];\n const endPoint = shapePointNavigation[pointIndex];\n const diffY = startPoint.y - endPoint.y;\n const diffX = startPoint.x - endPoint.x;\n\n return (Math.atan2(diffY, diffX) * 180) / Math.PI - horizontalVerticalAngle;\n });\n}\n\n/* eslint-disable complexity */\n/**\n * Calculate a point line outside the canvas for horizontal.\n * @param {number} startPointIndex - start point index\n * @param {boolean} flipX - flip x statux\n * @param {boolean} flipY - flip y statux\n * @returns {boolean} flipY - flip y statux\n */\nfunction isReverseLeftPositionForFlip(startPointIndex, flipX, flipY) {\n return (\n (((!flipX && flipY) || (!flipX && !flipY)) && startPointIndex === 0) ||\n (((flipX && flipY) || (flipX && !flipY)) && startPointIndex === 1) ||\n (((!flipX && !flipY) || (!flipX && flipY)) && startPointIndex === 2) ||\n (((flipX && !flipY) || (flipX && flipY)) && startPointIndex === 3)\n );\n}\n/* eslint-enable complexity */\n\n/* eslint-disable complexity */\n/**\n * Calculate a point line outside the canvas for vertical.\n * @param {number} startPointIndex - start point index\n * @param {boolean} flipX - flip x statux\n * @param {boolean} flipY - flip y statux\n * @returns {boolean} flipY - flip y statux\n */\nfunction isReverseTopPositionForFlip(startPointIndex, flipX, flipY) {\n return (\n (((flipX && !flipY) || (!flipX && !flipY)) && startPointIndex === 0) ||\n (((!flipX && !flipY) || (flipX && !flipY)) && startPointIndex === 1) ||\n (((flipX && flipY) || (!flipX && flipY)) && startPointIndex === 2) ||\n (((!flipX && flipY) || (flipX && flipY)) && startPointIndex === 3)\n );\n}\n/* eslint-enable complexity */\n\n/**\n * Shape edge points\n * @param {fabric.Object} shapeObj - Selected shape object on canvas\n * @returns {Array} shapeEdgePoint - shape edge positions\n */\nfunction getShapeEdgePoint(shapeObj) {\n return [\n shapeObj.getPointByOrigin('left', 'top'),\n shapeObj.getPointByOrigin('right', 'top'),\n shapeObj.getPointByOrigin('left', 'bottom'),\n shapeObj.getPointByOrigin('right', 'bottom'),\n ];\n}\n\n/**\n * Rotated shape dimension\n * @param {fabric.Object} shapeObj - Shape object\n * @returns {Object} Rotated shape dimension\n */\nfunction getRotatedDimension(shapeObj) {\n const [\n { x: ax, y: ay },\n { x: bx, y: by },\n { x: cx, y: cy },\n { x: dx, y: dy },\n ] = getShapeEdgePoint(shapeObj);\n\n const left = Math.min(ax, bx, cx, dx);\n const top = Math.min(ay, by, cy, dy);\n const right = Math.max(ax, bx, cx, dx);\n const bottom = Math.max(ay, by, cy, dy);\n\n return {\n left,\n top,\n right,\n bottom,\n width: right - left,\n height: bottom - top,\n };\n}\n\n/**\n * Make fill image\n * @param {HTMLImageElement} copiedCanvasElement - html image element\n * @param {number} currentCanvasImageAngle - current canvas angle\n * @param {Array} filterOption - filter option\n * @returns {fabric.Image}\n * @private\n */\nfunction makeFillImage(copiedCanvasElement, currentCanvasImageAngle, filterOption) {\n const fillImage = new fabric.Image(copiedCanvasElement);\n\n forEach(extend({}, ...filterOption), (value, key) => {\n const fabricFilterClassName = capitalizeString(key);\n const filter = new fabric.Image.filters[fabricFilterClassName]({\n [FILTER_OPTION_MAP[key]]: value,\n });\n fillImage.filters.push(filter);\n });\n fillImage.applyFilters();\n\n setCustomProperty(fillImage, {\n originalAngle: currentCanvasImageAngle,\n fillImageMaxSize: Math.max(fillImage.width, fillImage.height),\n });\n resizeHelper.adjustOriginToCenter(fillImage);\n\n return fillImage;\n}\n","/**\n * @author NHN. FE Development Team \n * @fileoverview Image zoom module (start zoom, end zoom)\n */\nimport fabric from 'fabric';\nimport Component from '@/interface/component';\nimport { clamp } from '@/util';\nimport { componentNames, eventNames, keyCodes, zoomModes } from '@/consts';\n\nconst MOUSE_MOVE_THRESHOLD = 10;\nconst DEFAULT_SCROLL_OPTION = {\n left: 0,\n top: 0,\n width: 0,\n height: 0,\n stroke: '#000000',\n strokeWidth: 0,\n fill: '#000000',\n opacity: 0.4,\n evented: false,\n selectable: false,\n hoverCursor: 'auto',\n};\nconst DEFAULT_VERTICAL_SCROLL_RATIO = {\n SIZE: 0.0045,\n MARGIN: 0.003,\n BORDER_RADIUS: 0.003,\n};\nconst DEFAULT_HORIZONTAL_SCROLL_RATIO = {\n SIZE: 0.0066,\n MARGIN: 0.0044,\n BORDER_RADIUS: 0.003,\n};\nconst DEFAULT_ZOOM_LEVEL = 1.0;\nconst {\n ZOOM_CHANGED,\n ADD_TEXT,\n TEXT_EDITING,\n OBJECT_MODIFIED,\n KEY_DOWN,\n KEY_UP,\n HAND_STARTED,\n HAND_STOPPED,\n} = eventNames;\n\n/**\n * Zoom components\n * @param {Graphics} graphics - Graphics instance\n * @extends {Component}\n * @class Zoom\n * @ignore\n */\nclass Zoom extends Component {\n constructor(graphics) {\n super(componentNames.ZOOM, graphics);\n\n /**\n * zoomArea\n * @type {?fabric.Rect}\n * @private\n */\n this.zoomArea = null;\n\n /**\n * Start point of zoom area\n * @type {?{x: number, y: number}}\n */\n this._startPoint = null;\n\n /**\n * Center point of every zoom\n * @type {Array.<{prevZoomLevel: number, zoomLevel: number, x: number, y: number}>}\n */\n this._centerPoints = [];\n\n /**\n * Zoom level (default: 100%(1.0), max: 400%(4.0))\n * @type {number}\n */\n this.zoomLevel = DEFAULT_ZOOM_LEVEL;\n\n /**\n * Zoom mode ('normal', 'zoom', 'hand')\n * @type {string}\n */\n this.zoomMode = zoomModes.DEFAULT;\n\n /**\n * Listeners\n * @type {Object.}\n * @private\n */\n this._listeners = {\n startZoom: this._onMouseDownWithZoomMode.bind(this),\n moveZoom: this._onMouseMoveWithZoomMode.bind(this),\n stopZoom: this._onMouseUpWithZoomMode.bind(this),\n startHand: this._onMouseDownWithHandMode.bind(this),\n moveHand: this._onMouseMoveWithHandMode.bind(this),\n stopHand: this._onMouseUpWithHandMode.bind(this),\n zoomChanged: this._changeScrollState.bind(this),\n keydown: this._startHandModeWithSpaceBar.bind(this),\n keyup: this._endHandModeWithSpaceBar.bind(this),\n };\n\n const canvas = this.getCanvas();\n\n /**\n * Width:Height ratio (ex. width=1.5, height=1 -> aspectRatio=1.5)\n * @private\n */\n this.aspectRatio = canvas.width / canvas.height;\n\n /**\n * vertical scroll bar\n * @type {fabric.Rect}\n * @private\n */\n this._verticalScroll = new fabric.Rect(DEFAULT_SCROLL_OPTION);\n\n /**\n * horizontal scroll bar\n * @type {fabric.Rect}\n * @private\n */\n this._horizontalScroll = new fabric.Rect(DEFAULT_SCROLL_OPTION);\n\n canvas.on(ZOOM_CHANGED, this._listeners.zoomChanged);\n\n this.graphics.on(ADD_TEXT, this._startTextEditingHandler.bind(this));\n this.graphics.on(TEXT_EDITING, this._startTextEditingHandler.bind(this));\n this.graphics.on(OBJECT_MODIFIED, this._stopTextEditingHandler.bind(this));\n fabric.util.addListener(document, KEY_DOWN, this._listeners.keydown);\n fabric.util.addListener(document, KEY_UP, this._listeners.keyup);\n }\n\n /**\n * Handler when you started editing text\n * @private\n */\n _startTextEditingHandler() {\n this.isTextEditing = true;\n }\n\n /**\n * Handler when you stopped editing text\n * @private\n */\n _stopTextEditingHandler() {\n this.isTextEditing = false;\n }\n\n /**\n * Handler who turns on hand mode when the space bar is down\n * @param {KeyboardEvent} e - Event object\n * @private\n */\n _startHandModeWithSpaceBar(e) {\n if (this.withSpace || this.isTextEditing) {\n return;\n }\n\n if (e.keyCode === keyCodes.SPACE) {\n e.preventDefault();\n this.withSpace = true;\n this.startHandMode();\n }\n }\n\n /**\n * Handler who turns off hand mode when space bar is up\n * @param {KeyboardEvent} e - Event object\n * @private\n */\n _endHandModeWithSpaceBar(e) {\n if (e.keyCode === keyCodes.SPACE) {\n e.preventDefault();\n this.withSpace = false;\n this.endHandMode();\n }\n }\n\n /**\n * Start zoom-in mode\n */\n startZoomInMode() {\n if (this.zoomArea) {\n return;\n }\n this.endHandMode();\n this.zoomMode = zoomModes.ZOOM;\n\n const canvas = this.getCanvas();\n\n this._changeObjectsEventedState(false);\n\n this.zoomArea = new fabric.Rect({\n left: 0,\n top: 0,\n width: 0.5,\n height: 0.5,\n stroke: 'black',\n strokeWidth: 1,\n fill: 'transparent',\n hoverCursor: 'zoom-in',\n });\n\n canvas.discardActiveObject();\n canvas.add(this.zoomArea);\n canvas.on('mouse:down', this._listeners.startZoom);\n canvas.selection = false;\n canvas.defaultCursor = 'zoom-in';\n }\n\n /**\n * End zoom-in mode\n */\n endZoomInMode() {\n this.zoomMode = zoomModes.DEFAULT;\n\n const canvas = this.getCanvas();\n const { startZoom, moveZoom, stopZoom } = this._listeners;\n\n canvas.selection = true;\n canvas.defaultCursor = 'auto';\n canvas.off({\n 'mouse:down': startZoom,\n 'mouse:move': moveZoom,\n 'mouse:up': stopZoom,\n });\n\n this._changeObjectsEventedState(true);\n\n canvas.remove(this.zoomArea);\n this.zoomArea = null;\n }\n\n /**\n * Start zoom drawing mode\n */\n start() {\n this.zoomArea = null;\n this._startPoint = null;\n this._startHandPoint = null;\n }\n\n /**\n * Stop zoom drawing mode\n */\n end() {\n this.endZoomInMode();\n this.endHandMode();\n }\n\n /**\n * Start hand mode\n */\n startHandMode() {\n this.endZoomInMode();\n this.zoomMode = zoomModes.HAND;\n\n const canvas = this.getCanvas();\n\n this._changeObjectsEventedState(false);\n\n canvas.discardActiveObject();\n canvas.off('mouse:down', this._listeners.startHand);\n canvas.on('mouse:down', this._listeners.startHand);\n canvas.selection = false;\n canvas.defaultCursor = 'grab';\n\n canvas.fire(HAND_STARTED);\n }\n\n /**\n * Stop hand mode\n */\n endHandMode() {\n this.zoomMode = zoomModes.DEFAULT;\n const canvas = this.getCanvas();\n\n this._changeObjectsEventedState(true);\n\n canvas.off('mouse:down', this._listeners.startHand);\n canvas.selection = true;\n canvas.defaultCursor = 'auto';\n\n this._startHandPoint = null;\n\n canvas.fire(HAND_STOPPED);\n }\n\n /**\n * onMousedown handler in fabric canvas\n * @param {{target: fabric.Object, e: MouseEvent}} fEvent - Fabric event\n * @private\n */\n _onMouseDownWithZoomMode({ target, e }) {\n if (target) {\n return;\n }\n\n const canvas = this.getCanvas();\n\n canvas.selection = false;\n\n this._startPoint = canvas.getPointer(e);\n this.zoomArea.set({ width: 0, height: 0 });\n\n const { moveZoom, stopZoom } = this._listeners;\n canvas.on({\n 'mouse:move': moveZoom,\n 'mouse:up': stopZoom,\n });\n }\n\n /**\n * onMousemove handler in fabric canvas\n * @param {{e: MouseEvent}} fEvent - Fabric event\n * @private\n */\n _onMouseMoveWithZoomMode({ e }) {\n const canvas = this.getCanvas();\n const pointer = canvas.getPointer(e);\n const { x, y } = pointer;\n const { zoomArea, _startPoint } = this;\n const deltaX = Math.abs(x - _startPoint.x);\n const deltaY = Math.abs(y - _startPoint.y);\n\n if (deltaX + deltaY > MOUSE_MOVE_THRESHOLD) {\n canvas.remove(zoomArea);\n zoomArea.set(this._calcRectDimensionFromPoint(x, y));\n canvas.add(zoomArea);\n }\n }\n\n /**\n * Get rect dimension setting from Canvas-Mouse-Position(x, y)\n * @param {number} x - Canvas-Mouse-Position x\n * @param {number} y - Canvas-Mouse-Position Y\n * @returns {{left: number, top: number, width: number, height: number}}\n * @private\n */\n _calcRectDimensionFromPoint(x, y) {\n const canvas = this.getCanvas();\n const canvasWidth = canvas.getWidth();\n const canvasHeight = canvas.getHeight();\n const { x: startX, y: startY } = this._startPoint;\n const { min } = Math;\n\n const left = min(startX, x);\n const top = min(startY, y);\n const width = clamp(x, startX, canvasWidth) - left; // (startX <= x(mouse) <= canvasWidth) - left\n const height = clamp(y, startY, canvasHeight) - top; // (startY <= y(mouse) <= canvasHeight) - top\n\n return { left, top, width, height };\n }\n\n /**\n * onMouseup handler in fabric canvas\n * @private\n */\n _onMouseUpWithZoomMode() {\n let { zoomLevel } = this;\n const { zoomArea } = this;\n const { moveZoom, stopZoom } = this._listeners;\n const canvas = this.getCanvas();\n const center = this._getCenterPoint();\n const { x, y } = center;\n\n if (!this._isMaxZoomLevel()) {\n this._centerPoints.push({\n x,\n y,\n prevZoomLevel: zoomLevel,\n zoomLevel: zoomLevel + 1,\n });\n zoomLevel += 1;\n canvas.zoomToPoint({ x, y }, zoomLevel);\n\n this._fireZoomChanged(canvas, zoomLevel);\n\n this.zoomLevel = zoomLevel;\n }\n\n canvas.off({\n 'mouse:move': moveZoom,\n 'mouse:up': stopZoom,\n });\n\n canvas.remove(zoomArea);\n this._startPoint = null;\n }\n\n /**\n * Get center point\n * @returns {{x: number, y: number}}\n * @private\n */\n _getCenterPoint() {\n const { left, top, width, height } = this.zoomArea;\n const { x, y } = this._startPoint;\n const { aspectRatio } = this;\n\n if (width < MOUSE_MOVE_THRESHOLD && height < MOUSE_MOVE_THRESHOLD) {\n return { x, y };\n }\n\n return width > height\n ? { x: left + (aspectRatio * height) / 2, y: top + height / 2 }\n : { x: left + width / 2, y: top + width / aspectRatio / 2 };\n }\n\n /**\n * Zoom the canvas\n * @param {{x: number, y: number}} center - center of zoom\n * @param {?number} zoomLevel - zoom level\n */\n zoom({ x, y }, zoomLevel = this.zoomLevel) {\n const canvas = this.getCanvas();\n const centerPoints = this._centerPoints;\n\n for (let i = centerPoints.length - 1; i >= 0; i -= 1) {\n if (centerPoints[i].zoomLevel < zoomLevel) {\n break;\n }\n\n const { x: prevX, y: prevY, prevZoomLevel } = centerPoints.pop();\n\n canvas.zoomToPoint({ x: prevX, y: prevY }, prevZoomLevel);\n this.zoomLevel = prevZoomLevel;\n }\n\n canvas.zoomToPoint({ x, y }, zoomLevel);\n if (!this._isDefaultZoomLevel(zoomLevel)) {\n this._centerPoints.push({\n x,\n y,\n zoomLevel,\n prevZoomLevel: this.zoomLevel,\n });\n }\n this.zoomLevel = zoomLevel;\n\n this._fireZoomChanged(canvas, zoomLevel);\n }\n\n /**\n * Zoom out one step\n */\n zoomOut() {\n const centerPoints = this._centerPoints;\n\n if (!centerPoints.length) {\n return;\n }\n\n const canvas = this.getCanvas();\n const point = centerPoints.pop();\n const { x, y, prevZoomLevel } = point;\n\n if (this._isDefaultZoomLevel(prevZoomLevel)) {\n canvas.setViewportTransform([1, 0, 0, 1, 0, 0]);\n } else {\n canvas.zoomToPoint({ x, y }, prevZoomLevel);\n }\n\n this.zoomLevel = prevZoomLevel;\n\n this._fireZoomChanged(canvas, this.zoomLevel);\n }\n\n /**\n * Zoom reset\n */\n resetZoom() {\n const canvas = this.getCanvas();\n\n canvas.setViewportTransform([1, 0, 0, 1, 0, 0]);\n\n this.zoomLevel = DEFAULT_ZOOM_LEVEL;\n this._centerPoints = [];\n\n this._fireZoomChanged(canvas, this.zoomLevel);\n }\n\n /**\n * Whether zoom level is max (5.0)\n * @returns {boolean}\n * @private\n */\n _isMaxZoomLevel() {\n return this.zoomLevel >= 5.0;\n }\n\n /**\n * Move point of zoom\n * @param {{x: number, y: number}} delta - move amount\n * @private\n */\n _movePointOfZoom({ x: deltaX, y: deltaY }) {\n const centerPoints = this._centerPoints;\n\n if (!centerPoints.length) {\n return;\n }\n\n const canvas = this.getCanvas();\n const { zoomLevel } = this;\n\n const point = centerPoints.pop();\n const { x: originX, y: originY, prevZoomLevel } = point;\n const x = originX - deltaX;\n const y = originY - deltaY;\n\n canvas.zoomToPoint({ x: originX, y: originY }, prevZoomLevel);\n canvas.zoomToPoint({ x, y }, zoomLevel);\n centerPoints.push({ x, y, prevZoomLevel, zoomLevel });\n\n this._fireZoomChanged(canvas, zoomLevel);\n }\n\n /**\n * onMouseDown handler in fabric canvas\n * @param {{target: fabric.Object, e: MouseEvent}} fEvent - Fabric event\n * @private\n */\n _onMouseDownWithHandMode({ target, e }) {\n if (target) {\n return;\n }\n\n const canvas = this.getCanvas();\n\n if (this.zoomLevel <= DEFAULT_ZOOM_LEVEL) {\n return;\n }\n\n canvas.selection = false;\n\n this._startHandPoint = canvas.getPointer(e);\n\n const { moveHand, stopHand } = this._listeners;\n canvas.on({\n 'mouse:move': moveHand,\n 'mouse:up': stopHand,\n });\n }\n\n /**\n * onMouseMove handler in fabric canvas\n * @param {{e: MouseEvent}} fEvent - Fabric event\n * @private\n */\n _onMouseMoveWithHandMode({ e }) {\n const canvas = this.getCanvas();\n const { x, y } = canvas.getPointer(e);\n const deltaX = x - this._startHandPoint.x;\n const deltaY = y - this._startHandPoint.y;\n\n this._movePointOfZoom({ x: deltaX, y: deltaY });\n }\n\n /**\n * onMouseUp handler in fabric canvas\n * @private\n */\n _onMouseUpWithHandMode() {\n const canvas = this.getCanvas();\n const { moveHand, stopHand } = this._listeners;\n\n canvas.off({\n 'mouse:move': moveHand,\n 'mouse:up': stopHand,\n });\n\n this._startHandPoint = null;\n }\n\n /**\n * onChangeZoom handler in fabric canvas\n * @private\n */\n _changeScrollState({ viewport, zoomLevel }) {\n const canvas = this.getCanvas();\n\n canvas.remove(this._verticalScroll);\n canvas.remove(this._horizontalScroll);\n\n if (this._isDefaultZoomLevel(zoomLevel)) {\n return;\n }\n\n const canvasWidth = canvas.width;\n const canvasHeight = canvas.height;\n\n const { tl, tr, bl } = viewport;\n const viewportWidth = tr.x - tl.x;\n const viewportHeight = bl.y - tl.y;\n\n const horizontalScrollWidth = (viewportWidth * viewportWidth) / canvasWidth;\n const horizontalScrollHeight = viewportHeight * DEFAULT_HORIZONTAL_SCROLL_RATIO.SIZE;\n const horizontalScrollLeft = clamp(\n tl.x + (tl.x / canvasWidth) * viewportWidth,\n tl.x,\n tr.x - horizontalScrollWidth\n );\n const horizontalScrollMargin = viewportHeight * DEFAULT_HORIZONTAL_SCROLL_RATIO.MARGIN;\n const horizontalScrollBorderRadius =\n viewportHeight * DEFAULT_HORIZONTAL_SCROLL_RATIO.BORDER_RADIUS;\n\n this._horizontalScroll.set({\n left: horizontalScrollLeft,\n top: bl.y - horizontalScrollHeight - horizontalScrollMargin,\n width: horizontalScrollWidth,\n height: horizontalScrollHeight,\n rx: horizontalScrollBorderRadius,\n ry: horizontalScrollBorderRadius,\n });\n\n const verticalScrollWidth = viewportWidth * DEFAULT_VERTICAL_SCROLL_RATIO.SIZE;\n const verticalScrollHeight = (viewportHeight * viewportHeight) / canvasHeight;\n const verticalScrollTop = clamp(\n tl.y + (tl.y / canvasHeight) * viewportHeight,\n tr.y,\n bl.y - verticalScrollHeight\n );\n const verticalScrollMargin = viewportWidth * DEFAULT_VERTICAL_SCROLL_RATIO.MARGIN;\n const verticalScrollBorderRadius = viewportWidth * DEFAULT_VERTICAL_SCROLL_RATIO.BORDER_RADIUS;\n\n this._verticalScroll.set({\n left: tr.x - verticalScrollWidth - verticalScrollMargin,\n top: verticalScrollTop,\n width: verticalScrollWidth,\n height: verticalScrollHeight,\n rx: verticalScrollBorderRadius,\n ry: verticalScrollBorderRadius,\n });\n\n this._addScrollBar();\n }\n\n /**\n * Change objects 'evented' state\n * @param {boolean} [evented=true] - objects 'evented' state\n */\n _changeObjectsEventedState(evented = true) {\n const canvas = this.getCanvas();\n\n canvas.forEachObject((obj) => {\n // {@link http://fabricjs.com/docs/fabric.Object.html#evented}\n obj.evented = evented;\n });\n }\n\n /**\n * Add scroll bar and set remove timer\n */\n _addScrollBar() {\n const canvas = this.getCanvas();\n\n canvas.add(this._horizontalScroll);\n canvas.add(this._verticalScroll);\n\n if (this.scrollBarTid) {\n clearTimeout(this.scrollBarTid);\n }\n\n this.scrollBarTid = setTimeout(() => {\n canvas.remove(this._horizontalScroll);\n canvas.remove(this._verticalScroll);\n }, 3000);\n }\n\n /**\n * Check zoom level is default zoom level (1.0)\n * @param {number} zoomLevel - zoom level\n * @returns {boolean} - whether zoom level is 1.0\n */\n _isDefaultZoomLevel(zoomLevel) {\n return zoomLevel === DEFAULT_ZOOM_LEVEL;\n }\n\n /**\n * Fire 'zoomChanged' event\n * @param {fabric.Canvas} canvas - fabric canvas\n * @param {number} zoomLevel - 'zoomChanged' event params\n */\n _fireZoomChanged(canvas, zoomLevel) {\n canvas.fire(ZOOM_CHANGED, { viewport: canvas.calcViewportBoundaries(), zoomLevel });\n }\n\n /**\n * Get zoom mode\n */\n get mode() {\n return this.zoomMode;\n }\n}\n\nexport default Zoom;\n","/**\n * @author NHN. FE Development Team \n * @fileoverview CropperDrawingMode class\n */\nimport DrawingMode from '@/interface/drawingMode';\nimport { drawingModes, componentNames as components } from '@/consts';\n\n/**\n * CropperDrawingMode class\n * @class\n * @ignore\n */\nclass CropperDrawingMode extends DrawingMode {\n constructor() {\n super(drawingModes.CROPPER);\n }\n\n /**\n * start this drawing mode\n * @param {Graphics} graphics - Graphics instance\n * @override\n */\n start(graphics) {\n const cropper = graphics.getComponent(components.CROPPER);\n cropper.start();\n }\n\n /**\n * stop this drawing mode\n * @param {Graphics} graphics - Graphics instance\n * @override\n */\n end(graphics) {\n const cropper = graphics.getComponent(components.CROPPER);\n cropper.end();\n }\n}\n\nexport default CropperDrawingMode;\n","/**\n * @author NHN. FE Development Team \n * @fileoverview FreeDrawingMode class\n */\nimport DrawingMode from '@/interface/drawingMode';\nimport { drawingModes, componentNames as components } from '@/consts';\n\n/**\n * FreeDrawingMode class\n * @class\n * @ignore\n */\nclass FreeDrawingMode extends DrawingMode {\n constructor() {\n super(drawingModes.FREE_DRAWING);\n }\n\n /**\n * start this drawing mode\n * @param {Graphics} graphics - Graphics instance\n * @param {{width: ?number, color: ?string}} [options] - Brush width & color\n * @override\n */\n start(graphics, options) {\n const freeDrawing = graphics.getComponent(components.FREE_DRAWING);\n freeDrawing.start(options);\n }\n\n /**\n * stop this drawing mode\n * @param {Graphics} graphics - Graphics instance\n * @override\n */\n end(graphics) {\n const freeDrawing = graphics.getComponent(components.FREE_DRAWING);\n freeDrawing.end();\n }\n}\n\nexport default FreeDrawingMode;\n","/**\n * @author NHN. FE Development Team \n * @fileoverview LineDrawingMode class\n */\nimport DrawingMode from '@/interface/drawingMode';\nimport { drawingModes, componentNames as components } from '@/consts';\n\n/**\n * LineDrawingMode class\n * @class\n * @ignore\n */\nclass LineDrawingMode extends DrawingMode {\n constructor() {\n super(drawingModes.LINE_DRAWING);\n }\n\n /**\n * start this drawing mode\n * @param {Graphics} graphics - Graphics instance\n * @param {{width: ?number, color: ?string}} [options] - Brush width & color\n * @override\n */\n start(graphics, options) {\n const lineDrawing = graphics.getComponent(components.LINE);\n lineDrawing.start(options);\n }\n\n /**\n * stop this drawing mode\n * @param {Graphics} graphics - Graphics instance\n * @override\n */\n end(graphics) {\n const lineDrawing = graphics.getComponent(components.LINE);\n lineDrawing.end();\n }\n}\n\nexport default LineDrawingMode;\n","/**\n * @author NHN. FE Development Team \n * @fileoverview ShapeDrawingMode class\n */\nimport DrawingMode from '@/interface/drawingMode';\nimport { drawingModes, componentNames as components } from '@/consts';\n\n/**\n * ShapeDrawingMode class\n * @class\n * @ignore\n */\nclass ShapeDrawingMode extends DrawingMode {\n constructor() {\n super(drawingModes.SHAPE);\n }\n\n /**\n * start this drawing mode\n * @param {Graphics} graphics - Graphics instance\n * @override\n */\n start(graphics) {\n const shape = graphics.getComponent(components.SHAPE);\n shape.start();\n }\n\n /**\n * stop this drawing mode\n * @param {Graphics} graphics - Graphics instance\n * @override\n */\n end(graphics) {\n const shape = graphics.getComponent(components.SHAPE);\n shape.end();\n }\n}\n\nexport default ShapeDrawingMode;\n","/**\n * @author NHN. FE Development Team \n * @fileoverview TextDrawingMode class\n */\nimport DrawingMode from '@/interface/drawingMode';\nimport { drawingModes, componentNames as components } from '@/consts';\n\n/**\n * TextDrawingMode class\n * @class\n * @ignore\n */\nclass TextDrawingMode extends DrawingMode {\n constructor() {\n super(drawingModes.TEXT);\n }\n\n /**\n * start this drawing mode\n * @param {Graphics} graphics - Graphics instance\n * @override\n */\n start(graphics) {\n const text = graphics.getComponent(components.TEXT);\n text.start();\n }\n\n /**\n * stop this drawing mode\n * @param {Graphics} graphics - Graphics instance\n * @override\n */\n end(graphics) {\n const text = graphics.getComponent(components.TEXT);\n text.end();\n }\n}\n\nexport default TextDrawingMode;\n","/**\n * @author NHN. FE Development Team \n * @fileoverview IconDrawingMode class\n */\nimport DrawingMode from '@/interface/drawingMode';\nimport { drawingModes, componentNames as components } from '@/consts';\n\n/**\n * IconDrawingMode class\n * @class\n * @ignore\n */\nclass IconDrawingMode extends DrawingMode {\n constructor() {\n super(drawingModes.ICON);\n }\n\n /**\n * start this drawing mode\n * @param {Graphics} graphics - Graphics instance\n * @override\n */\n start(graphics) {\n const icon = graphics.getComponent(components.ICON);\n icon.start();\n }\n\n /**\n * stop this drawing mode\n * @param {Graphics} graphics - Graphics instance\n * @override\n */\n end(graphics) {\n const icon = graphics.getComponent(components.ICON);\n icon.end();\n }\n}\n\nexport default IconDrawingMode;\n","/**\n * @author NHN. FE Development Team \n * @fileoverview ZoomDrawingMode class\n */\nimport DrawingMode from '@/interface/drawingMode';\nimport { drawingModes, componentNames as components } from '@/consts';\n\n/**\n * ZoomDrawingMode class\n * @class\n * @ignore\n */\nclass ZoomDrawingMode extends DrawingMode {\n constructor() {\n super(drawingModes.ZOOM);\n }\n\n /**\n * start this drawing mode\n * @param {Graphics} graphics - Graphics instance\n * @override\n */\n start(graphics) {\n const zoom = graphics.getComponent(components.ZOOM);\n\n zoom.start();\n }\n\n /**\n * stop this drawing mode\n * @param {Graphics} graphics - Graphics instance\n * @override\n */\n end(graphics) {\n const zoom = graphics.getComponent(components.ZOOM);\n\n zoom.end();\n }\n}\n\nexport default ZoomDrawingMode;\n","/**\n * @author NHN. FE Development Team \n * @fileoverview Add an icon\n */\nimport commandFactory from '@/factory/command';\nimport { Promise } from '@/util';\nimport { componentNames, commandNames } from '@/consts';\n\nconst { ICON } = componentNames;\n\nconst command = {\n name: commandNames.ADD_ICON,\n\n /**\n * Add an icon\n * @param {Graphics} graphics - Graphics instance\n * @param {string} type - Icon type ('arrow', 'cancel', custom icon name)\n * @param {Object} options - Icon options\n * @param {string} [options.fill] - Icon foreground color\n * @param {string} [options.left] - Icon x position\n * @param {string} [options.top] - Icon y position\n * @returns {Promise}\n */\n execute(graphics, type, options) {\n const iconComp = graphics.getComponent(ICON);\n\n return iconComp.add(type, options).then((objectProps) => {\n this.undoData.object = graphics.getObject(objectProps.id);\n\n return objectProps;\n });\n },\n\n /**\n * @param {Graphics} graphics - Graphics instance\n * @returns {Promise}\n */\n undo(graphics) {\n graphics.remove(this.undoData.object);\n\n return Promise.resolve();\n },\n};\n\ncommandFactory.register(command);\n\nexport default command;\n","/**\n * @author NHN. FE Development Team \n * @fileoverview Add an image object\n */\nimport commandFactory from '@/factory/command';\nimport { Promise } from '@/util';\nimport { commandNames } from '@/consts';\n\nconst command = {\n name: commandNames.ADD_IMAGE_OBJECT,\n\n /**\n * Add an image object\n * @param {Graphics} graphics - Graphics instance\n * @param {string} imgUrl - Image url to make object\n * @returns {Promise}\n */\n execute(graphics, imgUrl) {\n return graphics.addImageObject(imgUrl).then((objectProps) => {\n this.undoData.object = graphics.getObject(objectProps.id);\n\n return objectProps;\n });\n },\n\n /**\n * @param {Graphics} graphics - Graphics instance\n * @returns {Promise}\n */\n undo(graphics) {\n graphics.remove(this.undoData.object);\n\n return Promise.resolve();\n },\n};\n\ncommandFactory.register(command);\n\nexport default command;\n","/**\n * @author NHN. FE Development Team \n * @fileoverview Add an object\n */\nimport commandFactory from '@/factory/command';\nimport { Promise } from '@/util';\nimport { commandNames, rejectMessages } from '@/consts';\n\nconst command = {\n name: commandNames.ADD_OBJECT,\n\n /**\n * Add an object\n * @param {Graphics} graphics - Graphics instance\n * @param {Object} object - Fabric object\n * @returns {Promise}\n */\n execute(graphics, object) {\n return new Promise((resolve, reject) => {\n if (!graphics.contains(object)) {\n graphics.add(object);\n resolve(object);\n } else {\n reject(rejectMessages.addedObject);\n }\n });\n },\n\n /**\n * @param {Graphics} graphics - Graphics instance\n * @param {Object} object - Fabric object\n * @returns {Promise}\n */\n undo(graphics, object) {\n return new Promise((resolve, reject) => {\n if (graphics.contains(object)) {\n graphics.remove(object);\n resolve(object);\n } else {\n reject(rejectMessages.noObject);\n }\n });\n },\n};\n\ncommandFactory.register(command);\n\nexport default command;\n","/**\n * @author NHN. FE Development Team \n * @fileoverview Add a shape\n */\nimport commandFactory from '@/factory/command';\nimport { Promise } from '@/util';\nimport { componentNames, commandNames } from '@/consts';\n\nconst { SHAPE } = componentNames;\n\nconst command = {\n name: commandNames.ADD_SHAPE,\n\n /**\n * Add a shape\n * @param {Graphics} graphics - Graphics instance\n * @param {string} type - Shape type (ex: 'rect', 'circle', 'triangle')\n * @param {Object} options - Shape options\n * @param {string} [options.fill] - Shape foreground color (ex: '#fff', 'transparent')\n * @param {string} [options.stroke] - Shape outline color\n * @param {number} [options.strokeWidth] - Shape outline width\n * @param {number} [options.width] - Width value (When type option is 'rect', this options can use)\n * @param {number} [options.height] - Height value (When type option is 'rect', this options can use)\n * @param {number} [options.rx] - Radius x value (When type option is 'circle', this options can use)\n * @param {number} [options.ry] - Radius y value (When type option is 'circle', this options can use)\n * @param {number} [options.left] - Shape x position\n * @param {number} [options.top] - Shape y position\n * @param {number} [options.isRegular] - Whether resizing shape has 1:1 ratio or not\n * @returns {Promise}\n */\n execute(graphics, type, options) {\n const shapeComp = graphics.getComponent(SHAPE);\n\n return shapeComp.add(type, options).then((objectProps) => {\n const { id } = objectProps;\n\n this.undoData.object = graphics.getObject(id);\n\n return objectProps;\n });\n },\n\n /**\n * @param {Graphics} graphics - Graphics instance\n * @returns {Promise}\n */\n undo(graphics) {\n graphics.remove(this.undoData.object);\n\n return Promise.resolve();\n },\n};\n\ncommandFactory.register(command);\n\nexport default command;\n","/**\n * @author NHN. FE Development Team \n * @fileoverview Add a text object\n */\nimport commandFactory from '@/factory/command';\nimport { Promise } from '@/util';\nimport { componentNames, commandNames, rejectMessages } from '@/consts';\nimport {\n setCachedUndoDataForDimension,\n makeSelectionUndoData,\n makeSelectionUndoDatum,\n} from '@/helper/selectionModifyHelper';\n\nconst { TEXT } = componentNames;\n\nconst command = {\n name: commandNames.ADD_TEXT,\n\n /**\n * Add a text object\n * @param {Graphics} graphics - Graphics instance\n * @param {string} text - Initial input text\n * @param {Object} [options] Options for text styles\n * @param {Object} [options.styles] Initial styles\n * @param {string} [options.styles.fill] Color\n * @param {string} [options.styles.fontFamily] Font type for text\n * @param {number} [options.styles.fontSize] Size\n * @param {string} [options.styles.fontStyle] Type of inclination (normal / italic)\n * @param {string} [options.styles.fontWeight] Type of thicker or thinner looking (normal / bold)\n * @param {string} [options.styles.textAlign] Type of text align (left / center / right)\n * @param {string} [options.styles.textDecoration] Type of line (underline / line-through / overline)\n * @param {{x: number, y: number}} [options.position] - Initial position\n * @returns {Promise}\n */\n execute(graphics, text, options) {\n const textComp = graphics.getComponent(TEXT);\n\n if (this.undoData.object) {\n const undoObject = this.undoData.object;\n\n return new Promise((resolve, reject) => {\n if (!graphics.contains(undoObject)) {\n graphics.add(undoObject);\n resolve(undoObject);\n } else {\n reject(rejectMessages.redo);\n }\n });\n }\n\n return textComp.add(text, options).then((objectProps) => {\n const { id } = objectProps;\n const textObject = graphics.getObject(id);\n\n this.undoData.object = textObject;\n\n setCachedUndoDataForDimension(\n makeSelectionUndoData(textObject, () => makeSelectionUndoDatum(id, textObject, false))\n );\n\n return objectProps;\n });\n },\n\n /**\n * @param {Graphics} graphics - Graphics instance\n * @returns {Promise}\n */\n undo(graphics) {\n graphics.remove(this.undoData.object);\n\n return Promise.resolve();\n },\n};\n\ncommandFactory.register(command);\n\nexport default command;\n","/**\n * @author NHN. FE Development Team \n * @fileoverview Apply a filter into an image\n */\nimport snippet from 'tui-code-snippet';\nimport commandFactory from '@/factory/command';\nimport { componentNames, rejectMessages, commandNames } from '@/consts';\n\nconst { FILTER } = componentNames;\n\n/**\n * Cached data for undo\n * @type {Object}\n */\nlet cachedUndoDataForSilent = null;\n\n/**\n * Make undoData\n * @param {string} type - Filter type\n * @param {Object} prevfilterOption - prev Filter options\n * @param {Object} options - Filter options\n * @returns {object} - undo data\n */\nfunction makeUndoData(type, prevfilterOption, options) {\n const undoData = {};\n\n if (type === 'mask') {\n undoData.object = options.mask;\n }\n\n undoData.options = prevfilterOption;\n\n return undoData;\n}\n\nconst command = {\n name: commandNames.APPLY_FILTER,\n\n /**\n * Apply a filter into an image\n * @param {Graphics} graphics - Graphics instance\n * @param {string} type - Filter type\n * @param {Object} options - Filter options\n * @param {number} options.maskObjId - masking image object id\n * @param {boolean} isSilent - is silent execution or not\n * @returns {Promise}\n */\n execute(graphics, type, options, isSilent) {\n const filterComp = graphics.getComponent(FILTER);\n\n if (type === 'mask') {\n const maskObj = graphics.getObject(options.maskObjId);\n\n if (!(maskObj && maskObj.isType('image'))) {\n return Promise.reject(rejectMessages.invalidParameters);\n }\n\n snippet.extend(options, { mask: maskObj });\n graphics.remove(options.mask);\n }\n if (!this.isRedo) {\n const prevfilterOption = filterComp.getOptions(type);\n const undoData = makeUndoData(type, prevfilterOption, options);\n\n cachedUndoDataForSilent = this.setUndoData(undoData, cachedUndoDataForSilent, isSilent);\n }\n\n return filterComp.add(type, options);\n },\n\n /**\n * @param {Graphics} graphics - Graphics instance\n * @param {string} type - Filter type\n * @returns {Promise}\n */\n undo(graphics, type) {\n const filterComp = graphics.getComponent(FILTER);\n\n if (type === 'mask') {\n const mask = this.undoData.object;\n graphics.add(mask);\n graphics.setActiveObject(mask);\n\n return filterComp.remove(type);\n }\n\n // options changed case\n if (this.undoData.options) {\n return filterComp.add(type, this.undoData.options);\n }\n\n // filter added case\n return filterComp.remove(type);\n },\n};\n\ncommandFactory.register(command);\n\nexport default command;\n","/**\n * @author NHN. FE Development Team \n * @fileoverview Change icon color\n */\nimport commandFactory from '@/factory/command';\nimport { Promise } from '@/util';\nimport { componentNames, rejectMessages, commandNames } from '@/consts';\n\nconst { ICON } = componentNames;\n\nconst command = {\n name: commandNames.CHANGE_ICON_COLOR,\n\n /**\n * Change icon color\n * @param {Graphics} graphics - Graphics instance\n * @param {number} id - object id\n * @param {string} color - Color for icon\n * @returns {Promise}\n */\n execute(graphics, id, color) {\n return new Promise((resolve, reject) => {\n const iconComp = graphics.getComponent(ICON);\n const targetObj = graphics.getObject(id);\n\n if (!targetObj) {\n reject(rejectMessages.noObject);\n }\n\n this.undoData.object = targetObj;\n this.undoData.color = iconComp.getColor(targetObj);\n iconComp.setColor(color, targetObj);\n resolve();\n });\n },\n\n /**\n * @param {Graphics} graphics - Graphics instance\n * @returns {Promise}\n */\n undo(graphics) {\n const iconComp = graphics.getComponent(ICON);\n const { object: icon, color } = this.undoData;\n\n iconComp.setColor(color, icon);\n\n return Promise.resolve();\n },\n};\n\ncommandFactory.register(command);\n\nexport default command;\n","/**\n * @author NHN. FE Development Team \n * @fileoverview change a shape\n */\nimport snippet from 'tui-code-snippet';\nimport commandFactory from '@/factory/command';\nimport { Promise } from '@/util';\nimport { componentNames, rejectMessages, commandNames } from '@/consts';\n\nconst { SHAPE } = componentNames;\n\n/**\n * Cached data for undo\n * @type {Object}\n */\nlet cachedUndoDataForSilent = null;\n\n/**\n * Make undoData\n * @param {object} options - shape options\n * @param {Component} targetObj - shape component\n * @returns {object} - undo data\n */\nfunction makeUndoData(options, targetObj) {\n const undoData = {\n object: targetObj,\n options: {},\n };\n\n snippet.forEachOwnProperties(options, (value, key) => {\n undoData.options[key] = targetObj[key];\n });\n\n return undoData;\n}\n\nconst command = {\n name: commandNames.CHANGE_SHAPE,\n\n /**\n * Change a shape\n * @param {Graphics} graphics - Graphics instance\n * @param {number} id - object id\n * @param {Object} options - Shape options\n * @param {string} [options.fill] - Shape foreground color (ex: '#fff', 'transparent')\n * @param {string} [options.stroke] - Shape outline color\n * @param {number} [options.strokeWidth] - Shape outline width\n * @param {number} [options.width] - Width value (When type option is 'rect', this options can use)\n * @param {number} [options.height] - Height value (When type option is 'rect', this options can use)\n * @param {number} [options.rx] - Radius x value (When type option is 'circle', this options can use)\n * @param {number} [options.ry] - Radius y value (When type option is 'circle', this options can use)\n * @param {number} [options.left] - Shape x position\n * @param {number} [options.top] - Shape y position\n * @param {number} [options.isRegular] - Whether resizing shape has 1:1 ratio or not\n * @param {boolean} isSilent - is silent execution or not\n * @returns {Promise}\n */\n execute(graphics, id, options, isSilent) {\n const shapeComp = graphics.getComponent(SHAPE);\n const targetObj = graphics.getObject(id);\n\n if (!targetObj) {\n return Promise.reject(rejectMessages.noObject);\n }\n\n if (!this.isRedo) {\n const undoData = makeUndoData(options, targetObj);\n\n cachedUndoDataForSilent = this.setUndoData(undoData, cachedUndoDataForSilent, isSilent);\n }\n\n return shapeComp.change(targetObj, options);\n },\n\n /**\n * @param {Graphics} graphics - Graphics instance\n * @returns {Promise}\n */\n undo(graphics) {\n const shapeComp = graphics.getComponent(SHAPE);\n const { object: shape, options } = this.undoData;\n\n return shapeComp.change(shape, options);\n },\n};\n\ncommandFactory.register(command);\n\nexport default command;\n","/**\n * @author NHN. FE Development Team \n * @fileoverview Change a text\n */\nimport commandFactory from '@/factory/command';\nimport { Promise } from '@/util';\nimport { componentNames, rejectMessages, commandNames } from '@/consts';\n\nconst { TEXT } = componentNames;\n\nconst command = {\n name: commandNames.CHANGE_TEXT,\n\n /**\n * Change a text\n * @param {Graphics} graphics - Graphics instance\n * @param {number} id - object id\n * @param {string} text - Changing text\n * @returns {Promise}\n */\n execute(graphics, id, text) {\n const textComp = graphics.getComponent(TEXT);\n const targetObj = graphics.getObject(id);\n\n if (!targetObj) {\n return Promise.reject(rejectMessages.noObject);\n }\n\n this.undoData.object = targetObj;\n this.undoData.text = textComp.getText(targetObj);\n\n return textComp.change(targetObj, text);\n },\n\n /**\n * @param {Graphics} graphics - Graphics instance\n * @returns {Promise}\n */\n undo(graphics) {\n const textComp = graphics.getComponent(TEXT);\n const { object: textObj, text } = this.undoData;\n\n return textComp.change(textObj, text);\n },\n};\n\ncommandFactory.register(command);\n\nexport default command;\n","/**\n * @author NHN. FE Development Team \n * @fileoverview Change text styles\n */\nimport snippet from 'tui-code-snippet';\nimport commandFactory from '@/factory/command';\nimport { Promise } from '@/util';\nimport { componentNames, rejectMessages, commandNames } from '@/consts';\n\nconst { TEXT } = componentNames;\n\n/**\n * Cached data for undo\n * @type {Object}\n */\nlet cachedUndoDataForSilent = null;\n\n/**\n * Make undoData\n * @param {object} styles - text styles\n * @param {Component} targetObj - text component\n * @returns {object} - undo data\n */\nfunction makeUndoData(styles, targetObj) {\n const undoData = {\n object: targetObj,\n styles: {},\n };\n snippet.forEachOwnProperties(styles, (value, key) => {\n const undoValue = targetObj[key];\n undoData.styles[key] = undoValue;\n });\n\n return undoData;\n}\n\nconst command = {\n name: commandNames.CHANGE_TEXT_STYLE,\n\n /**\n * Change text styles\n * @param {Graphics} graphics - Graphics instance\n * @param {number} id - object id\n * @param {Object} styles - text styles\n * @param {string} [styles.fill] Color\n * @param {string} [styles.fontFamily] Font type for text\n * @param {number} [styles.fontSize] Size\n * @param {string} [styles.fontStyle] Type of inclination (normal / italic)\n * @param {string} [styles.fontWeight] Type of thicker or thinner looking (normal / bold)\n * @param {string} [styles.textAlign] Type of text align (left / center / right)\n * @param {string} [styles.textDecoration] Type of line (underline / line-through / overline)\n * @param {boolean} isSilent - is silent execution or not\n * @returns {Promise}\n */\n execute(graphics, id, styles, isSilent) {\n const textComp = graphics.getComponent(TEXT);\n const targetObj = graphics.getObject(id);\n\n if (!targetObj) {\n return Promise.reject(rejectMessages.noObject);\n }\n if (!this.isRedo) {\n const undoData = makeUndoData(styles, targetObj);\n\n cachedUndoDataForSilent = this.setUndoData(undoData, cachedUndoDataForSilent, isSilent);\n }\n\n return textComp.setStyle(targetObj, styles);\n },\n\n /**\n * @param {Graphics} graphics - Graphics instance\n * @returns {Promise}\n */\n undo(graphics) {\n const textComp = graphics.getComponent(TEXT);\n const { object: textObj, styles } = this.undoData;\n\n return textComp.setStyle(textObj, styles);\n },\n};\n\ncommandFactory.register(command);\n\nexport default command;\n","/**\n * @author NHN. FE Development Team \n * @fileoverview Clear all objects\n */\nimport commandFactory from '@/factory/command';\nimport { Promise } from '@/util';\nimport { commandNames } from '@/consts';\n\nconst command = {\n name: commandNames.CLEAR_OBJECTS,\n\n /**\n * Clear all objects without background (main) image\n * @param {Graphics} graphics - Graphics instance\n * @returns {Promise}\n */\n execute(graphics) {\n return new Promise((resolve) => {\n this.undoData.objects = graphics.removeAll();\n resolve();\n });\n },\n\n /**\n * @param {Graphics} graphics - Graphics instance\n * @returns {Promise}\n * @ignore\n */\n undo(graphics) {\n graphics.add(this.undoData.objects);\n\n return Promise.resolve();\n },\n};\n\ncommandFactory.register(command);\n\nexport default command;\n","/**\n * @author NHN. FE Development Team \n * @fileoverview Flip an image\n */\nimport commandFactory from '@/factory/command';\nimport { componentNames, commandNames } from '@/consts';\n\nconst { FLIP } = componentNames;\n\nconst command = {\n name: commandNames.FLIP_IMAGE,\n\n /**\n * flip an image\n * @param {Graphics} graphics - Graphics instance\n * @param {string} type - 'flipX' or 'flipY' or 'reset'\n * @returns {Promise}\n */\n execute(graphics, type) {\n const flipComp = graphics.getComponent(FLIP);\n\n this.undoData.setting = flipComp.getCurrentSetting();\n\n return flipComp[type]();\n },\n\n /**\n * @param {Graphics} graphics - Graphics instance\n * @returns {Promise}\n */\n undo(graphics) {\n const flipComp = graphics.getComponent(FLIP);\n\n return flipComp.set(this.undoData.setting);\n },\n};\n\ncommandFactory.register(command);\n\nexport default command;\n","/**\n * @author NHN. FE Development Team \n * @fileoverview Load a background (main) image\n */\nimport commandFactory from '@/factory/command';\nimport { componentNames, commandNames } from '@/consts';\n\nconst { IMAGE_LOADER } = componentNames;\n\nconst command = {\n name: commandNames.LOAD_IMAGE,\n\n /**\n * Load a background (main) image\n * @param {Graphics} graphics - Graphics instance\n * @param {string} imageName - Image name\n * @param {string} imgUrl - Image Url\n * @returns {Promise}\n */\n execute(graphics, imageName, imgUrl) {\n const loader = graphics.getComponent(IMAGE_LOADER);\n const prevImage = loader.getCanvasImage();\n const prevImageWidth = prevImage ? prevImage.width : 0;\n const prevImageHeight = prevImage ? prevImage.height : 0;\n const objects = graphics.removeAll(true).filter((objectItem) => objectItem.type !== 'cropzone');\n\n objects.forEach((objectItem) => {\n objectItem.evented = true;\n });\n\n this.undoData = {\n name: loader.getImageName(),\n image: prevImage,\n objects,\n };\n\n return loader.load(imageName, imgUrl).then((newImage) => ({\n oldWidth: prevImageWidth,\n oldHeight: prevImageHeight,\n newWidth: newImage.width,\n newHeight: newImage.height,\n }));\n },\n\n /**\n * @param {Graphics} graphics - Graphics instance\n * @returns {Promise}\n */\n undo(graphics) {\n const loader = graphics.getComponent(IMAGE_LOADER);\n const { objects, name, image } = this.undoData;\n\n graphics.removeAll(true);\n graphics.add(objects);\n\n return loader.load(name, image);\n },\n};\n\ncommandFactory.register(command);\n\nexport default command;\n","/**\n * @author NHN. FE Development Team \n * @fileoverview Remove a filter from an image\n */\nimport commandFactory from '@/factory/command';\nimport { componentNames, commandNames } from '@/consts';\n\nconst { FILTER } = componentNames;\n\nconst command = {\n name: commandNames.REMOVE_FILTER,\n\n /**\n * Remove a filter from an image\n * @param {Graphics} graphics - Graphics instance\n * @param {string} type - Filter type\n * @returns {Promise}\n */\n execute(graphics, type) {\n const filterComp = graphics.getComponent(FILTER);\n\n this.undoData.options = filterComp.getOptions(type);\n\n return filterComp.remove(type);\n },\n\n /**\n * @param {Graphics} graphics - Graphics instance\n * @param {string} type - Filter type\n * @returns {Promise}\n */\n undo(graphics, type) {\n const filterComp = graphics.getComponent(FILTER);\n const { options } = this.undoData;\n\n return filterComp.add(type, options);\n },\n};\n\ncommandFactory.register(command);\n\nexport default command;\n","/**\n * @author NHN. FE Development Team \n * @fileoverview Remove an object\n */\nimport commandFactory from '@/factory/command';\nimport { Promise } from '@/util';\nimport { commandNames, rejectMessages } from '@/consts';\n\nconst command = {\n name: commandNames.REMOVE_OBJECT,\n\n /**\n * Remove an object\n * @param {Graphics} graphics - Graphics instance\n * @param {number} id - object id\n * @returns {Promise}\n */\n execute(graphics, id) {\n return new Promise((resolve, reject) => {\n this.undoData.objects = graphics.removeObjectById(id);\n if (this.undoData.objects.length) {\n resolve();\n } else {\n reject(rejectMessages.noObject);\n }\n });\n },\n\n /**\n * @param {Graphics} graphics - Graphics instance\n * @returns {Promise}\n */\n undo(graphics) {\n graphics.add(this.undoData.objects);\n\n return Promise.resolve();\n },\n};\n\ncommandFactory.register(command);\n\nexport default command;\n","/**\n * @author NHN. FE Development Team \n * @fileoverview Resize a canvas\n */\nimport commandFactory from '@/factory/command';\nimport { Promise } from '@/util';\nimport { commandNames } from '@/consts';\n\nconst command = {\n name: commandNames.RESIZE_CANVAS_DIMENSION,\n\n /**\n * resize the canvas with given dimension\n * @param {Graphics} graphics - Graphics instance\n * @param {{width: number, height: number}} dimension - Max width & height\n * @returns {Promise}\n */\n execute(graphics, dimension) {\n return new Promise((resolve) => {\n this.undoData.size = {\n width: graphics.cssMaxWidth,\n height: graphics.cssMaxHeight,\n };\n\n graphics.setCssMaxDimension(dimension);\n graphics.adjustCanvasDimension();\n resolve();\n });\n },\n\n /**\n * @param {Graphics} graphics - Graphics instance\n * @returns {Promise}\n */\n undo(graphics) {\n graphics.setCssMaxDimension(this.undoData.size);\n graphics.adjustCanvasDimension();\n\n return Promise.resolve();\n },\n};\n\ncommandFactory.register(command);\n\nexport default command;\n","/**\n * @author NHN. FE Development Team \n * @fileoverview Rotate an image\n */\nimport commandFactory from '@/factory/command';\nimport { componentNames, commandNames } from '@/consts';\n\nconst { ROTATION } = componentNames;\n\n/**\n * Cached data for undo\n * @type {Object}\n */\nlet cachedUndoDataForSilent = null;\n\n/**\n * Make undo data\n * @param {Component} rotationComp - rotation component\n * @returns {object} - undodata\n */\nfunction makeUndoData(rotationComp) {\n return {\n angle: rotationComp.getCurrentAngle(),\n };\n}\n\nconst command = {\n name: commandNames.ROTATE_IMAGE,\n\n /**\n * Rotate an image\n * @param {Graphics} graphics - Graphics instance\n * @param {string} type - 'rotate' or 'setAngle'\n * @param {number} angle - angle value (degree)\n * @param {boolean} isSilent - is silent execution or not\n * @returns {Promise}\n */\n execute(graphics, type, angle, isSilent) {\n const rotationComp = graphics.getComponent(ROTATION);\n\n if (!this.isRedo) {\n const undoData = makeUndoData(rotationComp);\n\n cachedUndoDataForSilent = this.setUndoData(undoData, cachedUndoDataForSilent, isSilent);\n }\n\n return rotationComp[type](angle);\n },\n\n /**\n * @param {Graphics} graphics - Graphics instance\n * @returns {Promise}\n */\n undo(graphics) {\n const rotationComp = graphics.getComponent(ROTATION);\n const [, type, angle] = this.args;\n\n if (type === 'setAngle') {\n return rotationComp[type](this.undoData.angle);\n }\n\n return rotationComp.rotate(-angle);\n },\n};\n\ncommandFactory.register(command);\n\nexport default command;\n","/**\n * @author NHN. FE Development Team \n * @fileoverview Set object properties\n */\nimport snippet from 'tui-code-snippet';\nimport commandFactory from '@/factory/command';\nimport { Promise } from '@/util';\nimport { commandNames, rejectMessages } from '@/consts';\n\nconst command = {\n name: commandNames.SET_OBJECT_PROPERTIES,\n\n /**\n * Set object properties\n * @param {Graphics} graphics - Graphics instance\n * @param {number} id - object id\n * @param {Object} props - properties\n * @param {string} [props.fill] Color\n * @param {string} [props.fontFamily] Font type for text\n * @param {number} [props.fontSize] Size\n * @param {string} [props.fontStyle] Type of inclination (normal / italic)\n * @param {string} [props.fontWeight] Type of thicker or thinner looking (normal / bold)\n * @param {string} [props.textAlign] Type of text align (left / center / right)\n * @param {string} [props.textDecoration] Type of line (underline / line-through / overline)\n * @returns {Promise}\n */\n execute(graphics, id, props) {\n const targetObj = graphics.getObject(id);\n\n if (!targetObj) {\n return Promise.reject(rejectMessages.noObject);\n }\n\n this.undoData.props = {};\n snippet.forEachOwnProperties(props, (value, key) => {\n this.undoData.props[key] = targetObj[key];\n });\n\n graphics.setObjectProperties(id, props);\n\n return Promise.resolve();\n },\n\n /**\n * @param {Graphics} graphics - Graphics instance\n * @param {number} id - object id\n * @returns {Promise}\n */\n undo(graphics, id) {\n const { props } = this.undoData;\n\n graphics.setObjectProperties(id, props);\n\n return Promise.resolve();\n },\n};\n\ncommandFactory.register(command);\n\nexport default command;\n","/**\n * @author NHN. FE Development Team \n * @fileoverview Set object properties\n */\nimport commandFactory from '@/factory/command';\nimport { Promise } from '@/util';\nimport { commandNames, rejectMessages } from '@/consts';\n\nconst command = {\n name: commandNames.SET_OBJECT_POSITION,\n\n /**\n * Set object properties\n * @param {Graphics} graphics - Graphics instance\n * @param {number} id - object id\n * @param {Object} posInfo - position object\n * @param {number} posInfo.x - x position\n * @param {number} posInfo.y - y position\n * @param {string} posInfo.originX - can be 'left', 'center', 'right'\n * @param {string} posInfo.originY - can be 'top', 'center', 'bottom'\n * @returns {Promise}\n */\n execute(graphics, id, posInfo) {\n const targetObj = graphics.getObject(id);\n\n if (!targetObj) {\n return Promise.reject(rejectMessages.noObject);\n }\n\n this.undoData.objectId = id;\n this.undoData.props = graphics.getObjectProperties(id, ['left', 'top']);\n\n graphics.setObjectPosition(id, posInfo);\n graphics.renderAll();\n\n return Promise.resolve();\n },\n\n /**\n * @param {Graphics} graphics - Graphics instance\n * @returns {Promise}\n */\n undo(graphics) {\n const { objectId, props } = this.undoData;\n\n graphics.setObjectProperties(objectId, props);\n graphics.renderAll();\n\n return Promise.resolve();\n },\n};\n\ncommandFactory.register(command);\n\nexport default command;\n","/**\n * @author NHN. FE Development Team \n * @fileoverview change selection\n */\nimport commandFactory from '@/factory/command';\nimport { Promise } from '@/util';\nimport { commandNames } from '@/consts';\nimport { getCachedUndoDataForDimension } from '@/helper/selectionModifyHelper';\n\nconst command = {\n name: commandNames.CHANGE_SELECTION,\n\n execute(graphics, props) {\n if (this.isRedo) {\n props.forEach((prop) => {\n graphics.setObjectProperties(prop.id, prop);\n });\n } else {\n this.undoData = getCachedUndoDataForDimension();\n }\n\n return Promise.resolve();\n },\n\n undo(graphics) {\n this.undoData.forEach((datum) => {\n graphics.setObjectProperties(datum.id, datum);\n });\n\n return Promise.resolve();\n },\n};\n\ncommandFactory.register(command);\n\nexport default command;\n"],"sourceRoot":""} \ No newline at end of file diff --git a/apps/image-editor/index.d.ts b/apps/image-editor/index.d.ts index 7684ff122..456af015e 100644 --- a/apps/image-editor/index.d.ts +++ b/apps/image-editor/index.d.ts @@ -1,4 +1,4 @@ -// Type definitions for TOAST UI Image Editor v3.14.0 +// Type definitions for TOAST UI Image Editor v3.14.1 // TypeScript Version: 3.2.2 declare namespace tuiImageEditor {