diff --git a/apps/image-editor/dist/svg/icon-a.svg b/apps/image-editor/dist/svg/icon-a.svg index 0fc236b83..8bd2ace6c 100644 --- a/apps/image-editor/dist/svg/icon-a.svg +++ b/apps/image-editor/dist/svg/icon-a.svg @@ -324,6 +324,30 @@ + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/apps/image-editor/dist/svg/icon-b.svg b/apps/image-editor/dist/svg/icon-b.svg index c874bfac7..46d27a791 100644 --- a/apps/image-editor/dist/svg/icon-b.svg +++ b/apps/image-editor/dist/svg/icon-b.svg @@ -313,6 +313,34 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/apps/image-editor/dist/svg/icon-c.svg b/apps/image-editor/dist/svg/icon-c.svg index 3aff7e41a..00eb02072 100644 --- a/apps/image-editor/dist/svg/icon-c.svg +++ b/apps/image-editor/dist/svg/icon-c.svg @@ -313,6 +313,34 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/apps/image-editor/dist/svg/icon-d.svg b/apps/image-editor/dist/svg/icon-d.svg index d808cca0b..948a37086 100644 --- a/apps/image-editor/dist/svg/icon-d.svg +++ b/apps/image-editor/dist/svg/icon-d.svg @@ -313,6 +313,34 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/apps/image-editor/dist/tui-image-editor.css b/apps/image-editor/dist/tui-image-editor.css index 9c5f08669..45b22a883 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.13.0 + * @version 3.14.0 * @author NHN. FE Development Lab * @license MIT */ @@ -323,7 +323,8 @@ body > textarea { .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-icon .tui-image-editor-submenu > div.tui-image-editor-menu-icon, .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-filter .tui-image-editor-submenu > div.tui-image-editor-menu-filter, +.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, @@ -334,7 +335,8 @@ body > textarea { .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-icon .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-filter .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 { @@ -799,7 +801,7 @@ body > textarea { } .tui-image-editor-container .tui-image-editor-help-menu.top { white-space: nowrap; - width: 340px; + width: 506px; height: 40px; top: 8px; left: 50%; @@ -834,7 +836,7 @@ body > textarea { } .tui-image-editor-container .tui-image-editor-help-menu.bottom { white-space: nowrap; - width: 340px; + width: 506px; height: 40px; bottom: 8px; left: 50%; @@ -872,7 +874,7 @@ body > textarea { .tui-image-editor-container .tui-image-editor-help-menu.left { white-space: inherit; width: 40px; - height: 340px; + height: 506px; left: 8px; top: 50%; transform: translateY(-50%); @@ -912,7 +914,7 @@ body > textarea { .tui-image-editor-container .tui-image-editor-help-menu.right { white-space: inherit; width: 40px; - height: 340px; + height: 506px; right: 8px; top: 50%; transform: translateY(-50%); @@ -980,6 +982,8 @@ body > textarea { .tui-image-editor-container .tui-image-editor-controls .active svg:hover > use.hover { display: none; } +.tui-image-editor-container .tui-image-editor-help-menu .on svg > use.hover, +.tui-image-editor-container .tui-image-editor-controls .on svg > use.hover, .tui-image-editor-container .tui-image-editor-help-menu .opened svg > use.hover, .tui-image-editor-container .tui-image-editor-controls .opened svg > use.hover { display: block; @@ -1203,6 +1207,16 @@ body > textarea { left: 0; top: 0; } +.tie-zoom-button.resetFlip .tui-image-editor-button.resetFlip svg > use.normal, +.tie-zoom-button.flipX .tui-image-editor-button.flipX svg > use.normal, +.tie-zoom-button.flipY .tui-image-editor-button.flipY svg > use.normal { + display: none; +} +.tie-zoom-button.resetFlip .tui-image-editor-button.resetFlip svg > use.active, +.tie-zoom-button.flipX .tui-image-editor-button.flipX svg > use.active, +.tie-zoom-button.flipY .tui-image-editor-button.flipY svg > use.active { + display: block; +} .tui-image-editor-container.top.tui-image-editor-top-optimization .tui-image-editor-controls ul { text-align: right; } diff --git a/apps/image-editor/dist/tui-image-editor.css.map b/apps/image-editor/dist/tui-image-editor.css.map index 4074ae97e..3b2f098fc 100644 --- a/apps/image-editor/dist/tui-image-editor.css.map +++ b/apps/image-editor/dist/tui-image-editor.css.map @@ -1 +1 @@ -{"version":3,"sources":["webpack://tui.ImageEditor/src/css/main.styl","webpack://tui.ImageEditor/index.styl","webpack://tui.ImageEditor/src/css/gridtable.styl","webpack://tui.ImageEditor/src/css/submenu.styl","webpack://tui.ImageEditor/src/css/checkbox.styl","webpack://tui.ImageEditor/src/css/range.styl","webpack://tui.ImageEditor/src/css/position.styl","webpack://tui.ImageEditor/src/css/icon.styl","webpack://tui.ImageEditor/src/css/colorpicker.styl","webpack://tui.ImageEditor/src/css/buttons.styl","webpack://tui.ImageEditor/src/css/index.styl"],"names":[],"mappings":";;;;;;AAAA;EACI,0BAAU;ACCd;ADEE;EACE,SAAQ;EACR,UAAS;EACT,sBAAY;EACZ,iBAAY;EACZ,YAAQ;EACR,kBAAU;EACV,yBAAkB;EAClB,gBAAU;EACV,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AQ7lCE;;EAEE,cAAS;AR+lCb;AQxlCI;;;EACI,aAAS;AR4lCjB;AQ3lCI;;;EACI,cAAS;AR+lCjB;AQ3lCI;EACI,WAAO;AR6lCf;AQ5lCI;EACI,cAAS;AR8lCjB;AQzlCI;;EACI,kBAAc;AR4lCtB;AQ3lCI;;EACI,cAAS;AR8lCjB;AQ7lCI;;EACI,cAAS;ARgmCjB;AQxlCI;;;EACI,aAAS;AR4lCjB;AQ3lCI;;;EACI,cAAS;AR+lCjB;AQ3lCI;EACI,cAAS;AR6lCjB;AQ3lCI;;;EAGI,cAAS;AR6lCjB;AQ5lCA;;EAEI,UAAS;EACT,kBAAU;EACV,WAAO;EACP,YAAQ;EACR,yBAAQ;EACR,eAAQ;EACR,OAAM;EACN,MAAK;AR8lCT;ASjqCM;EACI,iBAAY;ATmqCtB;ASlqCM;EACI,aAAS;AToqCnB;AACA,4CAA4C,C","file":"tui-image-editor.css","sourcesContent":["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 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 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: 340px;\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: 340px;\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: 340px;\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: 340px;\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 .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.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 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}-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: 340px;\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: 340px;\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: 340px;\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: 340px;\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 .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","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"],"sourceRoot":""} \ No newline at end of file +{"version":3,"sources":["webpack://tui.ImageEditor/src/css/main.styl","webpack://tui.ImageEditor/index.styl","webpack://tui.ImageEditor/src/css/gridtable.styl","webpack://tui.ImageEditor/src/css/submenu.styl","webpack://tui.ImageEditor/src/css/checkbox.styl","webpack://tui.ImageEditor/src/css/range.styl","webpack://tui.ImageEditor/src/css/position.styl","webpack://tui.ImageEditor/src/css/icon.styl","webpack://tui.ImageEditor/src/css/colorpicker.styl","webpack://tui.ImageEditor/src/css/buttons.styl","webpack://tui.ImageEditor/src/css/index.styl"],"names":[],"mappings":";;;;;;AAAA;EACI,0BAAU;ACCd;ADEE;EACE,SAAQ;EACR,UAAS;EACT,sBAAY;EACZ,iBAAY;EACZ,YAAQ;EACR,kBAAU;EACV,yBAAkB;EAClB,gBAAU;EACV,qBAAgB;ACApB;ADEI;;;;;EACE,sBAAY;EACZ,SAAQ;EACR,UAAS;EACT,qBAAiB;EACjB,2BAA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ACI,cAAS;ARmmCjB;AQ/lCI;EACI,WAAO;ARimCf;AQhmCI;EACI,cAAS;ARkmCjB;AQ7lCI;;EACI,kBAAc;ARgmCtB;AQ/lCI;;EACI,cAAS;ARkmCjB;AQjmCI;;EACI,cAAS;ARomCjB;AQ5lCI;;;EACI,aAAS;ARgmCjB;AQ/lCI;;;EACI,cAAS;ARmmCjB;AQ/lCI;EACI,cAAS;ARimCjB;AQ/lCI;;;EAGI,cAAS;ARimCjB;AQhmCA;;EAEI,UAAS;EACT,kBAAU;EACV,WAAO;EACP,YAAQ;EACR,yBAAQ;EACR,eAAQ;EACR,OAAM;EACN,MAAK;ARkmCT;AQ1lCQ;;;EACI,aAAS;AR8lCrB;AQ7lCQ;;;EACI,cAAS;ARimCrB;AS/qCM;EACI,iBAAY;ATirCtB;AShrCM;EACI,aAAS;ATkrCnB;AACA,4CAA4C,C","file":"tui-image-editor.css","sourcesContent":["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"],"sourceRoot":""} \ No newline at end of file diff --git a/apps/image-editor/dist/tui-image-editor.js b/apps/image-editor/dist/tui-image-editor.js index 985fe3008..2ae724707 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.13.0 + * @version 3.14.0 * @author NHN. FE Development Lab * @license MIT */ @@ -3479,6 +3479,28 @@ exports.default = { return result; }; + var toggleZoomMode = function toggleZoomMode() { + var zoomMode = _this._graphics.getZoomMode(); + + _this.stopDrawingMode(); + if (zoomMode !== _consts.zoomModes.ZOOM) { + _this.startDrawingMode(_consts.drawingModes.ZOOM); + _this._graphics.startZoomInMode(); + } else { + _this._graphics.endZoomInMode(); + } + }; + var toggleHandMode = function toggleHandMode() { + var zoomMode = _this._graphics.getZoomMode(); + + _this.stopDrawingMode(); + if (zoomMode !== _consts.zoomModes.HAND) { + _this.startDrawingMode(_consts.drawingModes.ZOOM); + _this._graphics.startHandMode(); + } else { + _this._graphics.endHandMode(); + } + }; return (0, _tuiCodeSnippet.extend)({ initLoadImage: function initLoadImage(imagePath, imageName) { @@ -3563,6 +3585,20 @@ exports.default = { }, history: function history(event) { _this.ui.toggleHistoryMenu(event); + }, + zoomIn: function zoomIn() { + _this.ui.toggleZoomButtonStatus('zoomIn'); + _this.deactivateAll(); + toggleZoomMode(); + }, + zoomOut: function zoomOut() { + _this._graphics.zoomOut(); + }, + hand: function hand() { + _this.ui.offZoomInButtonStatus(); + _this.ui.toggleZoomButtonStatus('hand'); + _this.deactivateAll(); + toggleHandMode(); } }, this._commonAction()); }, @@ -3970,19 +4006,28 @@ exports.default = { _commonAction: function _commonAction() { var _this13 = this; + var TEXT = _consts.drawingModes.TEXT, + CROPPER = _consts.drawingModes.CROPPER, + SHAPE = _consts.drawingModes.SHAPE, + ZOOM = _consts.drawingModes.ZOOM; + + return { modeChange: function modeChange(menu) { switch (menu) { - case 'text': - _this13._changeActivateMode('TEXT'); + case _consts.drawingMenuNames.TEXT: + _this13._changeActivateMode(TEXT); break; - case 'crop': - _this13.startDrawingMode('CROPPER'); + case _consts.drawingMenuNames.CROP: + _this13.startDrawingMode(CROPPER); break; - case 'shape': - _this13._changeActivateMode('SHAPE'); + case _consts.drawingMenuNames.SHAPE: + _this13._changeActivateMode(SHAPE); _this13.setDrawingShape(_this13.ui.shape.type, _this13.ui.shape.options); break; + case _consts.drawingMenuNames.ZOOM: + _this13.startDrawingMode(ZOOM); + break; default: break; } @@ -9104,27 +9149,884 @@ var Text = function (_Component) { this.fire(_consts.eventNames.TEXT_EDITING); // fire editing text event } - this._lastClickTime = newClickTime; + this._lastClickTime = newClickTime; + } + + /** + * Get state of firing double click event + * @param {Date} newClickTime - Current clicked time + * @returns {boolean} Whether double clicked or not + * @private + */ + + }, { + key: '_isDoubleClick', + value: function _isDoubleClick(newClickTime) { + return newClickTime - this._lastClickTime < DBCLICK_TIME; + } + }]); + + return Text; +}(_component2.default); + +exports.default = Text; + +/***/ }), + +/***/ "./src/js/component/zoom.js": +/*!**********************************!*\ + !*** ./src/js/component/zoom.js ***! + \**********************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", { + value: true +}); + +var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); + +var _fabric = __webpack_require__(/*! fabric */ "fabric"); + +var _fabric2 = _interopRequireDefault(_fabric); + +var _component = __webpack_require__(/*! @/interface/component */ "./src/js/interface/component.js"); + +var _component2 = _interopRequireDefault(_component); + +var _util = __webpack_require__(/*! @/util */ "./src/js/util.js"); + +var _consts = __webpack_require__(/*! @/consts */ "./src/js/consts.js"); + +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"); } } + +function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } + +function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } /** + * @author NHN. FE Development Team + * @fileoverview Image zoom module (start zoom, end zoom) + */ + + +var MOUSE_MOVE_THRESHOLD = 10; +var DEFAULT_SCROLL_OPTION = { + left: 0, + top: 0, + width: 0, + height: 0, + stroke: '#000000', + strokeWidth: 0, + fill: '#000000', + opacity: 0.4, + evented: false, + selectable: false, + hoverCursor: 'auto' +}; +var DEFAULT_VERTICAL_SCROLL_RATIO = { + SIZE: 0.0045, + MARGIN: 0.003, + BORDER_RADIUS: 0.003 +}; +var DEFAULT_HORIZONTAL_SCROLL_RATIO = { + SIZE: 0.0066, + MARGIN: 0.0044, + BORDER_RADIUS: 0.003 +}; +var DEFAULT_ZOOM_LEVEL = 1.0; + +/** + * Zoom components + * @param {Graphics} graphics - Graphics instance + * @extends {Component} + * @class Zoom + * @ignore + */ + +var Zoom = function (_Component) { + _inherits(Zoom, _Component); + + function Zoom(graphics) { + _classCallCheck(this, Zoom); + + /** + * zoomArea + * @type {?fabric.Rect} + * @private + */ + var _this = _possibleConstructorReturn(this, (Zoom.__proto__ || Object.getPrototypeOf(Zoom)).call(this, _consts.componentNames.ZOOM, graphics)); + + _this.zoomArea = null; + + /** + * Start point of zoom area + * @type {?{x: number, y: number}} + */ + _this._startPoint = null; + + /** + * Center point of every zoom + * @type {Array.<{prevZoomLevel: number, zoomLevel: number, x: number, y: number}>} + */ + _this._centerPoints = []; + + /** + * Zoom level (default: 100%(1.0), max: 400%(4.0)) + * @type {number} + */ + _this.zoomLevel = DEFAULT_ZOOM_LEVEL; + + /** + * Zoom mode ('normal', 'zoom', 'hand') + * @type {string} + */ + _this.zoomMode = _consts.zoomModes.DEFAULT; + + /** + * Listeners + * @type {Object.} + * @private + */ + _this._listeners = { + startZoom: _this._onMouseDownWithZoomMode.bind(_this), + moveZoom: _this._onMouseMoveWithZoomMode.bind(_this), + stopZoom: _this._onMouseUpWithZoomMode.bind(_this), + startHand: _this._onMouseDownWithHandMode.bind(_this), + 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) + }; + + var canvas = _this.getCanvas(); + + /** + * Width:Height ratio (ex. width=1.5, height=1 -> aspectRatio=1.5) + * @private + */ + _this.aspectRatio = canvas.width / canvas.height; + + /** + * vertical scroll bar + * @type {fabric.Rect} + * @private + */ + _this._verticalScroll = new _fabric2.default.Rect(DEFAULT_SCROLL_OPTION); + + /** + * horizontal scroll bar + * @type {fabric.Rect} + * @private + */ + _this._horizontalScroll = new _fabric2.default.Rect(DEFAULT_SCROLL_OPTION); + + canvas.on(_consts.eventNames.ZOOM_CHANGED, _this._listeners.zoomChanged); + + _fabric2.default.util.addListener(document, 'keydown', _this._listeners.keydown); + _fabric2.default.util.addListener(document, 'keyup', _this._listeners.keyup); + return _this; + } + + /** + * Keydown event handler + * @param {KeyboardEvent} e - Event object + * @private + */ + + + _createClass(Zoom, [{ + key: '_onKeyDown', + value: function _onKeyDown(e) { + if (this.withSpace) { + return; + } + + if (e.keyCode === _consts.keyCodes.SPACE) { + e.preventDefault(); + this.withSpace = true; + this.startHandMode(); + } + } + + /** + * Keyup event handler + * @param {KeyboardEvent} e - Event object + * @private + */ + + }, { + key: '_onKeyUp', + value: function _onKeyUp(e) { + if (e.keyCode === _consts.keyCodes.SPACE) { + e.preventDefault(); + this.withSpace = false; + this.endHandMode(); + } + } + + /** + * Start zoom-in mode + */ + + }, { + key: 'startZoomInMode', + value: function startZoomInMode() { + if (this.zoomArea) { + return; + } + this.endHandMode(); + this.zoomMode = _consts.zoomModes.ZOOM; + + var canvas = this.getCanvas(); + + this._changeObjectsEventedState(false); + + this.zoomArea = new _fabric2.default.Rect({ + left: 0, + top: 0, + width: 0.5, + height: 0.5, + stroke: 'black', + strokeWidth: 1, + fill: 'transparent', + hoverCursor: 'zoom-in' + }); + + canvas.discardActiveObject(); + canvas.add(this.zoomArea); + canvas.on('mouse:down', this._listeners.startZoom); + canvas.selection = false; + canvas.defaultCursor = 'zoom-in'; + } + + /** + * End zoom-in mode + */ + + }, { + key: 'endZoomInMode', + value: function endZoomInMode() { + this.zoomMode = _consts.zoomModes.DEFAULT; + + var canvas = this.getCanvas(); + var _listeners = this._listeners, + startZoom = _listeners.startZoom, + moveZoom = _listeners.moveZoom, + stopZoom = _listeners.stopZoom; + + + canvas.selection = true; + canvas.defaultCursor = 'auto'; + canvas.off({ + 'mouse:down': startZoom, + 'mouse:move': moveZoom, + 'mouse:up': stopZoom + }); + + this._changeObjectsEventedState(true); + + canvas.remove(this.zoomArea); + this.zoomArea = null; + } + + /** + * Start zoom drawing mode + */ + + }, { + key: 'start', + value: function start() { + this.zoomArea = null; + this._startPoint = null; + this._startHandPoint = null; + } + + /** + * Stop zoom drawing mode + */ + + }, { + key: 'end', + value: function end() { + this.endZoomInMode(); + this.endHandMode(); + } + + /** + * Start hand mode + */ + + }, { + key: 'startHandMode', + value: function startHandMode() { + this.endZoomInMode(); + this.zoomMode = _consts.zoomModes.HAND; + + var canvas = this.getCanvas(); + + this._changeObjectsEventedState(false); + + canvas.discardActiveObject(); + canvas.off('mouse:down', this._listeners.startHand); + canvas.on('mouse:down', this._listeners.startHand); + canvas.selection = false; + canvas.defaultCursor = 'grab'; + + canvas.fire(_consts.eventNames.HAND_STARTED); + } + + /** + * Stop hand mode + */ + + }, { + key: 'endHandMode', + value: function endHandMode() { + this.zoomMode = _consts.zoomModes.DEFAULT; + var canvas = this.getCanvas(); + + this._changeObjectsEventedState(true); + + canvas.off('mouse:down', this._listeners.startHand); + canvas.selection = true; + canvas.defaultCursor = 'auto'; + + this._startHandPoint = null; + + canvas.fire(_consts.eventNames.HAND_STOPPED); + } + + /** + * onMousedown handler in fabric canvas + * @param {{target: fabric.Object, e: MouseEvent}} fEvent - Fabric event + * @private + */ + + }, { + key: '_onMouseDownWithZoomMode', + value: function _onMouseDownWithZoomMode(_ref) { + var target = _ref.target, + e = _ref.e; + + if (target) { + return; + } + + var canvas = this.getCanvas(); + + canvas.selection = false; + + this._startPoint = canvas.getPointer(e); + this.zoomArea.set({ width: 0, height: 0 }); + + var _listeners2 = this._listeners, + moveZoom = _listeners2.moveZoom, + stopZoom = _listeners2.stopZoom; + + canvas.on({ + 'mouse:move': moveZoom, + 'mouse:up': stopZoom + }); + } + + /** + * onMousemove handler in fabric canvas + * @param {{e: MouseEvent}} fEvent - Fabric event + * @private + */ + + }, { + key: '_onMouseMoveWithZoomMode', + value: function _onMouseMoveWithZoomMode(_ref2) { + var e = _ref2.e; + + var canvas = this.getCanvas(); + var pointer = canvas.getPointer(e); + var x = pointer.x, + y = pointer.y; + var zoomArea = this.zoomArea, + _startPoint = this._startPoint; + + var deltaX = Math.abs(x - _startPoint.x); + var deltaY = Math.abs(y - _startPoint.y); + + if (deltaX + deltaY > MOUSE_MOVE_THRESHOLD) { + canvas.remove(zoomArea); + zoomArea.set(this._calcRectDimensionFromPoint(x, y)); + canvas.add(zoomArea); + } + } + + /** + * Get rect dimension setting from Canvas-Mouse-Position(x, y) + * @param {number} x - Canvas-Mouse-Position x + * @param {number} y - Canvas-Mouse-Position Y + * @returns {{left: number, top: number, width: number, height: number}} + * @private + */ + + }, { + key: '_calcRectDimensionFromPoint', + value: function _calcRectDimensionFromPoint(x, y) { + var canvas = this.getCanvas(); + var canvasWidth = canvas.getWidth(); + var canvasHeight = canvas.getHeight(); + var _startPoint2 = this._startPoint, + startX = _startPoint2.x, + startY = _startPoint2.y; + var min = Math.min; + + + var left = min(startX, x); + var top = min(startY, y); + var width = (0, _util.clamp)(x, startX, canvasWidth) - left; // (startX <= x(mouse) <= canvasWidth) - left + var height = (0, _util.clamp)(y, startY, canvasHeight) - top; // (startY <= y(mouse) <= canvasHeight) - top + + return { left: left, top: top, width: width, height: height }; + } + + /** + * onMouseup handler in fabric canvas + * @private + */ + + }, { + key: '_onMouseUpWithZoomMode', + value: function _onMouseUpWithZoomMode() { + var zoomLevel = this.zoomLevel; + var zoomArea = this.zoomArea; + var _listeners3 = this._listeners, + moveZoom = _listeners3.moveZoom, + stopZoom = _listeners3.stopZoom; + + var canvas = this.getCanvas(); + var center = this._getCenterPoint(); + var x = center.x, + y = center.y; + + + if (!this._isMaxZoomLevel()) { + this._centerPoints.push({ + x: x, + y: y, + prevZoomLevel: zoomLevel, + zoomLevel: zoomLevel + 1 + }); + zoomLevel += 1; + canvas.zoomToPoint({ x: x, y: y }, zoomLevel); + + this._fireZoomChanged(canvas, zoomLevel); + + this.zoomLevel = zoomLevel; + } + + canvas.off({ + 'mouse:move': moveZoom, + 'mouse:up': stopZoom + }); + + canvas.remove(zoomArea); + this._startPoint = null; + } + + /** + * Get center point + * @returns {{x: number, y: number}} + * @private + */ + + }, { + key: '_getCenterPoint', + value: function _getCenterPoint() { + var _zoomArea = this.zoomArea, + left = _zoomArea.left, + top = _zoomArea.top, + width = _zoomArea.width, + height = _zoomArea.height; + var _startPoint3 = this._startPoint, + x = _startPoint3.x, + y = _startPoint3.y; + var aspectRatio = this.aspectRatio; + + + if (width < MOUSE_MOVE_THRESHOLD && height < MOUSE_MOVE_THRESHOLD) { + return { x: x, y: y }; + } + + return width > height ? { x: left + aspectRatio * height / 2, y: top + height / 2 } : { x: left + width / 2, y: top + width / aspectRatio / 2 }; + } + + /** + * Zoom the canvas + * @param {{x: number, y: number}} center - center of zoom + * @param {?number} zoomLevel - zoom level + */ + + }, { + key: 'zoom', + value: function zoom(_ref3) { + var x = _ref3.x, + y = _ref3.y; + var zoomLevel = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : this.zoomLevel; + + var canvas = this.getCanvas(); + var centerPoints = this._centerPoints; + + for (var i = centerPoints.length - 1; i >= 0; i -= 1) { + if (centerPoints[i].zoomLevel < zoomLevel) { + break; + } + + var _centerPoints$pop = centerPoints.pop(), + prevX = _centerPoints$pop.x, + prevY = _centerPoints$pop.y, + prevZoomLevel = _centerPoints$pop.prevZoomLevel; + + canvas.zoomToPoint({ x: prevX, y: prevY }, prevZoomLevel); + this.zoomLevel = prevZoomLevel; + } + + canvas.zoomToPoint({ x: x, y: y }, zoomLevel); + if (!this._isDefaultZoomLevel(zoomLevel)) { + this._centerPoints.push({ + x: x, + y: y, + zoomLevel: zoomLevel, + prevZoomLevel: this.zoomLevel + }); + } + this.zoomLevel = zoomLevel; + + this._fireZoomChanged(canvas, zoomLevel); + } + + /** + * Zoom out one step + */ + + }, { + key: 'zoomOut', + value: function zoomOut() { + var centerPoints = this._centerPoints; + + if (!centerPoints.length) { + return; + } + + var canvas = this.getCanvas(); + var point = centerPoints.pop(); + var x = point.x, + y = point.y, + prevZoomLevel = point.prevZoomLevel; + + + if (this._isDefaultZoomLevel(prevZoomLevel)) { + canvas.setViewportTransform([1, 0, 0, 1, 0, 0]); + } else { + canvas.zoomToPoint({ x: x, y: y }, prevZoomLevel); + } + + this.zoomLevel = prevZoomLevel; + + this._fireZoomChanged(canvas, this.zoomLevel); + } + + /** + * Zoom reset + */ + + }, { + key: 'resetZoom', + value: function resetZoom() { + var canvas = this.getCanvas(); + + canvas.setViewportTransform([1, 0, 0, 1, 0, 0]); + + this.zoomLevel = DEFAULT_ZOOM_LEVEL; + this._centerPoints = []; + + this._fireZoomChanged(canvas, this.zoomLevel); + } + + /** + * Whether zoom level is max (5.0) + * @returns {boolean} + * @private + */ + + }, { + key: '_isMaxZoomLevel', + value: function _isMaxZoomLevel() { + return this.zoomLevel >= 5.0; + } + + /** + * Move point of zoom + * @param {{x: number, y: number}} delta - move amount + * @private + */ + + }, { + key: '_movePointOfZoom', + value: function _movePointOfZoom(_ref4) { + var deltaX = _ref4.x, + deltaY = _ref4.y; + + var centerPoints = this._centerPoints; + + if (!centerPoints.length) { + return; + } + + var canvas = this.getCanvas(); + var zoomLevel = this.zoomLevel; + + + var point = centerPoints.pop(); + var originX = point.x, + originY = point.y, + prevZoomLevel = point.prevZoomLevel; + + var x = originX - deltaX; + var y = originY - deltaY; + + canvas.zoomToPoint({ x: originX, y: originY }, prevZoomLevel); + canvas.zoomToPoint({ x: x, y: y }, zoomLevel); + centerPoints.push({ x: x, y: y, prevZoomLevel: prevZoomLevel, zoomLevel: zoomLevel }); + + this._fireZoomChanged(canvas, zoomLevel); + } + + /** + * onMouseDown handler in fabric canvas + * @param {{target: fabric.Object, e: MouseEvent}} fEvent - Fabric event + * @private + */ + + }, { + key: '_onMouseDownWithHandMode', + value: function _onMouseDownWithHandMode(_ref5) { + var target = _ref5.target, + e = _ref5.e; + + if (target) { + return; + } + + var canvas = this.getCanvas(); + + if (this.zoomLevel <= DEFAULT_ZOOM_LEVEL) { + return; + } + + canvas.selection = false; + + this._startHandPoint = canvas.getPointer(e); + + var _listeners4 = this._listeners, + moveHand = _listeners4.moveHand, + stopHand = _listeners4.stopHand; + + canvas.on({ + 'mouse:move': moveHand, + 'mouse:up': stopHand + }); + } + + /** + * onMouseMove handler in fabric canvas + * @param {{e: MouseEvent}} fEvent - Fabric event + * @private + */ + + }, { + key: '_onMouseMoveWithHandMode', + value: function _onMouseMoveWithHandMode(_ref6) { + var e = _ref6.e; + + var canvas = this.getCanvas(); + + var _canvas$getPointer = canvas.getPointer(e), + x = _canvas$getPointer.x, + y = _canvas$getPointer.y; + + var deltaX = x - this._startHandPoint.x; + var deltaY = y - this._startHandPoint.y; + + this._movePointOfZoom({ x: deltaX, y: deltaY }); + } + + /** + * onMouseUp handler in fabric canvas + * @private + */ + + }, { + key: '_onMouseUpWithHandMode', + value: function _onMouseUpWithHandMode() { + var canvas = this.getCanvas(); + var _listeners5 = this._listeners, + moveHand = _listeners5.moveHand, + stopHand = _listeners5.stopHand; + + + canvas.off({ + 'mouse:move': moveHand, + 'mouse:up': stopHand + }); + + this._startHandPoint = null; + } + + /** + * onChangeZoom handler in fabric canvas + * @private + */ + + }, { + key: '_changeScrollState', + value: function _changeScrollState(_ref7) { + var viewport = _ref7.viewport, + zoomLevel = _ref7.zoomLevel; + + var canvas = this.getCanvas(); + + canvas.remove(this._verticalScroll); + canvas.remove(this._horizontalScroll); + + if (this._isDefaultZoomLevel(zoomLevel)) { + return; + } + + var canvasWidth = canvas.width; + var canvasHeight = canvas.height; + + var tl = viewport.tl, + tr = viewport.tr, + bl = viewport.bl; + + var viewportWidth = tr.x - tl.x; + var viewportHeight = bl.y - tl.y; + + var horizontalScrollWidth = viewportWidth * viewportWidth / canvasWidth; + var horizontalScrollHeight = viewportHeight * DEFAULT_HORIZONTAL_SCROLL_RATIO.SIZE; + var horizontalScrollLeft = (0, _util.clamp)(tl.x + tl.x / canvasWidth * viewportWidth, tl.x, tr.x - horizontalScrollWidth); + var horizontalScrollMargin = viewportHeight * DEFAULT_HORIZONTAL_SCROLL_RATIO.MARGIN; + var horizontalScrollBorderRadius = viewportHeight * DEFAULT_HORIZONTAL_SCROLL_RATIO.BORDER_RADIUS; + + this._horizontalScroll.set({ + left: horizontalScrollLeft, + top: bl.y - horizontalScrollHeight - horizontalScrollMargin, + width: horizontalScrollWidth, + height: horizontalScrollHeight, + rx: horizontalScrollBorderRadius, + ry: horizontalScrollBorderRadius + }); + + var verticalScrollWidth = viewportWidth * DEFAULT_VERTICAL_SCROLL_RATIO.SIZE; + var verticalScrollHeight = viewportHeight * viewportHeight / canvasHeight; + var verticalScrollTop = (0, _util.clamp)(tl.y + tl.y / canvasHeight * viewportHeight, tr.y, bl.y - verticalScrollHeight); + var verticalScrollMargin = viewportWidth * DEFAULT_VERTICAL_SCROLL_RATIO.MARGIN; + var verticalScrollBorderRadius = viewportWidth * DEFAULT_VERTICAL_SCROLL_RATIO.BORDER_RADIUS; + + this._verticalScroll.set({ + left: tr.x - verticalScrollWidth - verticalScrollMargin, + top: verticalScrollTop, + width: verticalScrollWidth, + height: verticalScrollHeight, + rx: verticalScrollBorderRadius, + ry: verticalScrollBorderRadius + }); + + this._addScrollBar(); + } + + /** + * Change objects 'evented' state + * @param {boolean} [evented=true] - objects 'evented' state + */ + + }, { + key: '_changeObjectsEventedState', + value: function _changeObjectsEventedState() { + var evented = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : true; + + var canvas = this.getCanvas(); + + canvas.forEachObject(function (obj) { + // {@link http://fabricjs.com/docs/fabric.Object.html#evented} + obj.evented = evented; + }); + } + + /** + * Add scroll bar and set remove timer + */ + + }, { + key: '_addScrollBar', + value: function _addScrollBar() { + var _this2 = this; + + var canvas = this.getCanvas(); + + canvas.add(this._horizontalScroll); + canvas.add(this._verticalScroll); + + if (this.scrollBarTid) { + clearTimeout(this.scrollBarTid); + } + + this.scrollBarTid = setTimeout(function () { + canvas.remove(_this2._horizontalScroll); + canvas.remove(_this2._verticalScroll); + }, 3000); + } + + /** + * Check zoom level is default zoom level (1.0) + * @param {number} zoomLevel - zoom level + * @returns {boolean} - whether zoom level is 1.0 + */ + + }, { + key: '_isDefaultZoomLevel', + value: function _isDefaultZoomLevel(zoomLevel) { + return zoomLevel === DEFAULT_ZOOM_LEVEL; + } + + /** + * Fire 'zoomChanged' event + * @param {fabric.Canvas} canvas - fabric canvas + * @param {number} zoomLevel - 'zoomChanged' event params + */ + + }, { + key: '_fireZoomChanged', + value: function _fireZoomChanged(canvas, zoomLevel) { + canvas.fire(_consts.eventNames.ZOOM_CHANGED, { viewport: canvas.calcViewportBoundaries(), zoomLevel: zoomLevel }); } /** - * Get state of firing double click event - * @param {Date} newClickTime - Current clicked time - * @returns {boolean} Whether double clicked or not - * @private + * Get zoom mode */ }, { - key: '_isDoubleClick', - value: function _isDoubleClick(newClickTime) { - return newClickTime - this._lastClickTime < DBCLICK_TIME; + key: 'mode', + get: function get() { + return this.zoomMode; } }]); - return Text; + return Zoom; }(_component2.default); -exports.default = Text; +exports.default = Zoom; /***/ }), @@ -9141,31 +10043,37 @@ exports.default = Text; Object.defineProperty(exports, "__esModule", { value: true }); -exports.emptyCropRectValues = exports.defaultFilterRangeValues = exports.defaultTextRangeValues = exports.defaultShapeStrokeValues = exports.defaultDrawRangeValues = exports.defaultRotateRangeValues = exports.defaultIconPath = exports.rejectMessages = exports.fObjectOptions = exports.keyCodes = exports.drawingModes = exports.historyNames = exports.eventNames = exports.commandNames = exports.CROPZONE_DEFAULT_OPTIONS = exports.SHAPE_DEFAULT_OPTIONS = exports.componentNames = exports.filterType = exports.OBJ_TYPE = exports.SHAPE_TYPE = exports.SHAPE_FILL_TYPE = exports.HELP_MENUS = exports.DELETE_HELP_MENUS = exports.COMMAND_HELP_MENUS = undefined; +exports.emptyCropRectValues = exports.defaultFilterRangeValues = exports.defaultTextRangeValues = exports.defaultShapeStrokeValues = exports.defaultDrawRangeValues = exports.defaultRotateRangeValues = exports.defaultIconPath = exports.rejectMessages = exports.fObjectOptions = exports.keyCodes = exports.zoomModes = exports.drawingMenuNames = exports.drawingModes = exports.historyNames = exports.eventNames = exports.commandNames = exports.CROPZONE_DEFAULT_OPTIONS = exports.SHAPE_DEFAULT_OPTIONS = exports.componentNames = exports.filterType = exports.OBJ_TYPE = exports.SHAPE_TYPE = exports.SHAPE_FILL_TYPE = exports.HELP_MENUS = exports.DELETE_HELP_MENUS = exports.COMMAND_HELP_MENUS = exports.ZOOM_HELP_MENUS = undefined; var _util = __webpack_require__(/*! @/util */ "./src/js/util.js"); /** - * Help features for command + * Help features for zoom * @type {Array.} */ -var COMMAND_HELP_MENUS = exports.COMMAND_HELP_MENUS = ['history', 'undo', 'redo', 'reset']; +var ZOOM_HELP_MENUS = exports.ZOOM_HELP_MENUS = ['zoomIn', 'zoomOut', 'hand']; /** - * Help features for delete + * Help features for command * @type {Array.} */ /** * @author NHN. FE Development Team * @fileoverview Constants */ +var COMMAND_HELP_MENUS = exports.COMMAND_HELP_MENUS = ['history', 'undo', 'redo', 'reset']; + +/** + * Help features for delete + * @type {Array.} + */ var DELETE_HELP_MENUS = exports.DELETE_HELP_MENUS = ['delete', 'deleteAll']; /** * Editor help features * @type {Array.} */ -var HELP_MENUS = exports.HELP_MENUS = [].concat(COMMAND_HELP_MENUS, DELETE_HELP_MENUS); +var HELP_MENUS = exports.HELP_MENUS = [].concat(ZOOM_HELP_MENUS, COMMAND_HELP_MENUS, DELETE_HELP_MENUS); /** * Fill type for shape @@ -9208,7 +10116,7 @@ var filterType = exports.filterType = { * Component names * @type {Object.} */ -var componentNames = exports.componentNames = (0, _util.keyMirror)('IMAGE_LOADER', 'CROPPER', 'FLIP', 'ROTATION', 'FREE_DRAWING', 'LINE', 'TEXT', 'ICON', 'FILTER', 'SHAPE'); +var componentNames = exports.componentNames = (0, _util.keyMirror)('IMAGE_LOADER', 'CROPPER', 'FLIP', 'ROTATION', 'FREE_DRAWING', 'LINE', 'TEXT', 'ICON', 'FILTER', 'SHAPE', 'ZOOM'); /** * Shape default option @@ -9290,7 +10198,10 @@ var eventNames = exports.eventNames = { SELECTION_CREATED: 'selectionCreated', EXECUTE_COMMAND: 'executeCommand', AFTER_UNDO: 'afterUndo', - AFTER_REDO: 'afterRedo' + AFTER_REDO: 'afterRedo', + ZOOM_CHANGED: 'zoomChanged', + HAND_STARTED: 'handStarted', + HAND_STOPPED: 'handStopped' }; /** @@ -9317,7 +10228,28 @@ var historyNames = exports.historyNames = { * Editor states * @type {Object.} */ -var drawingModes = exports.drawingModes = (0, _util.keyMirror)('NORMAL', 'CROPPER', 'FREE_DRAWING', 'LINE_DRAWING', 'TEXT', 'SHAPE', 'ICON'); +var drawingModes = exports.drawingModes = (0, _util.keyMirror)('NORMAL', 'CROPPER', 'FREE_DRAWING', 'LINE_DRAWING', 'TEXT', 'SHAPE', 'ICON', 'ZOOM'); + +/** + * Menu names with drawing mode + * @type {Object.} + */ +var drawingMenuNames = exports.drawingMenuNames = { + TEXT: 'text', + CROP: 'crop', + SHAPE: 'shape', + ZOOM: 'zoom' +}; + +/** + * Zoom modes + * @type {Object.} + */ +var zoomModes = exports.zoomModes = { + DEFAULT: 'normal', + ZOOM: 'zoom', + HAND: 'hand' +}; /** * Shortcut key values @@ -9332,7 +10264,8 @@ var keyCodes = exports.keyCodes = { BACKSPACE: 8, DEL: 46, ARROW_DOWN: 40, - ARROW_UP: 38 + ARROW_UP: 38, + SPACE: 32 }; /** @@ -9969,6 +10902,91 @@ exports.default = TextDrawingMode; /***/ }), +/***/ "./src/js/drawingMode/zoom.js": +/*!************************************!*\ + !*** ./src/js/drawingMode/zoom.js ***! + \************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", { + value: true +}); + +var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); + +var _drawingMode = __webpack_require__(/*! @/interface/drawingMode */ "./src/js/interface/drawingMode.js"); + +var _drawingMode2 = _interopRequireDefault(_drawingMode); + +var _consts = __webpack_require__(/*! @/consts */ "./src/js/consts.js"); + +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"); } } + +function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } + +function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } /** + * @author NHN. FE Development Team + * @fileoverview ZoomDrawingMode class + */ + + +/** + * ZoomDrawingMode class + * @class + * @ignore + */ +var ZoomDrawingMode = function (_DrawingMode) { + _inherits(ZoomDrawingMode, _DrawingMode); + + function ZoomDrawingMode() { + _classCallCheck(this, ZoomDrawingMode); + + return _possibleConstructorReturn(this, (ZoomDrawingMode.__proto__ || Object.getPrototypeOf(ZoomDrawingMode)).call(this, _consts.drawingModes.ZOOM)); + } + + /** + * start this drawing mode + * @param {Graphics} graphics - Graphics instance + * @override + */ + + + _createClass(ZoomDrawingMode, [{ + key: 'start', + value: function start(graphics) { + var zoom = graphics.getComponent(_consts.componentNames.ZOOM); + + zoom.start(); + } + + /** + * stop this drawing mode + * @param {Graphics} graphics - Graphics instance + * @override + */ + + }, { + key: 'end', + value: function end(graphics) { + var zoom = graphics.getComponent(_consts.componentNames.ZOOM); + + zoom.end(); + } + }]); + + return ZoomDrawingMode; +}(_drawingMode2.default); + +exports.default = ZoomDrawingMode; + +/***/ }), + /***/ "./src/js/extension/arrowLine.js": /*!***************************************!*\ !*** ./src/js/extension/arrowLine.js ***! @@ -11410,6 +12428,10 @@ var _shape = __webpack_require__(/*! @/component/shape */ "./src/js/component/sh var _shape2 = _interopRequireDefault(_shape); +var _zoom = __webpack_require__(/*! @/component/zoom */ "./src/js/component/zoom.js"); + +var _zoom2 = _interopRequireDefault(_zoom); + var _cropper3 = __webpack_require__(/*! @/drawingMode/cropper */ "./src/js/drawingMode/cropper.js"); var _cropper4 = _interopRequireDefault(_cropper3); @@ -11434,6 +12456,10 @@ var _icon3 = __webpack_require__(/*! @/drawingMode/icon */ "./src/js/drawingMode var _icon4 = _interopRequireDefault(_icon3); +var _zoom3 = __webpack_require__(/*! @/drawingMode/zoom */ "./src/js/drawingMode/zoom.js"); + +var _zoom4 = _interopRequireDefault(_zoom3); + var _selectionModifyHelper = __webpack_require__(/*! @/helper/selectionModifyHelper */ "./src/js/helper/selectionModifyHelper.js"); var _util = __webpack_require__(/*! @/util */ "./src/js/util.js"); @@ -11926,6 +12952,108 @@ var Graphics = function () { this._drawingMode = _consts.drawingModes.NORMAL; } + /** + * Change zoom of canvas + * @param {{x: number, y: number}} center - center of zoom + * @param {number} zoomLevel - zoom level + */ + + }, { + key: 'zoom', + value: function zoom(_ref2, zoomLevel) { + var x = _ref2.x, + y = _ref2.y; + + var zoom = this.getComponent(_consts.componentNames.ZOOM); + + zoom.zoom({ x: x, y: y }, zoomLevel); + } + + /** + * Get zoom mode + * @returns {string} + */ + + }, { + key: 'getZoomMode', + value: function getZoomMode() { + var zoom = this.getComponent(_consts.componentNames.ZOOM); + + return zoom.mode; + } + + /** + * Start zoom-in mode + */ + + }, { + key: 'startZoomInMode', + value: function startZoomInMode() { + var zoom = this.getComponent(_consts.componentNames.ZOOM); + + zoom.startZoomInMode(); + } + + /** + * Stop zoom-in mode + */ + + }, { + key: 'endZoomInMode', + value: function endZoomInMode() { + var zoom = this.getComponent(_consts.componentNames.ZOOM); + + zoom.endZoomInMode(); + } + + /** + * Zoom out one step + */ + + }, { + key: 'zoomOut', + value: function zoomOut() { + var zoom = this.getComponent(_consts.componentNames.ZOOM); + + zoom.zoomOut(); + } + + /** + * Start hand mode + */ + + }, { + key: 'startHandMode', + value: function startHandMode() { + var zoom = this.getComponent(_consts.componentNames.ZOOM); + + zoom.startHandMode(); + } + + /** + * Stop hand mode + */ + + }, { + key: 'endHandMode', + value: function endHandMode() { + var zoom = this.getComponent(_consts.componentNames.ZOOM); + + zoom.endHandMode(); + } + + /** + * Zoom reset + */ + + }, { + key: 'resetZoom', + value: function resetZoom() { + var zoom = this.getComponent(_consts.componentNames.ZOOM); + + zoom.resetZoom(); + } + /** * To data url from canvas * @param {Object} options - options for toDataURL @@ -12069,7 +13197,6 @@ var Graphics = function () { /** * Get fabric.Canvas instance * @returns {fabric.Canvas} - * @private */ }, { @@ -12490,6 +13617,7 @@ var Graphics = function () { this._register(this._drawingModeMap, new _shape4.default()); this._register(this._drawingModeMap, new _text4.default()); this._register(this._drawingModeMap, new _icon4.default()); + this._register(this._drawingModeMap, new _zoom4.default()); } /** @@ -12510,6 +13638,7 @@ var Graphics = function () { this._register(this._componentMap, new _icon2.default(this)); this._register(this._componentMap, new _filter2.default(this)); this._register(this._componentMap, new _shape2.default(this)); + this._register(this._componentMap, new _zoom2.default(this)); } /** @@ -15637,7 +16766,9 @@ var ImageEditor = function () { REDO_STACK_CHANGED = _consts.eventNames.REDO_STACK_CHANGED, EXECUTE_COMMAND = _consts.eventNames.EXECUTE_COMMAND, AFTER_UNDO = _consts.eventNames.AFTER_UNDO, - AFTER_REDO = _consts.eventNames.AFTER_REDO; + AFTER_REDO = _consts.eventNames.AFTER_REDO, + HAND_STARTED = _consts.eventNames.HAND_STARTED, + HAND_STOPPED = _consts.eventNames.HAND_STOPPED; /** * Undo stack changed event @@ -15662,6 +16793,8 @@ var ImageEditor = function () { this._invoker.on(REDO_STACK_CHANGED, this.fire.bind(this, REDO_STACK_CHANGED)); if (this.ui) { + var canvas = this._graphics.getCanvas(); + this._invoker.on(EXECUTE_COMMAND, function (command) { return _this.ui.fire(EXECUTE_COMMAND, command); }); @@ -15671,6 +16804,13 @@ var ImageEditor = function () { this._invoker.on(AFTER_REDO, function (command) { return _this.ui.fire(AFTER_REDO, command); }); + + canvas.on(HAND_STARTED, function () { + return _this.ui.fire(HAND_STARTED); + }); + canvas.on(HAND_STOPPED, function () { + return _this.ui.fire(HAND_STOPPED); + }); } } @@ -16118,6 +17258,33 @@ var ImageEditor = function () { return promise; } + /** + * Zoom + * @param {number} x - x axis of center point for zoom + * @param {number} y - y axis of center point for zoom + * @param {number} zoomLevel - level of zoom(1.0 ~ 5.0) + */ + + }, { + key: 'zoom', + value: function zoom(_ref2) { + var x = _ref2.x, + y = _ref2.y, + zoomLevel = _ref2.zoomLevel; + + this._graphics.zoom({ x: x, y: y }, zoomLevel); + } + + /** + * Reset zoom. Change zoom level to 1.0 + */ + + }, { + key: 'resetZoom', + value: function resetZoom() { + this._graphics.resetZoom(); + } + /** * Load image from file * @param {File} imgFile - Image file @@ -17804,8 +18971,8 @@ var DrawingMode = function () { */ }, { - key: 'stop', - value: function stop() { + key: 'end', + value: function end() { throw new Error(createMessage(errorTypes.UN_IMPLEMENTATION, 'stop')); } }]); @@ -18781,10 +19948,17 @@ var SUB_UI_COMPONENT = { var CustomEvents = _tuiCodeSnippet2.default.CustomEvents; + var BI_EXPRESSION_MINSIZE_WHEN_TOP_POSITION = '1300'; var HISTORY_MENU = 'history'; var HISTORY_PANEL_CLASS_NAME = 'tie-panel-history'; +var CLASS_NAME_ON = 'on'; +var ZOOM_BUTTON_TYPE = { + ZOOM_IN: 'zoomIn', + HAND: 'hand' +}; + /** * Default UI Class * @class @@ -18827,6 +20001,7 @@ var Ui = function () { this._makeSubMenu(); this._attachHistoryEvent(); + this._attachZoomEvent(); } /** @@ -18933,6 +20108,50 @@ var Ui = function () { } } + /** + * Toggle zoom button status + * @param {string} type - type of zoom button + */ + + }, { + key: 'toggleZoomButtonStatus', + value: function toggleZoomButtonStatus(type) { + var targetClassList = this._buttonElements[type].classList; + + targetClassList.toggle(CLASS_NAME_ON); + + if (type === ZOOM_BUTTON_TYPE.ZOOM_IN) { + this._buttonElements[ZOOM_BUTTON_TYPE.HAND].classList.remove(CLASS_NAME_ON); + } else { + this._buttonElements[ZOOM_BUTTON_TYPE.ZOOM_IN].classList.remove(CLASS_NAME_ON); + } + } + + /** + * Turn off zoom-in button status + */ + + }, { + key: 'offZoomInButtonStatus', + value: function offZoomInButtonStatus() { + var zoomInClassList = this._buttonElements[ZOOM_BUTTON_TYPE.ZOOM_IN].classList; + + zoomInClassList.remove(CLASS_NAME_ON); + } + + /** + * Change hand button status + * @param {boolean} enabled - status to change + */ + + }, { + key: 'changeHandButtonStatus', + value: function changeHandButtonStatus(enabled) { + var handClassList = this._buttonElements[ZOOM_BUTTON_TYPE.HAND].classList; + + handClassList[enabled ? 'add' : 'remove'](CLASS_NAME_ON); + } + /** * Change help button status * @param {string} buttonType - target button type @@ -19042,6 +20261,25 @@ var Ui = function () { this.on(_consts.eventNames.AFTER_REDO, this._selectNextHistory.bind(this)); } + /** + * Attach zoom event + * @private + */ + + }, { + key: '_attachZoomEvent', + value: function _attachZoomEvent() { + var _this2 = this; + + this.on(_consts.eventNames.HAND_STARTED, function () { + _this2.offZoomInButtonStatus(); + _this2.changeHandButtonStatus(true); + }); + this.on(_consts.eventNames.HAND_STOPPED, function () { + return _this2.changeHandButtonStatus(false); + }); + } + /** * Make primary ui dom element * @param {string|HTMLElement} element - Wrapper's element or selector @@ -19099,6 +20337,23 @@ var Ui = function () { locale: this._locale, makeSvgIcon: this.theme.makeMenSvgIconSet.bind(this.theme) }); + + this._activateZoomMenus(); + } + + /** + * Activate help menus for zoom. + * @private + */ + + }, { + key: '_activateZoomMenus', + value: function _activateZoomMenus() { + var _this3 = this; + + _tuiCodeSnippet2.default.forEach(_consts.ZOOM_HELP_MENUS, function (menu) { + _this3.changeHelpButtonEnabled(menu, true); + }); } /** @@ -19110,7 +20365,7 @@ var Ui = function () { }, { key: '_makeHelpMenuWithPartition', value: function _makeHelpMenuWithPartition() { - return [].concat(_consts.COMMAND_HELP_MENUS, [''], _consts.DELETE_HELP_MENUS); + return [].concat(_consts.ZOOM_HELP_MENUS, [''], _consts.COMMAND_HELP_MENUS, [''], _consts.DELETE_HELP_MENUS); } /** @@ -19121,17 +20376,17 @@ var Ui = function () { }, { key: '_addHelpMenus', value: function _addHelpMenus() { - var _this2 = this; + var _this4 = this; var helpMenuWithPartition = this._makeHelpMenuWithPartition(); _tuiCodeSnippet2.default.forEach(helpMenuWithPartition, function (menuName) { if (!menuName) { - _this2._makeMenuPartitionElement(); + _this4._makeMenuPartitionElement(); } else { - _this2._makeMenuElement(menuName, ['normal', 'disabled', 'hover'], 'help'); + _this4._makeMenuElement(menuName, ['normal', 'disabled', 'hover'], 'help'); - _this2._buttonElements[menuName] = _this2._helpMenuBarElement.querySelector('.tie-btn-' + menuName); + _this4._buttonElements[menuName] = _this4._helpMenuBarElement.querySelector('.tie-btn-' + menuName); } }); } @@ -19189,13 +20444,13 @@ var Ui = function () { }, { key: '_addHelpActionEvent', value: function _addHelpActionEvent() { - var _this3 = this; + var _this5 = this; _tuiCodeSnippet2.default.forEach(_consts.HELP_MENUS, function (helpName) { - _this3.eventHandler[helpName] = function (event) { - return _this3._actions.main[helpName](event); + _this5.eventHandler[helpName] = function (event) { + return _this5._actions.main[helpName](event); }; - _this3._buttonElements[helpName].addEventListener('click', _this3.eventHandler[helpName]); + _this5._buttonElements[helpName].addEventListener('click', _this5.eventHandler[helpName]); }); } @@ -19207,10 +20462,10 @@ var Ui = function () { }, { key: '_removeHelpActionEvent', value: function _removeHelpActionEvent() { - var _this4 = this; + var _this6 = this; _tuiCodeSnippet2.default.forEach(_consts.HELP_MENUS, function (helpName) { - _this4._buttonElements[helpName].removeEventListener('click', _this4.eventHandler[helpName]); + _this6._buttonElements[helpName].removeEventListener('click', _this6.eventHandler[helpName]); }); } @@ -19313,22 +20568,22 @@ var Ui = function () { }, { key: '_addDownloadEvent', value: function _addDownloadEvent() { - var _this5 = this; + var _this7 = this; this.eventHandler.download = function () { - return _this5._actions.main.download(); + return _this7._actions.main.download(); }; _tuiCodeSnippet2.default.forEach(this._buttonElements.download, function (element) { - element.addEventListener('click', _this5.eventHandler.download); + element.addEventListener('click', _this7.eventHandler.download); }); } }, { key: '_removeDownloadEvent', value: function _removeDownloadEvent() { - var _this6 = this; + var _this8 = this; _tuiCodeSnippet2.default.forEach(this._buttonElements.download, function (element) { - element.removeEventListener('click', _this6.eventHandler.download); + element.removeEventListener('click', _this8.eventHandler.download); }); } @@ -19340,14 +20595,14 @@ var Ui = function () { }, { key: '_addLoadEvent', value: function _addLoadEvent() { - var _this7 = this; + var _this9 = this; this.eventHandler.loadImage = function (event) { - return _this7._actions.main.load(event.target.files[0]); + return _this9._actions.main.load(event.target.files[0]); }; _tuiCodeSnippet2.default.forEach(this._buttonElements.load, function (element) { - element.addEventListener('change', _this7.eventHandler.loadImage); + element.addEventListener('change', _this9.eventHandler.loadImage); }); } @@ -19359,10 +20614,10 @@ var Ui = function () { }, { key: '_removeLoadEvent', value: function _removeLoadEvent() { - var _this8 = this; + var _this10 = this; _tuiCodeSnippet2.default.forEach(this._buttonElements.load, function (element) { - element.removeEventListener('change', _this8.eventHandler.loadImage); + element.removeEventListener('change', _this10.eventHandler.loadImage); }); } @@ -19375,10 +20630,10 @@ var Ui = function () { }, { key: '_addMainMenuEvent', value: function _addMainMenuEvent(menuName) { - var _this9 = this; + var _this11 = this; this.eventHandler[menuName] = function () { - return _this9.changeMenu(menuName); + return _this11.changeMenu(menuName); }; this._buttonElements[menuName].addEventListener('click', this.eventHandler[menuName]); } @@ -19403,11 +20658,11 @@ var Ui = function () { }, { key: '_addMenuEvent', value: function _addMenuEvent() { - var _this10 = this; + var _this12 = this; _tuiCodeSnippet2.default.forEach(this.options.menu, function (menuName) { - _this10._addMainMenuEvent(menuName); - _this10._addSubMenuEvent(menuName); + _this12._addMainMenuEvent(menuName); + _this12._addSubMenuEvent(menuName); }); } @@ -19419,10 +20674,10 @@ var Ui = function () { }, { key: '_removeMainMenuEvent', value: function _removeMainMenuEvent() { - var _this11 = this; + var _this13 = this; _tuiCodeSnippet2.default.forEach(this.options.menu, function (menuName) { - _this11._buttonElements[menuName].removeEventListener('click', _this11.eventHandler[menuName]); + _this13._buttonElements[menuName].removeEventListener('click', _this13.eventHandler[menuName]); }); } @@ -19481,10 +20736,10 @@ var Ui = function () { }, { key: '_destroyAllMenu', value: function _destroyAllMenu() { - var _this12 = this; + var _this14 = this; _tuiCodeSnippet2.default.forEach(this.options.menu, function (menuName) { - _this12[menuName].destroy(); + _this14[menuName].destroy(); }); this._historyMenu.destroy(); @@ -19498,12 +20753,12 @@ var Ui = function () { }, { key: 'initCanvas', value: function initCanvas() { - var _this13 = this; + var _this15 = this; var loadImageInfo = this._getLoadImage(); if (loadImageInfo.path) { this._actions.main.initLoadImage(loadImageInfo.path, loadImageInfo.name).then(function () { - _this13.activeMenuEvent(); + _this15.activeMenuEvent(); }); } @@ -20862,9 +22117,9 @@ function _possibleConstructorReturn(self, call) { if (!self) { throw new Referen function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } -var HISTORY_ITEM_CLASS_NAME = 'history-item'; -var SELECTED_ITEM_CLASS_NAME = 'selected-item'; -var DISABLED_ITEM_CLASS_NAME = 'disabled-item'; +var historyClassName = 'history-item'; +var selectedClassName = 'selected-item'; +var disabledClassName = 'disabled-item'; /** * History ui class @@ -21011,13 +22266,13 @@ var History = function (_Panel) { value: function _clickHistoryItem(event) { var target = event.target; - var item = target.closest('.' + HISTORY_ITEM_CLASS_NAME); + var item = target.closest('.' + historyClassName); if (!item) { return; } - var index = parseInt(item.getAttribute('data-index'), 10); + var index = Number.parseInt(item.getAttribute('data-index'), 10); if (index !== this._historyIndex) { var count = Math.abs(index - this._historyIndex); @@ -21039,13 +22294,13 @@ var History = function (_Panel) { key: '_selectItem', value: function _selectItem(index) { for (var i = 0; i < this.getListLength(); i += 1) { - this.removeClass(i, SELECTED_ITEM_CLASS_NAME); - this.removeClass(i, DISABLED_ITEM_CLASS_NAME); + this.removeClass(i, selectedClassName); + this.removeClass(i, disabledClassName); if (i > index) { - this.addClass(i, DISABLED_ITEM_CLASS_NAME); + this.addClass(i, disabledClassName); } } - this.addClass(index, SELECTED_ITEM_CLASS_NAME); + this.addClass(index, selectedClassName); } /** @@ -24560,11 +25815,10 @@ exports.Promise = _promise2.default; */ function clamp(value, minValue, maxValue) { - var temp = void 0; if (minValue > maxValue) { - temp = minValue; - minValue = maxValue; - maxValue = temp; + var _ref = [maxValue, minValue]; + minValue = _ref[0]; + maxValue = _ref[1]; } return max(minValue, min(value, maxValue)); @@ -24936,10 +26190,10 @@ function getObjectType(type) { * @returns {string} type of filter (ex: sepia, blur, ...) */ function getFilterType(type) { - var _ref = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}, - _ref$useAlpha = _ref.useAlpha, - useAlpha = _ref$useAlpha === undefined ? true : _ref$useAlpha, - mode = _ref.mode; + var _ref2 = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}, + _ref2$useAlpha = _ref2.useAlpha, + useAlpha = _ref2$useAlpha === undefined ? true : _ref2$useAlpha, + mode = _ref2.mode; var VINTAGE = _consts.filterType.VINTAGE, REMOVE_COLOR = _consts.filterType.REMOVE_COLOR, @@ -25113,7 +26367,7 @@ function isEmptyCropzone(cropRect) { /*! no static exports found */ /***/ (function(module, exports) { -module.exports = "" +module.exports = "" /***/ }), diff --git a/apps/image-editor/dist/tui-image-editor.js.map b/apps/image-editor/dist/tui-image-editor.js.map index 440dc665e..69983ab0c 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/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/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","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","_commonAction","changeColor","color","changeIconColor","addIcon","iconType","iconColor","startDrawingMode","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","modeChange","menu","_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","SHAPE","ADD_SHAPE","shapeComp","TEXT","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","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","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","drawingModes","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","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","tl","tr","mt","ml","mr","mb","bl","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","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","selectable","hoverCursor","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","point","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","_graphics","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","preventDefault","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","clearTimeout","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","Ui","_initializeOption","_actions","uiSize","_locale","Locale","locale","theme","Theme","eventHandler","_submenuChangeTransection","_selectedElement","_mainElement","_editorElementWrap","_editorElement","_menuBarElement","_subMenuElement","_makeUiElement","_setUiSize","_initMenuEvent","_makeSubMenu","_attachHistoryEvent","_removeUiEvent","_destroyAllMenu","cornerStyle","cornerStrokeColor","_getCanvasMaxDimension","editorElementStyle","menuBarPosition","_setEditorPosition","selectElementClassList","offsetWidth","buttonType","enableStatus","buttonClassList","_buttonElements","menuIconPath","initMenu","elementDimension","menuName","SubComponentClass","$0","_makeMenuElement","makeSvgIcon","makeMenSvgIconSet","_addHistory","_selectPrevHistory","_selectNextHistory","selector","biImage","getStyle","loadButtonStyle","downloadButtonStyle","commonStyle","headerStyle","submenuStyle","_helpMenuBarElement","querySelectorAll","_addHelpMenus","_historyMenu","History","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","HISTORY_ITEM_CLASS_NAME","SELECTED_ITEM_CLASS_NAME","DISABLED_ITEM_CLASS_NAME","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","temp","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,iCAA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AAoC;AACvD,wBAAwB,mBAAO,CAAC,sGAAkC;AAClE,mCAAmC,mBAAO,CAAC,gIAA+C;;AAE1F;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA,yDAAyD,gBAAgB;AACzE;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,GAAG;AACH;;AAEA;AACA;AACA;;;;;;;;;;;;;AC1Ca;AACb,qBAAqB,mBAAO,CAAC,8GAAsC;AACnE,kCAAkC,mBAAO,CAAC,4HAA6C;AACvF,UAAU,mBAAO,CAAC,sEAAkB;AACpC,sBAAsB,mBAAO,CAAC,kGAAgC;AAC9D,cAAc,mBAAO,CAAC,8EAAsB;;AAE5C;AACA;;AAEA,8BAA8B,aAAa;;AAE3C;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;;;;;;;;;;;ACpCA;;;;;;;;;;;;ACAA,aAAa,mBAAO,CAAC,4EAAqB;AAC1C,+BAA+B,mBAAO,CAAC,oIAAiD;AACxF,cAAc,mBAAO,CAAC,sFAA0B;AAChD,gBAAgB,mBAAO,CAAC,wEAAmB;AAC3C,aAAa,mBAAO,CAAC,0FAA4B;;AAEjD;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA,+CAA+C,sBAAsB;AACrE;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,cAAc;AACd;AACA;AACA;AACA;AACA,GAA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BAAO,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;AACA;AACA;;AAEA;AACA;AACA;AACA;;;;;;;;;;;;ACpGA,gBAAgB,mBAAO,CAAC,oFAAyB;;AAEjD;AACA;;AAEA;AACA;AACA,4DAA4D;AAC5D;AACA;AACA;AACA;;;;;;;;;;;;ACXA;AACA,oBAAoB,mBAAO,CAAC,4FAA6B;AACzD,6BAA6B,mBAAO,CAAC,gHAAuC;;AAE5E;AACA;AACA;;;;;;;;;;;;ACNA;AACA;;AAEA;AACA;AACA;AACA;AACA;;;;;;;;;;;;ACPA,gBAAgB,mBAAO,CAAC,oFAAyB;;AAEjD;;AAEA;AACA;AACA;AACA,uEAAuE;AACvE;;;;;;;;;;;;ACRA,6BAA6B,mBAAO,CAAC,gHAAuC;;AAE5E;AACA;AACA;AACA;AACA;;;;;;;;;;;;ACNA,eAAe,mBAAO,CAAC,kFAAwB;;AAE/C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;ACbA,sBAAsB,mBAAO,CAAC,kGAAgC;;AAE9D;AACA;;AAEA;;AAEA;;;;;;;;;;;;ACPA;AACA;;AAEA;AACA;AACA;;;;;;;;;;;;ACLA,oBAAoB,mBAAO,CAAC,0FAA4B;;AAExD;AACA;AACA;AACA;AACA;;;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AAqB,mBAAO,CAAC,8FAA8B;AAC3D,uBAAuB,mBAAO,CAAC,oGAAiC;AAChE,iCAAiC,mBAAO,CAAC,4GAAqC;AAC9E,cAAc,mBAAO,CAAC,8EAAsB;AAC5C,0BAA0B,mBAAO,CAAC,4FAA6B;AAC/D,eAAe,mBAAO,CAAC,kFAAwB;AAC/C,sBAAsB,mBAAO,CAAC,kGAAgC;AAC9D,iBAAiB,mBAAO,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;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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 } 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\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 },\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 return {\n modeChange: (menu) => {\n switch (menu) {\n case 'text':\n this._changeActivateMode('TEXT');\n break;\n case 'crop':\n this.startDrawingMode('CROPPER');\n break;\n case 'shape':\n this._changeActivateMode('SHAPE');\n this.setDrawingShape(this.ui.shape.type, this.ui.shape.options);\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 Constants\n */\nimport { keyMirror } from '@/util';\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 = [...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);\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};\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);\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};\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 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 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 {\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 * 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 * @private\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 }\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 }\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 } = 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 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 }\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 * 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 stop() {\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 { COMMAND_HELP_MENUS, DELETE_HELP_MENUS, eventNames, HELP_MENUS } 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;\nconst BI_EXPRESSION_MINSIZE_WHEN_TOP_POSITION = '1300';\nconst HISTORY_MENU = 'history';\nconst HISTORY_PANEL_CLASS_NAME = 'tie-panel-history';\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 }\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 * 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 * 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\n /**\n * make array for help menu output, including partitions.\n * @returns {Array}\n * @private\n */\n _makeHelpMenuWithPartition() {\n return [...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 HISTORY_ITEM_CLASS_NAME = 'history-item';\nconst SELECTED_ITEM_CLASS_NAME = 'selected-item';\nconst DISABLED_ITEM_CLASS_NAME = '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(`.${HISTORY_ITEM_CLASS_NAME}`);\n\n if (!item) {\n return;\n }\n\n const index = 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, SELECTED_ITEM_CLASS_NAME);\n this.removeClass(i, DISABLED_ITEM_CLASS_NAME);\n if (i > index) {\n this.addClass(i, DISABLED_ITEM_CLASS_NAME);\n }\n }\n this.addClass(index, SELECTED_ITEM_CLASS_NAME);\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 let temp;\n if (minValue > maxValue) {\n temp = minValue;\n minValue = maxValue;\n maxValue = temp;\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","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,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,iCAAiC,eAAe;QAChD;QACA;QACA;;QAEA;QACA,sDAAsD,+DAA+D;;QAErH;QACA;;;QAGA;QAC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;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;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;ACvBA,WAAW,m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AAO,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;AACA;AACA;;AAEA;AACA;AACA;AACA;;;;;;;;;;;;ACpGA,gBAAgB,mBAAO,CAAC,oFAAy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A,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,CAAC,4HAA6C;AACvF,0BAA0B,mBAAO,CAAC,4FAA6B;;AAE/D;AACA;;AAEA;AACA;A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AED;;;;;AAKO,SAASrC,sBAAT,CAAgCn7D,QAAhC,EAA0C;AAC/C,MAAIA,aAAa,KAAjB,EAAwB;AACtB,WAAO,QAAP;AACD;AACD,MAAIA,aAAa,MAAjB,EAAyB;AACvB,WAAO,OAAP;AACD;AACD,MAAIA,aAAa,OAAjB,EAA0B;AACxB,WAAO,MAAP;AACD;;AAED,SAAO,KAAP;AACD;;AAED;;;;;AAKA,SAASs9D,gBAAT,CAA0B13B,GAA1B,EAA+B;AAC7B,SAAOA,IAAIkQ,OAAJ,CAAY,OAAZ,EAAqB,UAAC2nB,KAAD;AAAA,WAAWA,MAAMpvD,WAAN,EAAX;AAAA,GAArB,CAAP;AACD;;AAED;;;;;;;;;AASO,SAAS+sD,eAAT,CAAyBh+D,QAAzB,EAAmC;AAAA,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,MAEhC6mB,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,SAAOpqB,SAASiqB,IAAT,IAAiBhqB,QAAQiqB,GAAzB,IAAgC/mB,UAAUgnB,KAA1C,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 diff --git a/apps/image-editor/dist/tui-image-editor.min.css b/apps/image-editor/dist/tui-image-editor.min.css index 96e54951b..e18ef4059 100644 --- a/apps/image-editor/dist/tui-image-editor.min.css +++ b/apps/image-editor/dist/tui-image-editor.min.css @@ -1,7 +1,7 @@ /*! * tui-image-editor.min.js - * @version 3.13.0 + * @version 3.14.0 * @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{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{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:340px;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:340px;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:340px;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:340px;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 .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 .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}.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} + */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} /*# sourceMappingURL=tui-image-editor.min.css.map */ \ No newline at end of file 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 c5cc01774..c1e84b244 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,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CACT,iBPu/BR,COt/BQ,yFACI,YPw/BZ,COv/BQ,kFACI,QAAQ,CACR,kBAAe,CACf,UAAQ,CACR,qBAAiB,CACjB,aPy/BZ,COt/BY,+LACE,qBP2/Bd,CO1/BQ,4DACI,OAAO,CACP,QAAQ,CACR,kCAAc,CACd,yBAAY,CACZ,iCAAa,CACb,iBAAU,CACV,WAAQ,CACR,SP4/BZ,CO3/BQ,0PAGI,UAAO,CACP,WP6/BZ,COz/BQ,2EACI,eAAY,CACZ,eAAa,CACb,oBP2/BZ,CO1/BQ,0EACI,YP4/BZ,CO3/BY,oLAEE,UP6/Bd,CO5/BI,0CACI,UAAO,CACP,WP8/BR,CO7/BI,gDACI,UAAO,CACP,WAAQ,CACR,QAAQ,CACR,kBAAe,CAEf,oBP+/BR,CO9/BQ,4DACI,wBAAQ,CACR,qBAAiB,CACjB,svBPggCZ,CO9/BI,sDACI,UPggCR,CO9/BI,8DACI,YPggCR,CQ7lCI,28BAUI,aRimCR,CQ7lCE,8JAEE,YR+lCJ,CQ7lCE,8JAEE,aR+lCJ,CQxlCI,uNACI,YR4lCR,CQ3lCI,uNACI,aR+lCR,CQ3lCI,kEACI,UR6lCR,CQ5lCI,2EACI,aR8lCR,CQzlCI,uGACI,iBR4lCR,CQzlCI,wSACI,aRgmCR,CQxlCI,wNACI,YR4lCR,CQnlCI,ggBAGI,aR6lCR,CQ5lCA,0CAEI,SAAS,CACT,iBAAU,CACV,UAAO,CACP,WAAQ,CACR,sBAAQ,CACR,cAAQ,CACR,MAAM,CACN,KR8lCJ,CSjqCM,gGACI,gBTmqCV,CSlqCM,kGACI,YToqCV","file":"tui-image-editor.min.css","sourcesContent":["/*!\n * tui-image-editor.min.js\n * @version 3.13.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 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 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: 340px;\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: 340px;\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: 340px;\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: 340px;\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 .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.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 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 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: 340px;\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: 340px;\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: 340px;\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: 340px;\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 .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.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 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}-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: 340px;\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: 340px;\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: 340px;\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: 340px;\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 .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","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,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U,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 diff --git a/apps/image-editor/dist/tui-image-editor.min.js b/apps/image-editor/dist/tui-image-editor.min.js index 85290dc23..aa9ef27d3 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.13.0 + * @version 3.14.0 * @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.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=void 0;var i=n(1),o=t.COMMAND_HELP_MENUS=["history","undo","redo","reset"],a=t.DELETE_HELP_MENUS=["delete","deleteAll"];t.HELP_MENUS=[].concat(o,a),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"),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"},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"),t.keyCodes={Z:90,Y:89,C:67,V:86,SHIFT:16,BACKSPACE:8,DEL:46,ARROW_DOWN:40,ARROW_UP:38},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){var i=void 0;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;j(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(4),v=n(17),m=n(61),g=n(29),y=n(100),b=n(41),_=n(101),k=n(14),E=n(16),w=n(102),O=n(22),C=n(45),M=n(30),x=n(106),S=n(62),P=n(63).set,j=n(107),T=n(66),I=n(108),A=n(23),L=n(31),D=n(26),R=n(53),H=n(6),N=n(109),z=H("species"),F="Promise",B=D.get,V=D.set,U=D.getterFor(F),W=m,X=f.TypeError,Y=f.document,G=f.process,q=v("fetch"),J=A.f,K=J,Z="process"==O(G),$=!!(Y&&Y.createEvent&&f.dispatchEvent),Q="unhandledrejection",ee=R(F,function(){if(!(C(W)!==String(W))){if(66===N)return!0;if(!Z&&"function"!=typeof PromiseRejectionEvent)return!0}if(d&&!W.prototype.finally)return!0;if(51<=N&&/native code/.test(W))return!1;function e(e){e(function(){},function(){})}var t=W.resolve(1);return(t.constructor={})[z]=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(){Z?G.emit("unhandledRejection",t,n):o(Q,n,t)}),i.rejection=Z||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(){Z?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?j(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=J(S(this,W));return i.ok="function"!=typeof e||e,i.fail="function"==typeof t&&t,i.domain=Z?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=J=function(e){return e===W||e===c?new l:K(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 q&&h({global:!0,enumerable:!0,forced:!0},{fetch:function(e){return T(W,q.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=J(this);return t.reject.call(void 0,e),t.promise}}),h({target:F,stat:!0,forced:d||ee},{resolve:function(e){return T(d&&this===c?W:this,e)}}),h({target:F,stat:!0,forced:te},{all:function(e){var s=this,t=J(s),l=t.resolve,c=t.reject,n=L(function(){var i=E(s.resolve),o=[],a=0,r=1;M(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=J(n),o=i.reject,t=L(function(){var t=E(n.resolve);M(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(17),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(18),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(18),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(4),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(4);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(4),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(17),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(16),d=n(17),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"}}]),x);function x(e,t,n){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,x),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()}O.mixin(M),t.default=M},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=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)}},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),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 * @fileoverview Constants\n */\nimport { keyMirror } from '@/util';\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 = [...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);\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};\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);\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};\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 let temp;\n if (minValue > maxValue) {\n temp = minValue;\n minValue = maxValue;\n maxValue = temp;\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","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","module.exports = __WEBPACK_EXTERNAL_MODULE__5__;","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","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","/**\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 stop() {\n throw new Error(createMessage(errorTypes.UN_IMPLEMENTATION, 'stop'));\n }\n}\n\nexport default DrawingMode;\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 } = 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 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 }\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 * 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 { COMMAND_HELP_MENUS, DELETE_HELP_MENUS, eventNames, HELP_MENUS } 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;\nconst BI_EXPRESSION_MINSIZE_WHEN_TOP_POSITION = '1300';\nconst HISTORY_MENU = 'history';\nconst HISTORY_PANEL_CLASS_NAME = 'tie-panel-history';\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 }\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 * 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 * 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\n /**\n * make array for help menu output, including partitions.\n * @returns {Array}\n * @private\n */\n _makeHelpMenuWithPartition() {\n return [...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 HISTORY_ITEM_CLASS_NAME = 'history-item';\nconst SELECTED_ITEM_CLASS_NAME = 'selected-item';\nconst DISABLED_ITEM_CLASS_NAME = '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(`.${HISTORY_ITEM_CLASS_NAME}`);\n\n if (!item) {\n return;\n }\n\n const index = 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, SELECTED_ITEM_CLASS_NAME);\n this.removeClass(i, DISABLED_ITEM_CLASS_NAME);\n if (i > index) {\n this.addClass(i, DISABLED_ITEM_CLASS_NAME);\n }\n }\n this.addClass(index, SELECTED_ITEM_CLASS_NAME);\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 } 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\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 },\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 return {\n modeChange: (menu) => {\n switch (menu) {\n case 'text':\n this._changeActivateMode('TEXT');\n break;\n case 'crop':\n this.startDrawingMode('CROPPER');\n break;\n case 'shape':\n this._changeActivateMode('SHAPE');\n this.setDrawingShape(this.ui.shape.type, this.ui.shape.options);\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 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 {\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 * 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 * @private\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 }\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 }\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 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 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","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","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","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,EAAQG,QAAQ,oBAAqBA,QAAQ,UAAkB,OAAGA,QAAQ,sBAEnGJ,EAAU,IAAIA,EAAU,KAAK,GAAIA,EAAU,IAAe,YAAIC,EAAQD,EAAU,IAAQ,KAAGA,EAAa,OAAGA,EAAU,IAAe,cARtI,CASGO,OAAQ,SAASC,EAAgCC,EAAgCC,GACpF,OCTMC,EAAmB,GA4BvBC,EAAoBC,E,4kBCzBtB,WAMaC,EAAkBA,EAAlBA,gBAAkB,CAAC,SAAU,UAAW,QAMxCC,EAAqBA,EAArBA,mBAAqB,CAAC,UAAW,OAAQ,OAAQ,SAMjDC,EAAoBA,EAApBA,kBAAoB,CAAC,SAAU,aAMlBC,EAAbA,qBAAiBH,EAAoBC,EAAuBC,GAM1CE,EA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I,EAAoBmvD,EAAI,SAASjnD,EAAO0I,GAEvC,GADU,EAAPA,IAAU1I,EAAQlI,EAAoBkI,IAC/B,EAAP0I,EAAU,OAAO1I,EACpB,GAAW,EAAP0I,GAA8B,iBAAV1I,GAAsBA,GAASA,EAAMm1E,WAAY,OAAOn1E,EAChF,IAAIo1E,EAAKxuE,OAAO8C,OAAO,MAGvB,GAFA5R,EAAoBoL,EAAEkyE,GACtBxuE,OAAOgI,eAAewmE,EAAI,UAAW,CAAE76D,YAAY,EAAMva,MAAOA,IACtD,EAAP0I,GAA4B,iBAAT1I,EAAmB,IAAI,IAAIwB,KAAOxB,EAAOlI,EAAoBi9E,EAAEK,EAAI5zE,EAAK,SAASA,GAAO,OAAOxB,EAAMwB,IAAQ+N,KAAK,KAAM/N,IAC9I,OAAO4zE,GAIRt9E,EAAoB+sD,EAAI,SAASxtD,GAChC,IAAI29E,EAAS39E,GAAUA,EAAO89E,WAC7B,WAAwB,OAAO99E,EAAgB,SAC/C,WAA8B,OAAOA,GAEtC,OADAS,EAAoBi9E,EAAEC,EAAQ,IAAKA,GAC5BA,GAIRl9E,EAAoBm9E,EAAI,SAAS7oE,EAAQoiC,GAAY,OAAO5nC,OAAOuI,UAAUV,eAAeC,KAAKtC,EAAQoiC,IAGzG12C,EAAoBu9E,EAAI,QAIjBv9E,EAAoBA,EAAoBkyB,EAAI,IA9EnD,SAASlyB,EAAoBw9E,GAG5B,GAAGz9E,EAAiBy9E,GACnB,OAAOz9E,EAAiBy9E,GAAUl+E,QAGnC,IAAIC,EAASQ,EAAiBy9E,GAAY,CACzCrzE,EAAGqzE,EACHvpD,GAAG,EACH30B,QAAS,IAUV,OANAm+E,EAAQD,GAAU5mE,KAAKrX,EAAOD,QAASC,EAAQA,EAAOD,QAASU,GAG/DT,EAAO00B,GAAI,EAGJ10B,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};\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 diff --git a/dist/svg/icon-a.svg b/dist/svg/icon-a.svg deleted file mode 100644 index 7e1efb817..000000000 --- a/dist/svg/icon-a.svg +++ /dev/null @@ -1,235 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/dist/svg/icon-b.svg b/dist/svg/icon-b.svg deleted file mode 100644 index c1ea6256a..000000000 --- a/dist/svg/icon-b.svg +++ /dev/null @@ -1,224 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/dist/svg/icon-c.svg b/dist/svg/icon-c.svg deleted file mode 100644 index 8074cf08d..000000000 --- a/dist/svg/icon-c.svg +++ /dev/null @@ -1,224 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/dist/svg/icon-d.svg b/dist/svg/icon-d.svg deleted file mode 100644 index 52e6ffa30..000000000 --- a/dist/svg/icon-d.svg +++ /dev/null @@ -1,224 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/dist/tui-image-editor.css b/dist/tui-image-editor.css deleted file mode 100644 index c4cc50905..000000000 --- a/dist/tui-image-editor.css +++ /dev/null @@ -1,952 +0,0 @@ -/*! - * tui-image-editor.js - * @version 3.11.0 - * @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: 0.3px; -} -.tui-image-editor-container div, -.tui-image-editor-container ul, -.tui-image-editor-container label, -.tui-image-editor-container input, -.tui-image-editor-container li { - 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 { -/* BUTTON AND LOGO */ - min-width: 533px; - position: absolute; - background-color: #151515; - top: 0; - width: 100%; -} -.tui-image-editor-container .tui-image-editor-header-buttons, -.tui-image-editor-container .tui-image-editor-controls-buttons { - float: right; - margin: 8px; -} -.tui-image-editor-container .tui-image-editor-header-logo, -.tui-image-editor-container .tui-image-editor-controls-logo { - float: left; - width: 30%; - padding: 17px; -} -.tui-image-editor-container .tui-image-editor-controls-logo, -.tui-image-editor-container .tui-image-editor-controls-buttons { - width: 270px; - height: 100%; - display: none; -} -.tui-image-editor-container .tui-image-editor-header-buttons button, -.tui-image-editor-container .tui-image-editor-header-buttons div, -.tui-image-editor-container .tui-image-editor-controls-buttons button, -.tui-image-editor-container .tui-image-editor-controls-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: bold; - cursor: pointer; - vertical-align: middle; - letter-spacing: 0.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 { - position: absolute; - 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-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-menu > .tui-image-editor-item { - position: relative; - display: inline-block; - border-radius: 2px; - padding: 7px 8px 3px 8px; - cursor: pointer; - margin: 0 4px; -} -.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 0; - 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-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-menu > .tui-image-editor-item.active { - background-color: #fff; - transition: all 0.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 rgba(255,255,255,0.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 rgba(255,255,255,0.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,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: normal; - font-size: 11px; - margin: 0 9px 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: 0.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 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 0px; -} -.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-flip .tui-image-editor-submenu > div.tui-image-editor-menu-flip, -.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-mask .tui-image-editor-submenu > div.tui-image-editor-menu-mask, -.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-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 { - 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-flip .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-mask .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-draw .tui-image-editor-submenu, -.tui-image-editor-container .tui-image-editor-main.tui-image-editor-menu-filter .tui-image-editor-submenu { - display: table; -} -.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 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 input + label:before, -.tui-image-editor-container .tui-image-editor-checkbox > label > span: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; - border: 0; - 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: 0px; - 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,0.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-subbar .tui-image-editor-disabled, -.tui-image-editor-container .tui-image-editor-virtual-range-pointer .tui-image-editor-disabled { - backbround-color: #f00; -} -.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: normal; -} -.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: #282828; - 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.top .tui-image-editor-submenu .tui-image-editor-partition.only-left-right, -.tui-image-editor-container.bottom .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: 0px; - 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-logo { - display: table-cell; -} -.tui-image-editor-container.top .tui-image-editor-controls-buttons { - 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 .tie-icon-add-button .tui-image-editor-button { - min-width: 42px; -} -.tui-image-editor-container .svg_ic-menu, -.tui-image-editor-container .svg_ic-helpmenu { - 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 { - 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 { - display: block; -} -.tui-image-editor-container .tui-image-editor-controls .active svg:hover > use.hover { - display: none; -} -.tui-image-editor-container .tui-image-editor-controls svg > use.normal { - display: block; -} -.tui-image-editor-container .tui-image-editor-controls .active svg > use.active { - display: block; -} -.tui-image-editor-container .tui-image-editor-controls .enabled svg > use.enabled { - 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 { - display: none; -} -.tui-image-editor-container .tui-image-editor-controls .help svg > use.disabled, -.tui-image-editor-container .tui-image-editor-controls .help.enabled svg > use.normal { - display: block; -} -.tui-image-editor-container .tui-image-editor-controls .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 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='#ffffff'] + .tui-colorpicker-palette-preview, -.tui-image-editor-container .tui-colorpicker-palette-hex[value=''] + .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,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='#ffffff'] { - border: 1px solid #ccc; -} -.tui-image-editor-container .color-picker-control .tui-colorpicker-palette-button[title=''] { - 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 ul, -.tui-image-editor-container .color-picker-control .tui-colorpicker-palette-container { - width: 100%; - height: auto; -} -.tui-image-editor-container .filter-color-item .color-picker-control label { - font-color: #333; - font-weight: normal; - 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 input + label:before, -.tui-image-editor-container .filter-color-item .tui-image-editor-checkbox > 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: 0px; - border-radius: 100%; - margin: auto; - margin-bottom: 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; -} -.tui-image-editor-container .tui-image-editor-submenu svg > use.normal { - display: block; -} -.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 .tui-image-editor-button[data-icontype="icon-star"] 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-arrow-3 .tui-image-editor-button[data-icontype="icon-arrow-3"] svg > use.active, -.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 .tui-image-editor-button[data-icontype="icon-arrow"] svg > use.active { - display: block; -} -.tie-draw-line-select-button.line .tui-image-editor-button.line svg > use.normal, -.tie-draw-line-select-button.free .tui-image-editor-button.free svg > use.normal { - display: none; -} -.tie-draw-line-select-button.line .tui-image-editor-button.line svg > use.active, -.tie-draw-line-select-button.free .tui-image-editor-button.free svg > use.active { - display: block; -} -.tie-flip-button.resetFlip .tui-image-editor-button.resetFlip svg > use.normal, -.tie-flip-button.flipX .tui-image-editor-button.flipX svg > use.normal, -.tie-flip-button.flipY .tui-image-editor-button.flipY svg > use.normal { - display: none; -} -.tie-flip-button.resetFlip .tui-image-editor-button.resetFlip svg > use.active, -.tie-flip-button.flipX .tui-image-editor-button.flipX svg > use.active, -.tie-flip-button.flipY .tui-image-editor-button.flipY 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.preset.active svg > use.active, -.tie-crop-preset-button .tui-image-editor-button.preset.active svg > use.active { - display: block; -} -.tie-crop-button .tui-image-editor-button.apply.active svg > use.active, -.tie-crop-preset-button .tui-image-editor-button.apply.active svg > use.active { - display: block; -} -.tie-shape-button.rect .tui-image-editor-button.rect svg > use.normal, -.tie-shape-button.circle .tui-image-editor-button.circle svg > use.normal, -.tie-shape-button.triangle .tui-image-editor-button.triangle svg > use.normal { - display: none; -} -.tie-shape-button.rect .tui-image-editor-button.rect svg > use.active, -.tie-shape-button.circle .tui-image-editor-button.circle svg > use.active, -.tie-shape-button.triangle .tui-image-editor-button.triangle svg > use.active { - display: block; -} -.tie-text-effect-button .tui-image-editor-button.active svg > use.active { - display: block; -} -.tie-text-align-button.left .tui-image-editor-button.left svg > use.active, -.tie-text-align-button.center .tui-image-editor-button.center svg > use.active, -.tie-text-align-button.right .tui-image-editor-button.right svg > use.active { - display: block; -} -.tie-mask-image-file, -.tie-icon-image-file { - opacity: 0; - position: absolute; - width: 100%; - height: 100%; - border: 1px solid #008000; - cursor: inherit; - left: 0; - top: 0; -} -.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; -} -/*# sourceMappingURL=src/css/index.css.map */ diff --git a/dist/tui-image-editor.js b/dist/tui-image-editor.js deleted file mode 100644 index abaf7f97b..000000000 --- a/dist/tui-image-editor.js +++ /dev/null @@ -1,2336 +0,0 @@ -/*! - * tui-image-editor.js - * @version 3.11.0 - * @author NHN FE Development Lab - * @license MIT - */ -(function webpackUniversalModuleDefinition(root, factory) { - if(typeof exports === 'object' && typeof module === 'object') - module.exports = factory(require("fabric")["fabric"], require("tui-code-snippet"), require("tui-color-picker")); - else if(typeof define === 'function' && define.amd) - define(["fabric", "tui-code-snippet", "tui-color-picker"], factory); - else if(typeof exports === 'object') - exports["ImageEditor"] = factory(require("fabric")["fabric"], require("tui-code-snippet"), require("tui-color-picker")); - else - root["tui"] = root["tui"] || {}, root["tui"]["ImageEditor"] = factory(root["fabric"], (root["tui"] && root["tui"]["util"]), (root["tui"] && root["tui"]["colorPicker"])); -})(window, function(__WEBPACK_EXTERNAL_MODULE_fabric__, __WEBPACK_EXTERNAL_MODULE_tui_code_snippet__, __WEBPACK_EXTERNAL_MODULE_tui_color_picker__) { -return /******/ (function(modules) { // webpackBootstrap -/******/ // The module cache -/******/ var installedModules = {}; -/******/ -/******/ // The require function -/******/ function __webpack_require__(moduleId) { -/******/ -/******/ // Check if module is in cache -/******/ if(installedModules[moduleId]) { -/******/ return installedModules[moduleId].exports; -/******/ } -/******/ // Create a new module (and put it into the cache) -/******/ var module = installedModules[moduleId] = { -/******/ i: moduleId, -/******/ l: false, -/******/ exports: {} -/******/ }; -/******/ -/******/ // Execute the module function -/******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__); -/******/ -/******/ // Flag the module as loaded -/******/ module.l = true; -/******/ -/******/ // Return the exports of the module -/******/ return module.exports; -/******/ } -/******/ -/******/ -/******/ // expose the modules object (__webpack_modules__) -/******/ __webpack_require__.m = modules; -/******/ -/******/ // expose the module cache -/******/ __webpack_require__.c = installedModules; -/******/ -/******/ // define getter function for harmony exports -/******/ __webpack_require__.d = function(exports, name, getter) { -/******/ if(!__webpack_require__.o(exports, name)) { -/******/ Object.defineProperty(exports, name, { enumerable: true, get: getter }); -/******/ } -/******/ }; -/******/ -/******/ // define __esModule on exports -/******/ __webpack_require__.r = function(exports) { -/******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) { -/******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); -/******/ } -/******/ Object.defineProperty(exports, '__esModule', { value: true }); -/******/ }; -/******/ -/******/ // create a fake namespace object -/******/ // mode & 1: value is a module id, require it -/******/ // mode & 2: merge all properties of value into the ns -/******/ // mode & 4: return value when already ns object -/******/ // mode & 8|1: behave like require -/******/ __webpack_require__.t = function(value, mode) { -/******/ if(mode & 1) value = __webpack_require__(value); -/******/ if(mode & 8) return value; -/******/ if((mode & 4) && typeof value === 'object' && value && value.__esModule) return value; -/******/ var ns = Object.create(null); -/******/ __webpack_require__.r(ns); -/******/ Object.defineProperty(ns, 'default', { enumerable: true, value: value }); -/******/ if(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key)); -/******/ return ns; -/******/ }; -/******/ -/******/ // getDefaultExport function for compatibility with non-harmony modules -/******/ __webpack_require__.n = function(module) { -/******/ var getter = module && module.__esModule ? -/******/ function getDefault() { return module['default']; } : -/******/ function getModuleExports() { return module; }; -/******/ __webpack_require__.d(getter, 'a', getter); -/******/ return getter; -/******/ }; -/******/ -/******/ // Object.prototype.hasOwnProperty.call -/******/ __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); }; -/******/ -/******/ // __webpack_public_path__ -/******/ __webpack_require__.p = "/dist"; -/******/ -/******/ -/******/ // Load entry module and return exports -/******/ return __webpack_require__(__webpack_require__.s = "./src/index.js"); -/******/ }) -/************************************************************************/ -/******/ ({ - -/***/ "./node_modules/core-js-pure/es/promise/index.js": -/*!*******************************************************!*\ - !*** ./node_modules/core-js-pure/es/promise/index.js ***! - \*******************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -eval("__webpack_require__(/*! ../../modules/es.object.to-string */ \"./node_modules/core-js-pure/modules/es.object.to-string.js\");\n__webpack_require__(/*! ../../modules/es.string.iterator */ \"./node_modules/core-js-pure/modules/es.string.iterator.js\");\n__webpack_require__(/*! ../../modules/web.dom-collections.iterator */ \"./node_modules/core-js-pure/modules/web.dom-collections.iterator.js\");\n__webpack_require__(/*! ../../modules/es.promise */ \"./node_modules/core-js-pure/modules/es.promise.js\");\n__webpack_require__(/*! ../../modules/es.promise.all-settled */ \"./node_modules/core-js-pure/modules/es.promise.all-settled.js\");\n__webpack_require__(/*! ../../modules/es.promise.finally */ \"./node_modules/core-js-pure/modules/es.promise.finally.js\");\nvar path = __webpack_require__(/*! ../../internals/path */ \"./node_modules/core-js-pure/internals/path.js\");\n\nmodule.exports = path.Promise;\n\n\n//# sourceURL=webpack://tui.ImageEditor/./node_modules/core-js-pure/es/promise/index.js?"); - -/***/ }), - -/***/ "./node_modules/core-js-pure/features/promise/index.js": -/*!*************************************************************!*\ - !*** ./node_modules/core-js-pure/features/promise/index.js ***! - \*************************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -eval("var parent = __webpack_require__(/*! ../../es/promise */ \"./node_modules/core-js-pure/es/promise/index.js\");\n__webpack_require__(/*! ../../modules/esnext.aggregate-error */ \"./node_modules/core-js-pure/modules/esnext.aggregate-error.js\");\n// TODO: Remove from `core-js@4`\n__webpack_require__(/*! ../../modules/esnext.promise.all-settled */ \"./node_modules/core-js-pure/modules/esnext.promise.all-settled.js\");\n__webpack_require__(/*! ../../modules/esnext.promise.try */ \"./node_modules/core-js-pure/modules/esnext.promise.try.js\");\n__webpack_require__(/*! ../../modules/esnext.promise.any */ \"./node_modules/core-js-pure/modules/esnext.promise.any.js\");\n\nmodule.exports = parent;\n\n\n//# sourceURL=webpack://tui.ImageEditor/./node_modules/core-js-pure/features/promise/index.js?"); - -/***/ }), - -/***/ "./node_modules/core-js-pure/internals/a-function.js": -/*!***********************************************************!*\ - !*** ./node_modules/core-js-pure/internals/a-function.js ***! - \***********************************************************/ -/*! no static exports found */ -/***/ (function(module, exports) { - -eval("module.exports = function (it) {\n if (typeof it != 'function') {\n throw TypeError(String(it) + ' is not a function');\n } return it;\n};\n\n\n//# sourceURL=webpack://tui.ImageEditor/./node_modules/core-js-pure/internals/a-function.js?"); - -/***/ }), - -/***/ "./node_modules/core-js-pure/internals/a-possible-prototype.js": -/*!*********************************************************************!*\ - !*** ./node_modules/core-js-pure/internals/a-possible-prototype.js ***! - \*********************************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -eval("var isObject = __webpack_require__(/*! ../internals/is-object */ \"./node_modules/core-js-pure/internals/is-object.js\");\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\n\n//# sourceURL=webpack://tui.ImageEditor/./node_modules/core-js-pure/internals/a-possible-prototype.js?"); - -/***/ }), - -/***/ "./node_modules/core-js-pure/internals/add-to-unscopables.js": -/*!*******************************************************************!*\ - !*** ./node_modules/core-js-pure/internals/add-to-unscopables.js ***! - \*******************************************************************/ -/*! no static exports found */ -/***/ (function(module, exports) { - -eval("module.exports = function () { /* empty */ };\n\n\n//# sourceURL=webpack://tui.ImageEditor/./node_modules/core-js-pure/internals/add-to-unscopables.js?"); - -/***/ }), - -/***/ "./node_modules/core-js-pure/internals/an-instance.js": -/*!************************************************************!*\ - !*** ./node_modules/core-js-pure/internals/an-instance.js ***! - \************************************************************/ -/*! no static exports found */ -/***/ (function(module, exports) { - -eval("module.exports = function (it, Constructor, name) {\n if (!(it instanceof Constructor)) {\n throw TypeError('Incorrect ' + (name ? name + ' ' : '') + 'invocation');\n } return it;\n};\n\n\n//# sourceURL=webpack://tui.ImageEditor/./node_modules/core-js-pure/internals/an-instance.js?"); - -/***/ }), - -/***/ "./node_modules/core-js-pure/internals/an-object.js": -/*!**********************************************************!*\ - !*** ./node_modules/core-js-pure/internals/an-object.js ***! - \**********************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -eval("var isObject = __webpack_require__(/*! ../internals/is-object */ \"./node_modules/core-js-pure/internals/is-object.js\");\n\nmodule.exports = function (it) {\n if (!isObject(it)) {\n throw TypeError(String(it) + ' is not an object');\n } return it;\n};\n\n\n//# sourceURL=webpack://tui.ImageEditor/./node_modules/core-js-pure/internals/an-object.js?"); - -/***/ }), - -/***/ "./node_modules/core-js-pure/internals/array-includes.js": -/*!***************************************************************!*\ - !*** ./node_modules/core-js-pure/internals/array-includes.js ***! - \***************************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -eval("var toIndexedObject = __webpack_require__(/*! ../internals/to-indexed-object */ \"./node_modules/core-js-pure/internals/to-indexed-object.js\");\nvar toLength = __webpack_require__(/*! ../internals/to-length */ \"./node_modules/core-js-pure/internals/to-length.js\");\nvar toAbsoluteIndex = __webpack_require__(/*! ../internals/to-absolute-index */ \"./node_modules/core-js-pure/internals/to-absolute-index.js\");\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\n\n//# sourceURL=webpack://tui.ImageEditor/./node_modules/core-js-pure/internals/array-includes.js?"); - -/***/ }), - -/***/ "./node_modules/core-js-pure/internals/call-with-safe-iteration-closing.js": -/*!*********************************************************************************!*\ - !*** ./node_modules/core-js-pure/internals/call-with-safe-iteration-closing.js ***! - \*********************************************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -eval("var anObject = __webpack_require__(/*! ../internals/an-object */ \"./node_modules/core-js-pure/internals/an-object.js\");\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\n\n//# sourceURL=webpack://tui.ImageEditor/./node_modules/core-js-pure/internals/call-with-safe-iteration-closing.js?"); - -/***/ }), - -/***/ "./node_modules/core-js-pure/internals/check-correctness-of-iteration.js": -/*!*******************************************************************************!*\ - !*** ./node_modules/core-js-pure/internals/check-correctness-of-iteration.js ***! - \*******************************************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -eval("var wellKnownSymbol = __webpack_require__(/*! ../internals/well-known-symbol */ \"./node_modules/core-js-pure/internals/well-known-symbol.js\");\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\n\n//# sourceURL=webpack://tui.ImageEditor/./node_modules/core-js-pure/internals/check-correctness-of-iteration.js?"); - -/***/ }), - -/***/ "./node_modules/core-js-pure/internals/classof-raw.js": -/*!************************************************************!*\ - !*** ./node_modules/core-js-pure/internals/classof-raw.js ***! - \************************************************************/ -/*! no static exports found */ -/***/ (function(module, exports) { - -eval("var toString = {}.toString;\n\nmodule.exports = function (it) {\n return toString.call(it).slice(8, -1);\n};\n\n\n//# sourceURL=webpack://tui.ImageEditor/./node_modules/core-js-pure/internals/classof-raw.js?"); - -/***/ }), - -/***/ "./node_modules/core-js-pure/internals/classof.js": -/*!********************************************************!*\ - !*** ./node_modules/core-js-pure/internals/classof.js ***! - \********************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -eval("var TO_STRING_TAG_SUPPORT = __webpack_require__(/*! ../internals/to-string-tag-support */ \"./node_modules/core-js-pure/internals/to-string-tag-support.js\");\nvar classofRaw = __webpack_require__(/*! ../internals/classof-raw */ \"./node_modules/core-js-pure/internals/classof-raw.js\");\nvar wellKnownSymbol = __webpack_require__(/*! ../internals/well-known-symbol */ \"./node_modules/core-js-pure/internals/well-known-symbol.js\");\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\n//# sourceURL=webpack://tui.ImageEditor/./node_modules/core-js-pure/internals/classof.js?"); - -/***/ }), - -/***/ "./node_modules/core-js-pure/internals/correct-prototype-getter.js": -/*!*************************************************************************!*\ - !*** ./node_modules/core-js-pure/internals/correct-prototype-getter.js ***! - \*************************************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -eval("var fails = __webpack_require__(/*! ../internals/fails */ \"./node_modules/core-js-pure/internals/fails.js\");\n\nmodule.exports = !fails(function () {\n function F() { /* empty */ }\n F.prototype.constructor = null;\n return Object.getPrototypeOf(new F()) !== F.prototype;\n});\n\n\n//# sourceURL=webpack://tui.ImageEditor/./node_modules/core-js-pure/internals/correct-prototype-getter.js?"); - -/***/ }), - -/***/ "./node_modules/core-js-pure/internals/create-iterator-constructor.js": -/*!****************************************************************************!*\ - !*** ./node_modules/core-js-pure/internals/create-iterator-constructor.js ***! - \****************************************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; -eval("\nvar IteratorPrototype = __webpack_require__(/*! ../internals/iterators-core */ \"./node_modules/core-js-pure/internals/iterators-core.js\").IteratorPrototype;\nvar create = __webpack_require__(/*! ../internals/object-create */ \"./node_modules/core-js-pure/internals/object-create.js\");\nvar createPropertyDescriptor = __webpack_require__(/*! ../internals/create-property-descriptor */ \"./node_modules/core-js-pure/internals/create-property-descriptor.js\");\nvar setToStringTag = __webpack_require__(/*! ../internals/set-to-string-tag */ \"./node_modules/core-js-pure/internals/set-to-string-tag.js\");\nvar Iterators = __webpack_require__(/*! ../internals/iterators */ \"./node_modules/core-js-pure/internals/iterators.js\");\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\n\n//# sourceURL=webpack://tui.ImageEditor/./node_modules/core-js-pure/internals/create-iterator-constructor.js?"); - -/***/ }), - -/***/ "./node_modules/core-js-pure/internals/create-non-enumerable-property.js": -/*!*******************************************************************************!*\ - !*** ./node_modules/core-js-pure/internals/create-non-enumerable-property.js ***! - \*******************************************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -eval("var DESCRIPTORS = __webpack_require__(/*! ../internals/descriptors */ \"./node_modules/core-js-pure/internals/descriptors.js\");\nvar definePropertyModule = __webpack_require__(/*! ../internals/object-define-property */ \"./node_modules/core-js-pure/internals/object-define-property.js\");\nvar createPropertyDescriptor = __webpack_require__(/*! ../internals/create-property-descriptor */ \"./node_modules/core-js-pure/internals/create-property-descriptor.js\");\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\n//# sourceURL=webpack://tui.ImageEditor/./node_modules/core-js-pure/internals/create-non-enumerable-property.js?"); - -/***/ }), - -/***/ "./node_modules/core-js-pure/internals/create-property-descriptor.js": -/*!***************************************************************************!*\ - !*** ./node_modules/core-js-pure/internals/create-property-descriptor.js ***! - \***************************************************************************/ -/*! no static exports found */ -/***/ (function(module, exports) { - -eval("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\n\n//# sourceURL=webpack://tui.ImageEditor/./node_modules/core-js-pure/internals/create-property-descriptor.js?"); - -/***/ }), - -/***/ "./node_modules/core-js-pure/internals/define-iterator.js": -/*!****************************************************************!*\ - !*** ./node_modules/core-js-pure/internals/define-iterator.js ***! - \****************************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; -eval("\nvar $ = __webpack_require__(/*! ../internals/export */ \"./node_modules/core-js-pure/internals/export.js\");\nvar createIteratorConstructor = __webpack_require__(/*! ../internals/create-iterator-constructor */ \"./node_modules/core-js-pure/internals/create-iterator-constructor.js\");\nvar getPrototypeOf = __webpack_require__(/*! ../internals/object-get-prototype-of */ \"./node_modules/core-js-pure/internals/object-get-prototype-of.js\");\nvar setPrototypeOf = __webpack_require__(/*! ../internals/object-set-prototype-of */ \"./node_modules/core-js-pure/internals/object-set-prototype-of.js\");\nvar setToStringTag = __webpack_require__(/*! ../internals/set-to-string-tag */ \"./node_modules/core-js-pure/internals/set-to-string-tag.js\");\nvar createNonEnumerableProperty = __webpack_require__(/*! ../internals/create-non-enumerable-property */ \"./node_modules/core-js-pure/internals/create-non-enumerable-property.js\");\nvar redefine = __webpack_require__(/*! ../internals/redefine */ \"./node_modules/core-js-pure/internals/redefine.js\");\nvar wellKnownSymbol = __webpack_require__(/*! ../internals/well-known-symbol */ \"./node_modules/core-js-pure/internals/well-known-symbol.js\");\nvar IS_PURE = __webpack_require__(/*! ../internals/is-pure */ \"./node_modules/core-js-pure/internals/is-pure.js\");\nvar Iterators = __webpack_require__(/*! ../internals/iterators */ \"./node_modules/core-js-pure/internals/iterators.js\");\nvar IteratorsCore = __webpack_require__(/*! ../internals/iterators-core */ \"./node_modules/core-js-pure/internals/iterators-core.js\");\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\n\n//# sourceURL=webpack://tui.ImageEditor/./node_modules/core-js-pure/internals/define-iterator.js?"); - -/***/ }), - -/***/ "./node_modules/core-js-pure/internals/descriptors.js": -/*!************************************************************!*\ - !*** ./node_modules/core-js-pure/internals/descriptors.js ***! - \************************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -eval("var fails = __webpack_require__(/*! ../internals/fails */ \"./node_modules/core-js-pure/internals/fails.js\");\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\n\n//# sourceURL=webpack://tui.ImageEditor/./node_modules/core-js-pure/internals/descriptors.js?"); - -/***/ }), - -/***/ "./node_modules/core-js-pure/internals/document-create-element.js": -/*!************************************************************************!*\ - !*** ./node_modules/core-js-pure/internals/document-create-element.js ***! - \************************************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -eval("var global = __webpack_require__(/*! ../internals/global */ \"./node_modules/core-js-pure/internals/global.js\");\nvar isObject = __webpack_require__(/*! ../internals/is-object */ \"./node_modules/core-js-pure/internals/is-object.js\");\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\n\n//# sourceURL=webpack://tui.ImageEditor/./node_modules/core-js-pure/internals/document-create-element.js?"); - -/***/ }), - -/***/ "./node_modules/core-js-pure/internals/dom-iterables.js": -/*!**************************************************************!*\ - !*** ./node_modules/core-js-pure/internals/dom-iterables.js ***! - \**************************************************************/ -/*! no static exports found */ -/***/ (function(module, exports) { - -eval("// 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\n\n//# sourceURL=webpack://tui.ImageEditor/./node_modules/core-js-pure/internals/dom-iterables.js?"); - -/***/ }), - -/***/ "./node_modules/core-js-pure/internals/engine-is-ios.js": -/*!**************************************************************!*\ - !*** ./node_modules/core-js-pure/internals/engine-is-ios.js ***! - \**************************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -eval("var userAgent = __webpack_require__(/*! ../internals/engine-user-agent */ \"./node_modules/core-js-pure/internals/engine-user-agent.js\");\n\nmodule.exports = /(iphone|ipod|ipad).*applewebkit/i.test(userAgent);\n\n\n//# sourceURL=webpack://tui.ImageEditor/./node_modules/core-js-pure/internals/engine-is-ios.js?"); - -/***/ }), - -/***/ "./node_modules/core-js-pure/internals/engine-user-agent.js": -/*!******************************************************************!*\ - !*** ./node_modules/core-js-pure/internals/engine-user-agent.js ***! - \******************************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -eval("var getBuiltIn = __webpack_require__(/*! ../internals/get-built-in */ \"./node_modules/core-js-pure/internals/get-built-in.js\");\n\nmodule.exports = getBuiltIn('navigator', 'userAgent') || '';\n\n\n//# sourceURL=webpack://tui.ImageEditor/./node_modules/core-js-pure/internals/engine-user-agent.js?"); - -/***/ }), - -/***/ "./node_modules/core-js-pure/internals/engine-v8-version.js": -/*!******************************************************************!*\ - !*** ./node_modules/core-js-pure/internals/engine-v8-version.js ***! - \******************************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -eval("var global = __webpack_require__(/*! ../internals/global */ \"./node_modules/core-js-pure/internals/global.js\");\nvar userAgent = __webpack_require__(/*! ../internals/engine-user-agent */ \"./node_modules/core-js-pure/internals/engine-user-agent.js\");\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\n\n//# sourceURL=webpack://tui.ImageEditor/./node_modules/core-js-pure/internals/engine-v8-version.js?"); - -/***/ }), - -/***/ "./node_modules/core-js-pure/internals/enum-bug-keys.js": -/*!**************************************************************!*\ - !*** ./node_modules/core-js-pure/internals/enum-bug-keys.js ***! - \**************************************************************/ -/*! no static exports found */ -/***/ (function(module, exports) { - -eval("// IE8- don't enum bug keys\nmodule.exports = [\n 'constructor',\n 'hasOwnProperty',\n 'isPrototypeOf',\n 'propertyIsEnumerable',\n 'toLocaleString',\n 'toString',\n 'valueOf'\n];\n\n\n//# sourceURL=webpack://tui.ImageEditor/./node_modules/core-js-pure/internals/enum-bug-keys.js?"); - -/***/ }), - -/***/ "./node_modules/core-js-pure/internals/export.js": -/*!*******************************************************!*\ - !*** ./node_modules/core-js-pure/internals/export.js ***! - \*******************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; -eval("\nvar global = __webpack_require__(/*! ../internals/global */ \"./node_modules/core-js-pure/internals/global.js\");\nvar getOwnPropertyDescriptor = __webpack_require__(/*! ../internals/object-get-own-property-descriptor */ \"./node_modules/core-js-pure/internals/object-get-own-property-descriptor.js\").f;\nvar isForced = __webpack_require__(/*! ../internals/is-forced */ \"./node_modules/core-js-pure/internals/is-forced.js\");\nvar path = __webpack_require__(/*! ../internals/path */ \"./node_modules/core-js-pure/internals/path.js\");\nvar bind = __webpack_require__(/*! ../internals/function-bind-context */ \"./node_modules/core-js-pure/internals/function-bind-context.js\");\nvar createNonEnumerableProperty = __webpack_require__(/*! ../internals/create-non-enumerable-property */ \"./node_modules/core-js-pure/internals/create-non-enumerable-property.js\");\nvar has = __webpack_require__(/*! ../internals/has */ \"./node_modules/core-js-pure/internals/has.js\");\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\n//# sourceURL=webpack://tui.ImageEditor/./node_modules/core-js-pure/internals/export.js?"); - -/***/ }), - -/***/ "./node_modules/core-js-pure/internals/fails.js": -/*!******************************************************!*\ - !*** ./node_modules/core-js-pure/internals/fails.js ***! - \******************************************************/ -/*! no static exports found */ -/***/ (function(module, exports) { - -eval("module.exports = function (exec) {\n try {\n return !!exec();\n } catch (error) {\n return true;\n }\n};\n\n\n//# sourceURL=webpack://tui.ImageEditor/./node_modules/core-js-pure/internals/fails.js?"); - -/***/ }), - -/***/ "./node_modules/core-js-pure/internals/function-bind-context.js": -/*!**********************************************************************!*\ - !*** ./node_modules/core-js-pure/internals/function-bind-context.js ***! - \**********************************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -eval("var aFunction = __webpack_require__(/*! ../internals/a-function */ \"./node_modules/core-js-pure/internals/a-function.js\");\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\n\n//# sourceURL=webpack://tui.ImageEditor/./node_modules/core-js-pure/internals/function-bind-context.js?"); - -/***/ }), - -/***/ "./node_modules/core-js-pure/internals/get-built-in.js": -/*!*************************************************************!*\ - !*** ./node_modules/core-js-pure/internals/get-built-in.js ***! - \*************************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -eval("var path = __webpack_require__(/*! ../internals/path */ \"./node_modules/core-js-pure/internals/path.js\");\nvar global = __webpack_require__(/*! ../internals/global */ \"./node_modules/core-js-pure/internals/global.js\");\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\n\n//# sourceURL=webpack://tui.ImageEditor/./node_modules/core-js-pure/internals/get-built-in.js?"); - -/***/ }), - -/***/ "./node_modules/core-js-pure/internals/get-iterator-method.js": -/*!********************************************************************!*\ - !*** ./node_modules/core-js-pure/internals/get-iterator-method.js ***! - \********************************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -eval("var classof = __webpack_require__(/*! ../internals/classof */ \"./node_modules/core-js-pure/internals/classof.js\");\nvar Iterators = __webpack_require__(/*! ../internals/iterators */ \"./node_modules/core-js-pure/internals/iterators.js\");\nvar wellKnownSymbol = __webpack_require__(/*! ../internals/well-known-symbol */ \"./node_modules/core-js-pure/internals/well-known-symbol.js\");\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\n\n//# sourceURL=webpack://tui.ImageEditor/./node_modules/core-js-pure/internals/get-iterator-method.js?"); - -/***/ }), - -/***/ "./node_modules/core-js-pure/internals/global.js": -/*!*******************************************************!*\ - !*** ./node_modules/core-js-pure/internals/global.js ***! - \*******************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -eval("/* WEBPACK VAR INJECTION */(function(global) {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\n/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../../webpack/buildin/global.js */ \"./node_modules/webpack/buildin/global.js\")))\n\n//# sourceURL=webpack://tui.ImageEditor/./node_modules/core-js-pure/internals/global.js?"); - -/***/ }), - -/***/ "./node_modules/core-js-pure/internals/has.js": -/*!****************************************************!*\ - !*** ./node_modules/core-js-pure/internals/has.js ***! - \****************************************************/ -/*! no static exports found */ -/***/ (function(module, exports) { - -eval("var hasOwnProperty = {}.hasOwnProperty;\n\nmodule.exports = function (it, key) {\n return hasOwnProperty.call(it, key);\n};\n\n\n//# sourceURL=webpack://tui.ImageEditor/./node_modules/core-js-pure/internals/has.js?"); - -/***/ }), - -/***/ "./node_modules/core-js-pure/internals/hidden-keys.js": -/*!************************************************************!*\ - !*** ./node_modules/core-js-pure/internals/hidden-keys.js ***! - \************************************************************/ -/*! no static exports found */ -/***/ (function(module, exports) { - -eval("module.exports = {};\n\n\n//# sourceURL=webpack://tui.ImageEditor/./node_modules/core-js-pure/internals/hidden-keys.js?"); - -/***/ }), - -/***/ "./node_modules/core-js-pure/internals/host-report-errors.js": -/*!*******************************************************************!*\ - !*** ./node_modules/core-js-pure/internals/host-report-errors.js ***! - \*******************************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -eval("var global = __webpack_require__(/*! ../internals/global */ \"./node_modules/core-js-pure/internals/global.js\");\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\n\n//# sourceURL=webpack://tui.ImageEditor/./node_modules/core-js-pure/internals/host-report-errors.js?"); - -/***/ }), - -/***/ "./node_modules/core-js-pure/internals/html.js": -/*!*****************************************************!*\ - !*** ./node_modules/core-js-pure/internals/html.js ***! - \*****************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -eval("var getBuiltIn = __webpack_require__(/*! ../internals/get-built-in */ \"./node_modules/core-js-pure/internals/get-built-in.js\");\n\nmodule.exports = getBuiltIn('document', 'documentElement');\n\n\n//# sourceURL=webpack://tui.ImageEditor/./node_modules/core-js-pure/internals/html.js?"); - -/***/ }), - -/***/ "./node_modules/core-js-pure/internals/ie8-dom-define.js": -/*!***************************************************************!*\ - !*** ./node_modules/core-js-pure/internals/ie8-dom-define.js ***! - \***************************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -eval("var DESCRIPTORS = __webpack_require__(/*! ../internals/descriptors */ \"./node_modules/core-js-pure/internals/descriptors.js\");\nvar fails = __webpack_require__(/*! ../internals/fails */ \"./node_modules/core-js-pure/internals/fails.js\");\nvar createElement = __webpack_require__(/*! ../internals/document-create-element */ \"./node_modules/core-js-pure/internals/document-create-element.js\");\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\n\n//# sourceURL=webpack://tui.ImageEditor/./node_modules/core-js-pure/internals/ie8-dom-define.js?"); - -/***/ }), - -/***/ "./node_modules/core-js-pure/internals/indexed-object.js": -/*!***************************************************************!*\ - !*** ./node_modules/core-js-pure/internals/indexed-object.js ***! - \***************************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -eval("var fails = __webpack_require__(/*! ../internals/fails */ \"./node_modules/core-js-pure/internals/fails.js\");\nvar classof = __webpack_require__(/*! ../internals/classof-raw */ \"./node_modules/core-js-pure/internals/classof-raw.js\");\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\n\n//# sourceURL=webpack://tui.ImageEditor/./node_modules/core-js-pure/internals/indexed-object.js?"); - -/***/ }), - -/***/ "./node_modules/core-js-pure/internals/inspect-source.js": -/*!***************************************************************!*\ - !*** ./node_modules/core-js-pure/internals/inspect-source.js ***! - \***************************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -eval("var store = __webpack_require__(/*! ../internals/shared-store */ \"./node_modules/core-js-pure/internals/shared-store.js\");\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\n\n//# sourceURL=webpack://tui.ImageEditor/./node_modules/core-js-pure/internals/inspect-source.js?"); - -/***/ }), - -/***/ "./node_modules/core-js-pure/internals/internal-state.js": -/*!***************************************************************!*\ - !*** ./node_modules/core-js-pure/internals/internal-state.js ***! - \***************************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -eval("var NATIVE_WEAK_MAP = __webpack_require__(/*! ../internals/native-weak-map */ \"./node_modules/core-js-pure/internals/native-weak-map.js\");\nvar global = __webpack_require__(/*! ../internals/global */ \"./node_modules/core-js-pure/internals/global.js\");\nvar isObject = __webpack_require__(/*! ../internals/is-object */ \"./node_modules/core-js-pure/internals/is-object.js\");\nvar createNonEnumerableProperty = __webpack_require__(/*! ../internals/create-non-enumerable-property */ \"./node_modules/core-js-pure/internals/create-non-enumerable-property.js\");\nvar objectHas = __webpack_require__(/*! ../internals/has */ \"./node_modules/core-js-pure/internals/has.js\");\nvar sharedKey = __webpack_require__(/*! ../internals/shared-key */ \"./node_modules/core-js-pure/internals/shared-key.js\");\nvar hiddenKeys = __webpack_require__(/*! ../internals/hidden-keys */ \"./node_modules/core-js-pure/internals/hidden-keys.js\");\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\n\n//# sourceURL=webpack://tui.ImageEditor/./node_modules/core-js-pure/internals/internal-state.js?"); - -/***/ }), - -/***/ "./node_modules/core-js-pure/internals/is-array-iterator-method.js": -/*!*************************************************************************!*\ - !*** ./node_modules/core-js-pure/internals/is-array-iterator-method.js ***! - \*************************************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -eval("var wellKnownSymbol = __webpack_require__(/*! ../internals/well-known-symbol */ \"./node_modules/core-js-pure/internals/well-known-symbol.js\");\nvar Iterators = __webpack_require__(/*! ../internals/iterators */ \"./node_modules/core-js-pure/internals/iterators.js\");\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\n\n//# sourceURL=webpack://tui.ImageEditor/./node_modules/core-js-pure/internals/is-array-iterator-method.js?"); - -/***/ }), - -/***/ "./node_modules/core-js-pure/internals/is-forced.js": -/*!**********************************************************!*\ - !*** ./node_modules/core-js-pure/internals/is-forced.js ***! - \**********************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -eval("var fails = __webpack_require__(/*! ../internals/fails */ \"./node_modules/core-js-pure/internals/fails.js\");\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\n\n//# sourceURL=webpack://tui.ImageEditor/./node_modules/core-js-pure/internals/is-forced.js?"); - -/***/ }), - -/***/ "./node_modules/core-js-pure/internals/is-object.js": -/*!**********************************************************!*\ - !*** ./node_modules/core-js-pure/internals/is-object.js ***! - \**********************************************************/ -/*! no static exports found */ -/***/ (function(module, exports) { - -eval("module.exports = function (it) {\n return typeof it === 'object' ? it !== null : typeof it === 'function';\n};\n\n\n//# sourceURL=webpack://tui.ImageEditor/./node_modules/core-js-pure/internals/is-object.js?"); - -/***/ }), - -/***/ "./node_modules/core-js-pure/internals/is-pure.js": -/*!********************************************************!*\ - !*** ./node_modules/core-js-pure/internals/is-pure.js ***! - \********************************************************/ -/*! no static exports found */ -/***/ (function(module, exports) { - -eval("module.exports = true;\n\n\n//# sourceURL=webpack://tui.ImageEditor/./node_modules/core-js-pure/internals/is-pure.js?"); - -/***/ }), - -/***/ "./node_modules/core-js-pure/internals/iterate.js": -/*!********************************************************!*\ - !*** ./node_modules/core-js-pure/internals/iterate.js ***! - \********************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -eval("var anObject = __webpack_require__(/*! ../internals/an-object */ \"./node_modules/core-js-pure/internals/an-object.js\");\nvar isArrayIteratorMethod = __webpack_require__(/*! ../internals/is-array-iterator-method */ \"./node_modules/core-js-pure/internals/is-array-iterator-method.js\");\nvar toLength = __webpack_require__(/*! ../internals/to-length */ \"./node_modules/core-js-pure/internals/to-length.js\");\nvar bind = __webpack_require__(/*! ../internals/function-bind-context */ \"./node_modules/core-js-pure/internals/function-bind-context.js\");\nvar getIteratorMethod = __webpack_require__(/*! ../internals/get-iterator-method */ \"./node_modules/core-js-pure/internals/get-iterator-method.js\");\nvar callWithSafeIterationClosing = __webpack_require__(/*! ../internals/call-with-safe-iteration-closing */ \"./node_modules/core-js-pure/internals/call-with-safe-iteration-closing.js\");\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\n\n//# sourceURL=webpack://tui.ImageEditor/./node_modules/core-js-pure/internals/iterate.js?"); - -/***/ }), - -/***/ "./node_modules/core-js-pure/internals/iterators-core.js": -/*!***************************************************************!*\ - !*** ./node_modules/core-js-pure/internals/iterators-core.js ***! - \***************************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; -eval("\nvar getPrototypeOf = __webpack_require__(/*! ../internals/object-get-prototype-of */ \"./node_modules/core-js-pure/internals/object-get-prototype-of.js\");\nvar createNonEnumerableProperty = __webpack_require__(/*! ../internals/create-non-enumerable-property */ \"./node_modules/core-js-pure/internals/create-non-enumerable-property.js\");\nvar has = __webpack_require__(/*! ../internals/has */ \"./node_modules/core-js-pure/internals/has.js\");\nvar wellKnownSymbol = __webpack_require__(/*! ../internals/well-known-symbol */ \"./node_modules/core-js-pure/internals/well-known-symbol.js\");\nvar IS_PURE = __webpack_require__(/*! ../internals/is-pure */ \"./node_modules/core-js-pure/internals/is-pure.js\");\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\n\n//# sourceURL=webpack://tui.ImageEditor/./node_modules/core-js-pure/internals/iterators-core.js?"); - -/***/ }), - -/***/ "./node_modules/core-js-pure/internals/iterators.js": -/*!**********************************************************!*\ - !*** ./node_modules/core-js-pure/internals/iterators.js ***! - \**********************************************************/ -/*! no static exports found */ -/***/ (function(module, exports) { - -eval("module.exports = {};\n\n\n//# sourceURL=webpack://tui.ImageEditor/./node_modules/core-js-pure/internals/iterators.js?"); - -/***/ }), - -/***/ "./node_modules/core-js-pure/internals/microtask.js": -/*!**********************************************************!*\ - !*** ./node_modules/core-js-pure/internals/microtask.js ***! - \**********************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -eval("var global = __webpack_require__(/*! ../internals/global */ \"./node_modules/core-js-pure/internals/global.js\");\nvar getOwnPropertyDescriptor = __webpack_require__(/*! ../internals/object-get-own-property-descriptor */ \"./node_modules/core-js-pure/internals/object-get-own-property-descriptor.js\").f;\nvar classof = __webpack_require__(/*! ../internals/classof-raw */ \"./node_modules/core-js-pure/internals/classof-raw.js\");\nvar macrotask = __webpack_require__(/*! ../internals/task */ \"./node_modules/core-js-pure/internals/task.js\").set;\nvar IS_IOS = __webpack_require__(/*! ../internals/engine-is-ios */ \"./node_modules/core-js-pure/internals/engine-is-ios.js\");\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\n\n//# sourceURL=webpack://tui.ImageEditor/./node_modules/core-js-pure/internals/microtask.js?"); - -/***/ }), - -/***/ "./node_modules/core-js-pure/internals/native-promise-constructor.js": -/*!***************************************************************************!*\ - !*** ./node_modules/core-js-pure/internals/native-promise-constructor.js ***! - \***************************************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -eval("var global = __webpack_require__(/*! ../internals/global */ \"./node_modules/core-js-pure/internals/global.js\");\n\nmodule.exports = global.Promise;\n\n\n//# sourceURL=webpack://tui.ImageEditor/./node_modules/core-js-pure/internals/native-promise-constructor.js?"); - -/***/ }), - -/***/ "./node_modules/core-js-pure/internals/native-symbol.js": -/*!**************************************************************!*\ - !*** ./node_modules/core-js-pure/internals/native-symbol.js ***! - \**************************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -eval("var fails = __webpack_require__(/*! ../internals/fails */ \"./node_modules/core-js-pure/internals/fails.js\");\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\n\n//# sourceURL=webpack://tui.ImageEditor/./node_modules/core-js-pure/internals/native-symbol.js?"); - -/***/ }), - -/***/ "./node_modules/core-js-pure/internals/native-weak-map.js": -/*!****************************************************************!*\ - !*** ./node_modules/core-js-pure/internals/native-weak-map.js ***! - \****************************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -eval("var global = __webpack_require__(/*! ../internals/global */ \"./node_modules/core-js-pure/internals/global.js\");\nvar inspectSource = __webpack_require__(/*! ../internals/inspect-source */ \"./node_modules/core-js-pure/internals/inspect-source.js\");\n\nvar WeakMap = global.WeakMap;\n\nmodule.exports = typeof WeakMap === 'function' && /native code/.test(inspectSource(WeakMap));\n\n\n//# sourceURL=webpack://tui.ImageEditor/./node_modules/core-js-pure/internals/native-weak-map.js?"); - -/***/ }), - -/***/ "./node_modules/core-js-pure/internals/new-promise-capability.js": -/*!***********************************************************************!*\ - !*** ./node_modules/core-js-pure/internals/new-promise-capability.js ***! - \***********************************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; -eval("\nvar aFunction = __webpack_require__(/*! ../internals/a-function */ \"./node_modules/core-js-pure/internals/a-function.js\");\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\n\n//# sourceURL=webpack://tui.ImageEditor/./node_modules/core-js-pure/internals/new-promise-capability.js?"); - -/***/ }), - -/***/ "./node_modules/core-js-pure/internals/object-create.js": -/*!**************************************************************!*\ - !*** ./node_modules/core-js-pure/internals/object-create.js ***! - \**************************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -eval("var anObject = __webpack_require__(/*! ../internals/an-object */ \"./node_modules/core-js-pure/internals/an-object.js\");\nvar defineProperties = __webpack_require__(/*! ../internals/object-define-properties */ \"./node_modules/core-js-pure/internals/object-define-properties.js\");\nvar enumBugKeys = __webpack_require__(/*! ../internals/enum-bug-keys */ \"./node_modules/core-js-pure/internals/enum-bug-keys.js\");\nvar hiddenKeys = __webpack_require__(/*! ../internals/hidden-keys */ \"./node_modules/core-js-pure/internals/hidden-keys.js\");\nvar html = __webpack_require__(/*! ../internals/html */ \"./node_modules/core-js-pure/internals/html.js\");\nvar documentCreateElement = __webpack_require__(/*! ../internals/document-create-element */ \"./node_modules/core-js-pure/internals/document-create-element.js\");\nvar sharedKey = __webpack_require__(/*! ../internals/shared-key */ \"./node_modules/core-js-pure/internals/shared-key.js\");\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\n\n//# sourceURL=webpack://tui.ImageEditor/./node_modules/core-js-pure/internals/object-create.js?"); - -/***/ }), - -/***/ "./node_modules/core-js-pure/internals/object-define-properties.js": -/*!*************************************************************************!*\ - !*** ./node_modules/core-js-pure/internals/object-define-properties.js ***! - \*************************************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -eval("var DESCRIPTORS = __webpack_require__(/*! ../internals/descriptors */ \"./node_modules/core-js-pure/internals/descriptors.js\");\nvar definePropertyModule = __webpack_require__(/*! ../internals/object-define-property */ \"./node_modules/core-js-pure/internals/object-define-property.js\");\nvar anObject = __webpack_require__(/*! ../internals/an-object */ \"./node_modules/core-js-pure/internals/an-object.js\");\nvar objectKeys = __webpack_require__(/*! ../internals/object-keys */ \"./node_modules/core-js-pure/internals/object-keys.js\");\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\n\n//# sourceURL=webpack://tui.ImageEditor/./node_modules/core-js-pure/internals/object-define-properties.js?"); - -/***/ }), - -/***/ "./node_modules/core-js-pure/internals/object-define-property.js": -/*!***********************************************************************!*\ - !*** ./node_modules/core-js-pure/internals/object-define-property.js ***! - \***********************************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -eval("var DESCRIPTORS = __webpack_require__(/*! ../internals/descriptors */ \"./node_modules/core-js-pure/internals/descriptors.js\");\nvar IE8_DOM_DEFINE = __webpack_require__(/*! ../internals/ie8-dom-define */ \"./node_modules/core-js-pure/internals/ie8-dom-define.js\");\nvar anObject = __webpack_require__(/*! ../internals/an-object */ \"./node_modules/core-js-pure/internals/an-object.js\");\nvar toPrimitive = __webpack_require__(/*! ../internals/to-primitive */ \"./node_modules/core-js-pure/internals/to-primitive.js\");\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\n\n//# sourceURL=webpack://tui.ImageEditor/./node_modules/core-js-pure/internals/object-define-property.js?"); - -/***/ }), - -/***/ "./node_modules/core-js-pure/internals/object-get-own-property-descriptor.js": -/*!***********************************************************************************!*\ - !*** ./node_modules/core-js-pure/internals/object-get-own-property-descriptor.js ***! - \***********************************************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -eval("var DESCRIPTORS = __webpack_require__(/*! ../internals/descriptors */ \"./node_modules/core-js-pure/internals/descriptors.js\");\nvar propertyIsEnumerableModule = __webpack_require__(/*! ../internals/object-property-is-enumerable */ \"./node_modules/core-js-pure/internals/object-property-is-enumerable.js\");\nvar createPropertyDescriptor = __webpack_require__(/*! ../internals/create-property-descriptor */ \"./node_modules/core-js-pure/internals/create-property-descriptor.js\");\nvar toIndexedObject = __webpack_require__(/*! ../internals/to-indexed-object */ \"./node_modules/core-js-pure/internals/to-indexed-object.js\");\nvar toPrimitive = __webpack_require__(/*! ../internals/to-primitive */ \"./node_modules/core-js-pure/internals/to-primitive.js\");\nvar has = __webpack_require__(/*! ../internals/has */ \"./node_modules/core-js-pure/internals/has.js\");\nvar IE8_DOM_DEFINE = __webpack_require__(/*! ../internals/ie8-dom-define */ \"./node_modules/core-js-pure/internals/ie8-dom-define.js\");\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\n\n//# sourceURL=webpack://tui.ImageEditor/./node_modules/core-js-pure/internals/object-get-own-property-descriptor.js?"); - -/***/ }), - -/***/ "./node_modules/core-js-pure/internals/object-get-prototype-of.js": -/*!************************************************************************!*\ - !*** ./node_modules/core-js-pure/internals/object-get-prototype-of.js ***! - \************************************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -eval("var has = __webpack_require__(/*! ../internals/has */ \"./node_modules/core-js-pure/internals/has.js\");\nvar toObject = __webpack_require__(/*! ../internals/to-object */ \"./node_modules/core-js-pure/internals/to-object.js\");\nvar sharedKey = __webpack_require__(/*! ../internals/shared-key */ \"./node_modules/core-js-pure/internals/shared-key.js\");\nvar CORRECT_PROTOTYPE_GETTER = __webpack_require__(/*! ../internals/correct-prototype-getter */ \"./node_modules/core-js-pure/internals/correct-prototype-getter.js\");\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\n\n//# sourceURL=webpack://tui.ImageEditor/./node_modules/core-js-pure/internals/object-get-prototype-of.js?"); - -/***/ }), - -/***/ "./node_modules/core-js-pure/internals/object-keys-internal.js": -/*!*********************************************************************!*\ - !*** ./node_modules/core-js-pure/internals/object-keys-internal.js ***! - \*********************************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -eval("var has = __webpack_require__(/*! ../internals/has */ \"./node_modules/core-js-pure/internals/has.js\");\nvar toIndexedObject = __webpack_require__(/*! ../internals/to-indexed-object */ \"./node_modules/core-js-pure/internals/to-indexed-object.js\");\nvar indexOf = __webpack_require__(/*! ../internals/array-includes */ \"./node_modules/core-js-pure/internals/array-includes.js\").indexOf;\nvar hiddenKeys = __webpack_require__(/*! ../internals/hidden-keys */ \"./node_modules/core-js-pure/internals/hidden-keys.js\");\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\n\n//# sourceURL=webpack://tui.ImageEditor/./node_modules/core-js-pure/internals/object-keys-internal.js?"); - -/***/ }), - -/***/ "./node_modules/core-js-pure/internals/object-keys.js": -/*!************************************************************!*\ - !*** ./node_modules/core-js-pure/internals/object-keys.js ***! - \************************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -eval("var internalObjectKeys = __webpack_require__(/*! ../internals/object-keys-internal */ \"./node_modules/core-js-pure/internals/object-keys-internal.js\");\nvar enumBugKeys = __webpack_require__(/*! ../internals/enum-bug-keys */ \"./node_modules/core-js-pure/internals/enum-bug-keys.js\");\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\n\n//# sourceURL=webpack://tui.ImageEditor/./node_modules/core-js-pure/internals/object-keys.js?"); - -/***/ }), - -/***/ "./node_modules/core-js-pure/internals/object-property-is-enumerable.js": -/*!******************************************************************************!*\ - !*** ./node_modules/core-js-pure/internals/object-property-is-enumerable.js ***! - \******************************************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; -eval("\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\n\n//# sourceURL=webpack://tui.ImageEditor/./node_modules/core-js-pure/internals/object-property-is-enumerable.js?"); - -/***/ }), - -/***/ "./node_modules/core-js-pure/internals/object-set-prototype-of.js": -/*!************************************************************************!*\ - !*** ./node_modules/core-js-pure/internals/object-set-prototype-of.js ***! - \************************************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -eval("var anObject = __webpack_require__(/*! ../internals/an-object */ \"./node_modules/core-js-pure/internals/an-object.js\");\nvar aPossiblePrototype = __webpack_require__(/*! ../internals/a-possible-prototype */ \"./node_modules/core-js-pure/internals/a-possible-prototype.js\");\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\n\n//# sourceURL=webpack://tui.ImageEditor/./node_modules/core-js-pure/internals/object-set-prototype-of.js?"); - -/***/ }), - -/***/ "./node_modules/core-js-pure/internals/object-to-string.js": -/*!*****************************************************************!*\ - !*** ./node_modules/core-js-pure/internals/object-to-string.js ***! - \*****************************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; -eval("\nvar TO_STRING_TAG_SUPPORT = __webpack_require__(/*! ../internals/to-string-tag-support */ \"./node_modules/core-js-pure/internals/to-string-tag-support.js\");\nvar classof = __webpack_require__(/*! ../internals/classof */ \"./node_modules/core-js-pure/internals/classof.js\");\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\n\n//# sourceURL=webpack://tui.ImageEditor/./node_modules/core-js-pure/internals/object-to-string.js?"); - -/***/ }), - -/***/ "./node_modules/core-js-pure/internals/path.js": -/*!*****************************************************!*\ - !*** ./node_modules/core-js-pure/internals/path.js ***! - \*****************************************************/ -/*! no static exports found */ -/***/ (function(module, exports) { - -eval("module.exports = {};\n\n\n//# sourceURL=webpack://tui.ImageEditor/./node_modules/core-js-pure/internals/path.js?"); - -/***/ }), - -/***/ "./node_modules/core-js-pure/internals/perform.js": -/*!********************************************************!*\ - !*** ./node_modules/core-js-pure/internals/perform.js ***! - \********************************************************/ -/*! no static exports found */ -/***/ (function(module, exports) { - -eval("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\n//# sourceURL=webpack://tui.ImageEditor/./node_modules/core-js-pure/internals/perform.js?"); - -/***/ }), - -/***/ "./node_modules/core-js-pure/internals/promise-resolve.js": -/*!****************************************************************!*\ - !*** ./node_modules/core-js-pure/internals/promise-resolve.js ***! - \****************************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -eval("var anObject = __webpack_require__(/*! ../internals/an-object */ \"./node_modules/core-js-pure/internals/an-object.js\");\nvar isObject = __webpack_require__(/*! ../internals/is-object */ \"./node_modules/core-js-pure/internals/is-object.js\");\nvar newPromiseCapability = __webpack_require__(/*! ../internals/new-promise-capability */ \"./node_modules/core-js-pure/internals/new-promise-capability.js\");\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\n\n//# sourceURL=webpack://tui.ImageEditor/./node_modules/core-js-pure/internals/promise-resolve.js?"); - -/***/ }), - -/***/ "./node_modules/core-js-pure/internals/redefine-all.js": -/*!*************************************************************!*\ - !*** ./node_modules/core-js-pure/internals/redefine-all.js ***! - \*************************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -eval("var redefine = __webpack_require__(/*! ../internals/redefine */ \"./node_modules/core-js-pure/internals/redefine.js\");\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\n\n//# sourceURL=webpack://tui.ImageEditor/./node_modules/core-js-pure/internals/redefine-all.js?"); - -/***/ }), - -/***/ "./node_modules/core-js-pure/internals/redefine.js": -/*!*********************************************************!*\ - !*** ./node_modules/core-js-pure/internals/redefine.js ***! - \*********************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -eval("var createNonEnumerableProperty = __webpack_require__(/*! ../internals/create-non-enumerable-property */ \"./node_modules/core-js-pure/internals/create-non-enumerable-property.js\");\n\nmodule.exports = function (target, key, value, options) {\n if (options && options.enumerable) target[key] = value;\n else createNonEnumerableProperty(target, key, value);\n};\n\n\n//# sourceURL=webpack://tui.ImageEditor/./node_modules/core-js-pure/internals/redefine.js?"); - -/***/ }), - -/***/ "./node_modules/core-js-pure/internals/require-object-coercible.js": -/*!*************************************************************************!*\ - !*** ./node_modules/core-js-pure/internals/require-object-coercible.js ***! - \*************************************************************************/ -/*! no static exports found */ -/***/ (function(module, exports) { - -eval("// `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\n\n//# sourceURL=webpack://tui.ImageEditor/./node_modules/core-js-pure/internals/require-object-coercible.js?"); - -/***/ }), - -/***/ "./node_modules/core-js-pure/internals/set-global.js": -/*!***********************************************************!*\ - !*** ./node_modules/core-js-pure/internals/set-global.js ***! - \***********************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -eval("var global = __webpack_require__(/*! ../internals/global */ \"./node_modules/core-js-pure/internals/global.js\");\nvar createNonEnumerableProperty = __webpack_require__(/*! ../internals/create-non-enumerable-property */ \"./node_modules/core-js-pure/internals/create-non-enumerable-property.js\");\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\n\n//# sourceURL=webpack://tui.ImageEditor/./node_modules/core-js-pure/internals/set-global.js?"); - -/***/ }), - -/***/ "./node_modules/core-js-pure/internals/set-species.js": -/*!************************************************************!*\ - !*** ./node_modules/core-js-pure/internals/set-species.js ***! - \************************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; -eval("\nvar getBuiltIn = __webpack_require__(/*! ../internals/get-built-in */ \"./node_modules/core-js-pure/internals/get-built-in.js\");\nvar definePropertyModule = __webpack_require__(/*! ../internals/object-define-property */ \"./node_modules/core-js-pure/internals/object-define-property.js\");\nvar wellKnownSymbol = __webpack_require__(/*! ../internals/well-known-symbol */ \"./node_modules/core-js-pure/internals/well-known-symbol.js\");\nvar DESCRIPTORS = __webpack_require__(/*! ../internals/descriptors */ \"./node_modules/core-js-pure/internals/descriptors.js\");\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\n\n//# sourceURL=webpack://tui.ImageEditor/./node_modules/core-js-pure/internals/set-species.js?"); - -/***/ }), - -/***/ "./node_modules/core-js-pure/internals/set-to-string-tag.js": -/*!******************************************************************!*\ - !*** ./node_modules/core-js-pure/internals/set-to-string-tag.js ***! - \******************************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -eval("var TO_STRING_TAG_SUPPORT = __webpack_require__(/*! ../internals/to-string-tag-support */ \"./node_modules/core-js-pure/internals/to-string-tag-support.js\");\nvar defineProperty = __webpack_require__(/*! ../internals/object-define-property */ \"./node_modules/core-js-pure/internals/object-define-property.js\").f;\nvar createNonEnumerableProperty = __webpack_require__(/*! ../internals/create-non-enumerable-property */ \"./node_modules/core-js-pure/internals/create-non-enumerable-property.js\");\nvar has = __webpack_require__(/*! ../internals/has */ \"./node_modules/core-js-pure/internals/has.js\");\nvar toString = __webpack_require__(/*! ../internals/object-to-string */ \"./node_modules/core-js-pure/internals/object-to-string.js\");\nvar wellKnownSymbol = __webpack_require__(/*! ../internals/well-known-symbol */ \"./node_modules/core-js-pure/internals/well-known-symbol.js\");\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\n\n//# sourceURL=webpack://tui.ImageEditor/./node_modules/core-js-pure/internals/set-to-string-tag.js?"); - -/***/ }), - -/***/ "./node_modules/core-js-pure/internals/shared-key.js": -/*!***********************************************************!*\ - !*** ./node_modules/core-js-pure/internals/shared-key.js ***! - \***********************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -eval("var shared = __webpack_require__(/*! ../internals/shared */ \"./node_modules/core-js-pure/internals/shared.js\");\nvar uid = __webpack_require__(/*! ../internals/uid */ \"./node_modules/core-js-pure/internals/uid.js\");\n\nvar keys = shared('keys');\n\nmodule.exports = function (key) {\n return keys[key] || (keys[key] = uid(key));\n};\n\n\n//# sourceURL=webpack://tui.ImageEditor/./node_modules/core-js-pure/internals/shared-key.js?"); - -/***/ }), - -/***/ "./node_modules/core-js-pure/internals/shared-store.js": -/*!*************************************************************!*\ - !*** ./node_modules/core-js-pure/internals/shared-store.js ***! - \*************************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -eval("var global = __webpack_require__(/*! ../internals/global */ \"./node_modules/core-js-pure/internals/global.js\");\nvar setGlobal = __webpack_require__(/*! ../internals/set-global */ \"./node_modules/core-js-pure/internals/set-global.js\");\n\nvar SHARED = '__core-js_shared__';\nvar store = global[SHARED] || setGlobal(SHARED, {});\n\nmodule.exports = store;\n\n\n//# sourceURL=webpack://tui.ImageEditor/./node_modules/core-js-pure/internals/shared-store.js?"); - -/***/ }), - -/***/ "./node_modules/core-js-pure/internals/shared.js": -/*!*******************************************************!*\ - !*** ./node_modules/core-js-pure/internals/shared.js ***! - \*******************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -eval("var IS_PURE = __webpack_require__(/*! ../internals/is-pure */ \"./node_modules/core-js-pure/internals/is-pure.js\");\nvar store = __webpack_require__(/*! ../internals/shared-store */ \"./node_modules/core-js-pure/internals/shared-store.js\");\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\n\n//# sourceURL=webpack://tui.ImageEditor/./node_modules/core-js-pure/internals/shared.js?"); - -/***/ }), - -/***/ "./node_modules/core-js-pure/internals/species-constructor.js": -/*!********************************************************************!*\ - !*** ./node_modules/core-js-pure/internals/species-constructor.js ***! - \********************************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -eval("var anObject = __webpack_require__(/*! ../internals/an-object */ \"./node_modules/core-js-pure/internals/an-object.js\");\nvar aFunction = __webpack_require__(/*! ../internals/a-function */ \"./node_modules/core-js-pure/internals/a-function.js\");\nvar wellKnownSymbol = __webpack_require__(/*! ../internals/well-known-symbol */ \"./node_modules/core-js-pure/internals/well-known-symbol.js\");\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\n\n//# sourceURL=webpack://tui.ImageEditor/./node_modules/core-js-pure/internals/species-constructor.js?"); - -/***/ }), - -/***/ "./node_modules/core-js-pure/internals/string-multibyte.js": -/*!*****************************************************************!*\ - !*** ./node_modules/core-js-pure/internals/string-multibyte.js ***! - \*****************************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -eval("var toInteger = __webpack_require__(/*! ../internals/to-integer */ \"./node_modules/core-js-pure/internals/to-integer.js\");\nvar requireObjectCoercible = __webpack_require__(/*! ../internals/require-object-coercible */ \"./node_modules/core-js-pure/internals/require-object-coercible.js\");\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\n\n//# sourceURL=webpack://tui.ImageEditor/./node_modules/core-js-pure/internals/string-multibyte.js?"); - -/***/ }), - -/***/ "./node_modules/core-js-pure/internals/task.js": -/*!*****************************************************!*\ - !*** ./node_modules/core-js-pure/internals/task.js ***! - \*****************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -eval("var global = __webpack_require__(/*! ../internals/global */ \"./node_modules/core-js-pure/internals/global.js\");\nvar fails = __webpack_require__(/*! ../internals/fails */ \"./node_modules/core-js-pure/internals/fails.js\");\nvar classof = __webpack_require__(/*! ../internals/classof-raw */ \"./node_modules/core-js-pure/internals/classof-raw.js\");\nvar bind = __webpack_require__(/*! ../internals/function-bind-context */ \"./node_modules/core-js-pure/internals/function-bind-context.js\");\nvar html = __webpack_require__(/*! ../internals/html */ \"./node_modules/core-js-pure/internals/html.js\");\nvar createElement = __webpack_require__(/*! ../internals/document-create-element */ \"./node_modules/core-js-pure/internals/document-create-element.js\");\nvar IS_IOS = __webpack_require__(/*! ../internals/engine-is-ios */ \"./node_modules/core-js-pure/internals/engine-is-ios.js\");\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\n\n//# sourceURL=webpack://tui.ImageEditor/./node_modules/core-js-pure/internals/task.js?"); - -/***/ }), - -/***/ "./node_modules/core-js-pure/internals/to-absolute-index.js": -/*!******************************************************************!*\ - !*** ./node_modules/core-js-pure/internals/to-absolute-index.js ***! - \******************************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -eval("var toInteger = __webpack_require__(/*! ../internals/to-integer */ \"./node_modules/core-js-pure/internals/to-integer.js\");\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\n\n//# sourceURL=webpack://tui.ImageEditor/./node_modules/core-js-pure/internals/to-absolute-index.js?"); - -/***/ }), - -/***/ "./node_modules/core-js-pure/internals/to-indexed-object.js": -/*!******************************************************************!*\ - !*** ./node_modules/core-js-pure/internals/to-indexed-object.js ***! - \******************************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -eval("// toObject with fallback for non-array-like ES3 strings\nvar IndexedObject = __webpack_require__(/*! ../internals/indexed-object */ \"./node_modules/core-js-pure/internals/indexed-object.js\");\nvar requireObjectCoercible = __webpack_require__(/*! ../internals/require-object-coercible */ \"./node_modules/core-js-pure/internals/require-object-coercible.js\");\n\nmodule.exports = function (it) {\n return IndexedObject(requireObjectCoercible(it));\n};\n\n\n//# sourceURL=webpack://tui.ImageEditor/./node_modules/core-js-pure/internals/to-indexed-object.js?"); - -/***/ }), - -/***/ "./node_modules/core-js-pure/internals/to-integer.js": -/*!***********************************************************!*\ - !*** ./node_modules/core-js-pure/internals/to-integer.js ***! - \***********************************************************/ -/*! no static exports found */ -/***/ (function(module, exports) { - -eval("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\n\n//# sourceURL=webpack://tui.ImageEditor/./node_modules/core-js-pure/internals/to-integer.js?"); - -/***/ }), - -/***/ "./node_modules/core-js-pure/internals/to-length.js": -/*!**********************************************************!*\ - !*** ./node_modules/core-js-pure/internals/to-length.js ***! - \**********************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -eval("var toInteger = __webpack_require__(/*! ../internals/to-integer */ \"./node_modules/core-js-pure/internals/to-integer.js\");\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\n\n//# sourceURL=webpack://tui.ImageEditor/./node_modules/core-js-pure/internals/to-length.js?"); - -/***/ }), - -/***/ "./node_modules/core-js-pure/internals/to-object.js": -/*!**********************************************************!*\ - !*** ./node_modules/core-js-pure/internals/to-object.js ***! - \**********************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -eval("var requireObjectCoercible = __webpack_require__(/*! ../internals/require-object-coercible */ \"./node_modules/core-js-pure/internals/require-object-coercible.js\");\n\n// `ToObject` abstract operation\n// https://tc39.github.io/ecma262/#sec-toobject\nmodule.exports = function (argument) {\n return Object(requireObjectCoercible(argument));\n};\n\n\n//# sourceURL=webpack://tui.ImageEditor/./node_modules/core-js-pure/internals/to-object.js?"); - -/***/ }), - -/***/ "./node_modules/core-js-pure/internals/to-primitive.js": -/*!*************************************************************!*\ - !*** ./node_modules/core-js-pure/internals/to-primitive.js ***! - \*************************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -eval("var isObject = __webpack_require__(/*! ../internals/is-object */ \"./node_modules/core-js-pure/internals/is-object.js\");\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\n\n//# sourceURL=webpack://tui.ImageEditor/./node_modules/core-js-pure/internals/to-primitive.js?"); - -/***/ }), - -/***/ "./node_modules/core-js-pure/internals/to-string-tag-support.js": -/*!**********************************************************************!*\ - !*** ./node_modules/core-js-pure/internals/to-string-tag-support.js ***! - \**********************************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -eval("var wellKnownSymbol = __webpack_require__(/*! ../internals/well-known-symbol */ \"./node_modules/core-js-pure/internals/well-known-symbol.js\");\n\nvar TO_STRING_TAG = wellKnownSymbol('toStringTag');\nvar test = {};\n\ntest[TO_STRING_TAG] = 'z';\n\nmodule.exports = String(test) === '[object z]';\n\n\n//# sourceURL=webpack://tui.ImageEditor/./node_modules/core-js-pure/internals/to-string-tag-support.js?"); - -/***/ }), - -/***/ "./node_modules/core-js-pure/internals/uid.js": -/*!****************************************************!*\ - !*** ./node_modules/core-js-pure/internals/uid.js ***! - \****************************************************/ -/*! no static exports found */ -/***/ (function(module, exports) { - -eval("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\n\n//# sourceURL=webpack://tui.ImageEditor/./node_modules/core-js-pure/internals/uid.js?"); - -/***/ }), - -/***/ "./node_modules/core-js-pure/internals/use-symbol-as-uid.js": -/*!******************************************************************!*\ - !*** ./node_modules/core-js-pure/internals/use-symbol-as-uid.js ***! - \******************************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -eval("var NATIVE_SYMBOL = __webpack_require__(/*! ../internals/native-symbol */ \"./node_modules/core-js-pure/internals/native-symbol.js\");\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\n\n//# sourceURL=webpack://tui.ImageEditor/./node_modules/core-js-pure/internals/use-symbol-as-uid.js?"); - -/***/ }), - -/***/ "./node_modules/core-js-pure/internals/well-known-symbol.js": -/*!******************************************************************!*\ - !*** ./node_modules/core-js-pure/internals/well-known-symbol.js ***! - \******************************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -eval("var global = __webpack_require__(/*! ../internals/global */ \"./node_modules/core-js-pure/internals/global.js\");\nvar shared = __webpack_require__(/*! ../internals/shared */ \"./node_modules/core-js-pure/internals/shared.js\");\nvar has = __webpack_require__(/*! ../internals/has */ \"./node_modules/core-js-pure/internals/has.js\");\nvar uid = __webpack_require__(/*! ../internals/uid */ \"./node_modules/core-js-pure/internals/uid.js\");\nvar NATIVE_SYMBOL = __webpack_require__(/*! ../internals/native-symbol */ \"./node_modules/core-js-pure/internals/native-symbol.js\");\nvar USE_SYMBOL_AS_UID = __webpack_require__(/*! ../internals/use-symbol-as-uid */ \"./node_modules/core-js-pure/internals/use-symbol-as-uid.js\");\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\n//# sourceURL=webpack://tui.ImageEditor/./node_modules/core-js-pure/internals/well-known-symbol.js?"); - -/***/ }), - -/***/ "./node_modules/core-js-pure/modules/es.array.iterator.js": -/*!****************************************************************!*\ - !*** ./node_modules/core-js-pure/modules/es.array.iterator.js ***! - \****************************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; -eval("\nvar toIndexedObject = __webpack_require__(/*! ../internals/to-indexed-object */ \"./node_modules/core-js-pure/internals/to-indexed-object.js\");\nvar addToUnscopables = __webpack_require__(/*! ../internals/add-to-unscopables */ \"./node_modules/core-js-pure/internals/add-to-unscopables.js\");\nvar Iterators = __webpack_require__(/*! ../internals/iterators */ \"./node_modules/core-js-pure/internals/iterators.js\");\nvar InternalStateModule = __webpack_require__(/*! ../internals/internal-state */ \"./node_modules/core-js-pure/internals/internal-state.js\");\nvar defineIterator = __webpack_require__(/*! ../internals/define-iterator */ \"./node_modules/core-js-pure/internals/define-iterator.js\");\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\n\n//# sourceURL=webpack://tui.ImageEditor/./node_modules/core-js-pure/modules/es.array.iterator.js?"); - -/***/ }), - -/***/ "./node_modules/core-js-pure/modules/es.object.to-string.js": -/*!******************************************************************!*\ - !*** ./node_modules/core-js-pure/modules/es.object.to-string.js ***! - \******************************************************************/ -/*! no static exports found */ -/***/ (function(module, exports) { - -eval("// empty\n\n\n//# sourceURL=webpack://tui.ImageEditor/./node_modules/core-js-pure/modules/es.object.to-string.js?"); - -/***/ }), - -/***/ "./node_modules/core-js-pure/modules/es.promise.all-settled.js": -/*!*********************************************************************!*\ - !*** ./node_modules/core-js-pure/modules/es.promise.all-settled.js ***! - \*********************************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; -eval("\nvar $ = __webpack_require__(/*! ../internals/export */ \"./node_modules/core-js-pure/internals/export.js\");\nvar aFunction = __webpack_require__(/*! ../internals/a-function */ \"./node_modules/core-js-pure/internals/a-function.js\");\nvar newPromiseCapabilityModule = __webpack_require__(/*! ../internals/new-promise-capability */ \"./node_modules/core-js-pure/internals/new-promise-capability.js\");\nvar perform = __webpack_require__(/*! ../internals/perform */ \"./node_modules/core-js-pure/internals/perform.js\");\nvar iterate = __webpack_require__(/*! ../internals/iterate */ \"./node_modules/core-js-pure/internals/iterate.js\");\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\n//# sourceURL=webpack://tui.ImageEditor/./node_modules/core-js-pure/modules/es.promise.all-settled.js?"); - -/***/ }), - -/***/ "./node_modules/core-js-pure/modules/es.promise.finally.js": -/*!*****************************************************************!*\ - !*** ./node_modules/core-js-pure/modules/es.promise.finally.js ***! - \*****************************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; -eval("\nvar $ = __webpack_require__(/*! ../internals/export */ \"./node_modules/core-js-pure/internals/export.js\");\nvar IS_PURE = __webpack_require__(/*! ../internals/is-pure */ \"./node_modules/core-js-pure/internals/is-pure.js\");\nvar NativePromise = __webpack_require__(/*! ../internals/native-promise-constructor */ \"./node_modules/core-js-pure/internals/native-promise-constructor.js\");\nvar fails = __webpack_require__(/*! ../internals/fails */ \"./node_modules/core-js-pure/internals/fails.js\");\nvar getBuiltIn = __webpack_require__(/*! ../internals/get-built-in */ \"./node_modules/core-js-pure/internals/get-built-in.js\");\nvar speciesConstructor = __webpack_require__(/*! ../internals/species-constructor */ \"./node_modules/core-js-pure/internals/species-constructor.js\");\nvar promiseResolve = __webpack_require__(/*! ../internals/promise-resolve */ \"./node_modules/core-js-pure/internals/promise-resolve.js\");\nvar redefine = __webpack_require__(/*! ../internals/redefine */ \"./node_modules/core-js-pure/internals/redefine.js\");\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\n\n//# sourceURL=webpack://tui.ImageEditor/./node_modules/core-js-pure/modules/es.promise.finally.js?"); - -/***/ }), - -/***/ "./node_modules/core-js-pure/modules/es.promise.js": -/*!*********************************************************!*\ - !*** ./node_modules/core-js-pure/modules/es.promise.js ***! - \*********************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; -eval("\nvar $ = __webpack_require__(/*! ../internals/export */ \"./node_modules/core-js-pure/internals/export.js\");\nvar IS_PURE = __webpack_require__(/*! ../internals/is-pure */ \"./node_modules/core-js-pure/internals/is-pure.js\");\nvar global = __webpack_require__(/*! ../internals/global */ \"./node_modules/core-js-pure/internals/global.js\");\nvar getBuiltIn = __webpack_require__(/*! ../internals/get-built-in */ \"./node_modules/core-js-pure/internals/get-built-in.js\");\nvar NativePromise = __webpack_require__(/*! ../internals/native-promise-constructor */ \"./node_modules/core-js-pure/internals/native-promise-constructor.js\");\nvar redefine = __webpack_require__(/*! ../internals/redefine */ \"./node_modules/core-js-pure/internals/redefine.js\");\nvar redefineAll = __webpack_require__(/*! ../internals/redefine-all */ \"./node_modules/core-js-pure/internals/redefine-all.js\");\nvar setToStringTag = __webpack_require__(/*! ../internals/set-to-string-tag */ \"./node_modules/core-js-pure/internals/set-to-string-tag.js\");\nvar setSpecies = __webpack_require__(/*! ../internals/set-species */ \"./node_modules/core-js-pure/internals/set-species.js\");\nvar isObject = __webpack_require__(/*! ../internals/is-object */ \"./node_modules/core-js-pure/internals/is-object.js\");\nvar aFunction = __webpack_require__(/*! ../internals/a-function */ \"./node_modules/core-js-pure/internals/a-function.js\");\nvar anInstance = __webpack_require__(/*! ../internals/an-instance */ \"./node_modules/core-js-pure/internals/an-instance.js\");\nvar classof = __webpack_require__(/*! ../internals/classof-raw */ \"./node_modules/core-js-pure/internals/classof-raw.js\");\nvar inspectSource = __webpack_require__(/*! ../internals/inspect-source */ \"./node_modules/core-js-pure/internals/inspect-source.js\");\nvar iterate = __webpack_require__(/*! ../internals/iterate */ \"./node_modules/core-js-pure/internals/iterate.js\");\nvar checkCorrectnessOfIteration = __webpack_require__(/*! ../internals/check-correctness-of-iteration */ \"./node_modules/core-js-pure/internals/check-correctness-of-iteration.js\");\nvar speciesConstructor = __webpack_require__(/*! ../internals/species-constructor */ \"./node_modules/core-js-pure/internals/species-constructor.js\");\nvar task = __webpack_require__(/*! ../internals/task */ \"./node_modules/core-js-pure/internals/task.js\").set;\nvar microtask = __webpack_require__(/*! ../internals/microtask */ \"./node_modules/core-js-pure/internals/microtask.js\");\nvar promiseResolve = __webpack_require__(/*! ../internals/promise-resolve */ \"./node_modules/core-js-pure/internals/promise-resolve.js\");\nvar hostReportErrors = __webpack_require__(/*! ../internals/host-report-errors */ \"./node_modules/core-js-pure/internals/host-report-errors.js\");\nvar newPromiseCapabilityModule = __webpack_require__(/*! ../internals/new-promise-capability */ \"./node_modules/core-js-pure/internals/new-promise-capability.js\");\nvar perform = __webpack_require__(/*! ../internals/perform */ \"./node_modules/core-js-pure/internals/perform.js\");\nvar InternalStateModule = __webpack_require__(/*! ../internals/internal-state */ \"./node_modules/core-js-pure/internals/internal-state.js\");\nvar isForced = __webpack_require__(/*! ../internals/is-forced */ \"./node_modules/core-js-pure/internals/is-forced.js\");\nvar wellKnownSymbol = __webpack_require__(/*! ../internals/well-known-symbol */ \"./node_modules/core-js-pure/internals/well-known-symbol.js\");\nvar V8_VERSION = __webpack_require__(/*! ../internals/engine-v8-version */ \"./node_modules/core-js-pure/internals/engine-v8-version.js\");\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\n\n//# sourceURL=webpack://tui.ImageEditor/./node_modules/core-js-pure/modules/es.promise.js?"); - -/***/ }), - -/***/ "./node_modules/core-js-pure/modules/es.string.iterator.js": -/*!*****************************************************************!*\ - !*** ./node_modules/core-js-pure/modules/es.string.iterator.js ***! - \*****************************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; -eval("\nvar charAt = __webpack_require__(/*! ../internals/string-multibyte */ \"./node_modules/core-js-pure/internals/string-multibyte.js\").charAt;\nvar InternalStateModule = __webpack_require__(/*! ../internals/internal-state */ \"./node_modules/core-js-pure/internals/internal-state.js\");\nvar defineIterator = __webpack_require__(/*! ../internals/define-iterator */ \"./node_modules/core-js-pure/internals/define-iterator.js\");\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\n\n//# sourceURL=webpack://tui.ImageEditor/./node_modules/core-js-pure/modules/es.string.iterator.js?"); - -/***/ }), - -/***/ "./node_modules/core-js-pure/modules/esnext.aggregate-error.js": -/*!*********************************************************************!*\ - !*** ./node_modules/core-js-pure/modules/esnext.aggregate-error.js ***! - \*********************************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; -eval("\nvar $ = __webpack_require__(/*! ../internals/export */ \"./node_modules/core-js-pure/internals/export.js\");\nvar DESCRIPTORS = __webpack_require__(/*! ../internals/descriptors */ \"./node_modules/core-js-pure/internals/descriptors.js\");\nvar getPrototypeOf = __webpack_require__(/*! ../internals/object-get-prototype-of */ \"./node_modules/core-js-pure/internals/object-get-prototype-of.js\");\nvar setPrototypeOf = __webpack_require__(/*! ../internals/object-set-prototype-of */ \"./node_modules/core-js-pure/internals/object-set-prototype-of.js\");\nvar create = __webpack_require__(/*! ../internals/object-create */ \"./node_modules/core-js-pure/internals/object-create.js\");\nvar defineProperty = __webpack_require__(/*! ../internals/object-define-property */ \"./node_modules/core-js-pure/internals/object-define-property.js\");\nvar createPropertyDescriptor = __webpack_require__(/*! ../internals/create-property-descriptor */ \"./node_modules/core-js-pure/internals/create-property-descriptor.js\");\nvar iterate = __webpack_require__(/*! ../internals/iterate */ \"./node_modules/core-js-pure/internals/iterate.js\");\nvar createNonEnumerableProperty = __webpack_require__(/*! ../internals/create-non-enumerable-property */ \"./node_modules/core-js-pure/internals/create-non-enumerable-property.js\");\nvar InternalStateModule = __webpack_require__(/*! ../internals/internal-state */ \"./node_modules/core-js-pure/internals/internal-state.js\");\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\n\n//# sourceURL=webpack://tui.ImageEditor/./node_modules/core-js-pure/modules/esnext.aggregate-error.js?"); - -/***/ }), - -/***/ "./node_modules/core-js-pure/modules/esnext.promise.all-settled.js": -/*!*************************************************************************!*\ - !*** ./node_modules/core-js-pure/modules/esnext.promise.all-settled.js ***! - \*************************************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -eval("// TODO: Remove from `core-js@4`\n__webpack_require__(/*! ./es.promise.all-settled.js */ \"./node_modules/core-js-pure/modules/es.promise.all-settled.js\");\n\n\n//# sourceURL=webpack://tui.ImageEditor/./node_modules/core-js-pure/modules/esnext.promise.all-settled.js?"); - -/***/ }), - -/***/ "./node_modules/core-js-pure/modules/esnext.promise.any.js": -/*!*****************************************************************!*\ - !*** ./node_modules/core-js-pure/modules/esnext.promise.any.js ***! - \*****************************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; -eval("\nvar $ = __webpack_require__(/*! ../internals/export */ \"./node_modules/core-js-pure/internals/export.js\");\nvar aFunction = __webpack_require__(/*! ../internals/a-function */ \"./node_modules/core-js-pure/internals/a-function.js\");\nvar getBuiltIn = __webpack_require__(/*! ../internals/get-built-in */ \"./node_modules/core-js-pure/internals/get-built-in.js\");\nvar newPromiseCapabilityModule = __webpack_require__(/*! ../internals/new-promise-capability */ \"./node_modules/core-js-pure/internals/new-promise-capability.js\");\nvar perform = __webpack_require__(/*! ../internals/perform */ \"./node_modules/core-js-pure/internals/perform.js\");\nvar iterate = __webpack_require__(/*! ../internals/iterate */ \"./node_modules/core-js-pure/internals/iterate.js\");\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\n\n//# sourceURL=webpack://tui.ImageEditor/./node_modules/core-js-pure/modules/esnext.promise.any.js?"); - -/***/ }), - -/***/ "./node_modules/core-js-pure/modules/esnext.promise.try.js": -/*!*****************************************************************!*\ - !*** ./node_modules/core-js-pure/modules/esnext.promise.try.js ***! - \*****************************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; -eval("\nvar $ = __webpack_require__(/*! ../internals/export */ \"./node_modules/core-js-pure/internals/export.js\");\nvar newPromiseCapabilityModule = __webpack_require__(/*! ../internals/new-promise-capability */ \"./node_modules/core-js-pure/internals/new-promise-capability.js\");\nvar perform = __webpack_require__(/*! ../internals/perform */ \"./node_modules/core-js-pure/internals/perform.js\");\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\n\n//# sourceURL=webpack://tui.ImageEditor/./node_modules/core-js-pure/modules/esnext.promise.try.js?"); - -/***/ }), - -/***/ "./node_modules/core-js-pure/modules/web.dom-collections.iterator.js": -/*!***************************************************************************!*\ - !*** ./node_modules/core-js-pure/modules/web.dom-collections.iterator.js ***! - \***************************************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -eval("__webpack_require__(/*! ./es.array.iterator */ \"./node_modules/core-js-pure/modules/es.array.iterator.js\");\nvar DOMIterables = __webpack_require__(/*! ../internals/dom-iterables */ \"./node_modules/core-js-pure/internals/dom-iterables.js\");\nvar global = __webpack_require__(/*! ../internals/global */ \"./node_modules/core-js-pure/internals/global.js\");\nvar classof = __webpack_require__(/*! ../internals/classof */ \"./node_modules/core-js-pure/internals/classof.js\");\nvar createNonEnumerableProperty = __webpack_require__(/*! ../internals/create-non-enumerable-property */ \"./node_modules/core-js-pure/internals/create-non-enumerable-property.js\");\nvar Iterators = __webpack_require__(/*! ../internals/iterators */ \"./node_modules/core-js-pure/internals/iterators.js\");\nvar wellKnownSymbol = __webpack_require__(/*! ../internals/well-known-symbol */ \"./node_modules/core-js-pure/internals/well-known-symbol.js\");\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\n\n//# sourceURL=webpack://tui.ImageEditor/./node_modules/core-js-pure/modules/web.dom-collections.iterator.js?"); - -/***/ }), - -/***/ "./node_modules/tui-code-snippet/src/js/array.js": -/*!*******************************************************!*\ - !*** ./node_modules/tui-code-snippet/src/js/array.js ***! - \*******************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; -eval("/**\n * @fileoverview This module has some functions for handling array.\n * @author NHN.\n * FE Development Lab \n */\n\n\n\nvar collection = __webpack_require__(/*! ./collection */ \"./node_modules/tui-code-snippet/src/js/collection.js\");\nvar type = __webpack_require__(/*! ./type */ \"./node_modules/tui-code-snippet/src/js/type.js\");\n\nvar aps = Array.prototype.slice;\nvar util;\n\n/**\n * Generate an integer Array containing an arithmetic progression.\n * @param {number} start - start index\n * @param {number} stop - stop index\n * @param {number} step - next visit index = current index + step\n * @returns {Array}\n * @memberof tui.util\n * @example\n * //-- #1. Get Module --//\n * var util = require('tui-code-snippet'); // node, commonjs\n * var util = tui.util; // distribution file\n *\n * //-- #2. Use property --//\n * util.range(5); // [0, 1, 2, 3, 4]\n * util.range(1, 5); // [1,2,3,4]\n * util.range(2, 10, 2); // [2,4,6,8]\n * util.range(10, 2, -2); // [10,8,6,4]\n */\nvar range = function(start, stop, step) {\n var arr = [];\n var flag;\n\n if (type.isUndefined(stop)) {\n stop = start || 0;\n start = 0;\n }\n\n step = step || 1;\n flag = step < 0 ? -1 : 1;\n stop *= flag;\n\n for (; start * flag < stop; start += step) {\n arr.push(start);\n }\n\n return arr;\n};\n\n/* eslint-disable valid-jsdoc */\n/**\n * Zip together multiple lists into a single array\n * @param {...Array}\n * @returns {Array}\n * @memberof tui.util\n * @example\n * //-- #1. Get Module --//\n * var util = require('tui-code-snippet'); // node, commonjs\n * var util = tui.util; // distribution file\n *\n * //-- #2. Use property --//\n * var result = util.zip([1, 2, 3], ['a', 'b','c'], [true, false, true]);\n * console.log(result[0]); // [1, 'a', true]\n * console.log(result[1]); // [2, 'b', false]\n * console.log(result[2]); // [3, 'c', true]\n */\nvar zip = function() {/* eslint-enable valid-jsdoc */\n var arr2d = aps.call(arguments);\n var result = [];\n\n collection.forEach(arr2d, function(arr) {\n collection.forEach(arr, function(value, index) {\n if (!result[index]) {\n result[index] = [];\n }\n result[index].push(value);\n });\n });\n\n return result;\n};\n\n/**\n * Returns the first index at which a given element can be found in the array\n * from start index(default 0), or -1 if it is not present.
                          \n * It compares searchElement to elements of the Array using strict equality\n * (the same method used by the ===, or triple-equals, operator).\n * @param {*} searchElement Element to locate in the array\n * @param {Array} array Array that will be traversed.\n * @param {number} startIndex Start index in array for searching (default 0)\n * @returns {number} the First index at which a given element, or -1 if it is not present\n * @memberof tui.util\n * @example\n * //-- #1. Get Module --//\n * var util = require('tui-code-snippet'); // node, commonjs\n * var util = tui.util; // distribution file\n *\n * //-- #2. Use property --//\n * var arr = ['one', 'two', 'three', 'four'];\n * var idx1 = util.inArray('one', arr, 3); // -1\n * var idx2 = util.inArray('one', arr); // 0\n */\nvar inArray = function(searchElement, array, startIndex) {\n var i;\n var length;\n startIndex = startIndex || 0;\n\n if (!type.isArray(array)) {\n return -1;\n }\n\n if (Array.prototype.indexOf) {\n return Array.prototype.indexOf.call(array, searchElement, startIndex);\n }\n\n length = array.length;\n for (i = startIndex; startIndex >= 0 && i < length; i += 1) {\n if (array[i] === searchElement) {\n return i;\n }\n }\n\n return -1;\n};\n\nutil = {\n inArray: inArray,\n range: range,\n zip: zip\n};\n\nmodule.exports = util;\n\n\n//# sourceURL=webpack://tui.ImageEditor/./node_modules/tui-code-snippet/src/js/array.js?"); - -/***/ }), - -/***/ "./node_modules/tui-code-snippet/src/js/collection.js": -/*!************************************************************!*\ - !*** ./node_modules/tui-code-snippet/src/js/collection.js ***! - \************************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; -eval("/**\n * @fileoverview This module has some functions for handling object as collection.\n * @author NHN.\n * FE Development Lab \n */\n\n\n\nvar type = __webpack_require__(/*! ./type */ \"./node_modules/tui-code-snippet/src/js/type.js\");\nvar object = __webpack_require__(/*! ./object */ \"./node_modules/tui-code-snippet/src/js/object.js\");\n\n/**\n * Execute the provided callback once for each element present\n * in the array(or Array-like object) in ascending order.
                          \n * If the callback function returns false, the loop will be stopped.
                          \n * Callback function(iteratee) is invoked with three arguments:\n * - The value of the element\n * - The index of the element\n * - The array(or Array-like object) being traversed\n * @param {Array} arr The array(or Array-like object) that will be traversed\n * @param {function} iteratee Callback function\n * @param {Object} [context] Context(this) of callback function\n * @memberof tui.util\n * @example\n * //-- #1. Get Module --//\n * var util = require('tui-code-snippet'); // node, commonjs\n * var util = tui.util; // distribution file\n *\n * //-- #2. Use property --//\n * var sum = 0;\n *\n * util.forEachArray([1,2,3], function(value){\n * sum += value;\n * });\n * alert(sum); // 6\n */\nfunction forEachArray(arr, iteratee, context) {\n var index = 0;\n var len = arr.length;\n\n context = context || null;\n\n for (; index < len; index += 1) {\n if (iteratee.call(context, arr[index], index, arr) === false) {\n break;\n }\n }\n}\n\n/**\n * Execute the provided callback once for each property of object which actually exist.
                          \n * If the callback function returns false, the loop will be stopped.
                          \n * Callback function(iteratee) is invoked with three arguments:\n * - The value of the property\n * - The name of the property\n * - The object being traversed\n * @param {Object} obj The object that will be traversed\n * @param {function} iteratee Callback function\n * @param {Object} [context] Context(this) of callback function\n * @memberof tui.util\n * @example\n * //-- #1. Get Module --//\n * var util = require('tui-code-snippet'); // node, commonjs\n * var util = tui.util; // distribution file\n *\n * //-- #2. Use property --//\n * var sum = 0;\n *\n * util.forEachOwnProperties({a:1,b:2,c:3}, function(value){\n * sum += value;\n * });\n * alert(sum); // 6\n **/\nfunction forEachOwnProperties(obj, iteratee, context) {\n var key;\n\n context = context || null;\n\n for (key in obj) {\n if (obj.hasOwnProperty(key)) {\n if (iteratee.call(context, obj[key], key, obj) === false) {\n break;\n }\n }\n }\n}\n\n/**\n * Execute the provided callback once for each property of object(or element of array) which actually exist.
                          \n * If the object is Array-like object(ex-arguments object), It needs to transform to Array.(see 'ex2' of example).
                          \n * If the callback function returns false, the loop will be stopped.
                          \n * Callback function(iteratee) is invoked with three arguments:\n * - The value of the property(or The value of the element)\n * - The name of the property(or The index of the element)\n * - The object being traversed\n * @param {Object} obj The object that will be traversed\n * @param {function} iteratee Callback function\n * @param {Object} [context] Context(this) of callback function\n * @memberof tui.util\n * @example\n * //-- #1. Get Module --//\n * var util = require('tui-code-snippet'); // node, commonjs\n * var util = tui.util; // distribution file\n *\n * //-- #2. Use property --//\n * var sum = 0;\n *\n * util.forEach([1,2,3], function(value){\n * sum += value;\n * });\n * alert(sum); // 6\n *\n * // In case of Array-like object\n * var array = Array.prototype.slice.call(arrayLike); // change to array\n * util.forEach(array, function(value){\n * sum += value;\n * });\n */\nfunction forEach(obj, iteratee, context) {\n if (type.isArray(obj)) {\n forEachArray(obj, iteratee, context);\n } else {\n forEachOwnProperties(obj, iteratee, context);\n }\n}\n\n/**\n * Execute the provided callback function once for each element in an array, in order,\n * and constructs a new array from the results.
                          \n * If the object is Array-like object(ex-arguments object),\n * It needs to transform to Array.(see 'ex2' of forEach example)
                          \n * Callback function(iteratee) is invoked with three arguments:\n * - The value of the property(or The value of the element)\n * - The name of the property(or The index of the element)\n * - The object being traversed\n * @param {Object} obj The object that will be traversed\n * @param {function} iteratee Callback function\n * @param {Object} [context] Context(this) of callback function\n * @returns {Array} A new array composed of returned values from callback function\n * @memberof tui.util\n * @example\n * //-- #1. Get Module --//\n * var util = require('tui-code-snippet'); // node, commonjs\n * var util = tui.util; // distribution file\n *\n * //-- #2. Use property --//\n * var result = util.map([0,1,2,3], function(value) {\n * return value + 1;\n * });\n *\n * alert(result); // 1,2,3,4\n */\nfunction map(obj, iteratee, context) {\n var resultArray = [];\n\n context = context || null;\n\n forEach(obj, function() {\n resultArray.push(iteratee.apply(context, arguments));\n });\n\n return resultArray;\n}\n\n/**\n * Execute the callback function once for each element present in the array(or Array-like object or plain object).
                          \n * If the object is Array-like object(ex-arguments object),\n * It needs to transform to Array.(see 'ex2' of forEach example)
                          \n * Callback function(iteratee) is invoked with four arguments:\n * - The previousValue\n * - The currentValue\n * - The index\n * - The object being traversed\n * @param {Object} obj The object that will be traversed\n * @param {function} iteratee Callback function\n * @param {Object} [context] Context(this) of callback function\n * @returns {*} The result value\n * @memberof tui.util\n * @example\n * //-- #1. Get Module --//\n * var util = require('tui-code-snippet'); // node, commonjs\n * var util = tui.util; // distribution file\n *\n * //-- #2. Use property --//\n * var result = util.reduce([0,1,2,3], function(stored, value) {\n * return stored + value;\n * });\n *\n * alert(result); // 6\n */\nfunction reduce(obj, iteratee, context) {\n var index = 0;\n var keys, length, store;\n\n context = context || null;\n\n if (!type.isArray(obj)) {\n keys = object.keys(obj);\n length = keys.length;\n store = obj[keys[index += 1]];\n } else {\n length = obj.length;\n store = obj[index];\n }\n\n index += 1;\n for (; index < length; index += 1) {\n store = iteratee.call(context, store, obj[keys ? keys[index] : index]);\n }\n\n return store;\n}\n\n/**\n * Transform the Array-like object to Array.
                          \n * In low IE (below 8), Array.prototype.slice.call is not perfect. So, try-catch statement is used.\n * @param {*} arrayLike Array-like object\n * @returns {Array} Array\n * @memberof tui.util\n * @example\n * //-- #1. Get Module --//\n * var util = require('tui-code-snippet'); // node, commonjs\n * var util = tui.util; // distribution file\n *\n * //-- #2. Use property --//\n * var arrayLike = {\n * 0: 'one',\n * 1: 'two',\n * 2: 'three',\n * 3: 'four',\n * length: 4\n * };\n * var result = util.toArray(arrayLike);\n *\n * alert(result instanceof Array); // true\n * alert(result); // one,two,three,four\n */\nfunction toArray(arrayLike) {\n var arr;\n try {\n arr = Array.prototype.slice.call(arrayLike);\n } catch (e) {\n arr = [];\n forEachArray(arrayLike, function(value) {\n arr.push(value);\n });\n }\n\n return arr;\n}\n\n/**\n * Create a new array or plain object with all elements(or properties)\n * that pass the test implemented by the provided function.
                          \n * Callback function(iteratee) is invoked with three arguments:\n * - The value of the property(or The value of the element)\n * - The name of the property(or The index of the element)\n * - The object being traversed\n * @param {Object} obj Object(plain object or Array) that will be traversed\n * @param {function} iteratee Callback function\n * @param {Object} [context] Context(this) of callback function\n * @returns {Object} plain object or Array\n * @memberof tui.util\n * @example\n * //-- #1. Get Module --//\n * var util = require('tui-code-snippet'); // node, commonjs\n * var util = tui.util; // distribution file\n *\n * //-- #2. Use property --//\n * var result1 = util.filter([0,1,2,3], function(value) {\n * return (value % 2 === 0);\n * });\n * alert(result1); // [0, 2]\n *\n * var result2 = util.filter({a : 1, b: 2, c: 3}, function(value) {\n * return (value % 2 !== 0);\n * });\n * alert(result2.a); // 1\n * alert(result2.b); // undefined\n * alert(result2.c); // 3\n */\nfunction filter(obj, iteratee, context) {\n var result, add;\n\n context = context || null;\n\n if (!type.isObject(obj) || !type.isFunction(iteratee)) {\n throw new Error('wrong parameter');\n }\n\n if (type.isArray(obj)) {\n result = [];\n add = function(subResult, args) {\n subResult.push(args[0]);\n };\n } else {\n result = {};\n add = function(subResult, args) {\n subResult[args[1]] = args[0];\n };\n }\n\n forEach(obj, function() {\n if (iteratee.apply(context, arguments)) {\n add(result, arguments);\n }\n }, context);\n\n return result;\n}\n\n/**\n * fetching a property\n * @param {Array} arr target collection\n * @param {String|Number} property property name\n * @returns {Array}\n * @memberof tui.util\n * @example\n * //-- #1. Get Module --//\n * var util = require('tui-code-snippet'); // node, commonjs\n * var util = tui.util; // distribution file\n *\n * //-- #2. Use property --//\n * var objArr = [\n * {'abc': 1, 'def': 2, 'ghi': 3},\n * {'abc': 4, 'def': 5, 'ghi': 6},\n * {'abc': 7, 'def': 8, 'ghi': 9}\n * ];\n * var arr2d = [\n * [1, 2, 3],\n * [4, 5, 6],\n * [7, 8, 9]\n * ];\n * util.pluck(objArr, 'abc'); // [1, 4, 7]\n * util.pluck(arr2d, 2); // [3, 6, 9]\n */\nfunction pluck(arr, property) {\n var result = map(arr, function(item) {\n return item[property];\n });\n\n return result;\n}\n\nmodule.exports = {\n forEachOwnProperties: forEachOwnProperties,\n forEachArray: forEachArray,\n forEach: forEach,\n toArray: toArray,\n map: map,\n reduce: reduce,\n filter: filter,\n pluck: pluck\n};\n\n\n//# sourceURL=webpack://tui.ImageEditor/./node_modules/tui-code-snippet/src/js/collection.js?"); - -/***/ }), - -/***/ "./node_modules/tui-code-snippet/src/js/object.js": -/*!********************************************************!*\ - !*** ./node_modules/tui-code-snippet/src/js/object.js ***! - \********************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; -eval("/**\n * @fileoverview This module has some functions for handling a plain object, json.\n * @author NHN.\n * FE Development Lab \n */\n\n\n\nvar type = __webpack_require__(/*! ./type */ \"./node_modules/tui-code-snippet/src/js/type.js\");\nvar array = __webpack_require__(/*! ./array */ \"./node_modules/tui-code-snippet/src/js/array.js\");\n\n/**\n * The last id of stamp\n * @type {number}\n * @private\n */\nvar lastId = 0;\n\n/**\n * Extend the target object from other objects.\n * @param {object} target - Object that will be extended\n * @param {...object} objects - Objects as sources\n * @returns {object} Extended object\n * @memberof tui.util\n */\nfunction extend(target, objects) { // eslint-disable-line no-unused-vars\n var hasOwnProp = Object.prototype.hasOwnProperty;\n var source, prop, i, len;\n\n for (i = 1, len = arguments.length; i < len; i += 1) {\n source = arguments[i];\n for (prop in source) {\n if (hasOwnProp.call(source, prop)) {\n target[prop] = source[prop];\n }\n }\n }\n\n return target;\n}\n\n/**\n * Assign a unique id to an object\n * @param {object} obj - Object that will be assigned id.\n * @returns {number} Stamped id\n * @memberof tui.util\n */\nfunction stamp(obj) {\n if (!obj.__fe_id) {\n lastId += 1;\n obj.__fe_id = lastId; // eslint-disable-line camelcase\n }\n\n return obj.__fe_id;\n}\n\n/**\n * Verify whether an object has a stamped id or not.\n * @param {object} obj - adjusted object\n * @returns {boolean}\n * @memberof tui.util\n */\nfunction hasStamp(obj) {\n return type.isExisty(pick(obj, '__fe_id'));\n}\n\n/**\n * Reset the last id of stamp\n * @private\n */\nfunction resetLastId() {\n lastId = 0;\n}\n\n/**\n * Return a key-list(array) of a given object\n * @param {object} obj - Object from which a key-list will be extracted\n * @returns {Array} A key-list(array)\n * @memberof tui.util\n */\nfunction keys(obj) {\n var keyArray = [];\n var key;\n\n for (key in obj) {\n if (obj.hasOwnProperty(key)) {\n keyArray.push(key);\n }\n }\n\n return keyArray;\n}\n\n/**\n * Return the equality for multiple objects(jsonObjects).
                          \n * See {@link http://stackoverflow.com/questions/1068834/object-comparison-in-javascript}\n * @param {...object} object - Multiple objects for comparing.\n * @returns {boolean} Equality\n * @memberof tui.util\n * @example\n * //-- #1. Get Module --//\n * var util = require('tui-code-snippet'); // node, commonjs\n * var util = tui.util; // distribution file\n *\n * //-- #2. Use property --//\n * var jsonObj1 = {name:'milk', price: 1000};\n * var jsonObj2 = {name:'milk', price: 1000};\n * var jsonObj3 = {name:'milk', price: 1000};\n * util.compareJSON(jsonObj1, jsonObj2, jsonObj3); // true\n *\n * var jsonObj4 = {name:'milk', price: 1000};\n * var jsonObj5 = {name:'beer', price: 3000};\n * util.compareJSON(jsonObj4, jsonObj5); // false\n */\nfunction compareJSON(object) {\n var argsLen = arguments.length;\n var i = 1;\n\n if (argsLen < 1) {\n return true;\n }\n\n for (; i < argsLen; i += 1) {\n if (!isSameObject(object, arguments[i])) {\n return false;\n }\n }\n\n return true;\n}\n\n/**\n * @param {*} x - object to compare\n * @param {*} y - object to compare\n * @returns {boolean} - whether object x and y is same or not\n * @private\n */\nfunction isSameObject(x, y) { // eslint-disable-line complexity\n var leftChain = [];\n var rightChain = [];\n var p;\n\n // remember that NaN === NaN returns false\n // and isNaN(undefined) returns true\n if (isNaN(x) &&\n isNaN(y) &&\n type.isNumber(x) &&\n type.isNumber(y)) {\n return true;\n }\n\n // Compare primitives and functions.\n // Check if both arguments link to the same object.\n // Especially useful on step when comparing prototypes\n if (x === y) {\n return true;\n }\n\n // Works in case when functions are created in constructor.\n // Comparing dates is a common scenario. Another built-ins?\n // We can even handle functions passed across iframes\n if ((type.isFunction(x) && type.isFunction(y)) ||\n (x instanceof Date && y instanceof Date) ||\n (x instanceof RegExp && y instanceof RegExp) ||\n (x instanceof String && y instanceof String) ||\n (x instanceof Number && y instanceof Number)) {\n return x.toString() === y.toString();\n }\n\n // At last checking prototypes as good a we can\n if (!(x instanceof Object && y instanceof Object)) {\n return false;\n }\n\n if (x.isPrototypeOf(y) ||\n y.isPrototypeOf(x) ||\n x.constructor !== y.constructor ||\n x.prototype !== y.prototype) {\n return false;\n }\n\n // check for infinitive linking loops\n if (array.inArray(x, leftChain) > -1 ||\n array.inArray(y, rightChain) > -1) {\n return false;\n }\n\n // Quick checking of one object beeing a subset of another.\n for (p in y) {\n if (y.hasOwnProperty(p) !== x.hasOwnProperty(p)) {\n return false;\n } else if (typeof y[p] !== typeof x[p]) {\n return false;\n }\n }\n\n // This for loop executes comparing with hasOwnProperty() and typeof for each property in 'x' object,\n // and verifying equality for x[property] and y[property].\n for (p in x) {\n if (y.hasOwnProperty(p) !== x.hasOwnProperty(p)) {\n return false;\n } else if (typeof y[p] !== typeof x[p]) {\n return false;\n }\n\n if (typeof (x[p]) === 'object' || typeof (x[p]) === 'function') {\n leftChain.push(x);\n rightChain.push(y);\n\n if (!isSameObject(x[p], y[p])) {\n return false;\n }\n\n leftChain.pop();\n rightChain.pop();\n } else if (x[p] !== y[p]) {\n return false;\n }\n }\n\n return true;\n}\n/* eslint-enable complexity */\n\n/**\n * Retrieve a nested item from the given object/array\n * @param {object|Array} obj - Object for retrieving\n * @param {...string|number} paths - Paths of property\n * @returns {*} Value\n * @memberof tui.util\n * @example\n * //-- #1. Get Module --//\n * var util = require('tui-code-snippet'); // node, commonjs\n * var util = tui.util; // distribution file\n *\n * //-- #2. Use property --//\n * var obj = {\n * 'key1': 1,\n * 'nested' : {\n * 'key1': 11,\n * 'nested': {\n * 'key1': 21\n * }\n * }\n * };\n * util.pick(obj, 'nested', 'nested', 'key1'); // 21\n * util.pick(obj, 'nested', 'nested', 'key2'); // undefined\n *\n * var arr = ['a', 'b', 'c'];\n * util.pick(arr, 1); // 'b'\n */\nfunction pick(obj, paths) { // eslint-disable-line no-unused-vars\n var args = arguments;\n var target = args[0];\n var i = 1;\n var length = args.length;\n\n for (; i < length; i += 1) {\n if (type.isUndefined(target) ||\n type.isNull(target)) {\n return;\n }\n\n target = target[args[i]];\n }\n\n return target; // eslint-disable-line consistent-return\n}\n\nmodule.exports = {\n extend: extend,\n stamp: stamp,\n hasStamp: hasStamp,\n resetLastId: resetLastId,\n keys: Object.prototype.keys || keys,\n compareJSON: compareJSON,\n pick: pick\n};\n\n\n//# sourceURL=webpack://tui.ImageEditor/./node_modules/tui-code-snippet/src/js/object.js?"); - -/***/ }), - -/***/ "./node_modules/tui-code-snippet/src/js/type.js": -/*!******************************************************!*\ - !*** ./node_modules/tui-code-snippet/src/js/type.js ***! - \******************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; -eval("/**\n * @fileoverview This module provides some functions to check the type of variable\n * @author NHN.\n * FE Development Lab \n */\n\n\n\nvar toString = Object.prototype.toString;\n\n/**\n * Check whether the given variable is existing or not.
                          \n * If the given variable is not null and not undefined, returns true.\n * @param {*} param - Target for checking\n * @returns {boolean} Is existy?\n * @memberof tui.util\n * @example\n * //-- #1. Get Module --//\n * var util = require('tui-code-snippet'); // node, commonjs\n * var util = tui.util; // distribution file\n *\n * //-- #2. Use property --//\n * util.isExisty(''); //true\n * util.isExisty(0); //true\n * util.isExisty([]); //true\n * util.isExisty({}); //true\n * util.isExisty(null); //false\n * util.isExisty(undefined); //false\n*/\nfunction isExisty(param) {\n return !isUndefined(param) && !isNull(param);\n}\n\n/**\n * Check whether the given variable is undefined or not.
                          \n * If the given variable is undefined, returns true.\n * @param {*} obj - Target for checking\n * @returns {boolean} Is undefined?\n * @memberof tui.util\n */\nfunction isUndefined(obj) {\n return obj === undefined; // eslint-disable-line no-undefined\n}\n\n/**\n * Check whether the given variable is null or not.
                          \n * If the given variable(arguments[0]) is null, returns true.\n * @param {*} obj - Target for checking\n * @returns {boolean} Is null?\n * @memberof tui.util\n */\nfunction isNull(obj) {\n return obj === null;\n}\n\n/**\n * Check whether the given variable is truthy or not.
                          \n * If the given variable is not null or not undefined or not false, returns true.
                          \n * (It regards 0 as true)\n * @param {*} obj - Target for checking\n * @returns {boolean} Is truthy?\n * @memberof tui.util\n */\nfunction isTruthy(obj) {\n return isExisty(obj) && obj !== false;\n}\n\n/**\n * Check whether the given variable is falsy or not.
                          \n * If the given variable is null or undefined or false, returns true.\n * @param {*} obj - Target for checking\n * @returns {boolean} Is falsy?\n * @memberof tui.util\n */\nfunction isFalsy(obj) {\n return !isTruthy(obj);\n}\n\n/**\n * Check whether the given variable is an arguments object or not.
                          \n * If the given variable is an arguments object, return true.\n * @param {*} obj - Target for checking\n * @returns {boolean} Is arguments?\n * @memberof tui.util\n */\nfunction isArguments(obj) {\n var result = isExisty(obj) &&\n ((toString.call(obj) === '[object Arguments]') || !!obj.callee);\n\n return result;\n}\n\n/**\n * Check whether the given variable is an instance of Array or not.
                          \n * If the given variable is an instance of Array, return true.\n * @param {*} obj - Target for checking\n * @returns {boolean} Is array instance?\n * @memberof tui.util\n */\nfunction isArray(obj) {\n return obj instanceof Array;\n}\n\n/**\n * Check whether the given variable is an object or not.
                          \n * If the given variable is an object, return true.\n * @param {*} obj - Target for checking\n * @returns {boolean} Is object?\n * @memberof tui.util\n */\nfunction isObject(obj) {\n return obj === Object(obj);\n}\n\n/**\n * Check whether the given variable is a function or not.
                          \n * If the given variable is a function, return true.\n * @param {*} obj - Target for checking\n * @returns {boolean} Is function?\n * @memberof tui.util\n */\nfunction isFunction(obj) {\n return obj instanceof Function;\n}\n\n/**\n * Check whether the given variable is a number or not.
                          \n * If the given variable is a number, return true.\n * @param {*} obj - Target for checking\n * @returns {boolean} Is number?\n * @memberof tui.util\n */\nfunction isNumber(obj) {\n return typeof obj === 'number' || obj instanceof Number;\n}\n\n/**\n * Check whether the given variable is a string or not.
                          \n * If the given variable is a string, return true.\n * @param {*} obj - Target for checking\n * @returns {boolean} Is string?\n * @memberof tui.util\n */\nfunction isString(obj) {\n return typeof obj === 'string' || obj instanceof String;\n}\n\n/**\n * Check whether the given variable is a boolean or not.
                          \n * If the given variable is a boolean, return true.\n * @param {*} obj - Target for checking\n * @returns {boolean} Is boolean?\n * @memberof tui.util\n */\nfunction isBoolean(obj) {\n return typeof obj === 'boolean' || obj instanceof Boolean;\n}\n\n/**\n * Check whether the given variable is an instance of Array or not.
                          \n * If the given variable is an instance of Array, return true.
                          \n * (It is used for multiple frame environments)\n * @param {*} obj - Target for checking\n * @returns {boolean} Is an instance of array?\n * @memberof tui.util\n */\nfunction isArraySafe(obj) {\n return toString.call(obj) === '[object Array]';\n}\n\n/**\n * Check whether the given variable is a function or not.
                          \n * If the given variable is a function, return true.
                          \n * (It is used for multiple frame environments)\n * @param {*} obj - Target for checking\n * @returns {boolean} Is a function?\n * @memberof tui.util\n */\nfunction isFunctionSafe(obj) {\n return toString.call(obj) === '[object Function]';\n}\n\n/**\n * Check whether the given variable is a number or not.
                          \n * If the given variable is a number, return true.
                          \n * (It is used for multiple frame environments)\n * @param {*} obj - Target for checking\n * @returns {boolean} Is a number?\n * @memberof tui.util\n */\nfunction isNumberSafe(obj) {\n return toString.call(obj) === '[object Number]';\n}\n\n/**\n * Check whether the given variable is a string or not.
                          \n * If the given variable is a string, return true.
                          \n * (It is used for multiple frame environments)\n * @param {*} obj - Target for checking\n * @returns {boolean} Is a string?\n * @memberof tui.util\n */\nfunction isStringSafe(obj) {\n return toString.call(obj) === '[object String]';\n}\n\n/**\n * Check whether the given variable is a boolean or not.
                          \n * If the given variable is a boolean, return true.
                          \n * (It is used for multiple frame environments)\n * @param {*} obj - Target for checking\n * @returns {boolean} Is a boolean?\n * @memberof tui.util\n */\nfunction isBooleanSafe(obj) {\n return toString.call(obj) === '[object Boolean]';\n}\n\n/**\n * Check whether the given variable is a instance of HTMLNode or not.
                          \n * If the given variables is a instance of HTMLNode, return true.\n * @param {*} html - Target for checking\n * @returns {boolean} Is HTMLNode ?\n * @memberof tui.util\n */\nfunction isHTMLNode(html) {\n if (typeof HTMLElement === 'object') {\n return (html && (html instanceof HTMLElement || !!html.nodeType));\n }\n\n return !!(html && html.nodeType);\n}\n\n/**\n * Check whether the given variable is a HTML tag or not.
                          \n * If the given variables is a HTML tag, return true.\n * @param {*} html - Target for checking\n * @returns {Boolean} Is HTML tag?\n * @memberof tui.util\n */\nfunction isHTMLTag(html) {\n if (typeof HTMLElement === 'object') {\n return (html && (html instanceof HTMLElement));\n }\n\n return !!(html && html.nodeType && html.nodeType === 1);\n}\n\n/**\n * Check whether the given variable is empty(null, undefined, or empty array, empty object) or not.
                          \n * If the given variables is empty, return true.\n * @param {*} obj - Target for checking\n * @returns {boolean} Is empty?\n * @memberof tui.util\n */\nfunction isEmpty(obj) {\n if (!isExisty(obj) || _isEmptyString(obj)) {\n return true;\n }\n\n if (isArray(obj) || isArguments(obj)) {\n return obj.length === 0;\n }\n\n if (isObject(obj) && !isFunction(obj)) {\n return !_hasOwnProperty(obj);\n }\n\n return true;\n}\n\n/**\n * Check whether given argument is empty string\n * @param {*} obj - Target for checking\n * @returns {boolean} whether given argument is empty string\n * @memberof tui.util\n * @private\n */\nfunction _isEmptyString(obj) {\n return isString(obj) && obj === '';\n}\n\n/**\n * Check whether given argument has own property\n * @param {Object} obj - Target for checking\n * @returns {boolean} - whether given argument has own property\n * @memberof tui.util\n * @private\n */\nfunction _hasOwnProperty(obj) {\n var key;\n for (key in obj) {\n if (obj.hasOwnProperty(key)) {\n return true;\n }\n }\n\n return false;\n}\n\n/**\n * Check whether the given variable is not empty\n * (not null, not undefined, or not empty array, not empty object) or not.
                          \n * If the given variables is not empty, return true.\n * @param {*} obj - Target for checking\n * @returns {boolean} Is not empty?\n * @memberof tui.util\n */\nfunction isNotEmpty(obj) {\n return !isEmpty(obj);\n}\n\n/**\n * Check whether the given variable is an instance of Date or not.
                          \n * If the given variables is an instance of Date, return true.\n * @param {*} obj - Target for checking\n * @returns {boolean} Is an instance of Date?\n * @memberof tui.util\n */\nfunction isDate(obj) {\n return obj instanceof Date;\n}\n\n/**\n * Check whether the given variable is an instance of Date or not.
                          \n * If the given variables is an instance of Date, return true.
                          \n * (It is used for multiple frame environments)\n * @param {*} obj - Target for checking\n * @returns {boolean} Is an instance of Date?\n * @memberof tui.util\n */\nfunction isDateSafe(obj) {\n return toString.call(obj) === '[object Date]';\n}\n\nmodule.exports = {\n isExisty: isExisty,\n isUndefined: isUndefined,\n isNull: isNull,\n isTruthy: isTruthy,\n isFalsy: isFalsy,\n isArguments: isArguments,\n isArray: isArray,\n isArraySafe: isArraySafe,\n isObject: isObject,\n isFunction: isFunction,\n isFunctionSafe: isFunctionSafe,\n isNumber: isNumber,\n isNumberSafe: isNumberSafe,\n isDate: isDate,\n isDateSafe: isDateSafe,\n isString: isString,\n isStringSafe: isStringSafe,\n isBoolean: isBoolean,\n isBooleanSafe: isBooleanSafe,\n isHTMLNode: isHTMLNode,\n isHTMLTag: isHTMLTag,\n isEmpty: isEmpty,\n isNotEmpty: isNotEmpty\n};\n\n\n//# sourceURL=webpack://tui.ImageEditor/./node_modules/tui-code-snippet/src/js/type.js?"); - -/***/ }), - -/***/ "./node_modules/webpack/buildin/global.js": -/*!***********************************!*\ - !*** (webpack)/buildin/global.js ***! - \***********************************/ -/*! no static exports found */ -/***/ (function(module, exports) { - -eval("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\n\n//# sourceURL=webpack://tui.ImageEditor/(webpack)/buildin/global.js?"); - -/***/ }), - -/***/ "./src/css/index.styl": -/*!****************************!*\ - !*** ./src/css/index.styl ***! - \****************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -eval("// extracted by mini-css-extract-plugin\n\n//# sourceURL=webpack://tui.ImageEditor/./src/css/index.styl?"); - -/***/ }), - -/***/ "./src/index.js": -/*!**********************!*\ - !*** ./src/index.js ***! - \**********************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; -eval("\n\n__webpack_require__(/*! ./js/polyfill */ \"./src/js/polyfill.js\");\n\nvar _imageEditor = __webpack_require__(/*! ./js/imageEditor */ \"./src/js/imageEditor.js\");\n\nvar _imageEditor2 = _interopRequireDefault(_imageEditor);\n\n__webpack_require__(/*! ./css/index.styl */ \"./src/css/index.styl\");\n\n__webpack_require__(/*! ./js/command/addIcon */ \"./src/js/command/addIcon.js\");\n\n__webpack_require__(/*! ./js/command/addImageObject */ \"./src/js/command/addImageObject.js\");\n\n__webpack_require__(/*! ./js/command/addObject */ \"./src/js/command/addObject.js\");\n\n__webpack_require__(/*! ./js/command/addShape */ \"./src/js/command/addShape.js\");\n\n__webpack_require__(/*! ./js/command/addText */ \"./src/js/command/addText.js\");\n\n__webpack_require__(/*! ./js/command/applyFilter */ \"./src/js/command/applyFilter.js\");\n\n__webpack_require__(/*! ./js/command/changeIconColor */ \"./src/js/command/changeIconColor.js\");\n\n__webpack_require__(/*! ./js/command/changeShape */ \"./src/js/command/changeShape.js\");\n\n__webpack_require__(/*! ./js/command/changeText */ \"./src/js/command/changeText.js\");\n\n__webpack_require__(/*! ./js/command/changeTextStyle */ \"./src/js/command/changeTextStyle.js\");\n\n__webpack_require__(/*! ./js/command/clearObjects */ \"./src/js/command/clearObjects.js\");\n\n__webpack_require__(/*! ./js/command/flip */ \"./src/js/command/flip.js\");\n\n__webpack_require__(/*! ./js/command/loadImage */ \"./src/js/command/loadImage.js\");\n\n__webpack_require__(/*! ./js/command/removeFilter */ \"./src/js/command/removeFilter.js\");\n\n__webpack_require__(/*! ./js/command/removeObject */ \"./src/js/command/removeObject.js\");\n\n__webpack_require__(/*! ./js/command/resizeCanvasDimension */ \"./src/js/command/resizeCanvasDimension.js\");\n\n__webpack_require__(/*! ./js/command/rotate */ \"./src/js/command/rotate.js\");\n\n__webpack_require__(/*! ./js/command/setObjectProperties */ \"./src/js/command/setObjectProperties.js\");\n\n__webpack_require__(/*! ./js/command/setObjectPosition */ \"./src/js/command/setObjectPosition.js\");\n\n__webpack_require__(/*! ./js/command/changeSelection */ \"./src/js/command/changeSelection.js\");\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\n// commands\nmodule.exports = _imageEditor2.default;\n\n//# sourceURL=webpack://tui.ImageEditor/./src/index.js?"); - -/***/ }), - -/***/ "./src/js/action.js": -/*!**************************!*\ - !*** ./src/js/action.js ***! - \**************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; -eval("\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _tuiCodeSnippet = __webpack_require__(/*! tui-code-snippet */ \"tui-code-snippet\");\n\nvar _util = __webpack_require__(/*! ./util */ \"./src/js/util.js\");\n\nvar _imagetracer = __webpack_require__(/*! ./helper/imagetracer */ \"./src/js/helper/imagetracer.js\");\n\nvar _imagetracer2 = _interopRequireDefault(_imagetracer);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nexports.default = {\n /**\n * Get ui actions\n * @returns {Object} actions for ui\n * @private\n */\n getActions: function 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 };\n },\n\n\n /**\n * Main Action\n * @returns {Object} actions for ui main\n * @private\n */\n _mainAction: function _mainAction() {\n var _this = this;\n\n var exitCropOnAction = function exitCropOnAction() {\n if (_this.ui.submenu === 'crop') {\n _this.stopDrawingMode();\n _this.ui.changeMenu('crop');\n }\n };\n var setAngleRangeBarOnAction = function setAngleRangeBarOnAction(angle) {\n if (_this.ui.submenu === 'rotate') {\n _this.ui.rotate.setRangeBarAngle('setAngle', angle);\n }\n };\n var setFilterStateRangeBarOnAction = function setFilterStateRangeBarOnAction(filterOptions) {\n if (_this.ui.submenu === 'filter') {\n _this.ui.filter.setFilterState(filterOptions);\n }\n };\n var onEndUndoRedo = function onEndUndoRedo(result) {\n setAngleRangeBarOnAction(result);\n setFilterStateRangeBarOnAction(result);\n\n return result;\n };\n\n return (0, _tuiCodeSnippet.extend)({\n initLoadImage: function initLoadImage(imagePath, imageName) {\n return _this.loadImageFromURL(imagePath, imageName).then(function (sizeValue) {\n exitCropOnAction();\n _this.ui.initializeImgUrl = imagePath;\n _this.ui.resizeEditor({ imageSize: sizeValue });\n _this.clearUndoStack();\n });\n },\n undo: function undo() {\n if (!_this.isEmptyUndoStack()) {\n exitCropOnAction();\n _this.deactivateAll();\n _this.undo().then(onEndUndoRedo);\n }\n },\n redo: function redo() {\n if (!_this.isEmptyRedoStack()) {\n exitCropOnAction();\n _this.deactivateAll();\n _this.redo().then(onEndUndoRedo);\n }\n },\n reset: function reset() {\n exitCropOnAction();\n _this.loadImageFromURL(_this.ui.initializeImgUrl, 'resetImage').then(function (sizeValue) {\n exitCropOnAction();\n _this.ui.resizeEditor({ imageSize: sizeValue });\n _this.clearUndoStack();\n });\n },\n delete: function _delete() {\n _this.ui.changeHelpButtonEnabled('delete', false);\n exitCropOnAction();\n _this.removeActiveObject();\n _this.activeObjectId = null;\n },\n deleteAll: function deleteAll() {\n exitCropOnAction();\n _this.clearObjects();\n _this.ui.changeHelpButtonEnabled('delete', false);\n _this.ui.changeHelpButtonEnabled('deleteAll', false);\n },\n load: function load(file) {\n if (!(0, _util.isSupportFileApi)()) {\n alert('This browser does not support file-api');\n }\n\n _this.ui.initializeImgUrl = URL.createObjectURL(file);\n _this.loadImageFromFile(file).then(function (sizeValue) {\n exitCropOnAction();\n _this.clearUndoStack();\n _this.ui.activeMenuEvent();\n _this.ui.resizeEditor({ imageSize: sizeValue });\n })['catch'](function (message) {\n return Promise.reject(message);\n });\n },\n download: function download() {\n var dataURL = _this.toDataURL();\n var imageName = _this.getImageName();\n var blob = void 0,\n type = void 0,\n w = void 0;\n\n if ((0, _util.isSupportFileApi)() && window.saveAs) {\n blob = (0, _util.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 }, this._commonAction());\n },\n\n\n /**\n * Icon Action\n * @returns {Object} actions for ui icon\n * @private\n */\n _iconAction: function _iconAction() {\n var _this2 = this;\n\n return (0, _tuiCodeSnippet.extend)({\n changeColor: function changeColor(color) {\n if (_this2.activeObjectId) {\n _this2.changeIconColor(_this2.activeObjectId, color);\n }\n },\n addIcon: function addIcon(iconType, iconColor) {\n _this2.startDrawingMode('ICON');\n _this2.setDrawingIcon(iconType, iconColor);\n },\n cancelAddIcon: function cancelAddIcon() {\n _this2.ui.icon.clearIconType();\n _this2.changeSelectableAll(true);\n _this2.changeCursor('default');\n _this2.stopDrawingMode();\n },\n registDefalutIcons: function registDefalutIcons(type, path) {\n var iconObj = {};\n iconObj[type] = path;\n _this2.registerIcons(iconObj);\n },\n registCustomIcon: function registCustomIcon(imgUrl, file) {\n var imagetracer = new _imagetracer2.default();\n imagetracer.imageToSVG(imgUrl, function (svgstr) {\n var _svgstr$match = svgstr.match(/path[^>]*d=\"([^\"]*)\"/),\n svgPath = _svgstr$match[1];\n\n var iconObj = {};\n iconObj[file.name] = svgPath;\n _this2.registerIcons(iconObj);\n _this2.addIcon(file.name, {\n left: 100,\n top: 100\n });\n }, _imagetracer2.default.tracerDefaultOption());\n }\n }, this._commonAction());\n },\n\n\n /**\n * Draw Action\n * @returns {Object} actions for ui draw\n * @private\n */\n _drawAction: function _drawAction() {\n var _this3 = this;\n\n return (0, _tuiCodeSnippet.extend)({\n setDrawMode: function setDrawMode(type, settings) {\n _this3.stopDrawingMode();\n if (type === 'free') {\n _this3.startDrawingMode('FREE_DRAWING', settings);\n } else {\n _this3.startDrawingMode('LINE_DRAWING', settings);\n }\n },\n setColor: function setColor(color) {\n _this3.setBrush({\n color: color\n });\n }\n }, this._commonAction());\n },\n\n\n /**\n * Mask Action\n * @returns {Object} actions for ui mask\n * @private\n */\n _maskAction: function _maskAction() {\n var _this4 = this;\n\n return (0, _tuiCodeSnippet.extend)({\n loadImageFromURL: function loadImageFromURL(imgUrl, file) {\n return _this4.loadImageFromURL(_this4.toDataURL(), 'FilterImage').then(function () {\n _this4.addImageObject(imgUrl).then(function () {\n URL.revokeObjectURL(file);\n });\n });\n },\n applyFilter: function applyFilter() {\n _this4.applyFilter('mask', {\n maskObjId: _this4.activeObjectId\n });\n }\n }, this._commonAction());\n },\n\n\n /**\n * Text Action\n * @returns {Object} actions for ui text\n * @private\n */\n _textAction: function _textAction() {\n var _this5 = this;\n\n return (0, _tuiCodeSnippet.extend)({\n changeTextStyle: function changeTextStyle(styleObj, isSilent) {\n if (_this5.activeObjectId) {\n _this5.changeTextStyle(_this5.activeObjectId, styleObj, isSilent);\n }\n }\n }, this._commonAction());\n },\n\n\n /**\n * Rotate Action\n * @returns {Object} actions for ui rotate\n * @private\n */\n _rotateAction: function _rotateAction() {\n var _this6 = this;\n\n return (0, _tuiCodeSnippet.extend)({\n rotate: function rotate(angle, isSilent) {\n _this6.rotate(angle, isSilent);\n _this6.ui.resizeEditor();\n _this6.ui.rotate.setRangeBarAngle('rotate', angle);\n },\n setAngle: function setAngle(angle, isSilent) {\n _this6.setAngle(angle, isSilent);\n _this6.ui.resizeEditor();\n _this6.ui.rotate.setRangeBarAngle('setAngle', angle);\n }\n }, this._commonAction());\n },\n\n\n /**\n * Shape Action\n * @returns {Object} actions for ui shape\n * @private\n */\n _shapeAction: function _shapeAction() {\n var _this7 = this;\n\n return (0, _tuiCodeSnippet.extend)({\n changeShape: function changeShape(changeShapeObject, isSilent) {\n if (_this7.activeObjectId) {\n _this7.changeShape(_this7.activeObjectId, changeShapeObject, isSilent);\n }\n },\n setDrawingShape: function setDrawingShape(shapeType) {\n _this7.setDrawingShape(shapeType);\n }\n }, this._commonAction());\n },\n\n\n /**\n * Crop Action\n * @returns {Object} actions for ui crop\n * @private\n */\n _cropAction: function _cropAction() {\n var _this8 = this;\n\n return (0, _tuiCodeSnippet.extend)({\n crop: function crop() {\n var cropRect = _this8.getCropzoneRect();\n if (cropRect) {\n _this8.crop(cropRect).then(function () {\n _this8.stopDrawingMode();\n _this8.ui.resizeEditor();\n _this8.ui.changeMenu('crop');\n })['catch'](function (message) {\n return Promise.reject(message);\n });\n }\n },\n cancel: function cancel() {\n _this8.stopDrawingMode();\n _this8.ui.changeMenu('crop');\n },\n /* eslint-disable */\n preset: function preset(presetType) {\n switch (presetType) {\n case 'preset-square':\n _this8.setCropzoneRect(1 / 1);\n break;\n case 'preset-3-2':\n _this8.setCropzoneRect(3 / 2);\n break;\n case 'preset-4-3':\n _this8.setCropzoneRect(4 / 3);\n break;\n case 'preset-5-4':\n _this8.setCropzoneRect(5 / 4);\n break;\n case 'preset-7-5':\n _this8.setCropzoneRect(7 / 5);\n break;\n case 'preset-16-9':\n _this8.setCropzoneRect(16 / 9);\n break;\n default:\n _this8.setCropzoneRect();\n _this8.ui.crop.changeApplyButtonStatus(false);\n break;\n }\n }\n }, this._commonAction());\n },\n\n\n /**\n * Flip Action\n * @returns {Object} actions for ui flip\n * @private\n */\n _flipAction: function _flipAction() {\n var _this9 = this;\n\n return (0, _tuiCodeSnippet.extend)({\n flip: function flip(flipType) {\n return _this9[flipType]();\n }\n }, this._commonAction());\n },\n\n\n /**\n * Filter Action\n * @returns {Object} actions for ui filter\n * @private\n */\n _filterAction: function _filterAction() {\n var _this10 = this;\n\n return (0, _tuiCodeSnippet.extend)({\n applyFilter: function applyFilter(applying, type, options, isSilent) {\n if (applying) {\n _this10.applyFilter(type, options, isSilent);\n } else if (_this10.hasFilter(type)) {\n _this10.removeFilter(type);\n }\n }\n }, this._commonAction());\n },\n\n\n /**\n * Image Editor Event Observer\n */\n setReAction: function setReAction() {\n var _this11 = this;\n\n this.on({\n undoStackChanged: function undoStackChanged(length) {\n if (length) {\n _this11.ui.changeHelpButtonEnabled('undo', true);\n _this11.ui.changeHelpButtonEnabled('reset', true);\n } else {\n _this11.ui.changeHelpButtonEnabled('undo', false);\n _this11.ui.changeHelpButtonEnabled('reset', false);\n }\n _this11.ui.resizeEditor();\n },\n redoStackChanged: function redoStackChanged(length) {\n if (length) {\n _this11.ui.changeHelpButtonEnabled('redo', true);\n } else {\n _this11.ui.changeHelpButtonEnabled('redo', false);\n }\n _this11.ui.resizeEditor();\n },\n /* eslint-disable complexity */\n objectActivated: function objectActivated(obj) {\n _this11.activeObjectId = obj.id;\n\n _this11.ui.changeHelpButtonEnabled('delete', true);\n _this11.ui.changeHelpButtonEnabled('deleteAll', true);\n\n if (obj.type === 'cropzone') {\n _this11.ui.crop.changeApplyButtonStatus(true);\n } else if (['rect', 'circle', 'triangle'].indexOf(obj.type) > -1) {\n _this11.stopDrawingMode();\n if (_this11.ui.submenu !== 'shape') {\n _this11.ui.changeMenu('shape', false, false);\n }\n _this11.ui.shape.setShapeStatus({\n strokeColor: obj.stroke,\n strokeWidth: obj.strokeWidth,\n fillColor: obj.fill\n });\n\n _this11.ui.shape.setMaxStrokeValue(Math.min(obj.width, obj.height));\n } else if (obj.type === 'path' || obj.type === 'line') {\n if (_this11.ui.submenu !== 'draw') {\n _this11.ui.changeMenu('draw', false, false);\n _this11.ui.draw.changeStandbyMode();\n }\n } else if (['i-text', 'text'].indexOf(obj.type) > -1) {\n if (_this11.ui.submenu !== 'text') {\n _this11.ui.changeMenu('text', false, false);\n }\n\n _this11.ui.text.setTextStyleStateOnAction(obj);\n } else if (obj.type === 'icon') {\n _this11.stopDrawingMode();\n if (_this11.ui.submenu !== 'icon') {\n _this11.ui.changeMenu('icon', false, false);\n }\n _this11.ui.icon.setIconPickerColor(obj.fill);\n }\n },\n /* eslint-enable complexity */\n addText: function addText(pos) {\n var _ui$text = _this11.ui.text,\n fill = _ui$text.textColor,\n fontSize = _ui$text.fontSize,\n fontStyle = _ui$text.fontStyle,\n fontWeight = _ui$text.fontWeight,\n underline = _ui$text.underline;\n\n var fontFamily = 'Noto Sans';\n\n _this11.addText('Double Click', {\n position: pos.originPosition,\n styles: { fill: fill, fontSize: fontSize, fontFamily: fontFamily, fontStyle: fontStyle, fontWeight: fontWeight, underline: underline }\n }).then(function () {\n _this11.changeCursor('default');\n });\n },\n addObjectAfter: function addObjectAfter(obj) {\n if (obj.type === 'icon') {\n _this11.ui.icon.changeStandbyMode();\n } else if (['rect', 'circle', 'triangle'].indexOf(obj.type) > -1) {\n _this11.ui.shape.setMaxStrokeValue(Math.min(obj.width, obj.height));\n _this11.ui.shape.changeStandbyMode();\n }\n },\n objectScaled: function objectScaled(obj) {\n if (['i-text', 'text'].indexOf(obj.type) > -1) {\n _this11.ui.text.fontSize = (0, _util.toInteger)(obj.fontSize);\n } else if (['rect', 'circle', 'triangle'].indexOf(obj.type) >= 0) {\n var width = obj.width,\n height = obj.height;\n\n var strokeValue = _this11.ui.shape.getStrokeValue();\n\n if (width < strokeValue) {\n _this11.ui.shape.setStrokeValue(width);\n }\n if (height < strokeValue) {\n _this11.ui.shape.setStrokeValue(height);\n }\n }\n },\n selectionCleared: function selectionCleared() {\n _this11.activeObjectId = null;\n if (_this11.ui.submenu === 'text') {\n _this11.changeCursor('text');\n } else if (_this11.ui.submenu !== 'draw' && _this11.ui.submenu !== 'crop') {\n _this11.stopDrawingMode();\n }\n }\n });\n },\n\n\n /**\n * Common Action\n * @returns {Object} common actions for ui\n * @private\n */\n _commonAction: function _commonAction() {\n var _this12 = this;\n\n return {\n modeChange: function modeChange(menu) {\n switch (menu) {\n case 'text':\n _this12._changeActivateMode('TEXT');\n break;\n case 'crop':\n _this12.startDrawingMode('CROPPER');\n break;\n case 'shape':\n _this12._changeActivateMode('SHAPE');\n _this12.setDrawingShape(_this12.ui.shape.type, _this12.ui.shape.options);\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 /**\n * Mixin\n * @param {ImageEditor} ImageEditor instance\n */\n mixin: function mixin(ImageEditor) {\n (0, _tuiCodeSnippet.extend)(ImageEditor.prototype, this);\n }\n};\n\n//# sourceURL=webpack://tui.ImageEditor/./src/js/action.js?"); - -/***/ }), - -/***/ "./src/js/command/addIcon.js": -/*!***********************************!*\ - !*** ./src/js/command/addIcon.js ***! - \***********************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; -eval("\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _command = __webpack_require__(/*! ../factory/command */ \"./src/js/factory/command.js\");\n\nvar _command2 = _interopRequireDefault(_command);\n\nvar _util = __webpack_require__(/*! ../util */ \"./src/js/util.js\");\n\nvar _consts = __webpack_require__(/*! ../consts */ \"./src/js/consts.js\");\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nvar ICON = _consts.componentNames.ICON; /**\n * @author NHN Ent. FE Development Team \n * @fileoverview Add an icon\n */\n\nvar command = {\n name: _consts.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: function execute(graphics, type, options) {\n var _this = this;\n\n var iconComp = graphics.getComponent(ICON);\n\n return iconComp.add(type, options).then(function (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: function undo(graphics) {\n graphics.remove(this.undoData.object);\n\n return _util.Promise.resolve();\n }\n};\n\n_command2.default.register(command);\n\nexports.default = command;\n\n//# sourceURL=webpack://tui.ImageEditor/./src/js/command/addIcon.js?"); - -/***/ }), - -/***/ "./src/js/command/addImageObject.js": -/*!******************************************!*\ - !*** ./src/js/command/addImageObject.js ***! - \******************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; -eval("\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _command = __webpack_require__(/*! ../factory/command */ \"./src/js/factory/command.js\");\n\nvar _command2 = _interopRequireDefault(_command);\n\nvar _util = __webpack_require__(/*! ../util */ \"./src/js/util.js\");\n\nvar _consts = __webpack_require__(/*! ../consts */ \"./src/js/consts.js\");\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nvar command = {\n name: _consts.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: function execute(graphics, imgUrl) {\n var _this = this;\n\n return graphics.addImageObject(imgUrl).then(function (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: function undo(graphics) {\n graphics.remove(this.undoData.object);\n\n return _util.Promise.resolve();\n }\n}; /**\n * @author NHN Ent. FE Development Team \n * @fileoverview Add an image object\n */\n\n\n_command2.default.register(command);\n\nexports.default = command;\n\n//# sourceURL=webpack://tui.ImageEditor/./src/js/command/addImageObject.js?"); - -/***/ }), - -/***/ "./src/js/command/addObject.js": -/*!*************************************!*\ - !*** ./src/js/command/addObject.js ***! - \*************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; -eval("\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _command = __webpack_require__(/*! ../factory/command */ \"./src/js/factory/command.js\");\n\nvar _command2 = _interopRequireDefault(_command);\n\nvar _util = __webpack_require__(/*! ../util */ \"./src/js/util.js\");\n\nvar _consts = __webpack_require__(/*! ../consts */ \"./src/js/consts.js\");\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nvar command = {\n name: _consts.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: function execute(graphics, object) {\n return new _util.Promise(function (resolve, reject) {\n if (!graphics.contains(object)) {\n graphics.add(object);\n resolve(object);\n } else {\n reject(_consts.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: function undo(graphics, object) {\n return new _util.Promise(function (resolve, reject) {\n if (graphics.contains(object)) {\n graphics.remove(object);\n resolve(object);\n } else {\n reject(_consts.rejectMessages.noObject);\n }\n });\n }\n}; /**\n * @author NHN Ent. FE Development Team \n * @fileoverview Add an object\n */\n\n\n_command2.default.register(command);\n\nexports.default = command;\n\n//# sourceURL=webpack://tui.ImageEditor/./src/js/command/addObject.js?"); - -/***/ }), - -/***/ "./src/js/command/addShape.js": -/*!************************************!*\ - !*** ./src/js/command/addShape.js ***! - \************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; -eval("\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _command = __webpack_require__(/*! ../factory/command */ \"./src/js/factory/command.js\");\n\nvar _command2 = _interopRequireDefault(_command);\n\nvar _util = __webpack_require__(/*! ../util */ \"./src/js/util.js\");\n\nvar _consts = __webpack_require__(/*! ../consts */ \"./src/js/consts.js\");\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nvar SHAPE = _consts.componentNames.SHAPE; /**\n * @author NHN Ent. FE Development Team \n * @fileoverview Add a shape\n */\n\nvar command = {\n name: _consts.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: function execute(graphics, type, options) {\n var _this = this;\n\n var shapeComp = graphics.getComponent(SHAPE);\n\n return shapeComp.add(type, options).then(function (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: function undo(graphics) {\n graphics.remove(this.undoData.object);\n\n return _util.Promise.resolve();\n }\n};\n\n_command2.default.register(command);\n\nexports.default = command;\n\n//# sourceURL=webpack://tui.ImageEditor/./src/js/command/addShape.js?"); - -/***/ }), - -/***/ "./src/js/command/addText.js": -/*!***********************************!*\ - !*** ./src/js/command/addText.js ***! - \***********************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; -eval("\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _command = __webpack_require__(/*! ../factory/command */ \"./src/js/factory/command.js\");\n\nvar _command2 = _interopRequireDefault(_command);\n\nvar _util = __webpack_require__(/*! ../util */ \"./src/js/util.js\");\n\nvar _consts = __webpack_require__(/*! ../consts */ \"./src/js/consts.js\");\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nvar TEXT = _consts.componentNames.TEXT; /**\n * @author NHN Ent. FE Development Team \n * @fileoverview Add a text object\n */\n\nvar command = {\n name: _consts.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: function execute(graphics, text, options) {\n var _this = this;\n\n var textComp = graphics.getComponent(TEXT);\n\n if (this.undoData.object) {\n var undoObject = this.undoData.object;\n\n return new _util.Promise(function (resolve, reject) {\n if (!graphics.contains(undoObject)) {\n graphics.add(undoObject);\n resolve(undoObject);\n } else {\n reject(_consts.rejectMessages.redo);\n }\n });\n }\n\n return textComp.add(text, options).then(function (objectProps) {\n var id = objectProps.id;\n\n var textObject = graphics.getObject(id);\n\n _this.undoData.object = textObject;\n\n return objectProps;\n });\n },\n\n /**\n * @param {Graphics} graphics - Graphics instance\n * @returns {Promise}\n */\n undo: function undo(graphics) {\n graphics.remove(this.undoData.object);\n\n return _util.Promise.resolve();\n }\n};\n\n_command2.default.register(command);\n\nexports.default = command;\n\n//# sourceURL=webpack://tui.ImageEditor/./src/js/command/addText.js?"); - -/***/ }), - -/***/ "./src/js/command/applyFilter.js": -/*!***************************************!*\ - !*** ./src/js/command/applyFilter.js ***! - \***************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; -eval("\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _tuiCodeSnippet = __webpack_require__(/*! tui-code-snippet */ \"tui-code-snippet\");\n\nvar _tuiCodeSnippet2 = _interopRequireDefault(_tuiCodeSnippet);\n\nvar _command = __webpack_require__(/*! ../factory/command */ \"./src/js/factory/command.js\");\n\nvar _command2 = _interopRequireDefault(_command);\n\nvar _consts = __webpack_require__(/*! ../consts */ \"./src/js/consts.js\");\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nvar FILTER = _consts.componentNames.FILTER;\n\n/**\n * Chched data for undo\n * @type {Object}\n */\n/**\n * @author NHN Ent. FE Development Team \n * @fileoverview Apply a filter into an image\n */\n\nvar chchedUndoDataForSilent = 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 var undoData = {};\n\n if (type === 'mask') {\n undoData.object = options.mask;\n }\n\n undoData.options = prevfilterOption;\n\n return undoData;\n}\n\nvar command = {\n name: _consts.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: function execute(graphics, type, options, isSilent) {\n var filterComp = graphics.getComponent(FILTER);\n\n if (type === 'mask') {\n var maskObj = graphics.getObject(options.maskObjId);\n\n if (!(maskObj && maskObj.isType('image'))) {\n return Promise.reject(_consts.rejectMessages.invalidParameters);\n }\n\n _tuiCodeSnippet2.default.extend(options, { mask: maskObj });\n graphics.remove(options.mask);\n }\n if (!this.isRedo) {\n var prevfilterOption = filterComp.getOptions(type);\n var undoData = makeUndoData(type, prevfilterOption, options);\n\n chchedUndoDataForSilent = this.setUndoData(undoData, chchedUndoDataForSilent, 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: function undo(graphics, type) {\n var filterComp = graphics.getComponent(FILTER);\n\n if (type === 'mask') {\n var 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\n_command2.default.register(command);\n\nexports.default = command;\n\n//# sourceURL=webpack://tui.ImageEditor/./src/js/command/applyFilter.js?"); - -/***/ }), - -/***/ "./src/js/command/changeIconColor.js": -/*!*******************************************!*\ - !*** ./src/js/command/changeIconColor.js ***! - \*******************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; -eval("\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _command = __webpack_require__(/*! ../factory/command */ \"./src/js/factory/command.js\");\n\nvar _command2 = _interopRequireDefault(_command);\n\nvar _util = __webpack_require__(/*! ../util */ \"./src/js/util.js\");\n\nvar _consts = __webpack_require__(/*! ../consts */ \"./src/js/consts.js\");\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nvar ICON = _consts.componentNames.ICON; /**\n * @author NHN Ent. FE Development Team \n * @fileoverview Change icon color\n */\n\nvar command = {\n name: _consts.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: function execute(graphics, id, color) {\n var _this = this;\n\n return new _util.Promise(function (resolve, reject) {\n var iconComp = graphics.getComponent(ICON);\n var targetObj = graphics.getObject(id);\n\n if (!targetObj) {\n reject(_consts.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: function undo(graphics) {\n var iconComp = graphics.getComponent(ICON);\n var _undoData = this.undoData,\n icon = _undoData.object,\n color = _undoData.color;\n\n\n iconComp.setColor(color, icon);\n\n return _util.Promise.resolve();\n }\n};\n\n_command2.default.register(command);\n\nexports.default = command;\n\n//# sourceURL=webpack://tui.ImageEditor/./src/js/command/changeIconColor.js?"); - -/***/ }), - -/***/ "./src/js/command/changeSelection.js": -/*!*******************************************!*\ - !*** ./src/js/command/changeSelection.js ***! - \*******************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; -eval("\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _command = __webpack_require__(/*! ../factory/command */ \"./src/js/factory/command.js\");\n\nvar _command2 = _interopRequireDefault(_command);\n\nvar _util = __webpack_require__(/*! ../util */ \"./src/js/util.js\");\n\nvar _consts = __webpack_require__(/*! ../consts */ \"./src/js/consts.js\");\n\nvar _selectionModifyHelper = __webpack_require__(/*! ../helper/selectionModifyHelper */ \"./src/js/helper/selectionModifyHelper.js\");\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\n/**\n * @author NHN. FE Development Team \n * @fileoverview change selection\n */\nvar command = {\n name: _consts.commandNames.CHANGE_SELECTION,\n\n execute: function execute(graphics, props) {\n if (this.isRedo) {\n props.forEach(function (prop) {\n graphics.setObjectProperties(prop.id, prop);\n });\n } else {\n this.undoData = (0, _selectionModifyHelper.getCachedUndoDataForDimension)();\n }\n\n return _util.Promise.resolve();\n },\n undo: function undo(graphics) {\n this.undoData.forEach(function (datum) {\n graphics.setObjectProperties(datum.id, datum);\n });\n\n return _util.Promise.resolve();\n }\n};\n\n_command2.default.register(command);\n\nexports.default = command;\n\n//# sourceURL=webpack://tui.ImageEditor/./src/js/command/changeSelection.js?"); - -/***/ }), - -/***/ "./src/js/command/changeShape.js": -/*!***************************************!*\ - !*** ./src/js/command/changeShape.js ***! - \***************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; -eval("\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _tuiCodeSnippet = __webpack_require__(/*! tui-code-snippet */ \"tui-code-snippet\");\n\nvar _tuiCodeSnippet2 = _interopRequireDefault(_tuiCodeSnippet);\n\nvar _util = __webpack_require__(/*! ../util */ \"./src/js/util.js\");\n\nvar _command = __webpack_require__(/*! ../factory/command */ \"./src/js/factory/command.js\");\n\nvar _command2 = _interopRequireDefault(_command);\n\nvar _consts = __webpack_require__(/*! ../consts */ \"./src/js/consts.js\");\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\n/**\n * @author NHN Ent. FE Development Team \n * @fileoverview change a shape\n */\nvar SHAPE = _consts.componentNames.SHAPE;\n\n/**\n * Chched data for undo\n * @type {Object}\n */\n\nvar chchedUndoDataForSilent = 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 var undoData = {\n object: targetObj,\n options: {}\n };\n\n _tuiCodeSnippet2.default.forEachOwnProperties(options, function (value, key) {\n undoData.options[key] = targetObj[key];\n });\n\n return undoData;\n}\n\nvar command = {\n name: _consts.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: function execute(graphics, id, options, isSilent) {\n var shapeComp = graphics.getComponent(SHAPE);\n var targetObj = graphics.getObject(id);\n\n if (!targetObj) {\n return _util.Promise.reject(_consts.rejectMessages.noObject);\n }\n\n if (!this.isRedo) {\n var undoData = makeUndoData(options, targetObj);\n\n chchedUndoDataForSilent = this.setUndoData(undoData, chchedUndoDataForSilent, isSilent);\n }\n\n return shapeComp.change(targetObj, options);\n },\n\n /**\n * @param {Graphics} graphics - Graphics instance\n * @returns {Promise}\n */\n undo: function undo(graphics) {\n var shapeComp = graphics.getComponent(SHAPE);\n var _undoData = this.undoData,\n shape = _undoData.object,\n options = _undoData.options;\n\n\n return shapeComp.change(shape, options);\n }\n};\n\n_command2.default.register(command);\n\nexports.default = command;\n\n//# sourceURL=webpack://tui.ImageEditor/./src/js/command/changeShape.js?"); - -/***/ }), - -/***/ "./src/js/command/changeText.js": -/*!**************************************!*\ - !*** ./src/js/command/changeText.js ***! - \**************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; -eval("\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _command = __webpack_require__(/*! ../factory/command */ \"./src/js/factory/command.js\");\n\nvar _command2 = _interopRequireDefault(_command);\n\nvar _util = __webpack_require__(/*! ../util */ \"./src/js/util.js\");\n\nvar _consts = __webpack_require__(/*! ../consts */ \"./src/js/consts.js\");\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nvar TEXT = _consts.componentNames.TEXT; /**\n * @author NHN Ent. FE Development Team \n * @fileoverview Change a text\n */\n\nvar command = {\n name: _consts.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: function execute(graphics, id, text) {\n var textComp = graphics.getComponent(TEXT);\n var targetObj = graphics.getObject(id);\n\n if (!targetObj) {\n return _util.Promise.reject(_consts.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: function undo(graphics) {\n var textComp = graphics.getComponent(TEXT);\n var _undoData = this.undoData,\n textObj = _undoData.object,\n text = _undoData.text;\n\n\n return textComp.change(textObj, text);\n }\n};\n\n_command2.default.register(command);\n\nexports.default = command;\n\n//# sourceURL=webpack://tui.ImageEditor/./src/js/command/changeText.js?"); - -/***/ }), - -/***/ "./src/js/command/changeTextStyle.js": -/*!*******************************************!*\ - !*** ./src/js/command/changeTextStyle.js ***! - \*******************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; -eval("\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _tuiCodeSnippet = __webpack_require__(/*! tui-code-snippet */ \"tui-code-snippet\");\n\nvar _tuiCodeSnippet2 = _interopRequireDefault(_tuiCodeSnippet);\n\nvar _command = __webpack_require__(/*! ../factory/command */ \"./src/js/factory/command.js\");\n\nvar _command2 = _interopRequireDefault(_command);\n\nvar _util = __webpack_require__(/*! ../util */ \"./src/js/util.js\");\n\nvar _consts = __webpack_require__(/*! ../consts */ \"./src/js/consts.js\");\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\n/**\n * @author NHN Ent. FE Development Team \n * @fileoverview Change text styles\n */\nvar TEXT = _consts.componentNames.TEXT;\n\n/**\n * Chched data for undo\n * @type {Object}\n */\n\nvar chchedUndoDataForSilent = 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 var undoData = {\n object: targetObj,\n styles: {}\n };\n _tuiCodeSnippet2.default.forEachOwnProperties(styles, function (value, key) {\n var undoValue = targetObj[key];\n undoData.styles[key] = undoValue;\n });\n\n return undoData;\n}\n\nvar command = {\n name: _consts.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: function execute(graphics, id, styles, isSilent) {\n var textComp = graphics.getComponent(TEXT);\n var targetObj = graphics.getObject(id);\n\n if (!targetObj) {\n return _util.Promise.reject(_consts.rejectMessages.noObject);\n }\n if (!this.isRedo) {\n var undoData = makeUndoData(styles, targetObj);\n\n chchedUndoDataForSilent = this.setUndoData(undoData, chchedUndoDataForSilent, isSilent);\n }\n\n return textComp.setStyle(targetObj, styles);\n },\n\n /**\n * @param {Graphics} graphics - Graphics instance\n * @returns {Promise}\n */\n undo: function undo(graphics) {\n var textComp = graphics.getComponent(TEXT);\n var _undoData = this.undoData,\n textObj = _undoData.object,\n styles = _undoData.styles;\n\n\n return textComp.setStyle(textObj, styles);\n }\n};\n\n_command2.default.register(command);\n\nexports.default = command;\n\n//# sourceURL=webpack://tui.ImageEditor/./src/js/command/changeTextStyle.js?"); - -/***/ }), - -/***/ "./src/js/command/clearObjects.js": -/*!****************************************!*\ - !*** ./src/js/command/clearObjects.js ***! - \****************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; -eval("\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _command = __webpack_require__(/*! ../factory/command */ \"./src/js/factory/command.js\");\n\nvar _command2 = _interopRequireDefault(_command);\n\nvar _util = __webpack_require__(/*! ../util */ \"./src/js/util.js\");\n\nvar _consts = __webpack_require__(/*! ../consts */ \"./src/js/consts.js\");\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nvar command = {\n name: _consts.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: function execute(graphics) {\n var _this = this;\n\n return new _util.Promise(function (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: function undo(graphics) {\n graphics.add(this.undoData.objects);\n\n return _util.Promise.resolve();\n }\n}; /**\n * @author NHN Ent. FE Development Team \n * @fileoverview Clear all objects\n */\n\n\n_command2.default.register(command);\n\nexports.default = command;\n\n//# sourceURL=webpack://tui.ImageEditor/./src/js/command/clearObjects.js?"); - -/***/ }), - -/***/ "./src/js/command/flip.js": -/*!********************************!*\ - !*** ./src/js/command/flip.js ***! - \********************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; -eval("\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _command = __webpack_require__(/*! ../factory/command */ \"./src/js/factory/command.js\");\n\nvar _command2 = _interopRequireDefault(_command);\n\nvar _consts = __webpack_require__(/*! ../consts */ \"./src/js/consts.js\");\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\n/**\n * @author NHN Ent. FE Development Team \n * @fileoverview Flip an image\n */\nvar FLIP = _consts.componentNames.FLIP;\n\n\nvar command = {\n name: _consts.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: function execute(graphics, type) {\n var 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: function undo(graphics) {\n var flipComp = graphics.getComponent(FLIP);\n\n return flipComp.set(this.undoData.setting);\n }\n};\n\n_command2.default.register(command);\n\nexports.default = command;\n\n//# sourceURL=webpack://tui.ImageEditor/./src/js/command/flip.js?"); - -/***/ }), - -/***/ "./src/js/command/loadImage.js": -/*!*************************************!*\ - !*** ./src/js/command/loadImage.js ***! - \*************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; -eval("\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _command = __webpack_require__(/*! ../factory/command */ \"./src/js/factory/command.js\");\n\nvar _command2 = _interopRequireDefault(_command);\n\nvar _consts = __webpack_require__(/*! ../consts */ \"./src/js/consts.js\");\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\n/**\n * @author NHN Ent. FE Development Team \n * @fileoverview Load a background (main) image\n */\nvar IMAGE_LOADER = _consts.componentNames.IMAGE_LOADER;\n\n\nvar command = {\n name: _consts.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: function execute(graphics, imageName, imgUrl) {\n var loader = graphics.getComponent(IMAGE_LOADER);\n var prevImage = loader.getCanvasImage();\n var prevImageWidth = prevImage ? prevImage.width : 0;\n var prevImageHeight = prevImage ? prevImage.height : 0;\n var objects = graphics.removeAll(true).filter(function (objectItem) {\n return objectItem.type !== 'cropzone';\n });\n\n objects.forEach(function (objectItem) {\n objectItem.evented = true;\n });\n\n this.undoData = {\n name: loader.getImageName(),\n image: prevImage,\n objects: objects\n };\n\n return loader.load(imageName, imgUrl).then(function (newImage) {\n return {\n oldWidth: prevImageWidth,\n oldHeight: prevImageHeight,\n newWidth: newImage.width,\n newHeight: newImage.height\n };\n });\n },\n\n\n /**\n * @param {Graphics} graphics - Graphics instance\n * @returns {Promise}\n */\n undo: function undo(graphics) {\n var loader = graphics.getComponent(IMAGE_LOADER);\n var _undoData = this.undoData,\n objects = _undoData.objects,\n name = _undoData.name,\n image = _undoData.image;\n\n\n graphics.removeAll(true);\n graphics.add(objects);\n\n return loader.load(name, image);\n }\n};\n\n_command2.default.register(command);\n\nexports.default = command;\n\n//# sourceURL=webpack://tui.ImageEditor/./src/js/command/loadImage.js?"); - -/***/ }), - -/***/ "./src/js/command/removeFilter.js": -/*!****************************************!*\ - !*** ./src/js/command/removeFilter.js ***! - \****************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; -eval("\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _command = __webpack_require__(/*! ../factory/command */ \"./src/js/factory/command.js\");\n\nvar _command2 = _interopRequireDefault(_command);\n\nvar _consts = __webpack_require__(/*! ../consts */ \"./src/js/consts.js\");\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\n/**\n * @author NHN Ent. FE Development Team \n * @fileoverview Remove a filter from an image\n */\nvar FILTER = _consts.componentNames.FILTER;\n\n\nvar command = {\n name: _consts.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: function execute(graphics, type) {\n var 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: function undo(graphics, type) {\n var filterComp = graphics.getComponent(FILTER);\n var options = this.undoData.options;\n\n\n return filterComp.add(type, options);\n }\n};\n\n_command2.default.register(command);\n\nexports.default = command;\n\n//# sourceURL=webpack://tui.ImageEditor/./src/js/command/removeFilter.js?"); - -/***/ }), - -/***/ "./src/js/command/removeObject.js": -/*!****************************************!*\ - !*** ./src/js/command/removeObject.js ***! - \****************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; -eval("\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _command = __webpack_require__(/*! ../factory/command */ \"./src/js/factory/command.js\");\n\nvar _command2 = _interopRequireDefault(_command);\n\nvar _util = __webpack_require__(/*! ../util */ \"./src/js/util.js\");\n\nvar _consts = __webpack_require__(/*! ../consts */ \"./src/js/consts.js\");\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nvar command = {\n name: _consts.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: function execute(graphics, id) {\n var _this = this;\n\n return new _util.Promise(function (resolve, reject) {\n _this.undoData.objects = graphics.removeObjectById(id);\n if (_this.undoData.objects.length) {\n resolve();\n } else {\n reject(_consts.rejectMessages.noObject);\n }\n });\n },\n\n /**\n * @param {Graphics} graphics - Graphics instance\n * @returns {Promise}\n */\n undo: function undo(graphics) {\n graphics.add(this.undoData.objects);\n\n return _util.Promise.resolve();\n }\n}; /**\n * @author NHN Ent. FE Development Team \n * @fileoverview Remove an object\n */\n\n\n_command2.default.register(command);\n\nexports.default = command;\n\n//# sourceURL=webpack://tui.ImageEditor/./src/js/command/removeObject.js?"); - -/***/ }), - -/***/ "./src/js/command/resizeCanvasDimension.js": -/*!*************************************************!*\ - !*** ./src/js/command/resizeCanvasDimension.js ***! - \*************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; -eval("\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _command = __webpack_require__(/*! ../factory/command */ \"./src/js/factory/command.js\");\n\nvar _command2 = _interopRequireDefault(_command);\n\nvar _util = __webpack_require__(/*! ../util */ \"./src/js/util.js\");\n\nvar _consts = __webpack_require__(/*! ../consts */ \"./src/js/consts.js\");\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nvar command = {\n name: _consts.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: function execute(graphics, dimension) {\n var _this = this;\n\n return new _util.Promise(function (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: function undo(graphics) {\n graphics.setCssMaxDimension(this.undoData.size);\n graphics.adjustCanvasDimension();\n\n return _util.Promise.resolve();\n }\n}; /**\n * @author NHN Ent. FE Development Team \n * @fileoverview Resize a canvas\n */\n\n\n_command2.default.register(command);\n\nexports.default = command;\n\n//# sourceURL=webpack://tui.ImageEditor/./src/js/command/resizeCanvasDimension.js?"); - -/***/ }), - -/***/ "./src/js/command/rotate.js": -/*!**********************************!*\ - !*** ./src/js/command/rotate.js ***! - \**********************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; -eval("\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _command = __webpack_require__(/*! ../factory/command */ \"./src/js/factory/command.js\");\n\nvar _command2 = _interopRequireDefault(_command);\n\nvar _consts = __webpack_require__(/*! ../consts */ \"./src/js/consts.js\");\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\n/**\n * @author NHN Ent. FE Development Team \n * @fileoverview Rotate an image\n */\nvar ROTATION = _consts.componentNames.ROTATION;\n\n/**\n * Chched data for undo\n * @type {Object}\n */\n\nvar chchedUndoDataForSilent = 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\nvar command = {\n name: _consts.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: function execute(graphics, type, angle, isSilent) {\n var rotationComp = graphics.getComponent(ROTATION);\n\n if (!this.isRedo) {\n var undoData = makeUndoData(rotationComp);\n\n chchedUndoDataForSilent = this.setUndoData(undoData, chchedUndoDataForSilent, isSilent);\n }\n\n return rotationComp[type](angle);\n },\n\n /**\n * @param {Graphics} graphics - Graphics instance\n * @returns {Promise}\n */\n undo: function undo(graphics) {\n var rotationComp = graphics.getComponent(ROTATION);\n var _args = this.args,\n type = _args[1],\n angle = _args[2];\n\n\n if (type === 'setAngle') {\n return rotationComp[type](this.undoData.angle);\n }\n\n return rotationComp.rotate(-angle);\n }\n};\n\n_command2.default.register(command);\n\nexports.default = command;\n\n//# sourceURL=webpack://tui.ImageEditor/./src/js/command/rotate.js?"); - -/***/ }), - -/***/ "./src/js/command/setObjectPosition.js": -/*!*********************************************!*\ - !*** ./src/js/command/setObjectPosition.js ***! - \*********************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; -eval("\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _command = __webpack_require__(/*! ../factory/command */ \"./src/js/factory/command.js\");\n\nvar _command2 = _interopRequireDefault(_command);\n\nvar _util = __webpack_require__(/*! ../util */ \"./src/js/util.js\");\n\nvar _consts = __webpack_require__(/*! ../consts */ \"./src/js/consts.js\");\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nvar command = {\n name: _consts.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: function execute(graphics, id, posInfo) {\n var targetObj = graphics.getObject(id);\n\n if (!targetObj) {\n return _util.Promise.reject(_consts.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 _util.Promise.resolve();\n },\n\n /**\n * @param {Graphics} graphics - Graphics instance\n * @returns {Promise}\n */\n undo: function undo(graphics) {\n var _undoData = this.undoData,\n objectId = _undoData.objectId,\n props = _undoData.props;\n\n\n graphics.setObjectProperties(objectId, props);\n graphics.renderAll();\n\n return _util.Promise.resolve();\n }\n}; /**\n * @author NHN Ent. FE Development Team \n * @fileoverview Set object properties\n */\n\n\n_command2.default.register(command);\n\nexports.default = command;\n\n//# sourceURL=webpack://tui.ImageEditor/./src/js/command/setObjectPosition.js?"); - -/***/ }), - -/***/ "./src/js/command/setObjectProperties.js": -/*!***********************************************!*\ - !*** ./src/js/command/setObjectProperties.js ***! - \***********************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; -eval("\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _tuiCodeSnippet = __webpack_require__(/*! tui-code-snippet */ \"tui-code-snippet\");\n\nvar _tuiCodeSnippet2 = _interopRequireDefault(_tuiCodeSnippet);\n\nvar _command = __webpack_require__(/*! ../factory/command */ \"./src/js/factory/command.js\");\n\nvar _command2 = _interopRequireDefault(_command);\n\nvar _util = __webpack_require__(/*! ../util */ \"./src/js/util.js\");\n\nvar _consts = __webpack_require__(/*! ../consts */ \"./src/js/consts.js\");\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\n/**\n * @author NHN Ent. FE Development Team \n * @fileoverview Set object properties\n */\nvar command = {\n name: _consts.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: function execute(graphics, id, props) {\n var _this = this;\n\n var targetObj = graphics.getObject(id);\n\n if (!targetObj) {\n return _util.Promise.reject(_consts.rejectMessages.noObject);\n }\n\n this.undoData.props = {};\n _tuiCodeSnippet2.default.forEachOwnProperties(props, function (value, key) {\n _this.undoData.props[key] = targetObj[key];\n });\n\n graphics.setObjectProperties(id, props);\n\n return _util.Promise.resolve();\n },\n\n /**\n * @param {Graphics} graphics - Graphics instance\n * @param {number} id - object id\n * @returns {Promise}\n */\n undo: function undo(graphics, id) {\n var props = this.undoData.props;\n\n\n graphics.setObjectProperties(id, props);\n\n return _util.Promise.resolve();\n }\n};\n\n_command2.default.register(command);\n\nexports.default = command;\n\n//# sourceURL=webpack://tui.ImageEditor/./src/js/command/setObjectProperties.js?"); - -/***/ }), - -/***/ "./src/js/component/cropper.js": -/*!*************************************!*\ - !*** ./src/js/component/cropper.js ***! - \*************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; -eval("\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\nvar _tuiCodeSnippet = __webpack_require__(/*! tui-code-snippet */ \"tui-code-snippet\");\n\nvar _tuiCodeSnippet2 = _interopRequireDefault(_tuiCodeSnippet);\n\nvar _fabric = __webpack_require__(/*! fabric */ \"fabric\");\n\nvar _fabric2 = _interopRequireDefault(_fabric);\n\nvar _component = __webpack_require__(/*! ../interface/component */ \"./src/js/interface/component.js\");\n\nvar _component2 = _interopRequireDefault(_component);\n\nvar _cropzone = __webpack_require__(/*! ../extension/cropzone */ \"./src/js/extension/cropzone.js\");\n\nvar _cropzone2 = _interopRequireDefault(_cropzone);\n\nvar _consts = __webpack_require__(/*! ../consts */ \"./src/js/consts.js\");\n\nvar _util = __webpack_require__(/*! ../util */ \"./src/js/util.js\");\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return call && (typeof call === \"object\" || typeof call === \"function\") ? call : self; }\n\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function, not \" + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } /**\n * @author NHN Ent. FE Development Team \n * @fileoverview Image crop module (start cropping, end cropping)\n */\n\n\nvar MOUSE_MOVE_THRESHOLD = 10;\nvar 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 */\n\nvar Cropper = function (_Component) {\n _inherits(Cropper, _Component);\n\n function Cropper(graphics) {\n _classCallCheck(this, Cropper);\n\n /**\n * Cropzone\n * @type {Cropzone}\n * @private\n */\n var _this = _possibleConstructorReturn(this, (Cropper.__proto__ || Object.getPrototypeOf(Cropper)).call(this, _consts.componentNames.CROPPER, graphics));\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 return _this;\n }\n\n /**\n * Start cropping\n */\n\n\n _createClass(Cropper, [{\n key: 'start',\n value: function start() {\n if (this._cropzone) {\n return;\n }\n var canvas = this.getCanvas();\n\n canvas.forEachObject(function (obj) {\n // {@link http://fabricjs.com/docs/fabric.Object.html#evented}\n obj.evented = false;\n });\n\n this._cropzone = new _cropzone2.default(canvas, _tuiCodeSnippet2.default.extend({\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 }, _consts.CROPZONE_DEFAULT_OPTIONS, this.graphics.cropSelectionStyle));\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 _fabric2.default.util.addListener(document, 'keydown', this._listeners.keydown);\n _fabric2.default.util.addListener(document, 'keyup', this._listeners.keyup);\n }\n\n /**\n * End cropping\n */\n\n }, {\n key: 'end',\n value: function end() {\n var canvas = this.getCanvas();\n var 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(function (obj) {\n obj.evented = true;\n });\n\n this._cropzone = null;\n\n _fabric2.default.util.removeListener(document, 'keydown', this._listeners.keydown);\n _fabric2.default.util.removeListener(document, 'keyup', this._listeners.keyup);\n }\n\n /**\n * Change cropzone visible\n * @param {boolean} visible - cropzone visible state\n */\n\n }, {\n key: 'changeVisibility',\n value: function changeVisibility(visible) {\n if (this._cropzone) {\n this._cropzone.set({ visible: 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\n }, {\n key: '_onFabricMouseDown',\n value: function _onFabricMouseDown(fEvent) {\n var canvas = this.getCanvas();\n\n if (fEvent.target) {\n return;\n }\n\n canvas.selection = false;\n var 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\n }, {\n key: '_onFabricMouseMove',\n value: function _onFabricMouseMove(fEvent) {\n var canvas = this.getCanvas();\n var pointer = canvas.getPointer(fEvent.e);\n var x = pointer.x,\n y = pointer.y;\n\n var 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\n }, {\n key: '_calcRectDimensionFromPoint',\n value: function _calcRectDimensionFromPoint(x, y) {\n var canvas = this.getCanvas();\n var canvasWidth = canvas.getWidth();\n var canvasHeight = canvas.getHeight();\n var startX = this._startX;\n var startY = this._startY;\n var left = (0, _util.clamp)(x, 0, startX);\n var top = (0, _util.clamp)(y, 0, startY);\n var width = (0, _util.clamp)(x, startX, canvasWidth) - left; // (startX <= x(mouse) <= canvasWidth) - left\n var height = (0, _util.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: left,\n top: top,\n width: width,\n height: height\n };\n }\n\n /**\n * onMouseup handler in fabric canvas\n * @private\n */\n\n }, {\n key: '_onFabricMouseUp',\n value: function _onFabricMouseUp() {\n var cropzone = this._cropzone;\n var listeners = this._listeners;\n var 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\n }, {\n key: 'getCroppedImageData',\n value: function getCroppedImageData(cropRect) {\n var canvas = this.getCanvas();\n var containsCropzone = canvas.contains(this._cropzone);\n if (!cropRect) {\n return null;\n }\n\n if (containsCropzone) {\n canvas.remove(this._cropzone);\n }\n\n var 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\n }, {\n key: 'getCropzoneRect',\n value: function getCropzoneRect() {\n var 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\n }, {\n key: 'setCropzoneRect',\n value: function setCropzoneRect(presetRatio) {\n var canvas = this.getCanvas();\n var 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\n }, {\n key: '_getPresetPropertiesForCropSize',\n value: function _getPresetPropertiesForCropSize(presetRatio) {\n var canvas = this.getCanvas();\n var originalWidth = canvas.getWidth();\n var originalHeight = canvas.getHeight();\n\n var standardSize = originalWidth >= originalHeight ? originalWidth : originalHeight;\n var getScale = function getScale(value, orignalValue) {\n return value > orignalValue ? orignalValue / value : 1;\n };\n\n var width = standardSize * presetRatio;\n var height = standardSize;\n\n var scaleWidth = getScale(width, originalWidth);\n\n var _snippet$map = _tuiCodeSnippet2.default.map([width, height], function (sizeValue) {\n return sizeValue * scaleWidth;\n });\n\n width = _snippet$map[0];\n height = _snippet$map[1];\n\n\n var scaleHeight = getScale(height, originalHeight);\n\n var _snippet$map2 = _tuiCodeSnippet2.default.map([width, height], function (sizeValue) {\n return (0, _util.fixFloatingPoint)(sizeValue * scaleHeight);\n });\n\n width = _snippet$map2[0];\n height = _snippet$map2[1];\n\n\n return {\n presetRatio: presetRatio,\n top: (originalHeight - height) / 2,\n left: (originalWidth - width) / 2,\n width: width,\n height: height\n };\n }\n\n /**\n * Keydown event handler\n * @param {KeyboardEvent} e - Event object\n * @private\n */\n\n }, {\n key: '_onKeyDown',\n value: function _onKeyDown(e) {\n if (e.keyCode === _consts.keyCodes.SHIFT) {\n this._withShiftKey = true;\n }\n }\n\n /**\n * Keyup event handler\n * @param {KeyboardEvent} e - Event object\n * @private\n */\n\n }, {\n key: '_onKeyUp',\n value: function _onKeyUp(e) {\n if (e.keyCode === _consts.keyCodes.SHIFT) {\n this._withShiftKey = false;\n }\n }\n }]);\n\n return Cropper;\n}(_component2.default);\n\nexports.default = Cropper;\n\n//# sourceURL=webpack://tui.ImageEditor/./src/js/component/cropper.js?"); - -/***/ }), - -/***/ "./src/js/component/filter.js": -/*!************************************!*\ - !*** ./src/js/component/filter.js ***! - \************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; -eval("\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\nvar _tuiCodeSnippet = __webpack_require__(/*! tui-code-snippet */ \"tui-code-snippet\");\n\nvar _util = __webpack_require__(/*! ../util */ \"./src/js/util.js\");\n\nvar _fabric = __webpack_require__(/*! fabric */ \"fabric\");\n\nvar _fabric2 = _interopRequireDefault(_fabric);\n\nvar _component = __webpack_require__(/*! ../interface/component */ \"./src/js/interface/component.js\");\n\nvar _component2 = _interopRequireDefault(_component);\n\nvar _mask = __webpack_require__(/*! ../extension/mask */ \"./src/js/extension/mask.js\");\n\nvar _mask2 = _interopRequireDefault(_mask);\n\nvar _consts = __webpack_require__(/*! ../consts */ \"./src/js/consts.js\");\n\nvar _sharpen = __webpack_require__(/*! ../extension/sharpen */ \"./src/js/extension/sharpen.js\");\n\nvar _sharpen2 = _interopRequireDefault(_sharpen);\n\nvar _emboss = __webpack_require__(/*! ../extension/emboss */ \"./src/js/extension/emboss.js\");\n\nvar _emboss2 = _interopRequireDefault(_emboss);\n\nvar _colorFilter = __webpack_require__(/*! ../extension/colorFilter */ \"./src/js/extension/colorFilter.js\");\n\nvar _colorFilter2 = _interopRequireDefault(_colorFilter);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return call && (typeof call === \"object\" || typeof call === \"function\") ? call : self; }\n\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function, not \" + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } /**\n * @author NHN Ent. FE Development Team \n * @fileoverview Add filter module\n */\n\n\nvar filters = _fabric2.default.Image.filters;\n\nfilters.Mask = _mask2.default;\nfilters.Sharpen = _sharpen2.default;\nfilters.Emboss = _emboss2.default;\nfilters.ColorFilter = _colorFilter2.default;\n\n/**\n * Filter\n * @class Filter\n * @param {Graphics} graphics - Graphics instance\n * @extends {Component}\n * @ignore\n */\n\nvar Filter = function (_Component) {\n _inherits(Filter, _Component);\n\n function Filter(graphics) {\n _classCallCheck(this, Filter);\n\n return _possibleConstructorReturn(this, (Filter.__proto__ || Object.getPrototypeOf(Filter)).call(this, _consts.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\n\n _createClass(Filter, [{\n key: 'add',\n value: function add(type, options) {\n var _this2 = this;\n\n return new _util.Promise(function (resolve, reject) {\n var sourceImg = _this2._getSourceImage();\n var canvas = _this2.getCanvas();\n var imgFilter = _this2._getFilter(sourceImg, type);\n if (!imgFilter) {\n imgFilter = _this2._createFilter(sourceImg, type, options);\n }\n\n if (!imgFilter) {\n reject(_consts.rejectMessages.invalidParameters);\n }\n\n _this2._changeFilterValues(imgFilter, options);\n\n _this2._apply(sourceImg, function () {\n canvas.renderAll();\n resolve({\n type: type,\n action: 'add',\n options: options\n });\n });\n });\n }\n\n /**\n * Remove filter to source image\n * @param {string} type - Filter type\n * @returns {Promise}\n */\n\n }, {\n key: 'remove',\n value: function remove(type) {\n var _this3 = this;\n\n return new _util.Promise(function (resolve, reject) {\n var sourceImg = _this3._getSourceImage();\n var canvas = _this3.getCanvas();\n var options = _this3.getOptions(type);\n\n if (!sourceImg.filters.length) {\n reject(_consts.rejectMessages.unsupportedOperation);\n }\n\n _this3._removeFilter(sourceImg, type);\n\n _this3._apply(sourceImg, function () {\n canvas.renderAll();\n resolve({\n type: type,\n action: 'remove',\n options: 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\n }, {\n key: 'hasFilter',\n value: function 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\n }, {\n key: 'getOptions',\n value: function getOptions(type) {\n var sourceImg = this._getSourceImage();\n var imgFilter = this._getFilter(sourceImg, type);\n if (!imgFilter) {\n return null;\n }\n\n return (0, _tuiCodeSnippet.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\n }, {\n key: '_changeFilterValues',\n value: function _changeFilterValues(imgFilter, options) {\n (0, _tuiCodeSnippet.forEach)(options, function (value, key) {\n if (!(0, _tuiCodeSnippet.isUndefined)(imgFilter[key])) {\n imgFilter[key] = value;\n }\n });\n (0, _tuiCodeSnippet.forEach)(imgFilter.options, function (value, key) {\n if (!(0, _tuiCodeSnippet.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\n }, {\n key: '_apply',\n value: function _apply(sourceImg, callback) {\n sourceImg.filters.push();\n var 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\n }, {\n key: '_getSourceImage',\n value: function _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\n }, {\n key: '_createFilter',\n value: function _createFilter(sourceImg, type, options) {\n var filterObj = void 0;\n // capitalize first letter for matching with fabric image filter name\n var fabricType = this._getFabricFilterType(type);\n var ImageFilter = _fabric2.default.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\n }, {\n key: '_getFilter',\n value: function _getFilter(sourceImg, type) {\n var imgFilter = null;\n\n if (sourceImg) {\n var fabricType = this._getFabricFilterType(type);\n var length = sourceImg.filters.length;\n\n var item = void 0,\n i = void 0;\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\n }, {\n key: '_removeFilter',\n value: function _removeFilter(sourceImg, type) {\n var fabricType = this._getFabricFilterType(type);\n sourceImg.filters = (0, _tuiCodeSnippet.filter)(sourceImg.filters, function (value) {\n return value.type !== fabricType;\n });\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\n }, {\n key: '_getFabricFilterType',\n value: function _getFabricFilterType(type) {\n return type.charAt(0).toUpperCase() + type.slice(1);\n }\n }]);\n\n return Filter;\n}(_component2.default);\n\nexports.default = Filter;\n\n//# sourceURL=webpack://tui.ImageEditor/./src/js/component/filter.js?"); - -/***/ }), - -/***/ "./src/js/component/flip.js": -/*!**********************************!*\ - !*** ./src/js/component/flip.js ***! - \**********************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; -eval("\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\nvar _tuiCodeSnippet = __webpack_require__(/*! tui-code-snippet */ \"tui-code-snippet\");\n\nvar _tuiCodeSnippet2 = _interopRequireDefault(_tuiCodeSnippet);\n\nvar _util = __webpack_require__(/*! ../util */ \"./src/js/util.js\");\n\nvar _component = __webpack_require__(/*! ../interface/component */ \"./src/js/interface/component.js\");\n\nvar _component2 = _interopRequireDefault(_component);\n\nvar _consts = __webpack_require__(/*! ../consts */ \"./src/js/consts.js\");\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return call && (typeof call === \"object\" || typeof call === \"function\") ? call : self; }\n\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function, not \" + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } /**\n * @author NHN Ent. FE Development Team \n * @fileoverview Image flip module\n */\n\n\n/**\n * Flip\n * @class Flip\n * @param {Graphics} graphics - Graphics instance\n * @extends {Component}\n * @ignore\n */\nvar Flip = function (_Component) {\n _inherits(Flip, _Component);\n\n function Flip(graphics) {\n _classCallCheck(this, Flip);\n\n return _possibleConstructorReturn(this, (Flip.__proto__ || Object.getPrototypeOf(Flip)).call(this, _consts.componentNames.FLIP, graphics));\n }\n\n /**\n * Get current flip settings\n * @returns {{flipX: Boolean, flipY: Boolean}}\n */\n\n\n _createClass(Flip, [{\n key: 'getCurrentSetting',\n value: function getCurrentSetting() {\n var 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\n }, {\n key: 'set',\n value: function set(newSetting) {\n var setting = this.getCurrentSetting();\n var isChangingFlipX = setting.flipX !== newSetting.flipX;\n var isChangingFlipY = setting.flipY !== newSetting.flipY;\n\n if (!isChangingFlipX && !isChangingFlipY) {\n return _util.Promise.reject(_consts.rejectMessages.flip);\n }\n\n _tuiCodeSnippet2.default.extend(setting, newSetting);\n this.setImageProperties(setting, true);\n this._invertAngle(isChangingFlipX, isChangingFlipY);\n this._flipObjects(isChangingFlipX, isChangingFlipY);\n\n return _util.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\n }, {\n key: '_invertAngle',\n value: function _invertAngle(isChangingFlipX, isChangingFlipY) {\n var canvasImage = this.getCanvasImage();\n var angle = canvasImage.angle;\n\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\n }, {\n key: '_flipObjects',\n value: function _flipObjects(isChangingFlipX, isChangingFlipY) {\n var canvas = this.getCanvas();\n\n if (isChangingFlipX) {\n canvas.forEachObject(function (obj) {\n obj.set({\n angle: parseFloat(obj.angle * -1), // parseFloat for -0 to 0\n flipX: !obj.flipX,\n left: canvas.width - obj.left\n }).setCoords();\n });\n }\n if (isChangingFlipY) {\n canvas.forEachObject(function (obj) {\n obj.set({\n angle: parseFloat(obj.angle * -1), // parseFloat for -0 to 0\n flipY: !obj.flipY,\n top: canvas.height - obj.top\n }).setCoords();\n });\n }\n canvas.renderAll();\n }\n\n /**\n * Reset flip settings\n * @returns {Promise}\n */\n\n }, {\n key: 'reset',\n value: function reset() {\n return this.set({\n flipX: false,\n flipY: false\n });\n }\n\n /**\n * Flip x\n * @returns {Promise}\n */\n\n }, {\n key: 'flipX',\n value: function flipX() {\n var 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\n }, {\n key: 'flipY',\n value: function flipY() {\n var current = this.getCurrentSetting();\n\n return this.set({\n flipX: current.flipX,\n flipY: !current.flipY\n });\n }\n }]);\n\n return Flip;\n}(_component2.default);\n\nexports.default = Flip;\n\n//# sourceURL=webpack://tui.ImageEditor/./src/js/component/flip.js?"); - -/***/ }), - -/***/ "./src/js/component/freeDrawing.js": -/*!*****************************************!*\ - !*** ./src/js/component/freeDrawing.js ***! - \*****************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; -eval("\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\nvar _fabric = __webpack_require__(/*! fabric */ \"fabric\");\n\nvar _fabric2 = _interopRequireDefault(_fabric);\n\nvar _component = __webpack_require__(/*! ../interface/component */ \"./src/js/interface/component.js\");\n\nvar _component2 = _interopRequireDefault(_component);\n\nvar _consts = __webpack_require__(/*! ../consts */ \"./src/js/consts.js\");\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return call && (typeof call === \"object\" || typeof call === \"function\") ? call : self; }\n\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function, not \" + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } /**\n * @author NHN Ent. FE Development Team \n * @fileoverview Free drawing module, Set brush\n */\n\n\n/**\n * FreeDrawing\n * @class FreeDrawing\n * @param {Graphics} graphics - Graphics instance\n * @extends {Component}\n * @ignore\n */\nvar FreeDrawing = function (_Component) {\n _inherits(FreeDrawing, _Component);\n\n function FreeDrawing(graphics) {\n _classCallCheck(this, FreeDrawing);\n\n /**\n * Brush width\n * @type {number}\n */\n var _this = _possibleConstructorReturn(this, (FreeDrawing.__proto__ || Object.getPrototypeOf(FreeDrawing)).call(this, _consts.componentNames.FREE_DRAWING, graphics));\n\n _this.width = 12;\n\n /**\n * fabric.Color instance for brush color\n * @type {fabric.Color}\n */\n _this.oColor = new _fabric2.default.Color('rgba(0, 0, 0, 0.5)');\n return _this;\n }\n\n /**\n * Start free drawing mode\n * @param {{width: ?number, color: ?string}} [setting] - Brush width & color\n */\n\n\n _createClass(FreeDrawing, [{\n key: 'start',\n value: function start(setting) {\n var 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\n }, {\n key: 'setBrush',\n value: function setBrush(setting) {\n var brush = this.getCanvas().freeDrawingBrush;\n\n setting = setting || {};\n this.width = setting.width || this.width;\n if (setting.color) {\n this.oColor = new _fabric2.default.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\n }, {\n key: 'end',\n value: function end() {\n var canvas = this.getCanvas();\n\n canvas.isDrawingMode = false;\n }\n }]);\n\n return FreeDrawing;\n}(_component2.default);\n\nexports.default = FreeDrawing;\n\n//# sourceURL=webpack://tui.ImageEditor/./src/js/component/freeDrawing.js?"); - -/***/ }), - -/***/ "./src/js/component/icon.js": -/*!**********************************!*\ - !*** ./src/js/component/icon.js ***! - \**********************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; -eval("\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\nvar _fabric = __webpack_require__(/*! fabric */ \"fabric\");\n\nvar _fabric2 = _interopRequireDefault(_fabric);\n\nvar _tuiCodeSnippet = __webpack_require__(/*! tui-code-snippet */ \"tui-code-snippet\");\n\nvar _tuiCodeSnippet2 = _interopRequireDefault(_tuiCodeSnippet);\n\nvar _util = __webpack_require__(/*! ../util */ \"./src/js/util.js\");\n\nvar _component = __webpack_require__(/*! ../interface/component */ \"./src/js/interface/component.js\");\n\nvar _component2 = _interopRequireDefault(_component);\n\nvar _consts = __webpack_require__(/*! ../consts */ \"./src/js/consts.js\");\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return call && (typeof call === \"object\" || typeof call === \"function\") ? call : self; }\n\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function, not \" + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } /**\n * @author NHN Ent. FE Development Team \n * @fileoverview Add icon module\n */\n\n\nvar pathMap = {\n arrow: 'M 0 90 H 105 V 120 L 160 60 L 105 0 V 30 H 0 Z',\n cancel: 'M 0 30 L 30 60 L 0 90 L 30 120 L 60 90 L 90 120 L 120 90 ' + '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 */\n\nvar Icon = function (_Component) {\n _inherits(Icon, _Component);\n\n function Icon(graphics) {\n _classCallCheck(this, Icon);\n\n /**\n * Default icon color\n * @type {string}\n */\n var _this = _possibleConstructorReturn(this, (Icon.__proto__ || Object.getPrototypeOf(Icon)).call(this, _consts.componentNames.ICON, graphics));\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 return _this;\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\n\n _createClass(Icon, [{\n key: 'setStates',\n value: function 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\n }, {\n key: 'start',\n value: function start() {\n var 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\n }, {\n key: 'end',\n value: function end() {\n var 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\n }, {\n key: 'add',\n value: function add(type, options) {\n var _this2 = this;\n\n return new _util.Promise(function (resolve, reject) {\n var canvas = _this2.getCanvas();\n var path = _this2._pathMap[type];\n var selectionStyle = _consts.fObjectOptions.SELECTION_STYLE;\n var icon = path ? _this2._createIcon(path) : null;\n _this2._icon = icon;\n\n if (!icon) {\n reject(_consts.rejectMessages.invalidParameters);\n }\n\n icon.set(_tuiCodeSnippet2.default.extend({\n type: 'icon',\n fill: _this2._oColor\n }, selectionStyle, options, _this2.graphics.controlStyle));\n\n canvas.add(icon).setActiveObject(icon);\n\n resolve(_this2.graphics.createObjectProperties(icon));\n });\n }\n\n /**\n * Register icon paths\n * @param {{key: string, value: string}} pathInfos - Path infos\n */\n\n }, {\n key: 'registerPaths',\n value: function registerPaths(pathInfos) {\n var _this3 = this;\n\n _tuiCodeSnippet2.default.forEach(pathInfos, function (path, type) {\n _this3._pathMap[type] = path;\n }, this);\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\n }, {\n key: 'setColor',\n value: function 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\n }, {\n key: 'getColor',\n value: function 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\n }, {\n key: '_createIcon',\n value: function _createIcon(path) {\n return new _fabric2.default.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\n }, {\n key: '_onFabricMouseDown',\n value: function _onFabricMouseDown(fEvent) {\n var _this4 = this;\n\n var canvas = this.getCanvas();\n\n this._startPoint = canvas.getPointer(fEvent.e);\n var _startPoint = this._startPoint,\n left = _startPoint.x,\n top = _startPoint.y;\n\n\n this.add(this._type, {\n left: left,\n top: top,\n fill: this._iconColor\n }).then(function () {\n _this4.fire(_consts.eventNames.ADD_OBJECT, _this4.graphics.createObjectProperties(_this4._icon));\n canvas.on('mouse:move', _this4._handlers.mousemove);\n canvas.on('mouse:up', _this4._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\n }, {\n key: '_onFabricMouseMove',\n value: function _onFabricMouseMove(fEvent) {\n var canvas = this.getCanvas();\n\n if (!this._icon) {\n return;\n }\n var moveOriginPointer = canvas.getPointer(fEvent.e);\n\n var scaleX = (moveOriginPointer.x - this._startPoint.x) / this._icon.width;\n var 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\n }, {\n key: '_onFabricMouseUp',\n value: function _onFabricMouseUp() {\n var canvas = this.getCanvas();\n\n this.fire(_consts.eventNames.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\n return Icon;\n}(_component2.default);\n\nexports.default = Icon;\n\n//# sourceURL=webpack://tui.ImageEditor/./src/js/component/icon.js?"); - -/***/ }), - -/***/ "./src/js/component/imageLoader.js": -/*!*****************************************!*\ - !*** ./src/js/component/imageLoader.js ***! - \*****************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; -eval("\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\nvar _component = __webpack_require__(/*! ../interface/component */ \"./src/js/interface/component.js\");\n\nvar _component2 = _interopRequireDefault(_component);\n\nvar _consts = __webpack_require__(/*! ../consts */ \"./src/js/consts.js\");\n\nvar _util = __webpack_require__(/*! ../util */ \"./src/js/util.js\");\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return call && (typeof call === \"object\" || typeof call === \"function\") ? call : self; }\n\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function, not \" + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } /**\n * @author NHN Ent. FE Development Team \n * @fileoverview Image loader\n */\n\n\nvar 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 */\n\nvar ImageLoader = function (_Component) {\n _inherits(ImageLoader, _Component);\n\n function ImageLoader(graphics) {\n _classCallCheck(this, ImageLoader);\n\n return _possibleConstructorReturn(this, (ImageLoader.__proto__ || Object.getPrototypeOf(ImageLoader)).call(this, _consts.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\n\n _createClass(ImageLoader, [{\n key: 'load',\n value: function load(imageName, img) {\n var _this2 = this;\n\n var promise = void 0;\n\n if (!imageName && !img) {\n // Back to the initial state, not error.\n var canvas = this.getCanvas();\n\n canvas.backgroundImage = null;\n canvas.renderAll();\n\n promise = new _util.Promise(function (resolve) {\n _this2.setCanvasImage('', null);\n resolve();\n });\n } else {\n promise = this._setBackgroundImage(img).then(function (oImage) {\n _this2.setCanvasImage(imageName, oImage);\n _this2.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\n }, {\n key: '_setBackgroundImage',\n value: function _setBackgroundImage(img) {\n var _this3 = this;\n\n if (!img) {\n return _util.Promise.reject(_consts.rejectMessages.loadImage);\n }\n\n return new _util.Promise(function (resolve, reject) {\n var canvas = _this3.getCanvas();\n\n canvas.setBackgroundImage(img, function () {\n var oImage = canvas.backgroundImage;\n\n if (oImage && oImage.getElement()) {\n resolve(oImage);\n } else {\n reject(_consts.rejectMessages.loadingImageFailed);\n }\n }, imageOption);\n });\n }\n }]);\n\n return ImageLoader;\n}(_component2.default);\n\nexports.default = ImageLoader;\n\n//# sourceURL=webpack://tui.ImageEditor/./src/js/component/imageLoader.js?"); - -/***/ }), - -/***/ "./src/js/component/line.js": -/*!**********************************!*\ - !*** ./src/js/component/line.js ***! - \**********************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; -eval("\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\nvar _fabric = __webpack_require__(/*! fabric */ \"fabric\");\n\nvar _fabric2 = _interopRequireDefault(_fabric);\n\nvar _tuiCodeSnippet = __webpack_require__(/*! tui-code-snippet */ \"tui-code-snippet\");\n\nvar _tuiCodeSnippet2 = _interopRequireDefault(_tuiCodeSnippet);\n\nvar _component = __webpack_require__(/*! ../interface/component */ \"./src/js/interface/component.js\");\n\nvar _component2 = _interopRequireDefault(_component);\n\nvar _arrowLine = __webpack_require__(/*! ../extension/arrowLine */ \"./src/js/extension/arrowLine.js\");\n\nvar _arrowLine2 = _interopRequireDefault(_arrowLine);\n\nvar _consts = __webpack_require__(/*! ../consts */ \"./src/js/consts.js\");\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return call && (typeof call === \"object\" || typeof call === \"function\") ? call : self; }\n\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function, not \" + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } /**\n * @author NHN. FE Development Team \n * @fileoverview Free drawing module, Set brush\n */\n\n\n/**\n * Line\n * @class Line\n * @param {Graphics} graphics - Graphics instance\n * @extends {Component}\n * @ignore\n */\nvar Line = function (_Component) {\n _inherits(Line, _Component);\n\n function Line(graphics) {\n _classCallCheck(this, Line);\n\n /**\n * Brush width\n * @type {number}\n * @private\n */\n var _this = _possibleConstructorReturn(this, (Line.__proto__ || Object.getPrototypeOf(Line)).call(this, _consts.componentNames.LINE, graphics));\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 _fabric2.default.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 return _this;\n }\n\n /**\n * Start drawing line mode\n * @param {{width: ?number, color: ?string}} [setting] - Brush width & color\n */\n\n\n _createClass(Line, [{\n key: 'setHeadOption',\n value: function setHeadOption(setting) {\n var _setting$arrowType = setting.arrowType,\n arrowType = _setting$arrowType === undefined ? {\n head: null,\n tail: null\n } : _setting$arrowType;\n\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\n }, {\n key: 'start',\n value: function start() {\n var setting = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};\n\n var 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(function (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\n }, {\n key: 'setBrush',\n value: function setBrush(setting) {\n var brush = this.getCanvas().freeDrawingBrush;\n\n setting = setting || {};\n this._width = setting.width || this._width;\n\n if (setting.color) {\n this._oColor = new _fabric2.default.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\n }, {\n key: 'end',\n value: function end() {\n var canvas = this.getCanvas();\n\n canvas.defaultCursor = 'default';\n canvas.selection = true;\n\n canvas.forEachObject(function (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\n }, {\n key: '_onFabricMouseDown',\n value: function _onFabricMouseDown(fEvent) {\n var canvas = this.getCanvas();\n\n var _canvas$getPointer = canvas.getPointer(fEvent.e),\n x = _canvas$getPointer.x,\n y = _canvas$getPointer.y;\n\n var points = [x, y, x, y];\n\n this._line = new _arrowLine2.default(points, {\n stroke: this._oColor.toRgba(),\n strokeWidth: this._width,\n arrowType: this._arrowType,\n evented: false\n });\n\n this._line.set(_consts.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(_consts.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\n }, {\n key: '_onFabricMouseMove',\n value: function _onFabricMouseMove(fEvent) {\n var canvas = this.getCanvas();\n var 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 * @param {{target: fabric.Object, e: MouseEvent}} fEvent - Fabric event object\n * @private\n */\n\n }, {\n key: '_onFabricMouseUp',\n value: function _onFabricMouseUp() {\n var canvas = this.getCanvas();\n\n this.fire(_consts.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\n }, {\n key: '_createLineEventObjectProperties',\n value: function _createLineEventObjectProperties() {\n var params = this.graphics.createObjectProperties(this._line);\n var _line = this._line,\n x1 = _line.x1,\n x2 = _line.x2,\n y1 = _line.y1,\n y2 = _line.y2;\n\n\n return _tuiCodeSnippet2.default.extend({}, params, {\n startPosition: {\n x: x1,\n y: y1\n },\n endPosition: {\n x: x2,\n y: y2\n }\n });\n }\n }]);\n\n return Line;\n}(_component2.default);\n\nexports.default = Line;\n\n//# sourceURL=webpack://tui.ImageEditor/./src/js/component/line.js?"); - -/***/ }), - -/***/ "./src/js/component/rotation.js": -/*!**************************************!*\ - !*** ./src/js/component/rotation.js ***! - \**************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; -eval("\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\nvar _fabric = __webpack_require__(/*! fabric */ \"fabric\");\n\nvar _fabric2 = _interopRequireDefault(_fabric);\n\nvar _util = __webpack_require__(/*! ../util */ \"./src/js/util.js\");\n\nvar _component = __webpack_require__(/*! ../interface/component */ \"./src/js/interface/component.js\");\n\nvar _component2 = _interopRequireDefault(_component);\n\nvar _consts = __webpack_require__(/*! ../consts */ \"./src/js/consts.js\");\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return call && (typeof call === \"object\" || typeof call === \"function\") ? call : self; }\n\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function, not \" + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } /**\n * @author NHN Ent. FE Development Team \n * @fileoverview Image rotation module\n */\n\n\n/**\n * Image Rotation component\n * @class Rotation\n * @extends {Component}\n * @param {Graphics} graphics - Graphics instance\n * @ignore\n */\nvar Rotation = function (_Component) {\n _inherits(Rotation, _Component);\n\n function Rotation(graphics) {\n _classCallCheck(this, Rotation);\n\n return _possibleConstructorReturn(this, (Rotation.__proto__ || Object.getPrototypeOf(Rotation)).call(this, _consts.componentNames.ROTATION, graphics));\n }\n\n /**\n * Get current angle\n * @returns {Number}\n */\n\n\n _createClass(Rotation, [{\n key: 'getCurrentAngle',\n value: function 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\n }, {\n key: 'setAngle',\n value: function setAngle(angle) {\n var oldAngle = this.getCurrentAngle() % 360; // The angle is lower than 2*PI(===360 degrees)\n\n angle %= 360;\n\n var canvasImage = this.getCanvasImage();\n var oldImageCenter = canvasImage.getCenterPoint();\n canvasImage.set({ angle: angle }).setCoords();\n this.adjustCanvasDimension();\n var newImageCenter = canvasImage.getCenterPoint();\n this._rotateForEachObject(oldImageCenter, newImageCenter, angle - oldAngle);\n\n return _util.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\n }, {\n key: '_rotateForEachObject',\n value: function _rotateForEachObject(oldImageCenter, newImageCenter, angleDiff) {\n var canvas = this.getCanvas();\n var centerDiff = {\n x: oldImageCenter.x - newImageCenter.x,\n y: oldImageCenter.y - newImageCenter.y\n };\n\n canvas.forEachObject(function (obj) {\n var objCenter = obj.getCenterPoint();\n var radian = _fabric2.default.util.degreesToRadians(angleDiff);\n var newObjCenter = _fabric2.default.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\n }, {\n key: 'rotate',\n value: function rotate(additionalAngle) {\n var current = this.getCurrentAngle();\n\n return this.setAngle(current + additionalAngle);\n }\n }]);\n\n return Rotation;\n}(_component2.default);\n\nexports.default = Rotation;\n\n//# sourceURL=webpack://tui.ImageEditor/./src/js/component/rotation.js?"); - -/***/ }), - -/***/ "./src/js/component/shape.js": -/*!***********************************!*\ - !*** ./src/js/component/shape.js ***! - \***********************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; -eval("\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\nvar _fabric = __webpack_require__(/*! fabric */ \"fabric\");\n\nvar _fabric2 = _interopRequireDefault(_fabric);\n\nvar _component = __webpack_require__(/*! ../interface/component */ \"./src/js/interface/component.js\");\n\nvar _component2 = _interopRequireDefault(_component);\n\nvar _consts = __webpack_require__(/*! ../consts */ \"./src/js/consts.js\");\n\nvar _shapeResizeHelper = __webpack_require__(/*! ../helper/shapeResizeHelper */ \"./src/js/helper/shapeResizeHelper.js\");\n\nvar _shapeResizeHelper2 = _interopRequireDefault(_shapeResizeHelper);\n\nvar _shapeFilterFillHelper = __webpack_require__(/*! ../helper/shapeFilterFillHelper */ \"./src/js/helper/shapeFilterFillHelper.js\");\n\nvar _util = __webpack_require__(/*! ../util */ \"./src/js/util.js\");\n\nvar _tuiCodeSnippet = __webpack_require__(/*! tui-code-snippet */ \"tui-code-snippet\");\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return call && (typeof call === \"object\" || typeof call === \"function\") ? call : self; }\n\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function, not \" + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } /**\n * @author NHN Ent. FE Development Team \n * @fileoverview Shape component\n */\n\n\nvar SHAPE_INIT_OPTIONS = (0, _tuiCodeSnippet.extend)({\n strokeWidth: 1,\n stroke: '#000000',\n fill: '#ffffff',\n width: 1,\n height: 1,\n rx: 0,\n ry: 0\n}, _consts.SHAPE_DEFAULT_OPTIONS);\n\nvar DEFAULT_TYPE = 'rect';\nvar DEFAULT_WIDTH = 20;\nvar 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 var fillOption = options.fill;\n var fillType = (0, _util.getFillTypeFromOption)(options.fill);\n var fill = fillOption;\n\n if (fillOption.color) {\n fill = fillOption.color;\n }\n\n var extOption = null;\n if (fillType === 'filter') {\n var newStaticCanvas = createStaticCanvas();\n extOption = (0, _shapeFilterFillHelper.makeFillPatternForFilter)(canvasImage, fillOption.filter, newStaticCanvas);\n } else {\n extOption = { fill: fill };\n }\n\n return (0, _tuiCodeSnippet.extend)({}, options, extOption);\n}\n\n/**\n * Shape\n * @class Shape\n * @param {Graphics} graphics - Graphics instance\n * @extends {Component}\n * @ignore\n */\n\nvar Shape = function (_Component) {\n _inherits(Shape, _Component);\n\n function Shape(graphics) {\n _classCallCheck(this, Shape);\n\n /**\n * Object of The drawing shape\n * @type {fabric.Object}\n * @private\n */\n var _this = _possibleConstructorReturn(this, (Shape.__proto__ || Object.getPrototypeOf(Shape)).call(this, _consts.componentNames.SHAPE, graphics));\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 = (0, _tuiCodeSnippet.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 return _this;\n }\n\n /**\n * Start to draw the shape on canvas\n * @ignore\n */\n\n\n _createClass(Shape, [{\n key: 'start',\n value: function start() {\n var 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 _fabric2.default.util.addListener(document, 'keydown', this._handlers.keydown);\n _fabric2.default.util.addListener(document, 'keyup', this._handlers.keyup);\n }\n\n /**\n * End to draw the shape on canvas\n * @ignore\n */\n\n }, {\n key: 'end',\n value: function end() {\n var 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 _fabric2.default.util.removeListener(document, 'keydown', this._handlers.keydown);\n _fabric2.default.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\n }, {\n key: 'setStates',\n value: function setStates(type, options) {\n this._type = type;\n\n if (options) {\n this._options = (0, _tuiCodeSnippet.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\n }, {\n key: 'add',\n value: function add(type, options) {\n var _this2 = this;\n\n return new _util.Promise(function (resolve) {\n var canvas = _this2.getCanvas();\n var extendOption = _this2._extendOptions(options);\n\n var shapeObj = _this2._createInstance(type, extendOption);\n var objectProperties = _this2.graphics.createObjectProperties(shapeObj);\n\n _this2._bindEventOnShape(shapeObj);\n\n canvas.add(shapeObj).setActiveObject(shapeObj);\n\n _this2._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\n }, {\n key: 'change',\n value: function change(shapeObj, options) {\n var _this3 = this;\n\n return new _util.Promise(function (resolve, reject) {\n if (!(0, _util.isShape)(shapeObj)) {\n reject(_consts.rejectMessages.unsupportedType);\n }\n var hasFillOption = (0, _util.getFillTypeFromOption)(options.fill) === 'filter';\n var _graphics = _this3.graphics,\n canvasImage = _graphics.canvasImage,\n createStaticCanvas = _graphics.createStaticCanvas;\n\n\n shapeObj.set(hasFillOption ? makeFabricFillOption(options, canvasImage, createStaticCanvas) : options);\n\n if (hasFillOption) {\n _this3._resetPositionFillFilter(shapeObj);\n }\n\n _this3.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\n }, {\n key: 'makeFillPropertyForUserEvent',\n value: function makeFillPropertyForUserEvent(shapeObj) {\n var fillType = (0, _util.getFillTypeFromObject)(shapeObj);\n var fillProp = {};\n\n if (fillType === _consts.SHAPE_FILL_TYPE.FILTER) {\n var fillImage = (0, _shapeFilterFillHelper.getFillImageFromShape)(shapeObj);\n var filterOption = (0, _shapeFilterFillHelper.makeFilterOptionFromFabricImage)(fillImage);\n\n fillProp.type = fillType;\n fillProp.filter = filterOption;\n } else {\n fillProp.type = _consts.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\n }, {\n key: 'processForCopiedObject',\n value: function processForCopiedObject(shapeObj, originalShapeObj) {\n this._bindEventOnShape(shapeObj);\n\n if ((0, _util.getFillTypeFromObject)(shapeObj) === 'filter') {\n var fillImage = (0, _shapeFilterFillHelper.getFillImageFromShape)(originalShapeObj);\n var filterOption = (0, _shapeFilterFillHelper.makeFilterOptionFromFabricImage)(fillImage);\n var newStaticCanvas = this.graphics.createStaticCanvas();\n\n shapeObj.set((0, _shapeFilterFillHelper.makeFillPatternForFilter)(this.graphics.canvasImage, filterOption, newStaticCanvas));\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\n }, {\n key: '_createInstance',\n value: function _createInstance(type, options) {\n var instance = void 0;\n\n switch (type) {\n case 'rect':\n instance = new _fabric2.default.Rect(options);\n break;\n case 'circle':\n instance = new _fabric2.default.Ellipse((0, _tuiCodeSnippet.extend)({\n type: 'circle'\n }, options));\n break;\n case 'triangle':\n instance = new _fabric2.default.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\n }, {\n key: '_extendOptions',\n value: function _extendOptions(options) {\n var selectionStyles = _consts.fObjectOptions.SELECTION_STYLE;\n var _graphics2 = this.graphics,\n canvasImage = _graphics2.canvasImage,\n createStaticCanvas = _graphics2.createStaticCanvas;\n\n\n options = (0, _tuiCodeSnippet.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\n }, {\n key: '_bindEventOnShape',\n value: function _bindEventOnShape(shapeObj) {\n var self = this;\n var canvas = this.getCanvas();\n\n shapeObj.on({\n added: function added() {\n self._shapeObj = this;\n _shapeResizeHelper2.default.setOrigins(self._shapeObj);\n },\n selected: function selected() {\n self._isSelected = true;\n self._shapeObj = this;\n canvas.uniformScaling = true;\n canvas.defaultCursor = 'default';\n _shapeResizeHelper2.default.setOrigins(self._shapeObj);\n },\n deselected: function deselected() {\n self._isSelected = false;\n self._shapeObj = null;\n canvas.defaultCursor = 'crosshair';\n canvas.uniformScaling = false;\n },\n modified: function modified() {\n var currentObj = self._shapeObj;\n\n _shapeResizeHelper2.default.adjustOriginToCenter(currentObj);\n _shapeResizeHelper2.default.setOrigins(currentObj);\n },\n modifiedInGroup: function modifiedInGroup(activeSelection) {\n self._fillFilterRePositionInGroupSelection(shapeObj, activeSelection);\n },\n moving: function moving() {\n self._resetPositionFillFilter(this);\n },\n rotating: function rotating() {\n self._resetPositionFillFilter(this);\n },\n scaling: function scaling(fEvent) {\n var pointer = canvas.getPointer(fEvent.e);\n var currentObj = self._shapeObj;\n\n canvas.setCursor('crosshair');\n _shapeResizeHelper2.default.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\n }, {\n key: '_onFabricMouseDown',\n value: function _onFabricMouseDown(fEvent) {\n if (!fEvent.target) {\n this._isSelected = false;\n this._shapeObj = false;\n }\n\n if (!this._isSelected && !this._shapeObj) {\n var 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\n }, {\n key: '_onFabricMouseMove',\n value: function _onFabricMouseMove(fEvent) {\n var _this4 = this;\n\n var canvas = this.getCanvas();\n var pointer = canvas.getPointer(fEvent.e);\n var startPointX = this._startPoint.x;\n var startPointY = this._startPoint.y;\n var width = startPointX - pointer.x;\n var height = startPointY - pointer.y;\n var shape = this._shapeObj;\n\n if (!shape) {\n this.add(this._type, {\n left: startPointX,\n top: startPointY,\n width: width,\n height: height\n }).then(function (objectProps) {\n _this4.fire(_consts.eventNames.ADD_OBJECT, objectProps);\n });\n } else {\n this._shapeObj.set({\n isRegular: this._withShiftKey\n });\n\n _shapeResizeHelper2.default.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\n }, {\n key: '_onFabricMouseUp',\n value: function _onFabricMouseUp() {\n var _this5 = this;\n\n var canvas = this.getCanvas();\n var startPointX = this._startPoint.x;\n var startPointY = this._startPoint.y;\n var 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(function (objectProps) {\n _this5.fire(_consts.eventNames.ADD_OBJECT, objectProps);\n });\n } else if (shape) {\n _shapeResizeHelper2.default.adjustOriginToCenter(shape);\n this.fire(_consts.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\n }, {\n key: '_onKeyDown',\n value: function _onKeyDown(e) {\n if (e.keyCode === _consts.keyCodes.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\n }, {\n key: '_onKeyUp',\n value: function _onKeyUp(e) {\n if (e.keyCode === _consts.keyCodes.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\n }, {\n key: '_resetPositionFillFilter',\n value: function _resetPositionFillFilter(shapeObj) {\n if ((0, _util.getFillTypeFromObject)(shapeObj) !== 'filter') {\n return;\n }\n\n var _getCustomProperty = (0, _util.getCustomProperty)(shapeObj, 'patternSourceCanvas'),\n patternSourceCanvas = _getCustomProperty.patternSourceCanvas;\n\n var fillImage = (0, _shapeFilterFillHelper.getFillImageFromShape)(shapeObj);\n\n var _getCustomProperty2 = (0, _util.getCustomProperty)(fillImage, 'originalAngle'),\n originalAngle = _getCustomProperty2.originalAngle;\n\n if (this.graphics.canvasImage.angle !== originalAngle) {\n (0, _shapeFilterFillHelper.reMakePatternImageSource)(shapeObj, this.graphics.canvasImage);\n }\n var originX = shapeObj.originX,\n originY = shapeObj.originY;\n\n\n _shapeResizeHelper2.default.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 (0, _shapeFilterFillHelper.rePositionFilterTypeFillImage)(shapeObj);\n\n (0, _util.changeOrigin)(shapeObj, {\n originX: originX,\n originY: originY\n });\n\n (0, _shapeFilterFillHelper.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\n }, {\n key: '_fillFilterRePositionInGroupSelection',\n value: function _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 var angle = shapeObj.angle,\n left = shapeObj.left,\n top = shapeObj.top;\n\n\n activeSelection.realizeTransform(shapeObj);\n this._resetPositionFillFilter(shapeObj);\n\n shapeObj.set({\n angle: angle,\n left: left,\n top: top\n });\n }\n }]);\n\n return Shape;\n}(_component2.default);\n\nexports.default = Shape;\n\n//# sourceURL=webpack://tui.ImageEditor/./src/js/component/shape.js?"); - -/***/ }), - -/***/ "./src/js/component/text.js": -/*!**********************************!*\ - !*** ./src/js/component/text.js ***! - \**********************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; -eval("\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\nvar _fabric = __webpack_require__(/*! fabric */ \"fabric\");\n\nvar _fabric2 = _interopRequireDefault(_fabric);\n\nvar _tuiCodeSnippet = __webpack_require__(/*! tui-code-snippet */ \"tui-code-snippet\");\n\nvar _tuiCodeSnippet2 = _interopRequireDefault(_tuiCodeSnippet);\n\nvar _component = __webpack_require__(/*! ../interface/component */ \"./src/js/interface/component.js\");\n\nvar _component2 = _interopRequireDefault(_component);\n\nvar _consts = __webpack_require__(/*! ../consts */ \"./src/js/consts.js\");\n\nvar _util = __webpack_require__(/*! ../util */ \"./src/js/util.js\");\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return call && (typeof call === \"object\" || typeof call === \"function\") ? call : self; }\n\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function, not \" + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } /**\n * @author NHN Ent. FE Development Team \n * @fileoverview Text module\n */\n\n\nvar defaultStyles = {\n fill: '#000000',\n left: 0,\n top: 0\n};\nvar resetStyles = {\n fill: '#000000',\n fontStyle: 'normal',\n fontWeight: 'normal',\n textAlign: 'left',\n underline: false\n};\n\nvar DBCLICK_TIME = 500;\n\n/**\n * Text\n * @class Text\n * @param {Graphics} graphics - Graphics instance\n * @extends {Component}\n * @ignore\n */\n\nvar Text = function (_Component) {\n _inherits(Text, _Component);\n\n function Text(graphics) {\n _classCallCheck(this, Text);\n\n /**\n * Default text style\n * @type {Object}\n */\n var _this = _possibleConstructorReturn(this, (Text.__proto__ || Object.getPrototypeOf(Text)).call(this, _consts.componentNames.TEXT, graphics));\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 };\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 return _this;\n }\n\n /**\n * Start input text mode\n */\n\n\n _createClass(Text, [{\n key: 'start',\n value: function start() {\n var _this2 = this;\n\n var 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:editing': this._listeners.modify\n });\n\n canvas.forEachObject(function (obj) {\n if (obj.type === 'i-text') {\n _this2.adjustOriginPosition(obj, 'start');\n }\n });\n\n this.setCanvasRatio();\n }\n\n /**\n * End input text mode\n */\n\n }, {\n key: 'end',\n value: function end() {\n var _this3 = this;\n\n var canvas = this.getCanvas();\n\n canvas.selection = true;\n canvas.defaultCursor = 'default';\n\n canvas.forEachObject(function (obj) {\n if (obj.type === 'i-text') {\n if (obj.text === '') {\n canvas.remove(obj);\n } else {\n _this3.adjustOriginPosition(obj, 'end');\n }\n }\n });\n\n canvas.off({\n 'mouse:down': this._listeners.mousedown,\n 'object:selected': this._listeners.select,\n 'before:selection:cleared': this._listeners.selectClear,\n 'object:scaling': this._listeners.scaling,\n 'text:editing': this._listeners.modify\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\n }, {\n key: 'adjustOriginPosition',\n value: function adjustOriginPosition(text, editStatus) {\n var originX = 'center',\n originY = 'center';\n\n if (editStatus === 'start') {\n originX = 'left';\n originY = 'top';\n }\n\n var _text$getPointByOrigi = text.getPointByOrigin(originX, originY),\n left = _text$getPointByOrigi.x,\n top = _text$getPointByOrigi.y;\n\n text.set({\n left: left,\n top: top,\n originX: originX,\n originY: 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\n }, {\n key: 'add',\n value: function add(text, options) {\n var _this4 = this;\n\n return new _util.Promise(function (resolve) {\n var canvas = _this4.getCanvas();\n var newText = null;\n var selectionStyle = _consts.fObjectOptions.SELECTION_STYLE;\n var styles = _this4._defaultStyles;\n\n _this4._setInitPos(options.position);\n\n if (options.styles) {\n styles = _tuiCodeSnippet2.default.extend(styles, options.styles);\n }\n\n if (!_tuiCodeSnippet2.default.isExisty(options.autofocus)) {\n options.autofocus = true;\n }\n\n newText = new _fabric2.default.IText(text, styles);\n selectionStyle = _tuiCodeSnippet2.default.extend({}, selectionStyle, {\n originX: 'left',\n originY: 'top'\n });\n\n newText.set(selectionStyle);\n newText.on({\n mouseup: _this4._onFabricMouseUp.bind(_this4)\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 _this4.isPrevEditing = true;\n resolve(_this4.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\n }, {\n key: 'change',\n value: function change(activeObj, text) {\n var _this5 = this;\n\n return new _util.Promise(function (resolve) {\n activeObj.set('text', text);\n\n _this5.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\n }, {\n key: 'setStyle',\n value: function setStyle(activeObj, styleObj) {\n var _this6 = this;\n\n return new _util.Promise(function (resolve) {\n _tuiCodeSnippet2.default.forEach(styleObj, function (val, key) {\n if (activeObj[key] === val && key !== 'fontSize') {\n styleObj[key] = resetStyles[key] || '';\n }\n }, _this6);\n\n if ('textDecoration' in styleObj) {\n _tuiCodeSnippet2.default.extend(styleObj, _this6._getTextDecorationAdaptObject(styleObj.textDecoration));\n }\n\n activeObj.set(styleObj);\n\n _this6.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\n }, {\n key: 'getText',\n value: function 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\n }, {\n key: 'setSelectedInfo',\n value: function 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\n }, {\n key: 'isSelected',\n value: function isSelected() {\n return this._isSelected;\n }\n\n /**\n * Get current selected text object\n * @returns {fabric.Text} Current selected text object\n */\n\n }, {\n key: 'getSelectedObj',\n value: function getSelectedObj() {\n return this._selectedObj;\n }\n\n /**\n * Set ratio value of canvas\n */\n\n }, {\n key: 'setCanvasRatio',\n value: function setCanvasRatio() {\n var canvasElement = this.getCanvasElement();\n var cssWidth = parseInt(canvasElement.style.maxWidth, 10);\n var originWidth = canvasElement.width;\n var ratio = originWidth / cssWidth;\n\n this._ratio = ratio;\n }\n\n /**\n * Get ratio value of canvas\n * @returns {number} Ratio value\n */\n\n }, {\n key: 'getCanvasRatio',\n value: function 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\n }, {\n key: '_getTextDecorationAdaptObject',\n value: function _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\n }, {\n key: '_setInitPos',\n value: function _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\n }, {\n key: '_onInput',\n value: function _onInput() {\n var ratio = this.getCanvasRatio();\n var obj = this._editingObj;\n var 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\n }, {\n key: '_onKeyDown',\n value: function _onKeyDown() {\n var _this7 = this;\n\n var ratio = this.getCanvasRatio();\n var obj = this._editingObj;\n var textareaStyle = this._textarea.style;\n\n setTimeout(function () {\n obj.text(_this7._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\n }, {\n key: '_onBlur',\n value: function _onBlur() {\n var ratio = this.getCanvasRatio();\n var editingObj = this._editingObj;\n var editingObjInfos = this._editingObjInfos;\n var textContent = this._textarea.value;\n var transWidth = editingObj.width / ratio - editingObjInfos.width / ratio;\n var 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 var params = {\n id: _tuiCodeSnippet2.default.stamp(editingObj),\n type: editingObj.type,\n text: textContent\n };\n\n this.fire(_consts.eventNames.TEXT_CHANGED, params);\n }\n }\n\n /**\n * Scroll event handler\n * @private\n */\n\n }, {\n key: '_onScroll',\n value: function _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\n }, {\n key: '_onFabricScaling',\n value: function _onFabricScaling(fEvent) {\n var obj = fEvent.target;\n var scalingSize = obj.fontSize * obj.scaleY;\n\n obj.fontSize = scalingSize;\n obj.scaleX = 1;\n obj.scaleY = 1;\n }\n\n /**\n * onSelectClear handler in fabric canvas\n * @param {{target: fabric.Object, e: MouseEvent}} fEvent - Fabric event\n * @private\n */\n\n }, {\n key: '_onFabricSelectClear',\n value: function _onFabricSelectClear(fEvent) {\n var 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\n }, {\n key: '_onFabricSelect',\n value: function _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\n }, {\n key: '_onFabricMouseDown',\n value: function _onFabricMouseDown(fEvent) {\n var 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\n }, {\n key: '_fireAddText',\n value: function _fireAddText(fEvent) {\n var obj = fEvent.target;\n var e = fEvent.e || {};\n var originPointer = this.getCanvas().getPointer(e);\n\n if (!obj) {\n this.fire(_consts.eventNames.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\n }, {\n key: '_onFabricMouseUp',\n value: function _onFabricMouseUp(fEvent) {\n var target = fEvent.target;\n\n var newClickTime = new Date().getTime();\n\n if (this._isDoubleClick(newClickTime) && !target.isEditing) {\n target.enterEditing();\n }\n\n if (target.isEditing) {\n this.fire(_consts.eventNames.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\n }, {\n key: '_isDoubleClick',\n value: function _isDoubleClick(newClickTime) {\n return newClickTime - this._lastClickTime < DBCLICK_TIME;\n }\n }]);\n\n return Text;\n}(_component2.default);\n\nexports.default = Text;\n\n//# sourceURL=webpack://tui.ImageEditor/./src/js/component/text.js?"); - -/***/ }), - -/***/ "./src/js/consts.js": -/*!**************************!*\ - !*** ./src/js/consts.js ***! - \**************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; -eval("\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.defaultFilterRangeValus = exports.defaultTextRangeValus = exports.defaultShapeStrokeValus = exports.defaultDrawRangeValus = exports.defaultRotateRangeValus = exports.defaultIconPath = exports.rejectMessages = exports.fObjectOptions = exports.keyCodes = exports.drawingModes = exports.eventNames = exports.commandNames = exports.CROPZONE_DEFAULT_OPTIONS = exports.SHAPE_DEFAULT_OPTIONS = exports.componentNames = exports.SHAPE_TYPE = exports.SHAPE_FILL_TYPE = exports.FILTER_NAME_VALUE_MAP = exports.HELP_MENUS = undefined;\n\nvar _util = __webpack_require__(/*! ./util */ \"./src/js/util.js\");\n\n/**\n * Editor help features\n * @type {Array.}\n */\nvar HELP_MENUS = exports.HELP_MENUS = ['undo', 'redo', 'reset', 'delete', 'deleteAll'];\n\n/**\n * Filter name value map\n * @type {Object.}\n */\n/**\n * @author NHN Ent. FE Development Team \n * @fileoverview Constants\n */\nvar FILTER_NAME_VALUE_MAP = exports.FILTER_NAME_VALUE_MAP = {\n blur: 'blur',\n blocksize: 'pixelate'\n};\n\n/**\n * Fill type for shape\n * @type {Object.}\n */\nvar SHAPE_FILL_TYPE = exports.SHAPE_FILL_TYPE = {\n FILTER: 'filter',\n COLOR: 'color'\n};\n\n/**\n * Shape type list\n * @type {Array.}\n */\nvar SHAPE_TYPE = exports.SHAPE_TYPE = ['rect', 'circle', 'triangle'];\n\n/**\n * Component names\n * @type {Object.}\n */\nvar componentNames = exports.componentNames = (0, _util.keyMirror)('IMAGE_LOADER', 'CROPPER', 'FLIP', 'ROTATION', 'FREE_DRAWING', 'LINE', 'TEXT', 'ICON', 'FILTER', 'SHAPE');\n\n/**\n * Shape default option\n * @type {Object}\n */\nvar SHAPE_DEFAULT_OPTIONS = exports.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 */\nvar CROPZONE_DEFAULT_OPTIONS = exports.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 */\nvar commandNames = exports.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 */\nvar eventNames = exports.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};\n\n/**\n * Editor states\n * @type {Object.}\n */\nvar drawingModes = exports.drawingModes = (0, _util.keyMirror)('NORMAL', 'CROPPER', 'FREE_DRAWING', 'LINE_DRAWING', 'TEXT', 'SHAPE', 'ICON');\n\n/**\n * Shortcut key values\n * @type {Object.}\n */\nvar keyCodes = exports.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};\n\n/**\n * Fabric object options\n * @type {Object.}\n */\nvar fObjectOptions = exports.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 */\nvar rejectMessages = exports.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 */\nvar defaultIconPath = exports.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': 'M43.349998,27 L17.354,53 H1.949999 l25.996,-26 L1.949999,1 h15.404 L43.349998,27 z ',\n '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 ',\n '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 ',\n 'icon-polygon': 'M3,31 L19,3 h32 l16,28 l-16,28 H19 z ',\n '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',\n '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 ',\n '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'\n};\n\nvar defaultRotateRangeValus = exports.defaultRotateRangeValus = {\n realTimeEvent: true,\n min: -360,\n max: 360,\n value: 0\n};\n\nvar defaultDrawRangeValus = exports.defaultDrawRangeValus = {\n min: 5,\n max: 30,\n value: 12\n};\n\nvar defaultShapeStrokeValus = exports.defaultShapeStrokeValus = {\n realTimeEvent: true,\n min: 2,\n max: 300,\n value: 3\n};\n\nvar defaultTextRangeValus = exports.defaultTextRangeValus = {\n realTimeEvent: true,\n min: 10,\n max: 100,\n value: 50\n};\n\nvar defaultFilterRangeValus = exports.defaultFilterRangeValus = {\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 colorfilterThresholeRange: {\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\n//# sourceURL=webpack://tui.ImageEditor/./src/js/consts.js?"); - -/***/ }), - -/***/ "./src/js/drawingMode/cropper.js": -/*!***************************************!*\ - !*** ./src/js/drawingMode/cropper.js ***! - \***************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; -eval("\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\nvar _drawingMode = __webpack_require__(/*! ../interface/drawingMode */ \"./src/js/interface/drawingMode.js\");\n\nvar _drawingMode2 = _interopRequireDefault(_drawingMode);\n\nvar _consts = __webpack_require__(/*! ../consts */ \"./src/js/consts.js\");\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return call && (typeof call === \"object\" || typeof call === \"function\") ? call : self; }\n\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function, not \" + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } /**\n * @author NHN Ent. FE Development Team \n * @fileoverview CropperDrawingMode class\n */\n\n\n/**\n * CropperDrawingMode class\n * @class\n * @ignore\n */\nvar CropperDrawingMode = function (_DrawingMode) {\n _inherits(CropperDrawingMode, _DrawingMode);\n\n function CropperDrawingMode() {\n _classCallCheck(this, CropperDrawingMode);\n\n return _possibleConstructorReturn(this, (CropperDrawingMode.__proto__ || Object.getPrototypeOf(CropperDrawingMode)).call(this, _consts.drawingModes.CROPPER));\n }\n\n /**\n * start this drawing mode\n * @param {Graphics} graphics - Graphics instance\n * @override\n */\n\n\n _createClass(CropperDrawingMode, [{\n key: 'start',\n value: function start(graphics) {\n var cropper = graphics.getComponent(_consts.componentNames.CROPPER);\n cropper.start();\n }\n\n /**\n * stop this drawing mode\n * @param {Graphics} graphics - Graphics instance\n * @override\n */\n\n }, {\n key: 'end',\n value: function end(graphics) {\n var cropper = graphics.getComponent(_consts.componentNames.CROPPER);\n cropper.end();\n }\n }]);\n\n return CropperDrawingMode;\n}(_drawingMode2.default);\n\nexports.default = CropperDrawingMode;\n\n//# sourceURL=webpack://tui.ImageEditor/./src/js/drawingMode/cropper.js?"); - -/***/ }), - -/***/ "./src/js/drawingMode/freeDrawing.js": -/*!*******************************************!*\ - !*** ./src/js/drawingMode/freeDrawing.js ***! - \*******************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; -eval("\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\nvar _drawingMode = __webpack_require__(/*! ../interface/drawingMode */ \"./src/js/interface/drawingMode.js\");\n\nvar _drawingMode2 = _interopRequireDefault(_drawingMode);\n\nvar _consts = __webpack_require__(/*! ../consts */ \"./src/js/consts.js\");\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return call && (typeof call === \"object\" || typeof call === \"function\") ? call : self; }\n\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function, not \" + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } /**\n * @author NHN Ent. FE Development Team \n * @fileoverview FreeDrawingMode class\n */\n\n\n/**\n * FreeDrawingMode class\n * @class\n * @ignore\n */\nvar FreeDrawingMode = function (_DrawingMode) {\n _inherits(FreeDrawingMode, _DrawingMode);\n\n function FreeDrawingMode() {\n _classCallCheck(this, FreeDrawingMode);\n\n return _possibleConstructorReturn(this, (FreeDrawingMode.__proto__ || Object.getPrototypeOf(FreeDrawingMode)).call(this, _consts.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\n\n _createClass(FreeDrawingMode, [{\n key: 'start',\n value: function start(graphics, options) {\n var freeDrawing = graphics.getComponent(_consts.componentNames.FREE_DRAWING);\n freeDrawing.start(options);\n }\n\n /**\n * stop this drawing mode\n * @param {Graphics} graphics - Graphics instance\n * @override\n */\n\n }, {\n key: 'end',\n value: function end(graphics) {\n var freeDrawing = graphics.getComponent(_consts.componentNames.FREE_DRAWING);\n freeDrawing.end();\n }\n }]);\n\n return FreeDrawingMode;\n}(_drawingMode2.default);\n\nexports.default = FreeDrawingMode;\n\n//# sourceURL=webpack://tui.ImageEditor/./src/js/drawingMode/freeDrawing.js?"); - -/***/ }), - -/***/ "./src/js/drawingMode/icon.js": -/*!************************************!*\ - !*** ./src/js/drawingMode/icon.js ***! - \************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; -eval("\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\nvar _drawingMode = __webpack_require__(/*! ../interface/drawingMode */ \"./src/js/interface/drawingMode.js\");\n\nvar _drawingMode2 = _interopRequireDefault(_drawingMode);\n\nvar _consts = __webpack_require__(/*! ../consts */ \"./src/js/consts.js\");\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return call && (typeof call === \"object\" || typeof call === \"function\") ? call : self; }\n\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function, not \" + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } /**\n * @author NHN Ent. FE Development Team \n * @fileoverview IconDrawingMode class\n */\n\n\n/**\n * IconDrawingMode class\n * @class\n * @ignore\n */\nvar IconDrawingMode = function (_DrawingMode) {\n _inherits(IconDrawingMode, _DrawingMode);\n\n function IconDrawingMode() {\n _classCallCheck(this, IconDrawingMode);\n\n return _possibleConstructorReturn(this, (IconDrawingMode.__proto__ || Object.getPrototypeOf(IconDrawingMode)).call(this, _consts.drawingModes.ICON));\n }\n\n /**\n * start this drawing mode\n * @param {Graphics} graphics - Graphics instance\n * @override\n */\n\n\n _createClass(IconDrawingMode, [{\n key: 'start',\n value: function start(graphics) {\n var icon = graphics.getComponent(_consts.componentNames.ICON);\n icon.start();\n }\n\n /**\n * stop this drawing mode\n * @param {Graphics} graphics - Graphics instance\n * @override\n */\n\n }, {\n key: 'end',\n value: function end(graphics) {\n var icon = graphics.getComponent(_consts.componentNames.ICON);\n icon.end();\n }\n }]);\n\n return IconDrawingMode;\n}(_drawingMode2.default);\n\nexports.default = IconDrawingMode;\n\n//# sourceURL=webpack://tui.ImageEditor/./src/js/drawingMode/icon.js?"); - -/***/ }), - -/***/ "./src/js/drawingMode/lineDrawing.js": -/*!*******************************************!*\ - !*** ./src/js/drawingMode/lineDrawing.js ***! - \*******************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; -eval("\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\nvar _drawingMode = __webpack_require__(/*! ../interface/drawingMode */ \"./src/js/interface/drawingMode.js\");\n\nvar _drawingMode2 = _interopRequireDefault(_drawingMode);\n\nvar _consts = __webpack_require__(/*! ../consts */ \"./src/js/consts.js\");\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return call && (typeof call === \"object\" || typeof call === \"function\") ? call : self; }\n\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function, not \" + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } /**\n * @author NHN Ent. FE Development Team \n * @fileoverview LineDrawingMode class\n */\n\n\n/**\n * LineDrawingMode class\n * @class\n * @ignore\n */\nvar LineDrawingMode = function (_DrawingMode) {\n _inherits(LineDrawingMode, _DrawingMode);\n\n function LineDrawingMode() {\n _classCallCheck(this, LineDrawingMode);\n\n return _possibleConstructorReturn(this, (LineDrawingMode.__proto__ || Object.getPrototypeOf(LineDrawingMode)).call(this, _consts.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\n\n _createClass(LineDrawingMode, [{\n key: 'start',\n value: function start(graphics, options) {\n var lineDrawing = graphics.getComponent(_consts.componentNames.LINE);\n lineDrawing.start(options);\n }\n\n /**\n * stop this drawing mode\n * @param {Graphics} graphics - Graphics instance\n * @override\n */\n\n }, {\n key: 'end',\n value: function end(graphics) {\n var lineDrawing = graphics.getComponent(_consts.componentNames.LINE);\n lineDrawing.end();\n }\n }]);\n\n return LineDrawingMode;\n}(_drawingMode2.default);\n\nexports.default = LineDrawingMode;\n\n//# sourceURL=webpack://tui.ImageEditor/./src/js/drawingMode/lineDrawing.js?"); - -/***/ }), - -/***/ "./src/js/drawingMode/shape.js": -/*!*************************************!*\ - !*** ./src/js/drawingMode/shape.js ***! - \*************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; -eval("\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\nvar _drawingMode = __webpack_require__(/*! ../interface/drawingMode */ \"./src/js/interface/drawingMode.js\");\n\nvar _drawingMode2 = _interopRequireDefault(_drawingMode);\n\nvar _consts = __webpack_require__(/*! ../consts */ \"./src/js/consts.js\");\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return call && (typeof call === \"object\" || typeof call === \"function\") ? call : self; }\n\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function, not \" + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } /**\n * @author NHN Ent. FE Development Team \n * @fileoverview ShapeDrawingMode class\n */\n\n\n/**\n * ShapeDrawingMode class\n * @class\n * @ignore\n */\nvar ShapeDrawingMode = function (_DrawingMode) {\n _inherits(ShapeDrawingMode, _DrawingMode);\n\n function ShapeDrawingMode() {\n _classCallCheck(this, ShapeDrawingMode);\n\n return _possibleConstructorReturn(this, (ShapeDrawingMode.__proto__ || Object.getPrototypeOf(ShapeDrawingMode)).call(this, _consts.drawingModes.SHAPE));\n }\n\n /**\n * start this drawing mode\n * @param {Graphics} graphics - Graphics instance\n * @override\n */\n\n\n _createClass(ShapeDrawingMode, [{\n key: 'start',\n value: function start(graphics) {\n var shape = graphics.getComponent(_consts.componentNames.SHAPE);\n shape.start();\n }\n\n /**\n * stop this drawing mode\n * @param {Graphics} graphics - Graphics instance\n * @override\n */\n\n }, {\n key: 'end',\n value: function end(graphics) {\n var shape = graphics.getComponent(_consts.componentNames.SHAPE);\n shape.end();\n }\n }]);\n\n return ShapeDrawingMode;\n}(_drawingMode2.default);\n\nexports.default = ShapeDrawingMode;\n\n//# sourceURL=webpack://tui.ImageEditor/./src/js/drawingMode/shape.js?"); - -/***/ }), - -/***/ "./src/js/drawingMode/text.js": -/*!************************************!*\ - !*** ./src/js/drawingMode/text.js ***! - \************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; -eval("\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\nvar _drawingMode = __webpack_require__(/*! ../interface/drawingMode */ \"./src/js/interface/drawingMode.js\");\n\nvar _drawingMode2 = _interopRequireDefault(_drawingMode);\n\nvar _consts = __webpack_require__(/*! ../consts */ \"./src/js/consts.js\");\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return call && (typeof call === \"object\" || typeof call === \"function\") ? call : self; }\n\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function, not \" + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } /**\n * @author NHN Ent. FE Development Team \n * @fileoverview TextDrawingMode class\n */\n\n\n/**\n * TextDrawingMode class\n * @class\n * @ignore\n */\nvar TextDrawingMode = function (_DrawingMode) {\n _inherits(TextDrawingMode, _DrawingMode);\n\n function TextDrawingMode() {\n _classCallCheck(this, TextDrawingMode);\n\n return _possibleConstructorReturn(this, (TextDrawingMode.__proto__ || Object.getPrototypeOf(TextDrawingMode)).call(this, _consts.drawingModes.TEXT));\n }\n\n /**\n * start this drawing mode\n * @param {Graphics} graphics - Graphics instance\n * @override\n */\n\n\n _createClass(TextDrawingMode, [{\n key: 'start',\n value: function start(graphics) {\n var text = graphics.getComponent(_consts.componentNames.TEXT);\n text.start();\n }\n\n /**\n * stop this drawing mode\n * @param {Graphics} graphics - Graphics instance\n * @override\n */\n\n }, {\n key: 'end',\n value: function end(graphics) {\n var text = graphics.getComponent(_consts.componentNames.TEXT);\n text.end();\n }\n }]);\n\n return TextDrawingMode;\n}(_drawingMode2.default);\n\nexports.default = TextDrawingMode;\n\n//# sourceURL=webpack://tui.ImageEditor/./src/js/drawingMode/text.js?"); - -/***/ }), - -/***/ "./src/js/extension/arrowLine.js": -/*!***************************************!*\ - !*** ./src/js/extension/arrowLine.js ***! - \***************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; -eval("\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _fabric = __webpack_require__(/*! fabric */ \"fabric\");\n\nvar _fabric2 = _interopRequireDefault(_fabric);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nvar ARROW_ANGLE = 30; /**\n * @author NHN. FE Development Team \n * @fileoverview Blur extending fabric.Image.filters.Convolute\n */\n\nvar CHEVRON_SIZE_RATIO = 2.7;\nvar TRIANGLE_SIZE_RATIO = 1.7;\nvar RADIAN_CONVERSION_VALUE = 180;\n\nvar ArrowLine = _fabric2.default.util.createClass(_fabric2.default.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: function initialize(points) {\n var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};\n\n this.callSuper('initialize', points, options);\n\n this.arrowType = options.arrowType;\n },\n\n\n /**\n * Render ArrowLine\n * @private\n * @override\n */\n _render: function _render(ctx) {\n var _calcLinePoints = this.calcLinePoints(),\n fromX = _calcLinePoints.x1,\n fromY = _calcLinePoints.y1,\n toX = _calcLinePoints.x2,\n toY = _calcLinePoints.y2;\n\n var linePosition = {\n fromX: fromX,\n fromY: fromY,\n toX: toX,\n toY: 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 /**\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: function _renderBasicLinePath(_ref) {\n var fromX = _ref.fromX,\n fromY = _ref.fromY,\n toX = _ref.toX,\n toY = _ref.toY;\n\n this.ctx.beginPath();\n this.ctx.moveTo(fromX, fromY);\n this.ctx.lineTo(toX, toY);\n },\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: function _drawDecoratorPath(linePosition) {\n this._drawDecoratorPathType('head', linePosition);\n this._drawDecoratorPathType('tail', linePosition);\n },\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: function _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 /**\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: function _drawTrianglePath(type, linePosition) {\n var decorateSize = this.ctx.lineWidth * TRIANGLE_SIZE_RATIO;\n\n this._drawChevronPath(type, linePosition, decorateSize);\n this.ctx.closePath();\n },\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: function _drawChevronPath(type, _ref2, decorateSize) {\n var _this = this;\n\n var fromX = _ref2.fromX,\n fromY = _ref2.fromY,\n toX = _ref2.toX,\n toY = _ref2.toY;\n var ctx = this.ctx;\n\n if (!decorateSize) {\n decorateSize = this.ctx.lineWidth * CHEVRON_SIZE_RATIO;\n }\n\n var _ref3 = type === 'head' ? [fromX, fromY] : [toX, toY],\n standardX = _ref3[0],\n standardY = _ref3[1];\n\n var _ref4 = type === 'head' ? [toX, toY] : [fromX, fromY],\n compareX = _ref4[0],\n compareY = _ref4[1];\n\n var angle = Math.atan2(compareY - standardY, compareX - standardX) * RADIAN_CONVERSION_VALUE / Math.PI;\n var rotatedPosition = function rotatedPosition(changeAngle) {\n return _this.getRotatePosition(decorateSize, changeAngle, {\n x: standardX,\n y: standardY\n });\n };\n\n ctx.moveTo.apply(ctx, rotatedPosition(angle + ARROW_ANGLE));\n ctx.lineTo(standardX, standardY);\n ctx.lineTo.apply(ctx, rotatedPosition(angle - ARROW_ANGLE));\n },\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: function getRotatePosition(distance, angle, referencePosition) {\n var radian = angle * Math.PI / RADIAN_CONVERSION_VALUE;\n var x = referencePosition.x,\n y = referencePosition.y;\n\n\n return [distance * Math.cos(radian) + x, distance * Math.sin(radian) + y];\n }\n});\n\nexports.default = ArrowLine;\n\n//# sourceURL=webpack://tui.ImageEditor/./src/js/extension/arrowLine.js?"); - -/***/ }), - -/***/ "./src/js/extension/colorFilter.js": -/*!*****************************************!*\ - !*** ./src/js/extension/colorFilter.js ***! - \*****************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; -eval("\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _fabric = __webpack_require__(/*! fabric */ \"fabric\");\n\nvar _fabric2 = _interopRequireDefault(_fabric);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\n/**\n * ColorFilter object\n * @class ColorFilter\n * @extends {fabric.Image.filters.BaseFilter}\n * @ignore\n */\nvar ColorFilter = _fabric2.default.util.createClass(_fabric2.default.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: function 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 /**\n * Applies filter to canvas element\n * @param {Object} canvas Canvas object passed by fabric\n */\n // eslint-disable-next-line complexity\n applyTo: function applyTo(canvas) {\n var canvasEl = canvas.canvasEl;\n\n var context = canvasEl.getContext('2d');\n var imageData = context.getImageData(0, 0, canvasEl.width, canvasEl.height);\n var data = imageData.data;\n var threshold = this.threshold;\n\n var filterColor = _fabric2.default.Color.sourceFromHex(this.color);\n var i = void 0,\n len = void 0;\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 (this._isOutsideThreshold(data[i], filterColor[0], threshold) || this._isOutsideThreshold(data[i + 1], filterColor[1], threshold) || this._isOutsideThreshold(data[i + 2], filterColor[2], threshold)) {\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 /**\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: function _isOutsideThreshold(color1, color2, threshold) {\n var diff = color1 - color2;\n\n return Math.abs(diff) > threshold;\n },\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: function _getColor(imageData, x, y) {\n var color = [0, 0, 0, 0];\n var data = imageData.data,\n width = imageData.width;\n\n var bytes = 4;\n var 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 * @author NHN Ent. FE Development Team \n * @fileoverview ColorFilter extending fabric.Image.filters.BaseFilter\n */\nexports.default = ColorFilter;\n\n//# sourceURL=webpack://tui.ImageEditor/./src/js/extension/colorFilter.js?"); - -/***/ }), - -/***/ "./src/js/extension/cropzone.js": -/*!**************************************!*\ - !*** ./src/js/extension/cropzone.js ***! - \**************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; -eval("\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _tuiCodeSnippet = __webpack_require__(/*! tui-code-snippet */ \"tui-code-snippet\");\n\nvar _tuiCodeSnippet2 = _interopRequireDefault(_tuiCodeSnippet);\n\nvar _fabric = __webpack_require__(/*! fabric */ \"fabric\");\n\nvar _fabric2 = _interopRequireDefault(_fabric);\n\nvar _util = __webpack_require__(/*! ../util */ \"./src/js/util.js\");\n\nvar _consts = __webpack_require__(/*! ../consts */ \"./src/js/consts.js\");\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } /**\n * @author NHN Ent. FE Development Team \n * @fileoverview Cropzone extending fabric.Rect\n */\n\n\nvar CORNER_TYPE_TOP_LEFT = 'tl';\nvar CORNER_TYPE_TOP_RIGHT = 'tr';\nvar CORNER_TYPE_MIDDLE_TOP = 'mt';\nvar CORNER_TYPE_MIDDLE_LEFT = 'ml';\nvar CORNER_TYPE_MIDDLE_RIGHT = 'mr';\nvar CORNER_TYPE_MIDDLE_BOTTOM = 'mb';\nvar CORNER_TYPE_BOTTOM_LEFT = 'bl';\nvar CORNER_TYPE_BOTTOM_RIGHT = 'br';\nvar CORNER_TYPE_LIST = [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];\nvar NOOP_FUNCTION = function 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 */\nvar Cropzone = _fabric2.default.util.createClass(_fabric2.default.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: function initialize(canvas, options, extendsOptions) {\n options = _tuiCodeSnippet2.default.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: function canvasEventDelegation(eventName) {\n var delegationState = 'unregisted';\n var isRegisted = this.canvasEventTrigger[eventName] !== NOOP_FUNCTION;\n if (isRegisted) {\n delegationState = 'registed';\n } else if ([_consts.eventNames.OBJECT_MOVED, _consts.eventNames.OBJECT_SCALED].indexOf(eventName) < 0) {\n delegationState = 'none';\n }\n\n return delegationState;\n },\n canvasEventRegister: function canvasEventRegister(eventName, eventTrigger) {\n this.canvasEventTrigger[eventName] = eventTrigger;\n },\n _addEventHandler: function _addEventHandler() {\n var _canvasEventTrigger;\n\n this.canvasEventTrigger = (_canvasEventTrigger = {}, _defineProperty(_canvasEventTrigger, _consts.eventNames.OBJECT_MOVED, NOOP_FUNCTION), _defineProperty(_canvasEventTrigger, _consts.eventNames.OBJECT_SCALED, NOOP_FUNCTION), _canvasEventTrigger);\n this.on({\n moving: this._onMoving.bind(this),\n scaling: this._onScaling.bind(this)\n });\n },\n _renderCropzone: function _renderCropzone(ctx) {\n var cropzoneDashLineWidth = 7;\n var cropzoneDashLineOffset = 7;\n\n // Calc original scale\n var originalFlipX = this.flipX ? -1 : 1;\n var originalFlipY = this.flipY ? -1 : 1;\n var originalScaleX = originalFlipX / this.scaleX;\n var 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 /**\n * Render Crop-zone\n * @private\n * @override\n */\n _render: function _render(ctx) {\n this.callSuper('_render', ctx);\n\n this._renderCropzone(ctx);\n },\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: function _fillOuterRect(ctx, fillStyle) {\n var _getCoordinates = this._getCoordinates(),\n x = _getCoordinates.x,\n y = _getCoordinates.y;\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 /**\n * Draw Inner grid line\n * @param {CanvasRenderingContext2D} ctx - Context\n * @private\n */\n _fillInnerRect: function _fillInnerRect(ctx) {\n var _getCoordinates2 = this._getCoordinates(),\n outerX = _getCoordinates2.x,\n outerY = _getCoordinates2.y;\n\n var x = this._caculateInnerPosition(outerX, (outerX[2] - outerX[1]) / 3);\n var 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 /**\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: function _caculateInnerPosition(outer, size) {\n var 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 /**\n * Get coordinates\n * @returns {cropzoneCoordinates} - {@link cropzoneCoordinates}\n * @private\n */\n _getCoordinates: function _getCoordinates() {\n var canvas = this.canvas,\n width = this.width,\n height = this.height,\n left = this.left,\n top = this.top;\n\n var halfWidth = width / 2;\n var halfHeight = height / 2;\n var canvasHeight = canvas.getHeight(); // fabric object\n var canvasWidth = canvas.getWidth(); // fabric object\n\n return {\n x: _tuiCodeSnippet2.default.map([-(halfWidth + left), // x0\n -halfWidth, // x1\n halfWidth, // x2\n halfWidth + (canvasWidth - left - width)], Math.ceil),\n y: _tuiCodeSnippet2.default.map([-(halfHeight + top), // y0\n -halfHeight, // y1\n halfHeight, // y2\n halfHeight + (canvasHeight - top - height)], 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: function _strokeBorder(ctx, strokeStyle, _ref) {\n var lineDashWidth = _ref.lineDashWidth,\n lineDashOffset = _ref.lineDashOffset,\n lineWidth = _ref.lineWidth;\n\n var halfWidth = this.width / 2;\n var 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 /**\n * onMoving event listener\n * @private\n */\n _onMoving: function _onMoving() {\n var height = this.height,\n width = this.width,\n left = this.left,\n top = this.top;\n\n var maxLeft = this.canvas.getWidth() - width;\n var maxTop = this.canvas.getHeight() - height;\n\n this.left = (0, _util.clamp)(left, 0, maxLeft);\n this.top = (0, _util.clamp)(top, 0, maxTop);\n\n this.canvasEventTrigger[_consts.eventNames.OBJECT_MOVED](this);\n },\n\n\n /**\n * onScaling event listener\n * @param {{e: MouseEvent}} fEvent - Fabric event\n * @private\n */\n _onScaling: function _onScaling(fEvent) {\n var selectedCorner = fEvent.transform.corner;\n var pointer = this.canvas.getPointer(fEvent.e);\n var 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[_consts.eventNames.OBJECT_SCALED](this);\n },\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: function _calcScalingSizeFromPointer(pointer, selectedCorner) {\n var isCornerTypeValid = cornerTypeValid(selectedCorner);\n\n return isCornerTypeValid && this._resizeCropZone(pointer, selectedCorner);\n },\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: function adjustRatioCropzoneSize(_ref2) {\n var width = _ref2.width,\n height = _ref2.height,\n leftMaker = _ref2.leftMaker,\n topMaker = _ref2.topMaker,\n maxWidth = _ref2.maxWidth,\n maxHeight = _ref2.maxHeight,\n scaleTo = _ref2.scaleTo;\n\n width = maxWidth ? (0, _util.clamp)(width, 1, maxWidth) : width;\n height = maxHeight ? (0, _util.clamp)(height, 1, maxHeight) : height;\n\n if (!this.presetRatio) {\n return {\n width: width,\n height: 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 var maxScaleFactor = Math.min(maxWidth / width, maxHeight / height);\n if (maxScaleFactor <= 1) {\n var _map = [width, height].map(function (v) {\n return v * maxScaleFactor;\n });\n\n width = _map[0];\n height = _map[1];\n }\n\n return {\n width: width,\n height: height,\n left: leftMaker(width),\n top: topMaker(height)\n };\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: function _getCropzoneRectInfo() {\n var _canvas = this.canvas,\n canvasWidth = _canvas.width,\n canvasHeight = _canvas.height;\n\n var _getBoundingRect = this.getBoundingRect(false, true),\n rectTop = _getBoundingRect.top,\n rectLeft = _getBoundingRect.left,\n rectWidth = _getBoundingRect.width,\n rectHeight = _getBoundingRect.height;\n\n return {\n rectTop: rectTop,\n rectLeft: rectLeft,\n rectWidth: rectWidth,\n rectHeight: rectHeight,\n rectRight: rectLeft + rectWidth,\n rectBottom: rectTop + rectHeight,\n canvasWidth: canvasWidth,\n canvasHeight: canvasHeight\n };\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: function _resizeCropZone(_ref3, corner) {\n var x = _ref3.x,\n y = _ref3.y;\n\n var _getCropzoneRectInfo2 = this._getCropzoneRectInfo(),\n rectWidth = _getCropzoneRectInfo2.rectWidth,\n rectHeight = _getCropzoneRectInfo2.rectHeight,\n rectTop = _getCropzoneRectInfo2.rectTop,\n rectLeft = _getCropzoneRectInfo2.rectLeft,\n rectBottom = _getCropzoneRectInfo2.rectBottom,\n rectRight = _getCropzoneRectInfo2.rectRight,\n canvasWidth = _getCropzoneRectInfo2.canvasWidth,\n canvasHeight = _getCropzoneRectInfo2.canvasHeight;\n\n var resizeInfoMap = {\n tl: {\n width: rectRight - x,\n height: rectBottom - y,\n leftMaker: function leftMaker(newWidth) {\n return rectRight - newWidth;\n },\n topMaker: function topMaker(newHeight) {\n return rectBottom - newHeight;\n },\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: function leftMaker() {\n return rectLeft;\n },\n topMaker: function topMaker(newHeight) {\n return rectBottom - newHeight;\n },\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: function leftMaker() {\n return rectLeft;\n },\n topMaker: function topMaker(newHeight) {\n return rectBottom - newHeight;\n },\n maxWidth: canvasWidth - rectLeft,\n maxHeight: rectBottom,\n scaleTo: 'height'\n },\n ml: {\n width: rectRight - x,\n height: rectHeight,\n leftMaker: function leftMaker(newWidth) {\n return rectRight - newWidth;\n },\n topMaker: function topMaker() {\n return rectTop;\n },\n maxWidth: rectRight,\n maxHeight: canvasHeight - rectTop,\n scaleTo: 'width'\n },\n mr: {\n width: x - rectLeft,\n height: rectHeight,\n leftMaker: function leftMaker() {\n return rectLeft;\n },\n topMaker: function topMaker() {\n return rectTop;\n },\n maxWidth: canvasWidth - rectLeft,\n maxHeight: canvasHeight - rectTop,\n scaleTo: 'width'\n },\n mb: {\n width: rectWidth,\n height: y - rectTop,\n leftMaker: function leftMaker() {\n return rectLeft;\n },\n topMaker: function topMaker() {\n return rectTop;\n },\n maxWidth: canvasWidth - rectLeft,\n maxHeight: canvasHeight - rectTop,\n scaleTo: 'height'\n },\n bl: {\n width: rectRight - x,\n height: y - rectTop,\n leftMaker: function leftMaker(newWidth) {\n return rectRight - newWidth;\n },\n topMaker: function topMaker() {\n return rectTop;\n },\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: function leftMaker() {\n return rectLeft;\n },\n topMaker: function topMaker() {\n return rectTop;\n },\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 /**\n * Return the whether this cropzone is valid\n * @returns {boolean}\n */\n isValid: function isValid() {\n return this.left >= 0 && this.top >= 0 && this.width > 0 && this.height > 0;\n }\n});\n\nexports.default = Cropzone;\n\n//# sourceURL=webpack://tui.ImageEditor/./src/js/extension/cropzone.js?"); - -/***/ }), - -/***/ "./src/js/extension/emboss.js": -/*!************************************!*\ - !*** ./src/js/extension/emboss.js ***! - \************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; -eval("\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _fabric = __webpack_require__(/*! fabric */ \"fabric\");\n\nvar _fabric2 = _interopRequireDefault(_fabric);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\n/**\n * Emboss object\n * @class Emboss\n * @extends {fabric.Image.filters.Convolute}\n * @ignore\n */\nvar Emboss = _fabric2.default.util.createClass(_fabric2.default.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: function initialize() {\n var matrix = [1, 1, 1, 1, 0.7, -1, -1, -1, -1];\n this.matrix = matrix;\n }\n}); /**\n * @author NHN Ent. FE Development Team \n * @fileoverview Emboss extending fabric.Image.filters.Convolute\n */\nexports.default = Emboss;\n\n//# sourceURL=webpack://tui.ImageEditor/./src/js/extension/emboss.js?"); - -/***/ }), - -/***/ "./src/js/extension/mask.js": -/*!**********************************!*\ - !*** ./src/js/extension/mask.js ***! - \**********************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; -eval("\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _fabric = __webpack_require__(/*! fabric */ \"fabric\");\n\nvar _fabric2 = _interopRequireDefault(_fabric);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\n/**\n * Mask object\n * @class Mask\n * @extends {fabric.Image.filters.BlendImage}\n * @ignore\n */\nvar Mask = _fabric2.default.util.createClass(_fabric2.default.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: function applyTo(pipelineState) {\n if (!this.mask) {\n return;\n }\n\n var canvas = pipelineState.canvasEl;\n var width = canvas.width,\n height = canvas.height;\n\n var maskCanvasEl = this._createCanvasOfMask(width, height);\n var ctx = canvas.getContext('2d');\n var maskCtx = maskCanvasEl.getContext('2d');\n var 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 /**\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: function _createCanvasOfMask(width, height) {\n var maskCanvasEl = _fabric2.default.util.createCanvasElement();\n\n maskCanvasEl.width = width;\n maskCanvasEl.height = height;\n\n return maskCanvasEl;\n },\n\n\n /**\n * Draw mask image on canvas element\n * @param {Object} maskCtx - Context of mask canvas\n * @private\n */\n _drawMask: function _drawMask(maskCtx) {\n var mask = this.mask;\n\n var maskImg = mask.getElement();\n var angle = mask.angle,\n left = mask.left,\n scaleX = mask.scaleX,\n scaleY = mask.scaleY,\n top = mask.top;\n\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 /**\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: function _mapData(maskCtx, imageData, width, height) {\n var data = imageData.data,\n imgHeight = imageData.height,\n imgWidth = imageData.width;\n\n var sourceData = data;\n var len = imgWidth * imgHeight * 4;\n var maskData = maskCtx.getImageData(0, 0, width, height).data;\n\n for (var i = 0; i < len; i += 4) {\n sourceData[i + 3] = maskData[i]; // adjust value of alpha data\n }\n }\n}); /**\n * @author NHN Ent. FE Development Team \n * @fileoverview Mask extending fabric.Image.filters.Mask\n */\nexports.default = Mask;\n\n//# sourceURL=webpack://tui.ImageEditor/./src/js/extension/mask.js?"); - -/***/ }), - -/***/ "./src/js/extension/sharpen.js": -/*!*************************************!*\ - !*** ./src/js/extension/sharpen.js ***! - \*************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; -eval("\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _fabric = __webpack_require__(/*! fabric */ \"fabric\");\n\nvar _fabric2 = _interopRequireDefault(_fabric);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\n/**\n * Sharpen object\n * @class Sharpen\n * @extends {fabric.Image.filters.Convolute}\n * @ignore\n */\nvar Sharpen = _fabric2.default.util.createClass(_fabric2.default.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: function initialize() {\n var matrix = [0, -1, 0, -1, 5, -1, 0, -1, 0];\n this.matrix = matrix;\n }\n}); /**\n * @author NHN Ent. FE Development Team \n * @fileoverview Sharpen extending fabric.Image.filters.Convolute\n */\nexports.default = Sharpen;\n\n//# sourceURL=webpack://tui.ImageEditor/./src/js/extension/sharpen.js?"); - -/***/ }), - -/***/ "./src/js/factory/command.js": -/*!***********************************!*\ - !*** ./src/js/factory/command.js ***! - \***********************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; -eval("\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _command = __webpack_require__(/*! ../interface/command */ \"./src/js/interface/command.js\");\n\nvar _command2 = _interopRequireDefault(_command);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nvar 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 */\n/**\n * @author NHN Ent. FE Development Team \n * @fileoverview Command factory\n */\nfunction create(name) {\n var actions = commands[name];\n if (actions) {\n for (var _len = arguments.length, args = Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {\n args[_key - 1] = arguments[_key];\n }\n\n return new _command2.default(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\nexports.default = {\n create: create,\n register: register\n};\n\n//# sourceURL=webpack://tui.ImageEditor/./src/js/factory/command.js?"); - -/***/ }), - -/***/ "./src/js/factory/errorMessage.js": -/*!****************************************!*\ - !*** ./src/js/factory/errorMessage.js ***! - \****************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; -eval("\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _tuiCodeSnippet = __webpack_require__(/*! tui-code-snippet */ \"tui-code-snippet\");\n\nvar _tuiCodeSnippet2 = _interopRequireDefault(_tuiCodeSnippet);\n\nvar _util = __webpack_require__(/*! ../util */ \"./src/js/util.js\");\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\n/**\n * @author NHN Ent. FE Development Team \n * @fileoverview Error-message factory\n */\nvar types = (0, _util.keyMirror)('UN_IMPLEMENTATION', 'NO_COMPONENT_NAME');\nvar messages = {\n UN_IMPLEMENTATION: 'Should implement a method: ',\n NO_COMPONENT_NAME: 'Should set a component name'\n};\nvar map = {\n UN_IMPLEMENTATION: function UN_IMPLEMENTATION(methodName) {\n return messages.UN_IMPLEMENTATION + methodName;\n },\n NO_COMPONENT_NAME: function NO_COMPONENT_NAME() {\n return messages.NO_COMPONENT_NAME;\n }\n};\n\nexports.default = {\n types: _tuiCodeSnippet2.default.extend({}, types),\n\n create: function create(type) {\n type = type.toLowerCase();\n var func = map[type];\n\n for (var _len = arguments.length, args = Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {\n args[_key - 1] = arguments[_key];\n }\n\n return func.apply(undefined, args);\n }\n};\n\n//# sourceURL=webpack://tui.ImageEditor/./src/js/factory/errorMessage.js?"); - -/***/ }), - -/***/ "./src/js/graphics.js": -/*!****************************!*\ - !*** ./src/js/graphics.js ***! - \****************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; -eval("\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); /**\n * @author NHN Ent. FE Development Team \n * @fileoverview Graphics module\n */\n\n\nvar _tuiCodeSnippet = __webpack_require__(/*! tui-code-snippet */ \"tui-code-snippet\");\n\nvar _tuiCodeSnippet2 = _interopRequireDefault(_tuiCodeSnippet);\n\nvar _fabric = __webpack_require__(/*! fabric */ \"fabric\");\n\nvar _fabric2 = _interopRequireDefault(_fabric);\n\nvar _imageLoader = __webpack_require__(/*! ./component/imageLoader */ \"./src/js/component/imageLoader.js\");\n\nvar _imageLoader2 = _interopRequireDefault(_imageLoader);\n\nvar _cropper = __webpack_require__(/*! ./component/cropper */ \"./src/js/component/cropper.js\");\n\nvar _cropper2 = _interopRequireDefault(_cropper);\n\nvar _flip = __webpack_require__(/*! ./component/flip */ \"./src/js/component/flip.js\");\n\nvar _flip2 = _interopRequireDefault(_flip);\n\nvar _rotation = __webpack_require__(/*! ./component/rotation */ \"./src/js/component/rotation.js\");\n\nvar _rotation2 = _interopRequireDefault(_rotation);\n\nvar _freeDrawing = __webpack_require__(/*! ./component/freeDrawing */ \"./src/js/component/freeDrawing.js\");\n\nvar _freeDrawing2 = _interopRequireDefault(_freeDrawing);\n\nvar _line = __webpack_require__(/*! ./component/line */ \"./src/js/component/line.js\");\n\nvar _line2 = _interopRequireDefault(_line);\n\nvar _text = __webpack_require__(/*! ./component/text */ \"./src/js/component/text.js\");\n\nvar _text2 = _interopRequireDefault(_text);\n\nvar _icon = __webpack_require__(/*! ./component/icon */ \"./src/js/component/icon.js\");\n\nvar _icon2 = _interopRequireDefault(_icon);\n\nvar _filter = __webpack_require__(/*! ./component/filter */ \"./src/js/component/filter.js\");\n\nvar _filter2 = _interopRequireDefault(_filter);\n\nvar _shape = __webpack_require__(/*! ./component/shape */ \"./src/js/component/shape.js\");\n\nvar _shape2 = _interopRequireDefault(_shape);\n\nvar _cropper3 = __webpack_require__(/*! ./drawingMode/cropper */ \"./src/js/drawingMode/cropper.js\");\n\nvar _cropper4 = _interopRequireDefault(_cropper3);\n\nvar _freeDrawing3 = __webpack_require__(/*! ./drawingMode/freeDrawing */ \"./src/js/drawingMode/freeDrawing.js\");\n\nvar _freeDrawing4 = _interopRequireDefault(_freeDrawing3);\n\nvar _lineDrawing = __webpack_require__(/*! ./drawingMode/lineDrawing */ \"./src/js/drawingMode/lineDrawing.js\");\n\nvar _lineDrawing2 = _interopRequireDefault(_lineDrawing);\n\nvar _shape3 = __webpack_require__(/*! ./drawingMode/shape */ \"./src/js/drawingMode/shape.js\");\n\nvar _shape4 = _interopRequireDefault(_shape3);\n\nvar _text3 = __webpack_require__(/*! ./drawingMode/text */ \"./src/js/drawingMode/text.js\");\n\nvar _text4 = _interopRequireDefault(_text3);\n\nvar _icon3 = __webpack_require__(/*! ./drawingMode/icon */ \"./src/js/drawingMode/icon.js\");\n\nvar _icon4 = _interopRequireDefault(_icon3);\n\nvar _util = __webpack_require__(/*! ./util */ \"./src/js/util.js\");\n\nvar _consts = __webpack_require__(/*! ./consts */ \"./src/js/consts.js\");\n\nvar _selectionModifyHelper = __webpack_require__(/*! ./helper/selectionModifyHelper */ \"./src/js/helper/selectionModifyHelper.js\");\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nvar extend = _tuiCodeSnippet2.default.extend,\n stamp = _tuiCodeSnippet2.default.stamp,\n isArray = _tuiCodeSnippet2.default.isArray,\n isString = _tuiCodeSnippet2.default.isString,\n forEachArray = _tuiCodeSnippet2.default.forEachArray,\n forEachOwnProperties = _tuiCodeSnippet2.default.forEachOwnProperties,\n CustomEvents = _tuiCodeSnippet2.default.CustomEvents;\n\nvar DEFAULT_CSS_MAX_WIDTH = 1000;\nvar DEFAULT_CSS_MAX_HEIGHT = 800;\nvar EXTRA_PX_FOR_PASTE = 10;\n\nvar cssOnly = {\n cssOnly: true\n};\nvar 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 */\n\nvar Graphics = function () {\n function Graphics(element) {\n var _ref = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {},\n cssMaxWidth = _ref.cssMaxWidth,\n cssMaxHeight = _ref.cssMaxHeight;\n\n _classCallCheck(this, Graphics);\n\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 = _consts.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\n\n _createClass(Graphics, [{\n key: 'destroy',\n value: function destroy() {\n var wrapperEl = this._canvas.wrapperEl;\n\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\n }, {\n key: 'deactivateAll',\n value: function deactivateAll() {\n this._canvas.discardActiveObject();\n\n return this;\n }\n\n /**\n * Renders all objects on canvas\n * @returns {Graphics} this\n */\n\n }, {\n key: 'renderAll',\n value: function 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\n }, {\n key: 'add',\n value: function add(objects) {\n var _canvas;\n\n var theArgs = [];\n if (isArray(objects)) {\n theArgs = objects;\n } else {\n theArgs.push(objects);\n }\n\n (_canvas = this._canvas).add.apply(_canvas, 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\n }, {\n key: 'contains',\n value: function 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\n }, {\n key: 'getObjects',\n value: function 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\n }, {\n key: 'getObject',\n value: function 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\n }, {\n key: 'remove',\n value: function 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\n }, {\n key: 'removeAll',\n value: function removeAll(includesBackground) {\n var canvas = this._canvas;\n var objects = canvas.getObjects().slice();\n canvas.remove.apply(canvas, 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\n }, {\n key: 'removeObjectById',\n value: function removeObjectById(id) {\n var objects = [];\n var canvas = this._canvas;\n var target = this.getObject(id);\n var isValidGroup = target && target.isType('group') && !target.isEmpty();\n\n if (isValidGroup) {\n canvas.discardActiveObject(); // restore states for each objects\n target.forEachObject(function (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\n }, {\n key: 'getObjectId',\n value: function getObjectId(object) {\n var 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\n }, {\n key: 'getActiveObject',\n value: function 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\n }, {\n key: 'getActiveObjectIdForRemove',\n value: function getActiveObjectIdForRemove() {\n var activeObject = this.getActiveObject();\n var type = activeObject.type,\n left = activeObject.left,\n top = activeObject.top;\n\n var isSelection = type === 'activeSelection';\n\n if (isSelection) {\n var group = new _fabric2.default.Group([].concat(activeObject.getObjects()), {\n left: left,\n top: 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\n }, {\n key: 'isReadyRemoveObject',\n value: function isReadyRemoveObject() {\n var 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\n }, {\n key: 'getActiveObjects',\n value: function getActiveObjects() {\n var 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\n }, {\n key: 'getActiveSelectionFromObjects',\n value: function getActiveSelectionFromObjects(objects) {\n var canvas = this.getCanvas();\n\n return new _fabric2.default.ActiveSelection(objects, { canvas: canvas });\n }\n\n /**\n * Activates an object or group\n * @param {Object} target - target object or group\n */\n\n }, {\n key: 'setActiveObject',\n value: function setActiveObject(target) {\n this._canvas.setActiveObject(target);\n }\n\n /**\n * Set Crop selection style\n * @param {Object} style - Selection styles\n */\n\n }, {\n key: 'setCropSelectionStyle',\n value: function setCropSelectionStyle(style) {\n this.cropSelectionStyle = style;\n }\n\n /**\n * Get component\n * @param {string} name - Component name\n * @returns {Component}\n */\n\n }, {\n key: 'getComponent',\n value: function getComponent(name) {\n return this._componentMap[name];\n }\n\n /**\n * Get current drawing mode\n * @returns {string}\n */\n\n }, {\n key: 'getDrawingMode',\n value: function 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\n }, {\n key: 'startDrawingMode',\n value: function 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 var 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\n }, {\n key: 'stopDrawingMode',\n value: function stopDrawingMode() {\n if (this._isSameDrawingMode(_consts.drawingModes.NORMAL)) {\n return;\n }\n\n var drawingModeInstance = this._getDrawingModeInstance(this.getDrawingMode());\n if (drawingModeInstance && drawingModeInstance.end) {\n drawingModeInstance.end(this);\n }\n this._drawingMode = _consts.drawingModes.NORMAL;\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\n }, {\n key: 'toDataURL',\n value: function toDataURL(options) {\n var cropper = this.getComponent(_consts.componentNames.CROPPER);\n cropper.changeVisibility(false);\n\n var 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\n }, {\n key: 'setCanvasImage',\n value: function 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\n }, {\n key: 'setCssMaxDimension',\n value: function 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\n }, {\n key: 'adjustCanvasDimension',\n value: function adjustCanvasDimension() {\n var canvasImage = this.canvasImage.scale(1);\n\n var _canvasImage$getBound = canvasImage.getBoundingRect(),\n width = _canvasImage$getBound.width,\n height = _canvasImage$getBound.height;\n\n var 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: width,\n height: 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\n }, {\n key: 'setCanvasCssDimension',\n value: function 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\n }, {\n key: 'setCanvasBackstoreDimension',\n value: function 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\n }, {\n key: 'setImageProperties',\n value: function setImageProperties(setting, withRendering) {\n var canvasImage = this.canvasImage;\n\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\n }, {\n key: 'getCanvasElement',\n value: function getCanvasElement() {\n return this._canvas.getElement();\n }\n\n /**\n * Get fabric.Canvas instance\n * @returns {fabric.Canvas}\n * @private\n */\n\n }, {\n key: 'getCanvas',\n value: function getCanvas() {\n return this._canvas;\n }\n\n /**\n * Get canvasImage (fabric.Image instance)\n * @returns {fabric.Image}\n */\n\n }, {\n key: 'getCanvasImage',\n value: function getCanvasImage() {\n return this.canvasImage;\n }\n\n /**\n * Get image name\n * @returns {string}\n */\n\n }, {\n key: 'getImageName',\n value: function 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\n }, {\n key: 'addImageObject',\n value: function addImageObject(imgUrl) {\n var _this = this;\n\n var callback = this._callbackAfterLoadingImageObject.bind(this);\n\n return new _util.Promise(function (resolve) {\n _fabric2.default.Image.fromURL(imgUrl, function (image) {\n callback(image);\n resolve(_this.createObjectProperties(image));\n }, {\n crossOrigin: 'Anonymous'\n });\n });\n }\n\n /**\n * Get center position of canvas\n * @returns {Object} {left, top}\n */\n\n }, {\n key: 'getCenter',\n value: function getCenter() {\n return this._canvas.getCenter();\n }\n\n /**\n * Get cropped rect\n * @returns {Object} rect\n */\n\n }, {\n key: 'getCropzoneRect',\n value: function getCropzoneRect() {\n return this.getComponent(_consts.componentNames.CROPPER).getCropzoneRect();\n }\n\n /**\n * Get cropped rect\n * @param {number} [mode] cropzone rect mode\n */\n\n }, {\n key: 'setCropzoneRect',\n value: function setCropzoneRect(mode) {\n this.getComponent(_consts.componentNames.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\n }, {\n key: 'getCroppedImageData',\n value: function getCroppedImageData(cropRect) {\n return this.getComponent(_consts.componentNames.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\n }, {\n key: 'setBrush',\n value: function setBrush(option) {\n var drawingMode = this._drawingMode;\n var compName = _consts.componentNames.FREE_DRAWING;\n\n if (drawingMode === _consts.drawingModes.LINE_DRAWING) {\n compName = _consts.componentNames.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\n }, {\n key: 'setDrawingShape',\n value: function setDrawingShape(type, options) {\n this.getComponent(_consts.componentNames.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\n }, {\n key: 'setIconStyle',\n value: function setIconStyle(type, iconColor) {\n this.getComponent(_consts.componentNames.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\n }, {\n key: 'registerPaths',\n value: function registerPaths(pathInfos) {\n this.getComponent(_consts.componentNames.ICON).registerPaths(pathInfos);\n }\n\n /**\n * Change cursor style\n * @param {string} cursorType - cursor type\n */\n\n }, {\n key: 'changeCursor',\n value: function changeCursor(cursorType) {\n var 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\n }, {\n key: 'hasFilter',\n value: function hasFilter(type) {\n return this.getComponent(_consts.componentNames.FILTER).hasFilter(type);\n }\n\n /**\n * Set selection style of fabric object by init option\n * @param {Object} styles - Selection styles\n */\n\n }, {\n key: 'setSelectionStyle',\n value: function setSelectionStyle(styles) {\n extend(_consts.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\n }, {\n key: 'setObjectProperties',\n value: function setObjectProperties(id, props) {\n var object = this.getObject(id);\n var 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\n }, {\n key: 'getObjectProperties',\n value: function getObjectProperties(id, keys) {\n var object = this.getObject(id);\n var props = {};\n\n if (isString(keys)) {\n props[keys] = object[keys];\n } else if (isArray(keys)) {\n forEachArray(keys, function (value) {\n props[value] = object[value];\n });\n } else {\n forEachOwnProperties(keys, function (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\n }, {\n key: 'getObjectPosition',\n value: function getObjectPosition(id, originX, originY) {\n var 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\n }, {\n key: 'setObjectPosition',\n value: function setObjectPosition(id, posInfo) {\n var targetObj = this.getObject(id);\n var x = posInfo.x,\n y = posInfo.y,\n originX = posInfo.originX,\n originY = posInfo.originY;\n\n if (!targetObj) {\n return false;\n }\n\n var targetOrigin = targetObj.getPointByOrigin(originX, originY);\n var centerOrigin = targetObj.getPointByOrigin('center', 'center');\n var diffX = centerOrigin.x - targetOrigin.x;\n var 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\n }, {\n key: 'getCanvasSize',\n value: function getCanvasSize() {\n var 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\n }, {\n key: 'createStaticCanvas',\n value: function createStaticCanvas() {\n var staticCanvas = new _fabric2.default.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\n }, {\n key: '_getDrawingModeInstance',\n value: function _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\n }, {\n key: '_setObjectCachingToFalse',\n value: function _setObjectCachingToFalse() {\n _fabric2.default.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\n }, {\n key: '_setCanvasElement',\n value: function _setCanvasElement(element) {\n var selectedElement = void 0;\n var canvasElement = void 0;\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 _fabric2.default.Canvas(canvasElement, {\n containerClass: 'tui-image-editor-canvas-container',\n enableRetinaScaling: false\n });\n }\n\n /**\n * Creates DrawingMode instances\n * @private\n */\n\n }, {\n key: '_createDrawingModeInstances',\n value: function _createDrawingModeInstances() {\n this._register(this._drawingModeMap, new _cropper4.default());\n this._register(this._drawingModeMap, new _freeDrawing4.default());\n this._register(this._drawingModeMap, new _lineDrawing2.default());\n this._register(this._drawingModeMap, new _shape4.default());\n this._register(this._drawingModeMap, new _text4.default());\n this._register(this._drawingModeMap, new _icon4.default());\n }\n\n /**\n * Create components\n * @private\n */\n\n }, {\n key: '_createComponents',\n value: function _createComponents() {\n this._register(this._componentMap, new _imageLoader2.default(this));\n this._register(this._componentMap, new _cropper2.default(this));\n this._register(this._componentMap, new _flip2.default(this));\n this._register(this._componentMap, new _rotation2.default(this));\n this._register(this._componentMap, new _freeDrawing2.default(this));\n this._register(this._componentMap, new _line2.default(this));\n this._register(this._componentMap, new _text2.default(this));\n this._register(this._componentMap, new _icon2.default(this));\n this._register(this._componentMap, new _filter2.default(this));\n this._register(this._componentMap, new _shape2.default(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\n }, {\n key: '_register',\n value: function _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\n }, {\n key: '_isSameDrawingMode',\n value: function _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\n }, {\n key: '_calcMaxDimension',\n value: function _calcMaxDimension(width, height) {\n var wScaleFactor = this.cssMaxWidth / width;\n var hScaleFactor = this.cssMaxHeight / height;\n var cssMaxWidth = Math.min(width, this.cssMaxWidth);\n var 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\n }, {\n key: '_callbackAfterLoadingImageObject',\n value: function _callbackAfterLoadingImageObject(obj) {\n var centerPos = this.getCanvasImage().getCenterPoint();\n\n obj.set(_consts.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\n }, {\n key: '_attachCanvasEvents',\n value: function _attachCanvasEvents() {\n var canvas = this._canvas;\n var 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\n }, {\n key: '_onMouseDown',\n value: function _onMouseDown(fEvent) {\n var _this2 = this;\n\n var event = fEvent.e,\n target = fEvent.target;\n\n var originPointer = this._canvas.getPointer(event);\n\n if (target) {\n var type = target.type;\n\n var undoData = (0, _selectionModifyHelper.makeSelectionUndoData)(target, function (item) {\n return (0, _selectionModifyHelper.makeSelectionUndoDatum)(_this2.getObjectId(item), item, type === 'activeSelection');\n });\n\n (0, _selectionModifyHelper.setCachedUndoDataForDimension)(undoData);\n }\n\n this.fire(_consts.eventNames.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\n }, {\n key: '_onObjectAdded',\n value: function _onObjectAdded(fEvent) {\n var 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\n }, {\n key: '_onObjectRemoved',\n value: function _onObjectRemoved(fEvent) {\n var 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\n }, {\n key: '_onObjectMoved',\n value: function _onObjectMoved(fEvent) {\n var _this3 = this;\n\n this._lazyFire(_consts.eventNames.OBJECT_MOVED, function (object) {\n return _this3.createObjectProperties(object);\n }, fEvent.target);\n }\n\n /**\n * \"object:scaling\" canvas event handler\n * @param {{target: fabric.Object, e: MouseEvent}} fEvent - Fabric event\n * @private\n */\n\n }, {\n key: '_onObjectScaled',\n value: function _onObjectScaled(fEvent) {\n var _this4 = this;\n\n this._lazyFire(_consts.eventNames.OBJECT_SCALED, function (object) {\n return _this4.createObjectProperties(object);\n }, fEvent.target);\n }\n\n /**\n * \"object:modified\" canvas event handler\n * @param {{target: fabric.Object, e: MouseEvent}} fEvent - Fabric event\n * @private\n */\n\n }, {\n key: '_onObjectModified',\n value: function _onObjectModified(fEvent) {\n var target = fEvent.target;\n\n if (target.type === 'activeSelection') {\n var items = target.getObjects();\n\n items.forEach(function (item) {\n return item.fire('modifiedInGroup', target);\n });\n }\n\n this.fire(_consts.eventNames.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\n }, {\n key: '_onObjectRotated',\n value: function _onObjectRotated(fEvent) {\n var _this5 = this;\n\n this._lazyFire(_consts.eventNames.OBJECT_ROTATED, function (object) {\n return _this5.createObjectProperties(object);\n }, fEvent.target);\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\n }, {\n key: '_lazyFire',\n value: function _lazyFire(eventName, paramsMaker, target) {\n var _this6 = this;\n\n var existEventDelegation = target && target.canvasEventDelegation;\n var delegationState = existEventDelegation ? target.canvasEventDelegation(eventName) : 'none';\n\n if (delegationState === 'unregisted') {\n target.canvasEventRegister(eventName, function (object) {\n _this6.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\n }, {\n key: '_onObjectSelected',\n value: function _onObjectSelected(fEvent) {\n var target = fEvent.target;\n\n var params = this.createObjectProperties(target);\n\n this.fire(_consts.eventNames.OBJECT_ACTIVATED, params);\n }\n\n /**\n * \"path:created\" canvas event handler\n * @param {{path: fabric.Path}} obj - Path object\n * @private\n */\n\n }, {\n key: '_onPathCreated',\n value: function _onPathCreated(obj) {\n var _obj$path$getCenterPo = obj.path.getCenterPoint(),\n left = _obj$path$getCenterPo.x,\n top = _obj$path$getCenterPo.y;\n\n obj.path.set(extend({\n left: left,\n top: top\n }, _consts.fObjectOptions.SELECTION_STYLE));\n\n var params = this.createObjectProperties(obj.path);\n\n this.fire(_consts.eventNames.ADD_OBJECT, params);\n }\n\n /**\n * \"selction:cleared\" canvas event handler\n * @private\n */\n\n }, {\n key: '_onSelectionCleared',\n value: function _onSelectionCleared() {\n this.fire(_consts.eventNames.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\n }, {\n key: '_onSelectionCreated',\n value: function _onSelectionCreated(fEvent) {\n var target = fEvent.target;\n\n var params = this.createObjectProperties(target);\n\n this.fire(_consts.eventNames.OBJECT_ACTIVATED, params);\n this.fire(_consts.eventNames.SELECTION_CREATED, fEvent.target);\n }\n\n /**\n * Canvas discard selection all\n */\n\n }, {\n key: 'discardSelection',\n value: function 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\n }, {\n key: 'changeSelectableAll',\n value: function changeSelectableAll(selectable) {\n this._canvas.forEachObject(function (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\n }, {\n key: 'createObjectProperties',\n value: function createObjectProperties(obj) {\n var predefinedKeys = ['left', 'top', 'width', 'height', 'fill', 'stroke', 'strokeWidth', 'opacity', 'angle'];\n var props = {\n id: stamp(obj),\n type: obj.type\n };\n\n extend(props, (0, _util.getProperties)(obj, predefinedKeys));\n\n if ((0, _util.includes)(['i-text', 'text'], obj.type)) {\n extend(props, this._createTextProperties(obj, props));\n } else if ((0, _util.includes)(['rect', 'triangle', 'circle'], obj.type)) {\n var shapeComp = this.getComponent(_consts.componentNames.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\n }, {\n key: '_createTextProperties',\n value: function _createTextProperties(obj) {\n var predefinedKeys = ['text', 'fontFamily', 'fontSize', 'fontStyle', 'textAlign', 'textDecoration', 'fontWeight'];\n var props = {};\n extend(props, (0, _util.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\n }, {\n key: '_addFabricObject',\n value: function _addFabricObject(obj) {\n var 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\n }, {\n key: '_removeFabricObject',\n value: function _removeFabricObject(id) {\n delete this._objects[id];\n }\n\n /**\n * Reset targetObjectForCopyPaste value from activeObject\n */\n\n }, {\n key: 'resetTargetObjectForCopyPaste',\n value: function resetTargetObjectForCopyPaste() {\n var activeObject = this.getActiveObject();\n\n if (activeObject) {\n this.targetObjectForCopyPaste = activeObject;\n }\n }\n\n /**\n * Paste fabric object\n * @returns {Promise}\n */\n\n }, {\n key: 'pasteObject',\n value: function pasteObject() {\n var _this7 = this;\n\n if (!this.targetObjectForCopyPaste) {\n return _util.Promise.resolve([]);\n }\n\n var targetObject = this.targetObjectForCopyPaste;\n var isGroupSelect = targetObject.type === 'activeSelection';\n var targetObjects = isGroupSelect ? targetObject.getObjects() : [targetObject];\n var newTargetObject = null;\n\n this.discardSelection();\n\n return this._cloneObject(targetObjects).then(function (addedObjects) {\n if (addedObjects.length > 1) {\n newTargetObject = _this7.getActiveSelectionFromObjects(addedObjects);\n } else {\n newTargetObject = addedObjects[0];\n }\n _this7.targetObjectForCopyPaste = newTargetObject;\n _this7.setActiveObject(newTargetObject);\n });\n }\n\n /**\n * Clone object\n * @param {fabric.Object} targetObjects - fabric object\n * @returns {Promise}\n * @private\n */\n\n }, {\n key: '_cloneObject',\n value: function _cloneObject(targetObjects) {\n var _this8 = this;\n\n var addedObjects = _tuiCodeSnippet2.default.map(targetObjects, function (targetObject) {\n return _this8._cloneObjectItem(targetObject);\n });\n\n return _util.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\n }, {\n key: '_cloneObjectItem',\n value: function _cloneObjectItem(targetObject) {\n var _this9 = this;\n\n return this._copyFabricObjectForPaste(targetObject).then(function (clonedObject) {\n var objectProperties = _this9.createObjectProperties(clonedObject);\n _this9.add(clonedObject);\n\n _this9.fire(_consts.eventNames.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\n }, {\n key: '_copyFabricObjectForPaste',\n value: function _copyFabricObjectForPaste(targetObject) {\n var _this10 = this;\n\n var addExtraPx = function addExtraPx(value, isReverse) {\n return isReverse ? value - EXTRA_PX_FOR_PASTE : value + EXTRA_PX_FOR_PASTE;\n };\n\n return this._copyFabricObject(targetObject).then(function (clonedObject) {\n var left = clonedObject.left,\n top = clonedObject.top,\n width = clonedObject.width,\n height = clonedObject.height;\n\n var _getCanvasSize = _this10.getCanvasSize(),\n canvasWidth = _getCanvasSize.width,\n canvasHeight = _getCanvasSize.height;\n\n var rightEdge = left + width / 2;\n var bottomEdge = top + height / 2;\n\n clonedObject.set(_tuiCodeSnippet2.default.extend({\n left: addExtraPx(left, rightEdge + EXTRA_PX_FOR_PASTE > canvasWidth),\n top: addExtraPx(top, bottomEdge + EXTRA_PX_FOR_PASTE > canvasHeight)\n }, _consts.fObjectOptions.SELECTION_STYLE));\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\n }, {\n key: '_copyFabricObject',\n value: function _copyFabricObject(targetObject) {\n var _this11 = this;\n\n return new _util.Promise(function (resolve) {\n targetObject.clone(function (cloned) {\n var shapeComp = _this11.getComponent(_consts.componentNames.SHAPE);\n if ((0, _util.isShape)(cloned)) {\n shapeComp.processForCopiedObject(cloned, targetObject);\n }\n\n resolve(cloned);\n });\n });\n }\n }]);\n\n return Graphics;\n}();\n\nCustomEvents.mixin(Graphics);\n\nexports.default = Graphics;\n\n//# sourceURL=webpack://tui.ImageEditor/./src/js/graphics.js?"); - -/***/ }), - -/***/ "./src/js/helper/imagetracer.js": -/*!**************************************!*\ - !*** ./src/js/helper/imagetracer.js ***! - \**************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; -eval("\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\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*/\nvar ImageTracer = function () {\n _createClass(ImageTracer, null, [{\n key: 'tracerDefaultOption',\n value: function 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 r: 0,\n g: 0,\n b: 0,\n a: 255\n }, {\n r: 255,\n g: 255,\n b: 255,\n a: 255\n }]\n };\n }\n /* eslint-disable */\n\n }]);\n\n function ImageTracer() {\n _classCallCheck(this, ImageTracer);\n\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: [{ r: 0, g: 0, b: 100, a: 255 }, { r: 255, g: 255, b: 255, a: 255 }]\n }\n };\n\n this.pathscan_combined_lookup = [[[-1, -1, -1, -1], [-1, -1, -1, -1], [-1, -1, -1, -1], [-1, -1, -1, -1]], [[0, 1, 0, -1], [-1, -1, -1, -1], [-1, -1, -1, -1], [0, 2, -1, 0]], [[-1, -1, -1, -1], [-1, -1, -1, -1], [0, 1, 0, -1], [0, 0, 1, 0]], [[0, 0, 1, 0], [-1, -1, -1, -1], [0, 2, -1, 0], [-1, -1, -1, -1]], [[-1, -1, -1, -1], [0, 0, 1, 0], [0, 3, 0, 1], [-1, -1, -1, -1]], [[13, 3, 0, 1], [13, 2, -1, 0], [7, 1, 0, -1], [7, 0, 1, 0]], [[-1, -1, -1, -1], [0, 1, 0, -1], [-1, -1, -1, -1], [0, 3, 0, 1]], [[0, 3, 0, 1], [0, 2, -1, 0], [-1, -1, -1, -1], [-1, -1, -1, -1]], [[0, 3, 0, 1], [0, 2, -1, 0], [-1, -1, -1, -1], [-1, -1, -1, -1]], [[-1, -1, -1, -1], [0, 1, 0, -1], [-1, -1, -1, -1], [0, 3, 0, 1]], [[11, 1, 0, -1], [14, 0, 1, 0], [14, 3, 0, 1], [11, 2, -1, 0]], [[-1, -1, -1, -1], [0, 0, 1, 0], [0, 3, 0, 1], [-1, -1, -1, -1]], [[0, 0, 1, 0], [-1, -1, -1, -1], [0, 2, -1, 0], [-1, -1, -1, -1]], [[-1, -1, -1, -1], [-1, -1, -1, -1], [0, 1, 0, -1], [0, 0, 1, 0]], [[0, 1, 0, -1], [-1, -1, -1, -1], [-1, -1, -1, -1], [0, 2, -1, 0]], [[-1, -1, -1, -1], [-1, -1, -1, -1], [-1, -1, -1, -1], [-1, -1, -1, -1]]];\n\n this.gks = [[0.27901, 0.44198, 0.27901], [0.135336, 0.228569, 0.272192, 0.228569, 0.135336], [0.086776, 0.136394, 0.178908, 0.195843, 0.178908, 0.136394, 0.086776], [0.063327, 0.093095, 0.122589, 0.144599, 0.152781, 0.144599, 0.122589, 0.093095, 0.063327], [0.049692, 0.069304, 0.089767, 0.107988, 0.120651, 0.125194, 0.120651, 0.107988, 0.089767, 0.069304, 0.049692]];\n\n this.specpalette = [{ r: 0, g: 0, b: 0, a: 255 }, { r: 128, g: 128, b: 128, a: 255 }, { r: 0, g: 0, b: 128, a: 255 }, { r: 64, g: 64, b: 128, a: 255 }, { r: 192, g: 192, b: 192, a: 255 }, { r: 255, g: 255, b: 255, a: 255 }, { r: 128, g: 128, b: 192, a: 255 }, { r: 0, g: 0, b: 192, a: 255 }, { r: 128, g: 0, b: 0, a: 255 }, { r: 128, g: 64, b: 64, a: 255 }, { r: 128, g: 0, b: 128, a: 255 }, { r: 168, g: 168, b: 168, a: 255 }, { r: 192, g: 128, b: 128, a: 255 }, { r: 192, g: 0, b: 0, a: 255 }, { r: 255, g: 255, b: 255, a: 255 }, { r: 0, g: 128, b: 0, a: 255 }];\n }\n\n _createClass(ImageTracer, [{\n key: 'imageToSVG',\n value: function imageToSVG(url, callback, options) {\n var _this = this;\n\n options = this.checkoptions(options);\n this.loadImage(url, function (canvas) {\n callback(_this.imagedataToSVG(_this.getImgdata(canvas), options));\n }, options);\n }\n }, {\n key: 'imagedataToSVG',\n value: function imagedataToSVG(imgd, options) {\n options = this.checkoptions(options);\n var td = this.imagedataToTracedata(imgd, options);\n\n return this.getsvgstring(td, options);\n }\n }, {\n key: 'imageToTracedata',\n value: function imageToTracedata(url, callback, options) {\n var _this2 = this;\n\n options = this.checkoptions(options);\n this.loadImage(url, function (canvas) {\n callback(_this2.imagedataToTracedata(_this2.getImgdata(canvas), options));\n }, options);\n }\n }, {\n key: 'imagedataToTracedata',\n value: function imagedataToTracedata(imgd, options) {\n options = this.checkoptions(options);\n var ii = this.colorquantization(imgd, options);\n var tracedata = void 0;\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 (var colornum = 0; colornum < ii.palette.length; colornum += 1) {\n var tracedlayer = this.batchtracepaths(this.internodes(this.pathscan(this.layeringstep(ii, colornum), options.pathomit), options), options.ltres, options.qtres);\n tracedata.layers.push(tracedlayer);\n }\n } else {\n var ls = this.layering(ii);\n if (options.layercontainerid) {\n this.drawLayers(ls, this.specpalette, options.scale, options.layercontainerid);\n }\n var bps = this.batchpathscan(ls, options.pathomit);\n var 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 key: 'checkoptions',\n value: function 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 var ok = Object.keys(this.optionpresets['default']);\n for (var 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 key: 'colorquantization',\n value: function colorquantization(imgd, options) {\n var arr = [];\n var idx = 0;\n var cd = void 0;\n var cdl = void 0;\n var ci = void 0;\n var paletteacc = [];\n var pixelnum = imgd.width * imgd.height;\n var i = void 0;\n var j = void 0;\n var k = void 0;\n var cnt = void 0;\n var palette = void 0;\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 (paletteacc[k].n / pixelnum < options.mincolorratio && cnt < options.colorquantcycles - 1) {\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 = Math.abs(palette[k].r - imgd.data[idx]) + Math.abs(palette[k].g - imgd.data[idx + 1]) + Math.abs(palette[k].b - imgd.data[idx + 2]) + 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: palette };\n }\n }, {\n key: 'samplepalette',\n value: function samplepalette(numberofcolors, imgd) {\n var idx = void 0;\n var palette = [];\n for (var 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 key: 'samplepalette2',\n value: function samplepalette2(numberofcolors, imgd) {\n var idx = void 0;\n var palette = [];\n var ni = Math.ceil(Math.sqrt(numberofcolors));\n var nj = Math.ceil(numberofcolors / ni);\n var vx = imgd.width / (ni + 1);\n var vy = imgd.height / (nj + 1);\n for (var j = 0; j < nj; j += 1) {\n for (var 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 key: 'generatepalette',\n value: function generatepalette(numberofcolors) {\n var palette = [];\n var rcnt = void 0;\n var gcnt = void 0;\n var bcnt = void 0;\n if (numberofcolors < 8) {\n var graystep = Math.floor(255 / (numberofcolors - 1));\n for (var i = 0; i < numberofcolors; i += 1) {\n palette.push({ r: i * graystep, g: i * graystep, b: i * graystep, a: 255 });\n }\n } else {\n var colorqnum = Math.floor(Math.pow(numberofcolors, 1 / 3));\n var colorstep = Math.floor(255 / (colorqnum - 1));\n var 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 key: 'layering',\n value: function layering(ii) {\n var layers = [];\n var val = 0;\n var ah = ii.array.length;\n var aw = ii.array[0].length;\n var n1 = void 0;\n var n2 = void 0;\n var n3 = void 0;\n var n4 = void 0;\n var n5 = void 0;\n var n6 = void 0;\n var n7 = void 0;\n var n8 = void 0;\n var i = void 0;\n var j = void 0;\n var k = void 0;\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 key: 'layeringstep',\n value: function layeringstep(ii, cnum) {\n var layer = [];\n var ah = ii.array.length;\n var aw = ii.array[0].length;\n var i = void 0;\n var j = void 0;\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] = (ii.array[j - 1][i - 1] === cnum ? 1 : 0) + (ii.array[j - 1][i] === cnum ? 2 : 0) + (ii.array[j][i - 1] === cnum ? 8 : 0) + (ii.array[j][i] === cnum ? 4 : 0);\n }\n }\n\n return layer;\n }\n }, {\n key: 'pathscan',\n value: function pathscan(arr, pathomit) {\n var paths = [];\n var pacnt = 0;\n var pcnt = 0;\n var px = 0;\n var py = 0;\n var w = arr[0].length;\n var h = arr.length;\n var dir = 0;\n var pathfinished = true;\n var holepath = false;\n var lookuprow = void 0;\n for (var j = 0; j < h; j += 1) {\n for (var 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 var parentidx = 0,\n parentbbox = [-1, -1, w + 1, h + 1];\n for (var parentcnt = 0; parentcnt < pacnt; parentcnt++) {\n if (!paths[parentcnt].isholepath && this.boundingboxincludes(paths[parentcnt].boundingbox, paths[pacnt].boundingbox) && this.boundingboxincludes(parentbbox, paths[parentcnt].boundingbox)) {\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 key: 'boundingboxincludes',\n value: function boundingboxincludes(parentbbox, childbbox) {\n return parentbbox[0] < childbbox[0] && parentbbox[1] < childbbox[1] && parentbbox[2] > childbbox[2] && parentbbox[3] > childbbox[3];\n }\n }, {\n key: 'batchpathscan',\n value: function batchpathscan(layers, pathomit) {\n var bpaths = [];\n for (var 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 key: 'internodes',\n value: function internodes(paths, options) {\n var ins = [];\n var palen = 0;\n var nextidx = 0;\n var nextidx2 = 0;\n var previdx = 0;\n var previdx2 = 0;\n var pacnt = void 0;\n var pcnt = void 0;\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 (options.rightangleenhance && this.testrightangle(paths[pacnt], previdx2, previdx, pcnt, nextidx, nextidx2)) {\n if (ins[pacnt].points.length > 0) {\n ins[pacnt].points[ins[pacnt].points.length - 1].linesegment = this.getdirection(ins[pacnt].points[ins[pacnt].points.length - 1].x, ins[pacnt].points[ins[pacnt].points.length - 1].y, paths[pacnt].points[pcnt].x, paths[pacnt].points[pcnt].y);\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(paths[pacnt].points[pcnt].x, paths[pacnt].points[pcnt].y, (paths[pacnt].points[pcnt].x + paths[pacnt].points[nextidx].x) / 2, (paths[pacnt].points[pcnt].y + paths[pacnt].points[nextidx].y) / 2)\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((paths[pacnt].points[pcnt].x + paths[pacnt].points[nextidx].x) / 2, (paths[pacnt].points[pcnt].y + paths[pacnt].points[nextidx].y) / 2, (paths[pacnt].points[nextidx].x + paths[pacnt].points[nextidx2].x) / 2, (paths[pacnt].points[nextidx].y + paths[pacnt].points[nextidx2].y) / 2)\n });\n }\n }\n\n return ins;\n }\n }, {\n key: 'testrightangle',\n value: function testrightangle(path, idx1, idx2, idx3, idx4, idx5) {\n return path.points[idx3].x === path.points[idx1].x && path.points[idx3].x === path.points[idx2].x && path.points[idx3].y === path.points[idx4].y && path.points[idx3].y === path.points[idx5].y || path.points[idx3].y === path.points[idx1].y && path.points[idx3].y === path.points[idx2].y && path.points[idx3].x === path.points[idx4].x && path.points[idx3].x === path.points[idx5].x;\n }\n }, {\n key: 'getdirection',\n value: function getdirection(x1, y1, x2, y2) {\n var 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 key: 'batchinternodes',\n value: function batchinternodes(bpaths, options) {\n var binternodes = [];\n for (var 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 key: 'tracepath',\n value: function tracepath(path, ltres, qtres) {\n var pcnt = 0;\n var segtype1 = void 0;\n var segtype2 = void 0;\n var seqend = void 0;\n var 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 ((path.points[seqend].linesegment === segtype1 || path.points[seqend].linesegment === segtype2 || segtype2 === -1) && seqend < path.points.length - 1) {\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 key: 'fitseq',\n value: function fitseq(path, ltres, qtres, seqstart, seqend) {\n if (seqend > path.points.length || seqend < 0) {\n return [];\n }\n var errorpoint = seqstart,\n errorval = 0,\n curvepass = true,\n px = void 0,\n py = void 0,\n dist2 = void 0;\n var tl = seqend - seqstart;\n if (tl < 0) {\n tl += path.points.length;\n }\n var vx = (path.points[seqend].x - path.points[seqstart].x) / tl,\n vy = (path.points[seqend].y - path.points[seqstart].y) / tl;\n var pcnt = (seqstart + 1) % path.points.length,\n pl = void 0;\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 = (path.points[pcnt].x - px) * (path.points[pcnt].x - px) + (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 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 var fitpoint = errorpoint;\n curvepass = true;\n errorval = 0;\n var t = (fitpoint - seqstart) / tl,\n t1 = (1 - t) * (1 - t),\n t2 = 2 * (1 - t) * t,\n t3 = t * t;\n var cpx = (t1 * path.points[seqstart].x + t3 * path.points[seqend].x - path.points[fitpoint].x) / -t2,\n cpy = (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 = (path.points[pcnt].x - px) * (path.points[pcnt].x - px) + (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 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 var splitpoint = fitpoint;\n\n return this.fitseq(path, ltres, qtres, seqstart, splitpoint).concat(this.fitseq(path, ltres, qtres, splitpoint, seqend));\n }\n }, {\n key: 'batchtracepaths',\n value: function batchtracepaths(internodepaths, ltres, qtres) {\n var btracedpaths = [];\n for (var 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 key: 'batchtracelayers',\n value: function batchtracelayers(binternodes, ltres, qtres) {\n var btbis = [];\n for (var 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 key: 'roundtodec',\n value: function roundtodec(val, places) {\n return Number(val.toFixed(places));\n }\n }, {\n key: 'svgpathstring',\n value: function svgpathstring(tracedata, lnum, pathnum, options) {\n var layer = tracedata.layers[lnum],\n smp = layer[pathnum],\n str = '',\n pcnt = void 0;\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 + ' ' + hsmp.segments[pcnt].y2 * options.scale + ' ';\n }\n str += hsmp.segments[pcnt].x1 * options.scale + ' ' + hsmp.segments[pcnt].y1 * options.scale + ' ';\n }\n } else {\n if (hsmp.segments[hsmp.segments.length - 1].hasOwnProperty('x3')) {\n str += 'M ' + this.roundtodec(hsmp.segments[hsmp.segments.length - 1].x3 * options.scale) + ' ' + this.roundtodec(hsmp.segments[hsmp.segments.length - 1].y3 * options.scale) + ' ';\n } else {\n str += 'M ' + this.roundtodec(hsmp.segments[hsmp.segments.length - 1].x2 * options.scale) + ' ' + 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(hsmp.segments[pcnt].y2 * options.scale) + ' ';\n }\n str += this.roundtodec(hsmp.segments[pcnt].x1 * options.scale) + ' ' + this.roundtodec(hsmp.segments[pcnt].y1 * options.scale) + ' ';\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 key: 'getsvgstring',\n value: function getsvgstring(tracedata, options) {\n options = this.checkoptions(options);\n var w = tracedata.width * options.scale;\n var h = tracedata.height * options.scale;\n\n var svgstr = '';\n for (var lcnt = 0; lcnt < tracedata.layers.length; lcnt += 1) {\n for (var 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 key: 'compareNumbers',\n value: function compareNumbers(a, b) {\n return a - b;\n }\n }, {\n key: 'torgbastr',\n value: function torgbastr(c) {\n return 'rgba(' + c.r + ',' + c.g + ',' + c.b + ',' + c.a + ')';\n }\n }, {\n key: 'tosvgcolorstr',\n value: function tosvgcolorstr(c, options) {\n return 'fill=\"rgb(' + c.r + ',' + c.g + ',' + c.b + ')\" stroke=\"rgb(' + c.r + ',' + c.g + ',' + c.b + ')\" stroke-width=\"' + options.strokewidth + '\" opacity=\"' + c.a / 255.0 + '\" ';\n }\n }, {\n key: 'appendSVGString',\n value: function appendSVGString(svgstr, parentid) {\n var div = void 0;\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 key: 'blur',\n value: function blur(imgd, radius, delta) {\n var i = void 0,\n j = void 0,\n k = void 0,\n d = void 0,\n idx = void 0,\n racc = void 0,\n gacc = void 0,\n bacc = void 0,\n aacc = void 0,\n wacc = void 0;\n var 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 var 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 var 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 = Math.abs(imgd2.data[idx] - imgd.data[idx]) + Math.abs(imgd2.data[idx + 1] - imgd.data[idx + 1]) + Math.abs(imgd2.data[idx + 2] - imgd.data[idx + 2]) + 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 key: 'loadImage',\n value: function loadImage(url, callback, options) {\n var img = new Image();\n if (options && options.corsenabled) {\n img.crossOrigin = 'Anonymous';\n }\n img.src = url;\n img.onload = function () {\n var canvas = document.createElement('canvas');\n canvas.width = img.width;\n canvas.height = img.height;\n var context = canvas.getContext('2d');\n context.drawImage(img, 0, 0);\n callback(canvas);\n };\n }\n }, {\n key: 'getImgdata',\n value: function getImgdata(canvas) {\n var context = canvas.getContext('2d');\n\n return context.getImageData(0, 0, canvas.width, canvas.height);\n }\n }, {\n key: 'drawLayers',\n value: function drawLayers(layers, palette, scale, parentid) {\n scale = scale || 1;\n var w = void 0,\n h = void 0,\n i = void 0,\n j = void 0,\n k = void 0;\n var div = void 0;\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 var canvas = document.createElement('canvas');\n canvas.width = w * scale;\n canvas.height = h * scale;\n var 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 return ImageTracer;\n}();\n\nexports.default = ImageTracer;\n\n//# sourceURL=webpack://tui.ImageEditor/./src/js/helper/imagetracer.js?"); - -/***/ }), - -/***/ "./src/js/helper/selectionModifyHelper.js": -/*!************************************************!*\ - !*** ./src/js/helper/selectionModifyHelper.js ***! - \************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; -eval("\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.setCachedUndoDataForDimension = setCachedUndoDataForDimension;\nexports.getCachedUndoDataForDimension = getCachedUndoDataForDimension;\nexports.makeSelectionUndoData = makeSelectionUndoData;\nexports.makeSelectionUndoDatum = makeSelectionUndoDatum;\n\nvar _object = __webpack_require__(/*! tui-code-snippet/src/js/object */ \"./node_modules/tui-code-snippet/src/js/object.js\");\n\n/**\n * Cached selection's info\n * @type {Array}\n * @private\n */\nvar cachedUndoDataForChangeDimension = null;\n\n/**\n * Set cached undo data\n * @param {Array} undoData - selection object\n * @private\n */\n/**\n * @author NHN. FE Development Team \n * @fileoverview Selection modification helper\n */\n\nfunction setCachedUndoDataForDimension(undoData) {\n cachedUndoDataForChangeDimension = undoData;\n}\n\n/**\n * Get cached undo data\n * @returns {Object} cached undo data\n * @private\n */\nfunction 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 */\nfunction makeSelectionUndoData(obj, undoDatumMaker) {\n var undoData = void 0;\n\n if (obj.type === 'activeSelection') {\n undoData = obj.getObjects().map(function (item) {\n var angle = item.angle,\n left = item.left,\n top = item.top,\n scaleX = item.scaleX,\n scaleY = item.scaleY,\n width = item.width,\n height = item.height;\n\n\n obj.realizeTransform(item);\n var result = undoDatumMaker(item);\n\n item.set({\n angle: angle,\n left: left,\n top: top,\n width: width,\n height: height,\n scaleX: scaleX,\n scaleY: 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 */\nfunction makeSelectionUndoDatum(id, obj, isSelection) {\n return isSelection ? {\n id: 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 } : (0, _object.extend)({ id: id }, obj);\n}\n\n//# sourceURL=webpack://tui.ImageEditor/./src/js/helper/selectionModifyHelper.js?"); - -/***/ }), - -/***/ "./src/js/helper/shapeFilterFillHelper.js": -/*!************************************************!*\ - !*** ./src/js/helper/shapeFilterFillHelper.js ***! - \************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; -eval("\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.getFillImageFromShape = getFillImageFromShape;\nexports.rePositionFilterTypeFillImage = rePositionFilterTypeFillImage;\nexports.makeFilterOptionFromFabricImage = makeFilterOptionFromFabricImage;\nexports.makeFillPatternForFilter = makeFillPatternForFilter;\nexports.resetFillPatternCanvas = resetFillPatternCanvas;\nexports.reMakePatternImageSource = reMakePatternImageSource;\nexports.getCachedCanvasImageElement = getCachedCanvasImageElement;\n\nvar _tuiCodeSnippet = __webpack_require__(/*! tui-code-snippet */ \"tui-code-snippet\");\n\nvar _util = __webpack_require__(/*! ../util */ \"./src/js/util.js\");\n\nvar _shapeResizeHelper = __webpack_require__(/*! ../helper/shapeResizeHelper */ \"./src/js/helper/shapeResizeHelper.js\");\n\nvar _shapeResizeHelper2 = _interopRequireDefault(_shapeResizeHelper);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } /**\n * @author NHN. FE Development Team \n * @fileoverview Shape resize helper\n */\n\n\nvar FILTER_OPTION_MAP = {\n pixelate: 'blocksize',\n blur: 'blur'\n};\nvar POSITION_DIMENSION_MAP = {\n x: 'width',\n y: 'height'\n};\n\nvar FILTER_NAME_VALUE_MAP = (0, _util.flipObject)(FILTER_OPTION_MAP);\n\n/**\n * Cached canvas image element for fill image\n * @type {boolean}\n * @private\n */\nvar cachedCanvasImageElement = null;\n\n/**\n * Get background image of fill\n * @param {fabric.Object} shapeObj - Shape object\n * @returns {fabric.Image}\n * @private\n */\nfunction getFillImageFromShape(shapeObj) {\n var _getCustomProperty = (0, _util.getCustomProperty)(shapeObj, 'patternSourceCanvas'),\n patternSourceCanvas = _getCustomProperty.patternSourceCanvas;\n\n var _patternSourceCanvas$ = patternSourceCanvas.getObjects(),\n fillImage = _patternSourceCanvas$[0];\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 */\nfunction rePositionFilterTypeFillImage(shapeObj) {\n var angle = shapeObj.angle,\n flipX = shapeObj.flipX,\n flipY = shapeObj.flipY;\n\n var fillImage = getFillImageFromShape(shapeObj);\n var rotatedShapeCornerDimension = getRotatedDimension(shapeObj);\n var right = rotatedShapeCornerDimension.right,\n bottom = rotatedShapeCornerDimension.bottom;\n var width = rotatedShapeCornerDimension.width,\n height = rotatedShapeCornerDimension.height;\n\n var diffLeft = (width - shapeObj.width) / 2;\n var diffTop = (height - shapeObj.height) / 2;\n var cropX = shapeObj.left - shapeObj.width / 2 - diffLeft;\n var cropY = shapeObj.top - shapeObj.height / 2 - diffTop;\n var left = width / 2 - diffLeft;\n var top = height / 2 - diffTop;\n var fillImageMaxSize = Math.max(width, height) + Math.max(diffLeft, diffTop);\n\n var _calculateFillImageDi = calculateFillImageDimensionOutsideCanvas({\n shapeObj: shapeObj,\n left: left,\n top: top,\n width: width,\n height: height,\n cropX: cropX,\n cropY: cropY,\n flipX: flipX,\n flipY: flipY,\n right: right,\n bottom: bottom\n });\n\n left = _calculateFillImageDi[0];\n top = _calculateFillImageDi[1];\n width = _calculateFillImageDi[2];\n height = _calculateFillImageDi[3];\n\n\n fillImage.set({\n angle: flipX === flipY ? -angle : angle,\n left: left,\n top: top,\n width: width,\n height: height,\n cropX: cropX,\n cropY: cropY,\n flipX: flipX,\n flipY: flipY\n });\n\n (0, _util.setCustomProperty)(fillImage, { fillImageMaxSize: fillImageMaxSize });\n}\n\n/**\n * Make filter option from fabric image\n * @param {fabric.Image} imageObject - fabric image object\n * @returns {object}\n */\nfunction makeFilterOptionFromFabricImage(imageObject) {\n return (0, _tuiCodeSnippet.map)(imageObject.filters, function (filter) {\n var _Object$keys = Object.keys(filter),\n key = _Object$keys[0];\n\n return _defineProperty({}, FILTER_NAME_VALUE_MAP[key], filter[key]);\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(_ref2) {\n var shapeObj = _ref2.shapeObj,\n left = _ref2.left,\n top = _ref2.top,\n width = _ref2.width,\n height = _ref2.height,\n cropX = _ref2.cropX,\n cropY = _ref2.cropY,\n flipX = _ref2.flipX,\n flipY = _ref2.flipY,\n right = _ref2.right,\n bottom = _ref2.bottom;\n\n var overflowAreaPositionFixer = function overflowAreaPositionFixer(type, outDistance, imageLeft, imageTop) {\n return calculateDistanceOverflowPart({\n type: type,\n outDistance: outDistance,\n shapeObj: shapeObj,\n flipX: flipX,\n flipY: flipY,\n left: imageLeft,\n top: imageTop\n });\n };\n var originalWidth = width,\n originalHeight = height;\n\n var _calculateDimensionLe = calculateDimensionLeftTopEdge(overflowAreaPositionFixer, {\n left: left,\n top: top,\n width: width,\n height: height,\n cropX: cropX,\n cropY: cropY\n });\n\n left = _calculateDimensionLe[0];\n top = _calculateDimensionLe[1];\n width = _calculateDimensionLe[2];\n height = _calculateDimensionLe[3];\n\n var _calculateDimensionRi = calculateDimensionRightBottomEdge(overflowAreaPositionFixer, {\n left: left,\n top: top,\n insideCanvasRealImageWidth: width,\n insideCanvasRealImageHeight: height,\n right: right,\n bottom: bottom,\n cropX: cropX,\n cropY: cropY,\n originalWidth: originalWidth,\n originalHeight: originalHeight\n });\n\n left = _calculateDimensionRi[0];\n top = _calculateDimensionRi[1];\n width = _calculateDimensionRi[2];\n height = _calculateDimensionRi[3];\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(overflowAreaPositionFixer, _ref3) {\n var left = _ref3.left,\n top = _ref3.top,\n insideCanvasRealImageWidth = _ref3.insideCanvasRealImageWidth,\n insideCanvasRealImageHeight = _ref3.insideCanvasRealImageHeight,\n right = _ref3.right,\n bottom = _ref3.bottom,\n cropX = _ref3.cropX,\n cropY = _ref3.cropY,\n originalWidth = _ref3.originalWidth,\n originalHeight = _ref3.originalHeight;\n var width = insideCanvasRealImageWidth,\n height = insideCanvasRealImageHeight;\n var _cachedCanvasImageEle = cachedCanvasImageElement,\n canvasWidth = _cachedCanvasImageEle.width,\n canvasHeight = _cachedCanvasImageEle.height;\n\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 var diff = {\n x: (insideCanvasRealImageWidth - width) / 2,\n y: (insideCanvasRealImageHeight - height) / 2\n };\n\n (0, _tuiCodeSnippet.forEach)(['x', 'y'], function (type) {\n var cropDistance2 = diff[type];\n if (cropDistance2 > 0) {\n var _overflowAreaPosition = overflowAreaPositionFixer(type, cropDistance2, left, top);\n\n left = _overflowAreaPosition[0];\n top = _overflowAreaPosition[1];\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(overflowAreaPositionFixer, _ref4) {\n var left = _ref4.left,\n top = _ref4.top,\n width = _ref4.width,\n height = _ref4.height,\n cropX = _ref4.cropX,\n cropY = _ref4.cropY;\n\n var dimension = {\n width: width,\n height: height\n };\n\n (0, _tuiCodeSnippet.forEach)(['x', 'y'], function (type) {\n var cropDistance = type === 'x' ? cropX : cropY;\n var compareSize = dimension[POSITION_DIMENSION_MAP[type]];\n var standardSize = cachedCanvasImageElement[POSITION_DIMENSION_MAP[type]];\n\n if (compareSize > standardSize) {\n var outDistance = (compareSize - standardSize) / 2;\n\n dimension[POSITION_DIMENSION_MAP[type]] = standardSize;\n\n var _overflowAreaPosition2 = overflowAreaPositionFixer(type, outDistance, left, top);\n\n left = _overflowAreaPosition2[0];\n top = _overflowAreaPosition2[1];\n }\n if (cropDistance < 0) {\n var _overflowAreaPosition3 = overflowAreaPositionFixer(type, cropDistance, left, top);\n\n left = _overflowAreaPosition3[0];\n top = _overflowAreaPosition3[1];\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 */\nfunction makeFillPatternForFilter(canvasImage, filterOption, patternSourceCanvas) {\n var copiedCanvasElement = getCachedCanvasImageElement(canvasImage);\n var fillImage = makeFillImage(copiedCanvasElement, canvasImage.angle, filterOption);\n patternSourceCanvas.add(fillImage);\n\n var fabricProperty = {\n fill: new fabric.Pattern({\n source: patternSourceCanvas.getElement(),\n repeat: 'no-repeat'\n })\n };\n\n (0, _util.setCustomProperty)(fabricProperty, { patternSourceCanvas: patternSourceCanvas });\n\n return fabricProperty;\n}\n\n/**\n * Reset fill pattern canvas\n * @param {fabric.StaticCanvas} patternSourceCanvas - fabric static canvas\n */\nfunction resetFillPatternCanvas(patternSourceCanvas) {\n var _patternSourceCanvas$2 = patternSourceCanvas.getObjects(),\n innerImage = _patternSourceCanvas$2[0];\n\n var _getCustomProperty2 = (0, _util.getCustomProperty)(innerImage, 'fillImageMaxSize'),\n fillImageMaxSize = _getCustomProperty2.fillImageMaxSize;\n\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 */\nfunction reMakePatternImageSource(shapeObj, canvasImage) {\n var _getCustomProperty3 = (0, _util.getCustomProperty)(shapeObj, 'patternSourceCanvas'),\n patternSourceCanvas = _getCustomProperty3.patternSourceCanvas;\n\n var _patternSourceCanvas$3 = patternSourceCanvas.getObjects(),\n fillImage = _patternSourceCanvas$3[0];\n\n var filterOption = makeFilterOptionFromFabricImage(fillImage);\n\n patternSourceCanvas.remove(fillImage);\n\n var copiedCanvasElement = getCachedCanvasImageElement(canvasImage, true);\n var 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 */\nfunction getCachedCanvasImageElement(canvasImage) {\n var reset = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;\n\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(_ref5) {\n var type = _ref5.type,\n shapeObj = _ref5.shapeObj,\n outDistance = _ref5.outDistance,\n left = _ref5.left,\n top = _ref5.top,\n flipX = _ref5.flipX,\n flipY = _ref5.flipY;\n\n var shapePointNavigation = getShapeEdgePoint(shapeObj);\n var shapeNeighborPointNavigation = [[1, 2], [0, 3], [0, 3], [1, 2]];\n var linePointsOutsideCanvas = calculateLinePointsOutsideCanvas(type, shapePointNavigation, shapeNeighborPointNavigation);\n var reatAngles = calculateLineAngleOfOutsideCanvas(type, shapePointNavigation, linePointsOutsideCanvas);\n var startPointIndex = linePointsOutsideCanvas.startPointIndex;\n\n var diffPosition = getReversePositionForFlip({\n outDistance: outDistance,\n startPointIndex: startPointIndex,\n flipX: flipX,\n flipY: flipY,\n reatAngles: 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(_ref6) {\n var outDistance = _ref6.outDistance,\n startPointIndex = _ref6.startPointIndex,\n flipX = _ref6.flipX,\n flipY = _ref6.flipY,\n reatAngles = _ref6.reatAngles;\n\n var rotationChangePoint1 = outDistance * Math.cos(reatAngles[0] * Math.PI / 180);\n var rotationChangePoint2 = outDistance * Math.cos(reatAngles[1] * Math.PI / 180);\n var isForward = startPointIndex === 2 || startPointIndex === 3;\n var 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(type, shapePointNavigation, shapeNeighborPointNavigation) {\n var minimumPoint = 0;\n var minimumPointIndex = 0;\n (0, _tuiCodeSnippet.forEach)(shapePointNavigation, function (point, index) {\n if (point[type] < minimumPoint) {\n minimumPoint = point[type];\n minimumPointIndex = index;\n }\n });\n\n var _shapeNeighborPointNa = shapeNeighborPointNavigation[minimumPointIndex],\n endPointIndex1 = _shapeNeighborPointNa[0],\n endPointIndex2 = _shapeNeighborPointNa[1];\n\n\n return {\n startPointIndex: minimumPointIndex,\n endPointIndex1: endPointIndex1,\n endPointIndex2: 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 var startPointIndex = linePointsOfOneVertexIndex.startPointIndex,\n endPointIndex1 = linePointsOfOneVertexIndex.endPointIndex1,\n endPointIndex2 = linePointsOfOneVertexIndex.endPointIndex2;\n\n var horizontalVerticalAngle = type === 'x' ? 180 : 270;\n\n return (0, _tuiCodeSnippet.map)([endPointIndex1, endPointIndex2], function (pointIndex) {\n var startPoint = shapePointNavigation[startPointIndex];\n var endPoint = shapePointNavigation[pointIndex];\n var diffY = startPoint.y - endPoint.y;\n var 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 (!flipX && flipY || !flipX && !flipY) && startPointIndex === 0 || (flipX && flipY || flipX && !flipY) && startPointIndex === 1 || (!flipX && !flipY || !flipX && flipY) && startPointIndex === 2 || (flipX && !flipY || flipX && flipY) && startPointIndex === 3;\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 (flipX && !flipY || !flipX && !flipY) && startPointIndex === 0 || (!flipX && !flipY || flipX && !flipY) && startPointIndex === 1 || (flipX && flipY || !flipX && flipY) && startPointIndex === 2 || (!flipX && flipY || flipX && flipY) && startPointIndex === 3;\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 [shapeObj.getPointByOrigin('left', 'top'), shapeObj.getPointByOrigin('right', 'top'), shapeObj.getPointByOrigin('left', 'bottom'), shapeObj.getPointByOrigin('right', 'bottom')];\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 var _getShapeEdgePoint = getShapeEdgePoint(shapeObj),\n _getShapeEdgePoint$ = _getShapeEdgePoint[0],\n ax = _getShapeEdgePoint$.x,\n ay = _getShapeEdgePoint$.y,\n _getShapeEdgePoint$2 = _getShapeEdgePoint[1],\n bx = _getShapeEdgePoint$2.x,\n by = _getShapeEdgePoint$2.y,\n _getShapeEdgePoint$3 = _getShapeEdgePoint[2],\n cx = _getShapeEdgePoint$3.x,\n cy = _getShapeEdgePoint$3.y,\n _getShapeEdgePoint$4 = _getShapeEdgePoint[3],\n dx = _getShapeEdgePoint$4.x,\n dy = _getShapeEdgePoint$4.y;\n\n var left = Math.min(ax, bx, cx, dx);\n var top = Math.min(ay, by, cy, dy);\n var right = Math.max(ax, bx, cx, dx);\n var bottom = Math.max(ay, by, cy, dy);\n\n return {\n left: left,\n top: top,\n right: right,\n bottom: 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 var fillImage = new fabric.Image(copiedCanvasElement);\n\n (0, _tuiCodeSnippet.forEach)(_tuiCodeSnippet.extend.apply(undefined, [{}].concat(filterOption)), function (value, key) {\n var fabricFiterClassName = (0, _util.capitalizeString)(key);\n var filter = new fabric.Image.filters[fabricFiterClassName](_defineProperty({}, FILTER_OPTION_MAP[key], value));\n fillImage.filters.push(filter);\n });\n fillImage.applyFilters();\n\n (0, _util.setCustomProperty)(fillImage, {\n originalAngle: currentCanvasImageAngle,\n fillImageMaxSize: Math.max(fillImage.width, fillImage.height)\n });\n _shapeResizeHelper2.default.adjustOriginToCenter(fillImage);\n\n return fillImage;\n}\n\n//# sourceURL=webpack://tui.ImageEditor/./src/js/helper/shapeFilterFillHelper.js?"); - -/***/ }), - -/***/ "./src/js/helper/shapeResizeHelper.js": -/*!********************************************!*\ - !*** ./src/js/helper/shapeResizeHelper.js ***! - \********************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; -eval("\n\n/**\n * @author NHN Ent. FE Development Team \n * @fileoverview Shape resize helper\n */\nvar DIVISOR = {\n rect: 1,\n circle: 2,\n triangle: 1\n};\nvar 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 var originX = shape.originX,\n originY = shape.originY;\n\n var 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 var sx = origin.x;\n var sy = origin.y;\n var px = pointer.x;\n var py = pointer.y;\n var r = angle * Math.PI / 180;\n var rx = (px - sx) * Math.cos(r) - (py - sy) * Math.sin(r) + sx;\n var 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 var centerPoint = shape.getPointByOrigin('center', 'center');\n var angle = -shape.angle;\n var originPositions = getPositionsOfRotatedOrigin(centerPoint, pointer, angle);\n var originX = originPositions.originX,\n originY = originPositions.originY;\n\n var origin = shape.getPointByOrigin(originX, originY);\n var left = shape.left - (centerPoint.x - origin.x);\n var top = shape.top - (centerPoint.y - origin.y);\n\n shape.set({\n originX: originX,\n originY: originY,\n left: left,\n top: 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 var origin = shape.startPoint;\n var angle = -shape.angle;\n var originPositions = getPositionsOfRotatedOrigin(origin, pointer, angle);\n var originX = originPositions.originX,\n originY = originPositions.originY;\n\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 var type = shape.type,\n scaleX = shape.scaleX,\n scaleY = shape.scaleY;\n\n var dimensionKeys = DIMENSION_KEYS[type];\n var width = shape[dimensionKeys.w] * scaleX;\n var height = shape[dimensionKeys.h] * scaleY;\n\n if (shape.isRegular) {\n var maxScale = Math.max(scaleX, scaleY);\n\n width = shape[dimensionKeys.w] * maxScale;\n height = shape[dimensionKeys.h] * maxScale;\n }\n\n var 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 var type = shape.type,\n strokeWidth = shape.strokeWidth,\n origin = shape.startPoint;\n\n var divisor = DIVISOR[type];\n var dimensionKeys = DIMENSION_KEYS[type];\n var isTriangle = !!(shape.type === 'triangle');\n var options = {};\n var width = Math.abs(origin.x - pointer.x) / divisor;\n var 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: function setOrigins(shape) {\n var leftTopPoint = shape.getPointByOrigin('left', 'top');\n var rightTopPoint = shape.getPointByOrigin('right', 'top');\n var rightBottomPoint = shape.getPointByOrigin('right', 'bottom');\n var 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 /**\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: function 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 /**\n * Adjust the origin position of shape to center\n * @param {fabric.Object} shape - Shape object\n */\n adjustOriginToCenter: function adjustOriginToCenter(shape) {\n var centerPoint = shape.getPointByOrigin('center', 'center');\n var originX = shape.originX,\n originY = shape.originY;\n\n var origin = shape.getPointByOrigin(originX, originY);\n var left = shape.left + (centerPoint.x - origin.x);\n var 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: left,\n top: top\n });\n\n shape.setCoords(); // For left, top properties\n }\n};\n\n//# sourceURL=webpack://tui.ImageEditor/./src/js/helper/shapeResizeHelper.js?"); - -/***/ }), - -/***/ "./src/js/imageEditor.js": -/*!*******************************!*\ - !*** ./src/js/imageEditor.js ***! - \*******************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; -eval("\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); /**\n * @author NHN Ent. FE Development Team \n * @fileoverview Image-editor application class\n */\n\n\nvar _tuiCodeSnippet = __webpack_require__(/*! tui-code-snippet */ \"tui-code-snippet\");\n\nvar _tuiCodeSnippet2 = _interopRequireDefault(_tuiCodeSnippet);\n\nvar _invoker3 = __webpack_require__(/*! ./invoker */ \"./src/js/invoker.js\");\n\nvar _invoker4 = _interopRequireDefault(_invoker3);\n\nvar _ui = __webpack_require__(/*! ./ui */ \"./src/js/ui.js\");\n\nvar _ui2 = _interopRequireDefault(_ui);\n\nvar _action = __webpack_require__(/*! ./action */ \"./src/js/action.js\");\n\nvar _action2 = _interopRequireDefault(_action);\n\nvar _command = __webpack_require__(/*! ./factory/command */ \"./src/js/factory/command.js\");\n\nvar _command2 = _interopRequireDefault(_command);\n\nvar _graphics = __webpack_require__(/*! ./graphics */ \"./src/js/graphics.js\");\n\nvar _graphics2 = _interopRequireDefault(_graphics);\n\nvar _util = __webpack_require__(/*! ./util */ \"./src/js/util.js\");\n\nvar _consts = __webpack_require__(/*! ./consts */ \"./src/js/consts.js\");\n\nvar _selectionModifyHelper = __webpack_require__(/*! ./helper/selectionModifyHelper */ \"./src/js/helper/selectionModifyHelper.js\");\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nvar isUndefined = _tuiCodeSnippet2.default.isUndefined,\n forEach = _tuiCodeSnippet2.default.forEach,\n CustomEvents = _tuiCodeSnippet2.default.CustomEvents;\nvar MOUSE_DOWN = _consts.eventNames.MOUSE_DOWN,\n OBJECT_MOVED = _consts.eventNames.OBJECT_MOVED,\n OBJECT_SCALED = _consts.eventNames.OBJECT_SCALED,\n OBJECT_ACTIVATED = _consts.eventNames.OBJECT_ACTIVATED,\n OBJECT_ROTATED = _consts.eventNames.OBJECT_ROTATED,\n OBJECT_ADDED = _consts.eventNames.OBJECT_ADDED,\n OBJECT_MODIFIED = _consts.eventNames.OBJECT_MODIFIED,\n ADD_TEXT = _consts.eventNames.ADD_TEXT,\n ADD_OBJECT = _consts.eventNames.ADD_OBJECT,\n TEXT_EDITING = _consts.eventNames.TEXT_EDITING,\n TEXT_CHANGED = _consts.eventNames.TEXT_CHANGED,\n ICON_CREATE_RESIZE = _consts.eventNames.ICON_CREATE_RESIZE,\n ICON_CREATE_END = _consts.eventNames.ICON_CREATE_END,\n SELECTION_CLEARED = _consts.eventNames.SELECTION_CLEARED,\n SELECTION_CREATED = _consts.eventNames.SELECTION_CREATED,\n ADD_OBJECT_AFTER = _consts.eventNames.ADD_OBJECT_AFTER;\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 */\n\nvar ImageEditor = function () {\n function ImageEditor(wrapper, options) {\n _classCallCheck(this, ImageEditor);\n\n options = _tuiCodeSnippet2.default.extend({\n includeUI: false,\n usageStatistics: true\n }, options);\n\n this.mode = null;\n\n this.activeObjectId = null;\n\n /**\n * UI instance\n * @type {Ui}\n */\n if (options.includeUI) {\n var UIOption = options.includeUI;\n UIOption.usageStatistics = options.usageStatistics;\n\n this.ui = new _ui2.default(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 _invoker4.default();\n\n /**\n * Graphics instance\n * @type {Graphics}\n * @private\n */\n this._graphics = new _graphics2.default(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 (0, _util.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\n\n _createClass(ImageEditor, [{\n key: '_setSelectionStyle',\n value: function _setSelectionStyle(selectionStyle, _ref) {\n var applyCropSelectionStyle = _ref.applyCropSelectionStyle,\n applyGroupSelectionStyle = _ref.applyGroupSelectionStyle;\n\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', function (eventTarget) {\n if (eventTarget.type === 'activeSelection') {\n eventTarget.set(selectionStyle);\n }\n });\n }\n }\n\n /**\n * Attach invoker events\n * @private\n */\n\n }, {\n key: '_attachInvokerEvents',\n value: function _attachInvokerEvents() {\n var UNDO_STACK_CHANGED = _consts.eventNames.UNDO_STACK_CHANGED,\n REDO_STACK_CHANGED = _consts.eventNames.REDO_STACK_CHANGED;\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\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\n /**\n * Attach canvas events\n * @private\n */\n\n }, {\n key: '_attachGraphicsEvents',\n value: function _attachGraphicsEvents() {\n var _graphics$on;\n\n this._graphics.on((_graphics$on = {}, _defineProperty(_graphics$on, MOUSE_DOWN, this._handlers.mousedown), _defineProperty(_graphics$on, OBJECT_MOVED, this._handlers.objectMoved), _defineProperty(_graphics$on, OBJECT_SCALED, this._handlers.objectScaled), _defineProperty(_graphics$on, OBJECT_ROTATED, this._handlers.objectRotated), _defineProperty(_graphics$on, OBJECT_ACTIVATED, this._handlers.objectActivated), _defineProperty(_graphics$on, OBJECT_ADDED, this._handlers.objectAdded), _defineProperty(_graphics$on, OBJECT_MODIFIED, this._handlers.objectModified), _defineProperty(_graphics$on, ADD_TEXT, this._handlers.addText), _defineProperty(_graphics$on, ADD_OBJECT, this._handlers.addObject), _defineProperty(_graphics$on, TEXT_EDITING, this._handlers.textEditing), _defineProperty(_graphics$on, TEXT_CHANGED, this._handlers.textChanged), _defineProperty(_graphics$on, ICON_CREATE_RESIZE, this._handlers.iconCreateResize), _defineProperty(_graphics$on, ICON_CREATE_END, this._handlers.iconCreateEnd), _defineProperty(_graphics$on, SELECTION_CLEARED, this._handlers.selectionCleared), _defineProperty(_graphics$on, SELECTION_CREATED, this._handlers.selectionCreated), _graphics$on));\n }\n\n /**\n * Attach dom events\n * @private\n */\n\n }, {\n key: '_attachDomEvents',\n value: function _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\n }, {\n key: '_detachDomEvents',\n value: function _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\n }, {\n key: '_onKeyDown',\n value: function _onKeyDown(e) {\n var ctrlKey = e.ctrlKey,\n keyCode = e.keyCode,\n metaKey = e.metaKey;\n\n var isModifierKey = ctrlKey || metaKey;\n\n if (isModifierKey) {\n if (keyCode === _consts.keyCodes.C) {\n this._graphics.resetTargetObjectForCopyPaste();\n } else if (keyCode === _consts.keyCodes.V) {\n this._graphics.pasteObject();\n this.clearRedoStack();\n } else if (keyCode === _consts.keyCodes.Z) {\n // There is no error message on shortcut when it's empty\n this.undo()['catch'](function () {});\n } else if (keyCode === _consts.keyCodes.Y) {\n // There is no error message on shortcut when it's empty\n this.redo()['catch'](function () {});\n }\n }\n\n var isDeleteKey = keyCode === _consts.keyCodes.BACKSPACE || keyCode === _consts.keyCodes.DEL;\n var 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\n }, {\n key: 'removeActiveObject',\n value: function removeActiveObject() {\n var 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\n }, {\n key: '_onMouseDown',\n value: function _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(_consts.eventNames.MOUSE_DOWN, event, originPointer);\n }\n\n /**\n * Add a 'addObject' command\n * @param {Object} obj - Fabric object\n * @private\n */\n\n }, {\n key: '_pushAddObjectCommand',\n value: function _pushAddObjectCommand(obj) {\n var command = _command2.default.create(_consts.commandNames.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\n }, {\n key: '_pushModifyObjectCommand',\n value: function _pushModifyObjectCommand(obj) {\n var _this = this;\n\n var type = obj.type;\n\n var props = (0, _selectionModifyHelper.makeSelectionUndoData)(obj, function (item) {\n return (0, _selectionModifyHelper.makeSelectionUndoDatum)(_this._graphics.getObjectId(item), item, type === 'activeSelection');\n });\n var command = _command2.default.create(_consts.commandNames.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\n }, {\n key: '_onObjectActivated',\n value: function _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(_consts.eventNames.OBJECT_ACTIVATED, props);\n }\n\n /**\n * 'objectMoved' event handler\n * @param {ObjectProps} props - object properties\n * @private\n */\n\n }, {\n key: '_onObjectMoved',\n value: function _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(_consts.eventNames.OBJECT_MOVED, props);\n }\n\n /**\n * 'objectScaled' event handler\n * @param {ObjectProps} props - object properties\n * @private\n */\n\n }, {\n key: '_onObjectScaled',\n value: function _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(_consts.eventNames.OBJECT_SCALED, props);\n }\n\n /**\n * 'objectRotated' event handler\n * @param {ObjectProps} props - object properties\n * @private\n */\n\n }, {\n key: '_onObjectRotated',\n value: function _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(_consts.eventNames.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\n }, {\n key: 'getDrawingMode',\n value: function getDrawingMode() {\n return this._graphics.getDrawingMode();\n }\n\n /**\n * Clear all objects\n * @returns {Promise}\n * @example\n * imageEditor.clearObjects();\n */\n\n }, {\n key: 'clearObjects',\n value: function clearObjects() {\n return this.execute(_consts.commandNames.CLEAR_OBJECTS);\n }\n\n /**\n * Deactivate all objects\n * @example\n * imageEditor.deactivateAll();\n */\n\n }, {\n key: 'deactivateAll',\n value: function deactivateAll() {\n this._graphics.deactivateAll();\n this._graphics.renderAll();\n }\n\n /**\n * discard selction\n * @example\n * imageEditor.discardSelection();\n */\n\n }, {\n key: 'discardSelection',\n value: function discardSelection() {\n this._graphics.discardSelection();\n }\n\n /**\n * selectable status change\n * @param {boolean} selectable - selctable status\n * @example\n * imageEditor.changeSelectableAll(false); // or true\n */\n\n }, {\n key: 'changeSelectableAll',\n value: function changeSelectableAll(selectable) {\n this._graphics.changeSelectableAll(selectable);\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\n }, {\n key: 'execute',\n value: function execute(commandName) {\n var _invoker;\n\n for (var _len = arguments.length, args = Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {\n args[_key - 1] = arguments[_key];\n }\n\n // Inject an Graphics instance as first parameter\n var theArgs = [this._graphics].concat(args);\n\n return (_invoker = this._invoker).execute.apply(_invoker, [commandName].concat(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\n }, {\n key: 'executeSilent',\n value: function executeSilent(commandName) {\n var _invoker2;\n\n for (var _len2 = arguments.length, args = Array(_len2 > 1 ? _len2 - 1 : 0), _key2 = 1; _key2 < _len2; _key2++) {\n args[_key2 - 1] = arguments[_key2];\n }\n\n // Inject an Graphics instance as first parameter\n var theArgs = [this._graphics].concat(args);\n\n return (_invoker2 = this._invoker).executeSilent.apply(_invoker2, [commandName].concat(theArgs));\n }\n\n /**\n * Undo\n * @returns {Promise}\n * @example\n * imageEditor.undo();\n */\n\n }, {\n key: 'undo',\n value: function undo() {\n return this._invoker.undo();\n }\n\n /**\n * Redo\n * @returns {Promise}\n * @example\n * imageEditor.redo();\n */\n\n }, {\n key: 'redo',\n value: function redo() {\n return this._invoker.redo();\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\n }, {\n key: 'loadImageFromFile',\n value: function loadImageFromFile(imgFile, imageName) {\n if (!imgFile) {\n return _util.Promise.reject(_consts.rejectMessages.invalidParameters);\n }\n\n var imgUrl = URL.createObjectURL(imgFile);\n imageName = imageName || imgFile.name;\n\n return this.loadImageFromURL(imgUrl, imageName).then(function (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\n }, {\n key: 'loadImageFromURL',\n value: function loadImageFromURL(url, imageName) {\n if (!imageName || !url) {\n return _util.Promise.reject(_consts.rejectMessages.invalidParameters);\n }\n\n return this.execute(_consts.commandNames.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\n }, {\n key: 'addImageObject',\n value: function addImageObject(imgUrl) {\n if (!imgUrl) {\n return _util.Promise.reject(_consts.rejectMessages.invalidParameters);\n }\n\n return this.execute(_consts.commandNames.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\n }, {\n key: 'startDrawingMode',\n value: function 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\n }, {\n key: 'stopDrawingMode',\n value: function 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\n }, {\n key: 'crop',\n value: function crop(rect) {\n var data = this._graphics.getCroppedImageData(rect);\n if (!data) {\n return _util.Promise.reject(_consts.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\n }, {\n key: 'getCropzoneRect',\n value: function 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\n }, {\n key: 'setCropzoneRect',\n value: function 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\n }, {\n key: '_flip',\n value: function _flip(type) {\n return this.execute(_consts.commandNames.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\n }, {\n key: 'flipX',\n value: function 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\n }, {\n key: 'flipY',\n value: function 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\n }, {\n key: 'resetFlip',\n value: function 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\n }, {\n key: '_rotate',\n value: function _rotate(type, angle, isSilent) {\n var result = null;\n if (isSilent) {\n result = this.executeSilent(_consts.commandNames.ROTATE_IMAGE, type, angle);\n } else {\n result = this.execute(_consts.commandNames.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 * imageEidtor.rotate(5); // angle = 5\n * imageEidtor.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\n }, {\n key: 'rotate',\n value: function 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 * imageEidtor.setAngle(5); // angle = 5\n * imageEidtor.rotate(50); // angle = 55\n * imageEidtor.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\n }, {\n key: 'setAngle',\n value: function 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\n }, {\n key: 'setBrush',\n value: function 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\n }, {\n key: 'setDrawingShape',\n value: function setDrawingShape(type, options) {\n this._graphics.setDrawingShape(type, options);\n }\n }, {\n key: 'setDrawingIcon',\n value: function 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\n }, {\n key: 'addShape',\n value: function addShape(type, options) {\n options = options || {};\n\n this._setPositions(options);\n\n return this.execute(_consts.commandNames.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\n }, {\n key: 'changeShape',\n value: function changeShape(id, options, isSilent) {\n var executeMethodName = isSilent ? 'executeSilent' : 'execute';\n\n return this[executeMethodName](_consts.commandNames.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\n }, {\n key: 'addText',\n value: function addText(text, options) {\n text = text || '';\n options = options || {};\n\n return this.execute(_consts.commandNames.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\n }, {\n key: 'changeText',\n value: function changeText(id, text) {\n text = text || '';\n\n return this.execute(_consts.commandNames.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\n }, {\n key: 'changeTextStyle',\n value: function changeTextStyle(id, styleObj, isSilent) {\n var executeMethodName = isSilent ? 'executeSilent' : 'execute';\n\n return this[executeMethodName](_consts.commandNames.CHANGE_TEXT_STYLE, id, styleObj);\n }\n\n /**\n * change text mode\n * @param {string} type - change type\n * @private\n */\n\n }, {\n key: '_changeActivateMode',\n value: function _changeActivateMode(type) {\n if (type !== 'ICON' && this.getDrawingMode() !== type) {\n this.startDrawingMode(type);\n }\n }\n\n /**\n * 'textChanged' event handler\n * @param {Object} objectProps changed object properties\n * @private\n */\n\n }, {\n key: '_onTextChanged',\n value: function _onTextChanged(objectProps) {\n this.changeText(objectProps.id, objectProps.text);\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\n }, {\n key: '_onIconCreateResize',\n value: function _onIconCreateResize(originPointer) {\n this.fire(_consts.eventNames.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\n }, {\n key: '_onIconCreateEnd',\n value: function _onIconCreateEnd(originPointer) {\n this.fire(_consts.eventNames.ICON_CREATE_END, originPointer);\n }\n\n /**\n * 'textEditing' event handler\n * @private\n */\n\n }, {\n key: '_onTextEditing',\n value: function _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 this.fire(_consts.eventNames.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\n }, {\n key: '_onAddText',\n value: function _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 this.fire(_consts.eventNames.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\n }, {\n key: '_onAddObject',\n value: function _onAddObject(objectProps) {\n var obj = this._graphics.getObject(objectProps.id);\n this._pushAddObjectCommand(obj);\n }\n\n /**\n * 'objectAdded' event handler\n * @param {Object} objectProps added object properties\n * @private\n */\n\n }, {\n key: '_onObjectAdded',\n value: function _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\n }, {\n key: '_onObjectModified',\n value: function _onObjectModified(obj) {\n this._pushModifyObjectCommand(obj);\n }\n\n /**\n * 'selectionCleared' event handler\n * @private\n */\n\n }, {\n key: '_selectionCleared',\n value: function _selectionCleared() {\n this.fire(SELECTION_CLEARED);\n }\n\n /**\n * 'selectionCreated' event handler\n * @param {Object} eventTarget - Fabric object\n * @private\n */\n\n }, {\n key: '_selectionCreated',\n value: function _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\n }, {\n key: 'registerIcons',\n value: function 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\n }, {\n key: 'changeCursor',\n value: function 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\n }, {\n key: 'addIcon',\n value: function addIcon(type, options) {\n options = options || {};\n\n this._setPositions(options);\n\n return this.execute(_consts.commandNames.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\n }, {\n key: 'changeIconColor',\n value: function changeIconColor(id, color) {\n return this.execute(_consts.commandNames.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\n }, {\n key: 'removeObject',\n value: function removeObject(id) {\n return this.execute(_consts.commandNames.REMOVE_OBJECT, id);\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\n }, {\n key: 'hasFilter',\n value: function 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\n }, {\n key: 'removeFilter',\n value: function removeFilter(type) {\n return this.execute(_consts.commandNames.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 {number} options.maskObjId - masking image object id\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\n }, {\n key: 'applyFilter',\n value: function applyFilter(type, options, isSilent) {\n var executeMethodName = isSilent ? 'executeSilent' : 'execute';\n\n return this[executeMethodName](_consts.commandNames.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\n }, {\n key: 'toDataURL',\n value: function 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\n }, {\n key: 'getImageName',\n value: function getImageName() {\n return this._graphics.getImageName();\n }\n\n /**\n * Clear undoStack\n * @example\n * imageEditor.clearUndoStack();\n */\n\n }, {\n key: 'clearUndoStack',\n value: function clearUndoStack() {\n this._invoker.clearUndoStack();\n }\n\n /**\n * Clear redoStack\n * @example\n * imageEditor.clearRedoStack();\n */\n\n }, {\n key: 'clearRedoStack',\n value: function 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\n }, {\n key: 'isEmptyUndoStack',\n value: function 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\n }, {\n key: 'isEmptyRedoStack',\n value: function 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\n }, {\n key: 'resizeCanvasDimension',\n value: function resizeCanvasDimension(dimension) {\n if (!dimension) {\n return _util.Promise.reject(_consts.rejectMessages.invalidParameters);\n }\n\n return this.execute(_consts.commandNames.RESIZE_CANVAS_DIMENSION, dimension);\n }\n\n /**\n * Destroy\n */\n\n }, {\n key: 'destroy',\n value: function destroy() {\n var _this2 = this;\n\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(this, function (value, key) {\n _this2[key] = null;\n }, this);\n }\n\n /**\n * Set position\n * @param {Object} options - Position options (left or top)\n * @private\n */\n\n }, {\n key: '_setPositions',\n value: function _setPositions(options) {\n var 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\n }, {\n key: 'setObjectProperties',\n value: function setObjectProperties(id, keyValue) {\n return this.execute(_consts.commandNames.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\n }, {\n key: 'setObjectPropertiesQuietly',\n value: function 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\n }, {\n key: 'getObjectProperties',\n value: function getObjectProperties(id, keys) {\n var 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\n }, {\n key: 'getCanvasSize',\n value: function 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\n }, {\n key: 'getObjectPosition',\n value: function 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\n }, {\n key: 'setObjectPosition',\n value: function setObjectPosition(id, posInfo) {\n return this.execute(_consts.commandNames.SET_OBJECT_POSITION, id, posInfo);\n }\n }]);\n\n return ImageEditor;\n}();\n\n_action2.default.mixin(ImageEditor);\nCustomEvents.mixin(ImageEditor);\n\nexports.default = ImageEditor;\n\n//# sourceURL=webpack://tui.ImageEditor/./src/js/imageEditor.js?"); - -/***/ }), - -/***/ "./src/js/interface/command.js": -/*!*************************************!*\ - !*** ./src/js/interface/command.js ***! - \*************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; -eval("\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); /**\n * @author NHN Ent. FE Development Team \n * @fileoverview Command interface\n */\n\n\nvar _tuiCodeSnippet = __webpack_require__(/*! tui-code-snippet */ \"tui-code-snippet\");\n\nvar _tuiCodeSnippet2 = _interopRequireDefault(_tuiCodeSnippet);\n\nvar _errorMessage = __webpack_require__(/*! ../factory/errorMessage */ \"./src/js/factory/errorMessage.js\");\n\nvar _errorMessage2 = _interopRequireDefault(_errorMessage);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nvar createMessage = _errorMessage2.default.create;\nvar errorTypes = _errorMessage2.default.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 */\n\nvar Command = function () {\n function Command(actions, args) {\n _classCallCheck(this, Command);\n\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\n\n _createClass(Command, [{\n key: 'execute',\n value: function 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\n }, {\n key: 'undo',\n value: function 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\n }, {\n key: 'setUndoData',\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 value: function setUndoData(undoData, cachedUndoDataForSilent, isSilent) {\n if (cachedUndoDataForSilent) {\n undoData = cachedUndoDataForSilent;\n }\n\n if (!isSilent) {\n _tuiCodeSnippet2.default.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\n }, {\n key: 'setExecuteCallback',\n value: function 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\n }, {\n key: 'setUndoCallback',\n value: function setUndoCallback(callback) {\n this.undoCallback = callback;\n\n return this;\n }\n }, {\n key: 'isRedo',\n get: function get() {\n return Object.keys(this.undoData).length;\n }\n }]);\n\n return Command;\n}();\n\nexports.default = Command;\n\n//# sourceURL=webpack://tui.ImageEditor/./src/js/interface/command.js?"); - -/***/ }), - -/***/ "./src/js/interface/component.js": -/*!***************************************!*\ - !*** ./src/js/interface/component.js ***! - \***************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; -eval("\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\n/**\n * @author NHN Ent. 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 */\nvar Component = function () {\n function Component(name, graphics) {\n _classCallCheck(this, Component);\n\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\n\n _createClass(Component, [{\n key: \"fire\",\n value: function fire() {\n var context = this.graphics;\n\n for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) {\n args[_key] = arguments[_key];\n }\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\n }, {\n key: \"setCanvasImage\",\n value: function 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\n }, {\n key: \"getCanvasElement\",\n value: function getCanvasElement() {\n return this.graphics.getCanvasElement();\n }\n\n /**\n * Get fabric.Canvas instance\n * @returns {fabric.Canvas}\n */\n\n }, {\n key: \"getCanvas\",\n value: function getCanvas() {\n return this.graphics.getCanvas();\n }\n\n /**\n * Get canvasImage (fabric.Image instance)\n * @returns {fabric.Image}\n */\n\n }, {\n key: \"getCanvasImage\",\n value: function getCanvasImage() {\n return this.graphics.getCanvasImage();\n }\n\n /**\n * Get image name\n * @returns {string}\n */\n\n }, {\n key: \"getImageName\",\n value: function getImageName() {\n return this.graphics.getImageName();\n }\n\n /**\n * Get image editor\n * @returns {ImageEditor}\n */\n\n }, {\n key: \"getEditor\",\n value: function getEditor() {\n return this.graphics.getEditor();\n }\n\n /**\n * Return component name\n * @returns {string}\n */\n\n }, {\n key: \"getName\",\n value: function 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\n }, {\n key: \"setImageProperties\",\n value: function 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\n }, {\n key: \"setCanvasCssDimension\",\n value: function 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\n }, {\n key: \"setCanvasBackstoreDimension\",\n value: function setCanvasBackstoreDimension(dimension) {\n this.graphics.setCanvasBackstoreDimension(dimension);\n }\n\n /**\n * Adjust canvas dimension with scaling image\n */\n\n }, {\n key: \"adjustCanvasDimension\",\n value: function adjustCanvasDimension() {\n this.graphics.adjustCanvasDimension();\n }\n }]);\n\n return Component;\n}();\n\nexports.default = Component;\n\n//# sourceURL=webpack://tui.ImageEditor/./src/js/interface/component.js?"); - -/***/ }), - -/***/ "./src/js/interface/drawingMode.js": -/*!*****************************************!*\ - !*** ./src/js/interface/drawingMode.js ***! - \*****************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; -eval("\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); /**\n * @author NHN Ent. FE Development Team \n * @fileoverview DrawingMode interface\n */\n\n\nvar _errorMessage = __webpack_require__(/*! ../factory/errorMessage */ \"./src/js/factory/errorMessage.js\");\n\nvar _errorMessage2 = _interopRequireDefault(_errorMessage);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nvar createMessage = _errorMessage2.default.create;\nvar errorTypes = _errorMessage2.default.types;\n\n/**\n * DrawingMode interface\n * @class\n * @param {string} name - drawing mode name\n * @ignore\n */\n\nvar DrawingMode = function () {\n function DrawingMode(name) {\n _classCallCheck(this, DrawingMode);\n\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\n\n _createClass(DrawingMode, [{\n key: 'getName',\n value: function getName() {\n return this.name;\n }\n\n /**\n * start this drawing mode\n * @param {Object} options - drawing mode options\n * @abstract\n */\n\n }, {\n key: 'start',\n value: function start() {\n throw new Error(createMessage(errorTypes.UN_IMPLEMENTATION, 'start'));\n }\n\n /**\n * stop this drawing mode\n * @abstract\n */\n\n }, {\n key: 'stop',\n value: function stop() {\n throw new Error(createMessage(errorTypes.UN_IMPLEMENTATION, 'stop'));\n }\n }]);\n\n return DrawingMode;\n}();\n\nexports.default = DrawingMode;\n\n//# sourceURL=webpack://tui.ImageEditor/./src/js/interface/drawingMode.js?"); - -/***/ }), - -/***/ "./src/js/invoker.js": -/*!***************************!*\ - !*** ./src/js/invoker.js ***! - \***************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; -eval("\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); /**\n * @author NHN Ent. FE Development Team \n * @fileoverview Invoker - invoke commands\n */\n\n\nvar _tuiCodeSnippet = __webpack_require__(/*! tui-code-snippet */ \"tui-code-snippet\");\n\nvar _tuiCodeSnippet2 = _interopRequireDefault(_tuiCodeSnippet);\n\nvar _util = __webpack_require__(/*! ./util */ \"./src/js/util.js\");\n\nvar _command = __webpack_require__(/*! ./factory/command */ \"./src/js/factory/command.js\");\n\nvar _command2 = _interopRequireDefault(_command);\n\nvar _consts = __webpack_require__(/*! ./consts */ \"./src/js/consts.js\");\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nvar isFunction = _tuiCodeSnippet2.default.isFunction,\n isString = _tuiCodeSnippet2.default.isString,\n CustomEvents = _tuiCodeSnippet2.default.CustomEvents;\n\n/**\n * Invoker\n * @class\n * @ignore\n */\n\nvar Invoker = function () {\n function Invoker() {\n _classCallCheck(this, Invoker);\n\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 * @returns {Promise}\n * @private\n */\n\n\n _createClass(Invoker, [{\n key: '_invokeExecution',\n value: function _invokeExecution(command) {\n var _this = this;\n\n this.lock();\n\n var args = command.args;\n\n if (!args) {\n args = [];\n }\n\n return command.execute.apply(command, args).then(function (value) {\n if (!_this._isSilent) {\n _this.pushUndoStack(command);\n }\n _this.unlock();\n if (isFunction(command.executeCallback)) {\n command.executeCallback(value);\n }\n\n return value;\n })['catch'](function (message) {\n _this.unlock();\n\n return _util.Promise.reject(message);\n });\n }\n\n /**\n * Invoke command undo\n * @param {Command} command - Command\n * @returns {Promise}\n * @private\n */\n\n }, {\n key: '_invokeUndo',\n value: function _invokeUndo(command) {\n var _this2 = this;\n\n this.lock();\n\n var args = command.args;\n\n if (!args) {\n args = [];\n }\n\n return command.undo.apply(command, args).then(function (value) {\n _this2.pushRedoStack(command);\n _this2.unlock();\n if (isFunction(command.undoCallback)) {\n command.undoCallback(value);\n }\n\n return value;\n })['catch'](function (message) {\n _this2.unlock();\n\n return _util.Promise.reject(message);\n });\n }\n\n /**\n * fire REDO_STACK_CHANGED event\n * @private\n */\n\n }, {\n key: '_fireRedoStackChanged',\n value: function _fireRedoStackChanged() {\n this.fire(_consts.eventNames.REDO_STACK_CHANGED, this._redoStack.length);\n }\n\n /**\n * fire UNDO_STACK_CHANGED event\n * @private\n */\n\n }, {\n key: '_fireUndoStackChanged',\n value: function _fireUndoStackChanged() {\n this.fire(_consts.eventNames.UNDO_STACK_CHANGED, this._undoStack.length);\n }\n\n /**\n * Lock this invoker\n */\n\n }, {\n key: 'lock',\n value: function lock() {\n this._isLocked = true;\n }\n\n /**\n * Unlock this invoker\n */\n\n }, {\n key: 'unlock',\n value: function unlock() {\n this._isLocked = false;\n }\n }, {\n key: 'executeSilent',\n value: function executeSilent() {\n var _this3 = this;\n\n this._isSilent = true;\n\n for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) {\n args[_key] = arguments[_key];\n }\n\n return this.execute.apply(this, args.concat([this._isSilent])).then(function () {\n _this3._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\n }, {\n key: 'execute',\n value: function execute() {\n var _this4 = this;\n\n if (this._isLocked) {\n return _util.Promise.reject(_consts.rejectMessages.isLock);\n }\n\n for (var _len2 = arguments.length, args = Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {\n args[_key2] = arguments[_key2];\n }\n\n var command = args[0];\n\n if (isString(command)) {\n command = _command2.default.create.apply(_command2.default, args);\n }\n\n return this._invokeExecution(command).then(function (value) {\n _this4.clearRedoStack();\n\n return value;\n });\n }\n\n /**\n * Undo command\n * @returns {Promise}\n */\n\n }, {\n key: 'undo',\n value: function undo() {\n var command = this._undoStack.pop();\n var promise = void 0;\n var 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 = _consts.rejectMessages.undo;\n if (this._isLocked) {\n message = message + ' Because ' + _consts.rejectMessages.isLock;\n }\n promise = _util.Promise.reject(message);\n }\n\n return promise;\n }\n\n /**\n * Redo command\n * @returns {Promise}\n */\n\n }, {\n key: 'redo',\n value: function redo() {\n var command = this._redoStack.pop();\n var promise = void 0;\n var 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);\n } else {\n message = _consts.rejectMessages.redo;\n if (this._isLocked) {\n message = message + ' Because ' + _consts.rejectMessages.isLock;\n }\n promise = _util.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\n }, {\n key: 'pushUndoStack',\n value: function 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\n }, {\n key: 'pushRedoStack',\n value: function 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\n }, {\n key: 'isEmptyRedoStack',\n value: function isEmptyRedoStack() {\n return this._redoStack.length === 0;\n }\n\n /**\n * Return whether the undoStack is empty\n * @returns {boolean}\n */\n\n }, {\n key: 'isEmptyUndoStack',\n value: function isEmptyUndoStack() {\n return this._undoStack.length === 0;\n }\n\n /**\n * Clear undoStack\n */\n\n }, {\n key: 'clearUndoStack',\n value: function clearUndoStack() {\n if (!this.isEmptyUndoStack()) {\n this._undoStack = [];\n this._fireUndoStackChanged();\n }\n }\n\n /**\n * Clear redoStack\n */\n\n }, {\n key: 'clearRedoStack',\n value: function clearRedoStack() {\n if (!this.isEmptyRedoStack()) {\n this._redoStack = [];\n this._fireRedoStackChanged();\n }\n }\n }]);\n\n return Invoker;\n}();\n\nCustomEvents.mixin(Invoker);\n\nexports.default = Invoker;\n\n//# sourceURL=webpack://tui.ImageEditor/./src/js/invoker.js?"); - -/***/ }), - -/***/ "./src/js/polyfill.js": -/*!****************************!*\ - !*** ./src/js/polyfill.js ***! - \****************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; -eval("\n\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 = Element.prototype.msMatchesSelector || Element.prototype.webkitMatchesSelector;\n\nif (!Element.prototype.closest) 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 (!('classList' in document.createElement('_')) || document.createElementNS && !('classList' in document.createElementNS('http://www.w3.org/2000/svg', 'g'))) {\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 = String[protoProp].trim || function () {\n return this.replace(/^\\s+|\\s+$/g, '');\n },\n arrIndexOf = Array[protoProp].indexOf || 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\n // Vendors: please allow content code to instantiate DOMExceptions\n DOMEx = function DOMEx(type, message) {\n this.name = type;\n this.code = DOMException[type];\n this.message = message;\n },\n checkTokenAndGetIndex = function checkTokenAndGetIndex(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 ClassList(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 classListGetter() {\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 createMethod(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\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 debouncedCheck() {\n clearTimeout(tid);\n tid = setTimeout(checkUseElems, 100);\n };\n var unobserveChanges = function unobserveChanges() {\n return;\n };\n var observeChanges = function observeChanges() {\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 unobserveChanges() {\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 unobserveChanges() {\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 createRequest(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 checkUseElems() {\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 = uses[i].getAttribute('href') || uses[i].getAttributeNS(xlinkNS, 'href') || 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(attrUpdateFunc({\n useEl: uses[i],\n base: base,\n hash: hash\n }), 0);\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(attrUpdateFunc({\n useEl: uses[i],\n base: base,\n hash: hash\n }), 0);\n }\n }\n }\n uses = '';\n inProgressCount += 1;\n observeIfDone();\n };\n var _winLoad;\n _winLoad = function winLoad() {\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//# sourceURL=webpack://tui.ImageEditor/./src/js/polyfill.js?"); - -/***/ }), - -/***/ "./src/js/ui.js": -/*!**********************!*\ - !*** ./src/js/ui.js ***! - \**********************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; -eval("\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\nvar _tuiCodeSnippet = __webpack_require__(/*! tui-code-snippet */ \"tui-code-snippet\");\n\nvar _tuiCodeSnippet2 = _interopRequireDefault(_tuiCodeSnippet);\n\nvar _consts = __webpack_require__(/*! ./consts */ \"./src/js/consts.js\");\n\nvar _util = __webpack_require__(/*! ./util */ \"./src/js/util.js\");\n\nvar _mainContainer = __webpack_require__(/*! ./ui/template/mainContainer */ \"./src/js/ui/template/mainContainer.js\");\n\nvar _mainContainer2 = _interopRequireDefault(_mainContainer);\n\nvar _controls = __webpack_require__(/*! ./ui/template/controls */ \"./src/js/ui/template/controls.js\");\n\nvar _controls2 = _interopRequireDefault(_controls);\n\nvar _theme = __webpack_require__(/*! ./ui/theme/theme */ \"./src/js/ui/theme/theme.js\");\n\nvar _theme2 = _interopRequireDefault(_theme);\n\nvar _shape = __webpack_require__(/*! ./ui/shape */ \"./src/js/ui/shape.js\");\n\nvar _shape2 = _interopRequireDefault(_shape);\n\nvar _crop = __webpack_require__(/*! ./ui/crop */ \"./src/js/ui/crop.js\");\n\nvar _crop2 = _interopRequireDefault(_crop);\n\nvar _flip = __webpack_require__(/*! ./ui/flip */ \"./src/js/ui/flip.js\");\n\nvar _flip2 = _interopRequireDefault(_flip);\n\nvar _rotate = __webpack_require__(/*! ./ui/rotate */ \"./src/js/ui/rotate.js\");\n\nvar _rotate2 = _interopRequireDefault(_rotate);\n\nvar _text = __webpack_require__(/*! ./ui/text */ \"./src/js/ui/text.js\");\n\nvar _text2 = _interopRequireDefault(_text);\n\nvar _mask = __webpack_require__(/*! ./ui/mask */ \"./src/js/ui/mask.js\");\n\nvar _mask2 = _interopRequireDefault(_mask);\n\nvar _icon = __webpack_require__(/*! ./ui/icon */ \"./src/js/ui/icon.js\");\n\nvar _icon2 = _interopRequireDefault(_icon);\n\nvar _draw = __webpack_require__(/*! ./ui/draw */ \"./src/js/ui/draw.js\");\n\nvar _draw2 = _interopRequireDefault(_draw);\n\nvar _filter = __webpack_require__(/*! ./ui/filter */ \"./src/js/ui/filter.js\");\n\nvar _filter2 = _interopRequireDefault(_filter);\n\nvar _locale = __webpack_require__(/*! ./ui/locale/locale */ \"./src/js/ui/locale/locale.js\");\n\nvar _locale2 = _interopRequireDefault(_locale);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nvar SUB_UI_COMPONENT = {\n Shape: _shape2.default,\n Crop: _crop2.default,\n Flip: _flip2.default,\n Rotate: _rotate2.default,\n Text: _text2.default,\n Mask: _mask2.default,\n Icon: _icon2.default,\n Draw: _draw2.default,\n Filter: _filter2.default\n};\n\nvar BI_EXPRESSION_MINSIZE_WHEN_TOP_POSITION = '1300';\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 */\n\nvar Ui = function () {\n function Ui(element, options, actions) {\n _classCallCheck(this, Ui);\n\n this.options = this._initializeOption(options);\n this._actions = actions;\n this.submenu = false;\n this.imageSize = {};\n this.uiSize = {};\n this._locale = new _locale2.default(this.options.locale);\n this.theme = new _theme2.default(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._menuElement = null;\n this._subMenuElement = null;\n this._makeUiElement(element);\n this._setUiSize();\n this._initMenuEvent = false;\n\n this._makeSubMenu();\n }\n\n /**\n * Destroys the instance.\n */\n\n\n _createClass(Ui, [{\n key: 'destroy',\n value: function destroy() {\n this._removeUiEvent();\n this._destroyAllMenu();\n this._selectedElement.innerHTML = '';\n\n (0, _util.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\n }, {\n key: 'setUiDefaultSelectionStyle',\n value: function setUiDefaultSelectionStyle(option) {\n return _tuiCodeSnippet2.default.extend({\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 }, option);\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\n }, {\n key: 'resizeEditor',\n value: function resizeEditor() {\n var _ref = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},\n uiSize = _ref.uiSize,\n _ref$imageSize = _ref.imageSize,\n imageSize = _ref$imageSize === undefined ? this.imageSize : _ref$imageSize;\n\n if (imageSize !== this.imageSize) {\n this.imageSize = imageSize;\n }\n if (uiSize) {\n this._setUiSize(uiSize);\n }\n\n var _getCanvasMaxDimensio = this._getCanvasMaxDimension(),\n width = _getCanvasMaxDimensio.width,\n height = _getCanvasMaxDimensio.height;\n\n var editorElementStyle = this._editorElement.style;\n var menuBarPosition = this.options.menuBarPosition;\n\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 var selectElementClassList = this._selectedElement.classList;\n\n if (menuBarPosition === 'top' && this._selectedElement.offsetWidth < BI_EXPRESSION_MINSIZE_WHEN_TOP_POSITION) {\n selectElementClassList.add('tui-image-editor-top-optimization');\n } else {\n selectElementClassList.remove('tui-image-editor-top-optimization');\n }\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\n }, {\n key: 'changeHelpButtonEnabled',\n value: function changeHelpButtonEnabled(buttonType, enableStatus) {\n var 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\n }, {\n key: '_initializeOption',\n value: function _initializeOption(options) {\n return _tuiCodeSnippet2.default.extend({\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 }, options);\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\n }, {\n key: '_setUiSize',\n value: function _setUiSize() {\n var uiSize = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : this.options.uiSize;\n\n var 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\n }, {\n key: '_makeSubMenu',\n value: function _makeSubMenu() {\n var _this = this;\n\n _tuiCodeSnippet2.default.forEach(this.options.menu, function (menuName) {\n var SubComponentClass = SUB_UI_COMPONENT[menuName.replace(/^[a-z]/, function ($0) {\n return $0.toUpperCase();\n })];\n\n // make menu element\n _this._makeMenuElement(menuName);\n\n // menu btn element\n _this._buttonElements[menuName] = _this._menuElement.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 * Make primary ui dom element\n * @param {string|HTMLElement} element - Wrapper's element or selector\n * @private\n */\n\n }, {\n key: '_makeUiElement',\n value: function _makeUiElement(element) {\n var selectedElement = void 0;\n\n window.snippet = _tuiCodeSnippet2.default;\n\n if (element.nodeType) {\n selectedElement = element;\n } else {\n selectedElement = document.querySelector(element);\n }\n var selector = (0, _util.getSelector)(selectedElement);\n\n selectedElement.classList.add('tui-image-editor-container');\n selectedElement.innerHTML = (0, _controls2.default)({\n locale: this._locale,\n biImage: this.theme.getStyle('common.bi'),\n loadButtonStyle: this.theme.getStyle('loadButton'),\n downloadButtonStyle: this.theme.getStyle('downloadButton')\n }) + (0, _mainContainer2.default)({\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._menuElement = 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\n /**\n * make array for help menu output, including partitions.\n * @returns {Array}\n * @private\n */\n\n }, {\n key: '_makeHelpMenuWithPartition',\n value: function _makeHelpMenuWithPartition() {\n var helpMenuWithPartition = [].concat(_consts.HELP_MENUS, ['']);\n helpMenuWithPartition.splice(3, 0, '');\n\n return helpMenuWithPartition;\n }\n\n /**\n * Add help menu\n * @private\n */\n\n }, {\n key: '_addHelpMenus',\n value: function _addHelpMenus() {\n var _this2 = this;\n\n var helpMenuWithPartition = this._makeHelpMenuWithPartition();\n\n _tuiCodeSnippet2.default.forEach(helpMenuWithPartition, function (menuName) {\n if (!menuName) {\n _this2._makeMenuPartitionElement();\n } else {\n _this2._makeMenuElement(menuName, ['normal', 'disabled', 'hover'], 'help');\n\n if (menuName) {\n _this2._buttonElements[menuName] = _this2._menuElement.querySelector('.tie-btn-' + menuName);\n }\n }\n });\n }\n\n /**\n * Make menu partition element\n * @private\n */\n\n }, {\n key: '_makeMenuPartitionElement',\n value: function _makeMenuPartitionElement() {\n var partitionElement = document.createElement('li');\n var partitionInnerElement = document.createElement('div');\n partitionElement.className = (0, _util.cls)('item');\n partitionInnerElement.className = (0, _util.cls)('icpartition');\n partitionElement.appendChild(partitionInnerElement);\n\n this._menuElement.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\n }, {\n key: '_makeMenuElement',\n value: function _makeMenuElement(menuName) {\n var useIconTypes = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : ['normal', 'active', 'hover'];\n var menuType = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 'normal';\n\n var btnElement = document.createElement('li');\n var menuItemHtml = this.theme.makeMenSvgIconSet(useIconTypes, menuName);\n\n this._addTooltipAttribute(btnElement, menuName);\n btnElement.className = 'tie-btn-' + menuName + ' ' + (0, _util.cls)('item') + ' ' + menuType;\n btnElement.innerHTML = menuItemHtml;\n\n this._menuElement.appendChild(btnElement);\n }\n\n /**\n * Add help action event\n * @private\n */\n\n }, {\n key: '_addHelpActionEvent',\n value: function _addHelpActionEvent() {\n var _this3 = this;\n\n _tuiCodeSnippet2.default.forEach(_consts.HELP_MENUS, function (helpName) {\n _this3.eventHandler[helpName] = function () {\n return _this3._actions.main[helpName]();\n };\n _this3._buttonElements[helpName].addEventListener('click', _this3.eventHandler[helpName]);\n });\n }\n\n /**\n * Remove help action event\n * @private\n */\n\n }, {\n key: '_removeHelpActionEvent',\n value: function _removeHelpActionEvent() {\n var _this4 = this;\n\n _tuiCodeSnippet2.default.forEach(_consts.HELP_MENUS, function (helpName) {\n _this4._buttonElements[helpName].removeEventListener('click', _this4.eventHandler[helpName]);\n });\n }\n\n /**\n * Add attribute for menu tooltip\n * @param {HTMLElement} element - menu element\n * @param {string} tooltipName - tooltipName\n * @private\n */\n\n }, {\n key: '_addTooltipAttribute',\n value: function _addTooltipAttribute(element, tooltipName) {\n element.setAttribute('tooltip-content', this._locale.localize(tooltipName.replace(/^[a-z]/g, function ($0) {\n return $0.toUpperCase();\n })));\n }\n\n /**\n * Add download event\n * @private\n */\n\n }, {\n key: '_addDownloadEvent',\n value: function _addDownloadEvent() {\n var _this5 = this;\n\n this.eventHandler.download = function () {\n return _this5._actions.main.download();\n };\n _tuiCodeSnippet2.default.forEach(this._buttonElements.download, function (element) {\n element.addEventListener('click', _this5.eventHandler.download);\n });\n }\n }, {\n key: '_removeDownloadEvent',\n value: function _removeDownloadEvent() {\n var _this6 = this;\n\n _tuiCodeSnippet2.default.forEach(this._buttonElements.download, function (element) {\n element.removeEventListener('click', _this6.eventHandler.download);\n });\n }\n\n /**\n * Add load event\n * @private\n */\n\n }, {\n key: '_addLoadEvent',\n value: function _addLoadEvent() {\n var _this7 = this;\n\n this.eventHandler.loadImage = function (event) {\n return _this7._actions.main.load(event.target.files[0]);\n };\n\n _tuiCodeSnippet2.default.forEach(this._buttonElements.load, function (element) {\n element.addEventListener('change', _this7.eventHandler.loadImage);\n });\n }\n\n /**\n * Remmove load event\n * @private\n */\n\n }, {\n key: '_removeLoadEvent',\n value: function _removeLoadEvent() {\n var _this8 = this;\n\n _tuiCodeSnippet2.default.forEach(this._buttonElements.load, function (element) {\n element.removeEventListener('change', _this8.eventHandler.loadImage);\n });\n }\n\n /**\n * Add menu event\n * @param {string} menuName - menu name\n * @private\n */\n\n }, {\n key: '_addMainMenuEvent',\n value: function _addMainMenuEvent(menuName) {\n var _this9 = this;\n\n this.eventHandler[menuName] = function () {\n return _this9.changeMenu(menuName);\n };\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\n }, {\n key: '_addSubMenuEvent',\n value: function _addSubMenuEvent(menuName) {\n this[menuName].addEvent(this._actions[menuName]);\n }\n\n /**\n * Add menu event\n * @private\n */\n\n }, {\n key: '_addMenuEvent',\n value: function _addMenuEvent() {\n var _this10 = this;\n\n _tuiCodeSnippet2.default.forEach(this.options.menu, function (menuName) {\n _this10._addMainMenuEvent(menuName);\n _this10._addSubMenuEvent(menuName);\n });\n }\n\n /**\n * Remove menu event\n * @private\n */\n\n }, {\n key: '_removeMainMenuEvent',\n value: function _removeMainMenuEvent() {\n var _this11 = this;\n\n _tuiCodeSnippet2.default.forEach(this.options.menu, function (menuName) {\n _this11._buttonElements[menuName].removeEventListener('click', _this11.eventHandler[menuName]);\n });\n }\n\n /**\n * Get editor area element\n * @returns {HTMLElement} editor area html element\n * @ignore\n */\n\n }, {\n key: 'getEditorArea',\n value: function getEditorArea() {\n return this._editorElement;\n }\n\n /**\n * Add event for menu items\n * @ignore\n */\n\n }, {\n key: 'activeMenuEvent',\n value: function activeMenuEvent() {\n if (this._initMenuEvent) {\n return;\n }\n\n this._addHelpActionEvent();\n this._addDownloadEvent();\n this._addMenuEvent();\n this._initMenu();\n this._initMenuEvent = true;\n }\n\n /**\n * Remove ui event\n * @private\n */\n\n }, {\n key: '_removeUiEvent',\n value: function _removeUiEvent() {\n this._removeHelpActionEvent();\n this._removeDownloadEvent();\n this._removeLoadEvent();\n this._removeMainMenuEvent();\n }\n\n /**\n * Destroy all menu instance\n * @private\n */\n\n }, {\n key: '_destroyAllMenu',\n value: function _destroyAllMenu() {\n var _this12 = this;\n\n _tuiCodeSnippet2.default.forEach(this.options.menu, function (menuName) {\n _this12[menuName].destroy();\n });\n }\n\n /**\n * Init canvas\n * @ignore\n */\n\n }, {\n key: 'initCanvas',\n value: function initCanvas() {\n var _this13 = this;\n\n var loadImageInfo = this._getLoadImage();\n if (loadImageInfo.path) {\n this._actions.main.initLoadImage(loadImageInfo.path, loadImageInfo.name).then(function () {\n _this13.activeMenuEvent();\n });\n }\n\n this._addLoadEvent();\n\n var gridVisual = document.createElement('div');\n\n gridVisual.className = (0, _util.cls)('grid-visual');\n var grid = '\\n \\n \\n \\n
                          ';\n gridVisual.innerHTML = grid;\n this._editorContainerElement = this._editorElement.querySelector('.tui-image-editor-canvas-container');\n this._editorContainerElement.appendChild(gridVisual);\n }\n\n /**\n * get editor area element\n * @returns {Object} load image option\n * @private\n */\n\n }, {\n key: '_getLoadImage',\n value: function _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\n }, {\n key: 'changeMenu',\n value: function changeMenu(menuName) {\n var toggle = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true;\n var discardSelection = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : true;\n\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 toogle or not\n * @param {boolean} discardSelection - discard selection\n * @private\n */\n\n }, {\n key: '_changeMenu',\n value: function _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\n }, {\n key: '_initMenu',\n value: function _initMenu() {\n if (this.options.initMenu) {\n var 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.registDefaultIcon();\n }\n }\n\n /**\n * Get canvas max Dimension\n * @returns {Object} - width & height of editor\n * @private\n */\n\n }, {\n key: '_getCanvasMaxDimension',\n value: function _getCanvasMaxDimension() {\n var _editorContainerEleme = this._editorContainerElement.style,\n maxWidth = _editorContainerEleme.maxWidth,\n maxHeight = _editorContainerEleme.maxHeight;\n\n var width = parseFloat(maxWidth);\n var height = parseFloat(maxHeight);\n\n return {\n width: width,\n height: 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\n }, {\n key: '_setEditorPosition',\n value: function _setEditorPosition(menuBarPosition) {\n var _getCanvasMaxDimensio2 = this._getCanvasMaxDimension(),\n width = _getCanvasMaxDimensio2.width,\n height = _getCanvasMaxDimensio2.height;\n\n var editorElementStyle = this._editorElement.style;\n var top = 0;\n var 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\n return Ui;\n}();\n\nexports.default = Ui;\n\n//# sourceURL=webpack://tui.ImageEditor/./src/js/ui.js?"); - -/***/ }), - -/***/ "./src/js/ui/crop.js": -/*!***************************!*\ - !*** ./src/js/ui/crop.js ***! - \***************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; -eval("\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\nvar _tuiCodeSnippet = __webpack_require__(/*! tui-code-snippet */ \"tui-code-snippet\");\n\nvar _tuiCodeSnippet2 = _interopRequireDefault(_tuiCodeSnippet);\n\nvar _submenuBase = __webpack_require__(/*! ./submenuBase */ \"./src/js/ui/submenuBase.js\");\n\nvar _submenuBase2 = _interopRequireDefault(_submenuBase);\n\nvar _util = __webpack_require__(/*! ../util */ \"./src/js/util.js\");\n\nvar _crop = __webpack_require__(/*! ./template/submenu/crop */ \"./src/js/ui/template/submenu/crop.js\");\n\nvar _crop2 = _interopRequireDefault(_crop);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return call && (typeof call === \"object\" || typeof call === \"function\") ? call : self; }\n\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function, not \" + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }\n\n/**\n * Crop ui class\n * @class\n * @ignore\n */\nvar Crop = function (_Submenu) {\n _inherits(Crop, _Submenu);\n\n function Crop(subMenuElement, _ref) {\n var locale = _ref.locale,\n makeSvgIcon = _ref.makeSvgIcon,\n menuBarPosition = _ref.menuBarPosition,\n usageStatistics = _ref.usageStatistics;\n\n _classCallCheck(this, Crop);\n\n var _this = _possibleConstructorReturn(this, (Crop.__proto__ || Object.getPrototypeOf(Crop)).call(this, subMenuElement, {\n locale: locale,\n name: 'crop',\n makeSvgIcon: makeSvgIcon,\n menuBarPosition: menuBarPosition,\n templateHtml: _crop2.default,\n usageStatistics: 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 return _this;\n }\n\n /**\n * Destroys the instance.\n */\n\n\n _createClass(Crop, [{\n key: 'destroy',\n value: function destroy() {\n this._removeEvent();\n\n (0, _util.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\n }, {\n key: 'addEvent',\n value: function addEvent(actions) {\n var apply = this._applyEventHandler.bind(this);\n var cancel = this._cancelEventHandler.bind(this);\n var cropzonePreset = this._cropzonePresetEventHandler.bind(this);\n\n this.eventHandler = {\n apply: apply,\n cancel: cancel,\n cropzonePreset: 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\n }, {\n key: '_removeEvent',\n value: function _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 key: '_applyEventHandler',\n value: function _applyEventHandler() {\n this.actions.crop();\n this._els.apply.classList.remove('active');\n }\n }, {\n key: '_cancelEventHandler',\n value: function _cancelEventHandler() {\n this.actions.cancel();\n this._els.apply.classList.remove('active');\n }\n }, {\n key: '_cropzonePresetEventHandler',\n value: function _cropzonePresetEventHandler(event) {\n var button = event.target.closest('.tui-image-editor-button.preset');\n if (button) {\n var _button$className$mat = button.className.match(/preset-[^\\s]+/),\n presetType = _button$className$mat[0];\n\n this._setPresetButtonActive(button);\n this.actions.preset(presetType);\n }\n }\n\n /**\n * Executed when the menu starts.\n */\n\n }, {\n key: 'changeStartMode',\n value: function changeStartMode() {\n this.actions.modeChange('crop');\n }\n\n /**\n * Returns the menu to its default state.\n */\n\n }, {\n key: 'changeStandbyMode',\n value: function 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\n }, {\n key: 'changeApplyButtonStatus',\n value: function 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\n }, {\n key: '_setPresetButtonActive',\n value: function _setPresetButtonActive() {\n var button = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : this.defaultPresetButton;\n\n _tuiCodeSnippet2.default.forEach([].slice.call(this._els.preset.querySelectorAll('.preset')), function (presetButton) {\n presetButton.classList.remove('active');\n });\n\n if (button) {\n button.classList.add('active');\n }\n }\n }]);\n\n return Crop;\n}(_submenuBase2.default);\n\nexports.default = Crop;\n\n//# sourceURL=webpack://tui.ImageEditor/./src/js/ui/crop.js?"); - -/***/ }), - -/***/ "./src/js/ui/draw.js": -/*!***************************!*\ - !*** ./src/js/ui/draw.js ***! - \***************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; -eval("\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\nvar _util = __webpack_require__(/*! ../util */ \"./src/js/util.js\");\n\nvar _colorpicker = __webpack_require__(/*! ./tools/colorpicker */ \"./src/js/ui/tools/colorpicker.js\");\n\nvar _colorpicker2 = _interopRequireDefault(_colorpicker);\n\nvar _range = __webpack_require__(/*! ./tools/range */ \"./src/js/ui/tools/range.js\");\n\nvar _range2 = _interopRequireDefault(_range);\n\nvar _submenuBase = __webpack_require__(/*! ./submenuBase */ \"./src/js/ui/submenuBase.js\");\n\nvar _submenuBase2 = _interopRequireDefault(_submenuBase);\n\nvar _draw = __webpack_require__(/*! ./template/submenu/draw */ \"./src/js/ui/template/submenu/draw.js\");\n\nvar _draw2 = _interopRequireDefault(_draw);\n\nvar _consts = __webpack_require__(/*! ../consts */ \"./src/js/consts.js\");\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return call && (typeof call === \"object\" || typeof call === \"function\") ? call : self; }\n\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function, not \" + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }\n\nvar DRAW_OPACITY = 0.7;\n\n/**\n * Draw ui class\n * @class\n * @ignore\n */\n\nvar Draw = function (_Submenu) {\n _inherits(Draw, _Submenu);\n\n function Draw(subMenuElement, _ref) {\n var locale = _ref.locale,\n makeSvgIcon = _ref.makeSvgIcon,\n menuBarPosition = _ref.menuBarPosition,\n usageStatistics = _ref.usageStatistics;\n\n _classCallCheck(this, Draw);\n\n var _this = _possibleConstructorReturn(this, (Draw.__proto__ || Object.getPrototypeOf(Draw)).call(this, subMenuElement, {\n locale: locale,\n name: 'draw',\n makeSvgIcon: makeSvgIcon,\n menuBarPosition: menuBarPosition,\n templateHtml: _draw2.default,\n usageStatistics: usageStatistics\n }));\n\n _this._els = {\n lineSelectButton: _this.selector('.tie-draw-line-select-button'),\n drawColorPicker: new _colorpicker2.default(_this.selector('.tie-draw-color'), '#00a9ff', _this.toggleDirection, _this.usageStatistics),\n drawRange: new _range2.default({\n slider: _this.selector('.tie-draw-range'),\n input: _this.selector('.tie-draw-range-value')\n }, _consts.defaultDrawRangeValus)\n };\n\n _this.type = null;\n _this.color = _this._els.drawColorPicker.color;\n _this.width = _this._els.drawRange.value;\n return _this;\n }\n\n /**\n * Destroys the instance.\n */\n\n\n _createClass(Draw, [{\n key: 'destroy',\n value: function destroy() {\n this._removeEvent();\n this._els.drawColorPicker.destroy();\n this._els.drawRange.destroy();\n\n (0, _util.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\n }, {\n key: 'addEvent',\n value: function 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\n }, {\n key: '_removeEvent',\n value: function _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\n }, {\n key: 'setDrawMode',\n value: function setDrawMode() {\n this.actions.setDrawMode(this.type, {\n width: this.width,\n color: (0, _util.getRgb)(this.color, DRAW_OPACITY)\n });\n }\n\n /**\n * Returns the menu to its default state.\n */\n\n }, {\n key: 'changeStandbyMode',\n value: function 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\n }, {\n key: 'changeStartMode',\n value: function 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\n }, {\n key: '_changeDrawType',\n value: function _changeDrawType(event) {\n var button = event.target.closest('.tui-image-editor-button');\n if (button) {\n var 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\n }, {\n key: '_changeDrawColor',\n value: function _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\n }, {\n key: '_changeDrawRange',\n value: function _changeDrawRange(value) {\n this.width = value;\n if (!this.type) {\n this.changeStartMode();\n } else {\n this.setDrawMode();\n }\n }\n }]);\n\n return Draw;\n}(_submenuBase2.default);\n\nexports.default = Draw;\n\n//# sourceURL=webpack://tui.ImageEditor/./src/js/ui/draw.js?"); - -/***/ }), - -/***/ "./src/js/ui/filter.js": -/*!*****************************!*\ - !*** ./src/js/ui/filter.js ***! - \*****************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; -eval("\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\nvar _tuiCodeSnippet = __webpack_require__(/*! tui-code-snippet */ \"tui-code-snippet\");\n\nvar _tuiCodeSnippet2 = _interopRequireDefault(_tuiCodeSnippet);\n\nvar _colorpicker = __webpack_require__(/*! ./tools/colorpicker */ \"./src/js/ui/tools/colorpicker.js\");\n\nvar _colorpicker2 = _interopRequireDefault(_colorpicker);\n\nvar _range = __webpack_require__(/*! ./tools/range */ \"./src/js/ui/tools/range.js\");\n\nvar _range2 = _interopRequireDefault(_range);\n\nvar _submenuBase = __webpack_require__(/*! ./submenuBase */ \"./src/js/ui/submenuBase.js\");\n\nvar _submenuBase2 = _interopRequireDefault(_submenuBase);\n\nvar _filter = __webpack_require__(/*! ./template/submenu/filter */ \"./src/js/ui/template/submenu/filter.js\");\n\nvar _filter2 = _interopRequireDefault(_filter);\n\nvar _util = __webpack_require__(/*! ../util */ \"./src/js/util.js\");\n\nvar _consts = __webpack_require__(/*! ../consts */ \"./src/js/consts.js\");\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return call && (typeof call === \"object\" || typeof call === \"function\") ? call : self; }\n\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function, not \" + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }\n\nvar PICKER_CONTROL_HEIGHT = '130px';\nvar BLEND_OPTIONS = ['add', 'diff', 'subtract', 'multiply', 'screen', 'lighten', 'darken'];\nvar FILTER_OPTIONS = ['grayscale', 'invert', 'sepia', 'vintage', 'blur', 'sharpen', 'emboss', 'remove-white', 'brightness', 'noise', 'pixelate', 'color-filter', 'tint', 'multiply', 'blend'];\n\nvar 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};\n\nvar RANGE_INSTANCE_NAMES = ['removewhiteDistanceRange', 'colorfilterThresholeRange', 'pixelateRange', 'noiseRange', 'brightnessRange', 'tintOpacity'];\nvar COLORPICKER_INSTANCE_NAMES = ['filterBlendColor', 'filterMultiplyColor', 'filterTintColor'];\n\n/**\n * Filter ui class\n * @class\n * @ignore\n */\n\nvar Filter = function (_Submenu) {\n _inherits(Filter, _Submenu);\n\n function Filter(subMenuElement, _ref) {\n var locale = _ref.locale,\n menuBarPosition = _ref.menuBarPosition,\n usageStatistics = _ref.usageStatistics;\n\n _classCallCheck(this, Filter);\n\n var _this = _possibleConstructorReturn(this, (Filter.__proto__ || Object.getPrototypeOf(Filter)).call(this, subMenuElement, {\n locale: locale,\n name: 'filter',\n menuBarPosition: menuBarPosition,\n templateHtml: _filter2.default,\n usageStatistics: usageStatistics\n }));\n\n _this.selectBoxShow = false;\n\n _this.checkedMap = {};\n _this._makeControlElement();\n return _this;\n }\n\n /**\n * Destroys the instance.\n */\n\n\n _createClass(Filter, [{\n key: 'destroy',\n value: function destroy() {\n this._removeEvent();\n this._destroyToolInstance();\n\n (0, _util.assignmentForDestroy)(this);\n }\n\n /**\n * Remove event for filter\n */\n\n }, {\n key: '_removeEvent',\n value: function _removeEvent() {\n var _this2 = this;\n\n _tuiCodeSnippet2.default.forEach(FILTER_OPTIONS, function (filter) {\n var filterCheckElement = _this2.selector('.tie-' + filter);\n var filterNameCamelCase = (0, _util.toCamelCase)(filter);\n\n filterCheckElement.removeEventListener('change', _this2.eventHandler[filterNameCamelCase]);\n });\n\n _tuiCodeSnippet2.default.forEach([].concat(RANGE_INSTANCE_NAMES, COLORPICKER_INSTANCE_NAMES), function (instanceName) {\n _this2._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 key: '_destroyToolInstance',\n value: function _destroyToolInstance() {\n var _this3 = this;\n\n _tuiCodeSnippet2.default.forEach([].concat(RANGE_INSTANCE_NAMES, COLORPICKER_INSTANCE_NAMES), function (instanceName) {\n _this3._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\n }, {\n key: 'addEvent',\n value: function addEvent(_ref2) {\n var _this4 = this;\n\n var applyFilter = _ref2.applyFilter;\n\n var changeFilterState = function changeFilterState(filterName) {\n return _this4._changeFilterState.bind(_this4, applyFilter, filterName);\n };\n var changeFilterStateForRange = function changeFilterStateForRange(filterName) {\n return function (value, isLast) {\n return _this4._changeFilterState(applyFilter, filterName, isLast);\n };\n };\n\n this.eventHandler = {\n changeBlendFilter: changeFilterState('blend'),\n blandTypeClick: function blandTypeClick(event) {\n return event.stopPropagation();\n }\n };\n\n _tuiCodeSnippet2.default.forEach(FILTER_OPTIONS, function (filter) {\n var filterCheckElement = _this4.selector('.tie-' + filter);\n var filterNameCamelCase = (0, _util.toCamelCase)(filter);\n _this4.checkedMap[filterNameCamelCase] = filterCheckElement;\n _this4.eventHandler[filterNameCamelCase] = changeFilterState(filterNameCamelCase);\n\n filterCheckElement.addEventListener('change', _this4.eventHandler[filterNameCamelCase]);\n });\n\n this._els.removewhiteDistanceRange.on('change', changeFilterStateForRange('removeWhite'));\n this._els.colorfilterThresholeRange.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} chagedFilterInfos - changed command infos\n * @param {string} type - filter type\n * @param {string} action - add or remove\n * @param {Object} options - filter options\n */\n\n }, {\n key: 'setFilterState',\n value: function setFilterState(chagedFilterInfos) {\n var type = chagedFilterInfos.type,\n options = chagedFilterInfos.options,\n action = chagedFilterInfos.action;\n\n var filterName = this._getFilterNameFromOptions(type, options);\n var 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\n }, {\n key: '_setFilterState',\n value: function _setFilterState(filterName, options) {\n if (filterName === 'colorFilter') {\n this._els.colorfilterThresholeRange.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\n }, {\n key: '_getFilterNameFromOptions',\n value: function _getFilterNameFromOptions(type, options) {\n var filterName = type;\n\n if (type === 'removeColor') {\n filterName = _tuiCodeSnippet2.default.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\n }, {\n key: '_changeFilterState',\n value: function _changeFilterState(applyFilter, filterName) {\n var isLast = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : true;\n\n var apply = this.checkedMap[filterName].checked;\n var type = filterNameMap[filterName];\n\n var 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\n }, {\n key: '_getFilterOption',\n value: function _getFilterOption(type) {\n var 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.colorfilterThresholeRange.value);\n break;\n case 'pixelate':\n option.blocksize = (0, _util.toInteger)(this._els.pixelateRange.value);\n break;\n case 'noise':\n option.noise = (0, _util.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\n }, {\n key: '_makeControlElement',\n value: function _makeControlElement() {\n this._els = {\n removewhiteDistanceRange: new _range2.default({ slider: this.selector('.tie-removewhite-distance-range') }, _consts.defaultFilterRangeValus.removewhiteDistanceRange),\n brightnessRange: new _range2.default({ slider: this.selector('.tie-brightness-range') }, _consts.defaultFilterRangeValus.brightnessRange),\n noiseRange: new _range2.default({ slider: this.selector('.tie-noise-range') }, _consts.defaultFilterRangeValus.noiseRange),\n pixelateRange: new _range2.default({ slider: this.selector('.tie-pixelate-range') }, _consts.defaultFilterRangeValus.pixelateRange),\n colorfilterThresholeRange: new _range2.default({ slider: this.selector('.tie-colorfilter-threshole-range') }, _consts.defaultFilterRangeValus.colorfilterThresholeRange),\n filterTintColor: new _colorpicker2.default(this.selector('.tie-filter-tint-color'), '#03bd9e', this.toggleDirection, this.usageStatistics),\n filterMultiplyColor: new _colorpicker2.default(this.selector('.tie-filter-multiply-color'), '#515ce6', this.toggleDirection, this.usageStatistics),\n filterBlendColor: new _colorpicker2.default(this.selector('.tie-filter-blend-color'), '#ffbb3b', this.toggleDirection, this.usageStatistics),\n blurRange: _consts.defaultFilterRangeValus.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\n }, {\n key: '_pickerWithRange',\n value: function _pickerWithRange(pickerControl) {\n var rangeWrap = document.createElement('div');\n var rangelabel = document.createElement('label');\n var 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 _range2.default({ slider: slider }, _consts.defaultFilterRangeValus.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\n }, {\n key: '_pickerWithSelectbox',\n value: function _pickerWithSelectbox(pickerControl) {\n var selectlistWrap = document.createElement('div');\n var selectlist = document.createElement('select');\n var 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\n }, {\n key: '_drawSelectOptionList',\n value: function _drawSelectOptionList(selectlist, optionlist) {\n var options = selectlist.querySelectorAll('option');\n _tuiCodeSnippet2.default.forEach(options, function (option) {\n var 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 * custome selectbox custom event\n * @param {HTMLElement} selectlist - selectbox element\n * @param {HTMLElement} optionlist - custom option list item element\n * @private\n */\n\n }, {\n key: '_pickerWithSelectboxForAddEvent',\n value: function _pickerWithSelectboxForAddEvent(selectlist, optionlist) {\n var _this5 = this;\n\n optionlist.addEventListener('click', function (event) {\n var optionValue = event.target.getAttribute('data-item');\n var 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 _this5.selectBoxShow = false;\n optionlist.style.display = 'none';\n });\n\n selectlist.addEventListener('mousedown', function (event) {\n event.preventDefault();\n _this5.selectBoxShow = !_this5.selectBoxShow;\n optionlist.style.display = _this5.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\n }, {\n key: '_makeSelectOptionList',\n value: function _makeSelectOptionList(selectlist) {\n _tuiCodeSnippet2.default.forEach(BLEND_OPTIONS, function (option) {\n var selectOption = document.createElement('option');\n selectOption.setAttribute('value', option);\n selectOption.innerHTML = option.replace(/^[a-z]/, function ($0) {\n return $0.toUpperCase();\n });\n selectlist.appendChild(selectOption);\n });\n }\n }]);\n\n return Filter;\n}(_submenuBase2.default);\n\nexports.default = Filter;\n\n//# sourceURL=webpack://tui.ImageEditor/./src/js/ui/filter.js?"); - -/***/ }), - -/***/ "./src/js/ui/flip.js": -/*!***************************!*\ - !*** ./src/js/ui/flip.js ***! - \***************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; -eval("\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\nvar _tuiCodeSnippet = __webpack_require__(/*! tui-code-snippet */ \"tui-code-snippet\");\n\nvar _tuiCodeSnippet2 = _interopRequireDefault(_tuiCodeSnippet);\n\nvar _util = __webpack_require__(/*! ../util */ \"./src/js/util.js\");\n\nvar _submenuBase = __webpack_require__(/*! ./submenuBase */ \"./src/js/ui/submenuBase.js\");\n\nvar _submenuBase2 = _interopRequireDefault(_submenuBase);\n\nvar _flip = __webpack_require__(/*! ./template/submenu/flip */ \"./src/js/ui/template/submenu/flip.js\");\n\nvar _flip2 = _interopRequireDefault(_flip);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return call && (typeof call === \"object\" || typeof call === \"function\") ? call : self; }\n\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function, not \" + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }\n\n/**\n * Flip ui class\n * @class\n * @ignore\n */\nvar Flip = function (_Submenu) {\n _inherits(Flip, _Submenu);\n\n function Flip(subMenuElement, _ref) {\n var locale = _ref.locale,\n makeSvgIcon = _ref.makeSvgIcon,\n menuBarPosition = _ref.menuBarPosition,\n usageStatistics = _ref.usageStatistics;\n\n _classCallCheck(this, Flip);\n\n var _this = _possibleConstructorReturn(this, (Flip.__proto__ || Object.getPrototypeOf(Flip)).call(this, subMenuElement, {\n locale: locale,\n name: 'flip',\n makeSvgIcon: makeSvgIcon,\n menuBarPosition: menuBarPosition,\n templateHtml: _flip2.default,\n usageStatistics: usageStatistics\n }));\n\n _this.flipStatus = false;\n\n _this._els = {\n flipButton: _this.selector('.tie-flip-button')\n };\n return _this;\n }\n\n /**\n * Destroys the instance.\n */\n\n\n _createClass(Flip, [{\n key: 'destroy',\n value: function destroy() {\n this._removeEvent();\n\n (0, _util.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\n }, {\n key: 'addEvent',\n value: function 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\n }, {\n key: '_removeEvent',\n value: function _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\n }, {\n key: '_changeFlip',\n value: function _changeFlip(event) {\n var _this2 = this;\n\n var button = event.target.closest('.tui-image-editor-button');\n if (button) {\n var flipType = this.getButtonType(button, ['flipX', 'flipY', 'resetFlip']);\n if (!this.flipStatus && flipType === 'resetFlip') {\n return;\n }\n\n this._actions.flip(flipType).then(function (flipStatus) {\n var flipClassList = _this2._els.flipButton.classList;\n _this2.flipStatus = false;\n\n flipClassList.remove('resetFlip');\n _tuiCodeSnippet2.default.forEach(['flipX', 'flipY'], function (type) {\n flipClassList.remove(type);\n if (flipStatus[type]) {\n flipClassList.add(type);\n flipClassList.add('resetFlip');\n _this2.flipStatus = true;\n }\n });\n });\n }\n }\n }]);\n\n return Flip;\n}(_submenuBase2.default);\n\nexports.default = Flip;\n\n//# sourceURL=webpack://tui.ImageEditor/./src/js/ui/flip.js?"); - -/***/ }), - -/***/ "./src/js/ui/icon.js": -/*!***************************!*\ - !*** ./src/js/ui/icon.js ***! - \***************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; -eval("\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\nvar _tuiCodeSnippet = __webpack_require__(/*! tui-code-snippet */ \"tui-code-snippet\");\n\nvar _tuiCodeSnippet2 = _interopRequireDefault(_tuiCodeSnippet);\n\nvar _colorpicker = __webpack_require__(/*! ./tools/colorpicker */ \"./src/js/ui/tools/colorpicker.js\");\n\nvar _colorpicker2 = _interopRequireDefault(_colorpicker);\n\nvar _submenuBase = __webpack_require__(/*! ./submenuBase */ \"./src/js/ui/submenuBase.js\");\n\nvar _submenuBase2 = _interopRequireDefault(_submenuBase);\n\nvar _icon = __webpack_require__(/*! ./template/submenu/icon */ \"./src/js/ui/template/submenu/icon.js\");\n\nvar _icon2 = _interopRequireDefault(_icon);\n\nvar _util = __webpack_require__(/*! ../util */ \"./src/js/util.js\");\n\nvar _consts = __webpack_require__(/*! ../consts */ \"./src/js/consts.js\");\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return call && (typeof call === \"object\" || typeof call === \"function\") ? call : self; }\n\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function, not \" + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }\n\n/**\n * Icon ui class\n * @class\n * @ignore\n */\nvar Icon = function (_Submenu) {\n _inherits(Icon, _Submenu);\n\n function Icon(subMenuElement, _ref) {\n var locale = _ref.locale,\n makeSvgIcon = _ref.makeSvgIcon,\n menuBarPosition = _ref.menuBarPosition,\n usageStatistics = _ref.usageStatistics;\n\n _classCallCheck(this, Icon);\n\n var _this = _possibleConstructorReturn(this, (Icon.__proto__ || Object.getPrototypeOf(Icon)).call(this, subMenuElement, {\n locale: locale,\n name: 'icon',\n makeSvgIcon: makeSvgIcon,\n menuBarPosition: menuBarPosition,\n templateHtml: _icon2.default,\n usageStatistics: usageStatistics\n }));\n\n _this.iconType = null;\n _this._iconMap = {};\n\n _this._els = {\n registrIconButton: _this.selector('.tie-icon-image-file'),\n addIconButton: _this.selector('.tie-icon-add-button'),\n iconColorpicker: new _colorpicker2.default(_this.selector('.tie-icon-color'), '#ffbb3b', _this.toggleDirection, _this.usageStatistics)\n };\n return _this;\n }\n\n /**\n * Destroys the instance.\n */\n\n\n _createClass(Icon, [{\n key: 'destroy',\n value: function destroy() {\n this._removeEvent();\n this._els.iconColorpicker.destroy();\n\n (0, _util.assignmentForDestroy)(this);\n }\n\n /**\n * Add event for icon\n * @param {Object} actions - actions for icon\n * @param {Function} actions.registCustomIcon - register icon\n * @param {Function} actions.addIcon - add icon\n * @param {Function} actions.changeColor - change icon color\n */\n\n }, {\n key: 'addEvent',\n value: function addEvent(actions) {\n var registerIcon = this._registerIconHandler.bind(this);\n var addIcon = this._addIconHandler.bind(this);\n\n this.eventHandler = {\n registerIcon: registerIcon,\n addIcon: addIcon\n };\n\n this.actions = actions;\n this._els.iconColorpicker.on('change', this._changeColorHandler.bind(this));\n this._els.registrIconButton.addEventListener('change', registerIcon);\n this._els.addIconButton.addEventListener('click', addIcon);\n }\n\n /**\n * Remove event\n * @private\n */\n\n }, {\n key: '_removeEvent',\n value: function _removeEvent() {\n this._els.iconColorpicker.off();\n this._els.registrIconButton.removeEventListener('change', this.eventHandler.registerIcon);\n this._els.addIconButton.removeEventListener('click', this.eventHandler.addIcon);\n }\n\n /**\n * Clear icon type\n */\n\n }, {\n key: 'clearIconType',\n value: function clearIconType() {\n this._els.addIconButton.classList.remove(this.iconType);\n this.iconType = null;\n }\n\n /**\n * Register default icon\n */\n\n }, {\n key: 'registDefaultIcon',\n value: function registDefaultIcon() {\n var _this2 = this;\n\n _tuiCodeSnippet2.default.forEach(_consts.defaultIconPath, function (path, type) {\n _this2.actions.registDefalutIcons(type, path);\n });\n }\n\n /**\n * Set icon picker color\n * @param {string} iconColor - rgb color string\n */\n\n }, {\n key: 'setIconPickerColor',\n value: function setIconPickerColor(iconColor) {\n this._els.iconColorpicker.color = iconColor;\n }\n\n /**\n * Returns the menu to its default state.\n */\n\n }, {\n key: 'changeStandbyMode',\n value: function 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\n }, {\n key: '_changeColorHandler',\n value: function _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\n }, {\n key: '_addIconHandler',\n value: function _addIconHandler(event) {\n var button = event.target.closest('.tui-image-editor-button');\n\n if (button) {\n var iconType = button.getAttribute('data-icontype');\n var 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\n }, {\n key: '_registerIconHandler',\n value: function _registerIconHandler(event) {\n var imgUrl = void 0;\n\n if (!_util.isSupportFileApi) {\n alert('This browser does not support file-api');\n }\n\n var _event$target$files = event.target.files,\n file = _event$target$files[0];\n\n\n if (file) {\n imgUrl = URL.createObjectURL(file);\n this.actions.registCustomIcon(imgUrl, file);\n }\n }\n }]);\n\n return Icon;\n}(_submenuBase2.default);\n\nexports.default = Icon;\n\n//# sourceURL=webpack://tui.ImageEditor/./src/js/ui/icon.js?"); - -/***/ }), - -/***/ "./src/js/ui/locale/locale.js": -/*!************************************!*\ - !*** ./src/js/ui/locale/locale.js ***! - \************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; -eval("\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\n/**\n * Translate messages\n */\nvar Locale = function () {\n /**\n * @constructor\n * @param {Object} locale - Locale object for initialise\n */\n function Locale(locale) {\n _classCallCheck(this, Locale);\n\n this._locale = locale;\n }\n\n /**\n * localize message\n * @param {string} message - message who will be localized\n * @returns {string}\n */\n\n\n _createClass(Locale, [{\n key: \"localize\",\n value: function localize(message) {\n return this._locale[message] || message;\n }\n }]);\n\n return Locale;\n}();\n\nexports.default = Locale;\n\n//# sourceURL=webpack://tui.ImageEditor/./src/js/ui/locale/locale.js?"); - -/***/ }), - -/***/ "./src/js/ui/mask.js": -/*!***************************!*\ - !*** ./src/js/ui/mask.js ***! - \***************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; -eval("\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\nvar _submenuBase = __webpack_require__(/*! ./submenuBase */ \"./src/js/ui/submenuBase.js\");\n\nvar _submenuBase2 = _interopRequireDefault(_submenuBase);\n\nvar _util = __webpack_require__(/*! ../util */ \"./src/js/util.js\");\n\nvar _mask = __webpack_require__(/*! ./template/submenu/mask */ \"./src/js/ui/template/submenu/mask.js\");\n\nvar _mask2 = _interopRequireDefault(_mask);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return call && (typeof call === \"object\" || typeof call === \"function\") ? call : self; }\n\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function, not \" + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }\n\n/**\n * Mask ui class\n * @class\n * @ignore\n */\nvar Mask = function (_Submenu) {\n _inherits(Mask, _Submenu);\n\n function Mask(subMenuElement, _ref) {\n var locale = _ref.locale,\n makeSvgIcon = _ref.makeSvgIcon,\n menuBarPosition = _ref.menuBarPosition,\n usageStatistics = _ref.usageStatistics;\n\n _classCallCheck(this, Mask);\n\n var _this = _possibleConstructorReturn(this, (Mask.__proto__ || Object.getPrototypeOf(Mask)).call(this, subMenuElement, {\n locale: locale,\n name: 'mask',\n makeSvgIcon: makeSvgIcon,\n menuBarPosition: menuBarPosition,\n templateHtml: _mask2.default,\n usageStatistics: usageStatistics\n }));\n\n _this._els = {\n applyButton: _this.selector('.tie-mask-apply'),\n maskImageButton: _this.selector('.tie-mask-image-file')\n };\n return _this;\n }\n\n /**\n * Destroys the instance.\n */\n\n\n _createClass(Mask, [{\n key: 'destroy',\n value: function destroy() {\n this._removeEvent();\n\n (0, _util.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\n }, {\n key: 'addEvent',\n value: function addEvent(actions) {\n var loadMaskFile = this._loadMaskFile.bind(this);\n var applyMask = this._applyMask.bind(this);\n\n this.eventHandler = {\n loadMaskFile: loadMaskFile,\n applyMask: 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\n }, {\n key: '_removeEvent',\n value: function _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\n }, {\n key: '_applyMask',\n value: function _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\n }, {\n key: '_loadMaskFile',\n value: function _loadMaskFile(event) {\n var imgUrl = void 0;\n\n if (!(0, _util.isSupportFileApi)()) {\n alert('This browser does not support file-api');\n }\n\n var _event$target$files = event.target.files,\n file = _event$target$files[0];\n\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\n return Mask;\n}(_submenuBase2.default);\n\nexports.default = Mask;\n\n//# sourceURL=webpack://tui.ImageEditor/./src/js/ui/mask.js?"); - -/***/ }), - -/***/ "./src/js/ui/rotate.js": -/*!*****************************!*\ - !*** ./src/js/ui/rotate.js ***! - \*****************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; -eval("\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\nvar _range = __webpack_require__(/*! ./tools/range */ \"./src/js/ui/tools/range.js\");\n\nvar _range2 = _interopRequireDefault(_range);\n\nvar _submenuBase = __webpack_require__(/*! ./submenuBase */ \"./src/js/ui/submenuBase.js\");\n\nvar _submenuBase2 = _interopRequireDefault(_submenuBase);\n\nvar _rotate = __webpack_require__(/*! ./template/submenu/rotate */ \"./src/js/ui/template/submenu/rotate.js\");\n\nvar _rotate2 = _interopRequireDefault(_rotate);\n\nvar _util = __webpack_require__(/*! ../util */ \"./src/js/util.js\");\n\nvar _consts = __webpack_require__(/*! ../consts */ \"./src/js/consts.js\");\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return call && (typeof call === \"object\" || typeof call === \"function\") ? call : self; }\n\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function, not \" + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }\n\nvar CLOCKWISE = 30;\nvar COUNTERCLOCKWISE = -30;\n\n/**\n * Rotate ui class\n * @class\n * @ignore\n */\n\nvar Rotate = function (_Submenu) {\n _inherits(Rotate, _Submenu);\n\n function Rotate(subMenuElement, _ref) {\n var locale = _ref.locale,\n makeSvgIcon = _ref.makeSvgIcon,\n menuBarPosition = _ref.menuBarPosition,\n usageStatistics = _ref.usageStatistics;\n\n _classCallCheck(this, Rotate);\n\n var _this = _possibleConstructorReturn(this, (Rotate.__proto__ || Object.getPrototypeOf(Rotate)).call(this, subMenuElement, {\n locale: locale,\n name: 'rotate',\n makeSvgIcon: makeSvgIcon,\n menuBarPosition: menuBarPosition,\n templateHtml: _rotate2.default,\n usageStatistics: usageStatistics\n }));\n\n _this._value = 0;\n\n _this._els = {\n rotateButton: _this.selector('.tie-retate-button'),\n rotateRange: new _range2.default({\n slider: _this.selector('.tie-rotate-range'),\n input: _this.selector('.tie-ratate-range-value')\n }, _consts.defaultRotateRangeValus)\n };\n return _this;\n }\n\n /**\n * Destroys the instance.\n */\n\n\n _createClass(Rotate, [{\n key: 'destroy',\n value: function destroy() {\n this._removeEvent();\n this._els.rotateRange.destroy();\n\n (0, _util.assignmentForDestroy)(this);\n }\n }, {\n key: 'setRangeBarAngle',\n value: function setRangeBarAngle(type, angle) {\n var 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 key: '_setRangeBarRatio',\n value: function _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\n }, {\n key: 'addEvent',\n value: function 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\n }, {\n key: '_removeEvent',\n value: function _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\n }, {\n key: '_changeRotateForRange',\n value: function _changeRotateForRange(value, isLast) {\n var angle = (0, _util.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\n }, {\n key: '_changeRotateForButton',\n value: function _changeRotateForButton(event) {\n var button = event.target.closest('.tui-image-editor-button');\n var angle = this._els.rotateRange.value;\n\n if (button) {\n var rotateType = this.getButtonType(button, ['counterclockwise', 'clockwise']);\n var rotateAngle = {\n clockwise: CLOCKWISE,\n counterclockwise: COUNTERCLOCKWISE\n }[rotateType];\n var newAngle = parseInt(angle, 10) + rotateAngle;\n var isRotatable = newAngle >= -360 && newAngle <= 360;\n if (isRotatable) {\n this.actions.rotate(rotateAngle);\n }\n }\n }\n }]);\n\n return Rotate;\n}(_submenuBase2.default);\n\nexports.default = Rotate;\n\n//# sourceURL=webpack://tui.ImageEditor/./src/js/ui/rotate.js?"); - -/***/ }), - -/***/ "./src/js/ui/shape.js": -/*!****************************!*\ - !*** ./src/js/ui/shape.js ***! - \****************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; -eval("\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\nvar _colorpicker = __webpack_require__(/*! ./tools/colorpicker */ \"./src/js/ui/tools/colorpicker.js\");\n\nvar _colorpicker2 = _interopRequireDefault(_colorpicker);\n\nvar _range = __webpack_require__(/*! ./tools/range */ \"./src/js/ui/tools/range.js\");\n\nvar _range2 = _interopRequireDefault(_range);\n\nvar _submenuBase = __webpack_require__(/*! ./submenuBase */ \"./src/js/ui/submenuBase.js\");\n\nvar _submenuBase2 = _interopRequireDefault(_submenuBase);\n\nvar _shape = __webpack_require__(/*! ./template/submenu/shape */ \"./src/js/ui/template/submenu/shape.js\");\n\nvar _shape2 = _interopRequireDefault(_shape);\n\nvar _util = __webpack_require__(/*! ../util */ \"./src/js/util.js\");\n\nvar _consts = __webpack_require__(/*! ../consts */ \"./src/js/consts.js\");\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return call && (typeof call === \"object\" || typeof call === \"function\") ? call : self; }\n\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function, not \" + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }\n\nvar SHAPE_DEFAULT_OPTION = {\n stroke: '#ffbb3b',\n fill: '',\n strokeWidth: 3\n};\n\n/**\n * Shape ui class\n * @class\n * @ignore\n */\n\nvar Shape = function (_Submenu) {\n _inherits(Shape, _Submenu);\n\n function Shape(subMenuElement, _ref) {\n var locale = _ref.locale,\n makeSvgIcon = _ref.makeSvgIcon,\n menuBarPosition = _ref.menuBarPosition,\n usageStatistics = _ref.usageStatistics;\n\n _classCallCheck(this, Shape);\n\n var _this = _possibleConstructorReturn(this, (Shape.__proto__ || Object.getPrototypeOf(Shape)).call(this, subMenuElement, {\n locale: locale,\n name: 'shape',\n makeSvgIcon: makeSvgIcon,\n menuBarPosition: menuBarPosition,\n templateHtml: _shape2.default,\n usageStatistics: usageStatistics\n }));\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 _range2.default({\n slider: _this.selector('.tie-stroke-range'),\n input: _this.selector('.tie-stroke-range-value')\n }, _consts.defaultShapeStrokeValus),\n fillColorpicker: new _colorpicker2.default(_this.selector('.tie-color-fill'), '', _this.toggleDirection, _this.usageStatistics),\n strokeColorpicker: new _colorpicker2.default(_this.selector('.tie-color-stroke'), '#ffbb3b', _this.toggleDirection, _this.usageStatistics)\n };\n\n _this.colorPickerControls.push(_this._els.fillColorpicker);\n _this.colorPickerControls.push(_this._els.strokeColorpicker);\n return _this;\n }\n\n /**\n * Destroys the instance.\n */\n\n\n _createClass(Shape, [{\n key: 'destroy',\n value: function destroy() {\n this._removeEvent();\n this._els.strokeRange.destroy();\n this._els.fillColorpicker.destroy();\n this._els.strokeColorpicker.destroy();\n\n (0, _util.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 dreawing shape\n */\n\n }, {\n key: 'addEvent',\n value: function 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\n }, {\n key: '_removeEvent',\n value: function _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\n }, {\n key: 'setShapeStatus',\n value: function setShapeStatus(_ref2) {\n var strokeWidth = _ref2.strokeWidth,\n strokeColor = _ref2.strokeColor,\n fillColor = _ref2.fillColor;\n\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: strokeWidth });\n }\n\n /**\n * Executed when the menu starts.\n */\n\n }, {\n key: 'changeStartMode',\n value: function changeStartMode() {\n this.actions.stopDrawingMode();\n }\n\n /**\n * Returns the menu to its default state.\n */\n\n }, {\n key: 'changeStandbyMode',\n value: function 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\n }, {\n key: 'setMaxStrokeValue',\n value: function setMaxStrokeValue(maxValue) {\n var strokeMaxValue = maxValue;\n if (strokeMaxValue <= 0) {\n strokeMaxValue = _consts.defaultShapeStrokeValus.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\n }, {\n key: 'setStrokeValue',\n value: function 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\n }, {\n key: 'getStrokeValue',\n value: function 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\n }, {\n key: '_changeShapeHandler',\n value: function _changeShapeHandler(event) {\n var button = event.target.closest('.tui-image-editor-button');\n if (button) {\n this.actions.stopDrawingMode();\n this.actions.discardSelection();\n var 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\n }, {\n key: '_changeStrokeRangeHandler',\n value: function _changeStrokeRangeHandler(value, isLast) {\n this.options.strokeWidth = (0, _util.toInteger)(value);\n this.actions.changeShape({\n strokeWidth: value\n }, !isLast);\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\n }, {\n key: '_changeFillColorHandler',\n value: function _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\n }, {\n key: '_changeStrokeColorHandler',\n value: function _changeStrokeColorHandler(color) {\n color = color || 'transparent';\n this.options.stroke = color;\n this.actions.changeShape({\n stroke: color\n });\n }\n }]);\n\n return Shape;\n}(_submenuBase2.default);\n\nexports.default = Shape;\n\n//# sourceURL=webpack://tui.ImageEditor/./src/js/ui/shape.js?"); - -/***/ }), - -/***/ "./src/js/ui/submenuBase.js": -/*!**********************************!*\ - !*** ./src/js/ui/submenuBase.js ***! - \**********************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; -eval("\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\n/**\n * Submenu Base Class\n * @class\n * @ignore\n */\nvar Submenu = function () {\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 function Submenu(subMenuElement, _ref) {\n var locale = _ref.locale,\n name = _ref.name,\n makeSvgIcon = _ref.makeSvgIcon,\n menuBarPosition = _ref.menuBarPosition,\n templateHtml = _ref.templateHtml,\n usageStatistics = _ref.usageStatistics;\n\n _classCallCheck(this, Submenu);\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: locale,\n name: name,\n makeSvgIcon: makeSvgIcon,\n templateHtml: templateHtml\n });\n }\n\n /**\n * editor dom ui query selector\n * @param {string} selectName - query selector string name\n * @returns {HTMLElement}\n */\n\n\n _createClass(Submenu, [{\n key: 'selector',\n value: function 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\n }, {\n key: 'colorPickerChangeShow',\n value: function colorPickerChangeShow(occurredControl) {\n this.colorPickerControls.forEach(function (pickerControl) {\n if (occurredControl !== pickerControl) {\n pickerControl.hide();\n }\n });\n }\n\n /**\n * Get butten type\n * @param {HTMLElement} button - event target element\n * @param {array} buttonNames - Array of button names\n * @returns {string} - button type\n */\n\n }, {\n key: 'getButtonType',\n value: function getButtonType(button, buttonNames) {\n return button.className.match(RegExp('(' + buttonNames.join('|') + ')'))[0];\n }\n\n /**\n * Get butten type\n * @param {HTMLElement} target - event target element\n * @param {string} removeClass - remove class name\n * @param {string} addClass - add class name\n */\n\n }, {\n key: 'changeClass',\n value: function 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\n }, {\n key: 'changeStandbyMode',\n value: function changeStandbyMode() {}\n\n /**\n * Interface method whose implementation is optional.\n * Executed when the menu starts.\n */\n\n }, {\n key: 'changeStartMode',\n value: function 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\n }, {\n key: '_makeSubMenuElement',\n value: function _makeSubMenuElement(_ref2) {\n var locale = _ref2.locale,\n name = _ref2.name,\n iconStyle = _ref2.iconStyle,\n makeSvgIcon = _ref2.makeSvgIcon,\n templateHtml = _ref2.templateHtml;\n\n var iconSubMenu = document.createElement('div');\n iconSubMenu.className = 'tui-image-editor-menu-' + name;\n iconSubMenu.innerHTML = templateHtml({\n locale: locale,\n iconStyle: iconStyle,\n makeSvgIcon: makeSvgIcon\n });\n\n this.subMenuElement.appendChild(iconSubMenu);\n }\n }]);\n\n return Submenu;\n}();\n\nexports.default = Submenu;\n\n//# sourceURL=webpack://tui.ImageEditor/./src/js/ui/submenuBase.js?"); - -/***/ }), - -/***/ "./src/js/ui/template/controls.js": -/*!****************************************!*\ - !*** ./src/js/ui/template/controls.js ***! - \****************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; -eval("\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nexports.default = function (_ref) {\n var locale = _ref.locale,\n biImage = _ref.biImage,\n loadButtonStyle = _ref.loadButtonStyle,\n downloadButtonStyle = _ref.downloadButtonStyle;\n return '\\n
                          \\n
                          \\n \\n
                          \\n
                            \\n\\n
                            \\n
                            \\n ' + locale.localize('Load') + '\\n \\n
                            \\n \\n
                            \\n
                            \\n';\n};\n\n//# sourceURL=webpack://tui.ImageEditor/./src/js/ui/template/controls.js?"); - -/***/ }), - -/***/ "./src/js/ui/template/mainContainer.js": -/*!*********************************************!*\ - !*** ./src/js/ui/template/mainContainer.js ***! - \*********************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; -eval("\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nexports.default = function (_ref) {\n var locale = _ref.locale,\n biImage = _ref.biImage,\n commonStyle = _ref.commonStyle,\n headerStyle = _ref.headerStyle,\n loadButtonStyle = _ref.loadButtonStyle,\n downloadButtonStyle = _ref.downloadButtonStyle,\n submenuStyle = _ref.submenuStyle;\n return '\\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};\n\n//# sourceURL=webpack://tui.ImageEditor/./src/js/ui/template/mainContainer.js?"); - -/***/ }), - -/***/ "./src/js/ui/template/style.js": -/*!*************************************!*\ - !*** ./src/js/ui/template/style.js ***! - \*************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; -eval("\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nexports.default = function (_ref) {\n var subMenuLabelActive = _ref.subMenuLabelActive,\n subMenuLabelNormal = _ref.subMenuLabelNormal,\n subMenuRangeTitle = _ref.subMenuRangeTitle,\n submenuPartitionVertical = _ref.submenuPartitionVertical,\n submenuPartitionHorizontal = _ref.submenuPartitionHorizontal,\n submenuCheckbox = _ref.submenuCheckbox,\n submenuRangePointer = _ref.submenuRangePointer,\n submenuRangeValue = _ref.submenuRangeValue,\n submenuColorpickerTitle = _ref.submenuColorpickerTitle,\n submenuColorpickerButton = _ref.submenuColorpickerButton,\n submenuRangeBar = _ref.submenuRangeBar,\n submenuRangeSubbar = _ref.submenuRangeSubbar,\n submenuDisabledRangePointer = _ref.submenuDisabledRangePointer,\n submenuDisabledRangeBar = _ref.submenuDisabledRangeBar,\n submenuDisabledRangeSubbar = _ref.submenuDisabledRangeSubbar,\n submenuIconSize = _ref.submenuIconSize,\n menuIconSize = _ref.menuIconSize,\n biSize = _ref.biSize,\n menuIconStyle = _ref.menuIconStyle,\n submenuIconStyle = _ref.submenuIconStyle;\n 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 \" + 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 fill-rule: evenodd;\\n fill: \" + menuIconStyle.normal.color + \";\\n stroke: \" + menuIconStyle.normal.color + \";\\n }\\n .tui-image-editor-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 fill-rule: evenodd;\\n fill: \" + menuIconStyle.hover.color + \";\\n stroke: \" + menuIconStyle.hover.color + \";\\n }\\n .tui-image-editor-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\n//# sourceURL=webpack://tui.ImageEditor/./src/js/ui/template/style.js?"); - -/***/ }), - -/***/ "./src/js/ui/template/submenu/crop.js": -/*!********************************************!*\ - !*** ./src/js/ui/template/submenu/crop.js ***! - \********************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; -eval("\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\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 */\nexports.default = function (_ref) {\n var locale = _ref.locale,\n makeSvgIcon = _ref.makeSvgIcon;\n return '\\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\n//# sourceURL=webpack://tui.ImageEditor/./src/js/ui/template/submenu/crop.js?"); - -/***/ }), - -/***/ "./src/js/ui/template/submenu/draw.js": -/*!********************************************!*\ - !*** ./src/js/ui/template/submenu/draw.js ***! - \********************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; -eval("\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\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 */\nexports.default = function (_ref) {\n var locale = _ref.locale,\n makeSvgIcon = _ref.makeSvgIcon;\n return '\\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\n//# sourceURL=webpack://tui.ImageEditor/./src/js/ui/template/submenu/draw.js?"); - -/***/ }), - -/***/ "./src/js/ui/template/submenu/filter.js": -/*!**********************************************!*\ - !*** ./src/js/ui/template/submenu/filter.js ***! - \**********************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; -eval("\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\n/**\n * @param {Locale} locale - Translate text\n * @returns {string}\n */\nexports.default = function (_ref) {\n var locale = _ref.locale;\n return '\\n
                              \\n
                            • \\n
                              \\n
                              \\n \\n
                              \\n
                              \\n \\n
                              \\n
                              \\n \\n
                              \\n
                              \\n \\n
                              \\n
                              \\n \\n
                              \\n
                              \\n \\n
                              \\n
                              \\n \\n
                              \\n
                              \\n
                            • \\n
                            • \\n
                              \\n
                            • \\n
                            • \\n
                              \\n
                              \\n
                              \\n \\n
                              \\n
                              \\n
                              \\n \\n
                              \\n
                              \\n
                              \\n
                              \\n
                              \\n \\n
                              \\n
                              \\n
                              \\n
                              \\n
                              \\n
                              \\n
                              \\n \\n
                              \\n
                              \\n
                              \\n
                              \\n
                              \\n
                            • \\n
                            • \\n
                              \\n
                            • \\n
                            • \\n
                              \\n
                              \\n \\n
                              \\n
                              \\n
                              \\n
                              \\n
                              \\n
                              \\n
                              \\n
                              \\n \\n
                              \\n
                              \\n
                              \\n \\n
                              \\n
                              \\n
                              \\n
                            • \\n
                            • \\n
                              \\n
                            • \\n
                            • \\n
                              \\n
                              \\n
                              \\n \\n
                              \\n
                              \\n
                              \\n
                              \\n
                              \\n \\n
                              \\n
                              \\n
                              \\n
                              \\n
                              \\n \\n
                              \\n
                              \\n
                            • \\n
                            \\n';\n};\n\n//# sourceURL=webpack://tui.ImageEditor/./src/js/ui/template/submenu/filter.js?"); - -/***/ }), - -/***/ "./src/js/ui/template/submenu/flip.js": -/*!********************************************!*\ - !*** ./src/js/ui/template/submenu/flip.js ***! - \********************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; -eval("\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\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 */\nexports.default = function (_ref) {\n var locale = _ref.locale,\n makeSvgIcon = _ref.makeSvgIcon;\n return '\\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\n//# sourceURL=webpack://tui.ImageEditor/./src/js/ui/template/submenu/flip.js?"); - -/***/ }), - -/***/ "./src/js/ui/template/submenu/icon.js": -/*!********************************************!*\ - !*** ./src/js/ui/template/submenu/icon.js ***! - \********************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; -eval("\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\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 */\nexports.default = function (_ref) {\n var locale = _ref.locale,\n makeSvgIcon = _ref.makeSvgIcon;\n return '\\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\n//# sourceURL=webpack://tui.ImageEditor/./src/js/ui/template/submenu/icon.js?"); - -/***/ }), - -/***/ "./src/js/ui/template/submenu/mask.js": -/*!********************************************!*\ - !*** ./src/js/ui/template/submenu/mask.js ***! - \********************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; -eval("\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\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 */\nexports.default = function (_ref) {\n var locale = _ref.locale,\n makeSvgIcon = _ref.makeSvgIcon;\n return '\\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\n//# sourceURL=webpack://tui.ImageEditor/./src/js/ui/template/submenu/mask.js?"); - -/***/ }), - -/***/ "./src/js/ui/template/submenu/rotate.js": -/*!**********************************************!*\ - !*** ./src/js/ui/template/submenu/rotate.js ***! - \**********************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; -eval("\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\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 */\nexports.default = function (_ref) {\n var locale = _ref.locale,\n makeSvgIcon = _ref.makeSvgIcon;\n return '\\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\n//# sourceURL=webpack://tui.ImageEditor/./src/js/ui/template/submenu/rotate.js?"); - -/***/ }), - -/***/ "./src/js/ui/template/submenu/shape.js": -/*!*********************************************!*\ - !*** ./src/js/ui/template/submenu/shape.js ***! - \*********************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; -eval("\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\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 */\nexports.default = function (_ref) {\n var locale = _ref.locale,\n makeSvgIcon = _ref.makeSvgIcon;\n return '\\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\n//# sourceURL=webpack://tui.ImageEditor/./src/js/ui/template/submenu/shape.js?"); - -/***/ }), - -/***/ "./src/js/ui/template/submenu/text.js": -/*!********************************************!*\ - !*** ./src/js/ui/template/submenu/text.js ***! - \********************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; -eval("\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\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 */\nexports.default = function (_ref) {\n var locale = _ref.locale,\n makeSvgIcon = _ref.makeSvgIcon;\n return '\\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};\n\n//# sourceURL=webpack://tui.ImageEditor/./src/js/ui/template/submenu/text.js?"); - -/***/ }), - -/***/ "./src/js/ui/text.js": -/*!***************************!*\ - !*** ./src/js/ui/text.js ***! - \***************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; -eval("\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\nvar _util = __webpack_require__(/*! ../util */ \"./src/js/util.js\");\n\nvar _range = __webpack_require__(/*! ./tools/range */ \"./src/js/ui/tools/range.js\");\n\nvar _range2 = _interopRequireDefault(_range);\n\nvar _colorpicker = __webpack_require__(/*! ./tools/colorpicker */ \"./src/js/ui/tools/colorpicker.js\");\n\nvar _colorpicker2 = _interopRequireDefault(_colorpicker);\n\nvar _submenuBase = __webpack_require__(/*! ./submenuBase */ \"./src/js/ui/submenuBase.js\");\n\nvar _submenuBase2 = _interopRequireDefault(_submenuBase);\n\nvar _text = __webpack_require__(/*! ./template/submenu/text */ \"./src/js/ui/template/submenu/text.js\");\n\nvar _text2 = _interopRequireDefault(_text);\n\nvar _consts = __webpack_require__(/*! ../consts */ \"./src/js/consts.js\");\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return call && (typeof call === \"object\" || typeof call === \"function\") ? call : self; }\n\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function, not \" + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }\n\n/**\n * Crop ui class\n * @class\n * @ignore\n */\nvar Text = function (_Submenu) {\n _inherits(Text, _Submenu);\n\n function Text(subMenuElement, _ref) {\n var locale = _ref.locale,\n makeSvgIcon = _ref.makeSvgIcon,\n menuBarPosition = _ref.menuBarPosition,\n usageStatistics = _ref.usageStatistics;\n\n _classCallCheck(this, Text);\n\n var _this = _possibleConstructorReturn(this, (Text.__proto__ || Object.getPrototypeOf(Text)).call(this, subMenuElement, {\n locale: locale,\n name: 'text',\n makeSvgIcon: makeSvgIcon,\n menuBarPosition: menuBarPosition,\n templateHtml: _text2.default,\n usageStatistics: usageStatistics\n }));\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 _colorpicker2.default(_this.selector('.tie-text-color'), '#ffbb3b', _this.toggleDirection, _this.usageStatistics),\n textRange: new _range2.default({\n slider: _this.selector('.tie-text-range'),\n input: _this.selector('.tie-text-range-value')\n }, _consts.defaultTextRangeValus)\n };\n return _this;\n }\n\n /**\n * Destroys the instance.\n */\n\n\n _createClass(Text, [{\n key: 'destroy',\n value: function destroy() {\n this._removeEvent();\n this._els.textColorpicker.destroy();\n this._els.textRange.destroy();\n\n (0, _util.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\n }, {\n key: 'addEvent',\n value: function addEvent(actions) {\n var setTextEffect = this._setTextEffectHandler.bind(this);\n var setTextAlign = this._setTextAlignHandler.bind(this);\n\n this.eventHandler = {\n setTextEffect: setTextEffect,\n setTextAlign: 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\n }, {\n key: '_removeEvent',\n value: function _removeEvent() {\n var _eventHandler = this.eventHandler,\n setTextEffect = _eventHandler.setTextEffect,\n setTextAlign = _eventHandler.setTextAlign;\n\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\n }, {\n key: 'changeStandbyMode',\n value: function changeStandbyMode() {\n this.actions.stopDrawingMode();\n }\n\n /**\n * Executed when the menu starts.\n */\n\n }, {\n key: 'changeStartMode',\n value: function changeStartMode() {\n this.actions.modeChange('text');\n }\n }, {\n key: 'setTextStyleStateOnAction',\n value: function setTextStyleStateOnAction() {\n var textStyle = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};\n var fill = textStyle.fill,\n fontSize = textStyle.fontSize,\n fontStyle = textStyle.fontStyle,\n fontWeight = textStyle.fontWeight,\n textDecoration = textStyle.textDecoration,\n textAlign = textStyle.textAlign;\n\n\n this.textColor = fill;\n this.fontSize = fontSize;\n this.setEffactState('italic', fontStyle);\n this.setEffactState('bold', fontWeight);\n this.setEffactState('underline', textDecoration);\n this.setAlignState(textAlign);\n }\n }, {\n key: 'setEffactState',\n value: function setEffactState(effactName, value) {\n var effactValue = value === 'italic' || value === 'bold' || value === 'underline';\n var button = this._els.textEffectButton.querySelector('.tui-image-editor-button.' + effactName);\n\n this.effect[effactName] = effactValue;\n\n button.classList[effactValue ? 'add' : 'remove']('active');\n }\n }, {\n key: 'setAlignState',\n value: function setAlignState(value) {\n var 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\n }, {\n key: '_setTextEffectHandler',\n value: function _setTextEffectHandler(event) {\n var button = event.target.closest('.tui-image-editor-button');\n\n var _button$className$mat = button.className.match(/(bold|italic|underline)/),\n styleType = _button$className$mat[0];\n\n var 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 * text effect set handler\n * @param {object} event - add button event object\n * @private\n */\n\n }, {\n key: '_setTextAlignHandler',\n value: function _setTextAlignHandler(event) {\n var button = event.target.closest('.tui-image-editor-button');\n if (button) {\n var 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\n }, {\n key: '_changeTextRnageHandler',\n value: function _changeTextRnageHandler(value, isLast) {\n this.actions.changeTextStyle({\n fontSize: value\n }, !isLast);\n }\n\n /**\n * change color handler\n * @param {string} color - change color string\n * @private\n */\n\n }, {\n key: '_changeColorHandler',\n value: function _changeColorHandler(color) {\n color = color || 'transparent';\n this.actions.changeTextStyle({\n fill: color\n });\n }\n }, {\n key: 'textColor',\n set: function set(color) {\n this._els.textColorpicker.color = color;\n }\n\n /**\n * Get text color\n * @returns {string} - text color\n */\n ,\n get: function get() {\n return this._els.textColorpicker.color;\n }\n\n /**\n * Get text size\n * @returns {string} - text size\n */\n\n }, {\n key: 'fontSize',\n get: function get() {\n return this._els.textRange.value;\n }\n\n /**\n * Set text size\n * @param {Number} value - text size\n */\n ,\n set: function set(value) {\n this._els.textRange.value = value;\n }\n\n /**\n * get font style\n * @returns {string} - font style\n */\n\n }, {\n key: 'fontStyle',\n get: function get() {\n return this.effect.italic ? 'italic' : 'normal';\n }\n\n /**\n * get font weight\n * @returns {string} - font weight\n */\n\n }, {\n key: 'fontWeight',\n get: function get() {\n return this.effect.bold ? 'bold' : 'normal';\n }\n\n /**\n * get text underline text underline\n * @returns {boolean} - true or false\n */\n\n }, {\n key: 'underline',\n get: function get() {\n return this.effect.underline;\n }\n }]);\n\n return Text;\n}(_submenuBase2.default);\n\nexports.default = Text;\n\n//# sourceURL=webpack://tui.ImageEditor/./src/js/ui/text.js?"); - -/***/ }), - -/***/ "./src/js/ui/theme/standard.js": -/*!*************************************!*\ - !*** ./src/js/ui/theme/standard.js ***! - \*************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; -eval("\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n/**\n * @fileoverview The standard theme\n * @author NHN Ent. FE Development Team \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 */\nexports.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\n//# sourceURL=webpack://tui.ImageEditor/./src/js/ui/theme/standard.js?"); - -/***/ }), - -/***/ "./src/js/ui/theme/theme.js": -/*!**********************************!*\ - !*** ./src/js/ui/theme/theme.js ***! - \**********************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; -eval("\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\nvar _tuiCodeSnippet = __webpack_require__(/*! tui-code-snippet */ \"tui-code-snippet\");\n\nvar _util = __webpack_require__(/*! ../../util */ \"./src/js/util.js\");\n\nvar _style = __webpack_require__(/*! ../template/style */ \"./src/js/ui/template/style.js\");\n\nvar _style2 = _interopRequireDefault(_style);\n\nvar _standard = __webpack_require__(/*! ./standard */ \"./src/js/ui/theme/standard.js\");\n\nvar _standard2 = _interopRequireDefault(_standard);\n\nvar _default = __webpack_require__(/*! ../../../svg/default.svg */ \"./src/svg/default.svg\");\n\nvar _default2 = _interopRequireDefault(_default);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\n/**\n * Theme manager\n * @class\n * @param {Object} customTheme - custom theme\n * @ignore\n */\nvar Theme = function () {\n function Theme(customTheme) {\n _classCallCheck(this, Theme);\n\n this.styles = this._changeToObject((0, _tuiCodeSnippet.extend)({}, _standard2.default, customTheme));\n (0, _util.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\n\n _createClass(Theme, [{\n key: 'getStyle',\n value: function getStyle(type) {\n var result = null;\n var firstProperty = type.replace(/\\..+$/, '');\n var 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((0, _tuiCodeSnippet.extend)({}, option, { borderLeft: '1px solid ' + option.color })),\n horizontal: this._makeCssText((0, _tuiCodeSnippet.extend)({}, option, { borderBottom: '1px solid ' + option.color }))\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\n }, {\n key: '_styleMaker',\n value: function _styleMaker() {\n var submenuLabelStyle = this.getStyle('submenu.label');\n var submenuPartitionStyle = this.getStyle('submenu.partition');\n\n return (0, _style2.default)({\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\n }, {\n key: '_changeToObject',\n value: function _changeToObject(styleOptions) {\n var styleObject = {};\n (0, _tuiCodeSnippet.forEach)(styleOptions, function (value, key) {\n var keyExplode = key.match(/^(.+)\\.([a-z]+)$/i);\n var property = keyExplode[1],\n subProperty = keyExplode[2];\n\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\n }, {\n key: '_makeCssText',\n value: function _makeCssText(styleObject) {\n var _this = this;\n\n var converterStack = [];\n\n (0, _tuiCodeSnippet.forEach)(styleObject, function (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\n }, {\n key: '_toUnderScore',\n value: function _toUnderScore(targetString) {\n return targetString.replace(/([A-Z])/g, function ($0, $1) {\n return '-' + $1.toLowerCase();\n });\n }\n\n /**\n * Load defulat svg icon\n * @private\n */\n\n }, {\n key: '_loadDefaultSvgIcon',\n value: function _loadDefaultSvgIcon() {\n if (!document.getElementById('tui-image-editor-svg-default-icons')) {\n var parser = new DOMParser();\n var dom = parser.parseFromString(_default2.default, '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\n }, {\n key: '_makeIconClassName',\n value: function _makeIconClassName(iconType, isSubmenu) {\n var iconStyleInfo = isSubmenu ? this.getStyle('submenu.icon') : this.getStyle('menu.icon');\n var _iconStyleInfo$iconTy = iconStyleInfo[iconType],\n path = _iconStyleInfo$iconTy.path,\n name = _iconStyleInfo$iconTy.name;\n\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\n }, {\n key: '_makeSvgIconPrefix',\n value: function _makeSvgIconPrefix(iconType, isSubmenu) {\n var iconStyleInfo = isSubmenu ? this.getStyle('submenu.icon') : this.getStyle('menu.icon');\n var _iconStyleInfo$iconTy2 = iconStyleInfo[iconType],\n path = _iconStyleInfo$iconTy2.path,\n name = _iconStyleInfo$iconTy2.name;\n\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\n }, {\n key: '_makeSvgItem',\n value: function _makeSvgItem(useIconTypes, menuName, isSubmenu) {\n var _this2 = this;\n\n return (0, _tuiCodeSnippet.map)(useIconTypes, function (iconType) {\n var svgIconPrefix = _this2._makeSvgIconPrefix(iconType, isSubmenu);\n var iconName = _this2._toUnderScore(menuName);\n var svgIconClassName = _this2._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\n }, {\n key: 'makeMenSvgIconSet',\n value: function makeMenSvgIconSet(useIconTypes, menuName) {\n var isSubmenu = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;\n\n return '' + this._makeSvgItem(useIconTypes, menuName, isSubmenu) + '';\n }\n }]);\n\n return Theme;\n}();\n\nexports.default = Theme;\n\n//# sourceURL=webpack://tui.ImageEditor/./src/js/ui/theme/theme.js?"); - -/***/ }), - -/***/ "./src/js/ui/tools/colorpicker.js": -/*!****************************************!*\ - !*** ./src/js/ui/tools/colorpicker.js ***! - \****************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; -eval("\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\nvar _tuiCodeSnippet = __webpack_require__(/*! tui-code-snippet */ \"tui-code-snippet\");\n\nvar _tuiCodeSnippet2 = _interopRequireDefault(_tuiCodeSnippet);\n\nvar _tuiColorPicker = __webpack_require__(/*! tui-color-picker */ \"tui-color-picker\");\n\nvar _tuiColorPicker2 = _interopRequireDefault(_tuiColorPicker);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nvar PICKER_COLOR = ['#000000', '#2a2a2a', '#545454', '#7e7e7e', '#a8a8a8', '#d2d2d2', '#ffffff', '', '#ff4040', '#ff6518', '#ffbb3b', '#03bd9e', '#00a9ff', '#515ce6', '#9e5fff', '#ff5583'];\n\n/**\n * Colorpicker control class\n * @class\n * @ignore\n */\n\nvar Colorpicker = function () {\n function Colorpicker(colorpickerElement) {\n var defaultColor = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : '#7e7e7e';\n var toggleDirection = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 'up';\n var usageStatistics = arguments[3];\n\n _classCallCheck(this, Colorpicker);\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 = _tuiColorPicker2.default.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\n\n _createClass(Colorpicker, [{\n key: 'destroy',\n value: function destroy() {\n var _this = this;\n\n this._removeEvent();\n this.picker.destroy();\n this.colorpickerElement.innerHTML = '';\n _tuiCodeSnippet2.default.forEach(this, function (value, key) {\n _this[key] = null;\n });\n }\n\n /**\n * Get color\n * @returns {Number} color value\n */\n\n }, {\n key: '_changeColorElement',\n\n\n /**\n * Change color element\n * @param {string} color color value\n * #private\n */\n value: function _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\n }, {\n key: '_makePickerButtonElement',\n value: function _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\n }, {\n key: '_makePickerLayerElement',\n value: function _makePickerLayerElement(colorpickerElement, title) {\n var label = document.createElement('label');\n var 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\n }, {\n key: '_addEvent',\n value: function _addEvent() {\n var _this2 = this;\n\n this.picker.on('selectColor', function (value) {\n _this2._changeColorElement(value.color);\n _this2._color = value.color;\n _this2.fire('change', value.color);\n });\n\n this.eventHandler = {\n pickerToggle: this._pickerToggleEventHandler.bind(this),\n pickerHide: function pickerHide() {\n return _this2.hide();\n }\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\n }, {\n key: '_removeEvent',\n value: function _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\n }, {\n key: '_pickerToggleEventHandler',\n value: function _pickerToggleEventHandler(event) {\n var target = event.target;\n\n var 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\n }, {\n key: '_isPaletteButton',\n value: function _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\n }, {\n key: '_isElementInColorPickerControl',\n value: function _isElementInColorPickerControl(element) {\n var 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 key: 'hide',\n value: function hide() {\n this._show = false;\n this.pickerControl.style.display = 'none';\n }\n\n /**\n * Set picker control position\n * @private\n */\n\n }, {\n key: '_setPickerControlPosition',\n value: function _setPickerControlPosition() {\n var controlStyle = this.pickerControl.style;\n var halfPickerWidth = this._colorpickerElement.clientWidth / 2 + 2;\n var left = this.pickerControl.offsetWidth / 2 - halfPickerWidth;\n var 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 key: 'color',\n get: function get() {\n return this._color;\n }\n\n /**\n * Set color\n * @param {string} color color value\n */\n ,\n set: function set(color) {\n this._color = color;\n this._changeColorElement(color);\n }\n }]);\n\n return Colorpicker;\n}();\n\n_tuiCodeSnippet2.default.CustomEvents.mixin(Colorpicker);\nexports.default = Colorpicker;\n\n//# sourceURL=webpack://tui.ImageEditor/./src/js/ui/tools/colorpicker.js?"); - -/***/ }), - -/***/ "./src/js/ui/tools/range.js": -/*!**********************************!*\ - !*** ./src/js/ui/tools/range.js ***! - \**********************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; -eval("\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\nvar _tuiCodeSnippet = __webpack_require__(/*! tui-code-snippet */ \"tui-code-snippet\");\n\nvar _tuiCodeSnippet2 = _interopRequireDefault(_tuiCodeSnippet);\n\nvar _util = __webpack_require__(/*! ../../util */ \"./src/js/util.js\");\n\nvar _consts = __webpack_require__(/*! ../../consts */ \"./src/js/consts.js\");\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nvar INPUT_FILTER_REGEXP = /(-?)([0-9]*)[^0-9]*([0-9]*)/g;\n\n/**\n * Range control class\n * @class\n * @ignore\n */\n\nvar Range = function () {\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 {number} [options.realTimeEvent] - Reflect live events.\n */\n function Range(rangeElements) {\n var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};\n\n _classCallCheck(this, Range);\n\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\n\n _createClass(Range, [{\n key: 'destroy',\n value: function destroy() {\n var _this = this;\n\n this._removeClickEvent();\n this._removeDragEvent();\n this._removeInputEvent();\n this.rangeElement.innerHTML = '';\n _tuiCodeSnippet2.default.forEach(this, function (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\n }, {\n key: 'trigger',\n\n\n /**\n * event tirigger\n * @param {string} type - type\n */\n value: function trigger(type) {\n this.fire(type, this._value);\n }\n\n /**\n * Calculate slider width\n * @returns {number} - slider width\n */\n\n }, {\n key: '_getRangeWidth',\n value: function _getRangeWidth() {\n var getElementWidth = function getElementWidth(element) {\n return (0, _util.toInteger)(window.getComputedStyle(element, null).width);\n };\n\n return getElementWidth(this.rangeElement) - getElementWidth(this.pointer);\n }\n\n /**\n * Make range element\n * @private\n */\n\n }, {\n key: '_drawRangeElement',\n value: function _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\n }, {\n key: '_addInputEvent',\n value: function _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\n }, {\n key: '_removeInputEvent',\n value: function _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\n }, {\n key: '_changeValueWithInputKeyEvent',\n value: function _changeValueWithInputKeyEvent(event) {\n var keyCode = event.keyCode,\n target = event.target;\n\n\n if ([_consts.keyCodes.ARROW_UP, _consts.keyCodes.ARROW_DOWN].indexOf(keyCode) < 0) {\n return;\n }\n\n var value = Number(target.value);\n\n value = this._valueUpDownForKeyEvent(value, keyCode);\n\n var unChanged = value < this._min || value > this._max;\n\n if (!unChanged) {\n var clampValue = (0, _util.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\n }, {\n key: '_valueUpDownForKeyEvent',\n value: function _valueUpDownForKeyEvent(value, keyCode) {\n var step = this._useDecimal ? 0.1 : 1;\n\n if (keyCode === _consts.keyCodes.ARROW_UP) {\n value += step;\n } else if (keyCode === _consts.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\n }, {\n key: '_changeValueWithInput',\n value: function _changeValueWithInput(isLast, event) {\n var keyCode = event.keyCode,\n target = event.target;\n\n\n if ([_consts.keyCodes.ARROW_UP, _consts.keyCodes.ARROW_DOWN].indexOf(keyCode) >= 0) {\n return;\n }\n\n var stringValue = this._filterForInputText(target.value);\n var waitForChange = !stringValue || isNaN(stringValue);\n target.value = stringValue;\n\n if (!waitForChange) {\n var value = this._useDecimal ? Number(stringValue) : (0, _util.toInteger)(stringValue);\n value = (0, _util.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\n }, {\n key: '_addClickEvent',\n value: function _addClickEvent() {\n this.rangeElement.addEventListener('click', this.eventHandler.changeSlideFinally);\n }\n\n /**\n * Remove Range click event\n * @private\n */\n\n }, {\n key: '_removeClickEvent',\n value: function _removeClickEvent() {\n this.rangeElement.removeEventListener('click', this.eventHandler.changeSlideFinally);\n }\n\n /**\n * Add Range drag event\n * @private\n */\n\n }, {\n key: '_addDragEvent',\n value: function _addDragEvent() {\n this.pointer.addEventListener('mousedown', this.eventHandler.startChangingSlide);\n }\n\n /**\n * Remove Range drag event\n * @private\n */\n\n }, {\n key: '_removeDragEvent',\n value: function _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\n }, {\n key: '_changeSlide',\n value: function _changeSlide(event) {\n var changePosition = event.screenX;\n var diffPosition = changePosition - this.firstPosition;\n var 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 var ratio = touchPx / this.rangeWidth;\n var resultValue = this._absMax * ratio + this._min;\n var value = this._useDecimal ? resultValue : (0, _util.toInteger)(resultValue);\n var 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 key: '_changeSlideFinally',\n value: function _changeSlideFinally(event) {\n event.stopPropagation();\n if (event.target.className !== 'tui-image-editor-range') {\n return;\n }\n var touchPx = event.offsetX;\n var ratio = touchPx / this.rangeWidth;\n var 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 key: '_startChangingSlide',\n value: function _startChangingSlide(event) {\n this.firstPosition = event.screenX;\n this.firstLeft = (0, _util.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\n }, {\n key: '_stopChangingSlide',\n value: function _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\n }, {\n key: '_filterForInputText',\n value: function _filterForInputText(inputValue) {\n return inputValue.replace(INPUT_FILTER_REGEXP, '$1$2$3');\n }\n }, {\n key: 'max',\n set: function set(maxValue) {\n this._max = maxValue;\n this._absMax = this._min * -1 + this._max;\n this.value = this._value;\n },\n get: function get() {\n return this._max;\n }\n\n /**\n * Get range value\n * @returns {Number} range value\n */\n\n }, {\n key: 'value',\n get: function get() {\n return this._value;\n }\n\n /**\n * Set range value\n * @param {Number} value range value\n * @param {Boolean} fire whether fire custom event or not\n */\n ,\n set: function set(value) {\n value = this._useDecimal ? value : (0, _util.toInteger)(value);\n\n var absValue = value - this._min;\n var 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 return Range;\n}();\n\n_tuiCodeSnippet2.default.CustomEvents.mixin(Range);\nexports.default = Range;\n\n//# sourceURL=webpack://tui.ImageEditor/./src/js/ui/tools/range.js?"); - -/***/ }), - -/***/ "./src/js/util.js": -/*!************************!*\ - !*** ./src/js/util.js ***! - \************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; -eval("\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.Promise = undefined;\nexports.clamp = clamp;\nexports.keyMirror = keyMirror;\nexports.makeStyleText = makeStyleText;\nexports.getProperties = getProperties;\nexports.toInteger = toInteger;\nexports.toCamelCase = toCamelCase;\nexports.isSupportFileApi = isSupportFileApi;\nexports.getRgb = getRgb;\nexports.sendHostName = sendHostName;\nexports.styleLoad = styleLoad;\nexports.getSelector = getSelector;\nexports.base64ToBlob = base64ToBlob;\nexports.fixFloatingPoint = fixFloatingPoint;\nexports.assignmentForDestroy = assignmentForDestroy;\nexports.cls = cls;\nexports.changeOrigin = changeOrigin;\nexports.flipObject = flipObject;\nexports.setCustomProperty = setCustomProperty;\nexports.getCustomProperty = getCustomProperty;\nexports.capitalizeString = capitalizeString;\nexports.includes = includes;\nexports.getFillTypeFromOption = getFillTypeFromOption;\nexports.getFillTypeFromObject = getFillTypeFromObject;\nexports.isShape = isShape;\n\nvar _tuiCodeSnippet = __webpack_require__(/*! tui-code-snippet */ \"tui-code-snippet\");\n\nvar _promise = __webpack_require__(/*! core-js-pure/features/promise */ \"./node_modules/core-js-pure/features/promise/index.js\");\n\nvar _promise2 = _interopRequireDefault(_promise);\n\nvar _consts = __webpack_require__(/*! ./consts */ \"./src/js/consts.js\");\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nvar FLOATING_POINT_DIGIT = 2; /**\n * @author NHN Ent. FE Development Team \n * @fileoverview Util\n */\n\nvar CSS_PREFIX = 'tui-image-editor-';\nvar min = Math.min,\n max = Math.max;\n\nvar hostnameSent = false;\n\n/**\n * Export Promise Class (for simplified module path)\n * @returns {Promise} promise class\n */\nexports.Promise = _promise2.default;\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 */\n\nfunction clamp(value, minValue, maxValue) {\n var temp = void 0;\n if (minValue > maxValue) {\n temp = minValue;\n minValue = maxValue;\n maxValue = temp;\n }\n\n return max(minValue, min(value, maxValue));\n}\n\n/**\n * Make key-value object from arguments\n * @returns {object.}\n */\nfunction keyMirror() {\n var obj = {};\n\n for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) {\n args[_key] = arguments[_key];\n }\n\n (0, _tuiCodeSnippet.forEach)(args, function (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 */\nfunction makeStyleText(styleObj) {\n var styleStr = '';\n\n (0, _tuiCodeSnippet.forEach)(styleObj, function (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 */\nfunction getProperties(obj, keys) {\n var props = {};\n var length = keys.length;\n\n var i = 0;\n var key = void 0;\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 */\nfunction 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 */\nfunction toCamelCase(targetString) {\n return targetString.replace(/-([a-z])/g, function ($0, $1) {\n return $1.toUpperCase();\n });\n}\n\n/**\n * Check browser file api support\n * @returns {boolean}\n * @private\n */\nfunction 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 */\nfunction getRgb(color, alpha) {\n if (color.length === 4) {\n color = '' + color + color.slice(1, 4);\n }\n var r = parseInt(color.slice(1, 3), 16);\n var g = parseInt(color.slice(3, 5), 16);\n var b = parseInt(color.slice(5, 7), 16);\n var a = alpha || 1;\n\n return 'rgba(' + r + ', ' + g + ', ' + b + ', ' + a + ')';\n}\n\n/**\n * send hostname\n */\nfunction sendHostName() {\n if (hostnameSent) {\n return;\n }\n hostnameSent = true;\n\n (0, _tuiCodeSnippet.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 */\nfunction styleLoad(styleBuffer, tagId) {\n var _document$getElements = document.getElementsByTagName('head'),\n head = _document$getElements[0];\n\n var linkElement = document.createElement('link');\n var 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 */\nfunction getSelector(targetElement) {\n return function (str) {\n return targetElement.querySelector(str);\n };\n}\n\n/**\n * Change base64 to blob\n * @param {String} data - base64 string data\n * @returns {Blob} Blob Data\n */\nfunction base64ToBlob(data) {\n var rImageType = /data:(image\\/.+);base64,/;\n var mimeString = '';\n var raw = void 0,\n uInt8Array = void 0,\n i = void 0;\n\n raw = data.replace(rImageType, function (header, imageType) {\n mimeString = imageType;\n\n return '';\n });\n\n raw = atob(raw);\n var 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 */\nfunction 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 */\nfunction assignmentForDestroy(targetObject) {\n (0, _tuiCodeSnippet.forEach)(targetObject, function (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 */\nfunction cls() {\n var str = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : '';\n var prefix = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : '';\n\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 */\nfunction changeOrigin(fObject, origin) {\n var originX = origin.originX,\n originY = origin.originY;\n\n var _fObject$getPointByOr = fObject.getPointByOrigin(originX, originY),\n left = _fObject$getPointByOr.x,\n top = _fObject$getPointByOr.y;\n\n fObject.set({\n left: left,\n top: top,\n originX: originX,\n originY: 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 */\nfunction flipObject(targetObject) {\n var result = {};\n\n Object.keys(targetObject).forEach(function (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 */\nfunction setCustomProperty(targetObject, props) {\n targetObject.customProps = targetObject.customProps || {};\n (0, _tuiCodeSnippet.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 */\nfunction getCustomProperty(fObject, propNames) {\n var resultObject = {};\n if ((0, _tuiCodeSnippet.isString)(propNames)) {\n propNames = [propNames];\n }\n (0, _tuiCodeSnippet.forEach)(propNames, function (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 */\nfunction 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 */\nfunction 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 */\nfunction getFillTypeFromOption() {\n var fillOption = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};\n\n return (0, _tuiCodeSnippet.pick)(fillOption, 'type') || _consts.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 */\nfunction getFillTypeFromObject(shapeObj) {\n var _shapeObj$fill = shapeObj.fill,\n fill = _shapeObj$fill === undefined ? {} : _shapeObj$fill;\n\n if (fill.source) {\n return _consts.SHAPE_FILL_TYPE.FILTER;\n }\n\n return _consts.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 */\nfunction isShape(obj) {\n return (0, _tuiCodeSnippet.inArray)(obj.get('type'), _consts.SHAPE_TYPE) >= 0;\n}\n\n//# sourceURL=webpack://tui.ImageEditor/./src/js/util.js?"); - -/***/ }), - -/***/ "./src/svg/default.svg": -/*!*****************************!*\ - !*** ./src/svg/default.svg ***! - \*****************************/ -/*! no static exports found */ -/***/ (function(module, exports) { - -eval("module.exports = \"\"\n\n//# sourceURL=webpack://tui.ImageEditor/./src/svg/default.svg?"); - -/***/ }), - -/***/ "fabric": -/*!****************************************************************************************************************!*\ - !*** external {"commonjs":["fabric","fabric"],"commonjs2":["fabric","fabric"],"amd":"fabric","root":"fabric"} ***! - \****************************************************************************************************************/ -/*! no static exports found */ -/***/ (function(module, exports) { - -eval("module.exports = __WEBPACK_EXTERNAL_MODULE_fabric__;\n\n//# sourceURL=webpack://tui.ImageEditor/external_%7B%22commonjs%22:%5B%22fabric%22,%22fabric%22%5D,%22commonjs2%22:%5B%22fabric%22,%22fabric%22%5D,%22amd%22:%22fabric%22,%22root%22:%22fabric%22%7D?"); - -/***/ }), - -/***/ "tui-code-snippet": -/*!******************************************************************************************************************************!*\ - !*** external {"commonjs":"tui-code-snippet","commonjs2":"tui-code-snippet","amd":"tui-code-snippet","root":["tui","util"]} ***! - \******************************************************************************************************************************/ -/*! no static exports found */ -/***/ (function(module, exports) { - -eval("module.exports = __WEBPACK_EXTERNAL_MODULE_tui_code_snippet__;\n\n//# sourceURL=webpack://tui.ImageEditor/external_%7B%22commonjs%22:%22tui-code-snippet%22,%22commonjs2%22:%22tui-code-snippet%22,%22amd%22:%22tui-code-snippet%22,%22root%22:%5B%22tui%22,%22util%22%5D%7D?"); - -/***/ }), - -/***/ "tui-color-picker": -/*!*************************************************************************************************************************************!*\ - !*** external {"commonjs":"tui-color-picker","commonjs2":"tui-color-picker","amd":"tui-color-picker","root":["tui","colorPicker"]} ***! - \*************************************************************************************************************************************/ -/*! no static exports found */ -/***/ (function(module, exports) { - -eval("module.exports = __WEBPACK_EXTERNAL_MODULE_tui_color_picker__;\n\n//# sourceURL=webpack://tui.ImageEditor/external_%7B%22commonjs%22:%22tui-color-picker%22,%22commonjs2%22:%22tui-color-picker%22,%22amd%22:%22tui-color-picker%22,%22root%22:%5B%22tui%22,%22colorPicker%22%5D%7D?"); - -/***/ }) - -/******/ }); -}); \ No newline at end of file diff --git a/dist/tui-image-editor.min.css b/dist/tui-image-editor.min.css deleted file mode 100644 index 9df1587a3..000000000 --- a/dist/tui-image-editor.min.css +++ /dev/null @@ -1,7 +0,0 @@ -/*! - * tui-image-editor.min.js - * @version 3.11.0 - * @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-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-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-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-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-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{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{display:table}.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:#282828;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 .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{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{display:block}.tui-image-editor-container .tui-image-editor-controls .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 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{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{display:block}.tui-image-editor-container .tui-image-editor-controls .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}.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} -/*# sourceMappingURL=tui-image-editor.min.css.map */ \ No newline at end of file diff --git a/dist/tui-image-editor.min.css.map b/dist/tui-image-editor.min.css.map deleted file mode 100644 index e97353e24..000000000 --- a/dist/tui-image-editor.min.css.map +++ /dev/null @@ -1 +0,0 @@ -{"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,CAC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R,CQv1BI,kEACI,URy1BR,CQx1BI,2EACI,aR01BR,CQr1BI,uGACI,iBRw1BR,CQr1BI,wSACI,aR41BR,CQp1BI,wNACI,YRw1BR,CQ/0BI,ggBAGI,aRy1BR,CQx1BA,0CAEI,SAAS,CACT,iBAAU,CACV,UAAO,CACP,WAAQ,CACR,sBAAQ,CACR,cAAQ,CACR,MAAM,CACN,KR01BJ,CS75BM,gGACI,gBT+5BV,CS95BM,kGACI,YTg6BV","file":"tui-image-editor.min.css","sourcesContent":["/*!\n * tui-image-editor.min.js\n * @version 3.11.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 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 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 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 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 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 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 display: table;\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: #282828;\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 .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-controls svg > use {\n display: none;\n}\n.tui-image-editor-container .tui-image-editor-controls .enabled 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-controls .active svg:hover > use.hover {\n display: none;\n}\n.tui-image-editor-container .tui-image-editor-controls svg > use.normal {\n display: block;\n}\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-controls .enabled svg > use.enabled {\n display: block;\n}\n.tui-image-editor-container .tui-image-editor-controls .active 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-controls .help svg > use.disabled,\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-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.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\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 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 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 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 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 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 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 display: table;\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: #282828;\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 .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-controls svg > use {\n display: none;\n}\n.tui-image-editor-container .tui-image-editor-controls .enabled 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-controls .active svg:hover > use.hover {\n display: none;\n}\n.tui-image-editor-container .tui-image-editor-controls svg > use.normal {\n display: block;\n}\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-controls .enabled svg > use.enabled {\n display: block;\n}\n.tui-image-editor-container .tui-image-editor-controls .active 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-controls .help svg > use.disabled,\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-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.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 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}-submenu\n display: table;\n\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: #282828;\n width: 1px;\n height: 24px;","/* 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 RIGIHT */\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","/* 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}-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 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","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/dist/tui-image-editor.min.js b/dist/tui-image-editor.min.js deleted file mode 100644 index fec649d5d..000000000 --- a/dist/tui-image-editor.min.js +++ /dev/null @@ -1,15 +0,0 @@ -/*! - * tui-image-editor.min.js - * @version 3.11.0 - * @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&&e.tui.util,e.fabric,e.tui&&e.tui.colorPicker))}(window,function(n,i,o){return s={},r.m=a=[function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.defaultFilterRangeValus=t.defaultTextRangeValus=t.defaultShapeStrokeValus=t.defaultDrawRangeValus=t.defaultRotateRangeValus=t.defaultIconPath=t.rejectMessages=t.fObjectOptions=t.keyCodes=t.drawingModes=t.eventNames=t.commandNames=t.CROPZONE_DEFAULT_OPTIONS=t.SHAPE_DEFAULT_OPTIONS=t.componentNames=t.SHAPE_TYPE=t.SHAPE_FILL_TYPE=t.FILTER_NAME_VALUE_MAP=t.HELP_MENUS=void 0;var i=n(1);t.HELP_MENUS=["undo","redo","reset","delete","deleteAll"],t.FILTER_NAME_VALUE_MAP={blur:"blur",blocksize:"pixelate"},t.SHAPE_FILL_TYPE={FILTER:"filter",COLOR:"color"},t.SHAPE_TYPE=["rect","circle","triangle"],t.componentNames=(0,i.keyMirror)("IMAGE_LOADER","CROPPER","FLIP","ROTATION","FREE_DRAWING","LINE","TEXT","ICON","FILTER","SHAPE"),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"},t.drawingModes=(0,i.keyMirror)("NORMAL","CROPPER","FREE_DRAWING","LINE_DRAWING","TEXT","SHAPE","ICON"),t.keyCodes={Z:90,Y:89,C:67,V:86,SHIFT:16,BACKSPACE:8,DEL:46,ARROW_DOWN:40,ARROW_UP:38},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.defaultRotateRangeValus={realTimeEvent:!0,min:-360,max:360,value:0},t.defaultDrawRangeValus={min:5,max:30,value:12},t.defaultShapeStrokeValus={realTimeEvent:!0,min:2,max:300,value:3},t.defaultTextRangeValus={realTimeEvent:!0,min:10,max:100,value:50},t.defaultFilterRangeValus={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},colorfilterThresholeRange:{realTimeEvent:!0,min:0,max:1,value:.2,useDecimal:!0},blurFilterRange:{value:.1}}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Promise=void 0,t.clamp=function(e,t,n){var i=void 0;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),r=!o||isNaN(o);if(i.value=o,!r){var a=(this._useDecimal?Number:l.toInteger)(o);a=(0,l.clamp)(a,this._min,this.max),this.value=a,this.fire("change",a,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,r=this._useDecimal?o:(0,l.toInteger)(o);this.value!==r&&(this.value=r,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 r,a=n(11),s=n(89),l=n(58),c=n(36),u=n(59),h=n(34),d=n(35),f="prototype",p="script",v=d("IE_PROTO"),g=function(){try{r=document.domain&&new ActiveXObject("htmlfile")}catch(e){}var e,t;g=r?function(e){e.write(o("")),e.close();var t=e.parentWindow.Object;return e=null,t}(r):((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 g[f][l[n]];return g()};c[v]=!0,e.exports=Object.create||function(e,t){var n;return null!==e?(i[f]=a(e),n=new i,i[f]=null,n[v]=e):n=g(),void 0===t?n:s(n,t)}},function(e,t,n){var i=n(32),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)),r=l(t),a=o.length;return r<0||a<=r?s?"":void 0:(n=o.charCodeAt(r))<55296||56319o;)a(i,n=t[o++])&&(~l(r,n)||r.push(n));return r}},function(e,t,n){function i(s){return function(e,t,n){var i,o=l(e),r=c(o.length),a=u(n,r);if(s&&t!=t){for(;a=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"),r.Arguments=r.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 v(e){var t;return!(!k(e)||"function"!=typeof(t=e.then))&&t}function r(h,d,f){if(!d.notified){d.notified=!0;var p=d.reactions;P(function(){for(var e=d.value,t=1==d.state,n=0;p.length>n;){var i,o,r,a=p[n++],s=t?a.ok:a.fail,l=a.resolve,c=a.reject,u=a.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(),r=!0)),i===a.promise?c(X("Promise-chain cycle")):(o=v(i))?o.call(i,l,c):l(i)):c(e)}catch(e){u&&!r&&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 a(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,r(e,t,!0))}var i,l,c,u,h=n(15),d=n(21),f=n(4),p=n(17),g=n(61),m=n(29),b=n(101),y=n(40),_=n(102),k=n(14),E=n(16),w=n(103),O=n(22),C=n(45),S=n(30),x=n(107),M=n(62),j=n(63).set,P=n(108),T=n(66),I=n(109),A=n(23),D=n(31),L=n(26),R=n(53),F=n(6),N=n(110),z=F("species"),H="Promise",B=L.get,W=L.set,U=L.getterFor(H),V=g,X=f.TypeError,Y=f.document,G=f.process,q=p("fetch"),J=A.f,K=J,Z="process"==O(G),$=!!(Y&&Y.createEvent&&f.dispatchEvent),Q="unhandledrejection",ee=R(H,function(){if(!(C(V)!==String(V))){if(66===N)return!0;if(!Z&&"function"!=typeof PromiseRejectionEvent)return!0}if(d&&!V.prototype.finally)return!0;if(51<=N&&/native code/.test(V))return!1;function e(e){e(function(){},function(){})}var t=V.resolve(1);return(t.constructor={})[z]=e,!(t.then(function(){})instanceof e)}),te=ee||!x(function(e){V.all(e).catch(function(){})}),ne=function(n,i){j.call(f,function(){var e,t=i.value;if(ie(i)&&(e=D(function(){Z?G.emit("unhandledRejection",t,n):o(Q,n,t)}),i.rejection=Z||ie(i)?2:1,e.error))throw e.value})},ie=function(e){return 1!==e.rejection&&!e.parent},oe=function(e,t){j.call(f,function(){Z?G.emit("rejectionHandled",e):o("rejectionhandled",e,t.value)})},re=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=v(e);o?P(function(){var t={done:!1};try{o.call(e,a(re,n,t,i),a(s,n,t,i))}catch(e){s(n,t,e,i)}}):(i.value=e,i.state=1,r(n,i,!1))}catch(e){s(n,{done:!1},e,i)}}};ee&&(V=function(e){w(this,V,H),E(e),i.call(this);var t=B(this);try{e(a(re,this,t),a(s,this,t))}catch(e){s(this,t,e)}},(i=function(){W(this,{type:H,done:!1,notified:!1,parent:!1,reactions:[],rejection:!1,state:0,value:void 0})}).prototype=b(V.prototype,{then:function(e,t){var n=U(this),i=J(M(this,V));return i.ok="function"!=typeof e||e,i.fail="function"==typeof t&&t,i.domain=Z?G.domain:void 0,n.parent=!0,n.reactions.push(i),0!=n.state&&r(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=a(re,e,t),this.reject=a(s,e,t)},A.f=J=function(e){return e===V||e===c?new l:K(e)},d||"function"!=typeof g||(u=g.prototype.then,m(g.prototype,"then",function(e,t){var n=this;return new V(function(e,t){u.call(n,e,t)}).then(e,t)},{unsafe:!0}),"function"==typeof q&&h({global:!0,enumerable:!0,forced:!0},{fetch:function(e){return T(V,q.apply(f,arguments))}}))),h({global:!0,wrap:!0,forced:ee},{Promise:V}),y(V,H,!1,!0),_(H),c=p(H),h({target:H,stat:!0,forced:ee},{reject:function(e){var t=J(this);return t.reject.call(void 0,e),t.promise}}),h({target:H,stat:!0,forced:d||ee},{resolve:function(e){return T(d&&this===c?V:this,e)}}),h({target:H,stat:!0,forced:te},{all:function(e){var s=this,t=J(s),l=t.resolve,c=t.reject,n=D(function(){var i=E(s.resolve),o=[],r=0,a=1;S(e,function(e){var t=r++,n=!1;o.push(void 0),a++,i.call(s,e).then(function(e){n||(n=!0,o[t]=e,--a||l(o))},c)}),--a||l(o)});return n.error&&c(n.value),t.promise},race:function(e){var n=this,i=J(n),o=i.reject,t=D(function(){var t=E(n.resolve);S(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(17),o=n(20),r=n(6),a=n(13),s=r("species");e.exports=function(e){var t=i(e),n=o.f;a&&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(18),r=i("iterator"),a=Array.prototype;e.exports=function(e){return void 0!==e&&(o.Array===e||a[r]===e)}},function(e,t,n){var i=n(42),o=n(18),r=n(6)("iterator");e.exports=function(e){if(null!=e)return e[r]||e["@@iterator"]||o[i(e)]}},function(e,t,n){var r=n(11);e.exports=function(t,e,n,i){try{return i?e(r(n)[0],n[1]):e(n)}catch(e){var o=t.return;throw void 0!==o&&r(o.call(t)),e}}},function(e,t,n){var o=n(6)("iterator"),r=!1;try{var i=0,a={next:function(){return{done:!!i++}},return:function(){r=!0}};a[o]=function(){return this},Array.from(a,function(){throw 2})}catch(e){}e.exports=function(e,t){if(!t&&!r)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,r,a,s,l,c,u,h=n(4),d=n(52).f,f=n(22),p=n(63).set,v=n(64),g=h.MutationObserver||h.WebKitMutationObserver,m=h.process,b=h.Promise,y="process"==f(m),_=d(h,"queueMicrotask"),k=_&&_.value;k||(i=function(){var e,t;for(y&&(e=m.domain)&&e.exit();o;){t=o.fn,o=o.next;try{t()}catch(e){throw o?a():r=void 0,e}}r=void 0,e&&e.enter()},a=y?function(){m.nextTick(i)}:g&&!v?(s=!0,l=document.createTextNode(""),new g(i).observe(l,{characterData:!0}),function(){l.data=s=!s}):b&&b.resolve?(c=b.resolve(void 0),u=c.then,function(){u.call(c,i)}):function(){p.call(h,i)}),e.exports=k||function(e){var t={fn:e,next:void 0};r&&(r.next=t),o||(o=t,a()),r=t}},function(e,t,n){var i=n(4);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,r=n(4),a=n(65),s=r.process,l=s&&s.versions,c=l&&l.v8;c?o=(i=c.split("."))[0]+i[1]:a&&(!(i=a.match(/Edge\/(\d+)/))||74<=i[1])&&(i=a.match(/Chrome\/(\d+)/))&&(o=i[1]),e.exports=o&&+o},function(e,t,n){"use strict";var i=n(15),o=n(21),r=n(61),a=n(10),s=n(17),l=n(62),c=n(66),u=n(29);i({target:"Promise",proto:!0,real:!0,forced:!!r&&a(function(){r.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 r||r.prototype.finally||u(r.prototype,"finally",s("Promise").prototype.finally)},function(e,t,n){"use strict";var i=n(15),o=n(13),r=n(39),a=n(60),s=n(56),l=n(20),c=n(27),u=n(30),h=n(8),d=n(26),f=d.set,p=d.getterFor("AggregateError"),v=function(e,t){var n=this;if(!(n instanceof v))return new v(e,t);a&&(n=a(new Error(t),r(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};v.prototype=s(Error.prototype,{constructor:c(5,v),message:c(5,""),name:c(5,"AggregateError")}),o&&l.f(v.prototype,"errors",{get:function(){return p(this).errors},configurable:!0}),i({global:!0},{AggregateError:v})},function(e,t,n){n(67)},function(e,t,n){"use strict";var i=n(15),o=n(23),r=n(31);i({target:"Promise",stat:!0},{try:function(e){var t=o.f(this),n=r(e);return(n.error?t.reject:t.resolve)(n.value),t.promise}})},function(e,t,n){"use strict";var i=n(15),h=n(16),d=n(17),o=n(23),r=n(31),f=n(30),p="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=r(function(){var i=h(l.resolve),o=[],r=0,a=1,s=!1;f(e,function(e){var t=r++,n=!1;o.push(void 0),a++,i.call(l,e).then(function(e){n||s||(s=!0,c(e))},function(e){n||s||(n=!0,o[t]=e,--a||u(new(d("AggregateError"))(o,p)))})}),--a||u(new(d("AggregateError"))(o,p))});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?r=i>this._editorElementWrap.offsetHeight-150?75-(i-(this._editorElementWrap.offsetHeight-150))/2:75:"left"===e?a=n>this._editorElementWrap.offsetWidth-248?124-(n-(this._editorElementWrap.offsetWidth-248))/2:124:"right"===e&&(a=n>this._editorElementWrap.scrollWidth-248?(n-this._editorElementWrap.scrollWidth)/2:-124)),o.top=r+"px",o.left=a+"px"}}]),O);function O(e,t,n){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,O),this.options=this._initializeOption(t),this._actions=n,this.submenu=!1,this.imageSize={},this.uiSize={},this._locale=new _.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._menuElement=null,this._subMenuElement=null,this._makeUiElement(e),this._setUiSize(),this._initMenuEvent=!1,this._makeSubMenu()}t.default=w},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,r=e.loadButtonStyle,a=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}),t.default=function(e){var t=e.locale,n=e.biImage,i=e.loadButtonStyle,o=e.downloadButtonStyle;return'\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,a.extend)({},l.default,e)),(0,r.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,r=e.submenuPartitionHorizontal,a=e.submenuCheckbox,s=e.submenuRangePointer,l=e.submenuRangeValue,c=e.submenuColorpickerTitle,u=e.submenuColorpickerButton,h=e.submenuRangeBar,d=e.submenuRangeSubbar,f=e.submenuDisabledRangePointer,p=e.submenuDisabledRangeBar,v=e.submenuDisabledRangeSubbar,g=e.submenuIconSize,m=e.menuIconSize,b=e.biSize,y=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 "+r+"\n }\n .tui-image-editor-container .tui-image-editor-checkbox label > span:before {\n "+a+"\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 "+v+"\n }\n .tui-image-editor-container .tui-image-editor-disabled .tui-image-editor-virtual-range-bar {\n "+p+"\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 "+m+"\n }\n .tui-image-editor-container .svg_ic-submenu {\n "+g+"\n }\n .tui-image-editor-container .tui-image-editor-controls-logo > img,\n .tui-image-editor-container .tui-image-editor-header-logo > img {\n "+b+"\n }\n .tui-image-editor-menu use.normal.use-default {\n fill-rule: evenodd;\n fill: "+y.normal.color+";\n stroke: "+y.normal.color+";\n }\n .tui-image-editor-menu use.active.use-default {\n fill-rule: evenodd;\n fill: "+y.active.color+";\n stroke: "+y.active.color+";\n }\n .tui-image-editor-menu use.hover.use-default {\n fill-rule: evenodd;\n fill: "+y.hover.color+";\n stroke: "+y.hover.color+";\n }\n .tui-image-editor-menu use.disabled.use-default {\n fill-rule: evenodd;\n fill: "+y.disabled.color+";\n stroke: "+y.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";function i(e,t){for(var n=0;n"}},this._commonAction())},_iconAction:function(){var o=this;return(0,r.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()},registDefalutIcons:function(e,t){var n={};n[e]=t,o.registerIcons(n)},registCustomIcon:function(e,i){(new s.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})},s.default.tracerDefaultOption())}},this._commonAction())},_drawAction:function(){var n=this;return(0,r.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,r.extend)({loadImageFromURL:function(e,t){return n.loadImageFromURL(n.toDataURL(),"FilterImage").then(function(){n.addImageObject(e).then(function(){URL.revokeObjectURL(t)})})},applyFilter:function(){n.applyFilter("mask",{maskObjId:n.activeObjectId})}},this._commonAction())},_textAction:function(){var n=this;return(0,r.extend)({changeTextStyle:function(e,t){n.activeObjectId&&n.changeTextStyle(n.activeObjectId,e,t)}},this._commonAction())},_rotateAction:function(){var n=this;return(0,r.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,r.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,r.extend)({crop:function(){var e=t.getCropzoneRect();e&&t.crop(e).then(function(){t.stopDrawingMode(),t.ui.resizeEditor(),t.ui.changeMenu("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,r.extend)({flip:function(e){return t[e]()}},this._commonAction())},_filterAction:function(){var o=this;return(0,r.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,r=t.fontWeight,a=t.underline;s.addText("Double Click",{position:e.originPosition,styles:{fill:n,fontSize:i,fontFamily:"Noto Sans",fontStyle:o,fontWeight:r,underline:a}}).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,a.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]=r-1),a-1n[i].boundingbox[3]&&(n[i].boundingbox[3]=a-1),d=this.pathscan_combined_lookup[e[a][r]][c],e[a][r]=d[0],c=d[1],r+=d[2],a+=d[3],r-1===n[i].points[0].x&&a-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,r=0,a=0,s=0,l=void 0,c=void 0;for(l=0;le.points.length||o<0)return[];var r=i,a=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,p=(i+1)%e.points.length,v=void 0;p!=o;)(v=p-i)<0&&(v+=e.points.length),l=e.points[i].x+d*v,c=e.points[i].y+f*v,t<(u=(e.points[p].x-l)*(e.points[p].x-l)+(e.points[p].y-c)*(e.points[p].y-c))&&(s=!1),a',a+='',a+='',a+=''),!r.segments[s].hasOwnProperty("x3")&&i.lcpr&&(a+='');for(l=0;l',a+='',a+='',a+=''),!c.segments[s].hasOwnProperty("x3")&&i.lcpr&&(a+='')}return a}},{key:"getsvgstring",value:function(e,t){t=this.checkoptions(t);for(var n=e.width*t.scale,i=e.height*t.scale,o="',r=0;rn},_getColor:function(e,t,n){var i=[0,0,0,0],o=e.data,r=4*(e.width*n+t);return i[0]=o[r],i[1]=o[1+r],i[2]=o[2+r],i[3]=o[3+r],i}});t.default=r},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