From d899f788696ad8810c7a50c55dee7b7f5027c016 Mon Sep 17 00:00:00 2001 From: "kyuwoo.choi" Date: Fri, 13 Apr 2018 23:31:46 +0900 Subject: [PATCH] chore: build dist for 3.1.0 --- dist/tui-image-editor.js | 38 ++++++++++++++++++++++++++++++++++-- dist/tui-image-editor.min.js | 10 +++++----- 2 files changed, 41 insertions(+), 7 deletions(-) diff --git a/dist/tui-image-editor.js b/dist/tui-image-editor.js index bbeb14bb4..fd19b23c2 100644 --- a/dist/tui-image-editor.js +++ b/dist/tui-image-editor.js @@ -1,6 +1,6 @@ /*! * tui-image-editor.js - * @version 3.0.2 + * @version 3.1.0 * @author NHNEnt FE Development Lab * @license MIT */ @@ -142,6 +142,8 @@ return /******/ (function(modules) { // webpackBootstrap var _consts2 = _interopRequireDefault(_consts); + var _util = __webpack_require__(71); + function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } @@ -161,13 +163,16 @@ return /******/ (function(modules) { // webpackBootstrap * @param {Object} [option] - Canvas max width & height of css * @param {number} option.cssMaxWidth - Canvas css-max-width * @param {number} option.cssMaxHeight - Canvas css-max-height + * @param {Boolean} [option.usageStatistics=true] - Let us know the hostname. If you don't want to send the hostname, please set to false. */ var ImageEditor = function () { function ImageEditor(wrapper, option) { _classCallCheck(this, ImageEditor); - option = option || {}; + option = _tuiCodeSnippet2.default.extend({ + usageStatistics: true + }, option); /** * Invoker @@ -208,6 +213,10 @@ return /******/ (function(modules) { // webpackBootstrap if (option.selectionStyle) { this._setSelectionStyle(option.selectionStyle); } + + if (option.usageStatistics) { + (0, _util.sendHostName)(); + } } /** @@ -3666,6 +3675,8 @@ return /******/ (function(modules) { // webpackBootstrap * @fileoverview Util */ + var hostnameSent = false; + module.exports = { /** * Clamp value @@ -3740,6 +3751,29 @@ return /******/ (function(modules) { // webpackBootstrap } return props; + }, + + + /** + * send hostname + */ + sendHostName: function sendHostName() { + var _location = location, + hostname = _location.hostname; + + if (hostnameSent) { + return; + } + hostnameSent = true; + + (0, _tuiCodeSnippet.imagePing)('https://www.google-analytics.com/collect', { + v: 1, + t: 'event', + tid: 'UA-115377265-9', + cid: hostname, + dp: hostname, + dh: 'image-editor' + }); } }; diff --git a/dist/tui-image-editor.min.js b/dist/tui-image-editor.min.js index af37acfee..9f31b394a 100644 --- a/dist/tui-image-editor.min.js +++ b/dist/tui-image-editor.min.js @@ -1,10 +1,10 @@ /*! * tui-image-editor.min.js - * @version 3.0.2 + * @version 3.1.0 * @author NHNEnt FE Development Lab * @license MIT */ -!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t(require("fabric/dist/fabric.require"),require("tui-code-snippet")):"function"==typeof define&&define.amd?define(["fabric/dist/fabric.require","tui-code-snippet"],t):"object"==typeof exports?exports.ImageEditor=t(require("fabric/dist/fabric.require"),require("tui-code-snippet")):(e.tui=e.tui||{},e.tui.ImageEditor=t(e.fabric,e.tui&&e.tui.util))}(this,function(e,t){return function(e){function t(r){if(n[r])return n[r].exports;var i=n[r]={exports:{},id:r,loaded:!1};return e[r].call(i.exports,i,i.exports,t),i.loaded=!0,i.exports}var n={};return t.m=e,t.c=n,t.p="dist",t(0)}([function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}var i=n(83),o=r(i);n(41),n(42),n(43),n(44),n(45),n(46),n(47),n(48),n(49),n(50),n(51),n(52),n(53),n(54),n(55),n(56),n(57),n(59),n(58),e.exports=o.default},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}var i=n(9),o=r(i);e.exports={componentNames:o.default.keyMirror("IMAGE_LOADER","CROPPER","FLIP","ROTATION","FREE_DRAWING","LINE","TEXT","ICON","FILTER","SHAPE"),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"},eventNames:{OBJECT_ACTIVATED:"objectActivated",OBJECT_MOVED:"objectMoved",OBJECT_SCALED:"objectScaled",TEXT_EDITING:"textEditing",TEXT_CHANGED:"textChanged",ADD_TEXT:"addText",ADD_OBJECT:"addObject",MOUSE_DOWN:"mousedown",REDO_STACK_CHANGED:"redoStackChanged",UNDO_STACK_CHANGED:"undoStackChanged"},drawingModes:o.default.keyMirror("NORMAL","CROPPER","FREE_DRAWING","LINE_DRAWING","TEXT","SHAPE"),keyCodes:{Z:90,Y:89,SHIFT:16,BACKSPACE:8,DEL:46},fObjectOptions:{SELECTION_STYLE:{borderColor:"red",cornerColor:"green",cornerSize:10,originX:"center",originY:"center",transparentCorners:!1}},rejectMessages:{flip:"The flipX and flipY setting values are not changed.",rotation:"The current angle is same the old angle.",loadImage:"The background image is empty.",isLock:"The executing command state is locked.",undo:"The promise of undo command is reject.",redo:"The promise of redo command is reject.",invalidDrawingMode:"This operation is not supported in the drawing mode",invalidParameters:"Invalid parameters",noActiveObject:"There is no active object.",unsupportedType:"Unsupported object type",noObject:"The object is not in canvas.",addedObject:"The object is already added."}}},function(e,t,n){n(114),n(116),n(117),n(115),e.exports=n(13).Promise},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}function i(e){var t=u[e];if(t){for(var n=arguments.length,r=Array(n>1?n-1:0),i=1;in&&(r=t,t=n,n=r),o(t,i(e,n))},keyMirror:function(){for(var e={},t=arguments.length,n=Array(t),i=0;i0?r:n)(e)}},function(e,t,n){var r=n(92),i=n(22);e.exports=function(e){return r(i(e))}},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}var i=n(5),o=r(i),a=n(9),s=(0,a.keyMirror)("UN_IMPLEMENTATION","NO_COMPONENT_NAME"),u={UN_IMPLEMENTATION:"Should implement a method: ",NO_COMPONENT_NAME:"Should set a component name"},c={UN_IMPLEMENTATION:function(e){return u.UN_IMPLEMENTATION+e},NO_COMPONENT_NAME:function(){return u.NO_COMPONENT_NAME}};e.exports={types:o.default.extend({},s),create:function(e){e=e.toLowerCase();for(var t=c[e],n=arguments.length,r=Array(n>1?n-1:0),i=1;in;)t.push(arguments[n++]);return g[++v]=function(){s("function"==typeof e?e:Function(e),t)},r(v),v},d=function(e){delete g[e]},"process"==n(16)(f)?r=function(e){f.nextTick(a(y,e,1))}:p?(i=new p,o=i.port2,i.port1.onmessage=m,r=a(o.postMessage,o,1)):l.addEventListener&&"function"==typeof postMessage&&!l.importScripts?(r=function(e){l.postMessage(e+"","*")},l.addEventListener("message",m,!1)):r=_ in c("script")?function(e){u.appendChild(c("script"))[_]=function(){u.removeChild(this),y.call(e)}}:function(e){setTimeout(a(y,e,1),0)}),e.exports={set:h,clear:d}},function(e,t,n){var r=n(26),i=Math.min;e.exports=function(e){return e>0?i(r(e),9007199254740991):0}},function(e,t){var n=0,r=Math.random();e.exports=function(e){return"Symbol(".concat(void 0===e?"":e,")_",(++n+r).toString(36))}},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}var i=n(3),o=r(i),a=n(2),s=r(a),u=n(1),c=r(u),l=c.default.componentNames,f=c.default.commandNames,h=l.ICON,d={name:f.ADD_ICON,execute:function(e,t,n){var r=this,i=e.getComponent(h);return i.add(t,n).then(function(t){return r.undoData.object=e.getObject(t.id),t})},undo:function(e){return e.remove(this.undoData.object),s.default.resolve()}};o.default.register(d),e.exports=d},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}var i=n(3),o=r(i),a=n(2),s=r(a),u=n(1),c=r(u),l=c.default.commandNames,f={name:l.ADD_IMAGE_OBJECT,execute:function(e,t){var n=this;return e.addImageObject(t).then(function(t){return n.undoData.object=e.getObject(t.id),t})},undo:function(e){return e.remove(this.undoData.object),s.default.resolve()}};o.default.register(f),e.exports=f},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}var i=n(3),o=r(i),a=n(2),s=r(a),u=n(1),c=r(u),l=c.default.commandNames,f=c.default.rejectMessages,h={name:l.ADD_OBJECT,execute:function(e,t){return new s.default(function(n,r){e.contains(t)?r(f.addedObject):(e.add(t),n(t))})},undo:function(e,t){return new s.default(function(n,r){e.contains(t)?(e.remove(t),n(t)):r(f.noObject)})}};o.default.register(h),e.exports=h},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}var i=n(3),o=r(i),a=n(2),s=r(a),u=n(1),c=r(u),l=c.default.componentNames,f=c.default.commandNames,h=l.SHAPE,d={name:f.ADD_SHAPE,execute:function(e,t,n){var r=this,i=e.getComponent(h);return i.add(t,n).then(function(t){return r.undoData.object=e.getObject(t.id),t})},undo:function(e){return e.remove(this.undoData.object),s.default.resolve()}};o.default.register(d),e.exports=d},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}var i=n(3),o=r(i),a=n(2),s=r(a),u=n(1),c=r(u),l=c.default.componentNames,f=c.default.commandNames,h=l.TEXT,d={name:f.ADD_TEXT,execute:function(e,t,n){var r=this,i=e.getComponent(h);return i.add(t,n).then(function(t){return r.undoData.object=e.getObject(t.id),t})},undo:function(e){return e.remove(this.undoData.object),s.default.resolve()}};o.default.register(d),e.exports=d},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}var i=n(3),o=r(i),a=n(1),s=r(a),u=s.default.componentNames,c=s.default.rejectMessages,l=s.default.commandNames,f=u.FILTER,h={name:l.APPLY_FILTER,execute:function(e,t,n){var r=e.getComponent(f);if("mask"===t){var i=e.getObject(n.maskObjId);if(!i||!i.isType("image"))return Promise.reject(c.invalidParameters);n={mask:i}}return"mask"===t?(this.undoData.object=n.mask,e.remove(n.mask)):this.undoData.options=r.getOptions(t),r.add(t,n)},undo:function(e,t){var n=e.getComponent(f);if("mask"===t){var r=this.undoData.object;return e.add(r),e.setActiveObject(r),n.remove(t)}return this.undoData.options?n.add(t,this.undoData.options):n.remove(t)}};o.default.register(h),e.exports=h},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}var i=n(3),o=r(i),a=n(2),s=r(a),u=n(1),c=r(u),l=c.default.componentNames,f=c.default.rejectMessages,h=c.default.commandNames,d=l.ICON,p={name:h.CHANGE_ICON_COLOR,execute:function(e,t,n){var r=this;return new s.default(function(i,o){var a=e.getComponent(d),s=e.getObject(t);s||o(f.noObject),r.undoData.object=s,r.undoData.color=a.getColor(s),a.setColor(n,s),i()})},undo:function(e){var t=e.getComponent(d),n=this.undoData.object,r=n.object,i=n.color;return t.setColor(i,r),s.default.resolve()}};o.default.register(p),e.exports=p},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}var i=n(5),o=r(i),a=n(3),s=r(a),u=n(2),c=r(u),l=n(1),f=r(l),h=f.default.componentNames,d=f.default.rejectMessages,p=f.default.commandNames,v=h.SHAPE,g={name:p.CHANGE_SHAPE,execute:function(e,t,n){var r=this,i=e.getComponent(v),a=e.getObject(t);return a?(this.undoData.object=a,this.undoData.options={},o.default.forEachOwnProperties(n,function(e,t){r.undoData.options[t]=a[t]}),i.change(a,n)):c.default.reject(d.noObject)},undo:function(e){var t=e.getComponent(v),n=this.undoData,r=n.object,i=n.options;return t.change(r,i)}};s.default.register(g),e.exports=g},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}var i=n(3),o=r(i),a=n(2),s=r(a),u=n(1),c=r(u),l=c.default.componentNames,f=c.default.rejectMessages,h=c.default.commandNames,d=l.TEXT,p={name:h.CHANGE_TEXT,execute:function(e,t,n){var r=e.getComponent(d),i=e.getObject(t);return i?(this.undoData.object=i,this.undoData.text=r.getText(i),r.change(i,n)):s.default.reject(f.noObject)},undo:function(e){var t=e.getComponent(d),n=this.undoData,r=n.object,i=n.text;return t.change(r,i)}};o.default.register(p),e.exports=p},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}var i=n(5),o=r(i),a=n(3),s=r(a),u=n(2),c=r(u),l=n(1),f=r(l),h=f.default.componentNames,d=f.default.rejectMessages,p=f.default.commandNames,v=h.TEXT,g={name:p.CHANGE_TEXT_STYLE,execute:function(e,t,n){var r=this,i=e.getComponent(v),a=e.getObject(t);return a?(this.undoData.object=a,this.undoData.styles={},o.default.forEachOwnProperties(n,function(e,t){r.undoData.styles[t]=a[t]}),i.setStyle(a,n)):c.default.reject(d.noObject)},undo:function(e){var t=e.getComponent(v),n=this.undoData,r=n.object,i=n.styles;return t.setStyle(r,i)}};s.default.register(g),e.exports=g},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}var i=n(3),o=r(i),a=n(2),s=r(a),u=n(1),c=r(u),l=c.default.commandNames,f={name:l.CLEAR_OBJECTS,execute:function(e){var t=this;return new s.default(function(n){t.undoData.objects=e.removeAll(),n()})},undo:function(e){return e.add(this.undoData.objects),s.default.resolve()}};o.default.register(f),e.exports=f},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}var i=n(3),o=r(i),a=n(1),s=r(a),u=s.default.componentNames,c=s.default.commandNames,l=u.FLIP,f={name:c.FLIP_IMAGE,execute:function(e,t){var n=e.getComponent(l);return this.undoData.setting=n.getCurrentSetting(),n[t]()},undo:function(e){var t=e.getComponent(l);return t.set(this.undoData.setting)}};o.default.register(f),e.exports=f},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}var i=n(3),o=r(i),a=n(1),s=r(a),u=s.default.componentNames,c=s.default.commandNames,l=u.IMAGE_LOADER,f={name:c.LOAD_IMAGE,execute:function(e,t,n){var r=e.getComponent(l),i=r.getCanvasImage(),o=i?i.width:0,a=i?i.height:0;return this.undoData={name:r.getImageName(),image:i,objects:e.removeAll(!0)},r.load(t,n).then(function(e){return{oldWidth:o,oldHeight:a,newWidth:e.width,newHeight:e.height}})},undo:function(e){var t=e.getComponent(l),n=this.undoData,r=n.objects,i=n.name,o=n.image;return e.removeAll(!0),e.add(r),t.load(i,o)}};o.default.register(f),e.exports=f},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}var i=n(3),o=r(i),a=n(1),s=r(a),u=s.default.componentNames,c=s.default.commandNames,l=u.FILTER,f={name:c.REMOVE_FILTER,execute:function(e,t){var n=e.getComponent(l);return this.undoData.options=n.getOptions(t),n.remove(t)},undo:function(e,t){var n=e.getComponent(l),r=this.undoData.options;return n.add(t,r)}};o.default.register(f),e.exports=f},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}var i=n(3),o=r(i),a=n(2),s=r(a),u=n(1),c=r(u),l=c.default.commandNames,f=c.default.rejectMessages,h={name:l.REMOVE_OBJECT,execute:function(e,t){var n=this;return new s.default(function(r,i){n.undoData.objects=e.removeObjectById(t),n.undoData.objects.length?r():i(f.noObject)})},undo:function(e){return e.add(this.undoData.objects),s.default.resolve()}};o.default.register(h),e.exports=h},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}var i=n(3),o=r(i),a=n(2),s=r(a),u=n(1),c=r(u),l=c.default.commandNames,f={name:l.RESIZE_CANVAS_DIMENSION,execute:function(e,t){var n=this;return new s.default(function(r){n.undoData.size={width:e.cssMaxWidth,height:e.cssMaxHeight},e.setCssMaxDimension(t),e.adjustCanvasDimension(),r()})},undo:function(e){return e.setCssMaxDimension(this.undoData.size),e.adjustCanvasDimension(),s.default.resolve()}};o.default.register(f),e.exports=f},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}var i=n(3),o=r(i),a=n(1),s=r(a),u=s.default.componentNames,c=s.default.commandNames,l=u.ROTATION,f={name:c.ROTATE_IMAGE,execute:function(e,t,n){var r=e.getComponent(l);return this.undoData.angle=r.getCurrentAngle(),r[t](n)},undo:function(e){var t=e.getComponent(l),n=this.undoData.angle;return t.setAngle(n)}};o.default.register(f),e.exports=f},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}var i=n(3),o=r(i),a=n(2),s=r(a),u=n(1),c=r(u),l=c.default.commandNames,f=c.default.rejectMessages,h={name:l.SET_OBJECT_POSITION,execute:function(e,t,n){var r=e.getObject(t);return r?(this.undoData.objectId=t,this.undoData.props=e.getObjectProperties(t,["left","top"]),e.setObjectPosition(t,n),e.renderAll(),s.default.resolve()):s.default.reject(f.noObject)},undo:function(e){var t=this.undoData,n=t.objectId,r=t.props;return e.setObjectProperties(n,r),e.renderAll(),s.default.resolve()}};o.default.register(h),e.exports=h},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}var i=n(5),o=r(i),a=n(3),s=r(a),u=n(2),c=r(u),l=n(1),f=r(l),h=f.default.commandNames,d=f.default.rejectMessages,p={name:h.SET_OBJECT_PROPERTIES,execute:function(e,t,n){var r=this,i=e.getObject(t);return i?(this.undoData.props={},o.default.forEachOwnProperties(n,function(e,t){r.undoData.props[t]=i[t]}),e.setObjectProperties(t,n),c.default.resolve()):c.default.reject(d.noObject)},undo:function(e,t){var n=this.undoData.props;return e.setObjectProperties(t,n),c.default.resolve()}};s.default.register(p),e.exports=p},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function a(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}var s=function(){function e(e,t){for(var n=0;ng&&(o.remove(),o.set(this._calcRectDimensionFromPoint(r,i)),t.add(o))}},{key:"_calcRectDimensionFromPoint",value:function(e,t){var n=this.getCanvas(),r=n.getWidth(),i=n.getHeight(),o=this._startX,a=this._startY,s=(0,v.clamp)(e,0,o),u=(0,v.clamp)(t,0,a),c=(0,v.clamp)(e,o,r)-s,l=(0,v.clamp)(t,a,i)-u;return this._withShiftKey&&(c>l?l=c:l>c&&(c=l),o>=e&&(s=o-c),a>=t&&(u=a-l)),{left:s,top:u,width:c,height:l}}},{key:"_onFabricMouseUp",value:function(){var e=this._cropzone,t=this._listeners,n=this.getCanvas();n.setActiveObject(e),n.off({"mouse:move":t.mousemove,"mouse:up":t.mouseup})}},{key:"getCroppedImageData",value:function(e){var t=this.getCanvas(),n=t.contains(this._cropzone);if(!e)return null;n&&this._cropzone.remove();var r={imageName:this.getImageName(),url:t.toDataURL(e)};return n&&t.add(this._cropzone),r}},{key:"getCropzoneRect",value:function(){var e=this._cropzone;return e.isValid()?{left:e.getLeft(),top:e.getTop(),width:e.getWidth(),height:e.getHeight()}:null}},{key:"_onKeyDown",value:function(e){e.keyCode===p.keyCodes.SHIFT&&(this._withShiftKey=!0)}},{key:"_onKeyUp",value:function(e){e.keyCode===p.keyCodes.SHIFT&&(this._withShiftKey=!1)}}]),t}(f.default);e.exports=_},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function a(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}var s=function(){function e(e,t){for(var n=0;nn},_getColor:function(e,t,n){var r=[0,0,0,0],i=e.data,o=e.width,a=4,s=(o*n+t)*a;return r[0]=i[s],r[1]=i[s+1],r[2]=i[s+2],r[3]=i[s+3],r}});e.exports=a},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}var i=n(5),o=r(i),a=n(4),s=r(a),u=n(9),c="tl",l="tr",f="mt",h="ml",d="mr",p="mb",v="bl",g="br",_=s.default.util.createClass(s.default.Rect,{initialize:function(e){e.type="cropzone",this.callSuper("initialize",e),this.on({moving:this._onMoving,scaling:this._onScaling})},_render:function(e){var t=7,n=7;this.callSuper("_render",e);var r=this.flipX?-1:1,i=this.flipY?-1:1,o=r/this.scaleX,a=i/this.scaleY;e.scale(o,a),this._fillOuterRect(e,"rgba(0, 0, 0, 0.55)"),this._strokeBorder(e,"rgb(0, 0, 0)",t),this._strokeBorder(e,"rgb(255, 255, 255)",t,n),e.scale(1/o,1/a)},_fillOuterRect:function(e,t){var n=this._getCoordinates(e),r=n.x,i=n.y;e.save(),e.fillStyle=t,e.beginPath(),e.moveTo(r[0]-1,i[0]-1),e.lineTo(r[3]+1,i[0]-1),e.lineTo(r[3]+1,i[3]+1),e.lineTo(r[0]-1,i[3]-1),e.lineTo(r[0]-1,i[0]-1),e.closePath(),e.moveTo(r[1],i[1]),e.lineTo(r[1],i[2]),e.lineTo(r[2],i[2]),e.lineTo(r[2],i[1]),e.lineTo(r[1],i[1]),e.closePath(),e.fill(),e.restore()},_getCoordinates:function(e){var t=this.getWidth(),n=this.getHeight(),r=t/2,i=n/2,a=this.getLeft(),s=this.getTop(),u=e.canvas;return{x:o.default.map([-(r+a),-r,r,r+(u.width-a-t)],Math.ceil),y:o.default.map([-(i+s),-i,i,i+(u.height-s-n)],Math.ceil)}},_strokeBorder:function(e,t,n,r){var i=this.getWidth()/2,o=this.getHeight()/2;e.save(),e.strokeStyle=t,e.setLineDash&&e.setLineDash([n,n]),r&&(e.lineDashOffset=r),e.beginPath(),e.moveTo(-i,-o),e.lineTo(i,-o),e.lineTo(i,o),e.lineTo(-i,o),e.lineTo(-i,-o),e.stroke(),e.restore()},_onMoving:function(){var e=this.getLeft(),t=this.getTop(),n=this.getWidth(),r=this.getHeight(),i=this.canvas.getWidth()-n,o=this.canvas.getHeight()-r; -this.setLeft((0,u.clamp)(e,0,i)),this.setTop((0,u.clamp)(t,0,o))},_onScaling:function(e){var t=this.canvas.getPointer(e.e),n=this._calcScalingSizeFromPointer(t);this.scale(1).set(n)},_calcScalingSizeFromPointer:function(e){var t=e.x,n=e.y,r=this._calcTopLeftScalingSizeFromPointer(t,n),i=this._calcBottomRightScalingSizeFromPointer(t,n);return this._makeScalingSettings(r,i)},_calcTopLeftScalingSizeFromPointer:function(e,t){var n=this.getHeight()+this.top,r=this.getWidth()+this.left,i=(0,u.clamp)(t,0,n-1),o=(0,u.clamp)(e,0,r-1);return{top:i,left:o,width:r-o,height:n-i}},_calcBottomRightScalingSizeFromPointer:function(e,t){var n=this.canvas,r=n.width,i=n.height,o=this.left,a=this.top;return{width:(0,u.clamp)(e,o+1,r)-o,height:(0,u.clamp)(t,a+1,i)-a}},_makeScalingSettings:function(e,t){var n=e.width,r=e.height,i=t.height,o=t.width,a=e.left,s=e.top,u=void 0;switch(this.__corner){case c:u=e;break;case l:u={width:o,height:r,top:s};break;case v:u={width:n,height:i,left:a};break;case g:u=t;break;case h:u={width:n,left:a};break;case f:u={height:r,top:s};break;case d:u={width:o};break;case p:u={height:i}}return u},isValid:function(){return this.left>=0&&this.top>=0&&this.width>0&&this.height>0}});e.exports=_},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}var i=n(4),o=r(i),a=o.default.util.createClass(o.default.Image.filters.Convolute,{type:"Emboss",initialize:function(){var e=[1,1,1,1,.7,-1,-1,-1,-1];this.matrix=e}});e.exports=a},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}var i=n(4),o=r(i),a=o.default.util.createClass(o.default.Image.filters.Mask,{applyTo:function(e){if(this.mask){var t=e.width,n=e.height,r=this._createCanvasOfMask(t,n),i=e.getContext("2d"),o=r.getContext("2d"),a=i.getImageData(0,0,t,n);this._drawMask(o,e,i),this._mapData(o,a,t,n),i.putImageData(a,0,0)}},_createCanvasOfMask:function(e,t){var n=o.default.util.createCanvasElement();return n.width=e,n.height=t,n},_drawMask:function(e){var t=this.mask,n=t.getElement(),r=t.getLeft(),i=t.getTop(),o=t.getAngle();e.save(),e.translate(r,i),e.rotate(o*Math.PI/180),e.scale(t.scaleX,t.scaleY),e.drawImage(n,-n.width/2,-n.height/2),e.restore()},_mapData:function(e,t,n,r){for(var i=t.data,o=e.getImageData(0,0,n,r).data,a=this.channel,s=t.width*t.height*4,u=0;uu?"right":"left",originY:i>c?"bottom":"top"}}function i(e){return"center"===e.getOriginX()&&"center"===e.getOriginY()}function o(e,t){var n=t.getPointByOrigin("center","center"),i=-t.getAngle(),o=r(n,e,i),a=o.originX,s=o.originY,u=t.getPointByOrigin(a,s),c=t.getLeft()-(n.x-u.x),l=t.getTop()-(n.x-u.y);t.set({originX:a,originY:s,left:c,top:l}),t.setCoords()}function a(e,t){var n=t.startPoint,i=-t.getAngle(),o=r(n,e,i),a=o.originX,s=o.originY;t.setPositionByOrigin(n,a,s)}function s(e){var t=e.type,n=e.scaleX,r=e.scaleY,i=l[t],o=e[i.w]*n,a=e[i.h]*r;if(e.isRegular){var s=Math.max(n,r);o=e[i.w]*s,a=e[i.h]*s}var u={hasControls:!1,hasBorders:!1,scaleX:1,scaleY:1};u[i.w]=o,u[i.h]=a,e.set(u)}function u(e,t){var n=t.type,r=t.strokeWidth,i=t.startPoint,o=c[n],a=l[n],s=!("triangle"!==t.type),u={},f=Math.abs(i.x-e.x)/o,h=Math.abs(i.y-e.y)/o;f>r&&(f-=r/o),h>r&&(h-=r/o),t.isRegular&&(f=h=Math.max(f,h),s&&(h=Math.sqrt(3)/2*f)),u[a.w]=f,u[a.h]=h,t.set(u)}var c={rect:1,circle:2,triangle:1},l={rect:{w:"width",h:"height"},circle:{w:"rx",h:"ry"},triangle:{w:"width",h:"height"}};e.exports={setOrigins:function(e){var t=e.getPointByOrigin("left","top"),n=e.getPointByOrigin("right","top"),r=e.getPointByOrigin("right","bottom"),i=e.getPointByOrigin("left","bottom");e.origins={lt:t,rt:n,rb:r,lb:i}},resize:function(e,t,r){i(e)&&(o(t,e),n(e)),r?s(e,t):u(t,e),a(t,e)},adjustOriginToCenter:function(e){var t=e.getPointByOrigin("center","center"),n=e.getOriginX(),r=e.getOriginY(),i=e.getPointByOrigin(n,r),o=e.getLeft()+(t.x-i.x),a=e.getTop()+(t.y-i.y);e.set({hasControls:!0,hasBorders:!0,originX:"center",originY:"center",left:o,top:a}),e.setCoords()}}},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}var o=function(){function e(e,t){for(var n=0;n1?n-1:0),i=1;il;)if(s=u[l++],s!=s)return!0}else for(;c>l;l++)if((e||l in u)&&u[l]===n)return e||l||0;return!e&&-1}}},function(e,t,n){var r=n(17),i=n(94),o=n(93),a=n(10),s=n(39),u=n(112),c={},l={},t=e.exports=function(e,t,n,f,h){var d,p,v,g,_=h?function(){return e}:u(e),y=r(n,f,t?2:1),m=0;if("function"!=typeof _)throw TypeError(e+" is not iterable!");if(o(_)){for(d=s(e.length);d>m;m++)if(g=t?y(a(p=e[m])[0],p[1]):y(e[m]),g===c||g===l)return g}else for(v=_.call(e);!(p=v.next()).done;)if(g=i(v,y,p.value,t),g===c||g===l)return g};t.BREAK=c,t.RETURN=l},function(e,t,n){e.exports=!n(14)&&!n(32)(function(){return 7!=Object.defineProperty(n(23)("div"),"a",{get:function(){return 7}}).a})},function(e,t){e.exports=function(e,t,n){var r=void 0===n;switch(t.length){case 0:return r?e():e.call(n);case 1:return r?e(t[0]):e.call(n,t[0]);case 2:return r?e(t[0],t[1]):e.call(n,t[0],t[1]);case 3:return r?e(t[0],t[1],t[2]):e.call(n,t[0],t[1],t[2]);case 4:return r?e(t[0],t[1],t[2],t[3]):e.call(n,t[0],t[1],t[2],t[3])}return e.apply(n,t)}},function(e,t,n){var r=n(16);e.exports=Object("z").propertyIsEnumerable(0)?Object:function(e){return"String"==r(e)?e.split(""):Object(e)}},function(e,t,n){var r=n(15),i=n(6)("iterator"),o=Array.prototype;e.exports=function(e){return void 0!==e&&(r.Array===e||o[i]===e)}},function(e,t,n){var r=n(10);e.exports=function(e,t,n,i){try{return i?t(r(n)[0],n[1]):t(n)}catch(t){var o=e.return;throw void 0!==o&&r(o.call(e)),t}}},function(e,t,n){"use strict";var r=n(99),i=n(36),o=n(24),a={};n(11)(a,n(6)("iterator"),function(){return this}),e.exports=function(e,t,n){e.prototype=r(a,{next:i(1,n)}),o(e,t+" Iterator")}},function(e,t,n){var r=n(6)("iterator"),i=!1;try{var o=[7][r]();o.return=function(){i=!0},Array.from(o,function(){throw 2})}catch(e){}e.exports=function(e,t){if(!t&&!i)return!1;var n=!1;try{var o=[7],a=o[r]();a.next=function(){return{done:n=!0}},o[r]=function(){return a},e(o)}catch(e){}return n}},function(e,t){e.exports=function(e,t){return{value:t,done:!!e}}},function(e,t,n){var r=n(8),i=n(38).set,o=r.MutationObserver||r.WebKitMutationObserver,a=r.process,s=r.Promise,u="process"==n(16)(a);e.exports=function(){var e,t,n,c=function(){var r,i;for(u&&(r=a.domain)&&r.exit();e;){i=e.fn,e=e.next;try{i()}catch(r){throw e?n():t=void 0,r}}t=void 0,r&&r.enter()};if(u)n=function(){a.nextTick(c)};else if(o){var l=!0,f=document.createTextNode("");new o(c).observe(f,{characterData:!0}),n=function(){f.data=l=!l}}else if(s&&s.resolve){var h=s.resolve();n=function(){h.then(c)}}else n=function(){i.call(r,c)};return function(r){var i={fn:r,next:void 0};t&&(t.next=i),e||(e=i,n()),t=i}}},function(e,t,n){var r=n(10),i=n(100),o=n(30),a=n(25)("IE_PROTO"),s=function(){},u="prototype",c=function(){var e,t=n(23)("iframe"),r=o.length,i="<",a=">";for(t.style.display="none",n(33).appendChild(t),t.src="javascript:",e=t.contentWindow.document,e.open(),e.write(i+"script"+a+"document.F=Object"+i+"/script"+a),e.close(),c=e.F;r--;)delete c[u][o[r]];return c()};e.exports=Object.create||function(e,t){var n;return null!==e?(s[u]=r(e),n=new s,s[u]=null,n[a]=e):n=c(),void 0===t?n:i(n,t)}},function(e,t,n){var r=n(20),i=n(10),o=n(103);e.exports=n(14)?Object.defineProperties:function(e,t){i(e);for(var n,a=o(t),s=a.length,u=0;s>u;)r.f(e,n=a[u++],t[n]);return e}},function(e,t,n){var r=n(18),i=n(110),o=n(25)("IE_PROTO"),a=Object.prototype;e.exports=Object.getPrototypeOf||function(e){return e=i(e),r(e,o)?e[o]:"function"==typeof e.constructor&&e instanceof e.constructor?e.constructor.prototype:e instanceof Object?a:null}},function(e,t,n){var r=n(18),i=n(27),o=n(88)(!1),a=n(25)("IE_PROTO");e.exports=function(e,t){var n,s=i(e),u=0,c=[];for(n in s)n!=a&&r(s,n)&&c.push(n);for(;t.length>u;)r(s,n=t[u++])&&(~o(c,n)||c.push(n));return c}},function(e,t,n){var r=n(102),i=n(30);e.exports=Object.keys||function(e){return r(e,i)}},function(e,t,n){var r=n(11);e.exports=function(e,t,n){for(var i in t)n&&e[i]?e[i]=t[i]:r(e,i,t[i]);return e}},function(e,t,n){e.exports=n(11)},function(e,t,n){"use strict";var r=n(8),i=n(13),o=n(20),a=n(14),s=n(6)("species");e.exports=function(e){var t="function"==typeof i[e]?i[e]:r[e];a&&t&&!t[s]&&o.f(t,s,{configurable:!0,get:function(){return this}})}},function(e,t,n){var r=n(10),i=n(21),o=n(6)("species");e.exports=function(e,t){var n,a=r(e).constructor;return void 0===a||void 0==(n=r(a)[o])?t:i(n)}},function(e,t,n){var r=n(26),i=n(22);e.exports=function(e){return function(t,n){var o,a,s=String(i(t)),u=r(n),c=s.length;return u<0||u>=c?e?"":void 0:(o=s.charCodeAt(u),o<55296||o>56319||u+1===c||(a=s.charCodeAt(u+1))<56320||a>57343?e?s.charAt(u):o:e?s.slice(u,u+2):(o-55296<<10)+(a-56320)+65536)}}},function(e,t,n){var r=n(26),i=Math.max,o=Math.min;e.exports=function(e,t){return e=r(e),e<0?i(e+t,0):o(e,t)}},function(e,t,n){var r=n(22);e.exports=function(e){return Object(r(e))}},function(e,t,n){var r=n(19);e.exports=function(e,t){if(!r(e))return e;var n,i;if(t&&"function"==typeof(n=e.toString)&&!r(i=n.call(e)))return i; -if("function"==typeof(n=e.valueOf)&&!r(i=n.call(e)))return i;if(!t&&"function"==typeof(n=e.toString)&&!r(i=n.call(e)))return i;throw TypeError("Can't convert object to primitive value")}},function(e,t,n){var r=n(29),i=n(6)("iterator"),o=n(15);e.exports=n(13).getIteratorMethod=function(e){if(void 0!=e)return e[i]||e["@@iterator"]||o[r(e)]}},function(e,t,n){"use strict";var r=n(86),i=n(97),o=n(15),a=n(27);e.exports=n(34)(Array,"Array",function(e,t){this._t=a(e),this._i=0,this._k=t},function(){var e=this._t,t=this._k,n=this._i++;return!e||n>=e.length?(this._t=void 0,i(1)):"keys"==t?i(0,n):"values"==t?i(0,e[n]):i(0,[n,e[n]])},"values"),o.Arguments=o.Array,r("keys"),r("values"),r("entries")},function(e,t){},function(e,t,n){"use strict";var r,i,o,a=n(35),s=n(8),u=n(17),c=n(29),l=n(31),f=n(19),h=n(21),d=n(87),p=n(89),v=n(107),g=n(38).set,_=n(98)(),y="Promise",m=s.TypeError,b=s.process,O=s[y],b=s.process,k="process"==c(b),w=function(){},C=!!function(){try{var e=O.resolve(1),t=(e.constructor={})[n(6)("species")]=function(e){e(w,w)};return(k||"function"==typeof PromiseRejectionEvent)&&e.then(w)instanceof t}catch(e){}}(),E=function(e,t){return e===t||e===O&&t===o},j=function(e){var t;return!(!f(e)||"function"!=typeof(t=e.then))&&t},x=function(e){return E(O,e)?new T(e):new i(e)},T=i=function(e){var t,n;this.promise=new e(function(e,r){if(void 0!==t||void 0!==n)throw m("Bad Promise constructor");t=e,n=r}),this.resolve=h(t),this.reject=h(n)},M=function(e){try{e()}catch(e){return{error:e}}},S=function(e,t){if(!e._n){e._n=!0;var n=e._c;_(function(){for(var r=e._v,i=1==e._s,o=0,a=function(t){var n,o,a=i?t.ok:t.fail,s=t.resolve,u=t.reject,c=t.domain;try{a?(i||(2==e._h&&D(e),e._h=1),a===!0?n=r:(c&&c.enter(),n=a(r),c&&c.exit()),n===t.promise?u(m("Promise-chain cycle")):(o=j(n))?o.call(n,s,u):s(n)):u(r)}catch(e){u(e)}};n.length>o;)a(n[o++]);e._c=[],e._n=!1,t&&!e._h&&P(e)})}},P=function(e){g.call(s,function(){var t,n,r,i=e._v;if(A(e)&&(t=M(function(){k?b.emit("unhandledRejection",i,e):(n=s.onunhandledrejection)?n({promise:e,reason:i}):(r=s.console)&&r.error&&r.error("Unhandled promise rejection",i)}),e._h=k||A(e)?2:1),e._a=void 0,t)throw t.error})},A=function(e){if(1==e._h)return!1;for(var t,n=e._a||e._c,r=0;n.length>r;)if(t=n[r++],t.fail||!A(t.promise))return!1;return!0},D=function(e){g.call(s,function(){var t;k?b.emit("rejectionHandled",e):(t=s.onrejectionhandled)&&t({promise:e,reason:e._v})})},I=function(e){var t=this;t._d||(t._d=!0,t=t._w||t,t._v=e,t._s=2,t._a||(t._a=t._c.slice()),S(t,!0))},N=function(e){var t,n=this;if(!n._d){n._d=!0,n=n._w||n;try{if(n===e)throw m("Promise can't be resolved itself");(t=j(e))?_(function(){var r={_w:n,_d:!1};try{t.call(e,u(N,r,1),u(I,r,1))}catch(e){I.call(r,e)}}):(n._v=e,n._s=1,S(n,!1))}catch(e){I.call({_w:n,_d:!1},e)}}};C||(O=function(e){d(this,O,y,"_h"),h(e),r.call(this);try{e(u(N,this,1),u(I,this,1))}catch(e){I.call(this,e)}},r=function(e){this._c=[],this._a=void 0,this._s=0,this._d=!1,this._v=void 0,this._h=0,this._n=!1},r.prototype=n(104)(O.prototype,{then:function(e,t){var n=x(v(this,O));return n.ok="function"!=typeof e||e,n.fail="function"==typeof t&&t,n.domain=k?b.domain:void 0,this._c.push(n),this._a&&this._a.push(n),this._s&&S(this,!1),n.promise},catch:function(e){return this.then(void 0,e)}}),T=function(){var e=new r;this.promise=e,this.resolve=u(N,e,1),this.reject=u(I,e,1)}),l(l.G+l.W+l.F*!C,{Promise:O}),n(24)(O,y),n(106)(y),o=n(13)[y],l(l.S+l.F*!C,y,{reject:function(e){var t=x(this),n=t.reject;return n(e),t.promise}}),l(l.S+l.F*(a||!C),y,{resolve:function(e){if(e instanceof O&&E(e.constructor,this))return e;var t=x(this),n=t.resolve;return n(e),t.promise}}),l(l.S+l.F*!(C&&n(96)(function(e){O.all(e).catch(w)})),y,{all:function(e){var t=this,n=x(t),r=n.resolve,i=n.reject,o=M(function(){var n=[],o=0,a=1;p(e,!1,function(e){var s=o++,u=!1;n.push(void 0),a++,t.resolve(e).then(function(e){u||(u=!0,n[s]=e,--a||r(n))},i)}),--a||r(n)});return o&&i(o.error),n.promise},race:function(e){var t=this,n=x(t),r=n.reject,i=M(function(){p(e,!1,function(e){t.resolve(e).then(n.resolve,r)})});return i&&r(i.error),n.promise}})},function(e,t,n){"use strict";var r=n(108)(!0);n(34)(String,"String",function(e){this._t=String(e),this._i=0},function(){var e,t=this._t,n=this._i;return n>=t.length?{value:void 0,done:!0}:(e=r(t,n),this._i+=e.length,{value:e,done:!1})})},function(e,t,n){n(113);for(var r=n(8),i=n(11),o=n(15),a=n(6)("toStringTag"),s=["NodeList","DOMTokenList","MediaList","StyleSheetList","CSSRuleList"],u=0;u<5;u++){var c=s[u],l=r[c],f=l&&l.prototype;f&&!f[a]&&i(f,a,c),o[c]=o.Array}}])}); \ No newline at end of file +!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t(require("fabric/dist/fabric.require"),require("tui-code-snippet")):"function"==typeof define&&define.amd?define(["fabric/dist/fabric.require","tui-code-snippet"],t):"object"==typeof exports?exports.ImageEditor=t(require("fabric/dist/fabric.require"),require("tui-code-snippet")):(e.tui=e.tui||{},e.tui.ImageEditor=t(e.fabric,e.tui&&e.tui.util))}(this,function(e,t){return function(e){function t(r){if(n[r])return n[r].exports;var i=n[r]={exports:{},id:r,loaded:!1};return e[r].call(i.exports,i,i.exports,t),i.loaded=!0,i.exports}var n={};return t.m=e,t.c=n,t.p="dist",t(0)}([function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}var i=n(83),o=r(i);n(41),n(42),n(43),n(44),n(45),n(46),n(47),n(48),n(49),n(50),n(51),n(52),n(53),n(54),n(55),n(56),n(57),n(59),n(58),e.exports=o.default},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}var i=n(9),o=r(i);e.exports={componentNames:o.default.keyMirror("IMAGE_LOADER","CROPPER","FLIP","ROTATION","FREE_DRAWING","LINE","TEXT","ICON","FILTER","SHAPE"),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"},eventNames:{OBJECT_ACTIVATED:"objectActivated",OBJECT_MOVED:"objectMoved",OBJECT_SCALED:"objectScaled",TEXT_EDITING:"textEditing",TEXT_CHANGED:"textChanged",ADD_TEXT:"addText",ADD_OBJECT:"addObject",MOUSE_DOWN:"mousedown",REDO_STACK_CHANGED:"redoStackChanged",UNDO_STACK_CHANGED:"undoStackChanged"},drawingModes:o.default.keyMirror("NORMAL","CROPPER","FREE_DRAWING","LINE_DRAWING","TEXT","SHAPE"),keyCodes:{Z:90,Y:89,SHIFT:16,BACKSPACE:8,DEL:46},fObjectOptions:{SELECTION_STYLE:{borderColor:"red",cornerColor:"green",cornerSize:10,originX:"center",originY:"center",transparentCorners:!1}},rejectMessages:{flip:"The flipX and flipY setting values are not changed.",rotation:"The current angle is same the old angle.",loadImage:"The background image is empty.",isLock:"The executing command state is locked.",undo:"The promise of undo command is reject.",redo:"The promise of redo command is reject.",invalidDrawingMode:"This operation is not supported in the drawing mode",invalidParameters:"Invalid parameters",noActiveObject:"There is no active object.",unsupportedType:"Unsupported object type",noObject:"The object is not in canvas.",addedObject:"The object is already added."}}},function(e,t,n){n(114),n(116),n(117),n(115),e.exports=n(13).Promise},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}function i(e){var t=u[e];if(t){for(var n=arguments.length,r=Array(n>1?n-1:0),i=1;in&&(r=t,t=n,n=r),o(t,i(e,n))},keyMirror:function(){for(var e={},t=arguments.length,n=Array(t),i=0;i0?r:n)(e)}},function(e,t,n){var r=n(92),i=n(22);e.exports=function(e){return r(i(e))}},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}var i=n(5),o=r(i),a=n(9),s=(0,a.keyMirror)("UN_IMPLEMENTATION","NO_COMPONENT_NAME"),u={UN_IMPLEMENTATION:"Should implement a method: ",NO_COMPONENT_NAME:"Should set a component name"},c={UN_IMPLEMENTATION:function(e){return u.UN_IMPLEMENTATION+e},NO_COMPONENT_NAME:function(){return u.NO_COMPONENT_NAME}};e.exports={types:o.default.extend({},s),create:function(e){e=e.toLowerCase();for(var t=c[e],n=arguments.length,r=Array(n>1?n-1:0),i=1;in;)t.push(arguments[n++]);return g[++v]=function(){s("function"==typeof e?e:Function(e),t)},r(v),v},d=function(e){delete g[e]},"process"==n(16)(f)?r=function(e){f.nextTick(a(y,e,1))}:p?(i=new p,o=i.port2,i.port1.onmessage=m,r=a(o.postMessage,o,1)):l.addEventListener&&"function"==typeof postMessage&&!l.importScripts?(r=function(e){l.postMessage(e+"","*")},l.addEventListener("message",m,!1)):r=_ in c("script")?function(e){u.appendChild(c("script"))[_]=function(){u.removeChild(this),y.call(e)}}:function(e){setTimeout(a(y,e,1),0)}),e.exports={set:h,clear:d}},function(e,t,n){var r=n(26),i=Math.min;e.exports=function(e){return e>0?i(r(e),9007199254740991):0}},function(e,t){var n=0,r=Math.random();e.exports=function(e){return"Symbol(".concat(void 0===e?"":e,")_",(++n+r).toString(36))}},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}var i=n(3),o=r(i),a=n(2),s=r(a),u=n(1),c=r(u),l=c.default.componentNames,f=c.default.commandNames,h=l.ICON,d={name:f.ADD_ICON,execute:function(e,t,n){var r=this,i=e.getComponent(h);return i.add(t,n).then(function(t){return r.undoData.object=e.getObject(t.id),t})},undo:function(e){return e.remove(this.undoData.object),s.default.resolve()}};o.default.register(d),e.exports=d},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}var i=n(3),o=r(i),a=n(2),s=r(a),u=n(1),c=r(u),l=c.default.commandNames,f={name:l.ADD_IMAGE_OBJECT,execute:function(e,t){var n=this;return e.addImageObject(t).then(function(t){return n.undoData.object=e.getObject(t.id),t})},undo:function(e){return e.remove(this.undoData.object),s.default.resolve()}};o.default.register(f),e.exports=f},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}var i=n(3),o=r(i),a=n(2),s=r(a),u=n(1),c=r(u),l=c.default.commandNames,f=c.default.rejectMessages,h={name:l.ADD_OBJECT,execute:function(e,t){return new s.default(function(n,r){e.contains(t)?r(f.addedObject):(e.add(t),n(t))})},undo:function(e,t){return new s.default(function(n,r){e.contains(t)?(e.remove(t),n(t)):r(f.noObject)})}};o.default.register(h),e.exports=h},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}var i=n(3),o=r(i),a=n(2),s=r(a),u=n(1),c=r(u),l=c.default.componentNames,f=c.default.commandNames,h=l.SHAPE,d={name:f.ADD_SHAPE,execute:function(e,t,n){var r=this,i=e.getComponent(h);return i.add(t,n).then(function(t){return r.undoData.object=e.getObject(t.id),t})},undo:function(e){return e.remove(this.undoData.object),s.default.resolve()}};o.default.register(d),e.exports=d},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}var i=n(3),o=r(i),a=n(2),s=r(a),u=n(1),c=r(u),l=c.default.componentNames,f=c.default.commandNames,h=l.TEXT,d={name:f.ADD_TEXT,execute:function(e,t,n){var r=this,i=e.getComponent(h);return i.add(t,n).then(function(t){return r.undoData.object=e.getObject(t.id),t})},undo:function(e){return e.remove(this.undoData.object),s.default.resolve()}};o.default.register(d),e.exports=d},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}var i=n(3),o=r(i),a=n(1),s=r(a),u=s.default.componentNames,c=s.default.rejectMessages,l=s.default.commandNames,f=u.FILTER,h={name:l.APPLY_FILTER,execute:function(e,t,n){var r=e.getComponent(f);if("mask"===t){var i=e.getObject(n.maskObjId);if(!i||!i.isType("image"))return Promise.reject(c.invalidParameters);n={mask:i}}return"mask"===t?(this.undoData.object=n.mask,e.remove(n.mask)):this.undoData.options=r.getOptions(t),r.add(t,n)},undo:function(e,t){var n=e.getComponent(f);if("mask"===t){var r=this.undoData.object;return e.add(r),e.setActiveObject(r),n.remove(t)}return this.undoData.options?n.add(t,this.undoData.options):n.remove(t)}};o.default.register(h),e.exports=h},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}var i=n(3),o=r(i),a=n(2),s=r(a),u=n(1),c=r(u),l=c.default.componentNames,f=c.default.rejectMessages,h=c.default.commandNames,d=l.ICON,p={name:h.CHANGE_ICON_COLOR,execute:function(e,t,n){var r=this;return new s.default(function(i,o){var a=e.getComponent(d),s=e.getObject(t);s||o(f.noObject),r.undoData.object=s,r.undoData.color=a.getColor(s),a.setColor(n,s),i()})},undo:function(e){var t=e.getComponent(d),n=this.undoData.object,r=n.object,i=n.color;return t.setColor(i,r),s.default.resolve()}};o.default.register(p),e.exports=p},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}var i=n(5),o=r(i),a=n(3),s=r(a),u=n(2),c=r(u),l=n(1),f=r(l),h=f.default.componentNames,d=f.default.rejectMessages,p=f.default.commandNames,v=h.SHAPE,g={name:p.CHANGE_SHAPE,execute:function(e,t,n){var r=this,i=e.getComponent(v),a=e.getObject(t);return a?(this.undoData.object=a,this.undoData.options={},o.default.forEachOwnProperties(n,function(e,t){r.undoData.options[t]=a[t]}),i.change(a,n)):c.default.reject(d.noObject)},undo:function(e){var t=e.getComponent(v),n=this.undoData,r=n.object,i=n.options;return t.change(r,i)}};s.default.register(g),e.exports=g},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}var i=n(3),o=r(i),a=n(2),s=r(a),u=n(1),c=r(u),l=c.default.componentNames,f=c.default.rejectMessages,h=c.default.commandNames,d=l.TEXT,p={name:h.CHANGE_TEXT,execute:function(e,t,n){var r=e.getComponent(d),i=e.getObject(t);return i?(this.undoData.object=i,this.undoData.text=r.getText(i),r.change(i,n)):s.default.reject(f.noObject)},undo:function(e){var t=e.getComponent(d),n=this.undoData,r=n.object,i=n.text;return t.change(r,i)}};o.default.register(p),e.exports=p},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}var i=n(5),o=r(i),a=n(3),s=r(a),u=n(2),c=r(u),l=n(1),f=r(l),h=f.default.componentNames,d=f.default.rejectMessages,p=f.default.commandNames,v=h.TEXT,g={name:p.CHANGE_TEXT_STYLE,execute:function(e,t,n){var r=this,i=e.getComponent(v),a=e.getObject(t);return a?(this.undoData.object=a,this.undoData.styles={},o.default.forEachOwnProperties(n,function(e,t){r.undoData.styles[t]=a[t]}),i.setStyle(a,n)):c.default.reject(d.noObject)},undo:function(e){var t=e.getComponent(v),n=this.undoData,r=n.object,i=n.styles;return t.setStyle(r,i)}};s.default.register(g),e.exports=g},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}var i=n(3),o=r(i),a=n(2),s=r(a),u=n(1),c=r(u),l=c.default.commandNames,f={name:l.CLEAR_OBJECTS,execute:function(e){var t=this;return new s.default(function(n){t.undoData.objects=e.removeAll(),n()})},undo:function(e){return e.add(this.undoData.objects),s.default.resolve()}};o.default.register(f),e.exports=f},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}var i=n(3),o=r(i),a=n(1),s=r(a),u=s.default.componentNames,c=s.default.commandNames,l=u.FLIP,f={name:c.FLIP_IMAGE,execute:function(e,t){var n=e.getComponent(l);return this.undoData.setting=n.getCurrentSetting(),n[t]()},undo:function(e){var t=e.getComponent(l);return t.set(this.undoData.setting)}};o.default.register(f),e.exports=f},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}var i=n(3),o=r(i),a=n(1),s=r(a),u=s.default.componentNames,c=s.default.commandNames,l=u.IMAGE_LOADER,f={name:c.LOAD_IMAGE,execute:function(e,t,n){var r=e.getComponent(l),i=r.getCanvasImage(),o=i?i.width:0,a=i?i.height:0;return this.undoData={name:r.getImageName(),image:i,objects:e.removeAll(!0)},r.load(t,n).then(function(e){return{oldWidth:o,oldHeight:a,newWidth:e.width,newHeight:e.height}})},undo:function(e){var t=e.getComponent(l),n=this.undoData,r=n.objects,i=n.name,o=n.image;return e.removeAll(!0),e.add(r),t.load(i,o)}};o.default.register(f),e.exports=f},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}var i=n(3),o=r(i),a=n(1),s=r(a),u=s.default.componentNames,c=s.default.commandNames,l=u.FILTER,f={name:c.REMOVE_FILTER,execute:function(e,t){var n=e.getComponent(l);return this.undoData.options=n.getOptions(t),n.remove(t)},undo:function(e,t){var n=e.getComponent(l),r=this.undoData.options;return n.add(t,r)}};o.default.register(f),e.exports=f},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}var i=n(3),o=r(i),a=n(2),s=r(a),u=n(1),c=r(u),l=c.default.commandNames,f=c.default.rejectMessages,h={name:l.REMOVE_OBJECT,execute:function(e,t){var n=this;return new s.default(function(r,i){n.undoData.objects=e.removeObjectById(t),n.undoData.objects.length?r():i(f.noObject)})},undo:function(e){return e.add(this.undoData.objects),s.default.resolve()}};o.default.register(h),e.exports=h},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}var i=n(3),o=r(i),a=n(2),s=r(a),u=n(1),c=r(u),l=c.default.commandNames,f={name:l.RESIZE_CANVAS_DIMENSION,execute:function(e,t){var n=this;return new s.default(function(r){n.undoData.size={width:e.cssMaxWidth,height:e.cssMaxHeight},e.setCssMaxDimension(t),e.adjustCanvasDimension(),r()})},undo:function(e){return e.setCssMaxDimension(this.undoData.size),e.adjustCanvasDimension(),s.default.resolve()}};o.default.register(f),e.exports=f},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}var i=n(3),o=r(i),a=n(1),s=r(a),u=s.default.componentNames,c=s.default.commandNames,l=u.ROTATION,f={name:c.ROTATE_IMAGE,execute:function(e,t,n){var r=e.getComponent(l);return this.undoData.angle=r.getCurrentAngle(),r[t](n)},undo:function(e){var t=e.getComponent(l),n=this.undoData.angle;return t.setAngle(n)}};o.default.register(f),e.exports=f},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}var i=n(3),o=r(i),a=n(2),s=r(a),u=n(1),c=r(u),l=c.default.commandNames,f=c.default.rejectMessages,h={name:l.SET_OBJECT_POSITION,execute:function(e,t,n){var r=e.getObject(t);return r?(this.undoData.objectId=t,this.undoData.props=e.getObjectProperties(t,["left","top"]),e.setObjectPosition(t,n),e.renderAll(),s.default.resolve()):s.default.reject(f.noObject)},undo:function(e){var t=this.undoData,n=t.objectId,r=t.props;return e.setObjectProperties(n,r),e.renderAll(),s.default.resolve()}};o.default.register(h),e.exports=h},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}var i=n(5),o=r(i),a=n(3),s=r(a),u=n(2),c=r(u),l=n(1),f=r(l),h=f.default.commandNames,d=f.default.rejectMessages,p={name:h.SET_OBJECT_PROPERTIES,execute:function(e,t,n){var r=this,i=e.getObject(t);return i?(this.undoData.props={},o.default.forEachOwnProperties(n,function(e,t){r.undoData.props[t]=i[t]}),e.setObjectProperties(t,n),c.default.resolve()):c.default.reject(d.noObject)},undo:function(e,t){var n=this.undoData.props;return e.setObjectProperties(t,n),c.default.resolve()}};s.default.register(p),e.exports=p},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function a(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}var s=function(){function e(e,t){for(var n=0;ng&&(o.remove(),o.set(this._calcRectDimensionFromPoint(r,i)),t.add(o))}},{key:"_calcRectDimensionFromPoint",value:function(e,t){var n=this.getCanvas(),r=n.getWidth(),i=n.getHeight(),o=this._startX,a=this._startY,s=(0,v.clamp)(e,0,o),u=(0,v.clamp)(t,0,a),c=(0,v.clamp)(e,o,r)-s,l=(0,v.clamp)(t,a,i)-u;return this._withShiftKey&&(c>l?l=c:l>c&&(c=l),o>=e&&(s=o-c),a>=t&&(u=a-l)),{left:s,top:u,width:c,height:l}}},{key:"_onFabricMouseUp",value:function(){var e=this._cropzone,t=this._listeners,n=this.getCanvas();n.setActiveObject(e),n.off({"mouse:move":t.mousemove,"mouse:up":t.mouseup})}},{key:"getCroppedImageData",value:function(e){var t=this.getCanvas(),n=t.contains(this._cropzone);if(!e)return null;n&&this._cropzone.remove();var r={imageName:this.getImageName(),url:t.toDataURL(e)};return n&&t.add(this._cropzone),r}},{key:"getCropzoneRect",value:function(){var e=this._cropzone;return e.isValid()?{left:e.getLeft(),top:e.getTop(),width:e.getWidth(),height:e.getHeight()}:null}},{key:"_onKeyDown",value:function(e){e.keyCode===p.keyCodes.SHIFT&&(this._withShiftKey=!0)}},{key:"_onKeyUp",value:function(e){e.keyCode===p.keyCodes.SHIFT&&(this._withShiftKey=!1)}}]),t}(f.default);e.exports=_},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function a(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}var s=function(){function e(e,t){for(var n=0;nn},_getColor:function(e,t,n){var r=[0,0,0,0],i=e.data,o=e.width,a=4,s=(o*n+t)*a;return r[0]=i[s],r[1]=i[s+1],r[2]=i[s+2],r[3]=i[s+3],r}});e.exports=a},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}var i=n(5),o=r(i),a=n(4),s=r(a),u=n(9),c="tl",l="tr",f="mt",h="ml",d="mr",p="mb",v="bl",g="br",_=s.default.util.createClass(s.default.Rect,{initialize:function(e){e.type="cropzone",this.callSuper("initialize",e),this.on({moving:this._onMoving,scaling:this._onScaling})},_render:function(e){var t=7,n=7;this.callSuper("_render",e);var r=this.flipX?-1:1,i=this.flipY?-1:1,o=r/this.scaleX,a=i/this.scaleY;e.scale(o,a),this._fillOuterRect(e,"rgba(0, 0, 0, 0.55)"),this._strokeBorder(e,"rgb(0, 0, 0)",t),this._strokeBorder(e,"rgb(255, 255, 255)",t,n),e.scale(1/o,1/a)},_fillOuterRect:function(e,t){var n=this._getCoordinates(e),r=n.x,i=n.y;e.save(),e.fillStyle=t,e.beginPath(),e.moveTo(r[0]-1,i[0]-1),e.lineTo(r[3]+1,i[0]-1),e.lineTo(r[3]+1,i[3]+1),e.lineTo(r[0]-1,i[3]-1),e.lineTo(r[0]-1,i[0]-1),e.closePath(),e.moveTo(r[1],i[1]),e.lineTo(r[1],i[2]),e.lineTo(r[2],i[2]),e.lineTo(r[2],i[1]),e.lineTo(r[1],i[1]),e.closePath(),e.fill(),e.restore()},_getCoordinates:function(e){var t=this.getWidth(),n=this.getHeight(),r=t/2,i=n/2,a=this.getLeft(),s=this.getTop(),u=e.canvas;return{x:o.default.map([-(r+a),-r,r,r+(u.width-a-t)],Math.ceil),y:o.default.map([-(i+s),-i,i,i+(u.height-s-n)],Math.ceil)}},_strokeBorder:function(e,t,n,r){var i=this.getWidth()/2,o=this.getHeight()/2;e.save(),e.strokeStyle=t,e.setLineDash&&e.setLineDash([n,n]),r&&(e.lineDashOffset=r), +e.beginPath(),e.moveTo(-i,-o),e.lineTo(i,-o),e.lineTo(i,o),e.lineTo(-i,o),e.lineTo(-i,-o),e.stroke(),e.restore()},_onMoving:function(){var e=this.getLeft(),t=this.getTop(),n=this.getWidth(),r=this.getHeight(),i=this.canvas.getWidth()-n,o=this.canvas.getHeight()-r;this.setLeft((0,u.clamp)(e,0,i)),this.setTop((0,u.clamp)(t,0,o))},_onScaling:function(e){var t=this.canvas.getPointer(e.e),n=this._calcScalingSizeFromPointer(t);this.scale(1).set(n)},_calcScalingSizeFromPointer:function(e){var t=e.x,n=e.y,r=this._calcTopLeftScalingSizeFromPointer(t,n),i=this._calcBottomRightScalingSizeFromPointer(t,n);return this._makeScalingSettings(r,i)},_calcTopLeftScalingSizeFromPointer:function(e,t){var n=this.getHeight()+this.top,r=this.getWidth()+this.left,i=(0,u.clamp)(t,0,n-1),o=(0,u.clamp)(e,0,r-1);return{top:i,left:o,width:r-o,height:n-i}},_calcBottomRightScalingSizeFromPointer:function(e,t){var n=this.canvas,r=n.width,i=n.height,o=this.left,a=this.top;return{width:(0,u.clamp)(e,o+1,r)-o,height:(0,u.clamp)(t,a+1,i)-a}},_makeScalingSettings:function(e,t){var n=e.width,r=e.height,i=t.height,o=t.width,a=e.left,s=e.top,u=void 0;switch(this.__corner){case c:u=e;break;case l:u={width:o,height:r,top:s};break;case v:u={width:n,height:i,left:a};break;case g:u=t;break;case h:u={width:n,left:a};break;case f:u={height:r,top:s};break;case d:u={width:o};break;case p:u={height:i}}return u},isValid:function(){return this.left>=0&&this.top>=0&&this.width>0&&this.height>0}});e.exports=_},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}var i=n(4),o=r(i),a=o.default.util.createClass(o.default.Image.filters.Convolute,{type:"Emboss",initialize:function(){var e=[1,1,1,1,.7,-1,-1,-1,-1];this.matrix=e}});e.exports=a},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}var i=n(4),o=r(i),a=o.default.util.createClass(o.default.Image.filters.Mask,{applyTo:function(e){if(this.mask){var t=e.width,n=e.height,r=this._createCanvasOfMask(t,n),i=e.getContext("2d"),o=r.getContext("2d"),a=i.getImageData(0,0,t,n);this._drawMask(o,e,i),this._mapData(o,a,t,n),i.putImageData(a,0,0)}},_createCanvasOfMask:function(e,t){var n=o.default.util.createCanvasElement();return n.width=e,n.height=t,n},_drawMask:function(e){var t=this.mask,n=t.getElement(),r=t.getLeft(),i=t.getTop(),o=t.getAngle();e.save(),e.translate(r,i),e.rotate(o*Math.PI/180),e.scale(t.scaleX,t.scaleY),e.drawImage(n,-n.width/2,-n.height/2),e.restore()},_mapData:function(e,t,n,r){for(var i=t.data,o=e.getImageData(0,0,n,r).data,a=this.channel,s=t.width*t.height*4,u=0;uu?"right":"left",originY:i>c?"bottom":"top"}}function i(e){return"center"===e.getOriginX()&&"center"===e.getOriginY()}function o(e,t){var n=t.getPointByOrigin("center","center"),i=-t.getAngle(),o=r(n,e,i),a=o.originX,s=o.originY,u=t.getPointByOrigin(a,s),c=t.getLeft()-(n.x-u.x),l=t.getTop()-(n.x-u.y);t.set({originX:a,originY:s,left:c,top:l}),t.setCoords()}function a(e,t){var n=t.startPoint,i=-t.getAngle(),o=r(n,e,i),a=o.originX,s=o.originY;t.setPositionByOrigin(n,a,s)}function s(e){var t=e.type,n=e.scaleX,r=e.scaleY,i=l[t],o=e[i.w]*n,a=e[i.h]*r;if(e.isRegular){var s=Math.max(n,r);o=e[i.w]*s,a=e[i.h]*s}var u={hasControls:!1,hasBorders:!1,scaleX:1,scaleY:1};u[i.w]=o,u[i.h]=a,e.set(u)}function u(e,t){var n=t.type,r=t.strokeWidth,i=t.startPoint,o=c[n],a=l[n],s=!("triangle"!==t.type),u={},f=Math.abs(i.x-e.x)/o,h=Math.abs(i.y-e.y)/o;f>r&&(f-=r/o),h>r&&(h-=r/o),t.isRegular&&(f=h=Math.max(f,h),s&&(h=Math.sqrt(3)/2*f)),u[a.w]=f,u[a.h]=h,t.set(u)}var c={rect:1,circle:2,triangle:1},l={rect:{w:"width",h:"height"},circle:{w:"rx",h:"ry"},triangle:{w:"width",h:"height"}};e.exports={setOrigins:function(e){var t=e.getPointByOrigin("left","top"),n=e.getPointByOrigin("right","top"),r=e.getPointByOrigin("right","bottom"),i=e.getPointByOrigin("left","bottom");e.origins={lt:t,rt:n,rb:r,lb:i}},resize:function(e,t,r){i(e)&&(o(t,e),n(e)),r?s(e,t):u(t,e),a(t,e)},adjustOriginToCenter:function(e){var t=e.getPointByOrigin("center","center"),n=e.getOriginX(),r=e.getOriginY(),i=e.getPointByOrigin(n,r),o=e.getLeft()+(t.x-i.x),a=e.getTop()+(t.y-i.y);e.set({hasControls:!0,hasBorders:!0,originX:"center",originY:"center",left:o,top:a}),e.setCoords()}}},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}var o=function(){function e(e,t){for(var n=0;n1?n-1:0),i=1;il;)if(s=u[l++],s!=s)return!0}else for(;c>l;l++)if((e||l in u)&&u[l]===n)return e||l||0;return!e&&-1}}},function(e,t,n){var r=n(17),i=n(94),o=n(93),a=n(10),s=n(39),u=n(112),c={},l={},t=e.exports=function(e,t,n,f,h){var d,p,v,g,_=h?function(){return e}:u(e),y=r(n,f,t?2:1),m=0;if("function"!=typeof _)throw TypeError(e+" is not iterable!");if(o(_)){for(d=s(e.length);d>m;m++)if(g=t?y(a(p=e[m])[0],p[1]):y(e[m]),g===c||g===l)return g}else for(v=_.call(e);!(p=v.next()).done;)if(g=i(v,y,p.value,t),g===c||g===l)return g};t.BREAK=c,t.RETURN=l},function(e,t,n){e.exports=!n(14)&&!n(32)(function(){return 7!=Object.defineProperty(n(23)("div"),"a",{get:function(){return 7}}).a})},function(e,t){e.exports=function(e,t,n){var r=void 0===n;switch(t.length){case 0:return r?e():e.call(n);case 1:return r?e(t[0]):e.call(n,t[0]);case 2:return r?e(t[0],t[1]):e.call(n,t[0],t[1]);case 3:return r?e(t[0],t[1],t[2]):e.call(n,t[0],t[1],t[2]);case 4:return r?e(t[0],t[1],t[2],t[3]):e.call(n,t[0],t[1],t[2],t[3])}return e.apply(n,t)}},function(e,t,n){var r=n(16);e.exports=Object("z").propertyIsEnumerable(0)?Object:function(e){return"String"==r(e)?e.split(""):Object(e)}},function(e,t,n){var r=n(15),i=n(6)("iterator"),o=Array.prototype;e.exports=function(e){return void 0!==e&&(r.Array===e||o[i]===e)}},function(e,t,n){var r=n(10);e.exports=function(e,t,n,i){try{return i?t(r(n)[0],n[1]):t(n)}catch(t){var o=e.return;throw void 0!==o&&r(o.call(e)),t}}},function(e,t,n){"use strict";var r=n(99),i=n(36),o=n(24),a={};n(11)(a,n(6)("iterator"),function(){return this}),e.exports=function(e,t,n){e.prototype=r(a,{next:i(1,n)}),o(e,t+" Iterator")}},function(e,t,n){var r=n(6)("iterator"),i=!1;try{var o=[7][r]();o.return=function(){i=!0},Array.from(o,function(){throw 2})}catch(e){}e.exports=function(e,t){if(!t&&!i)return!1;var n=!1;try{var o=[7],a=o[r]();a.next=function(){return{done:n=!0}},o[r]=function(){return a},e(o)}catch(e){}return n}},function(e,t){e.exports=function(e,t){return{value:t,done:!!e}}},function(e,t,n){var r=n(8),i=n(38).set,o=r.MutationObserver||r.WebKitMutationObserver,a=r.process,s=r.Promise,u="process"==n(16)(a);e.exports=function(){var e,t,n,c=function(){var r,i;for(u&&(r=a.domain)&&r.exit();e;){i=e.fn,e=e.next;try{i()}catch(r){throw e?n():t=void 0,r}}t=void 0,r&&r.enter()};if(u)n=function(){a.nextTick(c)};else if(o){var l=!0,f=document.createTextNode("");new o(c).observe(f,{characterData:!0}),n=function(){f.data=l=!l}}else if(s&&s.resolve){var h=s.resolve();n=function(){h.then(c)}}else n=function(){i.call(r,c)};return function(r){var i={fn:r,next:void 0};t&&(t.next=i),e||(e=i,n()),t=i}}},function(e,t,n){var r=n(10),i=n(100),o=n(30),a=n(25)("IE_PROTO"),s=function(){},u="prototype",c=function(){var e,t=n(23)("iframe"),r=o.length,i="<",a=">";for(t.style.display="none",n(33).appendChild(t),t.src="javascript:",e=t.contentWindow.document,e.open(),e.write(i+"script"+a+"document.F=Object"+i+"/script"+a),e.close(),c=e.F;r--;)delete c[u][o[r]];return c()};e.exports=Object.create||function(e,t){var n;return null!==e?(s[u]=r(e),n=new s,s[u]=null,n[a]=e):n=c(),void 0===t?n:i(n,t)}},function(e,t,n){var r=n(20),i=n(10),o=n(103);e.exports=n(14)?Object.defineProperties:function(e,t){i(e);for(var n,a=o(t),s=a.length,u=0;s>u;)r.f(e,n=a[u++],t[n]);return e}},function(e,t,n){var r=n(18),i=n(110),o=n(25)("IE_PROTO"),a=Object.prototype;e.exports=Object.getPrototypeOf||function(e){return e=i(e),r(e,o)?e[o]:"function"==typeof e.constructor&&e instanceof e.constructor?e.constructor.prototype:e instanceof Object?a:null}},function(e,t,n){var r=n(18),i=n(27),o=n(88)(!1),a=n(25)("IE_PROTO");e.exports=function(e,t){var n,s=i(e),u=0,c=[];for(n in s)n!=a&&r(s,n)&&c.push(n);for(;t.length>u;)r(s,n=t[u++])&&(~o(c,n)||c.push(n));return c}},function(e,t,n){var r=n(102),i=n(30);e.exports=Object.keys||function(e){return r(e,i)}},function(e,t,n){var r=n(11);e.exports=function(e,t,n){for(var i in t)n&&e[i]?e[i]=t[i]:r(e,i,t[i]);return e}},function(e,t,n){e.exports=n(11)},function(e,t,n){"use strict";var r=n(8),i=n(13),o=n(20),a=n(14),s=n(6)("species");e.exports=function(e){var t="function"==typeof i[e]?i[e]:r[e];a&&t&&!t[s]&&o.f(t,s,{configurable:!0,get:function(){return this}})}},function(e,t,n){var r=n(10),i=n(21),o=n(6)("species");e.exports=function(e,t){var n,a=r(e).constructor;return void 0===a||void 0==(n=r(a)[o])?t:i(n)}},function(e,t,n){var r=n(26),i=n(22);e.exports=function(e){return function(t,n){var o,a,s=String(i(t)),u=r(n),c=s.length;return u<0||u>=c?e?"":void 0:(o=s.charCodeAt(u),o<55296||o>56319||u+1===c||(a=s.charCodeAt(u+1))<56320||a>57343?e?s.charAt(u):o:e?s.slice(u,u+2):(o-55296<<10)+(a-56320)+65536); +}}},function(e,t,n){var r=n(26),i=Math.max,o=Math.min;e.exports=function(e,t){return e=r(e),e<0?i(e+t,0):o(e,t)}},function(e,t,n){var r=n(22);e.exports=function(e){return Object(r(e))}},function(e,t,n){var r=n(19);e.exports=function(e,t){if(!r(e))return e;var n,i;if(t&&"function"==typeof(n=e.toString)&&!r(i=n.call(e)))return i;if("function"==typeof(n=e.valueOf)&&!r(i=n.call(e)))return i;if(!t&&"function"==typeof(n=e.toString)&&!r(i=n.call(e)))return i;throw TypeError("Can't convert object to primitive value")}},function(e,t,n){var r=n(29),i=n(6)("iterator"),o=n(15);e.exports=n(13).getIteratorMethod=function(e){if(void 0!=e)return e[i]||e["@@iterator"]||o[r(e)]}},function(e,t,n){"use strict";var r=n(86),i=n(97),o=n(15),a=n(27);e.exports=n(34)(Array,"Array",function(e,t){this._t=a(e),this._i=0,this._k=t},function(){var e=this._t,t=this._k,n=this._i++;return!e||n>=e.length?(this._t=void 0,i(1)):"keys"==t?i(0,n):"values"==t?i(0,e[n]):i(0,[n,e[n]])},"values"),o.Arguments=o.Array,r("keys"),r("values"),r("entries")},function(e,t){},function(e,t,n){"use strict";var r,i,o,a=n(35),s=n(8),u=n(17),c=n(29),l=n(31),f=n(19),h=n(21),d=n(87),p=n(89),v=n(107),g=n(38).set,_=n(98)(),y="Promise",m=s.TypeError,b=s.process,O=s[y],b=s.process,k="process"==c(b),w=function(){},C=!!function(){try{var e=O.resolve(1),t=(e.constructor={})[n(6)("species")]=function(e){e(w,w)};return(k||"function"==typeof PromiseRejectionEvent)&&e.then(w)instanceof t}catch(e){}}(),E=function(e,t){return e===t||e===O&&t===o},j=function(e){var t;return!(!f(e)||"function"!=typeof(t=e.then))&&t},x=function(e){return E(O,e)?new T(e):new i(e)},T=i=function(e){var t,n;this.promise=new e(function(e,r){if(void 0!==t||void 0!==n)throw m("Bad Promise constructor");t=e,n=r}),this.resolve=h(t),this.reject=h(n)},M=function(e){try{e()}catch(e){return{error:e}}},S=function(e,t){if(!e._n){e._n=!0;var n=e._c;_(function(){for(var r=e._v,i=1==e._s,o=0,a=function(t){var n,o,a=i?t.ok:t.fail,s=t.resolve,u=t.reject,c=t.domain;try{a?(i||(2==e._h&&D(e),e._h=1),a===!0?n=r:(c&&c.enter(),n=a(r),c&&c.exit()),n===t.promise?u(m("Promise-chain cycle")):(o=j(n))?o.call(n,s,u):s(n)):u(r)}catch(e){u(e)}};n.length>o;)a(n[o++]);e._c=[],e._n=!1,t&&!e._h&&P(e)})}},P=function(e){g.call(s,function(){var t,n,r,i=e._v;if(A(e)&&(t=M(function(){k?b.emit("unhandledRejection",i,e):(n=s.onunhandledrejection)?n({promise:e,reason:i}):(r=s.console)&&r.error&&r.error("Unhandled promise rejection",i)}),e._h=k||A(e)?2:1),e._a=void 0,t)throw t.error})},A=function(e){if(1==e._h)return!1;for(var t,n=e._a||e._c,r=0;n.length>r;)if(t=n[r++],t.fail||!A(t.promise))return!1;return!0},D=function(e){g.call(s,function(){var t;k?b.emit("rejectionHandled",e):(t=s.onrejectionhandled)&&t({promise:e,reason:e._v})})},I=function(e){var t=this;t._d||(t._d=!0,t=t._w||t,t._v=e,t._s=2,t._a||(t._a=t._c.slice()),S(t,!0))},N=function(e){var t,n=this;if(!n._d){n._d=!0,n=n._w||n;try{if(n===e)throw m("Promise can't be resolved itself");(t=j(e))?_(function(){var r={_w:n,_d:!1};try{t.call(e,u(N,r,1),u(I,r,1))}catch(e){I.call(r,e)}}):(n._v=e,n._s=1,S(n,!1))}catch(e){I.call({_w:n,_d:!1},e)}}};C||(O=function(e){d(this,O,y,"_h"),h(e),r.call(this);try{e(u(N,this,1),u(I,this,1))}catch(e){I.call(this,e)}},r=function(e){this._c=[],this._a=void 0,this._s=0,this._d=!1,this._v=void 0,this._h=0,this._n=!1},r.prototype=n(104)(O.prototype,{then:function(e,t){var n=x(v(this,O));return n.ok="function"!=typeof e||e,n.fail="function"==typeof t&&t,n.domain=k?b.domain:void 0,this._c.push(n),this._a&&this._a.push(n),this._s&&S(this,!1),n.promise},catch:function(e){return this.then(void 0,e)}}),T=function(){var e=new r;this.promise=e,this.resolve=u(N,e,1),this.reject=u(I,e,1)}),l(l.G+l.W+l.F*!C,{Promise:O}),n(24)(O,y),n(106)(y),o=n(13)[y],l(l.S+l.F*!C,y,{reject:function(e){var t=x(this),n=t.reject;return n(e),t.promise}}),l(l.S+l.F*(a||!C),y,{resolve:function(e){if(e instanceof O&&E(e.constructor,this))return e;var t=x(this),n=t.resolve;return n(e),t.promise}}),l(l.S+l.F*!(C&&n(96)(function(e){O.all(e).catch(w)})),y,{all:function(e){var t=this,n=x(t),r=n.resolve,i=n.reject,o=M(function(){var n=[],o=0,a=1;p(e,!1,function(e){var s=o++,u=!1;n.push(void 0),a++,t.resolve(e).then(function(e){u||(u=!0,n[s]=e,--a||r(n))},i)}),--a||r(n)});return o&&i(o.error),n.promise},race:function(e){var t=this,n=x(t),r=n.reject,i=M(function(){p(e,!1,function(e){t.resolve(e).then(n.resolve,r)})});return i&&r(i.error),n.promise}})},function(e,t,n){"use strict";var r=n(108)(!0);n(34)(String,"String",function(e){this._t=String(e),this._i=0},function(){var e,t=this._t,n=this._i;return n>=t.length?{value:void 0,done:!0}:(e=r(t,n),this._i+=e.length,{value:e,done:!1})})},function(e,t,n){n(113);for(var r=n(8),i=n(11),o=n(15),a=n(6)("toStringTag"),s=["NodeList","DOMTokenList","MediaList","StyleSheetList","CSSRuleList"],u=0;u<5;u++){var c=s[u],l=r[c],f=l&&l.prototype;f&&!f[a]&&i(f,a,c),o[c]=o.Array}}])}); \ No newline at end of file