mirror of
https://github.com/antos-rde/antosdk-apps.git
synced 2024-12-25 11:48:21 +01:00
806 lines
460 KiB
JavaScript
806 lines
460 KiB
JavaScript
/*!
|
|
* tui-code-snippet.js
|
|
* @version 1.5.0
|
|
* @author NHNEnt FE Development Lab <dl_javascript@nhnent.com>
|
|
* @license MIT
|
|
*/
|
|
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports.util=t():(e.tui=e.tui||{},e.tui.util=t())}(this,(function(){return function(e){var t={};function n(o){if(t[o])return t[o].exports;var i=t[o]={exports:{},id:o,loaded:!1};return e[o].call(i.exports,i,i.exports,n),i.loaded=!0,i.exports}return n.m=e,n.c=t,n.p="dist",n(0)}([function(e,t,n){"use strict";var o={},i=n(1),r=i.extend;r(o,i),r(o,n(3)),r(o,n(2)),r(o,n(4)),r(o,n(5)),r(o,n(6)),r(o,n(7)),r(o,n(8)),r(o,n(9)),o.browser=n(10),o.popup=n(11),o.formatDate=n(12),o.defineClass=n(13),o.defineModule=n(14),o.defineNamespace=n(15),o.CustomEvents=n(16),o.Enum=n(17),o.ExMap=n(18),o.HashMap=n(20),o.Map=n(19),e.exports=o},function(e,t,n){"use strict";var o=n(2),i=n(3),r=0;function s(e,t){var n,r=[],a=[];if(isNaN(e)&&isNaN(t)&&o.isNumber(e)&&o.isNumber(t))return!0;if(e===t)return!0;if(o.isFunction(e)&&o.isFunction(t)||e instanceof Date&&t instanceof Date||e instanceof RegExp&&t instanceof RegExp||e instanceof String&&t instanceof String||e instanceof Number&&t instanceof Number)return e.toString()===t.toString();if(!(e instanceof Object&&t instanceof Object))return!1;if(e.isPrototypeOf(t)||t.isPrototypeOf(e)||e.constructor!==t.constructor||e.prototype!==t.prototype)return!1;if(i.inArray(e,r)>-1||i.inArray(t,a)>-1)return!1;for(n in t){if(t.hasOwnProperty(n)!==e.hasOwnProperty(n))return!1;if(typeof t[n]!=typeof e[n])return!1}for(n in e){if(t.hasOwnProperty(n)!==e.hasOwnProperty(n))return!1;if(typeof t[n]!=typeof e[n])return!1;if("object"==typeof e[n]||"function"==typeof e[n]){if(r.push(e),a.push(t),!s(e[n],t[n]))return!1;r.pop(),a.pop()}else if(e[n]!==t[n])return!1}return!0}function a(e,t){for(var n=arguments,i=n[0],r=1,s=n.length;r<s;r+=1){if(o.isUndefined(i)||o.isNull(i))return;i=i[n[r]]}return i}e.exports={extend:function(e,t){var n,o,i,r,s=Object.prototype.hasOwnProperty;for(i=1,r=arguments.length;i<r;i+=1)for(o in n=arguments[i])s.call(n,o)&&(e[o]=n[o]);return e},stamp:function(e){return e.__fe_id||(r+=1,e.__fe_id=r),e.__fe_id},hasStamp:function(e){return o.isExisty(a(e,"__fe_id"))},resetLastId:function(){r=0},keys:Object.prototype.keys||function(e){var t,n=[];for(t in e)e.hasOwnProperty(t)&&n.push(t);return n},compareJSON:function(e){var t=arguments.length,n=1;if(t<1)return!0;for(;n<t;n+=1)if(!s(e,arguments[n]))return!1;return!0},pick:a}},function(e,t){"use strict";var n=Object.prototype.toString;function o(e){return!i(e)&&!r(e)}function i(e){return void 0===e}function r(e){return null===e}function s(e){return o(e)&&!1!==e}function a(e){return o(e)&&("[object Arguments]"===n.call(e)||!!e.callee)}function l(e){return e instanceof Array}function c(e){return e===Object(e)}function u(e){return e instanceof Function}function d(e){return"string"==typeof e||e instanceof String}function h(e){return!(o(e)&&!function(e){return d(e)&&""===e}(e))||(l(e)||a(e)?0===e.length:!(c(e)&&!u(e))||!function(e){var t;for(t in e)if(e.hasOwnProperty(t))return!0;return!1}(e))}e.exports={isExisty:o,isUndefined:i,isNull:r,isTruthy:s,isFalsy:function(e){return!s(e)},isArguments:a,isArray:l,isArraySafe:function(e){return"[object Array]"===n.call(e)},isObject:c,isFunction:u,isFunctionSafe:function(e){return"[object Function]"===n.call(e)},isNumber:function(e){return"number"==typeof e||e instanceof Number},isNumberSafe:function(e){return"[object Number]"===n.call(e)},isDate:function(e){return e instanceof Date},isDateSafe:function(e){return"[object Date]"===n.call(e)},isString:d,isStringSafe:function(e){return"[object String]"===n.call(e)},isBoolean:function(e){return"boolean"==typeof e||e instanceof Boolean},isBooleanSafe:function(e){return"[object Boolean]"===n.call(e)},isHTMLNode:function(e){return"object"==typeof HTMLElement?e&&(e instanceof HTMLElement||!!e.nodeType):!(!e||!e.nodeType)},isHTMLTag:function(e){return"object"==typeof HTMLElement?e&&e instanceof HTMLElement:!(!e||!e.nodeType||1!==e.nodeType)},isEmpty:h,isNotEmpty:function(e){return!h(e)}}},function(e,t,n){"use strict";var o,i=n(4),r=n(2),s=Array.prototype.slice;o={inArray:function(e,t,n){var o,i;if(n=n||0,!r.isArray(t))return-1;if(Array.prototype.indexOf)return Array.prototype.indexOf.call(t,e,n);for(i=t.length,o=n;n>=0&&o<i;o+=1)if(t[o]===e)return o;return-1},range:function(e,t,n){var o,i=[];for(r.isUndefined(t)&&(t=e||0,e=0),t*=o=(n=n||1)<0?-1:1;e*o<t;e+=n)i.push(e);return i},zip:function(){var e=s.call(arguments),t=[];return i.forEach(e,(function(e){i.forEach(e,(function(e,n){t[n]||(t[n]=[]),t[n].push(e)}))})),t}},e.exports=o},function(e,t,n){"use strict";var o=n(2),i=n(1);function r(e,t,n){var o=0,i=e.length;for(n=n||null;o<i&&!1!==t.call(n,e[o],o,e);o+=1);}function s(e,t,n){var o;for(o in n=n||null,e)if(e.hasOwnProperty(o)&&!1===t.call(n,e[o],o,e))break}function a(e,t,n){o.isArray(e)?r(e,t,n):s(e,t,n)}function l(e,t,n){var o=[];return n=n||null,a(e,(function(){o.push(t.apply(n,arguments))})),o}e.exports={forEachOwnProperties:s,forEachArray:r,forEach:a,toArray:function(e){var t;try{t=Array.prototype.slice.call(e)}catch(n){t=[],r(e,(function(e){t.push(e)}))}return t},map:l,reduce:function(e,t,n){var r,s,a,l=0;for(n=n||null,o.isArray(e)?(s=e.length,a=e[l]):(s=(r=i.keys(e)).length,a=e[r[l+=1]]),l+=1;l<s;l+=1)a=t.call(n,a,e[r?r[l]:l]);return a},filter:function(e,t,n){var i,r;if(n=n||null,!o.isObject(e)||!o.isFunction(t))throw new Error("wrong parameter");return o.isArray(e)?(i=[],r=function(e,t){e.push(t[0])}):(i={},r=function(e,t){e[t[1]]=t[0]}),a(e,(function(){t.apply(n,arguments)&&r(i,arguments)}),n),i},pluck:function(e,t){return l(e,(function(e){return e[t]}))}}},function(e,t){"use strict";e.exports={bind:function(e,t){var n,o=Array.prototype.slice;return e.bind?e.bind.apply(e,o.call(arguments,1)):(n=o.call(arguments,2),function(){return e.apply(t,n.length?n.concat(o.call(arguments)):arguments)})}}},function(e,t){"use strict";function n(e){function t(){}return t.prototype=e,new t}e.exports={createObject:n,inherit:function(e,t){var o=n(t.prototype);o.constructor=e,e.prototype=o}}},function(e,t,n){"use strict";var o=n(4),i=n(1);e.exports={decodeHTMLEntity:function(e){var t={""":'"',"&":"&","<":"<",">":">","'":"'"," ":" "};return e.replace(/&|<|>|"|'| /g,(function(e){return t[e]?t[e]:e}))},encodeHTMLEntity:function(e){var t={'"':"quot","&":"amp","<":"lt",">":"gt","'":"#39"};return e.replace(/[<>&"']/g,(function(e){return t[e]?"&"+t[e]+";":e}))},hasEncodableString:function(e){return/[<>&"']/.test(e)},getDuplicatedChar:function(e,t){for(var n,r=0,s=e.length,a={};r<s;r+=1)a[n=e.charAt(r)]=1;for(r=0,s=t.length;r<s;r+=1)a[n=t.charAt(r)]&&(a[n]+=1);return a=o.filter(a,(function(e){return e>1})),(a=i.keys(a).sort()).join("")}}},function(e,t){"use strict";var n={},o=Array.prototype.slice;n.timestamp=function(){return Number(new Date)},n.debounce=function(e,t){var n,i;return t=t||0,function(){i=o.call(arguments),window.clearTimeout(n),n=window.setTimeout((function(){e.apply(null,i)}),t)}},n.throttle=function(e,t){var i,r,s,a,l=!0,c=function(t){e.apply(null,t),i=null};function u(){if(a=o.call(arguments),l)return c(a),void(l=!1);s=n.timestamp(),i=i||s,r(a),s-i>=t&&c(a)}return t=t||0,r=n.debounce(c,t),u.reset=function(){l=!0,i=null},u},e.exports=n},function(e,t,n){"use strict";var o=n(1),i=n(4),r=n(2);function s(e,t){var n=i.map(o.keys(t),(function(e,n){return(0===n?"":"&")+e+"="+t[e]})).join(""),r=document.createElement("img");return r.src=e+"?"+n,r.style.display="none",document.body.appendChild(r),document.body.removeChild(r),r}e.exports={imagePing:s,sendHostname:function(e,t){var n=location.hostname,o="TOAST UI "+e+" for "+n+": Statistics",i=window.localStorage.getItem(o);(r.isUndefined(window.tui)||!1!==window.tui.usageStatistics)&&(i&&!function(e){return(new Date).getTime()-e>6048e5}(i)||(window.localStorage.setItem(o,(new Date).getTime()),setTimeout((function(){"interactive"!==document.readyState&&"complete"!==document.readyState||s("https://www.google-analytics.com/collect",{v:1,t:"event",tid:t,cid:n,dp:n,dh:e,el:e,ec:"use"})}),1e3)))}}},function(e,t){"use strict";var n,o,i={chrome:!1,firefox:!1,safari:!1,msie:!1,edge:!1,others:!1,version:0},r=window.navigator,s=r.appName.replace(/\s/g,"_"),a=r.userAgent,l=/MSIE\s([0-9]+[.0-9]*)/,c=/Trident.*rv:11\./,u=/Edge\/(\d+)\./,d={firefox:/Firefox\/(\d+)\./,chrome:/Chrome\/(\d+)\./,safari:/Version\/([\d.]+).*Safari\/(\d+)/},h={Microsoft_Internet_Explorer:function(){var e=a.match(l);e?(i.msie=!0,i.version=parseFloat(e[1])):i.others=!0},Netscape:function(){var e=!1;if(c.exec(a))i.msie=!0,i.version=11,e=!0;else if(u.exec(a))i.edge=!0,i.version=a.match(u)[1],e=!0;else for(n in d)if(d.hasOwnProperty(n)&&(o=a.match(d[n]))&&o.length>1){i[n]=e=!0,i.version=parseFloat(o[1]||0);break}e||(i.others=!0)}};h[s]&&h[s](),e.exports=i},function(e,t,n){"use strict";var o=n(4),i=n(2),r=n(5),s=n(10),a=n(1),l=0;function c(){this.openedPopup={},this.closeWithParentPopup={},this.postBridgeUrl=""}c.prototype.getPopupList=function(e){return i.isExisty(e)?this.openedPopup[e]:this.openedPopup},c.prototype.openPopup=function(e,t){var n,o,c;if((t=a.extend({popupName:"popup_"+l+"_"+Number(new Date),popupOptionStr:"",useReload:!0,closeWithParent:!0,method:"get",param:{}},t||{})).method=t.method.toUpperCase(),this.postBridgeUrl=t.postBridgeUrl||this.postBridgeUrl,c="POST"===t.method&&t.param&&s.msie&&11===s.version,!i.isExisty(e))throw new Error("Popup#open() need popup url.");l+=1,t.param&&("GET"===t.method?e=e+(/\?/.test(e)?"&":"?")+this._parameterize(t.param):"POST"===t.method&&(c||(o=this.createForm(e,t.param,t.method,t.popupName),e="about:blank"))),n=this.openedPopup[t.popupName],i.isExisty(n)?n.closed?this.openedPopup[t.popupName]=n=this._open(c,t.param,e,t.popupName,t.popupOptionStr):(t.useReload&&n.location.replace(e),n.focus()):this.openedPopup[t.popupName]=n=this._open(c,t.param,e,t.popupName,t.popupOptionStr),this.closeWithParentPopup[t.popupName]=t.closeWithParent,(!n||n.closed||i.isUndefined(n.closed))&&alert("please enable popup windows for this website"),t.param&&"POST"===t.method&&!c&&(n&&o.submit(),o.parentNode&&o.parentNode.removeChild(o)),window.onunload=r.bind(this.closeAllPopup,this)},c.prototype.close=function(e,t){var n=t||window;(e=!!i.isExisty(e)&&e)&&(window.onunload=null),n.closed||(n.opener=window.location.href,n.close())},c.prototype.closeAllPopup=function(e){var t=i.isExisty(e);o.forEachOwnProperties(this.openedPopup,(function(e,n){(t&&this.closeWithParentPopup[n]||!t)&&this.close(!1,e)}),this)},c.prototype.focus=function(e){this.getPopupList(e).focus()},c.prototype.parseQuery=function(){var e,t,n={};return e=window.location.search.substr(1),o.forEachArray(e.split("&"),(function(e){t=e.split("="),n[decodeURIComponent(t[0])]=decodeURIComponent(t[1])})),n},c.prototype.createForm=function(e,t,n,i,r){var s,a=document.createElement("form");return r=r||document.body,a.method=n||"POST",a.action=e||"",a.target=i||"",a.style.display="none",o.forEachOwnProperties(t,(function(e,t){(s=document.createElement("input")).name=t,s.type="hidden",s.value=e,a.appendChild(s)})),r.appendChild(a),a},c.prototype._parameterize=function(e){var t=[];return o.forEachOwnProperties(e,(function(e,n){t.push(encodeURIComponent(n)+"="+encodeURIComponent(e))})),t.join("&")},c.prototype._open=function(e,t,n,o,i){var r;return e?(r=window.open(this.postBridgeUrl,o,i),setTimeout((function(){r.redirect(n,t)}),100)):r=window.open(n,o,i),r},e.exports=new c},function(e,t,n){"use strict";var o=n(2),i=n(1),r=/[\\]*YYYY|[\\]*YY|[\\]*MMMM|[\\]*MMM|[\\]*MM|[\\]*M|[\\]*DD|[\\]*D|[\\]*HH|[\\]*H|[\\]*A/gi,s=["Invalid month","January","February","March","April","May","June","July","August","September","October","November","December"],a=[0,31,28,31,30,31,30,31,31,30,31,30,31],l={M:function(e){return Number(e.month)},MM:function(e){var t=e.month;return Number(t)<10?"0"+t:t},MMM:function(e){return s[Number(e.month)].substr(0,3)},MMMM:function(e){return s[Number(e.month)]},D:function(e){return Number(e.date)},d:function(e){return l.D(e)},DD:function(e){var t=e.date;return Number(t)<10?"0"+t:t},dd:function(e){return l.DD(e)},YY:function(e){return Number(e.year)%100},yy:function(e){return l.YY(e)},YYYY:function(e){var t="20",n=e.year;return n>69&&n<100&&(t="19"),Number(n)<100?t+String(n):n},yyyy:function(e){return l.YYYY(e)},A:function(e){return e.meridiem},a:function(e){return e.meridiem},hh:function(e){var t=e.hour;return Number(t)<10?"0"+t:t},HH:function(e){return l.hh(e)},h:function(e){return String(Number(e.hour))},H:function(e){return l.h(e)},m:function(e){return String(Number(e.minute))},mm:function(e){var t=e.minute;return Number(t)<10?"0"+t:t}};e.exports=function(e,t,n){var s,c,u=i.pick(n,"meridiemSet","AM")||"AM",d=i.pick(n,"meridiemSet","PM")||"PM";return!!function(e,t,n){var o;return e=Number(e),t=Number(t),n=Number(n),(e>-1&&e<100||e>1969&&e<2070)&&t>0&&t<13&&(o=a[t],2===t&&e%4==0&&(e%100==0&&e%400!=0||(o=29)),n>0&&n<=o)}((c=o.isDate(t)?{year:t.getFullYear(),month:t.getMonth()+1,date:t.getDate(),hour:t.getHours(),minute:t.getMinutes()}:{year:t.year,month:t.month,date:t.date,hour:t.hour,minute:t.minute}).year,c.month,c.date)&&(c.meridiem="",/([^\\]|^)[aA]\b/.test(e)&&(s=c.hour>11?d:u,c.hour>12&&(c.hour%=12),0===c.hour&&(c.hour=12),c.meridiem=s),e.replace(r,(function(e){return e.indexOf("\\")>-1?e.replace(/\\/,""):l[e](c)||""})))}},function(e,t,n){"use strict";var o=n(6).inherit,i=n(1).extend;e.exports=function(e,t){var n;return t||(t=e,e=null),n=t.init||function(){},e&&o(n,e),t.hasOwnProperty("static")&&(i(n,t.static),delete t.static),i(n.prototype,t),n}},function(e,t,n){"use strict";var o=n(15),i=n(2);e.exports=function(e,t){var n=t||{};return i.isFunction(n.initialize)&&n.initialize(),o(e,n)}},function(e,t,n){"use strict";var o=n(4),i=n(1);e.exports=function(e,t,n){var r,s,a;return(r=e.split(".")).unshift(window),s=o.reduce(r,(function(e,t){return e[t]=e[t]||{},e[t]})),n?(a=r.pop(),s=i.pick.apply(null,r)[a]=t):i.extend(s,t),s}},function(e,t,n){"use strict";var o=n(4),i=n(2),r=n(1),s=/\s+/g;function a(){this.events=null,this.contexts=null}a.mixin=function(e){r.extend(e.prototype,a.prototype)},a.prototype._getHandlerItem=function(e,t){var n={handler:e};return t&&(n.context=t),n},a.prototype._safeEvent=function(e){var t,n=this.events;return n||(n=this.events={}),e&&((t=n[e])||(t=[],n[e]=t),n=t),n},a.prototype._safeContext=function(){var e=this.contexts;return e||(e=this.contexts=[]),e},a.prototype._indexOfContext=function(e){for(var t=this._safeContext(),n=0;t[n];){if(e===t[n][0])return n;n+=1}return-1},a.prototype._memorizeContext=function(e){var t,n;i.isExisty(e)&&(t=this._safeContext(),(n=this._indexOfContext(e))>-1?t[n][1]+=1:t.push([e,1]))},a.prototype._forgetContext=function(e){var t,n;i.isExisty(e)&&(t=this._safeContext(),(n=this._indexOfContext(e))>-1&&(t[n][1]-=1,t[n][1]<=0&&t.splice(n,1)))},a.prototype._bindEvent=function(e,t,n){var o=this._safeEvent(e);this._memorizeContext(n),o.push(this._getHandlerItem(t,n))},a.prototype.on=function(e,t,n){var r=this;i.isString(e)?(e=e.split(s),o.forEach(e,(function(e){r._bindEvent(e,t,n)}))):i.isObject(e)&&(n=t,o.forEach(e,(function(e,t){r.on(t,e,n)})))},a.prototype.once=function(e,t,n){var r=this;if(i.isObject(e))return n=t,void o.forEach(e,(function(e,t){r.once(t,e,n)}));this.on(e,(function o(){t.apply(n,arguments),r.off(e,o,n)}),n)},a.prototype._spliceMatches=function(e,t){var n,o=0;if(i.isArray(e))for(n=e.length;o<n;o+=1)!0===t(e[o])&&(e.splice(o,1),n-=1,o-=1)},a.prototype._matchHandler=function(e){var t=this;return function(n){var o=e===n.handler;return o&&t._forgetContext(n.context),o}},a.prototype._matchContext=function(e){var t=this;return function(n){var o=e===n.context;return o&&t._forgetContext(n.context),o}},a.prototype._matchHandlerAndContext=function(e,t){var n=this;return function(o){var i=e===o.handler,r=t===o.context,s=i&&r;return s&&n._forgetContext(o.context),s}},a.prototype._offByEventName=function(e,t){var n=this,r=o.forEachArray,a=i.isFunction(t),l=n._matchHandler(t);e=e.split(s),r(e,(function(e){var t=n._safeEvent(e);a?n._spliceMatches(t,l):(r(t,(function(e){n._forgetContext(e.context)})),n.events[e]=[])}))},a.prototype._offByHandler=function(e){var t=this,n=this._matchHandler(e);o.forEach(this._safeEvent(),(function(e){t._spliceMatches(e,n)}))},a.prototype._offByObject=function(e,t){var n,r=this;this._indexOfContext(e)<0?o.forEach(e,(function(e,t){r.off(t,e)})):i.isString(t)?(n=this._matchContext(e),r._spliceMatches(this._safeEvent(t),n)):i.isFunction(t)?(n=this._matchHandlerAndContext(t,e),o.forEach(this._safeEvent(),(function(e){r._spliceMatches(e,n)}))):(n=this._matchContext(e),o.forEach(this._safeEvent(),(function(e){r._spliceMatches(e,n)})))},a.prototype.off=function(e,t){i.isString(e)?this._offByEventName(e,t):arguments.length?i.isFunction(e)?this._offByHandler(e):i.isObject(e)&&this._offByObject(e,t):(this.events={},this.contexts=[])},a.prototype.fire=function(e){this.invoke.apply(this,arguments)},a.prototype.invoke=function(e){var t,n,o,i;if(!this.hasListener(e))return!0;for(t=this._safeEvent(e),n=Array.prototype.slice.call(arguments,1),o=0;t[o];){if(!1===(i=t[o]).handler.apply(i.context,n))return!1;o+=1}return!0},a.prototype.hasListener=function(e){return this.getListenerLength(e)>0},a.prototype.getListenerLength=function(e){return this._safeEvent(e).length},e.exports=a},function(e,t,n){"use strict";var o=n(4),i=n(2),r=function(){try{return Object.defineProperty({},"x",{}),!0}catch(e){return!1}}(),s=0;function a(e){e&&this.set.apply(this,arguments)}a.prototype.set=function(e){var t=this;i.isArray(e)||(e=o.toArray(arguments)),o.forEach(e,(function(e){t._addItem(e)}))},a.prototype.getName=function(e){var t,n=this;return o.forEach(this,(function(o,i){if(n._isEnumItem(i)&&e===o)return t=i,!1})),t},a.prototype._addItem=function(e){var t;this.hasOwnProperty(e)||(t=this._makeEnumValue(),r?Object.defineProperty(this,e,{enumerable:!0,configurable:!1,writable:!1,value:t}):this[e]=t)},a.prototype._makeEnumValue=function(){var e;return e=s,s+=1,e},a.prototype._isEnumItem=function(e){return i.isNumber(this[e])},e.exports=a},function(e,t,n){"use strict";var o=n(4),i=n(19);function r(e){this._map=new i(e),this.size=this._map.size}o.forEachArray(["get","has","forEach","keys","values","entries"],(function(e){r.prototype[e]=function(){return this._map[e].apply(this._map,arguments)}})),o.forEachArray(["delete","clear"],(function(e){r.prototype[e]=function(){var t=this._map[e].apply(this._map,arguments);return this.size=this._map.size,t}})),r.prototype.set=function(){return this._map.set.apply(this._map,arguments),this.size=this._map.size,this},r.prototype.setObject=function(e){o.forEachOwnProperties(e,(function(e,t){this.set(t,e)}),this)},r.prototype.deleteByKeys=function(e){o.forEachArray(e,(function(e){this.delete(e)}),this)},r.prototype.merge=function(e){e.forEach((function(e,t){this.set(t,e)}),this)},r.prototype.filter=function(e){var t=new r;return this.forEach((function(n,o){e(n,o)&&t.set(o,n)})),t},e.exports=r},function(e,t,n){"use strict";var o=n(4),i=n(2),r=n(3),s=n(10),a=n(5),l={},c={};function u(e,t){this._keys=e,this._valueGetter=t,this._length=this._keys.length,this._index=-1,this._done=!1}function d(e){this._valuesForString={},this._valuesForIndex={},this._keys=[],e&&this._setInitData(e),this.size=0}u.prototype.next=function(){var e={};do{this._index+=1}while(i.isUndefined(this._keys[this._index])&&this._index<this._length);return this._index>=this._length?e.done=!0:(e.done=!1,e.value=this._valueGetter(this._keys[this._index],this._index)),e},d.prototype._setInitData=function(e){if(!i.isArray(e))throw new Error("Only Array is supported.");o.forEachArray(e,(function(e){this.set(e[0],e[1])}),this)},d.prototype._isNaN=function(e){return"number"==typeof e&&e!=e},d.prototype._getKeyIndex=function(e){var t,n=-1;return i.isString(e)?(t=this._valuesForString[e])&&(n=t.keyIndex):n=r.inArray(e,this._keys),n},d.prototype._getOriginKey=function(e){var t=e;return e===l?t=void 0:e===c&&(t=NaN),t},d.prototype._getUniqueKey=function(e){var t=e;return i.isUndefined(e)?t=l:this._isNaN(e)&&(t=c),t},d.prototype._getValueObject=function(e,t){return i.isString(e)?this._valuesForString[e]:(i.isUndefined(t)&&(t=this._getKeyIndex(e)),t>=0?this._valuesForIndex[t]:void 0)},d.prototype._getOriginValue=function(e,t){return this._getValueObject(e,t).origin},d.prototype._getKeyValuePair=function(e,t){return[this._getOriginKey(e),this._getOriginValue(e,t)]},d.prototype._createValueObject=function(e,t){return{keyIndex:t,origin:e}},d.prototype.set=function(e,t){var n,o=this._getUniqueKey(e),r=this._getKeyIndex(o);return r<0&&(r=this._keys.push(o)-1,this.size+=1),n=this._createValueObject(t,r),i.isString(e)?this._valuesForString[e]=n:this._valuesForIndex[r]=n,this},d.prototype.get=function(e){var t=this._getUniqueKey(e),n=this._getValueObject(t);return n&&n.origin},d.prototype.keys=function(){return new u(this._keys,a.bind(this._getOriginKey,this))},d.prototype.values=function(){return new u(this._keys,a.bind(this._getOriginValue,this))},d.prototype.entries=function(){return new u(this._keys,a.bind(this._getKeyValuePair,this))},d.prototype.has=function(e){return!!this._getValueObject(e)},d.prototype.delete=function(e){var t;i.isString(e)?this._valuesForString[e]&&(t=this._valuesForString[e].keyIndex,delete this._valuesForString[e]):(t=this._getKeyIndex(e))>=0&&delete this._valuesForIndex[t],t>=0&&(delete this._keys[t],this.size-=1)},d.prototype.forEach=function(e,t){t=t||this,o.forEachArray(this._keys,(function(n){i.isUndefined(n)||e.call(t,this._getValueObject(n).origin,n,this)}),this)},d.prototype.clear=function(){d.call(this)},window.Map&&(s.firefox&&s.version>=37||s.chrome&&s.version>=42)&&(d=window.Map),e.exports=d},function(e,t,n){"use strict";var o=n(4),i=n(2);function r(e){this.length=0,e&&this.setObject(e)}r.prototype.set=function(e,t){2===arguments.length?this.setKeyValue(e,t):this.setObject(e)},r.prototype.setKeyValue=function(e,t){this.has(e)||(this.length+=1),this[this.encodeKey(e)]=t},r.prototype.setObject=function(e){var t=this;o.forEachOwnProperties(e,(function(e,n){t.setKeyValue(n,e)}))},r.prototype.merge=function(e){var t=this;e.each((function(e,n){t.setKeyValue(n,e)}))},r.prototype.encodeKey=function(e){return"å"+e},r.prototype.decodeKey=function(e){var t=e.split("å");return t[t.length-1]},r.prototype.get=function(e){return this[this.encodeKey(e)]},r.prototype.has=function(e){return this.hasOwnProperty(this.encodeKey(e))},r.prototype.remove=function(e){return arguments.length>1&&(e=o.toArray(arguments)),i.isArray(e)?this.removeByKeyArray(e):this.removeByKey(e)},r.prototype.removeByKey=function(e){var t=this.has(e)?this.get(e):null;return null!==t&&(delete this[this.encodeKey(e)],this.length-=1),t},r.prototype.removeByKeyArray=function(e){var t=[],n=this;return o.forEach(e,(function(e){t.push(n.removeByKey(e))})),t},r.prototype.removeAll=function(){var e=this;this.each((function(t,n){e.remove(n)}))},r.prototype.each=function(e){var t,n=this;o.forEachOwnProperties(this,(function(o,i){if("å"===i.charAt(0)&&(t=e(o,n.decodeKey(i))),!1===t)return t}))},r.prototype.keys=function(){var e=[],t=this;return this.each((function(n,o){e.push(t.decodeKey(o))})),e},r.prototype.find=function(e){var t=[];return this.each((function(n,o){e(n,o)&&t.push(n)})),t},r.prototype.toArray=function(){var e=[];return this.each((function(t){e.push(t)})),e},e.exports=r}])})),
|
|
/*!
|
|
* TOAST UI Color Picker
|
|
* @version 2.2.6
|
|
* @author NHN FE Development Team <dl_javascript@nhn.com>
|
|
* @license MIT
|
|
*/
|
|
function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports.colorPicker=t():(e.tui=e.tui||{},e.tui.colorPicker=t())}(window,(function(){return function(e){var t={};function n(o){if(t[o])return t[o].exports;var i=t[o]={i:o,l:!1,exports:{}};return e[o].call(i.exports,i,i.exports,n),i.l=!0,i.exports}return n.m=e,n.c=t,n.d=function(e,t,o){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:o})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var o=Object.create(null);if(n.r(o),Object.defineProperty(o,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var i in e)n.d(o,i,function(t){return e[t]}.bind(null,i));return o},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="dist",n(n.s=33)}([function(e,t,n){"use strict";e.exports=function(e,t){var n,o,i,r,s=Object.prototype.hasOwnProperty;for(i=1,r=arguments.length;i<r;i+=1)for(o in n=arguments[i])s.call(n,o)&&(e[o]=n[o]);return e}},function(e,t,n){"use strict";e.exports=function(e){return e instanceof Array}},function(e,t,n){"use strict";var o=n(1),i=n(6),r=n(7);e.exports=function(e,t,n){o(e)?i(e,t,n):r(e,t,n)}},function(e,t,n){"use strict";e.exports=function(e){return void 0===e}},function(e,t,n){"use strict";var o=n(22),i=n(2),r=n(6),s=n(7),a=n(37),l=0,c={getLength:function(e){var t=0;return s(e,(function(){t+=1})),t},map:function(e,t,n){var o=[];return i(e,(function(){o.push(t.apply(n||null,arguments))})),o},filter:function(e,t,n){var o=[];return r(e,(function(e){t.apply(n||null,arguments)&&o.push(e)})),o},generateId:function(){return l+=1},isOldBrowser:o.msie&&o.version<9,sendHostName:function(){a("color-picker","UA-129987462-1")}};e.exports=c},function(e,t,n){"use strict";var o=n(1);e.exports=function(e,t,n){var i,r;if(n=n||0,!o(t))return-1;if(Array.prototype.indexOf)return Array.prototype.indexOf.call(t,e,n);for(r=t.length,i=n;n>=0&&i<r;i+=1)if(t[i]===e)return i;return-1}},function(e,t,n){"use strict";e.exports=function(e,t,n){var o=0,i=e.length;for(n=n||null;o<i&&!1!==t.call(n,e[o],o,e);o+=1);}},function(e,t,n){"use strict";e.exports=function(e,t,n){var o;for(o in n=n||null,e)if(e.hasOwnProperty(o)&&!1===t.call(n,e[o],o,e))break}},function(e,t,n){"use strict";var o=n(39),i=n(13),r=n(41),s=n(3),a=n(9),l=n(19),c=n(4);function u(e,t){var n=c.generateId();e=e||{},s(t)&&(t=a.appendHTMLElement("div")),o(t,"tui-view-"+n),this.id=n,this.container=t,this.childs=new l((function(e){return e.id})),this.parent=null}u.prototype.addChild=function(e,t){t&&t.call(e,this),e.parent=this,this.childs.add(e)},u.prototype.removeChild=function(e,t){var n=r(e)?this.childs.items[e]:e;t&&t.call(n,this),this.childs.remove(n.id)},u.prototype.render=function(){this.childs.each((function(e){e.render()}))},u.prototype.recursive=function(e,t){i(e)&&(t||e(this),this.childs.each((function(t){t.recursive(e)})))},u.prototype.resize=function(){for(var e=Array.prototype.slice.call(arguments),t=this.parent;t;)i(t._onResize)&&t._onResize.apply(t,e),t=t.parent},u.prototype._beforeDestroy=function(){},u.prototype._destroy=function(){this._beforeDestroy(),this.container.innerHTML="",this.id=this.parent=this.childs=this.container=null},u.prototype.destroy=function(e){this.childs&&(this.childs.each((function(e){e.destroy(!0),e._destroy()})),this.childs.clear()),e||this._destroy()},u.prototype.getViewBound=function(){var e=this.container.getBoundingClientRect();return{x:e.left,y:e.top,width:e.right-e.left,height:e.bottom-e.top}},e.exports=u},function(e,t,n){"use strict";var o={appendHTMLElement:function(e,t,n){var o=document.createElement(e);return o.className=n||"",t?t.appendChild(o):document.body.appendChild(o),o}};e.exports=o},function(e,t,n){"use strict";var o=n(0),i=n(20),r=n(11),s=n(21),a=n(1),l=n(13),c=n(2),u=/\s+/g;function d(){this.events=null,this.contexts=null}d.mixin=function(e){o(e.prototype,d.prototype)},d.prototype._getHandlerItem=function(e,t){var n={handler:e};return t&&(n.context=t),n},d.prototype._safeEvent=function(e){var t,n=this.events;return n||(n=this.events={}),e&&((t=n[e])||(t=[],n[e]=t),n=t),n},d.prototype._safeContext=function(){var e=this.contexts;return e||(e=this.contexts=[]),e},d.prototype._indexOfContext=function(e){for(var t=this._safeContext(),n=0;t[n];){if(e===t[n][0])return n;n+=1}return-1},d.prototype._memorizeContext=function(e){var t,n;i(e)&&(t=this._safeContext(),(n=this._indexOfContext(e))>-1?t[n][1]+=1:t.push([e,1]))},d.prototype._forgetContext=function(e){var t,n;i(e)&&(t=this._safeContext(),(n=this._indexOfContext(e))>-1&&(t[n][1]-=1,t[n][1]<=0&&t.splice(n,1)))},d.prototype._bindEvent=function(e,t,n){var o=this._safeEvent(e);this._memorizeContext(n),o.push(this._getHandlerItem(t,n))},d.prototype.on=function(e,t,n){var o=this;r(e)?(e=e.split(u),c(e,(function(e){o._bindEvent(e,t,n)}))):s(e)&&(n=t,c(e,(function(e,t){o.on(t,e,n)})))},d.prototype.once=function(e,t,n){var o=this;if(s(e))return n=t,void c(e,(function(e,t){o.once(t,e,n)}));this.on(e,(function i(){t.apply(n,arguments),o.off(e,i,n)}),n)},d.prototype._spliceMatches=function(e,t){var n,o=0;if(a(e))for(n=e.length;o<n;o+=1)!0===t(e[o])&&(e.splice(o,1),n-=1,o-=1)},d.prototype._matchHandler=function(e){var t=this;return function(n){var o=e===n.handler;return o&&t._forgetContext(n.context),o}},d.prototype._matchContext=function(e){var t=this;return function(n){var o=e===n.context;return o&&t._forgetContext(n.context),o}},d.prototype._matchHandlerAndContext=function(e,t){var n=this;return function(o){var i=e===o.handler,r=t===o.context,s=i&&r;return s&&n._forgetContext(o.context),s}},d.prototype._offByEventName=function(e,t){var n=this,o=l(t),i=n._matchHandler(t);e=e.split(u),c(e,(function(e){var t=n._safeEvent(e);o?n._spliceMatches(t,i):(c(t,(function(e){n._forgetContext(e.context)})),n.events[e]=[])}))},d.prototype._offByHandler=function(e){var t=this,n=this._matchHandler(e);c(this._safeEvent(),(function(e){t._spliceMatches(e,n)}))},d.prototype._offByObject=function(e,t){var n,o=this;this._indexOfContext(e)<0?c(e,(function(e,t){o.off(t,e)})):r(t)?(n=this._matchContext(e),o._spliceMatches(this._safeEvent(t),n)):l(t)?(n=this._matchHandlerAndContext(t,e),c(this._safeEvent(),(function(e){o._spliceMatches(e,n)}))):(n=this._matchContext(e),c(this._safeEvent(),(function(e){o._spliceMatches(e,n)})))},d.prototype.off=function(e,t){r(e)?this._offByEventName(e,t):arguments.length?l(e)?this._offByHandler(e):s(e)&&this._offByObject(e,t):(this.events={},this.contexts=[])},d.prototype.fire=function(e){this.invoke.apply(this,arguments)},d.prototype.invoke=function(e){var t,n,o,i;if(!this.hasListener(e))return!0;for(t=this._safeEvent(e),n=Array.prototype.slice.call(arguments,1),o=0;t[o];){if(!1===(i=t[o]).handler.apply(i.context,n))return!1;o+=1}return!0},d.prototype.hasListener=function(e){return this.getListenerLength(e)>0},d.prototype.getListenerLength=function(e){return this._safeEvent(e).length},e.exports=d},function(e,t,n){"use strict";e.exports=function(e){return"string"==typeof e||e instanceof String}},function(e,t,n){"use strict";var o=/(^#[0-9A-F]{6}$)|(^#[0-9A-F]{3}$)/i,i={leadingZero:function(e,t){var n="",o=0;if((e+"").length>t)return e+"";for(;o<t-1;o+=1)n+="0";return(n+e).slice(-1*t)},isValidRGB:function(e){return o.test(e)},
|
|
// @license RGB <-> HSV conversion utilities based off of http://www.cs.rit.edu/~ncs/color/t_convert.html
|
|
hexToRGB:function(e){return!!i.isValidRGB(e)&&(e=e.substring(1),[parseInt(e.substr(0,2),16),parseInt(e.substr(2,2),16),parseInt(e.substr(4,2),16)])},rgbToHEX:function(e,t,n){var o="#"+i.leadingZero(e.toString(16),2)+i.leadingZero(t.toString(16),2)+i.leadingZero(n.toString(16),2);return!!i.isValidRGB(o)&&o},rgbToHSV:function(e,t,n){var o,i,r,s,a,l;if(e/=255,t/=255,n/=255,a=o=Math.max(e,t,n),l=o-(i=Math.min(e,t,n)),s=0===o?0:l/o,o===i)r=0;else{switch(o){case e:r=(t-n)/l+(t<n?6:0);break;case t:r=(n-e)/l+2;break;case n:r=(e-t)/l+4}r/=6}return[Math.round(360*r),Math.round(100*s),Math.round(100*a)]},hsvToRGB:function(e,t,n){var o,i,r,s,a,l,c,u;if(e=Math.max(0,Math.min(360,e)),t=Math.max(0,Math.min(100,t)),n=Math.max(0,Math.min(100,n)),n/=100,0===(t/=100))return o=i=r=n,[Math.round(255*o),Math.round(255*i),Math.round(255*r)];switch(l=n*(1-t),c=n*(1-t*(a=(e/=60)-(s=Math.floor(e)))),u=n*(1-t*(1-a)),s){case 0:o=n,i=u,r=l;break;case 1:o=c,i=n,r=l;break;case 2:o=l,i=n,r=u;break;case 3:o=l,i=c,r=n;break;case 4:o=u,i=l,r=n;break;default:o=n,i=l,r=c}return[Math.round(255*o),Math.round(255*i),Math.round(255*r)]}};e.exports=i},function(e,t,n){"use strict";e.exports=function(e){return e instanceof Function}},function(e,t,n){"use strict";var o=n(11),i=n(2),r=n(26);function s(e,t,n,o){function s(t){n.call(o||e,t||window.event)}"addEventListener"in e?e.addEventListener(t,s):"attachEvent"in e&&e.attachEvent("on"+t,s),function(e,t,n,o){var s=r(e,t),a=!1;i(s,(function(e){return e.handler!==n||(a=!0,!1)})),a||s.push({handler:n,wrappedHandler:o})}(e,t,n,s)}e.exports=function(e,t,n,r){o(t)?i(t.split(/\s+/g),(function(t){s(e,t,n,r)})):i(t,(function(t,o){s(e,o,t,n)}))}},function(e,t,n){"use strict";e.exports=function(e){e.preventDefault?e.preventDefault():e.returnValue=!1}},function(e,t,n){"use strict";e.exports=function(e){return e.replace(/([A-Z])/g,(function(e){return"-"+e.toLowerCase()}))}},function(e,t,n){"use strict";var o=n(11),i=n(2),r=n(26);function s(e,t,n){var o,s=r(e,t);n?(i(s,(function(i,r){return n!==i.handler||(a(e,t,i.wrappedHandler),o=r,!1)})),s.splice(o,1)):(i(s,(function(n){a(e,t,n.wrappedHandler)})),s.splice(0,s.length))}function a(e,t,n){"removeEventListener"in e?e.removeEventListener(t,n):"detachEvent"in e&&e.detachEvent("on"+t,n)}e.exports=function(e,t,n){o(t)?i(t.split(/\s+/g),(function(t){s(e,t,n)})):i(t,(function(t,n){s(e,n,t)}))}},function(e,t,n){"use strict";var o=n(50);e.exports=function(e,t){var n=o(t.prototype);n.constructor=e,e.prototype=n}},function(e,t,n){"use strict";var o=n(6),i=n(7),r=n(0),s=n(1),a=n(20),l=n(13),c=n(21),u=n(4),d=Array.prototype.slice;function h(e){this.items={},this.length=0,l(e)&&(this.getItemID=e)}h.and=function(e){var t;return e=d.call(arguments),t=e.length,function(n){for(var o=0;o<t;o+=1)if(!e[o].call(null,n))return!1;return!0}},h.or=function(e){var t;return e=d.call(arguments),t=e.length,function(n){for(var o=1,i=e[0].call(null,n);o<t;o+=1)i=i||e[o].call(null,n);return i}},h.merge=function(e){var t={},n=new h(e.getItemID);return o(arguments,(function(e){r(t,e.items)})),n.items=t,n.length=u.getLength(n.items),n},h.prototype.getItemID=function(e){return e._id+""},h.prototype.add=function(e){var t,n;arguments.length>1?o(d.call(arguments),(function(e){this.add(e)}),this):(t=this.getItemID(e),(n=this.items)[t]||(this.length+=1),n[t]=e)},h.prototype.remove=function(e){var t,n,o=[];return this.length?arguments.length>1?o=u.map(d.call(arguments),(function(e){return this.remove(e)}),this):(t=this.items,c(e)&&(e=this.getItemID(e)),t[e]?(this.length-=1,n=t[e],delete t[e],n):o):o},h.prototype.clear=function(){this.items={},this.length=0},h.prototype.has=function(e){var t,n;return!!this.length&&(t=l(e),n=!1,t?this.each((function(t){return!0!==e(t)||(n=!0,!1)})):(e=c(e)?this.getItemID(e):e,n=a(this.items[e])),n)},h.prototype.doWhenHas=function(e,t,n){var o=this.items[e];a(o)&&t.call(n||this,o)},h.prototype.find=function(e){var t=new h;return this.hasOwnProperty("getItemID")&&(t.getItemID=this.getItemID),this.each((function(n){!0===e(n)&&t.add(n)})),t},h.prototype.groupBy=function(e,t){var n,i,r={},a=l(e),c=this.getItemID;if(s(e)){if(o(e,(function(e){r[e+""]=new h(c)})),!t)return r;e=t,a=!0}return this.each((function(t){a?i=e(t):(i=t[e],l(i)&&(i=i.apply(t))),(n=r[i])||(n=r[i]=new h(c)),n.add(t)})),r},h.prototype.single=function(){var e;return this.each((function(t){return e=t,!1}),this),e},h.prototype.sort=function(e){var t=[];return this.each((function(e){t.push(e)})),l(e)&&(t=t.sort(e)),t},h.prototype.each=function(e,t){i(this.items,e,t||this)},h.prototype.toArray=function(){return this.length?u.map(this.items,(function(e){return e})):[]},e.exports=h},function(e,t,n){"use strict";var o=n(3),i=n(36);e.exports=function(e){return!o(e)&&!i(e)}},function(e,t,n){"use strict";e.exports=function(e){return e===Object(e)}},function(e,t,n){"use strict";var o,i,r,s,a,l,c,u,d,h,f={chrome:!1,firefox:!1,safari:!1,msie:!1,edge:!1,others:!1,version:0};window&&window.navigator&&(r=window.navigator,s=r.appName.replace(/\s/g,"_"),a=r.userAgent,l=/MSIE\s([0-9]+[.0-9]*)/,c=/Trident.*rv:11\./,u=/Edge\/(\d+)\./,d={firefox:/Firefox\/(\d+)\./,chrome:/Chrome\/(\d+)\./,safari:/Version\/([\d.]+).*Safari\/(\d+)/},(h={Microsoft_Internet_Explorer:function(){var e=a.match(l);e?(f.msie=!0,f.version=parseFloat(e[1])):f.others=!0},Netscape:function(){var e=!1;if(c.exec(a))f.msie=!0,f.version=11,e=!0;else if(u.exec(a))f.edge=!0,f.version=a.match(u)[1],e=!0;else for(o in d)if(d.hasOwnProperty(o)&&(i=a.match(d[o]))&&i.length>1){f[o]=e=!0,f.version=parseFloat(i[1]||0);break}e||(f.others=!0)}})[s]&&h[s]()),e.exports=f},function(e,t,n){"use strict";var o=n(3);e.exports=function(e){return e&&e.className?o(e.className.baseVal)?e.className:e.className.baseVal:""}},function(e,t,n){"use strict";(function(t){var o=n(10),i=n(42),r=n(44),s=n(47),a=n(28),l=n(17),c=n(14),u=n(15),d=n(0);function h(e,t){c(t,"mousedown",this._onMouseDown,this),this.options=d({distance:10},e),this.container=t,this._isMoved=!1,this._distance=0,this._dragStartFired=!1,this._dragStartEventData=null}h.prototype.destroy=function(){l(this.container,"mousedown",this._onMouseDown),this.options=this.container=this._isMoved=this._distance=this._dragStartFired=this._dragStartEventData=null},h.prototype._toggleDragEvent=function(e){var n=this.container;e?(i(n),c(window,"dragstart",u),c(t.document,{mousemove:this._onMouseMove,mouseup:this._onMouseUp},this)):(r(n),l(window,"dragstart",u),l(t.document,{mousemove:this._onMouseMove,mouseup:this._onMouseUp}))},h.prototype._getEventData=function(e){return{target:a(e),originEvent:e}},h.prototype._onMouseDown=function(e){0===s(e)&&(this._distance=0,this._dragStartFired=!1,this._dragStartEventData=this._getEventData(e),this._toggleDragEvent(!0))},h.prototype._onMouseMove=function(e){var t=this.options.distance;u(e),this._isMoved=!0,this._distance<t?this._distance+=1:this._dragStartFired||(this._dragStartFired=!0,this.invoke("dragStart",this._dragStartEventData))?this.fire("drag",this._getEventData(e)):this._toggleDragEvent(!1)},h.prototype._onMouseUp=function(e){if(this._toggleDragEvent(!1),this._isMoved)return this._isMoved=!1,void this.fire("dragEnd",this._getEventData(e));this.fire("click",this._getEventData(e))},o.mixin(h),e.exports=h}).call(this,n(25))},function(e,t){var n;n=function(){return this}();try{n=n||new Function("return this")()}catch(e){"object"==typeof window&&(n=window)}e.exports=n},function(e,t,n){"use strict";var o="_feEventKey";e.exports=function(e,t){var n,i=e[o];return i||(i=e[o]={}),(n=i[t])||(n=i[t]=[]),n}},function(e,t,n){"use strict";e.exports=function(e){var t,n,o=document.documentElement.style;for(t=0,n=e.length;t<n;t+=1)if(e[t]in o)return e[t];return!1}},function(e,t,n){"use strict";e.exports=function(e){return e.target||e.srcElement}},function(e,t,n){"use strict";var o=n(10),i=n(28),r=n(17),s=n(14),a=n(30),l=n(0),c=n(18),u=n(9),d=n(12),h=n(8),f=n(51);function p(e,t){this.options=l({cssPrefix:"tui-colorpicker-",preset:["#181818","#282828","#383838","#585858","#B8B8B8","#D8D8D8","#E8E8E8","#F8F8F8","#AB4642","#DC9656","#F7CA88","#A1B56C","#86C1B9","#7CAFC2","#BA8BAF","#A16946"],detailTxt:"Detail"},e),t=u.appendHTMLElement("div",t,this.options.cssPrefix+"palette-container"),h.call(this,e,t)}c(p,h),p.prototype._onClick=function(e){var t=this.options,n=i(e),o={};if(a(n,t.cssPrefix+"palette-button"))return o.color=n.value,void this.fire("_selectColor",o);a(n,t.cssPrefix+"palette-toggle-slider")&&this.fire("_toggleSlider")},p.prototype._onChange=function(e){var t=this.options,n=i(e),o={};a(n,t.cssPrefix+"palette-hex")&&(o.color=n.value,this.fire("_selectColor",o))},p.prototype._beforeDestroy=function(){this._toggleEvent(!1)},p.prototype._toggleEvent=function(e){var t,n=this.options,o=this.container,i=e?s:r;i(o,"click",this._onClick,this),(t=o.querySelector("."+n.cssPrefix+"palette-hex",o))&&i(t,"change",this._onChange,this)},p.prototype.render=function(e){var t,n=this.options;this._toggleEvent(!1),t=f({cssPrefix:n.cssPrefix,preset:n.preset,detailTxt:n.detailTxt,color:e,isValidRGB:d.isValidRGB,getItemClass:function(e){return e?"":" "+n.cssPrefix+"color-transparent"},isSelected:function(t){return t===e?" "+n.cssPrefix+"selected":""}}),this.container.innerHTML=t,this._toggleEvent(!0)},o.mixin(p),e.exports=p},function(e,t,n){"use strict";var o=n(5),i=n(23);e.exports=function(e,t){var n;return e.classList?e.classList.contains(t):(n=i(e).split(/\s+/),o(t,n)>-1)}},function(e,t,n){"use strict";var o=n(10),i=n(53),r=n(54),s=n(30),a=n(0),l=n(18),c=n(9),u=n(32),d=n(12),h=n(8),f=n(24),p=n(57),m=[-7,112],v=[-3,115],g=359.99;function y(e,t){(t=c.appendHTMLElement("div",t,e.cssPrefix+"slider-container")).style.display="none",h.call(this,e,t),this.options=a({color:"#f8f8f8",cssPrefix:"tui-colorpicker-"},e),this._dragDataCache={},this.sliderHandleElement=null,this.huebarHandleElement=null,this.baseColorElement=null,this.drag=new f({distance:0},t),this.drag.on({dragStart:this._onDragStart,drag:this._onDrag,dragEnd:this._onDragEnd,click:this._onClick},this)}l(y,h),y.prototype._beforeDestroy=function(){this.drag.off(),this.drag=this.options=this._dragDataCache=this.sliderHandleElement=this.huebarHandleElement=this.baseColorElement=null},y.prototype.toggle=function(e){this.container.style.display=e?"block":"none"},y.prototype.isVisible=function(){return"block"===this.container.style.display},y.prototype.render=function(e){var t,n,o=this.container,i=this.options,r=p.layout;d.isValidRGB(e)&&(r=(r=(r=(r=r.replace(/{{slider}}/,p.slider)).replace(/{{huebar}}/,p.huebar)).replace(/{{cssPrefix}}/g,i.cssPrefix)).replace(/{{id}}/g,i.id),this.container.innerHTML=r,this.sliderHandleElement=o.querySelector("."+i.cssPrefix+"slider-handle"),this.huebarHandleElement=o.querySelector("."+i.cssPrefix+"huebar-handle"),this.baseColorElement=o.querySelector("."+i.cssPrefix+"slider-basecolor"),t=d.hexToRGB(e),n=d.rgbToHSV.apply(null,t),this.moveHue(n[0],!0),this.moveSaturationAndValue(n[1],n[2],!0))},y.prototype._moveColorSliderHandle=function(e,t,n){var o,i=this.sliderHandleElement;t=Math.max(m[0],t),t=Math.min(m[1],t),e=Math.max(m[0],e),e=Math.min(m[1],e),u.setTranslateXY(i,e,t),o=t>50?"white":"black",u.setStrokeColor(i,o),n||this.fire("_selectColor",{color:d.rgbToHEX.apply(null,this.getRGB())})},y.prototype.moveSaturationAndValue=function(e,t,n){var o,i,r,s;e=e||0,t=t||0,o=Math.abs(m[0]),r=e*(i=m[1])/100-o,s=i-t*i/100-o,this._moveColorSliderHandle(r,s,n)},y.prototype._moveColorSliderByPosition=function(e,t){var n=m[0];this._moveColorSliderHandle(e+n,t+n)},y.prototype.getSaturationAndValue=function(){var e=Math.abs(m[0]),t=e+m[1],n=u.getTranslateXY(this.sliderHandleElement);return[(n[1]+e)/t*100,100-(n[0]+e)/t*100]},y.prototype._moveHueHandle=function(e,t){var n,o,i=this.huebarHandleElement,r=this.baseColorElement;e=Math.max(v[0],e),e=Math.min(v[1],e),u.setTranslateY(i,e),n=d.hsvToRGB(this.getHue(),100,100),o=d.rgbToHEX.apply(null,n),u.setGradientColorStop(r,o),t||this.fire("_selectColor",{color:d.rgbToHEX.apply(null,this.getRGB())})},y.prototype.moveHue=function(e,t){var n,o;n=((o=Math.abs(v[0]))+v[1])*(e=e||0)/g-o,this._moveHueHandle(n,t)},y.prototype._moveHueByPosition=function(e){var t=v[0];this._moveHueHandle(e+t)},y.prototype.getHue=function(){var e,t,n=this.huebarHandleElement,o=u.getTranslateXY(n);return t=(e=Math.abs(v[0]))+v[1],(o[0]+e)*g/t},y.prototype.getHSV=function(){var e=this.getSaturationAndValue();return[this.getHue()].concat(e)},y.prototype.getRGB=function(){return d.hsvToRGB.apply(null,this.getHSV())},y.prototype._prepareColorSliderForMouseEvent=function(e){var t=this.options,n=r(e.target,"."+t.cssPrefix+"slider-part");return this._dragDataCache={isColorSlider:s(n,t.cssPrefix+"slider-left"),parentElement:n}},y.prototype._onClick=function(e){var t=this._prepareColorSliderForMouseEvent(e),n=i(e.originEvent,t.parentElement);t.isColorSlider?this._moveColorSliderByPosition(n[0],n[1]):this._moveHueByPosition(n[1]),this._dragDataCache=null},y.prototype._onDragStart=function(e){this._prepareColorSliderForMouseEvent(e)},y.prototype._onDrag=function(e){var t=this._dragDataCache,n=i(e.originEvent,t.parentElement);t.isColorSlider?this._moveColorSliderByPosition(n[0],n[1]):this._moveHueByPosition(n[1])},y.prototype._onDragEnd=function(){this._dragDataCache=null},o.mixin(y),e.exports=y},function(e,t,n){"use strict";var o=n(4).isOldBrowser,i=/[\.\-0-9]+/g,r={getTranslateXY:function(e){var t;return o?(t=e.style,[parseFloat(t.top),parseFloat(t.left)]):(t=e.getAttribute("transform"))?(t=t.match(i),[parseFloat(t[1]),parseFloat(t[0])]):[0,0]},setTranslateXY:function(e,t,n){o?(e.style.left=t+"px",e.style.top=n+"px"):e.setAttribute("transform","translate("+t+","+n+")")},setTranslateY:function(e,t){o?e.style.top=t+"px":e.setAttribute("transform","translate(-6,"+t+")")},setStrokeColor:function(e,t){o?e.strokecolor=t:e.setAttribute("stroke",t)},setGradientColorStop:function(e,t){o?e.color=t:e.setAttribute("stop-color",t)}};e.exports=r},function(e,t,n){n(34),e.exports=n(35)},function(e,t,n){},function(e,t,n){"use strict";var o={Collection:n(19),View:n(8),Drag:n(24),create:n(48),Palette:n(29),Slider:n(31),colorutil:n(12),svgvml:n(32)};e.exports=o},function(e,t,n){"use strict";e.exports=function(e){return null===e}},function(e,t,n){"use strict";var o=n(3),i=n(38);e.exports=function(e,t){var n=location.hostname,r="TOAST UI "+e+" for "+n+": Statistics",s=window.localStorage.getItem(r);(o(window.tui)||!1!==window.tui.usageStatistics)&&(s&&!function(e){return(new Date).getTime()-e>6048e5}(s)||(window.localStorage.setItem(r,(new Date).getTime()),setTimeout((function(){"interactive"!==document.readyState&&"complete"!==document.readyState||i("https://www.google-analytics.com/collect",{v:1,t:"event",tid:t,cid:n,dp:n,dh:e,el:e,ec:"use"})}),1e3)))}},function(e,t,n){"use strict";var o=n(7);e.exports=function(e,t){var n=document.createElement("img"),i="";return o(t,(function(e,t){i+="&"+t+"="+e})),i=i.substring(1),n.src=e+"?"+i,n.style.display="none",document.body.appendChild(n),document.body.removeChild(n),n}},function(e,t,n){"use strict";var o=n(2),i=n(5),r=n(23),s=n(40);e.exports=function(e){var t,n=Array.prototype.slice.call(arguments,1),a=e.classList,l=[];a?o(n,(function(t){e.classList.add(t)})):((t=r(e))&&(n=[].concat(t.split(/\s+/),n)),o(n,(function(e){i(e,l)<0&&l.push(e)})),s(e,l))}},function(e,t,n){"use strict";var o=n(1),i=n(3);e.exports=function(e,t){t=(t=o(t)?t.join(" "):t).replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,""),i(e.className.baseVal)?e.className=t:e.className.baseVal=t}},function(e,t,n){"use strict";e.exports=function(e){return"number"==typeof e||e instanceof Number}},function(e,t,n){"use strict";var o=n(14),i=n(15),r=n(43),s=n(27),a="onselectstart"in document,l=s(["userSelect","WebkitUserSelect","OUserSelect","MozUserSelect","msUserSelect"]);e.exports=function(e){e||(e=document),a?o(e,"selectstart",i):(e=e===document?document.documentElement:e,r(e,"prevUserSelect",e.style[l]),e.style[l]="none")}},function(e,t,n){"use strict";var o=n(16);e.exports=function(e,t,n){e.dataset?e.dataset[t]=n:e.setAttribute("data-"+o(t),n)}},function(e,t,n){"use strict";var o=n(17),i=n(15),r=n(45),s=n(46),a=n(27),l="onselectstart"in document,c="prevUserSelect",u=a(["userSelect","WebkitUserSelect","OUserSelect","MozUserSelect","msUserSelect"]);e.exports=function(e){e||(e=document),l?o(e,"selectstart",i):((e=e===document?document.documentElement:e).style[u]=r(e,c)||"auto",s(e,c))}},function(e,t,n){"use strict";var o=n(16);e.exports=function(e,t){return e.dataset?e.dataset[t]:e.getAttribute("data-"+o(t))}},function(e,t,n){"use strict";var o=n(16);e.exports=function(e,t){e.dataset?delete e.dataset[t]:e.removeAttribute("data-"+o(t))}},function(e,t,n){"use strict";var o=n(22),i=n(5),r=["0","1","3","5","7"],s=["2","6"],a=["4"];e.exports=function(e){return o.msie&&o.version<=8?function(e){var t=String(e.button);if(i(t,r)>-1)return 0;if(i(t,s)>-1)return 2;if(i(t,a)>-1)return 1;return null}(e):e.button}},function(e,t,n){"use strict";var o=n(10),i=n(0),r=n(4),s=n(12),a=n(49),l=n(29),c=n(31),u=0;function d(e){var t;if(!(this instanceof d))return new d(e);if(!(e=this.options=i({container:null,color:"#f8f8f8",preset:["#181818","#282828","#383838","#585858","#b8b8b8","#d8d8d8","#e8e8e8","#f8f8f8","#ab4642","#dc9656","#f7ca88","#a1b56c","#86c1b9","#7cafc2","#ba8baf","#a16946"],cssPrefix:"tui-colorpicker-",detailTxt:"Detail",id:u+=1,usageStatistics:!0},e)).container)throw new Error("ColorPicker(): need container option.");t=this.layout=new a(e,e.container),this.palette=new l(e,t.container),this.palette.on({_selectColor:this._onSelectColorInPalette,_toggleSlider:this._onToggleSlider},this),this.slider=new c(e,t.container),this.slider.on("_selectColor",this._onSelectColorInSlider,this),t.addChild(this.palette),t.addChild(this.slider),this.render(e.color),e.usageStatistics&&r.sendHostName()}d.prototype._onSelectColorInPalette=function(e){var t=e.color,n=this.options;s.isValidRGB(t)||""===t?(this.fire("selectColor",{color:t,origin:"palette"}),n.color!==t&&(n.color=t,this.render(t))):this.render()},d.prototype._onToggleSlider=function(){this.slider.toggle(!this.slider.isVisible())},d.prototype._onSelectColorInSlider=function(e){var t=e.color,n=this.options;this.fire("selectColor",{color:t,origin:"slider"}),n.color!==t&&(n.color=t,this.palette.render(t))},d.prototype.setColor=function(e){if(!s.isValidRGB(e))throw new Error("ColorPicker#setColor(): need valid hex string color value");this.options.color=e,this.render(e)},d.prototype.getColor=function(){return this.options.color},d.prototype.toggle=function(e){this.layout.container.style.display=e?"block":"none"},d.prototype.render=function(e){this.layout.render(e||this.options.color)},d.prototype.destroy=function(){this.layout.destroy(),this.options.container.innerHTML="",this.layout=this.slider=this.palette=this.options=null},o.mixin(d),e.exports=d},function(e,t,n){"use strict";var o=n(0),i=n(18),r=n(9),s=n(8);function a(e,t){this.options=o({cssPrefix:"tui-colorpicker-"},e),t=r.appendHTMLElement("div",t,this.options.cssPrefix+"container"),s.call(this,e,t),this.render()}i(a,s),a.prototype.render=function(e){this.recursive((function(t){t.render(e)}),!0)},e.exports=a},function(e,t,n){"use strict";e.exports=function(e){function t(){}return t.prototype=e,new t}},function(e,t,n){"use strict";var o=n(52);e.exports=function(e){var t=['<ul class="{{cssPrefix}}clearfix">',"{{each preset}}",['<li><input class="{{cssPrefix}}palette-button{{isSelected @this}}{{getItemClass @this}}" type="button"',"{{if isValidRGB @this}}",' style="background-color:{{@this}};color:{{@this}}"',"{{/if}}",' title="{{@this}}" value="{{@this}}" /></li>'].join(""),"{{/each}}","</ul>",'<div class="{{cssPrefix}}clearfix" style="overflow:hidden">','<input type="button" class="{{cssPrefix}}palette-toggle-slider" value="{{detailTxt}}" />','<input type="text" class="{{cssPrefix}}palette-hex" value="{{color}}" maxlength="7" />','<span class="{{cssPrefix}}palette-preview" style="background-color:{{color}};color:{{color}}">{{color}}</span>',"</div>"].join("\n");return o(t,e)}},function(e,t,n){"use strict";var o=n(5),i=n(2),r=n(1),s=n(11),a=n(0),l=/{{\s?|\s?}}/g,c=/^[a-zA-Z0-9_@]+\[[a-zA-Z0-9_@"']+\]$/,u=/\[\s?|\s?\]/,d=/^[a-zA-Z_]+\.[a-zA-Z_]+$/,h=/\./,f=/^["']\w+["']$/,p=/"|'/g,m=/^-?\d+\.?\d*$/,v={if:function(e,t,n){var o=function(e,t){var n=[e],o=[],r=0,s=0;return i(t,(function(e,i){0===e.indexOf("if")?r+=1:"/if"===e?r-=1:r||0!==e.indexOf("elseif")&&"else"!==e||(n.push("else"===e?["true"]:e.split(" ").slice(1)),o.push(t.slice(s,i)),s=i+1)})),o.push(t.slice(s)),{exps:n,sourcesInsideIf:o}}(e,t),r=!1,s="";return i(o.exps,(function(e,t){return(r=b(e,n))&&(s=j(o.sourcesInsideIf[t],n)),!r})),s},each:function(e,t,n){var o=b(e,n),s=r(o)?"@index":"@key",l={},c="";return i(o,(function(e,o){l[s]=o,l["@this"]=e,a(n,l),c+=j(t.slice(),n)})),c},with:function(e,t,n){var i=o("as",e),r=e[i+1],s=b(e.slice(0,i),n),l={};return l[r]=s,j(t,a(n,l))||""}},g=3==="a".split(/a/).length?function(e,t){return e.split(t)}:function(e,t){var n,o,i=[],r=0;for(t.global||(t=new RegExp(t,"g")),n=t.exec(e);null!==n;)o=n.index,i.push(e.slice(r,o)),r=o+n[0].length,n=t.exec(e);return i.push(e.slice(r)),i};function y(e,t){var n,o=t[e];return"true"===e?o=!0:"false"===e?o=!1:f.test(e)?o=e.replace(p,""):c.test(e)?o=y((n=e.split(u))[0],t)[y(n[1],t)]:d.test(e)?o=y((n=e.split(h))[0],t)[n[1]]:m.test(e)&&(o=parseFloat(e)),o}function _(e,t,n){for(var o,i,r,a,l=v[e],c=1,u=2,d=t[u];c&&s(d);)0===d.indexOf(e)?c+=1:0===d.indexOf("/"+e)&&(c-=1,o=u),d=t[u+=2];if(c)throw Error(e+" needs {{/"+e+"}} expression.");return t[0]=l(t[0].split(" ").slice(1),(i=0,r=o,(a=t.splice(i+1,r-i)).pop(),a),n),t}function b(e,t){var n=y(e[0],t);return n instanceof Function?function(e,t,n){var o=[];return i(t,(function(e){o.push(y(e,n))})),e.apply(null,o)}(n,e.slice(1),t):n}function j(e,t){for(var n,o,i,r=1,a=e[r];s(a);)o=(n=a.split(" "))[0],v[o]?(i=_(o,e.splice(r,e.length-r),t),e=e.concat(i)):e[r]=b(n,t),a=e[r+=2];return e.join("")}e.exports=function(e,t){return j(g(e,l),t)}},function(e,t,n){"use strict";var o=n(1);e.exports=function(e,t){var n,i=o(e),r=i?e[0]:e.clientX,s=i?e[1]:e.clientY;return t?[r-(n=t.getBoundingClientRect()).left-t.clientLeft,s-n.top-t.clientTop]:[r,s]}},function(e,t,n){"use strict";var o=n(55);e.exports=function(e,t){var n=e.parentNode;if(o(e,t))return e;for(;n&&n!==document;){if(o(n,t))return n;n=n.parentNode}return null}},function(e,t,n){"use strict";var o=n(5),i=n(56),r=Element.prototype,s=r.matches||r.webkitMatchesSelector||r.mozMatchesSelector||r.msMatchesSelector||function(e){var t=this.document||this.ownerDocument;return o(this,i(t.querySelectorAll(e)))>-1};e.exports=function(e,t){return s.call(e,t)}},function(e,t,n){"use strict";var o=n(6);e.exports=function(e){var t;try{t=Array.prototype.slice.call(e)}catch(n){t=[],o(e,(function(e){t.push(e)}))}return t}},function(e,t,n){"use strict";(function(t){var o=n(4).isOldBrowser,i=['<div class="{{cssPrefix}}slider-left {{cssPrefix}}slider-part">{{slider}}</div>','<div class="{{cssPrefix}}slider-right {{cssPrefix}}slider-part">{{huebar}}</div>'].join("\n"),r=['<svg class="{{cssPrefix}}svg {{cssPrefix}}svg-slider">',"<defs>",'<linearGradient id="{{cssPrefix}}svg-fill-color-{{id}}" x1="0%" y1="0%" x2="100%" y2="0%">','<stop offset="0%" stop-color="rgb(255,255,255)" />','<stop class="{{cssPrefix}}slider-basecolor" offset="100%" stop-color="rgb(255,0,0)" />',"</linearGradient>",'<linearGradient id="{{cssPrefix}}svn-fill-black-{{id}}" x1="0%" y1="0%" x2="0%" y2="100%">','<stop offset="0%" style="stop-color:rgb(0,0,0);stop-opacity:0" />','<stop offset="100%" style="stop-color:rgb(0,0,0);stop-opacity:1" />',"</linearGradient>","</defs>",'<rect width="100%" height="100%" fill="url(#{{cssPrefix}}svg-fill-color-{{id}})"></rect>','<rect width="100%" height="100%" fill="url(#{{cssPrefix}}svn-fill-black-{{id}})"></rect>','<path transform="translate(0,0)" class="{{cssPrefix}}slider-handle" d="M0 7.5 L15 7.5 M7.5 15 L7.5 0 M2 7 a5.5 5.5 0 1 1 0 1 Z" stroke="black" stroke-width="0.75" fill="none" />',"</svg>"].join("\n"),s=['<div class="{{cssPrefix}}vml-slider">','<v:rect strokecolor="none" class="{{cssPrefix}}vml {{cssPrefix}}vml-slider-bg">','<v:fill class="{{cssPrefix}}vml {{cssPrefix}}slider-basecolor" type="gradient" method="none" color="#ff0000" color2="#fff" angle="90" />',"</v:rect>",'<v:rect strokecolor="#ccc" class="{{cssPrefix}}vml {{cssPrefix}}vml-slider-bg">','<v:fill type="gradient" method="none" color="black" color2="white" o:opacity2="0%" class="{{cssPrefix}}vml" />',"</v:rect>",'<v:shape class="{{cssPrefix}}vml {{cssPrefix}}slider-handle" coordsize="1 1" style="width:1px;height:1px;"path="m 0,7 l 14,7 m 7,14 l 7,0 ar 12,12 2,2 z" filled="false" stroked="true" />',"</div>"].join("\n"),a=['<svg class="{{cssPrefix}}svg {{cssPrefix}}svg-huebar">',"<defs>",'<linearGradient id="g-{{id}}" x1="0%" y1="0%" x2="0%" y2="100%">','<stop offset="0%" stop-color="rgb(255,0,0)" />','<stop offset="16.666%" stop-color="rgb(255,255,0)" />','<stop offset="33.333%" stop-color="rgb(0,255,0)" />','<stop offset="50%" stop-color="rgb(0,255,255)" />','<stop offset="66.666%" stop-color="rgb(0,0,255)" />','<stop offset="83.333%" stop-color="rgb(255,0,255)" />','<stop offset="100%" stop-color="rgb(255,0,0)" />',"</linearGradient>","</defs>",'<rect width="18px" height="100%" fill="url(#g-{{id}})"></rect>','<path transform="translate(-6,-3)" class="{{cssPrefix}}huebar-handle" d="M0 0 L4 4 L0 8 L0 0 Z" fill="black" stroke="none" />',"</svg>"].join("\n"),l=['<div class="{{cssPrefix}}vml-huebar">','<v:rect strokecolor="#ccc" class="{{cssPrefix}}vml {{cssPrefix}}vml-huebar-bg">','<v:fill type="gradient" method="none" colors="0% rgb(255,0,0), 16.666% rgb(255,255,0), 33.333% rgb(0,255,0), 50% rgb(0,255,255), 66.666% rgb(0,0,255), 83.333% rgb(255,0,255), 100% rgb(255,0,0)" angle="180" class="{{cssPrefix}}vml" />',"</v:rect>",'<v:shape class="{{cssPrefix}}vml {{cssPrefix}}huebar-handle" coordsize="1 1" style="width:1px;height:1px;position:absolute;z-index:1;right:22px;top:-3px;"path="m 0,0 l 4,4 l 0,8 l 0,0 z" filled="true" fillcolor="black" stroked="false" />',"</div>"].join("\n");o&&t.document.namespaces.add("v","urn:schemas-microsoft-com:vml"),e.exports={layout:i,slider:o?s:r,huebar:o?l:a}}).call(this,n(25))}])})),
|
|
/*!
|
|
* tui-image-editor.js
|
|
* @version 3.14.3
|
|
* @author NHN. FE Development Lab <dl_javascript@nhn.com>
|
|
* @license MIT
|
|
*/
|
|
function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t(require("fabric").fabric,require("tui-code-snippet"),require("tui-color-picker")):"function"==typeof define&&define.amd?define(["fabric","tui-code-snippet","tui-color-picker"],t):"object"==typeof exports?exports.ImageEditor=t(require("fabric").fabric,require("tui-code-snippet"),require("tui-color-picker")):(e.tui=e.tui||{},e.tui.ImageEditor=t(e.fabric,e.tui.util,e.tui.colorPicker))}(window,(function(e,t,n){return function(e){var t={};function n(o){if(t[o])return t[o].exports;var i=t[o]={i:o,l:!1,exports:{}};return e[o].call(i.exports,i,i.exports,n),i.l=!0,i.exports}return n.m=e,n.c=t,n.d=function(e,t,o){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:o})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var o=Object.create(null);if(n.r(o),Object.defineProperty(o,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var i in e)n.d(o,i,function(t){return e[t]}.bind(null,i));return o},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="/dist",n(n.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(e,t,n){n(/*! ../../modules/es.object.to-string */"./node_modules/core-js-pure/modules/es.object.to-string.js"),n(/*! ../../modules/es.string.iterator */"./node_modules/core-js-pure/modules/es.string.iterator.js"),n(/*! ../../modules/web.dom-collections.iterator */"./node_modules/core-js-pure/modules/web.dom-collections.iterator.js"),n(/*! ../../modules/es.promise */"./node_modules/core-js-pure/modules/es.promise.js"),n(/*! ../../modules/es.promise.all-settled */"./node_modules/core-js-pure/modules/es.promise.all-settled.js"),n(/*! ../../modules/es.promise.finally */"./node_modules/core-js-pure/modules/es.promise.finally.js");var o=n(/*! ../../internals/path */"./node_modules/core-js-pure/internals/path.js");e.exports=o.Promise},"./node_modules/core-js-pure/features/promise/index.js":
|
|
/*!*************************************************************!*\
|
|
!*** ./node_modules/core-js-pure/features/promise/index.js ***!
|
|
\*************************************************************/
|
|
/*! no static exports found */function(e,t,n){var o=n(/*! ../../es/promise */"./node_modules/core-js-pure/es/promise/index.js");n(/*! ../../modules/esnext.aggregate-error */"./node_modules/core-js-pure/modules/esnext.aggregate-error.js"),n(/*! ../../modules/esnext.promise.all-settled */"./node_modules/core-js-pure/modules/esnext.promise.all-settled.js"),n(/*! ../../modules/esnext.promise.try */"./node_modules/core-js-pure/modules/esnext.promise.try.js"),n(/*! ../../modules/esnext.promise.any */"./node_modules/core-js-pure/modules/esnext.promise.any.js"),e.exports=o},"./node_modules/core-js-pure/internals/a-function.js":
|
|
/*!***********************************************************!*\
|
|
!*** ./node_modules/core-js-pure/internals/a-function.js ***!
|
|
\***********************************************************/
|
|
/*! no static exports found */function(e,t){e.exports=function(e){if("function"!=typeof e)throw TypeError(String(e)+" is not a function");return e}},"./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(e,t,n){var o=n(/*! ../internals/is-object */"./node_modules/core-js-pure/internals/is-object.js");e.exports=function(e){if(!o(e)&&null!==e)throw TypeError("Can't set "+String(e)+" as a prototype");return e}},"./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(e,t){e.exports=function(){}},"./node_modules/core-js-pure/internals/an-instance.js":
|
|
/*!************************************************************!*\
|
|
!*** ./node_modules/core-js-pure/internals/an-instance.js ***!
|
|
\************************************************************/
|
|
/*! no static exports found */function(e,t){e.exports=function(e,t,n){if(!(e instanceof t))throw TypeError("Incorrect "+(n?n+" ":"")+"invocation");return e}},"./node_modules/core-js-pure/internals/an-object.js":
|
|
/*!**********************************************************!*\
|
|
!*** ./node_modules/core-js-pure/internals/an-object.js ***!
|
|
\**********************************************************/
|
|
/*! no static exports found */function(e,t,n){var o=n(/*! ../internals/is-object */"./node_modules/core-js-pure/internals/is-object.js");e.exports=function(e){if(!o(e))throw TypeError(String(e)+" is not an object");return e}},"./node_modules/core-js-pure/internals/array-includes.js":
|
|
/*!***************************************************************!*\
|
|
!*** ./node_modules/core-js-pure/internals/array-includes.js ***!
|
|
\***************************************************************/
|
|
/*! no static exports found */function(e,t,n){var o=n(/*! ../internals/to-indexed-object */"./node_modules/core-js-pure/internals/to-indexed-object.js"),i=n(/*! ../internals/to-length */"./node_modules/core-js-pure/internals/to-length.js"),r=n(/*! ../internals/to-absolute-index */"./node_modules/core-js-pure/internals/to-absolute-index.js"),s=function(e){return function(t,n,s){var a,l=o(t),c=i(l.length),u=r(s,c);if(e&&n!=n){for(;c>u;)if((a=l[u++])!=a)return!0}else for(;c>u;u++)if((e||u in l)&&l[u]===n)return e||u||0;return!e&&-1}};e.exports={includes:s(!0),indexOf:s(!1)}},"./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(e,t,n){var o=n(/*! ../internals/an-object */"./node_modules/core-js-pure/internals/an-object.js");e.exports=function(e,t,n,i){try{return i?t(o(n)[0],n[1]):t(n)}catch(t){var r=e.return;throw void 0!==r&&o(r.call(e)),t}}},"./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(e,t,n){var o=n(/*! ../internals/well-known-symbol */"./node_modules/core-js-pure/internals/well-known-symbol.js")("iterator"),i=!1;try{var r=0,s={next:function(){return{done:!!r++}},return:function(){i=!0}};s[o]=function(){return this},Array.from(s,(function(){throw 2}))}catch(e){}e.exports=function(e,t){if(!t&&!i)return!1;var n=!1;try{var r={};r[o]=function(){return{next:function(){return{done:n=!0}}}},e(r)}catch(e){}return n}},"./node_modules/core-js-pure/internals/classof-raw.js":
|
|
/*!************************************************************!*\
|
|
!*** ./node_modules/core-js-pure/internals/classof-raw.js ***!
|
|
\************************************************************/
|
|
/*! no static exports found */function(e,t){var n={}.toString;e.exports=function(e){return n.call(e).slice(8,-1)}},"./node_modules/core-js-pure/internals/classof.js":
|
|
/*!********************************************************!*\
|
|
!*** ./node_modules/core-js-pure/internals/classof.js ***!
|
|
\********************************************************/
|
|
/*! no static exports found */function(e,t,n){var o=n(/*! ../internals/to-string-tag-support */"./node_modules/core-js-pure/internals/to-string-tag-support.js"),i=n(/*! ../internals/classof-raw */"./node_modules/core-js-pure/internals/classof-raw.js"),r=n(/*! ../internals/well-known-symbol */"./node_modules/core-js-pure/internals/well-known-symbol.js")("toStringTag"),s="Arguments"==i(function(){return arguments}());e.exports=o?i:function(e){var t,n,o;return void 0===e?"Undefined":null===e?"Null":"string"==typeof(n=function(e,t){try{return e[t]}catch(e){}}(t=Object(e),r))?n:s?i(t):"Object"==(o=i(t))&&"function"==typeof t.callee?"Arguments":o}},"./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(e,t,n){var o=n(/*! ../internals/fails */"./node_modules/core-js-pure/internals/fails.js");e.exports=!o((function(){function e(){}return e.prototype.constructor=null,Object.getPrototypeOf(new e)!==e.prototype}))},"./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(e,t,n){"use strict";var o=n(/*! ../internals/iterators-core */"./node_modules/core-js-pure/internals/iterators-core.js").IteratorPrototype,i=n(/*! ../internals/object-create */"./node_modules/core-js-pure/internals/object-create.js"),r=n(/*! ../internals/create-property-descriptor */"./node_modules/core-js-pure/internals/create-property-descriptor.js"),s=n(/*! ../internals/set-to-string-tag */"./node_modules/core-js-pure/internals/set-to-string-tag.js"),a=n(/*! ../internals/iterators */"./node_modules/core-js-pure/internals/iterators.js"),l=function(){return this};e.exports=function(e,t,n){var c=t+" Iterator";return e.prototype=i(o,{next:r(1,n)}),s(e,c,!1,!0),a[c]=l,e}},"./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(e,t,n){var o=n(/*! ../internals/descriptors */"./node_modules/core-js-pure/internals/descriptors.js"),i=n(/*! ../internals/object-define-property */"./node_modules/core-js-pure/internals/object-define-property.js"),r=n(/*! ../internals/create-property-descriptor */"./node_modules/core-js-pure/internals/create-property-descriptor.js");e.exports=o?function(e,t,n){return i.f(e,t,r(1,n))}:function(e,t,n){return e[t]=n,e}},"./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(e,t){e.exports=function(e,t){return{enumerable:!(1&e),configurable:!(2&e),writable:!(4&e),value:t}}},"./node_modules/core-js-pure/internals/define-iterator.js":
|
|
/*!****************************************************************!*\
|
|
!*** ./node_modules/core-js-pure/internals/define-iterator.js ***!
|
|
\****************************************************************/
|
|
/*! no static exports found */function(e,t,n){"use strict";var o=n(/*! ../internals/export */"./node_modules/core-js-pure/internals/export.js"),i=n(/*! ../internals/create-iterator-constructor */"./node_modules/core-js-pure/internals/create-iterator-constructor.js"),r=n(/*! ../internals/object-get-prototype-of */"./node_modules/core-js-pure/internals/object-get-prototype-of.js"),s=n(/*! ../internals/object-set-prototype-of */"./node_modules/core-js-pure/internals/object-set-prototype-of.js"),a=n(/*! ../internals/set-to-string-tag */"./node_modules/core-js-pure/internals/set-to-string-tag.js"),l=n(/*! ../internals/create-non-enumerable-property */"./node_modules/core-js-pure/internals/create-non-enumerable-property.js"),c=n(/*! ../internals/redefine */"./node_modules/core-js-pure/internals/redefine.js"),u=n(/*! ../internals/well-known-symbol */"./node_modules/core-js-pure/internals/well-known-symbol.js"),d=n(/*! ../internals/is-pure */"./node_modules/core-js-pure/internals/is-pure.js"),h=n(/*! ../internals/iterators */"./node_modules/core-js-pure/internals/iterators.js"),f=n(/*! ../internals/iterators-core */"./node_modules/core-js-pure/internals/iterators-core.js"),p=f.IteratorPrototype,m=f.BUGGY_SAFARI_ITERATORS,v=u("iterator"),g="keys",y="values",_="entries",b=function(){return this};e.exports=function(e,t,n,u,f,j,k){i(n,t,u);var E,x,w,O=function(e){if(e===f&&T)return T;if(!m&&e in S)return S[e];switch(e){case g:case y:case _:return function(){return new n(this,e)}}return function(){return new n(this)}},M=t+" Iterator",C=!1,S=e.prototype,P=S[v]||S["@@iterator"]||f&&S[f],T=!m&&P||O(f),I="Array"==t&&S.entries||P;if(I&&(E=r(I.call(new e)),p!==Object.prototype&&E.next&&(d||r(E)===p||(s?s(E,p):"function"!=typeof E[v]&&l(E,v,b)),a(E,M,!0,!0),d&&(h[M]=b))),f==y&&P&&P.name!==y&&(C=!0,T=function(){return P.call(this)}),d&&!k||S[v]===T||l(S,v,T),h[t]=T,f)if(x={values:O(y),keys:j?T:O(g),entries:O(_)},k)for(w in x)(m||C||!(w in S))&&c(S,w,x[w]);else o({target:t,proto:!0,forced:m||C},x);return x}},"./node_modules/core-js-pure/internals/descriptors.js":
|
|
/*!************************************************************!*\
|
|
!*** ./node_modules/core-js-pure/internals/descriptors.js ***!
|
|
\************************************************************/
|
|
/*! no static exports found */function(e,t,n){var o=n(/*! ../internals/fails */"./node_modules/core-js-pure/internals/fails.js");e.exports=!o((function(){return 7!=Object.defineProperty({},1,{get:function(){return 7}})[1]}))},"./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(e,t,n){var o=n(/*! ../internals/global */"./node_modules/core-js-pure/internals/global.js"),i=n(/*! ../internals/is-object */"./node_modules/core-js-pure/internals/is-object.js"),r=o.document,s=i(r)&&i(r.createElement);e.exports=function(e){return s?r.createElement(e):{}}},"./node_modules/core-js-pure/internals/dom-iterables.js":
|
|
/*!**************************************************************!*\
|
|
!*** ./node_modules/core-js-pure/internals/dom-iterables.js ***!
|
|
\**************************************************************/
|
|
/*! no static exports found */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}},"./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(e,t,n){var o=n(/*! ../internals/engine-user-agent */"./node_modules/core-js-pure/internals/engine-user-agent.js");e.exports=/(iphone|ipod|ipad).*applewebkit/i.test(o)},"./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(e,t,n){var o=n(/*! ../internals/get-built-in */"./node_modules/core-js-pure/internals/get-built-in.js");e.exports=o("navigator","userAgent")||""},"./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(e,t,n){var o,i,r=n(/*! ../internals/global */"./node_modules/core-js-pure/internals/global.js"),s=n(/*! ../internals/engine-user-agent */"./node_modules/core-js-pure/internals/engine-user-agent.js"),a=r.process,l=a&&a.versions,c=l&&l.v8;c?i=(o=c.split("."))[0]+o[1]:s&&(!(o=s.match(/Edge\/(\d+)/))||o[1]>=74)&&(o=s.match(/Chrome\/(\d+)/))&&(i=o[1]),e.exports=i&&+i},"./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(e,t){e.exports=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"]},"./node_modules/core-js-pure/internals/export.js":
|
|
/*!*******************************************************!*\
|
|
!*** ./node_modules/core-js-pure/internals/export.js ***!
|
|
\*******************************************************/
|
|
/*! no static exports found */function(e,t,n){"use strict";var o=n(/*! ../internals/global */"./node_modules/core-js-pure/internals/global.js"),i=n(/*! ../internals/object-get-own-property-descriptor */"./node_modules/core-js-pure/internals/object-get-own-property-descriptor.js").f,r=n(/*! ../internals/is-forced */"./node_modules/core-js-pure/internals/is-forced.js"),s=n(/*! ../internals/path */"./node_modules/core-js-pure/internals/path.js"),a=n(/*! ../internals/function-bind-context */"./node_modules/core-js-pure/internals/function-bind-context.js"),l=n(/*! ../internals/create-non-enumerable-property */"./node_modules/core-js-pure/internals/create-non-enumerable-property.js"),c=n(/*! ../internals/has */"./node_modules/core-js-pure/internals/has.js"),u=function(e){var t=function(t,n,o){if(this instanceof e){switch(arguments.length){case 0:return new e;case 1:return new e(t);case 2:return new e(t,n)}return new e(t,n,o)}return e.apply(this,arguments)};return t.prototype=e.prototype,t};e.exports=function(e,t){var n,d,h,f,p,m,v,g,y=e.target,_=e.global,b=e.stat,j=e.proto,k=_?o:b?o[y]:(o[y]||{}).prototype,E=_?s:s[y]||(s[y]={}),x=E.prototype;for(h in t)n=!r(_?h:y+(b?".":"#")+h,e.forced)&&k&&c(k,h),p=E[h],n&&(m=e.noTargetGet?(g=i(k,h))&&g.value:k[h]),f=n&&m?m:t[h],n&&typeof p==typeof f||(v=e.bind&&n?a(f,o):e.wrap&&n?u(f):j&&"function"==typeof f?a(Function.call,f):f,(e.sham||f&&f.sham||p&&p.sham)&&l(v,"sham",!0),E[h]=v,j&&(c(s,d=y+"Prototype")||l(s,d,{}),s[d][h]=f,e.real&&x&&!x[h]&&l(x,h,f)))}},"./node_modules/core-js-pure/internals/fails.js":
|
|
/*!******************************************************!*\
|
|
!*** ./node_modules/core-js-pure/internals/fails.js ***!
|
|
\******************************************************/
|
|
/*! no static exports found */function(e,t){e.exports=function(e){try{return!!e()}catch(e){return!0}}},"./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(e,t,n){var o=n(/*! ../internals/a-function */"./node_modules/core-js-pure/internals/a-function.js");e.exports=function(e,t,n){if(o(e),void 0===t)return e;switch(n){case 0:return function(){return e.call(t)};case 1:return function(n){return e.call(t,n)};case 2:return function(n,o){return e.call(t,n,o)};case 3:return function(n,o,i){return e.call(t,n,o,i)}}return function(){return e.apply(t,arguments)}}},"./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(e,t,n){var o=n(/*! ../internals/path */"./node_modules/core-js-pure/internals/path.js"),i=n(/*! ../internals/global */"./node_modules/core-js-pure/internals/global.js"),r=function(e){return"function"==typeof e?e:void 0};e.exports=function(e,t){return arguments.length<2?r(o[e])||r(i[e]):o[e]&&o[e][t]||i[e]&&i[e][t]}},"./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(e,t,n){var o=n(/*! ../internals/classof */"./node_modules/core-js-pure/internals/classof.js"),i=n(/*! ../internals/iterators */"./node_modules/core-js-pure/internals/iterators.js"),r=n(/*! ../internals/well-known-symbol */"./node_modules/core-js-pure/internals/well-known-symbol.js")("iterator");e.exports=function(e){if(null!=e)return e[r]||e["@@iterator"]||i[o(e)]}},"./node_modules/core-js-pure/internals/global.js":
|
|
/*!*******************************************************!*\
|
|
!*** ./node_modules/core-js-pure/internals/global.js ***!
|
|
\*******************************************************/
|
|
/*! no static exports found */function(e,t,n){(function(t){var n=function(e){return e&&e.Math==Math&&e};e.exports=n("object"==typeof globalThis&&globalThis)||n("object"==typeof window&&window)||n("object"==typeof self&&self)||n("object"==typeof t&&t)||Function("return this")()}).call(this,n(/*! ./../../webpack/buildin/global.js */"./node_modules/webpack/buildin/global.js"))},"./node_modules/core-js-pure/internals/has.js":
|
|
/*!****************************************************!*\
|
|
!*** ./node_modules/core-js-pure/internals/has.js ***!
|
|
\****************************************************/
|
|
/*! no static exports found */function(e,t){var n={}.hasOwnProperty;e.exports=function(e,t){return n.call(e,t)}},"./node_modules/core-js-pure/internals/hidden-keys.js":
|
|
/*!************************************************************!*\
|
|
!*** ./node_modules/core-js-pure/internals/hidden-keys.js ***!
|
|
\************************************************************/
|
|
/*! no static exports found */function(e,t){e.exports={}},"./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(e,t,n){var o=n(/*! ../internals/global */"./node_modules/core-js-pure/internals/global.js");e.exports=function(e,t){var n=o.console;n&&n.error&&(1===arguments.length?n.error(e):n.error(e,t))}},"./node_modules/core-js-pure/internals/html.js":
|
|
/*!*****************************************************!*\
|
|
!*** ./node_modules/core-js-pure/internals/html.js ***!
|
|
\*****************************************************/
|
|
/*! no static exports found */function(e,t,n){var o=n(/*! ../internals/get-built-in */"./node_modules/core-js-pure/internals/get-built-in.js");e.exports=o("document","documentElement")},"./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(e,t,n){var o=n(/*! ../internals/descriptors */"./node_modules/core-js-pure/internals/descriptors.js"),i=n(/*! ../internals/fails */"./node_modules/core-js-pure/internals/fails.js"),r=n(/*! ../internals/document-create-element */"./node_modules/core-js-pure/internals/document-create-element.js");e.exports=!o&&!i((function(){return 7!=Object.defineProperty(r("div"),"a",{get:function(){return 7}}).a}))},"./node_modules/core-js-pure/internals/indexed-object.js":
|
|
/*!***************************************************************!*\
|
|
!*** ./node_modules/core-js-pure/internals/indexed-object.js ***!
|
|
\***************************************************************/
|
|
/*! no static exports found */function(e,t,n){var o=n(/*! ../internals/fails */"./node_modules/core-js-pure/internals/fails.js"),i=n(/*! ../internals/classof-raw */"./node_modules/core-js-pure/internals/classof-raw.js"),r="".split;e.exports=o((function(){return!Object("z").propertyIsEnumerable(0)}))?function(e){return"String"==i(e)?r.call(e,""):Object(e)}:Object},"./node_modules/core-js-pure/internals/inspect-source.js":
|
|
/*!***************************************************************!*\
|
|
!*** ./node_modules/core-js-pure/internals/inspect-source.js ***!
|
|
\***************************************************************/
|
|
/*! no static exports found */function(e,t,n){var o=n(/*! ../internals/shared-store */"./node_modules/core-js-pure/internals/shared-store.js"),i=Function.toString;"function"!=typeof o.inspectSource&&(o.inspectSource=function(e){return i.call(e)}),e.exports=o.inspectSource},"./node_modules/core-js-pure/internals/internal-state.js":
|
|
/*!***************************************************************!*\
|
|
!*** ./node_modules/core-js-pure/internals/internal-state.js ***!
|
|
\***************************************************************/
|
|
/*! no static exports found */function(e,t,n){var o,i,r,s=n(/*! ../internals/native-weak-map */"./node_modules/core-js-pure/internals/native-weak-map.js"),a=n(/*! ../internals/global */"./node_modules/core-js-pure/internals/global.js"),l=n(/*! ../internals/is-object */"./node_modules/core-js-pure/internals/is-object.js"),c=n(/*! ../internals/create-non-enumerable-property */"./node_modules/core-js-pure/internals/create-non-enumerable-property.js"),u=n(/*! ../internals/has */"./node_modules/core-js-pure/internals/has.js"),d=n(/*! ../internals/shared-key */"./node_modules/core-js-pure/internals/shared-key.js"),h=n(/*! ../internals/hidden-keys */"./node_modules/core-js-pure/internals/hidden-keys.js"),f=a.WeakMap;if(s){var p=new f,m=p.get,v=p.has,g=p.set;o=function(e,t){return g.call(p,e,t),t},i=function(e){return m.call(p,e)||{}},r=function(e){return v.call(p,e)}}else{var y=d("state");h[y]=!0,o=function(e,t){return c(e,y,t),t},i=function(e){return u(e,y)?e[y]:{}},r=function(e){return u(e,y)}}e.exports={set:o,get:i,has:r,enforce:function(e){return r(e)?i(e):o(e,{})},getterFor:function(e){return function(t){var n;if(!l(t)||(n=i(t)).type!==e)throw TypeError("Incompatible receiver, "+e+" required");return n}}}},"./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(e,t,n){var o=n(/*! ../internals/well-known-symbol */"./node_modules/core-js-pure/internals/well-known-symbol.js"),i=n(/*! ../internals/iterators */"./node_modules/core-js-pure/internals/iterators.js"),r=o("iterator"),s=Array.prototype;e.exports=function(e){return void 0!==e&&(i.Array===e||s[r]===e)}},"./node_modules/core-js-pure/internals/is-forced.js":
|
|
/*!**********************************************************!*\
|
|
!*** ./node_modules/core-js-pure/internals/is-forced.js ***!
|
|
\**********************************************************/
|
|
/*! no static exports found */function(e,t,n){var o=n(/*! ../internals/fails */"./node_modules/core-js-pure/internals/fails.js"),i=/#|\.prototype\./,r=function(e,t){var n=a[s(e)];return n==c||n!=l&&("function"==typeof t?o(t):!!t)},s=r.normalize=function(e){return String(e).replace(i,".").toLowerCase()},a=r.data={},l=r.NATIVE="N",c=r.POLYFILL="P";e.exports=r},"./node_modules/core-js-pure/internals/is-object.js":
|
|
/*!**********************************************************!*\
|
|
!*** ./node_modules/core-js-pure/internals/is-object.js ***!
|
|
\**********************************************************/
|
|
/*! no static exports found */function(e,t){e.exports=function(e){return"object"==typeof e?null!==e:"function"==typeof e}},"./node_modules/core-js-pure/internals/is-pure.js":
|
|
/*!********************************************************!*\
|
|
!*** ./node_modules/core-js-pure/internals/is-pure.js ***!
|
|
\********************************************************/
|
|
/*! no static exports found */function(e,t){e.exports=!0},"./node_modules/core-js-pure/internals/iterate.js":
|
|
/*!********************************************************!*\
|
|
!*** ./node_modules/core-js-pure/internals/iterate.js ***!
|
|
\********************************************************/
|
|
/*! no static exports found */function(e,t,n){var o=n(/*! ../internals/an-object */"./node_modules/core-js-pure/internals/an-object.js"),i=n(/*! ../internals/is-array-iterator-method */"./node_modules/core-js-pure/internals/is-array-iterator-method.js"),r=n(/*! ../internals/to-length */"./node_modules/core-js-pure/internals/to-length.js"),s=n(/*! ../internals/function-bind-context */"./node_modules/core-js-pure/internals/function-bind-context.js"),a=n(/*! ../internals/get-iterator-method */"./node_modules/core-js-pure/internals/get-iterator-method.js"),l=n(/*! ../internals/call-with-safe-iteration-closing */"./node_modules/core-js-pure/internals/call-with-safe-iteration-closing.js"),c=function(e,t){this.stopped=e,this.result=t};(e.exports=function(e,t,n,u,d){var h,f,p,m,v,g,y,_=s(t,n,u?2:1);if(d)h=e;else{if("function"!=typeof(f=a(e)))throw TypeError("Target is not iterable");if(i(f)){for(p=0,m=r(e.length);m>p;p++)if((v=u?_(o(y=e[p])[0],y[1]):_(e[p]))&&v instanceof c)return v;return new c(!1)}h=f.call(e)}for(g=h.next;!(y=g.call(h)).done;)if("object"==typeof(v=l(h,_,y.value,u))&&v&&v instanceof c)return v;return new c(!1)}).stop=function(e){return new c(!0,e)}},"./node_modules/core-js-pure/internals/iterators-core.js":
|
|
/*!***************************************************************!*\
|
|
!*** ./node_modules/core-js-pure/internals/iterators-core.js ***!
|
|
\***************************************************************/
|
|
/*! no static exports found */function(e,t,n){"use strict";var o,i,r,s=n(/*! ../internals/object-get-prototype-of */"./node_modules/core-js-pure/internals/object-get-prototype-of.js"),a=n(/*! ../internals/create-non-enumerable-property */"./node_modules/core-js-pure/internals/create-non-enumerable-property.js"),l=n(/*! ../internals/has */"./node_modules/core-js-pure/internals/has.js"),c=n(/*! ../internals/well-known-symbol */"./node_modules/core-js-pure/internals/well-known-symbol.js"),u=n(/*! ../internals/is-pure */"./node_modules/core-js-pure/internals/is-pure.js"),d=c("iterator"),h=!1;[].keys&&("next"in(r=[].keys())?(i=s(s(r)))!==Object.prototype&&(o=i):h=!0),null==o&&(o={}),u||l(o,d)||a(o,d,(function(){return this})),e.exports={IteratorPrototype:o,BUGGY_SAFARI_ITERATORS:h}},"./node_modules/core-js-pure/internals/iterators.js":
|
|
/*!**********************************************************!*\
|
|
!*** ./node_modules/core-js-pure/internals/iterators.js ***!
|
|
\**********************************************************/
|
|
/*! no static exports found */function(e,t){e.exports={}},"./node_modules/core-js-pure/internals/microtask.js":
|
|
/*!**********************************************************!*\
|
|
!*** ./node_modules/core-js-pure/internals/microtask.js ***!
|
|
\**********************************************************/
|
|
/*! no static exports found */function(e,t,n){var o,i,r,s,a,l,c,u,d=n(/*! ../internals/global */"./node_modules/core-js-pure/internals/global.js"),h=n(/*! ../internals/object-get-own-property-descriptor */"./node_modules/core-js-pure/internals/object-get-own-property-descriptor.js").f,f=n(/*! ../internals/classof-raw */"./node_modules/core-js-pure/internals/classof-raw.js"),p=n(/*! ../internals/task */"./node_modules/core-js-pure/internals/task.js").set,m=n(/*! ../internals/engine-is-ios */"./node_modules/core-js-pure/internals/engine-is-ios.js"),v=d.MutationObserver||d.WebKitMutationObserver,g=d.process,y=d.Promise,_="process"==f(g),b=h(d,"queueMicrotask"),j=b&&b.value;j||(o=function(){var e,t;for(_&&(e=g.domain)&&e.exit();i;){t=i.fn,i=i.next;try{t()}catch(e){throw i?s():r=void 0,e}}r=void 0,e&&e.enter()},_?s=function(){g.nextTick(o)}:v&&!m?(a=!0,l=document.createTextNode(""),new v(o).observe(l,{characterData:!0}),s=function(){l.data=a=!a}):y&&y.resolve?(c=y.resolve(void 0),u=c.then,s=function(){u.call(c,o)}):s=function(){p.call(d,o)}),e.exports=j||function(e){var t={fn:e,next:void 0};r&&(r.next=t),i||(i=t,s()),r=t}},"./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(e,t,n){var o=n(/*! ../internals/global */"./node_modules/core-js-pure/internals/global.js");e.exports=o.Promise},"./node_modules/core-js-pure/internals/native-symbol.js":
|
|
/*!**************************************************************!*\
|
|
!*** ./node_modules/core-js-pure/internals/native-symbol.js ***!
|
|
\**************************************************************/
|
|
/*! no static exports found */function(e,t,n){var o=n(/*! ../internals/fails */"./node_modules/core-js-pure/internals/fails.js");e.exports=!!Object.getOwnPropertySymbols&&!o((function(){return!String(Symbol())}))},"./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(e,t,n){var o=n(/*! ../internals/global */"./node_modules/core-js-pure/internals/global.js"),i=n(/*! ../internals/inspect-source */"./node_modules/core-js-pure/internals/inspect-source.js"),r=o.WeakMap;e.exports="function"==typeof r&&/native code/.test(i(r))},"./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(e,t,n){"use strict";var o=n(/*! ../internals/a-function */"./node_modules/core-js-pure/internals/a-function.js"),i=function(e){var t,n;this.promise=new e((function(e,o){if(void 0!==t||void 0!==n)throw TypeError("Bad Promise constructor");t=e,n=o})),this.resolve=o(t),this.reject=o(n)};e.exports.f=function(e){return new i(e)}},"./node_modules/core-js-pure/internals/object-create.js":
|
|
/*!**************************************************************!*\
|
|
!*** ./node_modules/core-js-pure/internals/object-create.js ***!
|
|
\**************************************************************/
|
|
/*! no static exports found */function(e,t,n){var o,i=n(/*! ../internals/an-object */"./node_modules/core-js-pure/internals/an-object.js"),r=n(/*! ../internals/object-define-properties */"./node_modules/core-js-pure/internals/object-define-properties.js"),s=n(/*! ../internals/enum-bug-keys */"./node_modules/core-js-pure/internals/enum-bug-keys.js"),a=n(/*! ../internals/hidden-keys */"./node_modules/core-js-pure/internals/hidden-keys.js"),l=n(/*! ../internals/html */"./node_modules/core-js-pure/internals/html.js"),c=n(/*! ../internals/document-create-element */"./node_modules/core-js-pure/internals/document-create-element.js"),u=n(/*! ../internals/shared-key */"./node_modules/core-js-pure/internals/shared-key.js"),d=u("IE_PROTO"),h=function(){},f=function(e){return"<script>"+e+"</"+"script>"},p=function(){try{o=document.domain&&new ActiveXObject("htmlfile")}catch(e){}var e,t;p=o?function(e){e.write(f("")),e.close();var t=e.parentWindow.Object;return e=null,t}(o):((t=c("iframe")).style.display="none",l.appendChild(t),t.src=String("javascript:"),(e=t.contentWindow.document).open(),e.write(f("document.F=Object")),e.close(),e.F);for(var n=s.length;n--;)delete p.prototype[s[n]];return p()};a[d]=!0,e.exports=Object.create||function(e,t){var n;return null!==e?(h.prototype=i(e),n=new h,h.prototype=null,n[d]=e):n=p(),void 0===t?n:r(n,t)}},"./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(e,t,n){var o=n(/*! ../internals/descriptors */"./node_modules/core-js-pure/internals/descriptors.js"),i=n(/*! ../internals/object-define-property */"./node_modules/core-js-pure/internals/object-define-property.js"),r=n(/*! ../internals/an-object */"./node_modules/core-js-pure/internals/an-object.js"),s=n(/*! ../internals/object-keys */"./node_modules/core-js-pure/internals/object-keys.js");e.exports=o?Object.defineProperties:function(e,t){r(e);for(var n,o=s(t),a=o.length,l=0;a>l;)i.f(e,n=o[l++],t[n]);return e}},"./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(e,t,n){var o=n(/*! ../internals/descriptors */"./node_modules/core-js-pure/internals/descriptors.js"),i=n(/*! ../internals/ie8-dom-define */"./node_modules/core-js-pure/internals/ie8-dom-define.js"),r=n(/*! ../internals/an-object */"./node_modules/core-js-pure/internals/an-object.js"),s=n(/*! ../internals/to-primitive */"./node_modules/core-js-pure/internals/to-primitive.js"),a=Object.defineProperty;t.f=o?a:function(e,t,n){if(r(e),t=s(t,!0),r(n),i)try{return a(e,t,n)}catch(e){}if("get"in n||"set"in n)throw TypeError("Accessors not supported");return"value"in n&&(e[t]=n.value),e}},"./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(e,t,n){var o=n(/*! ../internals/descriptors */"./node_modules/core-js-pure/internals/descriptors.js"),i=n(/*! ../internals/object-property-is-enumerable */"./node_modules/core-js-pure/internals/object-property-is-enumerable.js"),r=n(/*! ../internals/create-property-descriptor */"./node_modules/core-js-pure/internals/create-property-descriptor.js"),s=n(/*! ../internals/to-indexed-object */"./node_modules/core-js-pure/internals/to-indexed-object.js"),a=n(/*! ../internals/to-primitive */"./node_modules/core-js-pure/internals/to-primitive.js"),l=n(/*! ../internals/has */"./node_modules/core-js-pure/internals/has.js"),c=n(/*! ../internals/ie8-dom-define */"./node_modules/core-js-pure/internals/ie8-dom-define.js"),u=Object.getOwnPropertyDescriptor;t.f=o?u:function(e,t){if(e=s(e),t=a(t,!0),c)try{return u(e,t)}catch(e){}if(l(e,t))return r(!i.f.call(e,t),e[t])}},"./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(e,t,n){var o=n(/*! ../internals/has */"./node_modules/core-js-pure/internals/has.js"),i=n(/*! ../internals/to-object */"./node_modules/core-js-pure/internals/to-object.js"),r=n(/*! ../internals/shared-key */"./node_modules/core-js-pure/internals/shared-key.js"),s=n(/*! ../internals/correct-prototype-getter */"./node_modules/core-js-pure/internals/correct-prototype-getter.js"),a=r("IE_PROTO"),l=Object.prototype;e.exports=s?Object.getPrototypeOf:function(e){return e=i(e),o(e,a)?e[a]:"function"==typeof e.constructor&&e instanceof e.constructor?e.constructor.prototype:e instanceof Object?l:null}},"./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(e,t,n){var o=n(/*! ../internals/has */"./node_modules/core-js-pure/internals/has.js"),i=n(/*! ../internals/to-indexed-object */"./node_modules/core-js-pure/internals/to-indexed-object.js"),r=n(/*! ../internals/array-includes */"./node_modules/core-js-pure/internals/array-includes.js").indexOf,s=n(/*! ../internals/hidden-keys */"./node_modules/core-js-pure/internals/hidden-keys.js");e.exports=function(e,t){var n,a=i(e),l=0,c=[];for(n in a)!o(s,n)&&o(a,n)&&c.push(n);for(;t.length>l;)o(a,n=t[l++])&&(~r(c,n)||c.push(n));return c}},"./node_modules/core-js-pure/internals/object-keys.js":
|
|
/*!************************************************************!*\
|
|
!*** ./node_modules/core-js-pure/internals/object-keys.js ***!
|
|
\************************************************************/
|
|
/*! no static exports found */function(e,t,n){var o=n(/*! ../internals/object-keys-internal */"./node_modules/core-js-pure/internals/object-keys-internal.js"),i=n(/*! ../internals/enum-bug-keys */"./node_modules/core-js-pure/internals/enum-bug-keys.js");e.exports=Object.keys||function(e){return o(e,i)}},"./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(e,t,n){"use strict";var o={}.propertyIsEnumerable,i=Object.getOwnPropertyDescriptor,r=i&&!o.call({1:2},1);t.f=r?function(e){var t=i(this,e);return!!t&&t.enumerable}:o},"./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(e,t,n){var o=n(/*! ../internals/an-object */"./node_modules/core-js-pure/internals/an-object.js"),i=n(/*! ../internals/a-possible-prototype */"./node_modules/core-js-pure/internals/a-possible-prototype.js");e.exports=Object.setPrototypeOf||("__proto__"in{}?function(){var e,t=!1,n={};try{(e=Object.getOwnPropertyDescriptor(Object.prototype,"__proto__").set).call(n,[]),t=n instanceof Array}catch(e){}return function(n,r){return o(n),i(r),t?e.call(n,r):n.__proto__=r,n}}():void 0)},"./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(e,t,n){"use strict";var o=n(/*! ../internals/to-string-tag-support */"./node_modules/core-js-pure/internals/to-string-tag-support.js"),i=n(/*! ../internals/classof */"./node_modules/core-js-pure/internals/classof.js");e.exports=o?{}.toString:function(){return"[object "+i(this)+"]"}},"./node_modules/core-js-pure/internals/path.js":
|
|
/*!*****************************************************!*\
|
|
!*** ./node_modules/core-js-pure/internals/path.js ***!
|
|
\*****************************************************/
|
|
/*! no static exports found */function(e,t){e.exports={}},"./node_modules/core-js-pure/internals/perform.js":
|
|
/*!********************************************************!*\
|
|
!*** ./node_modules/core-js-pure/internals/perform.js ***!
|
|
\********************************************************/
|
|
/*! no static exports found */function(e,t){e.exports=function(e){try{return{error:!1,value:e()}}catch(e){return{error:!0,value:e}}}},"./node_modules/core-js-pure/internals/promise-resolve.js":
|
|
/*!****************************************************************!*\
|
|
!*** ./node_modules/core-js-pure/internals/promise-resolve.js ***!
|
|
\****************************************************************/
|
|
/*! no static exports found */function(e,t,n){var o=n(/*! ../internals/an-object */"./node_modules/core-js-pure/internals/an-object.js"),i=n(/*! ../internals/is-object */"./node_modules/core-js-pure/internals/is-object.js"),r=n(/*! ../internals/new-promise-capability */"./node_modules/core-js-pure/internals/new-promise-capability.js");e.exports=function(e,t){if(o(e),i(t)&&t.constructor===e)return t;var n=r.f(e);return(0,n.resolve)(t),n.promise}},"./node_modules/core-js-pure/internals/redefine-all.js":
|
|
/*!*************************************************************!*\
|
|
!*** ./node_modules/core-js-pure/internals/redefine-all.js ***!
|
|
\*************************************************************/
|
|
/*! no static exports found */function(e,t,n){var o=n(/*! ../internals/redefine */"./node_modules/core-js-pure/internals/redefine.js");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}},"./node_modules/core-js-pure/internals/redefine.js":
|
|
/*!*********************************************************!*\
|
|
!*** ./node_modules/core-js-pure/internals/redefine.js ***!
|
|
\*********************************************************/
|
|
/*! no static exports found */function(e,t,n){var o=n(/*! ../internals/create-non-enumerable-property */"./node_modules/core-js-pure/internals/create-non-enumerable-property.js");e.exports=function(e,t,n,i){i&&i.enumerable?e[t]=n:o(e,t,n)}},"./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(e,t){e.exports=function(e){if(null==e)throw TypeError("Can't call method on "+e);return e}},"./node_modules/core-js-pure/internals/set-global.js":
|
|
/*!***********************************************************!*\
|
|
!*** ./node_modules/core-js-pure/internals/set-global.js ***!
|
|
\***********************************************************/
|
|
/*! no static exports found */function(e,t,n){var o=n(/*! ../internals/global */"./node_modules/core-js-pure/internals/global.js"),i=n(/*! ../internals/create-non-enumerable-property */"./node_modules/core-js-pure/internals/create-non-enumerable-property.js");e.exports=function(e,t){try{i(o,e,t)}catch(n){o[e]=t}return t}},"./node_modules/core-js-pure/internals/set-species.js":
|
|
/*!************************************************************!*\
|
|
!*** ./node_modules/core-js-pure/internals/set-species.js ***!
|
|
\************************************************************/
|
|
/*! no static exports found */function(e,t,n){"use strict";var o=n(/*! ../internals/get-built-in */"./node_modules/core-js-pure/internals/get-built-in.js"),i=n(/*! ../internals/object-define-property */"./node_modules/core-js-pure/internals/object-define-property.js"),r=n(/*! ../internals/well-known-symbol */"./node_modules/core-js-pure/internals/well-known-symbol.js"),s=n(/*! ../internals/descriptors */"./node_modules/core-js-pure/internals/descriptors.js"),a=r("species");e.exports=function(e){var t=o(e),n=i.f;s&&t&&!t[a]&&n(t,a,{configurable:!0,get:function(){return this}})}},"./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(e,t,n){var o=n(/*! ../internals/to-string-tag-support */"./node_modules/core-js-pure/internals/to-string-tag-support.js"),i=n(/*! ../internals/object-define-property */"./node_modules/core-js-pure/internals/object-define-property.js").f,r=n(/*! ../internals/create-non-enumerable-property */"./node_modules/core-js-pure/internals/create-non-enumerable-property.js"),s=n(/*! ../internals/has */"./node_modules/core-js-pure/internals/has.js"),a=n(/*! ../internals/object-to-string */"./node_modules/core-js-pure/internals/object-to-string.js"),l=n(/*! ../internals/well-known-symbol */"./node_modules/core-js-pure/internals/well-known-symbol.js")("toStringTag");e.exports=function(e,t,n,c){if(e){var u=n?e:e.prototype;s(u,l)||i(u,l,{configurable:!0,value:t}),c&&!o&&r(u,"toString",a)}}},"./node_modules/core-js-pure/internals/shared-key.js":
|
|
/*!***********************************************************!*\
|
|
!*** ./node_modules/core-js-pure/internals/shared-key.js ***!
|
|
\***********************************************************/
|
|
/*! no static exports found */function(e,t,n){var o=n(/*! ../internals/shared */"./node_modules/core-js-pure/internals/shared.js"),i=n(/*! ../internals/uid */"./node_modules/core-js-pure/internals/uid.js"),r=o("keys");e.exports=function(e){return r[e]||(r[e]=i(e))}},"./node_modules/core-js-pure/internals/shared-store.js":
|
|
/*!*************************************************************!*\
|
|
!*** ./node_modules/core-js-pure/internals/shared-store.js ***!
|
|
\*************************************************************/
|
|
/*! no static exports found */function(e,t,n){var o=n(/*! ../internals/global */"./node_modules/core-js-pure/internals/global.js"),i=n(/*! ../internals/set-global */"./node_modules/core-js-pure/internals/set-global.js"),r="__core-js_shared__",s=o[r]||i(r,{});e.exports=s},"./node_modules/core-js-pure/internals/shared.js":
|
|
/*!*******************************************************!*\
|
|
!*** ./node_modules/core-js-pure/internals/shared.js ***!
|
|
\*******************************************************/
|
|
/*! no static exports found */function(e,t,n){var o=n(/*! ../internals/is-pure */"./node_modules/core-js-pure/internals/is-pure.js"),i=n(/*! ../internals/shared-store */"./node_modules/core-js-pure/internals/shared-store.js");(e.exports=function(e,t){return i[e]||(i[e]=void 0!==t?t:{})})("versions",[]).push({version:"3.6.4",mode:o?"pure":"global",copyright:"© 2020 Denis Pushkarev (zloirock.ru)"})},"./node_modules/core-js-pure/internals/species-constructor.js":
|
|
/*!********************************************************************!*\
|
|
!*** ./node_modules/core-js-pure/internals/species-constructor.js ***!
|
|
\********************************************************************/
|
|
/*! no static exports found */function(e,t,n){var o=n(/*! ../internals/an-object */"./node_modules/core-js-pure/internals/an-object.js"),i=n(/*! ../internals/a-function */"./node_modules/core-js-pure/internals/a-function.js"),r=n(/*! ../internals/well-known-symbol */"./node_modules/core-js-pure/internals/well-known-symbol.js")("species");e.exports=function(e,t){var n,s=o(e).constructor;return void 0===s||null==(n=o(s)[r])?t:i(n)}},"./node_modules/core-js-pure/internals/string-multibyte.js":
|
|
/*!*****************************************************************!*\
|
|
!*** ./node_modules/core-js-pure/internals/string-multibyte.js ***!
|
|
\*****************************************************************/
|
|
/*! no static exports found */function(e,t,n){var o=n(/*! ../internals/to-integer */"./node_modules/core-js-pure/internals/to-integer.js"),i=n(/*! ../internals/require-object-coercible */"./node_modules/core-js-pure/internals/require-object-coercible.js"),r=function(e){return function(t,n){var r,s,a=String(i(t)),l=o(n),c=a.length;return l<0||l>=c?e?"":void 0:(r=a.charCodeAt(l))<55296||r>56319||l+1===c||(s=a.charCodeAt(l+1))<56320||s>57343?e?a.charAt(l):r:e?a.slice(l,l+2):s-56320+(r-55296<<10)+65536}};e.exports={codeAt:r(!1),charAt:r(!0)}},"./node_modules/core-js-pure/internals/task.js":
|
|
/*!*****************************************************!*\
|
|
!*** ./node_modules/core-js-pure/internals/task.js ***!
|
|
\*****************************************************/
|
|
/*! no static exports found */function(e,t,n){var o,i,r,s=n(/*! ../internals/global */"./node_modules/core-js-pure/internals/global.js"),a=n(/*! ../internals/fails */"./node_modules/core-js-pure/internals/fails.js"),l=n(/*! ../internals/classof-raw */"./node_modules/core-js-pure/internals/classof-raw.js"),c=n(/*! ../internals/function-bind-context */"./node_modules/core-js-pure/internals/function-bind-context.js"),u=n(/*! ../internals/html */"./node_modules/core-js-pure/internals/html.js"),d=n(/*! ../internals/document-create-element */"./node_modules/core-js-pure/internals/document-create-element.js"),h=n(/*! ../internals/engine-is-ios */"./node_modules/core-js-pure/internals/engine-is-ios.js"),f=s.location,p=s.setImmediate,m=s.clearImmediate,v=s.process,g=s.MessageChannel,y=s.Dispatch,_=0,b={},j="onreadystatechange",k=function(e){if(b.hasOwnProperty(e)){var t=b[e];delete b[e],t()}},E=function(e){return function(){k(e)}},x=function(e){k(e.data)},w=function(e){s.postMessage(e+"",f.protocol+"//"+f.host)};p&&m||(p=function(e){for(var t=[],n=1;arguments.length>n;)t.push(arguments[n++]);return b[++_]=function(){("function"==typeof e?e:Function(e)).apply(void 0,t)},o(_),_},m=function(e){delete b[e]},"process"==l(v)?o=function(e){v.nextTick(E(e))}:y&&y.now?o=function(e){y.now(E(e))}:g&&!h?(r=(i=new g).port2,i.port1.onmessage=x,o=c(r.postMessage,r,1)):!s.addEventListener||"function"!=typeof postMessage||s.importScripts||a(w)?o=j in d("script")?function(e){u.appendChild(d("script")).onreadystatechange=function(){u.removeChild(this),k(e)}}:function(e){setTimeout(E(e),0)}:(o=w,s.addEventListener("message",x,!1))),e.exports={set:p,clear:m}},"./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(e,t,n){var o=n(/*! ../internals/to-integer */"./node_modules/core-js-pure/internals/to-integer.js"),i=Math.max,r=Math.min;e.exports=function(e,t){var n=o(e);return n<0?i(n+t,0):r(n,t)}},"./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(e,t,n){var o=n(/*! ../internals/indexed-object */"./node_modules/core-js-pure/internals/indexed-object.js"),i=n(/*! ../internals/require-object-coercible */"./node_modules/core-js-pure/internals/require-object-coercible.js");e.exports=function(e){return o(i(e))}},"./node_modules/core-js-pure/internals/to-integer.js":
|
|
/*!***********************************************************!*\
|
|
!*** ./node_modules/core-js-pure/internals/to-integer.js ***!
|
|
\***********************************************************/
|
|
/*! no static exports found */function(e,t){var n=Math.ceil,o=Math.floor;e.exports=function(e){return isNaN(e=+e)?0:(e>0?o:n)(e)}},"./node_modules/core-js-pure/internals/to-length.js":
|
|
/*!**********************************************************!*\
|
|
!*** ./node_modules/core-js-pure/internals/to-length.js ***!
|
|
\**********************************************************/
|
|
/*! no static exports found */function(e,t,n){var o=n(/*! ../internals/to-integer */"./node_modules/core-js-pure/internals/to-integer.js"),i=Math.min;e.exports=function(e){return e>0?i(o(e),9007199254740991):0}},"./node_modules/core-js-pure/internals/to-object.js":
|
|
/*!**********************************************************!*\
|
|
!*** ./node_modules/core-js-pure/internals/to-object.js ***!
|
|
\**********************************************************/
|
|
/*! no static exports found */function(e,t,n){var o=n(/*! ../internals/require-object-coercible */"./node_modules/core-js-pure/internals/require-object-coercible.js");e.exports=function(e){return Object(o(e))}},"./node_modules/core-js-pure/internals/to-primitive.js":
|
|
/*!*************************************************************!*\
|
|
!*** ./node_modules/core-js-pure/internals/to-primitive.js ***!
|
|
\*************************************************************/
|
|
/*! no static exports found */function(e,t,n){var o=n(/*! ../internals/is-object */"./node_modules/core-js-pure/internals/is-object.js");e.exports=function(e,t){if(!o(e))return e;var n,i;if(t&&"function"==typeof(n=e.toString)&&!o(i=n.call(e)))return i;if("function"==typeof(n=e.valueOf)&&!o(i=n.call(e)))return i;if(!t&&"function"==typeof(n=e.toString)&&!o(i=n.call(e)))return i;throw TypeError("Can't convert object to primitive value")}},"./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(e,t,n){var o={};o[n(/*! ../internals/well-known-symbol */"./node_modules/core-js-pure/internals/well-known-symbol.js")("toStringTag")]="z",e.exports="[object z]"===String(o)},"./node_modules/core-js-pure/internals/uid.js":
|
|
/*!****************************************************!*\
|
|
!*** ./node_modules/core-js-pure/internals/uid.js ***!
|
|
\****************************************************/
|
|
/*! no static exports found */function(e,t){var n=0,o=Math.random();e.exports=function(e){return"Symbol("+String(void 0===e?"":e)+")_"+(++n+o).toString(36)}},"./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(e,t,n){var o=n(/*! ../internals/native-symbol */"./node_modules/core-js-pure/internals/native-symbol.js");e.exports=o&&!Symbol.sham&&"symbol"==typeof Symbol.iterator},"./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(e,t,n){var o=n(/*! ../internals/global */"./node_modules/core-js-pure/internals/global.js"),i=n(/*! ../internals/shared */"./node_modules/core-js-pure/internals/shared.js"),r=n(/*! ../internals/has */"./node_modules/core-js-pure/internals/has.js"),s=n(/*! ../internals/uid */"./node_modules/core-js-pure/internals/uid.js"),a=n(/*! ../internals/native-symbol */"./node_modules/core-js-pure/internals/native-symbol.js"),l=n(/*! ../internals/use-symbol-as-uid */"./node_modules/core-js-pure/internals/use-symbol-as-uid.js"),c=i("wks"),u=o.Symbol,d=l?u:u&&u.withoutSetter||s;e.exports=function(e){return r(c,e)||(a&&r(u,e)?c[e]=u[e]:c[e]=d("Symbol."+e)),c[e]}},"./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(e,t,n){"use strict";var o=n(/*! ../internals/to-indexed-object */"./node_modules/core-js-pure/internals/to-indexed-object.js"),i=n(/*! ../internals/add-to-unscopables */"./node_modules/core-js-pure/internals/add-to-unscopables.js"),r=n(/*! ../internals/iterators */"./node_modules/core-js-pure/internals/iterators.js"),s=n(/*! ../internals/internal-state */"./node_modules/core-js-pure/internals/internal-state.js"),a=n(/*! ../internals/define-iterator */"./node_modules/core-js-pure/internals/define-iterator.js"),l="Array Iterator",c=s.set,u=s.getterFor(l);e.exports=a(Array,"Array",(function(e,t){c(this,{type:l,target:o(e),index:0,kind:t})}),(function(){var e=u(this),t=e.target,n=e.kind,o=e.index++;return!t||o>=t.length?(e.target=void 0,{value:void 0,done:!0}):"keys"==n?{value:o,done:!1}:"values"==n?{value:t[o],done:!1}:{value:[o,t[o]],done:!1}}),"values"),r.Arguments=r.Array,i("keys"),i("values"),i("entries")},"./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(e,t){},"./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(e,t,n){"use strict";var o=n(/*! ../internals/export */"./node_modules/core-js-pure/internals/export.js"),i=n(/*! ../internals/a-function */"./node_modules/core-js-pure/internals/a-function.js"),r=n(/*! ../internals/new-promise-capability */"./node_modules/core-js-pure/internals/new-promise-capability.js"),s=n(/*! ../internals/perform */"./node_modules/core-js-pure/internals/perform.js"),a=n(/*! ../internals/iterate */"./node_modules/core-js-pure/internals/iterate.js");o({target:"Promise",stat:!0},{allSettled:function(e){var t=this,n=r.f(t),o=n.resolve,l=n.reject,c=s((function(){var n=i(t.resolve),r=[],s=0,l=1;a(e,(function(e){var i=s++,a=!1;r.push(void 0),l++,n.call(t,e).then((function(e){a||(a=!0,r[i]={status:"fulfilled",value:e},--l||o(r))}),(function(e){a||(a=!0,r[i]={status:"rejected",reason:e},--l||o(r))}))})),--l||o(r)}));return c.error&&l(c.value),n.promise}})},"./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(e,t,n){"use strict";var o=n(/*! ../internals/export */"./node_modules/core-js-pure/internals/export.js"),i=n(/*! ../internals/is-pure */"./node_modules/core-js-pure/internals/is-pure.js"),r=n(/*! ../internals/native-promise-constructor */"./node_modules/core-js-pure/internals/native-promise-constructor.js"),s=n(/*! ../internals/fails */"./node_modules/core-js-pure/internals/fails.js"),a=n(/*! ../internals/get-built-in */"./node_modules/core-js-pure/internals/get-built-in.js"),l=n(/*! ../internals/species-constructor */"./node_modules/core-js-pure/internals/species-constructor.js"),c=n(/*! ../internals/promise-resolve */"./node_modules/core-js-pure/internals/promise-resolve.js"),u=n(/*! ../internals/redefine */"./node_modules/core-js-pure/internals/redefine.js");o({target:"Promise",proto:!0,real:!0,forced:!!r&&s((function(){r.prototype.finally.call({then:function(){}},(function(){}))}))},{finally:function(e){var t=l(this,a("Promise")),n="function"==typeof e;return this.then(n?function(n){return c(t,e()).then((function(){return n}))}:e,n?function(n){return c(t,e()).then((function(){throw n}))}:e)}}),i||"function"!=typeof r||r.prototype.finally||u(r.prototype,"finally",a("Promise").prototype.finally)},"./node_modules/core-js-pure/modules/es.promise.js":
|
|
/*!*********************************************************!*\
|
|
!*** ./node_modules/core-js-pure/modules/es.promise.js ***!
|
|
\*********************************************************/
|
|
/*! no static exports found */function(e,t,n){"use strict";var o,i,r,s,a=n(/*! ../internals/export */"./node_modules/core-js-pure/internals/export.js"),l=n(/*! ../internals/is-pure */"./node_modules/core-js-pure/internals/is-pure.js"),c=n(/*! ../internals/global */"./node_modules/core-js-pure/internals/global.js"),u=n(/*! ../internals/get-built-in */"./node_modules/core-js-pure/internals/get-built-in.js"),d=n(/*! ../internals/native-promise-constructor */"./node_modules/core-js-pure/internals/native-promise-constructor.js"),h=n(/*! ../internals/redefine */"./node_modules/core-js-pure/internals/redefine.js"),f=n(/*! ../internals/redefine-all */"./node_modules/core-js-pure/internals/redefine-all.js"),p=n(/*! ../internals/set-to-string-tag */"./node_modules/core-js-pure/internals/set-to-string-tag.js"),m=n(/*! ../internals/set-species */"./node_modules/core-js-pure/internals/set-species.js"),v=n(/*! ../internals/is-object */"./node_modules/core-js-pure/internals/is-object.js"),g=n(/*! ../internals/a-function */"./node_modules/core-js-pure/internals/a-function.js"),y=n(/*! ../internals/an-instance */"./node_modules/core-js-pure/internals/an-instance.js"),_=n(/*! ../internals/classof-raw */"./node_modules/core-js-pure/internals/classof-raw.js"),b=n(/*! ../internals/inspect-source */"./node_modules/core-js-pure/internals/inspect-source.js"),j=n(/*! ../internals/iterate */"./node_modules/core-js-pure/internals/iterate.js"),k=n(/*! ../internals/check-correctness-of-iteration */"./node_modules/core-js-pure/internals/check-correctness-of-iteration.js"),E=n(/*! ../internals/species-constructor */"./node_modules/core-js-pure/internals/species-constructor.js"),x=n(/*! ../internals/task */"./node_modules/core-js-pure/internals/task.js").set,w=n(/*! ../internals/microtask */"./node_modules/core-js-pure/internals/microtask.js"),O=n(/*! ../internals/promise-resolve */"./node_modules/core-js-pure/internals/promise-resolve.js"),M=n(/*! ../internals/host-report-errors */"./node_modules/core-js-pure/internals/host-report-errors.js"),C=n(/*! ../internals/new-promise-capability */"./node_modules/core-js-pure/internals/new-promise-capability.js"),S=n(/*! ../internals/perform */"./node_modules/core-js-pure/internals/perform.js"),P=n(/*! ../internals/internal-state */"./node_modules/core-js-pure/internals/internal-state.js"),T=n(/*! ../internals/is-forced */"./node_modules/core-js-pure/internals/is-forced.js"),I=n(/*! ../internals/well-known-symbol */"./node_modules/core-js-pure/internals/well-known-symbol.js"),A=n(/*! ../internals/engine-v8-version */"./node_modules/core-js-pure/internals/engine-v8-version.js"),D=I("species"),L="Promise",N=P.get,H=P.set,R=P.getterFor(L),z=d,B=c.TypeError,F=c.document,U=c.process,V=u("fetch"),W=C.f,X=W,G="process"==_(U),Y=!!(F&&F.createEvent&&c.dispatchEvent),Z="unhandledrejection",q=T(L,(function(){if(!(b(z)!==String(z))){if(66===A)return!0;if(!G&&"function"!=typeof PromiseRejectionEvent)return!0}if(l&&!z.prototype.finally)return!0;if(A>=51&&/native code/.test(z))return!1;var e=z.resolve(1),t=function(e){e((function(){}),(function(){}))};return(e.constructor={})[D]=t,!(e.then((function(){}))instanceof t)})),K=q||!k((function(e){z.all(e).catch((function(){}))})),J=function(e){var t;return!(!v(e)||"function"!=typeof(t=e.then))&&t},$=function(e,t,n){if(!t.notified){t.notified=!0;var o=t.reactions;w((function(){for(var i=t.value,r=1==t.state,s=0;o.length>s;){var a,l,c,u=o[s++],d=r?u.ok:u.fail,h=u.resolve,f=u.reject,p=u.domain;try{d?(r||(2===t.rejection&&ne(e,t),t.rejection=1),!0===d?a=i:(p&&p.enter(),a=d(i),p&&(p.exit(),c=!0)),a===u.promise?f(B("Promise-chain cycle")):(l=J(a))?l.call(a,h,f):h(a)):f(i)}catch(e){p&&!c&&p.exit(),f(e)}}t.reactions=[],t.notified=!1,n&&!t.rejection&&ee(e,t)}))}},Q=function(e,t,n){var o,i;Y?((o=F.createEvent("Event")).promise=t,o.reason=n,o.initEvent(e,!1,!0),c.dispatchEvent(o)):o={promise:t,reason:n},(i=c["on"+e])?i(o):e===Z&&M("Unhandled promise rejection",n)},ee=function(e,t){x.call(c,(function(){var n,o=t.value;if(te(t)&&(n=S((function(){G?U.emit("unhandledRejection",o,e):Q(Z,e,o)})),t.rejection=G||te(t)?2:1,n.error))throw n.value}))},te=function(e){return 1!==e.rejection&&!e.parent},ne=function(e,t){x.call(c,(function(){G?U.emit("rejectionHandled",e):Q("rejectionhandled",e,t.value)}))},oe=function(e,t,n,o){return function(i){e(t,n,i,o)}},ie=function(e,t,n,o){t.done||(t.done=!0,o&&(t=o),t.value=n,t.state=2,$(e,t,!0))},re=function(e,t,n,o){if(!t.done){t.done=!0,o&&(t=o);try{if(e===n)throw B("Promise can't be resolved itself");var i=J(n);i?w((function(){var o={done:!1};try{i.call(n,oe(re,e,o,t),oe(ie,e,o,t))}catch(n){ie(e,o,n,t)}})):(t.value=n,t.state=1,$(e,t,!1))}catch(n){ie(e,{done:!1},n,t)}}};q&&(z=function(e){y(this,z,L),g(e),o.call(this);var t=N(this);try{e(oe(re,this,t),oe(ie,this,t))}catch(e){ie(this,t,e)}},(o=function(e){H(this,{type:L,done:!1,notified:!1,parent:!1,reactions:[],rejection:!1,state:0,value:void 0})}).prototype=f(z.prototype,{then:function(e,t){var n=R(this),o=W(E(this,z));return o.ok="function"!=typeof e||e,o.fail="function"==typeof t&&t,o.domain=G?U.domain:void 0,n.parent=!0,n.reactions.push(o),0!=n.state&&$(this,n,!1),o.promise},catch:function(e){return this.then(void 0,e)}}),i=function(){var e=new o,t=N(e);this.promise=e,this.resolve=oe(re,e,t),this.reject=oe(ie,e,t)},C.f=W=function(e){return e===z||e===r?new i(e):X(e)},l||"function"!=typeof d||(s=d.prototype.then,h(d.prototype,"then",(function(e,t){var n=this;return new z((function(e,t){s.call(n,e,t)})).then(e,t)}),{unsafe:!0}),"function"==typeof V&&a({global:!0,enumerable:!0,forced:!0},{fetch:function(e){return O(z,V.apply(c,arguments))}}))),a({global:!0,wrap:!0,forced:q},{Promise:z}),p(z,L,!1,!0),m(L),r=u(L),a({target:L,stat:!0,forced:q},{reject:function(e){var t=W(this);return t.reject.call(void 0,e),t.promise}}),a({target:L,stat:!0,forced:l||q},{resolve:function(e){return O(l&&this===r?z:this,e)}}),a({target:L,stat:!0,forced:K},{all:function(e){var t=this,n=W(t),o=n.resolve,i=n.reject,r=S((function(){var n=g(t.resolve),r=[],s=0,a=1;j(e,(function(e){var l=s++,c=!1;r.push(void 0),a++,n.call(t,e).then((function(e){c||(c=!0,r[l]=e,--a||o(r))}),i)})),--a||o(r)}));return r.error&&i(r.value),n.promise},race:function(e){var t=this,n=W(t),o=n.reject,i=S((function(){var i=g(t.resolve);j(e,(function(e){i.call(t,e).then(n.resolve,o)}))}));return i.error&&o(i.value),n.promise}})},"./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(e,t,n){"use strict";var o=n(/*! ../internals/string-multibyte */"./node_modules/core-js-pure/internals/string-multibyte.js").charAt,i=n(/*! ../internals/internal-state */"./node_modules/core-js-pure/internals/internal-state.js"),r=n(/*! ../internals/define-iterator */"./node_modules/core-js-pure/internals/define-iterator.js"),s="String Iterator",a=i.set,l=i.getterFor(s);r(String,"String",(function(e){a(this,{type:s,string:String(e),index:0})}),(function(){var e,t=l(this),n=t.string,i=t.index;return i>=n.length?{value:void 0,done:!0}:(e=o(n,i),t.index+=e.length,{value:e,done:!1})}))},"./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(e,t,n){"use strict";var o=n(/*! ../internals/export */"./node_modules/core-js-pure/internals/export.js"),i=n(/*! ../internals/descriptors */"./node_modules/core-js-pure/internals/descriptors.js"),r=n(/*! ../internals/object-get-prototype-of */"./node_modules/core-js-pure/internals/object-get-prototype-of.js"),s=n(/*! ../internals/object-set-prototype-of */"./node_modules/core-js-pure/internals/object-set-prototype-of.js"),a=n(/*! ../internals/object-create */"./node_modules/core-js-pure/internals/object-create.js"),l=n(/*! ../internals/object-define-property */"./node_modules/core-js-pure/internals/object-define-property.js"),c=n(/*! ../internals/create-property-descriptor */"./node_modules/core-js-pure/internals/create-property-descriptor.js"),u=n(/*! ../internals/iterate */"./node_modules/core-js-pure/internals/iterate.js"),d=n(/*! ../internals/create-non-enumerable-property */"./node_modules/core-js-pure/internals/create-non-enumerable-property.js"),h=n(/*! ../internals/internal-state */"./node_modules/core-js-pure/internals/internal-state.js"),f=h.set,p=h.getterFor("AggregateError"),m=function(e,t){var n=this;if(!(n instanceof m))return new m(e,t);s&&(n=s(new Error(t),r(n)));var o=[];return u(e,o.push,o),i?f(n,{errors:o,type:"AggregateError"}):n.errors=o,void 0!==t&&d(n,"message",String(t)),n};m.prototype=a(Error.prototype,{constructor:c(5,m),message:c(5,""),name:c(5,"AggregateError")}),i&&l.f(m.prototype,"errors",{get:function(){return p(this).errors},configurable:!0}),o({global:!0},{AggregateError:m})},"./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(e,t,n){n(/*! ./es.promise.all-settled.js */"./node_modules/core-js-pure/modules/es.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(e,t,n){"use strict";var o=n(/*! ../internals/export */"./node_modules/core-js-pure/internals/export.js"),i=n(/*! ../internals/a-function */"./node_modules/core-js-pure/internals/a-function.js"),r=n(/*! ../internals/get-built-in */"./node_modules/core-js-pure/internals/get-built-in.js"),s=n(/*! ../internals/new-promise-capability */"./node_modules/core-js-pure/internals/new-promise-capability.js"),a=n(/*! ../internals/perform */"./node_modules/core-js-pure/internals/perform.js"),l=n(/*! ../internals/iterate */"./node_modules/core-js-pure/internals/iterate.js"),c="No one promise resolved";o({target:"Promise",stat:!0},{any:function(e){var t=this,n=s.f(t),o=n.resolve,u=n.reject,d=a((function(){var n=i(t.resolve),s=[],a=0,d=1,h=!1;l(e,(function(e){var i=a++,l=!1;s.push(void 0),d++,n.call(t,e).then((function(e){l||h||(h=!0,o(e))}),(function(e){l||h||(l=!0,s[i]=e,--d||u(new(r("AggregateError"))(s,c)))}))})),--d||u(new(r("AggregateError"))(s,c))}));return d.error&&u(d.value),n.promise}})},"./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(e,t,n){"use strict";var o=n(/*! ../internals/export */"./node_modules/core-js-pure/internals/export.js"),i=n(/*! ../internals/new-promise-capability */"./node_modules/core-js-pure/internals/new-promise-capability.js"),r=n(/*! ../internals/perform */"./node_modules/core-js-pure/internals/perform.js");o({target:"Promise",stat:!0},{try:function(e){var t=i.f(this),n=r(e);return(n.error?t.reject:t.resolve)(n.value),t.promise}})},"./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(e,t,n){n(/*! ./es.array.iterator */"./node_modules/core-js-pure/modules/es.array.iterator.js");var o=n(/*! ../internals/dom-iterables */"./node_modules/core-js-pure/internals/dom-iterables.js"),i=n(/*! ../internals/global */"./node_modules/core-js-pure/internals/global.js"),r=n(/*! ../internals/classof */"./node_modules/core-js-pure/internals/classof.js"),s=n(/*! ../internals/create-non-enumerable-property */"./node_modules/core-js-pure/internals/create-non-enumerable-property.js"),a=n(/*! ../internals/iterators */"./node_modules/core-js-pure/internals/iterators.js"),l=n(/*! ../internals/well-known-symbol */"./node_modules/core-js-pure/internals/well-known-symbol.js")("toStringTag");for(var c in o){var u=i[c],d=u&&u.prototype;d&&r(d)!==l&&s(d,l,c),a[c]=a.Array}},"./node_modules/webpack/buildin/global.js":
|
|
/*!***********************************!*\
|
|
!*** (webpack)/buildin/global.js ***!
|
|
\***********************************/
|
|
/*! no static exports found */function(e,t){var n;n=function(){return this}();try{n=n||new Function("return this")()}catch(e){"object"==typeof window&&(n=window)}e.exports=n},"./src/css/index.styl":
|
|
/*!****************************!*\
|
|
!*** ./src/css/index.styl ***!
|
|
\****************************/
|
|
/*! no static exports found */function(e,t,n){},"./src/index.js":
|
|
/*!**********************!*\
|
|
!*** ./src/index.js ***!
|
|
\**********************/
|
|
/*! no static exports found */function(e,t,n){"use strict";n(/*! @/polyfill */"./src/js/polyfill.js");var o,i=n(/*! @/imageEditor */"./src/js/imageEditor.js"),r=(o=i)&&o.__esModule?o:{default:o};n(/*! @css/index.styl */"./src/css/index.styl"),n(/*! @/command/addIcon */"./src/js/command/addIcon.js"),n(/*! @/command/addImageObject */"./src/js/command/addImageObject.js"),n(/*! @/command/addObject */"./src/js/command/addObject.js"),n(/*! @/command/addShape */"./src/js/command/addShape.js"),n(/*! @/command/addText */"./src/js/command/addText.js"),n(/*! @/command/applyFilter */"./src/js/command/applyFilter.js"),n(/*! @/command/changeIconColor */"./src/js/command/changeIconColor.js"),n(/*! @/command/changeShape */"./src/js/command/changeShape.js"),n(/*! @/command/changeText */"./src/js/command/changeText.js"),n(/*! @/command/changeTextStyle */"./src/js/command/changeTextStyle.js"),n(/*! @/command/clearObjects */"./src/js/command/clearObjects.js"),n(/*! @/command/flip */"./src/js/command/flip.js"),n(/*! @/command/loadImage */"./src/js/command/loadImage.js"),n(/*! @/command/removeFilter */"./src/js/command/removeFilter.js"),n(/*! @/command/removeObject */"./src/js/command/removeObject.js"),n(/*! @/command/resizeCanvasDimension */"./src/js/command/resizeCanvasDimension.js"),n(/*! @/command/rotate */"./src/js/command/rotate.js"),n(/*! @/command/setObjectProperties */"./src/js/command/setObjectProperties.js"),n(/*! @/command/setObjectPosition */"./src/js/command/setObjectPosition.js"),n(/*! @/command/changeSelection */"./src/js/command/changeSelection.js"),e.exports=r.default},"./src/js/action.js":
|
|
/*!**************************!*\
|
|
!*** ./src/js/action.js ***!
|
|
\**************************/
|
|
/*! no static exports found */function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var o,i=n(/*! tui-code-snippet */"tui-code-snippet"),r=n(/*! @/helper/imagetracer */"./src/js/helper/imagetracer.js"),s=(o=r)&&o.__esModule?o:{default:o},a=n(/*! @/util */"./src/js/util.js"),l=n(/*! @/consts */"./src/js/consts.js");t.default={getActions:function(){return{main:this._mainAction(),shape:this._shapeAction(),crop:this._cropAction(),flip:this._flipAction(),rotate:this._rotateAction(),text:this._textAction(),mask:this._maskAction(),draw:this._drawAction(),icon:this._iconAction(),filter:this._filterAction(),history:this._historyAction()}},_mainAction:function(){var e=this,t=function(){"crop"===e.ui.submenu&&(e.stopDrawingMode(),e.ui.changeMenu("crop"))},n=function(t){var n,o;return n=t,"rotate"===e.ui.submenu&&e.ui.rotate.setRangeBarAngle("setAngle",n),o=t,"filter"===e.ui.submenu&&e.ui.filter.setFilterState(o),t},o=function(){e.ui.filter&&e.ui.filter.initFilterCheckBoxState()};return(0,i.extend)({initLoadImage:function(n,o){return e.loadImageFromURL(n,o).then((function(o){t(),e.ui.initializeImgUrl=n,e.ui.resizeEditor({imageSize:o}),e.clearUndoStack(),e._invoker.fire(l.eventNames.EXECUTE_COMMAND,l.historyNames.LOAD_IMAGE)}))},undo:function(){e.isEmptyUndoStack()||(t(),e.deactivateAll(),e.undo().then(n))},redo:function(){e.isEmptyRedoStack()||(t(),e.deactivateAll(),e.redo().then(n))},reset:function(){t(),e.loadImageFromURL(e.ui.initializeImgUrl,"resetImage").then((function(n){t(),o(),e.ui.resizeEditor({imageSize:n}),e.clearUndoStack(),e._initHistory()}))},delete:function(){e.ui.changeHelpButtonEnabled("delete",!1),t(),e.removeActiveObject(),e.activeObjectId=null},deleteAll:function(){t(),e.clearObjects(),e.ui.changeHelpButtonEnabled("delete",!1),e.ui.changeHelpButtonEnabled("deleteAll",!1)},load:function(n){(0,a.isSupportFileApi)()||alert("This browser does not support file-api"),e.ui.initializeImgUrl=URL.createObjectURL(n),e.loadImageFromFile(n).then((function(n){t(),o(),e.clearUndoStack(),e.ui.activeMenuEvent(),e.ui.resizeEditor({imageSize:n}),e._clearHistory(),e._invoker.fire(l.eventNames.EXECUTE_COMMAND,l.historyNames.LOAD_IMAGE)})).catch((function(e){return Promise.reject(e)}))},download:function(){var t=e.toDataURL(),n=e.getImageName(),o=void 0,i=void 0;(0,a.isSupportFileApi)()&&window.saveAs?(i=(o=(0,a.base64ToBlob)(t)).type.split("/")[1],n.split(".").pop()!==i&&(n+="."+i),saveAs(o,n)):window.open().document.body.innerHTML="<img src='"+t+"'>"},history:function(t){e.ui.toggleHistoryMenu(t)},zoomIn:function(){var t;e.ui.toggleZoomButtonStatus("zoomIn"),e.deactivateAll(),t=e._graphics.getZoomMode(),e.stopDrawingMode(),t!==l.zoomModes.ZOOM?(e.startDrawingMode(l.drawingModes.ZOOM),e._graphics.startZoomInMode()):e._graphics.endZoomInMode()},zoomOut:function(){e._graphics.zoomOut()},hand:function(){var t;e.ui.offZoomInButtonStatus(),e.ui.toggleZoomButtonStatus("hand"),e.deactivateAll(),t=e._graphics.getZoomMode(),e.stopDrawingMode(),t!==l.zoomModes.HAND?(e.startDrawingMode(l.drawingModes.ZOOM),e._graphics.startHandMode()):e._graphics.endHandMode()}},this._commonAction())},_iconAction:function(){var e=this;return(0,i.extend)({changeColor:function(t){e.activeObjectId&&e.changeIconColor(e.activeObjectId,t)},addIcon:function(t,n){e.startDrawingMode("ICON"),e.setDrawingIcon(t,n)},cancelAddIcon:function(){e.ui.icon.clearIconType(),e.changeSelectableAll(!0),e.changeCursor("default"),e.stopDrawingMode()},registerDefaultIcons:function(t,n){var o={};o[t]=n,e.registerIcons(o)},registerCustomIcon:function(t,n){(new s.default).imageToSVG(t,(function(t){var o=t.match(/path[^>]*d="([^"]*)"/)[1],i={};i[n.name]=o,e.registerIcons(i),e.addIcon(n.name,{left:100,top:100})}),s.default.tracerDefaultOption())}},this._commonAction())},_drawAction:function(){var e=this;return(0,i.extend)({setDrawMode:function(t,n){e.stopDrawingMode(),"free"===t?e.startDrawingMode("FREE_DRAWING",n):e.startDrawingMode("LINE_DRAWING",n)},setColor:function(t){e.setBrush({color:t})}},this._commonAction())},_maskAction:function(){var e=this;return(0,i.extend)({loadImageFromURL:function(t,n){return e.loadImageFromURL(e.toDataURL(),"FilterImage").then((function(){e.addImageObject(t).then((function(){URL.revokeObjectURL(n)})),e._invoker.fire(l.eventNames.EXECUTE_COMMAND,l.historyNames.LOAD_MASK_IMAGE)}))},applyFilter:function(){e.applyFilter("mask",{maskObjId:e.activeObjectId})}},this._commonAction())},_textAction:function(){var e=this;return(0,i.extend)({changeTextStyle:function(t,n){e.activeObjectId&&e.changeTextStyle(e.activeObjectId,t,n)}},this._commonAction())},_rotateAction:function(){var e=this;return(0,i.extend)({rotate:function(t,n){e.rotate(t,n),e.ui.resizeEditor(),e.ui.rotate.setRangeBarAngle("rotate",t)},setAngle:function(t,n){e.setAngle(t,n),e.ui.resizeEditor(),e.ui.rotate.setRangeBarAngle("setAngle",t)}},this._commonAction())},_shapeAction:function(){var e=this;return(0,i.extend)({changeShape:function(t,n){e.activeObjectId&&e.changeShape(e.activeObjectId,t,n)},setDrawingShape:function(t){e.setDrawingShape(t)}},this._commonAction())},_cropAction:function(){var e=this;return(0,i.extend)({crop:function(){var t=e.getCropzoneRect();t&&!(0,a.isEmptyCropzone)(t)&&e.crop(t).then((function(){e.stopDrawingMode(),e.ui.resizeEditor(),e.ui.changeMenu("crop"),e._invoker.fire(l.eventNames.EXECUTE_COMMAND,l.historyNames.CROP)})).catch((function(e){return Promise.reject(e)}))},cancel:function(){e.stopDrawingMode(),e.ui.changeMenu("crop")},preset:function(t){switch(t){case"preset-square":e.setCropzoneRect(1);break;case"preset-3-2":e.setCropzoneRect(1.5);break;case"preset-4-3":e.setCropzoneRect(4/3);break;case"preset-5-4":e.setCropzoneRect(5/4);break;case"preset-7-5":e.setCropzoneRect(1.4);break;case"preset-16-9":e.setCropzoneRect(16/9);break;default:e.setCropzoneRect(),e.ui.crop.changeApplyButtonStatus(!1)}}},this._commonAction())},_flipAction:function(){var e=this;return(0,i.extend)({flip:function(t){return e[t]()}},this._commonAction())},_filterAction:function(){var e=this;return(0,i.extend)({applyFilter:function(t,n,o,i){t?e.applyFilter(n,o,i):e.hasFilter(n)&&e.removeFilter(n)}},this._commonAction())},setReAction:function(){var e=this;this.on({undoStackChanged:function(t){t?(e.ui.changeHelpButtonEnabled("undo",!0),e.ui.changeHelpButtonEnabled("reset",!0)):(e.ui.changeHelpButtonEnabled("undo",!1),e.ui.changeHelpButtonEnabled("reset",!1)),e.ui.resizeEditor()},redoStackChanged:function(t){t?e.ui.changeHelpButtonEnabled("redo",!0):e.ui.changeHelpButtonEnabled("redo",!1),e.ui.resizeEditor()},objectActivated:function(t){e.activeObjectId=t.id,e.ui.changeHelpButtonEnabled("delete",!0),e.ui.changeHelpButtonEnabled("deleteAll",!0),"cropzone"===t.type?e.ui.crop.changeApplyButtonStatus(!0):["rect","circle","triangle"].indexOf(t.type)>-1?(e.stopDrawingMode(),"shape"!==e.ui.submenu&&e.ui.changeMenu("shape",!1,!1),e.ui.shape.setShapeStatus({strokeColor:t.stroke,strokeWidth:t.strokeWidth,fillColor:t.fill}),e.ui.shape.setMaxStrokeValue(Math.min(t.width,t.height))):"path"===t.type||"line"===t.type?"draw"!==e.ui.submenu&&(e.ui.changeMenu("draw",!1,!1),e.ui.draw.changeStandbyMode()):["i-text","text"].indexOf(t.type)>-1?("text"!==e.ui.submenu&&e.ui.changeMenu("text",!1,!1),e.ui.text.setTextStyleStateOnAction(t)):"icon"===t.type&&(e.stopDrawingMode(),"icon"!==e.ui.submenu&&e.ui.changeMenu("icon",!1,!1),e.ui.icon.setIconPickerColor(t.fill))},addText:function(t){var n=e.ui.text,o=n.textColor,i=n.fontSize,r=n.fontStyle,s=n.fontWeight,a=n.underline;e.addText("Double Click",{position:t.originPosition,styles:{fill:o,fontSize:i,fontFamily:"Noto Sans",fontStyle:r,fontWeight:s,underline:a}}).then((function(){e.changeCursor("default")}))},addObjectAfter:function(t){"icon"===t.type?e.ui.icon.changeStandbyMode():["rect","circle","triangle"].indexOf(t.type)>-1&&(e.ui.shape.setMaxStrokeValue(Math.min(t.width,t.height)),e.ui.shape.changeStandbyMode())},objectScaled:function(t){if(["i-text","text"].indexOf(t.type)>-1)e.ui.text.fontSize=(0,a.toInteger)(t.fontSize);else if(["rect","circle","triangle"].indexOf(t.type)>=0){var n=t.width,o=t.height,i=e.ui.shape.getStrokeValue();n<i&&e.ui.shape.setStrokeValue(n),o<i&&e.ui.shape.setStrokeValue(o)}},selectionCleared:function(){e.activeObjectId=null,"text"===e.ui.submenu?e.changeCursor("text"):"draw"!==e.ui.submenu&&"crop"!==e.ui.submenu&&e.stopDrawingMode()}})},_historyAction:function(){var e=this;return{undo:function(t){return e.undo(t)},redo:function(t){return e.redo(t)}}},_commonAction:function(){var e=this,t=l.drawingModes.TEXT,n=l.drawingModes.CROPPER,o=l.drawingModes.SHAPE,i=l.drawingModes.ZOOM;return{modeChange:function(r){switch(r){case l.drawingMenuNames.TEXT:e._changeActivateMode(t);break;case l.drawingMenuNames.CROP:e.startDrawingMode(n);break;case l.drawingMenuNames.SHAPE:e._changeActivateMode(o),e.setDrawingShape(e.ui.shape.type,e.ui.shape.options);break;case l.drawingMenuNames.ZOOM:e.startDrawingMode(i)}},deactivateAll:this.deactivateAll.bind(this),changeSelectableAll:this.changeSelectableAll.bind(this),discardSelection:this.discardSelection.bind(this),stopDrawingMode:this.stopDrawingMode.bind(this)}},mixin:function(e){(0,i.extend)(e.prototype,this)}}},"./src/js/command/addIcon.js":
|
|
/*!***********************************!*\
|
|
!*** ./src/js/command/addIcon.js ***!
|
|
\***********************************/
|
|
/*! no static exports found */function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var o,i=n(/*! @/factory/command */"./src/js/factory/command.js"),r=(o=i)&&o.__esModule?o:{default:o},s=n(/*! @/util */"./src/js/util.js"),a=n(/*! @/consts */"./src/js/consts.js");var l=a.componentNames.ICON,c={name:a.commandNames.ADD_ICON,execute:function(e,t,n){var o=this;return e.getComponent(l).add(t,n).then((function(t){return o.undoData.object=e.getObject(t.id),t}))},undo:function(e){return e.remove(this.undoData.object),s.Promise.resolve()}};r.default.register(c),t.default=c},"./src/js/command/addImageObject.js":
|
|
/*!******************************************!*\
|
|
!*** ./src/js/command/addImageObject.js ***!
|
|
\******************************************/
|
|
/*! no static exports found */function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var o,i=n(/*! @/factory/command */"./src/js/factory/command.js"),r=(o=i)&&o.__esModule?o:{default:o},s=n(/*! @/util */"./src/js/util.js");var a={name:n(/*! @/consts */"./src/js/consts.js").commandNames.ADD_IMAGE_OBJECT,execute:function(e,t){var n=this;return e.addImageObject(t).then((function(t){return n.undoData.object=e.getObject(t.id),t}))},undo:function(e){return e.remove(this.undoData.object),s.Promise.resolve()}};r.default.register(a),t.default=a},"./src/js/command/addObject.js":
|
|
/*!*************************************!*\
|
|
!*** ./src/js/command/addObject.js ***!
|
|
\*************************************/
|
|
/*! no static exports found */function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var o,i=n(/*! @/factory/command */"./src/js/factory/command.js"),r=(o=i)&&o.__esModule?o:{default:o},s=n(/*! @/util */"./src/js/util.js"),a=n(/*! @/consts */"./src/js/consts.js");var l={name:a.commandNames.ADD_OBJECT,execute:function(e,t){return new s.Promise((function(n,o){e.contains(t)?o(a.rejectMessages.addedObject):(e.add(t),n(t))}))},undo:function(e,t){return new s.Promise((function(n,o){e.contains(t)?(e.remove(t),n(t)):o(a.rejectMessages.noObject)}))}};r.default.register(l),t.default=l},"./src/js/command/addShape.js":
|
|
/*!************************************!*\
|
|
!*** ./src/js/command/addShape.js ***!
|
|
\************************************/
|
|
/*! no static exports found */function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var o,i=n(/*! @/factory/command */"./src/js/factory/command.js"),r=(o=i)&&o.__esModule?o:{default:o},s=n(/*! @/util */"./src/js/util.js"),a=n(/*! @/consts */"./src/js/consts.js");var l=a.componentNames.SHAPE,c={name:a.commandNames.ADD_SHAPE,execute:function(e,t,n){var o=this;return e.getComponent(l).add(t,n).then((function(t){var n=t.id;return o.undoData.object=e.getObject(n),t}))},undo:function(e){return e.remove(this.undoData.object),s.Promise.resolve()}};r.default.register(c),t.default=c},"./src/js/command/addText.js":
|
|
/*!***********************************!*\
|
|
!*** ./src/js/command/addText.js ***!
|
|
\***********************************/
|
|
/*! no static exports found */function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var o,i=n(/*! @/factory/command */"./src/js/factory/command.js"),r=(o=i)&&o.__esModule?o:{default:o},s=n(/*! @/util */"./src/js/util.js"),a=n(/*! @/consts */"./src/js/consts.js"),l=n(/*! @/helper/selectionModifyHelper */"./src/js/helper/selectionModifyHelper.js");var c=a.componentNames.TEXT,u={name:a.commandNames.ADD_TEXT,execute:function(e,t,n){var o=this,i=e.getComponent(c);if(this.undoData.object){var r=this.undoData.object;return new s.Promise((function(t,n){e.contains(r)?n(a.rejectMessages.redo):(e.add(r),t(r))}))}return i.add(t,n).then((function(t){var n=t.id,i=e.getObject(n);return o.undoData.object=i,(0,l.setCachedUndoDataForDimension)((0,l.makeSelectionUndoData)(i,(function(){return(0,l.makeSelectionUndoDatum)(n,i,!1)}))),t}))},undo:function(e){return e.remove(this.undoData.object),s.Promise.resolve()}};r.default.register(u),t.default=u},"./src/js/command/applyFilter.js":
|
|
/*!***************************************!*\
|
|
!*** ./src/js/command/applyFilter.js ***!
|
|
\***************************************/
|
|
/*! no static exports found */function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var o=s(n(/*! tui-code-snippet */"tui-code-snippet")),i=s(n(/*! @/factory/command */"./src/js/factory/command.js")),r=n(/*! @/consts */"./src/js/consts.js");function s(e){return e&&e.__esModule?e:{default:e}}var a=r.componentNames.FILTER,l=null;var c={name:r.commandNames.APPLY_FILTER,execute:function(e,t,n,i){var s=e.getComponent(a);if("mask"===t){var c=e.getObject(n.maskObjId);if(!c||!c.isType("image"))return Promise.reject(r.rejectMessages.invalidParameters);o.default.extend(n,{mask:c}),e.remove(n.mask)}if(!this.isRedo){var u=function(e,t,n){var o={};return"mask"===e&&(o.object=n.mask),o.options=t,o}(t,s.getOptions(t),n);l=this.setUndoData(u,l,i)}return s.add(t,n)},undo:function(e,t){var n=e.getComponent(a);if("mask"===t){var o=this.undoData.object;return e.add(o),e.setActiveObject(o),n.remove(t)}return this.undoData.options?n.add(t,this.undoData.options):n.remove(t)}};i.default.register(c),t.default=c},"./src/js/command/changeIconColor.js":
|
|
/*!*******************************************!*\
|
|
!*** ./src/js/command/changeIconColor.js ***!
|
|
\*******************************************/
|
|
/*! no static exports found */function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var o,i=n(/*! @/factory/command */"./src/js/factory/command.js"),r=(o=i)&&o.__esModule?o:{default:o},s=n(/*! @/util */"./src/js/util.js"),a=n(/*! @/consts */"./src/js/consts.js");var l=a.componentNames.ICON,c={name:a.commandNames.CHANGE_ICON_COLOR,execute:function(e,t,n){var o=this;return new s.Promise((function(i,r){var s=e.getComponent(l),c=e.getObject(t);c||r(a.rejectMessages.noObject),o.undoData.object=c,o.undoData.color=s.getColor(c),s.setColor(n,c),i()}))},undo:function(e){var t=e.getComponent(l),n=this.undoData,o=n.object,i=n.color;return t.setColor(i,o),s.Promise.resolve()}};r.default.register(c),t.default=c},"./src/js/command/changeSelection.js":
|
|
/*!*******************************************!*\
|
|
!*** ./src/js/command/changeSelection.js ***!
|
|
\*******************************************/
|
|
/*! no static exports found */function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var o,i=n(/*! @/factory/command */"./src/js/factory/command.js"),r=(o=i)&&o.__esModule?o:{default:o},s=n(/*! @/util */"./src/js/util.js"),a=n(/*! @/consts */"./src/js/consts.js"),l=n(/*! @/helper/selectionModifyHelper */"./src/js/helper/selectionModifyHelper.js");var c={name:a.commandNames.CHANGE_SELECTION,execute:function(e,t){return this.isRedo?t.forEach((function(t){e.setObjectProperties(t.id,t)})):this.undoData=(0,l.getCachedUndoDataForDimension)(),s.Promise.resolve()},undo:function(e){return this.undoData.forEach((function(t){e.setObjectProperties(t.id,t)})),s.Promise.resolve()}};r.default.register(c),t.default=c},"./src/js/command/changeShape.js":
|
|
/*!***************************************!*\
|
|
!*** ./src/js/command/changeShape.js ***!
|
|
\***************************************/
|
|
/*! no static exports found */function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var o=a(n(/*! tui-code-snippet */"tui-code-snippet")),i=a(n(/*! @/factory/command */"./src/js/factory/command.js")),r=n(/*! @/util */"./src/js/util.js"),s=n(/*! @/consts */"./src/js/consts.js");function a(e){return e&&e.__esModule?e:{default:e}}var l=s.componentNames.SHAPE,c=null;var u={name:s.commandNames.CHANGE_SHAPE,execute:function(e,t,n,i){var a=e.getComponent(l),u=e.getObject(t);if(!u)return r.Promise.reject(s.rejectMessages.noObject);if(!this.isRedo){var d=function(e,t){var n={object:t,options:{}};return o.default.forEachOwnProperties(e,(function(e,o){n.options[o]=t[o]})),n}(n,u);c=this.setUndoData(d,c,i)}return a.change(u,n)},undo:function(e){var t=e.getComponent(l),n=this.undoData,o=n.object,i=n.options;return t.change(o,i)}};i.default.register(u),t.default=u},"./src/js/command/changeText.js":
|
|
/*!**************************************!*\
|
|
!*** ./src/js/command/changeText.js ***!
|
|
\**************************************/
|
|
/*! no static exports found */function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var o,i=n(/*! @/factory/command */"./src/js/factory/command.js"),r=(o=i)&&o.__esModule?o:{default:o},s=n(/*! @/util */"./src/js/util.js"),a=n(/*! @/consts */"./src/js/consts.js");var l=a.componentNames.TEXT,c={name:a.commandNames.CHANGE_TEXT,execute:function(e,t,n){var o=e.getComponent(l),i=e.getObject(t);return i?(this.undoData.object=i,this.undoData.text=o.getText(i),o.change(i,n)):s.Promise.reject(a.rejectMessages.noObject)},undo:function(e){var t=e.getComponent(l),n=this.undoData,o=n.object,i=n.text;return t.change(o,i)}};r.default.register(c),t.default=c},"./src/js/command/changeTextStyle.js":
|
|
/*!*******************************************!*\
|
|
!*** ./src/js/command/changeTextStyle.js ***!
|
|
\*******************************************/
|
|
/*! no static exports found */function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var o=a(n(/*! tui-code-snippet */"tui-code-snippet")),i=a(n(/*! @/factory/command */"./src/js/factory/command.js")),r=n(/*! @/util */"./src/js/util.js"),s=n(/*! @/consts */"./src/js/consts.js");function a(e){return e&&e.__esModule?e:{default:e}}var l=s.componentNames.TEXT,c=null;var u={name:s.commandNames.CHANGE_TEXT_STYLE,execute:function(e,t,n,i){var a=e.getComponent(l),u=e.getObject(t);if(!u)return r.Promise.reject(s.rejectMessages.noObject);if(!this.isRedo){var d=function(e,t){var n={object:t,styles:{}};return o.default.forEachOwnProperties(e,(function(e,o){var i=t[o];n.styles[o]=i})),n}(n,u);c=this.setUndoData(d,c,i)}return a.setStyle(u,n)},undo:function(e){var t=e.getComponent(l),n=this.undoData,o=n.object,i=n.styles;return t.setStyle(o,i)}};i.default.register(u),t.default=u},"./src/js/command/clearObjects.js":
|
|
/*!****************************************!*\
|
|
!*** ./src/js/command/clearObjects.js ***!
|
|
\****************************************/
|
|
/*! no static exports found */function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var o,i=n(/*! @/factory/command */"./src/js/factory/command.js"),r=(o=i)&&o.__esModule?o:{default:o},s=n(/*! @/util */"./src/js/util.js");var a={name:n(/*! @/consts */"./src/js/consts.js").commandNames.CLEAR_OBJECTS,execute:function(e){var t=this;return new s.Promise((function(n){t.undoData.objects=e.removeAll(),n()}))},undo:function(e){return e.add(this.undoData.objects),s.Promise.resolve()}};r.default.register(a),t.default=a},"./src/js/command/flip.js":
|
|
/*!********************************!*\
|
|
!*** ./src/js/command/flip.js ***!
|
|
\********************************/
|
|
/*! no static exports found */function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var o,i=n(/*! @/factory/command */"./src/js/factory/command.js"),r=(o=i)&&o.__esModule?o:{default:o},s=n(/*! @/consts */"./src/js/consts.js");var a=s.componentNames.FLIP,l={name:s.commandNames.FLIP_IMAGE,execute:function(e,t){var n=e.getComponent(a);return this.undoData.setting=n.getCurrentSetting(),n[t]()},undo:function(e){return e.getComponent(a).set(this.undoData.setting)}};r.default.register(l),t.default=l},"./src/js/command/loadImage.js":
|
|
/*!*************************************!*\
|
|
!*** ./src/js/command/loadImage.js ***!
|
|
\*************************************/
|
|
/*! no static exports found */function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var o,i=n(/*! @/factory/command */"./src/js/factory/command.js"),r=(o=i)&&o.__esModule?o:{default:o},s=n(/*! @/consts */"./src/js/consts.js");var a=s.componentNames.IMAGE_LOADER,l={name:s.commandNames.LOAD_IMAGE,execute:function(e,t,n){var o=e.getComponent(a),i=o.getCanvasImage(),r=i?i.width:0,s=i?i.height:0,l=e.removeAll(!0).filter((function(e){return"cropzone"!==e.type}));return l.forEach((function(e){e.evented=!0})),this.undoData={name:o.getImageName(),image:i,objects:l},o.load(t,n).then((function(e){return{oldWidth:r,oldHeight:s,newWidth:e.width,newHeight:e.height}}))},undo:function(e){var t=e.getComponent(a),n=this.undoData,o=n.objects,i=n.name,r=n.image;return e.removeAll(!0),e.add(o),t.load(i,r)}};r.default.register(l),t.default=l},"./src/js/command/removeFilter.js":
|
|
/*!****************************************!*\
|
|
!*** ./src/js/command/removeFilter.js ***!
|
|
\****************************************/
|
|
/*! no static exports found */function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var o,i=n(/*! @/factory/command */"./src/js/factory/command.js"),r=(o=i)&&o.__esModule?o:{default:o},s=n(/*! @/consts */"./src/js/consts.js");var a=s.componentNames.FILTER,l={name:s.commandNames.REMOVE_FILTER,execute:function(e,t){var n=e.getComponent(a);return this.undoData.options=n.getOptions(t),n.remove(t)},undo:function(e,t){var n=e.getComponent(a),o=this.undoData.options;return n.add(t,o)}};r.default.register(l),t.default=l},"./src/js/command/removeObject.js":
|
|
/*!****************************************!*\
|
|
!*** ./src/js/command/removeObject.js ***!
|
|
\****************************************/
|
|
/*! no static exports found */function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var o,i=n(/*! @/factory/command */"./src/js/factory/command.js"),r=(o=i)&&o.__esModule?o:{default:o},s=n(/*! @/util */"./src/js/util.js"),a=n(/*! @/consts */"./src/js/consts.js");var l={name:a.commandNames.REMOVE_OBJECT,execute:function(e,t){var n=this;return new s.Promise((function(o,i){n.undoData.objects=e.removeObjectById(t),n.undoData.objects.length?o():i(a.rejectMessages.noObject)}))},undo:function(e){return e.add(this.undoData.objects),s.Promise.resolve()}};r.default.register(l),t.default=l},"./src/js/command/resizeCanvasDimension.js":
|
|
/*!*************************************************!*\
|
|
!*** ./src/js/command/resizeCanvasDimension.js ***!
|
|
\*************************************************/
|
|
/*! no static exports found */function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var o,i=n(/*! @/factory/command */"./src/js/factory/command.js"),r=(o=i)&&o.__esModule?o:{default:o},s=n(/*! @/util */"./src/js/util.js");var a={name:n(/*! @/consts */"./src/js/consts.js").commandNames.RESIZE_CANVAS_DIMENSION,execute:function(e,t){var n=this;return new s.Promise((function(o){n.undoData.size={width:e.cssMaxWidth,height:e.cssMaxHeight},e.setCssMaxDimension(t),e.adjustCanvasDimension(),o()}))},undo:function(e){return e.setCssMaxDimension(this.undoData.size),e.adjustCanvasDimension(),s.Promise.resolve()}};r.default.register(a),t.default=a},"./src/js/command/rotate.js":
|
|
/*!**********************************!*\
|
|
!*** ./src/js/command/rotate.js ***!
|
|
\**********************************/
|
|
/*! no static exports found */function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var o,i=n(/*! @/factory/command */"./src/js/factory/command.js"),r=(o=i)&&o.__esModule?o:{default:o},s=n(/*! @/consts */"./src/js/consts.js");var a=s.componentNames.ROTATION,l=null;var c={name:s.commandNames.ROTATE_IMAGE,execute:function(e,t,n,o){var i=e.getComponent(a);if(!this.isRedo){var r=function(e){return{angle:e.getCurrentAngle()}}(i);l=this.setUndoData(r,l,o)}return i[t](n)},undo:function(e){var t=e.getComponent(a),n=this.args,o=n[1],i=n[2];return"setAngle"===o?t[o](this.undoData.angle):t.rotate(-i)}};r.default.register(c),t.default=c},"./src/js/command/setObjectPosition.js":
|
|
/*!*********************************************!*\
|
|
!*** ./src/js/command/setObjectPosition.js ***!
|
|
\*********************************************/
|
|
/*! no static exports found */function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var o,i=n(/*! @/factory/command */"./src/js/factory/command.js"),r=(o=i)&&o.__esModule?o:{default:o},s=n(/*! @/util */"./src/js/util.js"),a=n(/*! @/consts */"./src/js/consts.js");var l={name:a.commandNames.SET_OBJECT_POSITION,execute:function(e,t,n){return e.getObject(t)?(this.undoData.objectId=t,this.undoData.props=e.getObjectProperties(t,["left","top"]),e.setObjectPosition(t,n),e.renderAll(),s.Promise.resolve()):s.Promise.reject(a.rejectMessages.noObject)},undo:function(e){var t=this.undoData,n=t.objectId,o=t.props;return e.setObjectProperties(n,o),e.renderAll(),s.Promise.resolve()}};r.default.register(l),t.default=l},"./src/js/command/setObjectProperties.js":
|
|
/*!***********************************************!*\
|
|
!*** ./src/js/command/setObjectProperties.js ***!
|
|
\***********************************************/
|
|
/*! no static exports found */function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var o=a(n(/*! tui-code-snippet */"tui-code-snippet")),i=a(n(/*! @/factory/command */"./src/js/factory/command.js")),r=n(/*! @/util */"./src/js/util.js"),s=n(/*! @/consts */"./src/js/consts.js");function a(e){return e&&e.__esModule?e:{default:e}}var l={name:s.commandNames.SET_OBJECT_PROPERTIES,execute:function(e,t,n){var i=this,a=e.getObject(t);return a?(this.undoData.props={},o.default.forEachOwnProperties(n,(function(e,t){i.undoData.props[t]=a[t]})),e.setObjectProperties(t,n),r.Promise.resolve()):r.Promise.reject(s.rejectMessages.noObject)},undo:function(e,t){var n=this.undoData.props;return e.setObjectProperties(t,n),r.Promise.resolve()}};i.default.register(l),t.default=l},"./src/js/component/cropper.js":
|
|
/*!*************************************!*\
|
|
!*** ./src/js/component/cropper.js ***!
|
|
\*************************************/
|
|
/*! no static exports found */function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var o=function(){function e(e,t){for(var n=0;n<t.length;n++){var o=t[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}return function(t,n,o){return n&&e(t.prototype,n),o&&e(t,o),t}}(),i=u(n(/*! tui-code-snippet */"tui-code-snippet")),r=u(n(/*! fabric */"fabric")),s=u(n(/*! @/interface/component */"./src/js/interface/component.js")),a=u(n(/*! @/extension/cropzone */"./src/js/extension/cropzone.js")),l=n(/*! @/consts */"./src/js/consts.js"),c=n(/*! @/util */"./src/js/util.js");function u(e){return e&&e.__esModule?e:{default:e}}var d={presetRatio:null,top:-10,left:-10,height:1,width:1},h=function(e){function t(e){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t);var n=function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,l.componentNames.CROPPER,e));return n._cropzone=null,n._startX=null,n._startY=null,n._withShiftKey=!1,n._listeners={keydown:n._onKeyDown.bind(n),keyup:n._onKeyUp.bind(n),mousedown:n._onFabricMouseDown.bind(n),mousemove:n._onFabricMouseMove.bind(n),mouseup:n._onFabricMouseUp.bind(n)},n}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,e),o(t,[{key:"start",value:function(){if(!this._cropzone){var e=this.getCanvas();e.forEachObject((function(e){e.evented=!1})),this._cropzone=new a.default(e,i.default.extend({left:0,top:0,width:.5,height:.5,strokeWidth:0,cornerSize:10,cornerColor:"black",fill:"transparent"},l.CROPZONE_DEFAULT_OPTIONS,this.graphics.cropSelectionStyle)),e.discardActiveObject(),e.add(this._cropzone),e.on("mouse:down",this._listeners.mousedown),e.selection=!1,e.defaultCursor="crosshair",r.default.util.addListener(document,"keydown",this._listeners.keydown),r.default.util.addListener(document,"keyup",this._listeners.keyup)}}},{key:"end",value:function(){var e=this.getCanvas(),t=this._cropzone;t&&(e.remove(t),e.selection=!0,e.defaultCursor="default",e.off("mouse:down",this._listeners.mousedown),e.forEachObject((function(e){e.evented=!0})),this._cropzone=null,r.default.util.removeListener(document,"keydown",this._listeners.keydown),r.default.util.removeListener(document,"keyup",this._listeners.keyup))}},{key:"changeVisibility",value:function(e){this._cropzone&&this._cropzone.set({visible:e})}},{key:"_onFabricMouseDown",value:function(e){var t=this.getCanvas();if(!e.target){t.selection=!1;var n=t.getPointer(e.e);this._startX=n.x,this._startY=n.y,t.on({"mouse:move":this._listeners.mousemove,"mouse:up":this._listeners.mouseup})}}},{key:"_onFabricMouseMove",value:function(e){var t=this.getCanvas(),n=t.getPointer(e.e),o=n.x,i=n.y,r=this._cropzone;Math.abs(o-this._startX)+Math.abs(i-this._startY)>10&&(t.remove(r),r.set(this._calcRectDimensionFromPoint(o,i)),t.add(r),t.setActiveObject(r))}},{key:"_calcRectDimensionFromPoint",value:function(e,t){var n=this.getCanvas(),o=n.getWidth(),i=n.getHeight(),r=this._startX,s=this._startY,a=(0,c.clamp)(e,0,r),l=(0,c.clamp)(t,0,s),u=(0,c.clamp)(e,r,o)-a,d=(0,c.clamp)(t,s,i)-l;return this._withShiftKey&&(u>d?d=u:d>u&&(u=d),r>=e&&(a=r-u),s>=t&&(l=s-d)),{left:a,top:l,width:u,height:d}}},{key:"_onFabricMouseUp",value:function(){var e=this._cropzone,t=this._listeners,n=this.getCanvas();n.setActiveObject(e),n.off({"mouse:move":t.mousemove,"mouse:up":t.mouseup})}},{key:"getCroppedImageData",value:function(e){var t=this.getCanvas(),n=t.contains(this._cropzone);if(!e)return null;n&&t.remove(this._cropzone);var o={imageName:this.getImageName(),url:t.toDataURL(e)};return n&&t.add(this._cropzone),o}},{key:"getCropzoneRect",value:function(){var e=this._cropzone;return e.isValid()?{left:e.left,top:e.top,width:e.width,height:e.height}:null}},{key:"setCropzoneRect",value:function(e){var t=this.getCanvas(),n=this._cropzone;t.discardActiveObject(),t.selection=!1,t.remove(n),n.set(e?this._getPresetPropertiesForCropSize(e):d),t.add(n),t.selection=!0,e&&t.setActiveObject(n)}},{key:"_getPresetPropertiesForCropSize",value:function(e){var t=this.getCanvas(),n=t.getWidth(),o=t.getHeight(),r=n>=o?n:o,s=function(e,t){return e>t?t/e:1},a=r*e,l=r,u=s(a,n),d=i.default.map([a,l],(function(e){return e*u}));a=d[0];var h=s(l=d[1],o),f=i.default.map([a,l],(function(e){return(0,c.fixFloatingPoint)(e*h)}));return a=f[0],{presetRatio:e,top:(o-(l=f[1]))/2,left:(n-a)/2,width:a,height:l}}},{key:"_onKeyDown",value:function(e){e.keyCode===l.keyCodes.SHIFT&&(this._withShiftKey=!0)}},{key:"_onKeyUp",value:function(e){e.keyCode===l.keyCodes.SHIFT&&(this._withShiftKey=!1)}}]),t}(s.default);t.default=h},"./src/js/component/filter.js":
|
|
/*!************************************!*\
|
|
!*** ./src/js/component/filter.js ***!
|
|
\************************************/
|
|
/*! no static exports found */function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var o=function(){function e(e,t){for(var n=0;n<t.length;n++){var o=t[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}return function(t,n,o){return n&&e(t.prototype,n),o&&e(t,o),t}}(),i=n(/*! tui-code-snippet */"tui-code-snippet"),r=f(n(/*! fabric */"fabric")),s=f(n(/*! @/interface/component */"./src/js/interface/component.js")),a=n(/*! @/util */"./src/js/util.js"),l=n(/*! @/consts */"./src/js/consts.js"),c=f(n(/*! @/extension/mask */"./src/js/extension/mask.js")),u=f(n(/*! @/extension/sharpen */"./src/js/extension/sharpen.js")),d=f(n(/*! @/extension/emboss */"./src/js/extension/emboss.js")),h=f(n(/*! @/extension/colorFilter */"./src/js/extension/colorFilter.js"));function f(e){return e&&e.__esModule?e:{default:e}}var p=r.default.Image.filters;p.Mask=c.default,p.Sharpen=u.default,p.Emboss=d.default,p.ColorFilter=h.default;var m=function(e){function t(e){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,l.componentNames.FILTER,e))}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,e),o(t,[{key:"add",value:function(e,t){var n=this;return new a.Promise((function(o,i){var r=n._getSourceImage(),s=n.getCanvas(),a=n._getFilter(r,e);a||(a=n._createFilter(r,e,t)),a||i(l.rejectMessages.invalidParameters),n._changeFilterValues(a,t),n._apply(r,(function(){s.renderAll(),o({type:e,action:"add",options:t})}))}))}},{key:"remove",value:function(e){var t=this;return new a.Promise((function(n,o){var i=t._getSourceImage(),r=t.getCanvas(),s=t.getOptions(e);i.filters.length||o(l.rejectMessages.unsupportedOperation),t._removeFilter(i,e),t._apply(i,(function(){r.renderAll(),n({type:e,action:"remove",options:s})}))}))}},{key:"hasFilter",value:function(e){return!!this._getFilter(this._getSourceImage(),e)}},{key:"getOptions",value:function(e){var t=this._getSourceImage(),n=this._getFilter(t,e);return n?(0,i.extend)({},n.options):null}},{key:"_changeFilterValues",value:function(e,t){(0,i.forEach)(t,(function(t,n){(0,i.isUndefined)(e[n])||(e[n]=t)})),(0,i.forEach)(e.options,(function(n,o){(0,i.isUndefined)(t[o])||(e.options[o]=t[o])}))}},{key:"_apply",value:function(e,t){e.filters.push(),e.applyFilters()&&t()}},{key:"_getSourceImage",value:function(){return this.getCanvasImage()}},{key:"_createFilter",value:function(e,t,n){var o=void 0,i=this._getFabricFilterType(t),s=r.default.Image.filters[i];return s&&((o=new s(n)).options=n,e.filters.push(o)),o}},{key:"_getFilter",value:function(e,t){var n=null;if(e){var o=this._getFabricFilterType(t),i=e.filters.length,r=void 0,s=void 0;for(s=0;s<i;s+=1)if((r=e.filters[s]).type===o){n=r;break}}return n}},{key:"_removeFilter",value:function(e,t){var n=this._getFabricFilterType(t);e.filters=(0,i.filter)(e.filters,(function(e){return e.type!==n}))}},{key:"_getFabricFilterType",value:function(e){return e.charAt(0).toUpperCase()+e.slice(1)}}]),t}(s.default);t.default=m},"./src/js/component/flip.js":
|
|
/*!**********************************!*\
|
|
!*** ./src/js/component/flip.js ***!
|
|
\**********************************/
|
|
/*! no static exports found */function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var o=function(){function e(e,t){for(var n=0;n<t.length;n++){var o=t[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}return function(t,n,o){return n&&e(t.prototype,n),o&&e(t,o),t}}(),i=l(n(/*! tui-code-snippet */"tui-code-snippet")),r=l(n(/*! @/interface/component */"./src/js/interface/component.js")),s=n(/*! @/util */"./src/js/util.js"),a=n(/*! @/consts */"./src/js/consts.js");function l(e){return e&&e.__esModule?e:{default:e}}var c=function(e){function t(e){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,a.componentNames.FLIP,e))}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,e),o(t,[{key:"getCurrentSetting",value:function(){var e=this.getCanvasImage();return{flipX:e.flipX,flipY:e.flipY}}},{key:"set",value:function(e){var t=this.getCurrentSetting(),n=t.flipX!==e.flipX,o=t.flipY!==e.flipY;return n||o?(i.default.extend(t,e),this.setImageProperties(t,!0),this._invertAngle(n,o),this._flipObjects(n,o),s.Promise.resolve({flipX:t.flipX,flipY:t.flipY,angle:this.getCanvasImage().angle})):s.Promise.reject(a.rejectMessages.flip)}},{key:"_invertAngle",value:function(e,t){var n=this.getCanvasImage(),o=n.angle;e&&(o*=-1),t&&(o*=-1),n.rotate(parseFloat(o)).setCoords()}},{key:"_flipObjects",value:function(e,t){var n=this.getCanvas();e&&n.forEachObject((function(e){e.set({angle:parseFloat(-1*e.angle),flipX:!e.flipX,left:n.width-e.left}).setCoords()})),t&&n.forEachObject((function(e){e.set({angle:parseFloat(-1*e.angle),flipY:!e.flipY,top:n.height-e.top}).setCoords()})),n.renderAll()}},{key:"reset",value:function(){return this.set({flipX:!1,flipY:!1})}},{key:"flipX",value:function(){var e=this.getCurrentSetting();return this.set({flipX:!e.flipX,flipY:e.flipY})}},{key:"flipY",value:function(){var e=this.getCurrentSetting();return this.set({flipX:e.flipX,flipY:!e.flipY})}}]),t}(r.default);t.default=c},"./src/js/component/freeDrawing.js":
|
|
/*!*****************************************!*\
|
|
!*** ./src/js/component/freeDrawing.js ***!
|
|
\*****************************************/
|
|
/*! no static exports found */function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var o=function(){function e(e,t){for(var n=0;n<t.length;n++){var o=t[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}return function(t,n,o){return n&&e(t.prototype,n),o&&e(t,o),t}}(),i=a(n(/*! fabric */"fabric")),r=a(n(/*! @/interface/component */"./src/js/interface/component.js")),s=n(/*! @/consts */"./src/js/consts.js");function a(e){return e&&e.__esModule?e:{default:e}}var l=function(e){function t(e){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t);var n=function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,s.componentNames.FREE_DRAWING,e));return n.width=12,n.oColor=new i.default.Color("rgba(0, 0, 0, 0.5)"),n}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,e),o(t,[{key:"start",value:function(e){this.getCanvas().isDrawingMode=!0,this.setBrush(e)}},{key:"setBrush",value:function(e){var t=this.getCanvas().freeDrawingBrush;e=e||{},this.width=e.width||this.width,e.color&&(this.oColor=new i.default.Color(e.color)),t.width=this.width,t.color=this.oColor.toRgba()}},{key:"end",value:function(){this.getCanvas().isDrawingMode=!1}}]),t}(r.default);t.default=l},"./src/js/component/icon.js":
|
|
/*!**********************************!*\
|
|
!*** ./src/js/component/icon.js ***!
|
|
\**********************************/
|
|
/*! no static exports found */function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var o=function(){function e(e,t){for(var n=0;n<t.length;n++){var o=t[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}return function(t,n,o){return n&&e(t.prototype,n),o&&e(t,o),t}}(),i=c(n(/*! tui-code-snippet */"tui-code-snippet")),r=c(n(/*! fabric */"fabric")),s=c(n(/*! @/interface/component */"./src/js/interface/component.js")),a=n(/*! @/util */"./src/js/util.js"),l=n(/*! @/consts */"./src/js/consts.js");function c(e){return e&&e.__esModule?e:{default:e}}var u={arrow:"M 0 90 H 105 V 120 L 160 60 L 105 0 V 30 H 0 Z",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"},d=function(e){function t(e){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t);var n=function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,l.componentNames.ICON,e));return n._oColor="#000000",n._pathMap=u,n._type=null,n._iconColor=null,n._handlers={mousedown:n._onFabricMouseDown.bind(n),mousemove:n._onFabricMouseMove.bind(n),mouseup:n._onFabricMouseUp.bind(n)},n}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,e),o(t,[{key:"setStates",value:function(e,t){this._type=e,this._iconColor=t}},{key:"start",value:function(){var e=this.getCanvas();e.selection=!1,e.on("mouse:down",this._handlers.mousedown)}},{key:"end",value:function(){var e=this.getCanvas();e.selection=!0,e.off({"mouse:down":this._handlers.mousedown})}},{key:"add",value:function(e,t){var n=this;return new a.Promise((function(o,r){var s=n.getCanvas(),a=n._pathMap[e],c=l.fObjectOptions.SELECTION_STYLE,u=a?n._createIcon(a):null;n._icon=u,u||r(l.rejectMessages.invalidParameters),u.set(i.default.extend({type:"icon",fill:n._oColor},c,t,n.graphics.controlStyle)),s.add(u).setActiveObject(u),o(n.graphics.createObjectProperties(u))}))}},{key:"registerPaths",value:function(e){var t=this;i.default.forEach(e,(function(e,n){t._pathMap[n]=e}),this)}},{key:"setColor",value:function(e,t){this._oColor=e,t&&"icon"===t.get("type")&&(t.set({fill:this._oColor}),this.getCanvas().renderAll())}},{key:"getColor",value:function(e){return e.fill}},{key:"_createIcon",value:function(e){return new r.default.Path(e)}},{key:"_onFabricMouseDown",value:function(e){var t=this,n=this.getCanvas();this._startPoint=n.getPointer(e.e);var o=this._startPoint,i=o.x,r=o.y;this.add(this._type,{left:i,top:r,fill:this._iconColor}).then((function(){t.fire(l.eventNames.ADD_OBJECT,t.graphics.createObjectProperties(t._icon)),n.on("mouse:move",t._handlers.mousemove),n.on("mouse:up",t._handlers.mouseup)}))}},{key:"_onFabricMouseMove",value:function(e){var t=this.getCanvas();if(this._icon){var n=t.getPointer(e.e),o=(n.x-this._startPoint.x)/this._icon.width,i=(n.y-this._startPoint.y)/this._icon.height;this._icon.set({scaleX:Math.abs(2*o),scaleY:Math.abs(2*i)}),this._icon.setCoords(),t.renderAll()}}},{key:"_onFabricMouseUp",value:function(){var e=this.getCanvas();this.fire(l.eventNames.OBJECT_ADDED,this.graphics.createObjectProperties(this._icon)),this._icon=null,e.off("mouse:down",this._handlers.mousedown),e.off("mouse:move",this._handlers.mousemove),e.off("mouse:up",this._handlers.mouseup)}}]),t}(s.default);t.default=d},"./src/js/component/imageLoader.js":
|
|
/*!*****************************************!*\
|
|
!*** ./src/js/component/imageLoader.js ***!
|
|
\*****************************************/
|
|
/*! no static exports found */function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var o,i=function(){function e(e,t){for(var n=0;n<t.length;n++){var o=t[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}return function(t,n,o){return n&&e(t.prototype,n),o&&e(t,o),t}}(),r=n(/*! @/interface/component */"./src/js/interface/component.js"),s=(o=r)&&o.__esModule?o:{default:o},a=n(/*! @/util */"./src/js/util.js"),l=n(/*! @/consts */"./src/js/consts.js");var c={padding:0,crossOrigin:"Anonymous"},u=function(e){function t(e){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,l.componentNames.IMAGE_LOADER,e))}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,e),i(t,[{key:"load",value:function(e,t){var n=this,o=void 0;if(e||t)o=this._setBackgroundImage(t).then((function(t){return n.setCanvasImage(e,t),n.adjustCanvasDimension(),t}));else{var i=this.getCanvas();i.backgroundImage=null,i.renderAll(),o=new a.Promise((function(e){n.setCanvasImage("",null),e()}))}return o}},{key:"_setBackgroundImage",value:function(e){var t=this;return e?new a.Promise((function(n,o){var i=t.getCanvas();i.setBackgroundImage(e,(function(){var e=i.backgroundImage;e&&e.getElement()?n(e):o(l.rejectMessages.loadingImageFailed)}),c)})):a.Promise.reject(l.rejectMessages.loadImage)}}]),t}(s.default);t.default=u},"./src/js/component/line.js":
|
|
/*!**********************************!*\
|
|
!*** ./src/js/component/line.js ***!
|
|
\**********************************/
|
|
/*! no static exports found */function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var o=function(){function e(e,t){for(var n=0;n<t.length;n++){var o=t[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}return function(t,n,o){return n&&e(t.prototype,n),o&&e(t,o),t}}(),i=c(n(/*! tui-code-snippet */"tui-code-snippet")),r=c(n(/*! fabric */"fabric")),s=c(n(/*! @/interface/component */"./src/js/interface/component.js")),a=c(n(/*! @/extension/arrowLine */"./src/js/extension/arrowLine.js")),l=n(/*! @/consts */"./src/js/consts.js");function c(e){return e&&e.__esModule?e:{default:e}}var u=function(e){function t(e){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t);var n=function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,l.componentNames.LINE,e));return n._width=12,n._oColor=new r.default.Color("rgba(0, 0, 0, 0.5)"),n._listeners={mousedown:n._onFabricMouseDown.bind(n),mousemove:n._onFabricMouseMove.bind(n),mouseup:n._onFabricMouseUp.bind(n)},n}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,e),o(t,[{key:"setHeadOption",value:function(e){var t=e.arrowType,n=void 0===t?{head:null,tail:null}:t;this._arrowType=n}},{key:"start",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=this.getCanvas();t.defaultCursor="crosshair",t.selection=!1,this.setHeadOption(e),this.setBrush(e),t.forEachObject((function(e){e.set({evented:!1})})),t.on({"mouse:down":this._listeners.mousedown})}},{key:"setBrush",value:function(e){var t=this.getCanvas().freeDrawingBrush;e=e||{},this._width=e.width||this._width,e.color&&(this._oColor=new r.default.Color(e.color)),t.width=this._width,t.color=this._oColor.toRgba()}},{key:"end",value:function(){var e=this.getCanvas();e.defaultCursor="default",e.selection=!0,e.forEachObject((function(e){e.set({evented:!0})})),e.off("mouse:down",this._listeners.mousedown)}},{key:"_onFabricMouseDown",value:function(e){var t=this.getCanvas(),n=t.getPointer(e.e),o=n.x,i=n.y,r=[o,i,o,i];this._line=new a.default(r,{stroke:this._oColor.toRgba(),strokeWidth:this._width,arrowType:this._arrowType,evented:!1}),this._line.set(l.fObjectOptions.SELECTION_STYLE),t.add(this._line),t.on({"mouse:move":this._listeners.mousemove,"mouse:up":this._listeners.mouseup}),this.fire(l.eventNames.ADD_OBJECT,this._createLineEventObjectProperties())}},{key:"_onFabricMouseMove",value:function(e){var t=this.getCanvas(),n=t.getPointer(e.e);this._line.set({x2:n.x,y2:n.y}),this._line.setCoords(),t.renderAll()}},{key:"_onFabricMouseUp",value:function(){var e=this.getCanvas();this.fire(l.eventNames.OBJECT_ADDED,this._createLineEventObjectProperties()),this._line=null,e.off({"mouse:move":this._listeners.mousemove,"mouse:up":this._listeners.mouseup})}},{key:"_createLineEventObjectProperties",value:function(){var e=this.graphics.createObjectProperties(this._line),t=this._line,n=t.x1,o=t.x2,r=t.y1,s=t.y2;return i.default.extend({},e,{startPosition:{x:n,y:r},endPosition:{x:o,y:s}})}}]),t}(s.default);t.default=u},"./src/js/component/rotation.js":
|
|
/*!**************************************!*\
|
|
!*** ./src/js/component/rotation.js ***!
|
|
\**************************************/
|
|
/*! no static exports found */function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var o=function(){function e(e,t){for(var n=0;n<t.length;n++){var o=t[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}return function(t,n,o){return n&&e(t.prototype,n),o&&e(t,o),t}}(),i=l(n(/*! fabric */"fabric")),r=l(n(/*! @/interface/component */"./src/js/interface/component.js")),s=n(/*! @/util */"./src/js/util.js"),a=n(/*! @/consts */"./src/js/consts.js");function l(e){return e&&e.__esModule?e:{default:e}}var c=function(e){function t(e){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,a.componentNames.ROTATION,e))}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,e),o(t,[{key:"getCurrentAngle",value:function(){return this.getCanvasImage().angle}},{key:"setAngle",value:function(e){var t=this.getCurrentAngle()%360;e%=360;var n=this.getCanvasImage(),o=n.getCenterPoint();n.set({angle:e}).setCoords(),this.adjustCanvasDimension();var i=n.getCenterPoint();return this._rotateForEachObject(o,i,e-t),s.Promise.resolve(e)}},{key:"_rotateForEachObject",value:function(e,t,n){var o=this.getCanvas(),r=e.x-t.x,s=e.y-t.y;o.forEachObject((function(t){var o=t.getCenterPoint(),a=i.default.util.degreesToRadians(n),l=i.default.util.rotatePoint(o,e,a);t.set({left:l.x-r,top:l.y-s,angle:(t.angle+n)%360}),t.setCoords()})),o.renderAll()}},{key:"rotate",value:function(e){var t=this.getCurrentAngle();return this.setAngle(t+e)}}]),t}(r.default);t.default=c},"./src/js/component/shape.js":
|
|
/*!***********************************!*\
|
|
!*** ./src/js/component/shape.js ***!
|
|
\***********************************/
|
|
/*! no static exports found */function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var o=function(){function e(e,t){for(var n=0;n<t.length;n++){var o=t[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}return function(t,n,o){return n&&e(t.prototype,n),o&&e(t,o),t}}(),i=n(/*! tui-code-snippet */"tui-code-snippet"),r=d(n(/*! fabric */"fabric")),s=d(n(/*! @/interface/component */"./src/js/interface/component.js")),a=d(n(/*! @/helper/shapeResizeHelper */"./src/js/helper/shapeResizeHelper.js")),l=n(/*! @/helper/shapeFilterFillHelper */"./src/js/helper/shapeFilterFillHelper.js"),c=n(/*! @/util */"./src/js/util.js"),u=n(/*! @/consts */"./src/js/consts.js");function d(e){return e&&e.__esModule?e:{default:e}}var h=(0,i.extend)({strokeWidth:1,stroke:"#000000",fill:"#ffffff",width:1,height:1,rx:0,ry:0},u.SHAPE_DEFAULT_OPTIONS);function f(e,t,n){var o=e.fill,r=(0,c.getFillTypeFromOption)(e.fill),s=o;o.color&&(s=o.color);var a=null;if("filter"===r){var u=n();a=(0,l.makeFillPatternForFilter)(t,o.filter,u)}else a={fill:s};return(0,i.extend)({},e,a)}var p=function(e){function t(e){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t);var n=function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,u.componentNames.SHAPE,e));return n._shapeObj=null,n._type="rect",n._options=(0,i.extend)({},h),n._isSelected=!1,n._startPoint={},n._withShiftKey=!1,n._handlers={mousedown:n._onFabricMouseDown.bind(n),mousemove:n._onFabricMouseMove.bind(n),mouseup:n._onFabricMouseUp.bind(n),keydown:n._onKeyDown.bind(n),keyup:n._onKeyUp.bind(n)},n}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,e),o(t,[{key:"start",value:function(){var e=this.getCanvas();this._isSelected=!1,e.defaultCursor="crosshair",e.selection=!1,e.uniformScaling=!0,e.on({"mouse:down":this._handlers.mousedown}),r.default.util.addListener(document,"keydown",this._handlers.keydown),r.default.util.addListener(document,"keyup",this._handlers.keyup)}},{key:"end",value:function(){var e=this.getCanvas();this._isSelected=!1,e.defaultCursor="default",e.selection=!0,e.uniformScaling=!1,e.off({"mouse:down":this._handlers.mousedown}),r.default.util.removeListener(document,"keydown",this._handlers.keydown),r.default.util.removeListener(document,"keyup",this._handlers.keyup)}},{key:"setStates",value:function(e,t){this._type=e,t&&(this._options=(0,i.extend)(this._options,t))}},{key:"add",value:function(e,t){var n=this;return new c.Promise((function(o){var i=n.getCanvas(),r=n._extendOptions(t),s=n._createInstance(e,r),a=n.graphics.createObjectProperties(s);n._bindEventOnShape(s),i.add(s).setActiveObject(s),n._resetPositionFillFilter(s),o(a)}))}},{key:"change",value:function(e,t){var n=this;return new c.Promise((function(o,i){(0,c.isShape)(e)||i(u.rejectMessages.unsupportedType);var r="filter"===(0,c.getFillTypeFromOption)(t.fill),s=n.graphics,a=s.canvasImage,l=s.createStaticCanvas;e.set(r?f(t,a,l):t),r&&n._resetPositionFillFilter(e),n.getCanvas().renderAll(),o()}))}},{key:"makeFillPropertyForUserEvent",value:function(e){var t=(0,c.getFillTypeFromObject)(e),n={};if(t===u.SHAPE_FILL_TYPE.FILTER){var o=(0,l.getFillImageFromShape)(e),i=(0,l.makeFilterOptionFromFabricImage)(o);n.type=t,n.filter=i}else n.type=u.SHAPE_FILL_TYPE.COLOR,n.color=e.fill||"transparent";return n}},{key:"processForCopiedObject",value:function(e,t){if(this._bindEventOnShape(e),"filter"===(0,c.getFillTypeFromObject)(e)){var n=(0,l.getFillImageFromShape)(t),o=(0,l.makeFilterOptionFromFabricImage)(n),i=this.graphics.createStaticCanvas();e.set((0,l.makeFillPatternForFilter)(this.graphics.canvasImage,o,i)),this._resetPositionFillFilter(e)}}},{key:"_createInstance",value:function(e,t){var n=void 0;switch(e){case"rect":n=new r.default.Rect(t);break;case"circle":n=new r.default.Ellipse((0,i.extend)({type:"circle"},t));break;case"triangle":n=new r.default.Triangle(t);break;default:n={}}return n}},{key:"_extendOptions",value:function(e){var t=u.fObjectOptions.SELECTION_STYLE,n=this.graphics,o=n.canvasImage,r=n.createStaticCanvas;return f(e=(0,i.extend)({},h,this._options,t,e),o,r)}},{key:"_bindEventOnShape",value:function(e){var t=this,n=this.getCanvas();e.on({added:function(){t._shapeObj=this,a.default.setOrigins(t._shapeObj)},selected:function(){t._isSelected=!0,t._shapeObj=this,n.uniformScaling=!0,n.defaultCursor="default",a.default.setOrigins(t._shapeObj)},deselected:function(){t._isSelected=!1,t._shapeObj=null,n.defaultCursor="crosshair",n.uniformScaling=!1},modified:function(){var e=t._shapeObj;a.default.adjustOriginToCenter(e),a.default.setOrigins(e)},modifiedInGroup:function(n){t._fillFilterRePositionInGroupSelection(e,n)},moving:function(){t._resetPositionFillFilter(this)},rotating:function(){t._resetPositionFillFilter(this)},scaling:function(e){var o=n.getPointer(e.e),i=t._shapeObj;n.setCursor("crosshair"),a.default.resize(i,o,!0),t._resetPositionFillFilter(this)}})}},{key:"_onFabricMouseDown",value:function(e){if(e.target||(this._isSelected=!1,this._shapeObj=!1),!this._isSelected&&!this._shapeObj){var t=this.getCanvas();this._startPoint=t.getPointer(e.e),t.on({"mouse:move":this._handlers.mousemove,"mouse:up":this._handlers.mouseup})}}},{key:"_onFabricMouseMove",value:function(e){var t=this,n=this.getCanvas(),o=n.getPointer(e.e),i=this._startPoint.x,r=this._startPoint.y,s=i-o.x,l=r-o.y,c=this._shapeObj;c?(this._shapeObj.set({isRegular:this._withShiftKey}),a.default.resize(c,o),n.renderAll(),this._resetPositionFillFilter(c)):this.add(this._type,{left:i,top:r,width:s,height:l}).then((function(e){t.fire(u.eventNames.ADD_OBJECT,e)}))}},{key:"_onFabricMouseUp",value:function(){var e=this,t=this.getCanvas(),n=this._startPoint.x,o=this._startPoint.y,i=this._shapeObj;i?i&&(a.default.adjustOriginToCenter(i),this.fire(u.eventNames.OBJECT_ADDED,this.graphics.createObjectProperties(i))):this.add(this._type,{left:n,top:o,width:20,height:20}).then((function(t){e.fire(u.eventNames.ADD_OBJECT,t)})),t.off({"mouse:move":this._handlers.mousemove,"mouse:up":this._handlers.mouseup})}},{key:"_onKeyDown",value:function(e){e.keyCode===u.keyCodes.SHIFT&&(this._withShiftKey=!0,this._shapeObj&&(this._shapeObj.isRegular=!0))}},{key:"_onKeyUp",value:function(e){e.keyCode===u.keyCodes.SHIFT&&(this._withShiftKey=!1,this._shapeObj&&(this._shapeObj.isRegular=!1))}},{key:"_resetPositionFillFilter",value:function(e){if("filter"===(0,c.getFillTypeFromObject)(e)){var t=(0,c.getCustomProperty)(e,"patternSourceCanvas").patternSourceCanvas,n=(0,l.getFillImageFromShape)(e),o=(0,c.getCustomProperty)(n,"originalAngle").originalAngle;this.graphics.canvasImage.angle!==o&&(0,l.reMakePatternImageSource)(e,this.graphics.canvasImage);var i=e.originX,r=e.originY;a.default.adjustOriginToCenter(e),e.width*=e.scaleX,e.height*=e.scaleY,e.rx*=e.scaleX,e.ry*=e.scaleY,e.scaleX=1,e.scaleY=1,(0,l.rePositionFilterTypeFillImage)(e),(0,c.changeOrigin)(e,{originX:i,originY:r}),(0,l.resetFillPatternCanvas)(t)}}},{key:"_fillFilterRePositionInGroupSelection",value:function(e,t){1===t.scaleX&&1===t.scaleY||t.addWithUpdate();var n=e.angle,o=e.left,i=e.top;t.realizeTransform(e),this._resetPositionFillFilter(e),e.set({angle:n,left:o,top:i})}}]),t}(s.default);t.default=p},"./src/js/component/text.js":
|
|
/*!**********************************!*\
|
|
!*** ./src/js/component/text.js ***!
|
|
\**********************************/
|
|
/*! no static exports found */function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var o=function(){function e(e,t){for(var n=0;n<t.length;n++){var o=t[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}return function(t,n,o){return n&&e(t.prototype,n),o&&e(t,o),t}}(),i=c(n(/*! tui-code-snippet */"tui-code-snippet")),r=c(n(/*! fabric */"fabric")),s=c(n(/*! @/interface/component */"./src/js/interface/component.js")),a=n(/*! @/util */"./src/js/util.js"),l=n(/*! @/consts */"./src/js/consts.js");function c(e){return e&&e.__esModule?e:{default:e}}var u={fill:"#000000",left:0,top:0},d={fill:"#000000",fontStyle:"normal",fontWeight:"normal",textAlign:"left",underline:!1},h=function(e){function t(e){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t);var n=function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,l.componentNames.TEXT,e));return n._defaultStyles=u,n._isSelected=!1,n._selectedObj={},n._editingObj={},n._listeners={mousedown:n._onFabricMouseDown.bind(n),select:n._onFabricSelect.bind(n),selectClear:n._onFabricSelectClear.bind(n),scaling:n._onFabricScaling.bind(n),textChanged:n._onFabricTextChanged.bind(n)},n._textarea=null,n._ratio=1,n._lastClickTime=(new Date).getTime(),n._editingObjInfos={},n.isPrevEditing=!1,n}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,e),o(t,[{key:"start",value:function(){var e=this,t=this.getCanvas();t.selection=!1,t.defaultCursor="text",t.on({"mouse:down":this._listeners.mousedown,"selection:created":this._listeners.select,"selection:updated":this._listeners.select,"before:selection:cleared":this._listeners.selectClear,"object:scaling":this._listeners.scaling,"text:changed":this._listeners.textChanged}),t.forEachObject((function(t){"i-text"===t.type&&e.adjustOriginPosition(t,"start")})),this.setCanvasRatio()}},{key:"end",value:function(){var e=this,t=this.getCanvas();t.selection=!0,t.defaultCursor="default",t.forEachObject((function(n){"i-text"===n.type&&(""===n.text?t.remove(n):e.adjustOriginPosition(n,"end"))})),t.off({"mouse:down":this._listeners.mousedown,"selection:created":this._listeners.select,"selection:updated":this._listeners.select,"before:selection:cleared":this._listeners.selectClear,"object:selected":this._listeners.select,"object:scaling":this._listeners.scaling,"text:changed":this._listeners.textChanged})}},{key:"adjustOriginPosition",value:function(e,t){var n="center",o="center";"start"===t&&(n="left",o="top");var i=e.getPointByOrigin(n,o),r=i.x,s=i.y;e.set({left:r,top:s,originX:n,originY:o}),e.setCoords()}},{key:"add",value:function(e,t){var n=this;return new a.Promise((function(o){var s=n.getCanvas(),a=null,c=l.fObjectOptions.SELECTION_STYLE,u=n._defaultStyles;n._setInitPos(t.position),t.styles&&(u=i.default.extend(u,t.styles)),i.default.isExisty(t.autofocus)||(t.autofocus=!0),a=new r.default.IText(e,u),c=i.default.extend({},c,{originX:"left",originY:"top"}),a.set(c),a.on({mouseup:n._onFabricMouseUp.bind(n)}),s.add(a),t.autofocus&&(a.enterEditing(),a.selectAll()),s.getActiveObject()||s.setActiveObject(a),n.isPrevEditing=!0,o(n.graphics.createObjectProperties(a))}))}},{key:"change",value:function(e,t){var n=this;return new a.Promise((function(o){e.set("text",t),n.getCanvas().renderAll(),o()}))}},{key:"setStyle",value:function(e,t){var n=this;return new a.Promise((function(o){i.default.forEach(t,(function(n,o){e[o]===n&&"fontSize"!==o&&(t[o]=d[o]||"")}),n),"textDecoration"in t&&i.default.extend(t,n._getTextDecorationAdaptObject(t.textDecoration)),e.set(t),n.getCanvas().renderAll(),o()}))}},{key:"getText",value:function(e){return e.text}},{key:"setSelectedInfo",value:function(e,t){this._selectedObj=e,this._isSelected=t}},{key:"isSelected",value:function(){return this._isSelected}},{key:"getSelectedObj",value:function(){return this._selectedObj}},{key:"setCanvasRatio",value:function(){var e=this.getCanvasElement(),t=parseInt(e.style.maxWidth,10),n=e.width;this._ratio=n/t}},{key:"getCanvasRatio",value:function(){return this._ratio}},{key:"_getTextDecorationAdaptObject",value:function(e){return{underline:"underline"===e,linethrough:"line-through"===e,overline:"overline"===e}}},{key:"_setInitPos",value:function(e){e=e||this.getCanvasImage().getCenterPoint(),this._defaultStyles.left=e.x,this._defaultStyles.top=e.y}},{key:"_onInput",value:function(){var e=this.getCanvasRatio(),t=this._editingObj,n=this._textarea.style;n.width=Math.ceil(t.width/e)+"px",n.height=Math.ceil(t.height/e)+"px"}},{key:"_onKeyDown",value:function(){var e=this,t=this.getCanvasRatio(),n=this._editingObj,o=this._textarea.style;setTimeout((function(){n.text(e._textarea.value),o.width=Math.ceil(n.width/t)+"px",o.height=Math.ceil(n.height/t)+"px"}),0)}},{key:"_onBlur",value:function(){var e=this.getCanvasRatio(),t=this._editingObj,n=this._editingObjInfos,o=this._textarea.value,r=t.width/e-n.width/e,s=t.height/e-n.height/e;if(1===e&&(r/=2,s/=2),this._textarea.style.display="none",t.set({left:n.left+r,top:n.top+s}),o.length){this.getCanvas().add(t);var a={id:i.default.stamp(t),type:t.type,text:o};this.fire(l.eventNames.TEXT_CHANGED,a)}}},{key:"_onScroll",value:function(){this._textarea.scrollLeft=0,this._textarea.scrollTop=0}},{key:"_onFabricScaling",value:function(e){var t=e.target;t.fontSize=t.fontSize*t.scaleY,t.scaleX=1,t.scaleY=1}},{key:"_onFabricTextChanged",value:function(e){this.fire(l.eventNames.TEXT_CHANGED,e.target)}},{key:"_onFabricSelectClear",value:function(e){var t=this.getSelectedObj();this.isPrevEditing=!0,this.setSelectedInfo(e.target,!1),t&&""===t.text&&this.getCanvas().remove(t)}},{key:"_onFabricSelect",value:function(e){this.isPrevEditing=!0,this.setSelectedInfo(e.target,!0)}},{key:"_onFabricMouseDown",value:function(e){var t=e.target;t&&!t.isType("text")||(this.isPrevEditing?this.isPrevEditing=!1:this._fireAddText(e))}},{key:"_fireAddText",value:function(e){var t=e.target,n=e.e||{},o=this.getCanvas().getPointer(n);t||this.fire(l.eventNames.ADD_TEXT,{originPosition:{x:o.x,y:o.y},clientPosition:{x:n.clientX||0,y:n.clientY||0}})}},{key:"_onFabricMouseUp",value:function(e){var t=e.target,n=(new Date).getTime();this._isDoubleClick(n)&&!t.isEditing&&t.enterEditing(),t.isEditing&&this.fire(l.eventNames.TEXT_EDITING),this._lastClickTime=n}},{key:"_isDoubleClick",value:function(e){return e-this._lastClickTime<500}}]),t}(s.default);t.default=h},"./src/js/component/zoom.js":
|
|
/*!**********************************!*\
|
|
!*** ./src/js/component/zoom.js ***!
|
|
\**********************************/
|
|
/*! no static exports found */function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var o=function(){function e(e,t){for(var n=0;n<t.length;n++){var o=t[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}return function(t,n,o){return n&&e(t.prototype,n),o&&e(t,o),t}}(),i=l(n(/*! fabric */"fabric")),r=l(n(/*! @/interface/component */"./src/js/interface/component.js")),s=n(/*! @/util */"./src/js/util.js"),a=n(/*! @/consts */"./src/js/consts.js");function l(e){return e&&e.__esModule?e:{default:e}}var c={left:0,top:0,width:0,height:0,stroke:"#000000",strokeWidth:0,fill:"#000000",opacity:.4,evented:!1,selectable:!1,hoverCursor:"auto"},u=.0045,d=.003,h=.003,f=.0066,p=.0044,m=.003,v=a.eventNames.ZOOM_CHANGED,g=a.eventNames.ADD_TEXT,y=a.eventNames.TEXT_EDITING,_=a.eventNames.OBJECT_MODIFIED,b=a.eventNames.KEY_DOWN,j=a.eventNames.KEY_UP,k=a.eventNames.HAND_STARTED,E=a.eventNames.HAND_STOPPED,x=function(e){function t(e){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t);var n=function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,a.componentNames.ZOOM,e));n.zoomArea=null,n._startPoint=null,n._centerPoints=[],n.zoomLevel=1,n.zoomMode=a.zoomModes.DEFAULT,n._listeners={startZoom:n._onMouseDownWithZoomMode.bind(n),moveZoom:n._onMouseMoveWithZoomMode.bind(n),stopZoom:n._onMouseUpWithZoomMode.bind(n),startHand:n._onMouseDownWithHandMode.bind(n),moveHand:n._onMouseMoveWithHandMode.bind(n),stopHand:n._onMouseUpWithHandMode.bind(n),zoomChanged:n._changeScrollState.bind(n),keydown:n._startHandModeWithSpaceBar.bind(n),keyup:n._endHandModeWithSpaceBar.bind(n)};var o=n.getCanvas();return n.aspectRatio=o.width/o.height,n._verticalScroll=new i.default.Rect(c),n._horizontalScroll=new i.default.Rect(c),o.on(v,n._listeners.zoomChanged),n.graphics.on(g,n._startTextEditingHandler.bind(n)),n.graphics.on(y,n._startTextEditingHandler.bind(n)),n.graphics.on(_,n._stopTextEditingHandler.bind(n)),n}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,e),o(t,[{key:"attachKeyboardZoomEvents",value:function(){i.default.util.addListener(document,b,this._listeners.keydown),i.default.util.addListener(document,j,this._listeners.keyup)}},{key:"detachKeyboardZoomEvents",value:function(){i.default.util.removeListener(document,b,this._listeners.keydown),i.default.util.removeListener(document,j,this._listeners.keyup)}},{key:"_startTextEditingHandler",value:function(){this.isTextEditing=!0}},{key:"_stopTextEditingHandler",value:function(){this.isTextEditing=!1}},{key:"_startHandModeWithSpaceBar",value:function(e){this.withSpace||this.isTextEditing||e.keyCode===a.keyCodes.SPACE&&(this.withSpace=!0,this.startHandMode())}},{key:"_endHandModeWithSpaceBar",value:function(e){e.keyCode===a.keyCodes.SPACE&&(this.withSpace=!1,this.endHandMode())}},{key:"startZoomInMode",value:function(){if(!this.zoomArea){this.endHandMode(),this.zoomMode=a.zoomModes.ZOOM;var e=this.getCanvas();this._changeObjectsEventedState(!1),this.zoomArea=new i.default.Rect({left:0,top:0,width:.5,height:.5,stroke:"black",strokeWidth:1,fill:"transparent",hoverCursor:"zoom-in"}),e.discardActiveObject(),e.add(this.zoomArea),e.on("mouse:down",this._listeners.startZoom),e.selection=!1,e.defaultCursor="zoom-in"}}},{key:"endZoomInMode",value:function(){this.zoomMode=a.zoomModes.DEFAULT;var e=this.getCanvas(),t=this._listeners,n=t.startZoom,o=t.moveZoom,i=t.stopZoom;e.selection=!0,e.defaultCursor="auto",e.off({"mouse:down":n,"mouse:move":o,"mouse:up":i}),this._changeObjectsEventedState(!0),e.remove(this.zoomArea),this.zoomArea=null}},{key:"start",value:function(){this.zoomArea=null,this._startPoint=null,this._startHandPoint=null}},{key:"end",value:function(){this.endZoomInMode(),this.endHandMode()}},{key:"startHandMode",value:function(){this.endZoomInMode(),this.zoomMode=a.zoomModes.HAND;var e=this.getCanvas();this._changeObjectsEventedState(!1),e.discardActiveObject(),e.off("mouse:down",this._listeners.startHand),e.on("mouse:down",this._listeners.startHand),e.selection=!1,e.defaultCursor="grab",e.fire(k)}},{key:"endHandMode",value:function(){this.zoomMode=a.zoomModes.DEFAULT;var e=this.getCanvas();this._changeObjectsEventedState(!0),e.off("mouse:down",this._listeners.startHand),e.selection=!0,e.defaultCursor="auto",this._startHandPoint=null,e.fire(E)}},{key:"_onMouseDownWithZoomMode",value:function(e){var t=e.target,n=e.e;if(!t){var o=this.getCanvas();o.selection=!1,this._startPoint=o.getPointer(n),this.zoomArea.set({width:0,height:0});var i=this._listeners,r=i.moveZoom,s=i.stopZoom;o.on({"mouse:move":r,"mouse:up":s})}}},{key:"_onMouseMoveWithZoomMode",value:function(e){var t=e.e,n=this.getCanvas(),o=n.getPointer(t),i=o.x,r=o.y,s=this.zoomArea,a=this._startPoint;Math.abs(i-a.x)+Math.abs(r-a.y)>10&&(n.remove(s),s.set(this._calcRectDimensionFromPoint(i,r)),n.add(s))}},{key:"_calcRectDimensionFromPoint",value:function(e,t){var n=this.getCanvas(),o=n.getWidth(),i=n.getHeight(),r=this._startPoint,a=r.x,l=r.y,c=Math.min,u=c(a,e),d=c(l,t);return{left:u,top:d,width:(0,s.clamp)(e,a,o)-u,height:(0,s.clamp)(t,l,i)-d}}},{key:"_onMouseUpWithZoomMode",value:function(){var e=this.zoomLevel,t=this.zoomArea,n=this._listeners,o=n.moveZoom,i=n.stopZoom,r=this.getCanvas(),s=this._getCenterPoint(),a=s.x,l=s.y;this._isMaxZoomLevel()||(this._centerPoints.push({x:a,y:l,prevZoomLevel:e,zoomLevel:e+1}),e+=1,r.zoomToPoint({x:a,y:l},e),this._fireZoomChanged(r,e),this.zoomLevel=e),r.off({"mouse:move":o,"mouse:up":i}),r.remove(t),this._startPoint=null}},{key:"_getCenterPoint",value:function(){var e=this.zoomArea,t=e.left,n=e.top,o=e.width,i=e.height,r=this._startPoint,s=r.x,a=r.y,l=this.aspectRatio;return o<10&&i<10?{x:s,y:a}:o>i?{x:t+l*i/2,y:n+i/2}:{x:t+o/2,y:n+o/l/2}}},{key:"zoom",value:function(e){for(var t=e.x,n=e.y,o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.zoomLevel,i=this.getCanvas(),r=this._centerPoints,s=r.length-1;s>=0&&!(r[s].zoomLevel<o);s-=1){var a=r.pop(),l=a.x,c=a.y,u=a.prevZoomLevel;i.zoomToPoint({x:l,y:c},u),this.zoomLevel=u}i.zoomToPoint({x:t,y:n},o),this._isDefaultZoomLevel(o)||this._centerPoints.push({x:t,y:n,zoomLevel:o,prevZoomLevel:this.zoomLevel}),this.zoomLevel=o,this._fireZoomChanged(i,o)}},{key:"zoomOut",value:function(){var e=this._centerPoints;if(e.length){var t=this.getCanvas(),n=e.pop(),o=n.x,i=n.y,r=n.prevZoomLevel;this._isDefaultZoomLevel(r)?t.setViewportTransform([1,0,0,1,0,0]):t.zoomToPoint({x:o,y:i},r),this.zoomLevel=r,this._fireZoomChanged(t,this.zoomLevel)}}},{key:"resetZoom",value:function(){var e=this.getCanvas();e.setViewportTransform([1,0,0,1,0,0]),this.zoomLevel=1,this._centerPoints=[],this._fireZoomChanged(e,this.zoomLevel)}},{key:"_isMaxZoomLevel",value:function(){return this.zoomLevel>=5}},{key:"_movePointOfZoom",value:function(e){var t=e.x,n=e.y,o=this._centerPoints;if(o.length){var i=this.getCanvas(),r=this.zoomLevel,s=o.pop(),a=s.x,l=s.y,c=s.prevZoomLevel,u=a-t,d=l-n;i.zoomToPoint({x:a,y:l},c),i.zoomToPoint({x:u,y:d},r),o.push({x:u,y:d,prevZoomLevel:c,zoomLevel:r}),this._fireZoomChanged(i,r)}}},{key:"_onMouseDownWithHandMode",value:function(e){var t=e.target,n=e.e;if(!t){var o=this.getCanvas();if(!(this.zoomLevel<=1)){o.selection=!1,this._startHandPoint=o.getPointer(n);var i=this._listeners,r=i.moveHand,s=i.stopHand;o.on({"mouse:move":r,"mouse:up":s})}}}},{key:"_onMouseMoveWithHandMode",value:function(e){var t=e.e,n=this.getCanvas().getPointer(t),o=n.x,i=n.y,r=o-this._startHandPoint.x,s=i-this._startHandPoint.y;this._movePointOfZoom({x:r,y:s})}},{key:"_onMouseUpWithHandMode",value:function(){var e=this.getCanvas(),t=this._listeners,n=t.moveHand,o=t.stopHand;e.off({"mouse:move":n,"mouse:up":o}),this._startHandPoint=null}},{key:"_changeScrollState",value:function(e){var t=e.viewport,n=e.zoomLevel,o=this.getCanvas();if(o.remove(this._verticalScroll),o.remove(this._horizontalScroll),!this._isDefaultZoomLevel(n)){var i=o.width,r=o.height,a=t.tl,l=t.tr,c=t.bl,v=l.x-a.x,g=c.y-a.y,y=v*v/i,_=g*f,b=(0,s.clamp)(a.x+a.x/i*v,a.x,l.x-y),j=g*p,k=g*m;this._horizontalScroll.set({left:b,top:c.y-_-j,width:y,height:_,rx:k,ry:k});var E=v*u,x=g*g/r,w=(0,s.clamp)(a.y+a.y/r*g,l.y,c.y-x),O=v*d,M=v*h;this._verticalScroll.set({left:l.x-E-O,top:w,width:E,height:x,rx:M,ry:M}),this._addScrollBar()}}},{key:"_changeObjectsEventedState",value:function(){var e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0],t=this.getCanvas();t.forEachObject((function(t){t.evented=e}))}},{key:"_addScrollBar",value:function(){var e=this,t=this.getCanvas();t.add(this._horizontalScroll),t.add(this._verticalScroll),this.scrollBarTid&&clearTimeout(this.scrollBarTid),this.scrollBarTid=setTimeout((function(){t.remove(e._horizontalScroll),t.remove(e._verticalScroll)}),3e3)}},{key:"_isDefaultZoomLevel",value:function(e){return 1===e}},{key:"_fireZoomChanged",value:function(e,t){e.fire(v,{viewport:e.calcViewportBoundaries(),zoomLevel:t})}},{key:"mode",get:function(){return this.zoomMode}}]),t}(r.default);t.default=x},"./src/js/consts.js":
|
|
/*!**************************!*\
|
|
!*** ./src/js/consts.js ***!
|
|
\**************************/
|
|
/*! no static exports found */function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.emptyCropRectValues=t.defaultFilterRangeValues=t.defaultTextRangeValues=t.defaultShapeStrokeValues=t.defaultDrawRangeValues=t.defaultRotateRangeValues=t.defaultIconPath=t.rejectMessages=t.fObjectOptions=t.keyCodes=t.zoomModes=t.drawingMenuNames=t.drawingModes=t.historyNames=t.selectorNames=t.eventNames=t.commandNames=t.CROPZONE_DEFAULT_OPTIONS=t.SHAPE_DEFAULT_OPTIONS=t.componentNames=t.filterType=t.OBJ_TYPE=t.SHAPE_TYPE=t.SHAPE_FILL_TYPE=t.HELP_MENUS=t.DELETE_HELP_MENUS=t.COMMAND_HELP_MENUS=t.ZOOM_HELP_MENUS=void 0;var o=n(/*! @/util */"./src/js/util.js"),i=t.ZOOM_HELP_MENUS=["zoomIn","zoomOut","hand"],r=t.COMMAND_HELP_MENUS=["history","undo","redo","reset"],s=t.DELETE_HELP_MENUS=["delete","deleteAll"];t.HELP_MENUS=[].concat(i,r,s),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,o.keyMirror)("IMAGE_LOADER","CROPPER","FLIP","ROTATION","FREE_DRAWING","LINE","TEXT","ICON","FILTER","SHAPE","ZOOM"),t.SHAPE_DEFAULT_OPTIONS={lockSkewingX:!0,lockSkewingY:!0,bringForward:!0,isRegular:!1},t.CROPZONE_DEFAULT_OPTIONS={hasRotatingPoint:!1,hasBorders:!1,lockScalingFlip:!0,lockRotation:!0,lockSkewingX:!0,lockSkewingY:!0},t.commandNames={CLEAR_OBJECTS:"clearObjects",LOAD_IMAGE:"loadImage",FLIP_IMAGE:"flip",ROTATE_IMAGE:"rotate",ADD_OBJECT:"addObject",REMOVE_OBJECT:"removeObject",APPLY_FILTER:"applyFilter",REMOVE_FILTER:"removeFilter",ADD_ICON:"addIcon",CHANGE_ICON_COLOR:"changeIconColor",ADD_SHAPE:"addShape",CHANGE_SHAPE:"changeShape",ADD_TEXT:"addText",CHANGE_TEXT:"changeText",CHANGE_TEXT_STYLE:"changeTextStyle",ADD_IMAGE_OBJECT:"addImageObject",RESIZE_CANVAS_DIMENSION:"resizeCanvasDimension",SET_OBJECT_PROPERTIES:"setObjectProperties",SET_OBJECT_POSITION:"setObjectPosition",CHANGE_SELECTION:"changeSelection"},t.eventNames={OBJECT_ACTIVATED:"objectActivated",OBJECT_MOVED:"objectMoved",OBJECT_SCALED:"objectScaled",OBJECT_CREATED:"objectCreated",OBJECT_ROTATED:"objectRotated",OBJECT_ADDED:"objectAdded",OBJECT_MODIFIED:"objectModified",TEXT_EDITING:"textEditing",TEXT_CHANGED:"textChanged",ICON_CREATE_RESIZE:"iconCreateResize",ICON_CREATE_END:"iconCreateEnd",ADD_TEXT:"addText",ADD_OBJECT:"addObject",ADD_OBJECT_AFTER:"addObjectAfter",MOUSE_DOWN:"mousedown",MOUSE_UP:"mouseup",MOUSE_MOVE:"mousemove",REDO_STACK_CHANGED:"redoStackChanged",UNDO_STACK_CHANGED:"undoStackChanged",SELECTION_CLEARED:"selectionCleared",SELECTION_CREATED:"selectionCreated",EXECUTE_COMMAND:"executeCommand",AFTER_UNDO:"afterUndo",AFTER_REDO:"afterRedo",ZOOM_CHANGED:"zoomChanged",HAND_STARTED:"handStarted",HAND_STOPPED:"handStopped",KEY_DOWN:"keydown",KEY_UP:"keyup",INPUT_BOX_EDITING_STARTED:"inputBoxEditingStarted",INPUT_BOX_EDITING_STOPPED:"inputBoxEditingStopped",FOCUS:"focus",BLUR:"blur"},t.selectorNames={COLOR_PICKER_INPUT_BOX:".tui-colorpicker-palette-hex"},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,o.keyMirror)("NORMAL","CROPPER","FREE_DRAWING","LINE_DRAWING","TEXT","SHAPE","ICON","ZOOM"),t.drawingMenuNames={TEXT:"text",CROP:"crop",SHAPE:"shape",ZOOM:"zoom"},t.zoomModes={DEFAULT:"normal",ZOOM:"zoom",HAND:"hand"},t.keyCodes={Z:90,Y:89,C:67,V:86,SHIFT:16,BACKSPACE:8,DEL:46,ARROW_DOWN:40,ARROW_UP:38,SPACE:32},t.fObjectOptions={SELECTION_STYLE:{borderColor:"red",cornerColor:"green",cornerSize:10,originX:"center",originY:"center",transparentCorners:!1}},t.rejectMessages={addedObject:"The object is already added.",flip:"The flipX and flipY setting values are not changed.",invalidDrawingMode:"This operation is not supported in the drawing mode.",invalidParameters:"Invalid parameters.",isLock:"The executing command state is locked.",loadImage:"The background image is empty.",loadingImageFailed:"Invalid image loaded.",noActiveObject:"There is no active object.",noObject:"The object is not in canvas.",redo:"The promise of redo command is reject.",rotation:"The current angle is same the old angle.",undo:"The promise of undo command is reject.",unsupportedOperation:"Unsupported operation.",unsupportedType:"Unsupported object type."},t.defaultIconPath={"icon-arrow":"M40 12V0l24 24-24 24V36H0V12h40z","icon-arrow-2":"M49,32 H3 V22 h46 l-18,-18 h12 l23,23 L43,50 h-12 l18,-18 z ","icon-arrow-3":"M43.349998,27 L17.354,53 H1.949999 l25.996,-26 L1.949999,1 h15.404 L43.349998,27 z ","icon-star":"M35,54.557999 l-19.912001,10.468 l3.804,-22.172001 l-16.108,-15.7 l22.26,-3.236 L35,3.746 l9.956,20.172001 l22.26,3.236 l-16.108,15.7 l3.804,22.172001 z ","icon-star-2":"M17,31.212 l-7.194,4.08 l-4.728,-6.83 l-8.234,0.524 l-1.328,-8.226 l-7.644,-3.14 l2.338,-7.992 l-5.54,-6.18 l5.54,-6.176 l-2.338,-7.994 l7.644,-3.138 l1.328,-8.226 l8.234,0.522 l4.728,-6.83 L17,-24.312 l7.194,-4.08 l4.728,6.83 l8.234,-0.522 l1.328,8.226 l7.644,3.14 l-2.338,7.992 l5.54,6.178 l-5.54,6.178 l2.338,7.992 l-7.644,3.14 l-1.328,8.226 l-8.234,-0.524 l-4.728,6.83 z ","icon-polygon":"M3,31 L19,3 h32 l16,28 l-16,28 H19 z ","icon-location":"M24 62C8 45.503 0 32.837 0 24 0 10.745 10.745 0 24 0s24 10.745 24 24c0 8.837-8 21.503-24 38zm0-28c5.523 0 10-4.477 10-10s-4.477-10-10-10-10 4.477-10 10 4.477 10 10 10z","icon-heart":"M49.994999,91.349998 l-6.96,-6.333 C18.324001,62.606995 2.01,47.829002 2.01,29.690998 C2.01,14.912998 13.619999,3.299999 28.401001,3.299999 c8.349,0 16.362,5.859 21.594,12 c5.229,-6.141 13.242001,-12 21.591,-12 c14.778,0 26.390999,11.61 26.390999,26.390999 c0,18.138 -16.314001,32.916 -41.025002,55.374001 l-6.96,6.285 z ","icon-bubble":"M44 48L34 58V48H12C5.373 48 0 42.627 0 36V12C0 5.373 5.373 0 12 0h40c6.627 0 12 5.373 12 12v24c0 6.627-5.373 12-12 12h-8z"},t.defaultRotateRangeValues={realTimeEvent:!0,min:-360,max:360,value:0},t.defaultDrawRangeValues={min:5,max:30,value:12},t.defaultShapeStrokeValues={realTimeEvent:!0,min:2,max:300,value:3},t.defaultTextRangeValues={realTimeEvent:!0,min:10,max:100,value:50},t.defaultFilterRangeValues={tintOpacityRange:{realTimeEvent:!0,min:0,max:1,value:.7,useDecimal:!0},removewhiteDistanceRange:{realTimeEvent:!0,min:0,max:1,value:.2,useDecimal:!0},brightnessRange:{realTimeEvent:!0,min:-1,max:1,value:0,useDecimal:!0},noiseRange:{realTimeEvent:!0,min:0,max:1e3,value:100},pixelateRange:{realTimeEvent:!0,min:2,max:20,value:4},colorfilterThresholdRange:{realTimeEvent:!0,min:0,max:1,value:.2,useDecimal:!0},blurFilterRange:{value:.1}},t.emptyCropRectValues={LEFT:0,TOP:0,WIDTH:.5,HEIGHT:.5}},"./src/js/drawingMode/cropper.js":
|
|
/*!***************************************!*\
|
|
!*** ./src/js/drawingMode/cropper.js ***!
|
|
\***************************************/
|
|
/*! no static exports found */function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var o,i=function(){function e(e,t){for(var n=0;n<t.length;n++){var o=t[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}return function(t,n,o){return n&&e(t.prototype,n),o&&e(t,o),t}}(),r=n(/*! @/interface/drawingMode */"./src/js/interface/drawingMode.js"),s=(o=r)&&o.__esModule?o:{default:o},a=n(/*! @/consts */"./src/js/consts.js");var l=function(e){function t(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,a.drawingModes.CROPPER))}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,e),i(t,[{key:"start",value:function(e){e.getComponent(a.componentNames.CROPPER).start()}},{key:"end",value:function(e){e.getComponent(a.componentNames.CROPPER).end()}}]),t}(s.default);t.default=l},"./src/js/drawingMode/freeDrawing.js":
|
|
/*!*******************************************!*\
|
|
!*** ./src/js/drawingMode/freeDrawing.js ***!
|
|
\*******************************************/
|
|
/*! no static exports found */function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var o,i=function(){function e(e,t){for(var n=0;n<t.length;n++){var o=t[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}return function(t,n,o){return n&&e(t.prototype,n),o&&e(t,o),t}}(),r=n(/*! @/interface/drawingMode */"./src/js/interface/drawingMode.js"),s=(o=r)&&o.__esModule?o:{default:o},a=n(/*! @/consts */"./src/js/consts.js");var l=function(e){function t(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,a.drawingModes.FREE_DRAWING))}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,e),i(t,[{key:"start",value:function(e,t){e.getComponent(a.componentNames.FREE_DRAWING).start(t)}},{key:"end",value:function(e){e.getComponent(a.componentNames.FREE_DRAWING).end()}}]),t}(s.default);t.default=l},"./src/js/drawingMode/icon.js":
|
|
/*!************************************!*\
|
|
!*** ./src/js/drawingMode/icon.js ***!
|
|
\************************************/
|
|
/*! no static exports found */function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var o,i=function(){function e(e,t){for(var n=0;n<t.length;n++){var o=t[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}return function(t,n,o){return n&&e(t.prototype,n),o&&e(t,o),t}}(),r=n(/*! @/interface/drawingMode */"./src/js/interface/drawingMode.js"),s=(o=r)&&o.__esModule?o:{default:o},a=n(/*! @/consts */"./src/js/consts.js");var l=function(e){function t(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,a.drawingModes.ICON))}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,e),i(t,[{key:"start",value:function(e){e.getComponent(a.componentNames.ICON).start()}},{key:"end",value:function(e){e.getComponent(a.componentNames.ICON).end()}}]),t}(s.default);t.default=l},"./src/js/drawingMode/lineDrawing.js":
|
|
/*!*******************************************!*\
|
|
!*** ./src/js/drawingMode/lineDrawing.js ***!
|
|
\*******************************************/
|
|
/*! no static exports found */function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var o,i=function(){function e(e,t){for(var n=0;n<t.length;n++){var o=t[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}return function(t,n,o){return n&&e(t.prototype,n),o&&e(t,o),t}}(),r=n(/*! @/interface/drawingMode */"./src/js/interface/drawingMode.js"),s=(o=r)&&o.__esModule?o:{default:o},a=n(/*! @/consts */"./src/js/consts.js");var l=function(e){function t(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,a.drawingModes.LINE_DRAWING))}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,e),i(t,[{key:"start",value:function(e,t){e.getComponent(a.componentNames.LINE).start(t)}},{key:"end",value:function(e){e.getComponent(a.componentNames.LINE).end()}}]),t}(s.default);t.default=l},"./src/js/drawingMode/shape.js":
|
|
/*!*************************************!*\
|
|
!*** ./src/js/drawingMode/shape.js ***!
|
|
\*************************************/
|
|
/*! no static exports found */function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var o,i=function(){function e(e,t){for(var n=0;n<t.length;n++){var o=t[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}return function(t,n,o){return n&&e(t.prototype,n),o&&e(t,o),t}}(),r=n(/*! @/interface/drawingMode */"./src/js/interface/drawingMode.js"),s=(o=r)&&o.__esModule?o:{default:o},a=n(/*! @/consts */"./src/js/consts.js");var l=function(e){function t(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,a.drawingModes.SHAPE))}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,e),i(t,[{key:"start",value:function(e){e.getComponent(a.componentNames.SHAPE).start()}},{key:"end",value:function(e){e.getComponent(a.componentNames.SHAPE).end()}}]),t}(s.default);t.default=l},"./src/js/drawingMode/text.js":
|
|
/*!************************************!*\
|
|
!*** ./src/js/drawingMode/text.js ***!
|
|
\************************************/
|
|
/*! no static exports found */function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var o,i=function(){function e(e,t){for(var n=0;n<t.length;n++){var o=t[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}return function(t,n,o){return n&&e(t.prototype,n),o&&e(t,o),t}}(),r=n(/*! @/interface/drawingMode */"./src/js/interface/drawingMode.js"),s=(o=r)&&o.__esModule?o:{default:o},a=n(/*! @/consts */"./src/js/consts.js");var l=function(e){function t(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,a.drawingModes.TEXT))}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,e),i(t,[{key:"start",value:function(e){e.getComponent(a.componentNames.TEXT).start()}},{key:"end",value:function(e){e.getComponent(a.componentNames.TEXT).end()}}]),t}(s.default);t.default=l},"./src/js/drawingMode/zoom.js":
|
|
/*!************************************!*\
|
|
!*** ./src/js/drawingMode/zoom.js ***!
|
|
\************************************/
|
|
/*! no static exports found */function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var o,i=function(){function e(e,t){for(var n=0;n<t.length;n++){var o=t[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}return function(t,n,o){return n&&e(t.prototype,n),o&&e(t,o),t}}(),r=n(/*! @/interface/drawingMode */"./src/js/interface/drawingMode.js"),s=(o=r)&&o.__esModule?o:{default:o},a=n(/*! @/consts */"./src/js/consts.js");var l=function(e){function t(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,a.drawingModes.ZOOM))}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,e),i(t,[{key:"start",value:function(e){e.getComponent(a.componentNames.ZOOM).start()}},{key:"end",value:function(e){e.getComponent(a.componentNames.ZOOM).end()}}]),t}(s.default);t.default=l},"./src/js/extension/arrowLine.js":
|
|
/*!***************************************!*\
|
|
!*** ./src/js/extension/arrowLine.js ***!
|
|
\***************************************/
|
|
/*! no static exports found */function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var o,i=n(/*! fabric */"fabric"),r=(o=i)&&o.__esModule?o:{default:o};var s=r.default.util.createClass(r.default.Line,{type:"line",initialize:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};this.callSuper("initialize",e,t),this.arrowType=t.arrowType},_render:function(e){var t=this.calcLinePoints(),n={fromX:t.x1,fromY:t.y1,toX:t.x2,toY:t.y2};this.ctx=e,e.lineWidth=this.strokeWidth,this._renderBasicLinePath(n),this._drawDecoratorPath(n),this._renderStroke(e)},_renderBasicLinePath:function(e){var t=e.fromX,n=e.fromY,o=e.toX,i=e.toY;this.ctx.beginPath(),this.ctx.moveTo(t,n),this.ctx.lineTo(o,i)},_drawDecoratorPath:function(e){this._drawDecoratorPathType("head",e),this._drawDecoratorPathType("tail",e)},_drawDecoratorPathType:function(e,t){switch(this.arrowType[e]){case"triangle":this._drawTrianglePath(e,t);break;case"chevron":this._drawChevronPath(e,t)}},_drawTrianglePath:function(e,t){var n=1.7*this.ctx.lineWidth;this._drawChevronPath(e,t,n),this.ctx.closePath()},_drawChevronPath:function(e,t,n){var o=this,i=t.fromX,r=t.fromY,s=t.toX,a=t.toY,l=this.ctx;n||(n=2.7*this.ctx.lineWidth);var c="head"===e?[i,r]:[s,a],u=c[0],d=c[1],h="head"===e?[s,a]:[i,r],f=h[0],p=h[1],m=180*Math.atan2(p-d,f-u)/Math.PI,v=function(e){return o.getRotatePosition(n,e,{x:u,y:d})};l.moveTo.apply(l,v(m+30)),l.lineTo(u,d),l.lineTo.apply(l,v(m-30))},getRotatePosition:function(e,t,n){var o=t*Math.PI/180,i=n.x,r=n.y;return[e*Math.cos(o)+i,e*Math.sin(o)+r]}});t.default=s},"./src/js/extension/colorFilter.js":
|
|
/*!*****************************************!*\
|
|
!*** ./src/js/extension/colorFilter.js ***!
|
|
\*****************************************/
|
|
/*! no static exports found */function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var o,i=n(/*! fabric */"fabric"),r=(o=i)&&o.__esModule?o:{default:o};var s=r.default.util.createClass(r.default.Image.filters.BaseFilter,{type:"ColorFilter",initialize:function(e){e||(e={}),this.color=e.color||"#FFFFFF",this.threshold=e.threshold||45,this.x=e.x||null,this.y=e.y||null},applyTo:function(e){var t,n=e.canvasEl,o=n.getContext("2d"),i=o.getImageData(0,0,n.width,n.height),s=i.data,a=this.threshold,l=r.default.Color.sourceFromHex(this.color),c=void 0;for(this.x&&this.y&&(l=this._getColor(i,this.x,this.y)),c=0,t=s.length;c<t;c+=4)this._isOutsideThreshold(s[c],l[0],a)||this._isOutsideThreshold(s[c+1],l[1],a)||this._isOutsideThreshold(s[c+2],l[2],a)||(s[c]=s[c+1]=s[c+2]=s[c+3]=0);o.putImageData(i,0,0)},_isOutsideThreshold:function(e,t,n){var o=e-t;return Math.abs(o)>n},_getColor:function(e,t,n){var o=[0,0,0,0],i=e.data,r=4*(e.width*n+t);return o[0]=i[r],o[1]=i[r+1],o[2]=i[r+2],o[3]=i[r+3],o}});t.default=s},"./src/js/extension/cropzone.js":
|
|
/*!**************************************!*\
|
|
!*** ./src/js/extension/cropzone.js ***!
|
|
\**************************************/
|
|
/*! no static exports found */function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var o=a(n(/*! tui-code-snippet */"tui-code-snippet")),i=a(n(/*! fabric */"fabric")),r=n(/*! @/util */"./src/js/util.js"),s=n(/*! @/consts */"./src/js/consts.js");function a(e){return e&&e.__esModule?e:{default:e}}function l(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var c=["tl","tr","mt","ml","mr","mb","bl","br"],u=function(){};function d(e,t){return e>t?"width":"height"}var h=i.default.util.createClass(i.default.Rect,{initialize:function(e,t,n){(t=o.default.extend(t,n)).type="cropzone",this.callSuper("initialize",t),this._addEventHandler(),this.canvas=e,this.options=t},canvasEventDelegation:function(e){var t="unregistered";return this.canvasEventTrigger[e]!==u?t="registered":[s.eventNames.OBJECT_MOVED,s.eventNames.OBJECT_SCALED].indexOf(e)<0&&(t="none"),t},canvasEventRegister:function(e,t){this.canvasEventTrigger[e]=t},_addEventHandler:function(){var e;this.canvasEventTrigger=(l(e={},s.eventNames.OBJECT_MOVED,u),l(e,s.eventNames.OBJECT_SCALED,u),e),this.on({moving:this._onMoving.bind(this),scaling:this._onScaling.bind(this)}),i.default.util.addListener(document,"keydown",this._onKeyDown.bind(this)),i.default.util.addListener(document,"keyup",this._onKeyUp.bind(this))},_renderCropzone:function(e){var t=this.flipX?-1:1,n=this.flipY?-1:1,o=t/this.scaleX,i=n/this.scaleY;e.scale(o,i),this._fillOuterRect(e,"rgba(0, 0, 0, 0.5)"),this.options.lineWidth?(this._fillInnerRect(e),this._strokeBorder(e,"rgb(255, 255, 255)",{lineWidth:this.options.lineWidth})):(this._strokeBorder(e,"rgb(0, 0, 0)",{lineDashWidth:7}),this._strokeBorder(e,"rgb(255, 255, 255)",{lineDashWidth:7,lineDashOffset:7})),e.scale(1/o,1/i)},_render:function(e){this.callSuper("_render",e),this._renderCropzone(e)},_fillOuterRect:function(e,t){var n=this._getCoordinates(),o=n.x,i=n.y;e.save(),e.fillStyle=t,e.beginPath(),e.moveTo(o[0]-1,i[0]-1),e.lineTo(o[3]+1,i[0]-1),e.lineTo(o[3]+1,i[3]+1),e.lineTo(o[0]-1,i[3]+1),e.lineTo(o[0]-1,i[0]-1),e.closePath(),e.moveTo(o[1],i[1]),e.lineTo(o[1],i[2]),e.lineTo(o[2],i[2]),e.lineTo(o[2],i[1]),e.lineTo(o[1],i[1]),e.closePath(),e.fill(),e.restore()},_fillInnerRect:function(e){var t=this._getCoordinates(),n=t.x,o=t.y,i=this._caculateInnerPosition(n,(n[2]-n[1])/3),r=this._caculateInnerPosition(o,(o[2]-o[1])/3);e.save(),e.strokeStyle="rgba(255, 255, 255, 0.7)",e.lineWidth=this.options.lineWidth,e.beginPath(),e.moveTo(i[0],r[1]),e.lineTo(i[3],r[1]),e.moveTo(i[0],r[2]),e.lineTo(i[3],r[2]),e.moveTo(i[1],r[0]),e.lineTo(i[1],r[3]),e.moveTo(i[2],r[0]),e.lineTo(i[2],r[3]),e.stroke(),e.closePath(),e.restore()},_caculateInnerPosition:function(e,t){var n=[];return n[0]=e[1],n[1]=e[1]+t,n[2]=e[1]+2*t,n[3]=e[2],n},_getCoordinates:function(){var e=this.canvas,t=this.width,n=this.height,i=this.left,r=this.top,s=t/2,a=n/2,l=e.getHeight(),c=e.getWidth();return{x:o.default.map([-(s+i),-s,s,s+(c-i-t)],Math.ceil),y:o.default.map([-(a+r),-a,a,a+(l-r-n)],Math.ceil)}},_strokeBorder:function(e,t,n){var o=n.lineDashWidth,i=n.lineDashOffset,r=n.lineWidth,s=this.width/2,a=this.height/2;e.save(),e.strokeStyle=t,e.setLineDash&&e.setLineDash([o,o]),i&&(e.lineDashOffset=i),r&&(e.lineWidth=r),e.beginPath(),e.moveTo(-s,-a),e.lineTo(s,-a),e.lineTo(s,a),e.lineTo(-s,a),e.lineTo(-s,-a),e.stroke(),e.restore()},_onMoving:function(){var e=this.height,t=this.width,n=this.left,o=this.top,i=this.canvas.getWidth()-t,a=this.canvas.getHeight()-e;this.left=(0,r.clamp)(n,0,i),this.top=(0,r.clamp)(o,0,a),this.canvasEventTrigger[s.eventNames.OBJECT_MOVED](this)},_onScaling:function(e){var t=e.transform.corner,n=this.canvas.getPointer(e.e),o=this._calcScalingSizeFromPointer(n,t);this.scale(1).set(o),this.canvasEventTrigger[s.eventNames.OBJECT_SCALED](this)},_calcScalingSizeFromPointer:function(e,t){return function(e){return c.indexOf(e)>=0}(t)&&this._resizeCropZone(e,t)},adjustRatioCropzoneSize:function(e){var t=e.width,n=e.height,o=e.leftMaker,i=e.topMaker,s=e.maxWidth,a=e.maxHeight,l=e.scaleTo;if(t=s?(0,r.clamp)(t,1,s):t,n=a?(0,r.clamp)(n,1,a):n,!this.presetRatio)return this._withShiftKey&&(t>n?n=t:n>t&&(t=n)),{width:t,height:n,left:o(t),top:i(n)};"width"===l?n=t/this.presetRatio:t=n*this.presetRatio;var c=Math.min(s/t,a/n);if(c<=1){var u=[t,n].map((function(e){return e*c}));t=u[0],n=u[1]}return{width:t,height:n,left:o(t),top:i(n)}},_getCropzoneRectInfo:function(){var e=this.canvas,t=e.width,n=e.height,o=this.getBoundingRect(!1,!0),i=o.top,r=o.left,s=o.width,a=o.height;return{rectTop:i,rectLeft:r,rectWidth:s,rectHeight:a,rectRight:r+s,rectBottom:i+a,canvasWidth:t,canvasHeight:n}},_resizeCropZone:function(e,t){var n=e.x,o=e.y,i=this._getCropzoneRectInfo(),r=i.rectWidth,s=i.rectHeight,a=i.rectTop,l=i.rectLeft,c=i.rectBottom,u=i.rectRight,h=i.canvasWidth,f=i.canvasHeight,p={tl:{width:u-n,height:c-o,leftMaker:function(e){return u-e},topMaker:function(e){return c-e},maxWidth:u,maxHeight:c,scaleTo:d(l-n,a-o)},tr:{width:n-l,height:c-o,leftMaker:function(){return l},topMaker:function(e){return c-e},maxWidth:h-l,maxHeight:c,scaleTo:d(n-u,a-o)},mt:{width:r,height:c-o,leftMaker:function(){return l},topMaker:function(e){return c-e},maxWidth:h-l,maxHeight:c,scaleTo:"height"},ml:{width:u-n,height:s,leftMaker:function(e){return u-e},topMaker:function(){return a},maxWidth:u,maxHeight:f-a,scaleTo:"width"},mr:{width:n-l,height:s,leftMaker:function(){return l},topMaker:function(){return a},maxWidth:h-l,maxHeight:f-a,scaleTo:"width"},mb:{width:r,height:o-a,leftMaker:function(){return l},topMaker:function(){return a},maxWidth:h-l,maxHeight:f-a,scaleTo:"height"},bl:{width:u-n,height:o-a,leftMaker:function(e){return u-e},topMaker:function(){return a},maxWidth:u,maxHeight:f-a,scaleTo:d(l-n,o-c)},br:{width:n-l,height:o-a,leftMaker:function(){return l},topMaker:function(){return a},maxWidth:h-l,maxHeight:f-a,scaleTo:d(n-u,o-c)}};return this.adjustRatioCropzoneSize(p[t])},isValid:function(){return this.left>=0&&this.top>=0&&this.width>0&&this.height>0},_onKeyDown:function(e){e.keyCode===s.keyCodes.SHIFT&&(this._withShiftKey=!0)},_onKeyUp:function(e){e.keyCode===s.keyCodes.SHIFT&&(this._withShiftKey=!1)}});t.default=h},"./src/js/extension/emboss.js":
|
|
/*!************************************!*\
|
|
!*** ./src/js/extension/emboss.js ***!
|
|
\************************************/
|
|
/*! no static exports found */function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var o,i=n(/*! fabric */"fabric"),r=(o=i)&&o.__esModule?o:{default:o};var s=r.default.util.createClass(r.default.Image.filters.Convolute,{type:"Emboss",initialize:function(){this.matrix=[1,1,1,1,.7,-1,-1,-1,-1]}});t.default=s},"./src/js/extension/mask.js":
|
|
/*!**********************************!*\
|
|
!*** ./src/js/extension/mask.js ***!
|
|
\**********************************/
|
|
/*! no static exports found */function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var o,i=n(/*! fabric */"fabric"),r=(o=i)&&o.__esModule?o:{default:o};var s=r.default.util.createClass(r.default.Image.filters.BlendImage,{applyTo:function(e){if(this.mask){var t=e.canvasEl,n=t.width,o=t.height,i=this._createCanvasOfMask(n,o),r=t.getContext("2d"),s=i.getContext("2d"),a=r.getImageData(0,0,n,o);this._drawMask(s,t,r),this._mapData(s,a,n,o),e.imageData=a}},_createCanvasOfMask:function(e,t){var n=r.default.util.createCanvasElement();return n.width=e,n.height=t,n},_drawMask:function(e){var t=this.mask,n=t.getElement(),o=t.angle,i=t.left,r=t.scaleX,s=t.scaleY,a=t.top;e.save(),e.translate(i,a),e.rotate(o*Math.PI/180),e.scale(r,s),e.drawImage(n,-n.width/2,-n.height/2),e.restore()},_mapData:function(e,t,n,o){for(var i=t.data,r=t.height,s=i,a=t.width*r*4,l=e.getImageData(0,0,n,o).data,c=0;c<a;c+=4)s[c+3]=l[c]}});t.default=s},"./src/js/extension/sharpen.js":
|
|
/*!*************************************!*\
|
|
!*** ./src/js/extension/sharpen.js ***!
|
|
\*************************************/
|
|
/*! no static exports found */function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var o,i=n(/*! fabric */"fabric"),r=(o=i)&&o.__esModule?o:{default:o};var s=r.default.util.createClass(r.default.Image.filters.Convolute,{type:"Sharpen",initialize:function(){this.matrix=[0,-1,0,-1,5,-1,0,-1,0]}});t.default=s},"./src/js/factory/command.js":
|
|
/*!***********************************!*\
|
|
!*** ./src/js/factory/command.js ***!
|
|
\***********************************/
|
|
/*! no static exports found */function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var o,i=n(/*! @/interface/command */"./src/js/interface/command.js"),r=(o=i)&&o.__esModule?o:{default:o};var s={};t.default={create:function(e){var t=s[e];if(t){for(var n=arguments.length,o=Array(n>1?n-1:0),i=1;i<n;i++)o[i-1]=arguments[i];return new r.default(t,o)}return null},register:function(e){s[e.name]=e}}},"./src/js/factory/errorMessage.js":
|
|
/*!****************************************!*\
|
|
!*** ./src/js/factory/errorMessage.js ***!
|
|
\****************************************/
|
|
/*! no static exports found */function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var o,i=n(/*! tui-code-snippet */"tui-code-snippet"),r=(o=i)&&o.__esModule?o:{default:o};var s=(0,n(/*! @/util */"./src/js/util.js").keyMirror)("UN_IMPLEMENTATION","NO_COMPONENT_NAME"),a="Should implement a method: ",l="Should set a component name",c={UN_IMPLEMENTATION:function(e){return a+e},NO_COMPONENT_NAME:function(){return l}};t.default={types:r.default.extend({},s),create:function(e){e=e.toLowerCase();for(var t=c[e],n=arguments.length,o=Array(n>1?n-1:0),i=1;i<n;i++)o[i-1]=arguments[i];return t.apply(void 0,o)}}},"./src/js/graphics.js":
|
|
/*!****************************!*\
|
|
!*** ./src/js/graphics.js ***!
|
|
\****************************/
|
|
/*! no static exports found */function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var o=function(){function e(e,t){for(var n=0;n<t.length;n++){var o=t[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}return function(t,n,o){return n&&e(t.prototype,n),o&&e(t,o),t}}(),i=M(n(/*! tui-code-snippet */"tui-code-snippet")),r=M(n(/*! fabric */"fabric")),s=M(n(/*! @/component/imageLoader */"./src/js/component/imageLoader.js")),a=M(n(/*! @/component/cropper */"./src/js/component/cropper.js")),l=M(n(/*! @/component/flip */"./src/js/component/flip.js")),c=M(n(/*! @/component/rotation */"./src/js/component/rotation.js")),u=M(n(/*! @/component/freeDrawing */"./src/js/component/freeDrawing.js")),d=M(n(/*! @/component/line */"./src/js/component/line.js")),h=M(n(/*! @/component/text */"./src/js/component/text.js")),f=M(n(/*! @/component/icon */"./src/js/component/icon.js")),p=M(n(/*! @/component/filter */"./src/js/component/filter.js")),m=M(n(/*! @/component/shape */"./src/js/component/shape.js")),v=M(n(/*! @/component/zoom */"./src/js/component/zoom.js")),g=M(n(/*! @/drawingMode/cropper */"./src/js/drawingMode/cropper.js")),y=M(n(/*! @/drawingMode/freeDrawing */"./src/js/drawingMode/freeDrawing.js")),_=M(n(/*! @/drawingMode/lineDrawing */"./src/js/drawingMode/lineDrawing.js")),b=M(n(/*! @/drawingMode/shape */"./src/js/drawingMode/shape.js")),j=M(n(/*! @/drawingMode/text */"./src/js/drawingMode/text.js")),k=M(n(/*! @/drawingMode/icon */"./src/js/drawingMode/icon.js")),E=M(n(/*! @/drawingMode/zoom */"./src/js/drawingMode/zoom.js")),x=n(/*! @/helper/selectionModifyHelper */"./src/js/helper/selectionModifyHelper.js"),w=n(/*! @/util */"./src/js/util.js"),O=n(/*! @/consts */"./src/js/consts.js");function M(e){return e&&e.__esModule?e:{default:e}}function C(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}var S=i.default.extend,P=i.default.stamp,T=i.default.isArray,I=i.default.isString,A=i.default.forEachArray,D=i.default.forEachOwnProperties,L=i.default.CustomEvents,N={cssOnly:!0},H={backstoreOnly:!0},R=function(){function e(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},o=n.cssMaxWidth,i=n.cssMaxHeight;C(this,e),this.canvasImage=null,this.cssMaxWidth=o||1e3,this.cssMaxHeight=i||800,this.cropSelectionStyle={},this.targetObjectForCopyPaste=null,this.imageName="",this._objects={},this._canvas=null,this._drawingMode=O.drawingModes.NORMAL,this._drawingModeMap={},this._componentMap={},this._handler={onMouseDown:this._onMouseDown.bind(this),onObjectAdded:this._onObjectAdded.bind(this),onObjectRemoved:this._onObjectRemoved.bind(this),onObjectMoved:this._onObjectMoved.bind(this),onObjectScaled:this._onObjectScaled.bind(this),onObjectModified:this._onObjectModified.bind(this),onObjectRotated:this._onObjectRotated.bind(this),onObjectSelected:this._onObjectSelected.bind(this),onPathCreated:this._onPathCreated.bind(this),onSelectionCleared:this._onSelectionCleared.bind(this),onSelectionCreated:this._onSelectionCreated.bind(this)},this._setObjectCachingToFalse(),this._setCanvasElement(t),this._createDrawingModeInstances(),this._createComponents(),this._attachCanvasEvents(),this._attachZoomEvents()}return o(e,[{key:"destroy",value:function(){var e=this._canvas.wrapperEl;this._canvas.clear(),e.parentNode.removeChild(e),this._detachZoomEvents()}},{key:"_attachZoomEvents",value:function(){this.getComponent(O.componentNames.ZOOM).attachKeyboardZoomEvents()}},{key:"_detachZoomEvents",value:function(){this.getComponent(O.componentNames.ZOOM).detachKeyboardZoomEvents()}},{key:"deactivateAll",value:function(){return this._canvas.discardActiveObject(),this}},{key:"renderAll",value:function(){return this._canvas.renderAll(),this}},{key:"add",value:function(e){var t,n=[];T(e)?n=e:n.push(e),(t=this._canvas).add.apply(t,n)}},{key:"contains",value:function(e){return this._canvas.contains(e)}},{key:"getObjects",value:function(){return this._canvas.getObjects().slice()}},{key:"getObject",value:function(e){return this._objects[e]}},{key:"remove",value:function(e){this._canvas.remove(e)}},{key:"removeAll",value:function(e){var t=this._canvas,n=t.getObjects().slice();return t.remove.apply(t,this._canvas.getObjects()),e&&t.clear(),n}},{key:"removeObjectById",value:function(e){var t=[],n=this._canvas,o=this.getObject(e);return o&&o.isType("group")&&!o.isEmpty()?(n.discardActiveObject(),o.forEachObject((function(e){t.push(e),n.remove(e)}))):n.contains(o)&&(t.push(o),n.remove(o)),t}},{key:"getObjectId",value:function(e){var t=null;for(t in this._objects)if(this._objects.hasOwnProperty(t)&&e===this._objects[t])return t;return null}},{key:"getActiveObject",value:function(){return this._canvas._activeObject}},{key:"getActiveObjectIdForRemove",value:function(){var e=this.getActiveObject(),t=e.type,n=e.left,o=e.top;if("activeSelection"===t){var i=new r.default.Group([].concat(e.getObjects()),{left:n,top:o});return this._addFabricObject(i)}return this.getObjectId(e)}},{key:"isReadyRemoveObject",value:function(){var e=this.getActiveObject();return e&&!e.isEditing}},{key:"getActiveObjects",value:function(){var e=this._canvas._activeObject;return e&&"activeSelection"===e.type?e:null}},{key:"getActiveSelectionFromObjects",value:function(e){var t=this.getCanvas();return new r.default.ActiveSelection(e,{canvas:t})}},{key:"setActiveObject",value:function(e){this._canvas.setActiveObject(e)}},{key:"setCropSelectionStyle",value:function(e){this.cropSelectionStyle=e}},{key:"getComponent",value:function(e){return this._componentMap[e]}},{key:"getDrawingMode",value:function(){return this._drawingMode}},{key:"startDrawingMode",value:function(e,t){if(this._isSameDrawingMode(e))return!0;this.stopDrawingMode();var n=this._getDrawingModeInstance(e);return n&&n.start&&(n.start(this,t),this._drawingMode=e),!!n}},{key:"stopDrawingMode",value:function(){if(!this._isSameDrawingMode(O.drawingModes.NORMAL)){var e=this._getDrawingModeInstance(this.getDrawingMode());e&&e.end&&e.end(this),this._drawingMode=O.drawingModes.NORMAL}}},{key:"zoom",value:function(e,t){var n=e.x,o=e.y,i=this.getComponent(O.componentNames.ZOOM);i.zoom({x:n,y:o},t)}},{key:"getZoomMode",value:function(){return this.getComponent(O.componentNames.ZOOM).mode}},{key:"startZoomInMode",value:function(){this.getComponent(O.componentNames.ZOOM).startZoomInMode()}},{key:"endZoomInMode",value:function(){this.getComponent(O.componentNames.ZOOM).endZoomInMode()}},{key:"zoomOut",value:function(){this.getComponent(O.componentNames.ZOOM).zoomOut()}},{key:"startHandMode",value:function(){this.getComponent(O.componentNames.ZOOM).startHandMode()}},{key:"endHandMode",value:function(){this.getComponent(O.componentNames.ZOOM).endHandMode()}},{key:"resetZoom",value:function(){this.getComponent(O.componentNames.ZOOM).resetZoom()}},{key:"toDataURL",value:function(e){var t=this.getComponent(O.componentNames.CROPPER);t.changeVisibility(!1);var n=this._canvas&&this._canvas.toDataURL(e);return t.changeVisibility(!0),n}},{key:"setCanvasImage",value:function(e,t){t&&P(t),this.imageName=e,this.canvasImage=t}},{key:"setCssMaxDimension",value:function(e){this.cssMaxWidth=e.width||this.cssMaxWidth,this.cssMaxHeight=e.height||this.cssMaxHeight}},{key:"adjustCanvasDimension",value:function(){var e=this.canvasImage.scale(1),t=e.getBoundingRect(),n=t.width,o=t.height,i=this._calcMaxDimension(n,o);this.setCanvasCssDimension({width:"100%",height:"100%","max-width":i.width+"px","max-height":i.height+"px"}),this.setCanvasBackstoreDimension({width:n,height:o}),this._canvas.centerObject(e)}},{key:"setCanvasCssDimension",value:function(e){this._canvas.setDimensions(e,N)}},{key:"setCanvasBackstoreDimension",value:function(e){this._canvas.setDimensions(e,H)}},{key:"setImageProperties",value:function(e,t){var n=this.canvasImage;n&&(n.set(e).setCoords(),t&&this._canvas.renderAll())}},{key:"getCanvasElement",value:function(){return this._canvas.getElement()}},{key:"getCanvas",value:function(){return this._canvas}},{key:"getCanvasImage",value:function(){return this.canvasImage}},{key:"getImageName",value:function(){return this.imageName}},{key:"addImageObject",value:function(e){var t=this,n=this._callbackAfterLoadingImageObject.bind(this);return new w.Promise((function(o){r.default.Image.fromURL(e,(function(e){n(e),o(t.createObjectProperties(e))}),{crossOrigin:"Anonymous"})}))}},{key:"getCenter",value:function(){return this._canvas.getCenter()}},{key:"getCropzoneRect",value:function(){return this.getComponent(O.componentNames.CROPPER).getCropzoneRect()}},{key:"setCropzoneRect",value:function(e){this.getComponent(O.componentNames.CROPPER).setCropzoneRect(e)}},{key:"getCroppedImageData",value:function(e){return this.getComponent(O.componentNames.CROPPER).getCroppedImageData(e)}},{key:"setBrush",value:function(e){var t=this._drawingMode,n=O.componentNames.FREE_DRAWING;t===O.drawingModes.LINE_DRAWING&&(n=O.componentNames.LINE),this.getComponent(n).setBrush(e)}},{key:"setDrawingShape",value:function(e,t){this.getComponent(O.componentNames.SHAPE).setStates(e,t)}},{key:"setIconStyle",value:function(e,t){this.getComponent(O.componentNames.ICON).setStates(e,t)}},{key:"registerPaths",value:function(e){this.getComponent(O.componentNames.ICON).registerPaths(e)}},{key:"changeCursor",value:function(e){var t=this.getCanvas();t.defaultCursor=e,t.renderAll()}},{key:"hasFilter",value:function(e){return this.getComponent(O.componentNames.FILTER).hasFilter(e)}},{key:"setSelectionStyle",value:function(e){S(O.fObjectOptions.SELECTION_STYLE,e)}},{key:"setObjectProperties",value:function(e,t){var n=this.getObject(e),o=S({},t);return n.set(o),n.setCoords(),this.getCanvas().renderAll(),o}},{key:"getObjectProperties",value:function(e,t){var n=this.getObject(e),o={};return I(t)?o[t]=n[t]:T(t)?A(t,(function(e){o[e]=n[e]})):D(t,(function(e,t){o[t]=n[t]})),o}},{key:"getObjectPosition",value:function(e,t,n){var o=this.getObject(e);return o?o.getPointByOrigin(t,n):null}},{key:"setObjectPosition",value:function(e,t){var n=this.getObject(e),o=t.x,i=t.y,r=t.originX,s=t.originY;if(!n)return!1;var a=n.getPointByOrigin(r,s),l=n.getPointByOrigin("center","center"),c=l.x-a.x,u=l.y-a.y;return n.set({left:o+c,top:i+u}),n.setCoords(),!0}},{key:"getCanvasSize",value:function(){var e=this.getCanvasImage();return{width:e?e.width:0,height:e?e.height:0}}},{key:"createStaticCanvas",value:function(){var e=new r.default.StaticCanvas;return e.set({enableRetinaScaling:!1}),e}},{key:"_getDrawingModeInstance",value:function(e){return this._drawingModeMap[e]}},{key:"_setObjectCachingToFalse",value:function(){r.default.Object.prototype.objectCaching=!1}},{key:"_setCanvasElement",value:function(e){var t=void 0,n=void 0;"CANVAS"!==(t=e.nodeType?e:document.querySelector(e)).nodeName.toUpperCase()&&(n=document.createElement("canvas"),t.appendChild(n)),this._canvas=new r.default.Canvas(n,{containerClass:"tui-image-editor-canvas-container",enableRetinaScaling:!1})}},{key:"_createDrawingModeInstances",value:function(){this._register(this._drawingModeMap,new g.default),this._register(this._drawingModeMap,new y.default),this._register(this._drawingModeMap,new _.default),this._register(this._drawingModeMap,new b.default),this._register(this._drawingModeMap,new j.default),this._register(this._drawingModeMap,new k.default),this._register(this._drawingModeMap,new E.default)}},{key:"_createComponents",value:function(){this._register(this._componentMap,new s.default(this)),this._register(this._componentMap,new a.default(this)),this._register(this._componentMap,new l.default(this)),this._register(this._componentMap,new c.default(this)),this._register(this._componentMap,new u.default(this)),this._register(this._componentMap,new d.default(this)),this._register(this._componentMap,new h.default(this)),this._register(this._componentMap,new f.default(this)),this._register(this._componentMap,new p.default(this)),this._register(this._componentMap,new m.default(this)),this._register(this._componentMap,new v.default(this))}},{key:"_register",value:function(e,t){e[t.getName()]=t}},{key:"_isSameDrawingMode",value:function(e){return this.getDrawingMode()===e}},{key:"_calcMaxDimension",value:function(e,t){var n=this.cssMaxWidth/e,o=this.cssMaxHeight/t,i=Math.min(e,this.cssMaxWidth),r=Math.min(t,this.cssMaxHeight);return n<1&&n<o?(i=e*n,r=t*n):o<1&&o<n&&(i=e*o,r=t*o),{width:Math.floor(i),height:Math.floor(r)}}},{key:"_callbackAfterLoadingImageObject",value:function(e){var t=this.getCanvasImage().getCenterPoint();e.set(O.fObjectOptions.SELECTION_STYLE),e.set({left:t.x,top:t.y,crossOrigin:"Anonymous"}),this.getCanvas().add(e).setActiveObject(e)}},{key:"_attachCanvasEvents",value:function(){var e=this._canvas,t=this._handler;e.on({"mouse:down":t.onMouseDown,"object:added":t.onObjectAdded,"object:removed":t.onObjectRemoved,"object:moving":t.onObjectMoved,"object:scaling":t.onObjectScaled,"object:modified":t.onObjectModified,"object:rotating":t.onObjectRotated,"path:created":t.onPathCreated,"selection:cleared":t.onSelectionCleared,"selection:created":t.onSelectionCreated,"selection:updated":t.onObjectSelected})}},{key:"_onMouseDown",value:function(e){var t=this,n=e.e,o=e.target,i=this._canvas.getPointer(n);if(o){var r=o.type,s=(0,x.makeSelectionUndoData)(o,(function(e){return(0,x.makeSelectionUndoDatum)(t.getObjectId(e),e,"activeSelection"===r)}));(0,x.setCachedUndoDataForDimension)(s)}this.fire(O.eventNames.MOUSE_DOWN,n,i)}},{key:"_onObjectAdded",value:function(e){var t=e.target;t.isType("cropzone")||this._addFabricObject(t)}},{key:"_onObjectRemoved",value:function(e){var t=e.target;this._removeFabricObject(P(t))}},{key:"_onObjectMoved",value:function(e){var t=this;this._lazyFire(O.eventNames.OBJECT_MOVED,(function(e){return t.createObjectProperties(e)}),e.target)}},{key:"_onObjectScaled",value:function(e){var t=this;this._lazyFire(O.eventNames.OBJECT_SCALED,(function(e){return t.createObjectProperties(e)}),e.target)}},{key:"_onObjectModified",value:function(e){var t=e.target;"activeSelection"===t.type&&t.getObjects().forEach((function(e){return e.fire("modifiedInGroup",t)}));this.fire(O.eventNames.OBJECT_MODIFIED,t,this.getObjectId(t))}},{key:"_onObjectRotated",value:function(e){var t=this;this._lazyFire(O.eventNames.OBJECT_ROTATED,(function(e){return t.createObjectProperties(e)}),e.target)}},{key:"_lazyFire",value:function(e,t,n){var o=this,i=n&&n.canvasEventDelegation?n.canvasEventDelegation(e):"none";"unregistered"===i&&n.canvasEventRegister(e,(function(n){o.fire(e,t(n))})),"none"===i&&this.fire(e,t(n))}},{key:"_onObjectSelected",value:function(e){var t=e.target,n=this.createObjectProperties(t);this.fire(O.eventNames.OBJECT_ACTIVATED,n)}},{key:"_onPathCreated",value:function(e){var t=e.path.getCenterPoint(),n=t.x,o=t.y;e.path.set(S({left:n,top:o},O.fObjectOptions.SELECTION_STYLE));var i=this.createObjectProperties(e.path);this.fire(O.eventNames.ADD_OBJECT,i)}},{key:"_onSelectionCleared",value:function(){this.fire(O.eventNames.SELECTION_CLEARED)}},{key:"_onSelectionCreated",value:function(e){var t=e.target,n=this.createObjectProperties(t);this.fire(O.eventNames.OBJECT_ACTIVATED,n),this.fire(O.eventNames.SELECTION_CREATED,e.target)}},{key:"discardSelection",value:function(){this._canvas.discardActiveObject(),this._canvas.renderAll()}},{key:"changeSelectableAll",value:function(e){this._canvas.forEachObject((function(t){t.selectable=e,t.hoverCursor=e?"move":"crosshair"}))}},{key:"createObjectProperties",value:function(e){var t={id:P(e),type:e.type};if(S(t,(0,w.getProperties)(e,["left","top","width","height","fill","stroke","strokeWidth","opacity","angle"])),(0,w.includes)(["i-text","text"],e.type))S(t,this._createTextProperties(e,t));else if((0,w.includes)(["rect","triangle","circle"],e.type)){var n=this.getComponent(O.componentNames.SHAPE);S(t,{fill:n.makeFillPropertyForUserEvent(e)})}return t}},{key:"_createTextProperties",value:function(e){var t={};return S(t,(0,w.getProperties)(e,["text","fontFamily","fontSize","fontStyle","textAlign","textDecoration","fontWeight"])),t}},{key:"_addFabricObject",value:function(e){var t=P(e);return this._objects[t]=e,t}},{key:"_removeFabricObject",value:function(e){delete this._objects[e]}},{key:"resetTargetObjectForCopyPaste",value:function(){var e=this.getActiveObject();e&&(this.targetObjectForCopyPaste=e)}},{key:"pasteObject",value:function(){var e=this;if(!this.targetObjectForCopyPaste)return w.Promise.resolve([]);var t=this.targetObjectForCopyPaste,n="activeSelection"===t.type?t.getObjects():[t],o=null;return this.discardSelection(),this._cloneObject(n).then((function(t){o=t.length>1?e.getActiveSelectionFromObjects(t):t[0],e.targetObjectForCopyPaste=o,e.setActiveObject(o)}))}},{key:"_cloneObject",value:function(e){var t=this,n=i.default.map(e,(function(e){return t._cloneObjectItem(e)}));return w.Promise.all(n)}},{key:"_cloneObjectItem",value:function(e){var t=this;return this._copyFabricObjectForPaste(e).then((function(e){var n=t.createObjectProperties(e);return t.add(e),t.fire(O.eventNames.ADD_OBJECT,n),e}))}},{key:"_copyFabricObjectForPaste",value:function(e){var t=this,n=function(e,t){return t?e-10:e+10};return this._copyFabricObject(e).then((function(e){var o=e.left,r=e.top,s=e.width,a=e.height,l=t.getCanvasSize(),c=l.width,u=l.height,d=o+s/2,h=r+a/2;return e.set(i.default.extend({left:n(o,d+10>c),top:n(r,h+10>u)},O.fObjectOptions.SELECTION_STYLE)),e}))}},{key:"_copyFabricObject",value:function(e){var t=this;return new w.Promise((function(n){e.clone((function(o){var i=t.getComponent(O.componentNames.SHAPE);(0,w.isShape)(o)&&i.processForCopiedObject(o,e),n(o)}))}))}}]),e}();L.mixin(R),t.default=R},"./src/js/helper/imagetracer.js":
|
|
/*!**************************************!*\
|
|
!*** ./src/js/helper/imagetracer.js ***!
|
|
\**************************************/
|
|
/*! no static exports found */function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var o=function(){function e(e,t){for(var n=0;n<t.length;n++){var o=t[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}return function(t,n,o){return n&&e(t.prototype,n),o&&e(t,o),t}}();var i=function(){function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.versionnumber="1.2.4",this.optionpresets={default:{corsenabled:!1,ltres:1,qtres:1,pathomit:8,rightangleenhance:!0,colorsampling:2,numberofcolors:16,mincolorratio:0,colorquantcycles:3,layering:0,strokewidth:1,linefilter:!1,scale:1,roundcoords:1,viewbox:!1,desc:!1,lcpr:0,qcpr:0,blurradius:0,blurdelta:20},posterized1:{colorsampling:0,numberofcolors:2},posterized2:{numberofcolors:4,blurradius:5},curvy:{ltres:.01,linefilter:!0,rightangleenhance:!1},sharp:{qtres:.01,linefilter:!1},detailed:{pathomit:0,roundcoords:2,ltres:.5,qtres:.5,numberofcolors:64},smoothed:{blurradius:5,blurdelta:64},grayscale:{colorsampling:0,colorquantcycles:1,numberofcolors:7},fixedpalette:{colorsampling:0,colorquantcycles:1,numberofcolors:27},randomsampling1:{colorsampling:1,numberofcolors:8},randomsampling2:{colorsampling:1,numberofcolors:64},artistic1:{colorsampling:0,colorquantcycles:1,pathomit:0,blurradius:5,blurdelta:64,ltres:.01,linefilter:!0,numberofcolors:16,strokewidth:2},artistic2:{qtres:.01,colorsampling:0,colorquantcycles:1,numberofcolors:4,strokewidth:0},artistic3:{qtres:10,ltres:10,numberofcolors:8},artistic4:{qtres:10,ltres:10,numberofcolors:64,blurradius:5,blurdelta:256,strokewidth:2},posterized3:{ltres:1,qtres:1,pathomit:20,rightangleenhance:!0,colorsampling:0,numberofcolors:3,mincolorratio:0,colorquantcycles:3,blurradius:3,blurdelta:20,strokewidth:0,linefilter:!1,roundcoords:1,pal:[{r:0,g:0,b:100,a:255},{r:255,g:255,b:255,a:255}]}},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]]],this.gks=[[.27901,.44198,.27901],[.135336,.228569,.272192,.228569,.135336],[.086776,.136394,.178908,.195843,.178908,.136394,.086776],[.063327,.093095,.122589,.144599,.152781,.144599,.122589,.093095,.063327],[.049692,.069304,.089767,.107988,.120651,.125194,.120651,.107988,.089767,.069304,.049692]],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}]}return o(e,null,[{key:"tracerDefaultOption",value:function(){return{pathomit:100,ltres:.1,qtres:1,scale:1,strokewidth:5,viewbox:!1,linefilter:!0,desc:!1,rightangleenhance:!1,pal:[{r:0,g:0,b:0,a:255},{r:255,g:255,b:255,a:255}]}}}]),o(e,[{key:"imageToSVG",value:function(e,t,n){var o=this;n=this.checkoptions(n),this.loadImage(e,(function(e){t(o.imagedataToSVG(o.getImgdata(e),n))}),n)}},{key:"imagedataToSVG",value:function(e,t){t=this.checkoptions(t);var n=this.imagedataToTracedata(e,t);return this.getsvgstring(n,t)}},{key:"imageToTracedata",value:function(e,t,n){var o=this;n=this.checkoptions(n),this.loadImage(e,(function(e){t(o.imagedataToTracedata(o.getImgdata(e),n))}),n)}},{key:"imagedataToTracedata",value:function(e,t){t=this.checkoptions(t);var n=this.colorquantization(e,t),o=void 0;if(0===t.layering){o={layers:[],palette:n.palette,width:n.array[0].length-2,height:n.array.length-2};for(var i=0;i<n.palette.length;i+=1){var r=this.batchtracepaths(this.internodes(this.pathscan(this.layeringstep(n,i),t.pathomit),t),t.ltres,t.qtres);o.layers.push(r)}}else{var s=this.layering(n);t.layercontainerid&&this.drawLayers(s,this.specpalette,t.scale,t.layercontainerid);var a=this.batchpathscan(s,t.pathomit),l=this.batchinternodes(a,t);o={layers:this.batchtracelayers(l,t.ltres,t.qtres),palette:n.palette,width:e.width,height:e.height}}return o}},{key:"checkoptions",value:function(e){"string"==typeof(e=e||{})&&(e=e.toLowerCase(),e=this.optionpresets[e]?this.optionpresets[e]:{});for(var t=Object.keys(this.optionpresets.default),n=0;n<t.length;n+=1)e.hasOwnProperty(t[n])||(e[t[n]]=this.optionpresets.default[t[n]]);return e}},{key:"colorquantization",value:function(e,t){var n=[],o=0,i=void 0,r=void 0,s=void 0,a=[],l=e.width*e.height,c=void 0,u=void 0,d=void 0,h=void 0,f=void 0;for(u=0;u<e.height+2;u+=1)for(n[u]=[],c=0;c<e.width+2;c+=1)n[u][c]=-1;for(f=t.pal?t.pal:0===t.colorsampling?this.generatepalette(t.numberofcolors):1===t.colorsampling?this.samplepalette(t.numberofcolors,e):this.samplepalette2(t.numberofcolors,e),t.blurradius>0&&(e=this.blur(e,t.blurradius,t.blurdelta)),h=0;h<t.colorquantcycles;h+=1){if(h>0)for(d=0;d<f.length;d+=1)a[d].n>0&&(f[d]={r:Math.floor(a[d].r/a[d].n),g:Math.floor(a[d].g/a[d].n),b:Math.floor(a[d].b/a[d].n),a:Math.floor(a[d].a/a[d].n)}),a[d].n/l<t.mincolorratio&&h<t.colorquantcycles-1&&(f[d]={r:Math.floor(255*Math.random()),g:Math.floor(255*Math.random()),b:Math.floor(255*Math.random()),a:Math.floor(255*Math.random())});for(c=0;c<f.length;c+=1)a[c]={r:0,g:0,b:0,a:0,n:0};for(u=0;u<e.height;u+=1)for(c=0;c<e.width;c+=1){for(o=4*(u*e.width+c),s=0,r=1024,d=0;d<f.length;d+=1)(i=Math.abs(f[d].r-e.data[o])+Math.abs(f[d].g-e.data[o+1])+Math.abs(f[d].b-e.data[o+2])+Math.abs(f[d].a-e.data[o+3]))<r&&(r=i,s=d);a[s].r+=e.data[o],a[s].g+=e.data[o+1],a[s].b+=e.data[o+2],a[s].a+=e.data[o+3],a[s].n+=1,n[u+1][c+1]=s}}return{array:n,palette:f}}},{key:"samplepalette",value:function(e,t){for(var n=void 0,o=[],i=0;i<e;i+=1)n=4*Math.floor(Math.random()*t.data.length/4),o.push({r:t.data[n],g:t.data[n+1],b:t.data[n+2],a:t.data[n+3]});return o}},{key:"samplepalette2",value:function(e,t){for(var n=void 0,o=[],i=Math.ceil(Math.sqrt(e)),r=Math.ceil(e/i),s=t.width/(i+1),a=t.height/(r+1),l=0;l<r;l+=1)for(var c=0;c<i&&o.length!==e;c+=1)n=4*Math.floor((l+1)*a*t.width+(c+1)*s),o.push({r:t.data[n],g:t.data[n+1],b:t.data[n+2],a:t.data[n+3]});return o}},{key:"generatepalette",value:function(e){var t=[],n=void 0,o=void 0,i=void 0;if(e<8)for(var r=Math.floor(255/(e-1)),s=0;s<e;s+=1)t.push({r:s*r,g:s*r,b:s*r,a:255});else{var a=Math.floor(Math.pow(e,1/3)),l=Math.floor(255/(a-1)),c=e-a*a*a;for(n=0;n<a;n+=1)for(o=0;o<a;o+=1)for(i=0;i<a;i+=1)t.push({r:n*l,g:o*l,b:i*l,a:255});for(n=0;n<c;n+=1)t.push({r:Math.floor(255*Math.random()),g:Math.floor(255*Math.random()),b:Math.floor(255*Math.random()),a:Math.floor(255*Math.random())})}return t}},{key:"layering",value:function(e){var t=[],n=0,o=e.array.length,i=e.array[0].length,r=void 0,s=void 0,a=void 0,l=void 0,c=void 0,u=void 0,d=void 0,h=void 0,f=void 0,p=void 0,m=void 0;for(m=0;m<e.palette.length;m+=1)for(t[m]=[],p=0;p<o;p+=1)for(t[m][p]=[],f=0;f<i;f+=1)t[m][p][f]=0;for(p=1;p<o-1;p+=1)for(f=1;f<i-1;f+=1)n=e.array[p][f],r=e.array[p-1][f-1]===n?1:0,s=e.array[p-1][f]===n?1:0,a=e.array[p-1][f+1]===n?1:0,l=e.array[p][f-1]===n?1:0,c=e.array[p][f+1]===n?1:0,u=e.array[p+1][f-1]===n?1:0,d=e.array[p+1][f]===n?1:0,h=e.array[p+1][f+1]===n?1:0,t[n][p+1][f+1]=1+2*c+4*h+8*d,l||(t[n][p+1][f]=2+4*d+8*u),s||(t[n][p][f+1]=0+2*a+4*c+8),r||(t[n][p][f]=0+2*s+4+8*l);return t}},{key:"layeringstep",value:function(e,t){var n=[],o=e.array.length,i=e.array[0].length,r=void 0,s=void 0;for(s=0;s<o;s+=1)for(n[s]=[],r=0;r<i;r+=1)n[s][r]=0;for(s=1;s<o;s+=1)for(r=1;r<i;r+=1)n[s][r]=(e.array[s-1][r-1]===t?1:0)+(e.array[s-1][r]===t?2:0)+(e.array[s][r-1]===t?8:0)+(e.array[s][r]===t?4:0);return n}},{key:"pathscan",value:function(e,t){for(var n=[],o=0,i=0,r=0,s=0,a=e[0].length,l=e.length,c=0,u=!0,d=!1,h=void 0,f=0;f<l;f+=1)for(var p=0;p<a;p+=1)if(4===e[f][p]||11===e[f][p])for(r=p,s=f,n[o]={},n[o].points=[],n[o].boundingbox=[r,s,r,s],n[o].holechildren=[],u=!1,i=0,d=11===e[f][p],c=1;!u;){if(n[o].points[i]={},n[o].points[i].x=r-1,n[o].points[i].y=s-1,n[o].points[i].t=e[s][r],r-1<n[o].boundingbox[0]&&(n[o].boundingbox[0]=r-1),r-1>n[o].boundingbox[2]&&(n[o].boundingbox[2]=r-1),s-1<n[o].boundingbox[1]&&(n[o].boundingbox[1]=s-1),s-1>n[o].boundingbox[3]&&(n[o].boundingbox[3]=s-1),h=this.pathscan_combined_lookup[e[s][r]][c],e[s][r]=h[0],c=h[1],r+=h[2],s+=h[3],r-1===n[o].points[0].x&&s-1===n[o].points[0].y)if(u=!0,n[o].points.length<t)n.pop();else{if(n[o].isholepath=!!d,d){for(var m=0,v=[-1,-1,a+1,l+1],g=0;g<o;g++)!n[g].isholepath&&this.boundingboxincludes(n[g].boundingbox,n[o].boundingbox)&&this.boundingboxincludes(v,n[g].boundingbox)&&(m=g,v=n[g].boundingbox);n[m].holechildren.push(o)}o+=1}i+=1}return n}},{key:"boundingboxincludes",value:function(e,t){return e[0]<t[0]&&e[1]<t[1]&&e[2]>t[2]&&e[3]>t[3]}},{key:"batchpathscan",value:function(e,t){var n=[];for(var o in e)e.hasOwnProperty(o)&&(n[o]=this.pathscan(e[o],t));return n}},{key:"internodes",value:function(e,t){var n=[],o=0,i=0,r=0,s=0,a=0,l=void 0,c=void 0;for(l=0;l<e.length;l+=1)for(n[l]={},n[l].points=[],n[l].boundingbox=e[l].boundingbox,n[l].holechildren=e[l].holechildren,n[l].isholepath=e[l].isholepath,o=e[l].points.length,c=0;c<o;c+=1)i=(c+1)%o,r=(c+2)%o,s=(c-1+o)%o,a=(c-2+o)%o,t.rightangleenhance&&this.testrightangle(e[l],a,s,c,i,r)&&(n[l].points.length>0&&(n[l].points[n[l].points.length-1].linesegment=this.getdirection(n[l].points[n[l].points.length-1].x,n[l].points[n[l].points.length-1].y,e[l].points[c].x,e[l].points[c].y)),n[l].points.push({x:e[l].points[c].x,y:e[l].points[c].y,linesegment:this.getdirection(e[l].points[c].x,e[l].points[c].y,(e[l].points[c].x+e[l].points[i].x)/2,(e[l].points[c].y+e[l].points[i].y)/2)})),n[l].points.push({x:(e[l].points[c].x+e[l].points[i].x)/2,y:(e[l].points[c].y+e[l].points[i].y)/2,linesegment:this.getdirection((e[l].points[c].x+e[l].points[i].x)/2,(e[l].points[c].y+e[l].points[i].y)/2,(e[l].points[i].x+e[l].points[r].x)/2,(e[l].points[i].y+e[l].points[r].y)/2)});return n}},{key:"testrightangle",value:function(e,t,n,o,i,r){return e.points[o].x===e.points[t].x&&e.points[o].x===e.points[n].x&&e.points[o].y===e.points[i].y&&e.points[o].y===e.points[r].y||e.points[o].y===e.points[t].y&&e.points[o].y===e.points[n].y&&e.points[o].x===e.points[i].x&&e.points[o].x===e.points[r].x}},{key:"getdirection",value:function(e,t,n,o){return e<n?t<o?1:t>o?7:0:e>n?t<o?3:t>o?5:4:t<o?2:t>o?6:8}},{key:"batchinternodes",value:function(e,t){var n=[];for(var o in e)e.hasOwnProperty(o)&&(n[o]=this.internodes(e[o],t));return n}},{key:"tracepath",value:function(e,t,n){var o=0,i=void 0,r=void 0,s=void 0,a={segments:[]};for(a.boundingbox=e.boundingbox,a.holechildren=e.holechildren,a.isholepath=e.isholepath;o<e.points.length;){for(i=e.points[o].linesegment,r=-1,s=o+1;(e.points[s].linesegment===i||e.points[s].linesegment===r||-1===r)&&s<e.points.length-1;)e.points[s].linesegment!==i&&-1===r&&(r=e.points[s].linesegment),s+=1;s===e.points.length-1&&(s=0),a.segments=a.segments.concat(this.fitseq(e,t,n,o,s)),o=s>0?s:e.points.length}return a}},{key:"fitseq",value:function(e,t,n,o,i){if(i>e.points.length||i<0)return[];var r=o,s=0,a=!0,l=void 0,c=void 0,u=void 0,d=i-o;d<0&&(d+=e.points.length);for(var h=(e.points[i].x-e.points[o].x)/d,f=(e.points[i].y-e.points[o].y)/d,p=(o+1)%e.points.length,m=void 0;p!=i;)(m=p-o)<0&&(m+=e.points.length),l=e.points[o].x+h*m,c=e.points[o].y+f*m,(u=(e.points[p].x-l)*(e.points[p].x-l)+(e.points[p].y-c)*(e.points[p].y-c))>t&&(a=!1),u>s&&(r=p,s=u),p=(p+1)%e.points.length;if(a)return[{type:"L",x1:e.points[o].x,y1:e.points[o].y,x2:e.points[i].x,y2:e.points[i].y}];var v=r;a=!0,s=0;var g=(v-o)/d,y=(1-g)*(1-g),_=2*(1-g)*g,b=g*g,j=(y*e.points[o].x+b*e.points[i].x-e.points[v].x)/-_,k=(y*e.points[o].y+b*e.points[i].y-e.points[v].y)/-_;for(p=o+1;p!=i;)_=2*(1-(g=(p-o)/d))*g,b=g*g,l=(y=(1-g)*(1-g))*e.points[o].x+_*j+b*e.points[i].x,c=y*e.points[o].y+_*k+b*e.points[i].y,(u=(e.points[p].x-l)*(e.points[p].x-l)+(e.points[p].y-c)*(e.points[p].y-c))>n&&(a=!1),u>s&&(r=p,s=u),p=(p+1)%e.points.length;if(a)return[{type:"Q",x1:e.points[o].x,y1:e.points[o].y,x2:j,y2:k,x3:e.points[i].x,y3:e.points[i].y}];var E=v;return this.fitseq(e,t,n,o,E).concat(this.fitseq(e,t,n,E,i))}},{key:"batchtracepaths",value:function(e,t,n){var o=[];for(var i in e)e.hasOwnProperty(i)&&o.push(this.tracepath(e[i],t,n));return o}},{key:"batchtracelayers",value:function(e,t,n){var o=[];for(var i in e)e.hasOwnProperty(i)&&(o[i]=this.batchtracepaths(e[i],t,n));return o}},{key:"roundtodec",value:function(e,t){return Number(e.toFixed(t))}},{key:"svgpathstring",value:function(e,t,n,o){var i=e.layers[t],r=i[n],s="",a=void 0;if(o.linefilter&&r.segments.length<3)return s;if(s="<path "+(o.desc?'desc="l '+t+" p "+n+'" ':"")+this.tosvgcolorstr(e.palette[t],o)+'d="',-1===o.roundcoords){for(s+="M "+r.segments[0].x1*o.scale+" "+r.segments[0].y1*o.scale+" ",a=0;a<r.segments.length;a++)s+=r.segments[a].type+" "+r.segments[a].x2*o.scale+" "+r.segments[a].y2*o.scale+" ",r.segments[a].hasOwnProperty("x3")&&(s+=r.segments[a].x3*o.scale+" "+r.segments[a].y3*o.scale+" ");s+="Z "}else{for(s+="M "+this.roundtodec(r.segments[0].x1*o.scale,o.roundcoords)+" "+this.roundtodec(r.segments[0].y1*o.scale,o.roundcoords)+" ",a=0;a<r.segments.length;a++)s+=r.segments[a].type+" "+this.roundtodec(r.segments[a].x2*o.scale,o.roundcoords)+" "+this.roundtodec(r.segments[a].y2*o.scale,o.roundcoords)+" ",r.segments[a].hasOwnProperty("x3")&&(s+=this.roundtodec(r.segments[a].x3*o.scale,o.roundcoords)+" "+this.roundtodec(r.segments[a].y3*o.scale,o.roundcoords)+" ");s+="Z "}for(var l=0;l<r.holechildren.length;l++){var c=i[r.holechildren[l]];if(-1===o.roundcoords)for(c.segments[c.segments.length-1].hasOwnProperty("x3")?s+="M "+c.segments[c.segments.length-1].x3*o.scale+" "+c.segments[c.segments.length-1].y3*o.scale+" ":s+="M "+c.segments[c.segments.length-1].x2*o.scale+" "+c.segments[c.segments.length-1].y2*o.scale+" ",a=c.segments.length-1;a>=0;a--)s+=c.segments[a].type+" ",c.segments[a].hasOwnProperty("x3")&&(s+=c.segments[a].x2*o.scale+" "+c.segments[a].y2*o.scale+" "),s+=c.segments[a].x1*o.scale+" "+c.segments[a].y1*o.scale+" ";else for(c.segments[c.segments.length-1].hasOwnProperty("x3")?s+="M "+this.roundtodec(c.segments[c.segments.length-1].x3*o.scale)+" "+this.roundtodec(c.segments[c.segments.length-1].y3*o.scale)+" ":s+="M "+this.roundtodec(c.segments[c.segments.length-1].x2*o.scale)+" "+this.roundtodec(c.segments[c.segments.length-1].y2*o.scale)+" ",a=c.segments.length-1;a>=0;a--)s+=c.segments[a].type+" ",c.segments[a].hasOwnProperty("x3")&&(s+=this.roundtodec(c.segments[a].x2*o.scale)+" "+this.roundtodec(c.segments[a].y2*o.scale)+" "),s+=this.roundtodec(c.segments[a].x1*o.scale)+" "+this.roundtodec(c.segments[a].y1*o.scale)+" ";s+="Z "}if(s+='" />',o.lcpr||o.qcpr){for(a=0;a<r.segments.length;a++)r.segments[a].hasOwnProperty("x3")&&o.qcpr&&(s+='<circle cx="'+r.segments[a].x2*o.scale+'" cy="'+r.segments[a].y2*o.scale+'" r="'+o.qcpr+'" fill="cyan" stroke-width="'+.2*o.qcpr+'" stroke="black" />',s+='<circle cx="'+r.segments[a].x3*o.scale+'" cy="'+r.segments[a].y3*o.scale+'" r="'+o.qcpr+'" fill="white" stroke-width="'+.2*o.qcpr+'" stroke="black" />',s+='<line x1="'+r.segments[a].x1*o.scale+'" y1="'+r.segments[a].y1*o.scale+'" x2="'+r.segments[a].x2*o.scale+'" y2="'+r.segments[a].y2*o.scale+'" stroke-width="'+.2*o.qcpr+'" stroke="cyan" />',s+='<line x1="'+r.segments[a].x2*o.scale+'" y1="'+r.segments[a].y2*o.scale+'" x2="'+r.segments[a].x3*o.scale+'" y2="'+r.segments[a].y3*o.scale+'" stroke-width="'+.2*o.qcpr+'" stroke="cyan" />'),!r.segments[a].hasOwnProperty("x3")&&o.lcpr&&(s+='<circle cx="'+r.segments[a].x2*o.scale+'" cy="'+r.segments[a].y2*o.scale+'" r="'+o.lcpr+'" fill="white" stroke-width="'+.2*o.lcpr+'" stroke="black" />');for(l=0;l<r.holechildren.length;l++){c=i[r.holechildren[l]];for(a=0;a<c.segments.length;a++)c.segments[a].hasOwnProperty("x3")&&o.qcpr&&(s+='<circle cx="'+c.segments[a].x2*o.scale+'" cy="'+c.segments[a].y2*o.scale+'" r="'+o.qcpr+'" fill="cyan" stroke-width="'+.2*o.qcpr+'" stroke="black" />',s+='<circle cx="'+c.segments[a].x3*o.scale+'" cy="'+c.segments[a].y3*o.scale+'" r="'+o.qcpr+'" fill="white" stroke-width="'+.2*o.qcpr+'" stroke="black" />',s+='<line x1="'+c.segments[a].x1*o.scale+'" y1="'+c.segments[a].y1*o.scale+'" x2="'+c.segments[a].x2*o.scale+'" y2="'+c.segments[a].y2*o.scale+'" stroke-width="'+.2*o.qcpr+'" stroke="cyan" />',s+='<line x1="'+c.segments[a].x2*o.scale+'" y1="'+c.segments[a].y2*o.scale+'" x2="'+c.segments[a].x3*o.scale+'" y2="'+c.segments[a].y3*o.scale+'" stroke-width="'+.2*o.qcpr+'" stroke="cyan" />'),!c.segments[a].hasOwnProperty("x3")&&o.lcpr&&(s+='<circle cx="'+c.segments[a].x2*o.scale+'" cy="'+c.segments[a].y2*o.scale+'" r="'+o.lcpr+'" fill="white" stroke-width="'+.2*o.lcpr+'" stroke="black" />')}}return s}},{key:"getsvgstring",value:function(e,t){t=this.checkoptions(t);for(var n=e.width*t.scale,o=e.height*t.scale,i="<svg "+(t.viewbox?'viewBox="0 0 '+n+" "+o+'" ':'width="'+n+'" height="'+o+'" ')+'version="1.1" xmlns="http://www.w3.org/2000/svg" desc="Created with imagetracer.js version '+this.versionnumber+'" >',r=0;r<e.layers.length;r+=1)for(var s=0;s<e.layers[r].length;s+=1)e.layers[r][s].isholepath||(i+=this.svgpathstring(e,r,s,t));return i+="</svg>"}},{key:"compareNumbers",value:function(e,t){return e-t}},{key:"torgbastr",value:function(e){return"rgba("+e.r+","+e.g+","+e.b+","+e.a+")"}},{key:"tosvgcolorstr",value:function(e,t){return'fill="rgb('+e.r+","+e.g+","+e.b+')" stroke="rgb('+e.r+","+e.g+","+e.b+')" stroke-width="'+t.strokewidth+'" opacity="'+e.a/255+'" '}},{key:"appendSVGString",value:function(e,t){var n=void 0;t?(n=document.getElementById(t))||((n=document.createElement("div")).id=t,document.body.appendChild(n)):(n=document.createElement("div"),document.body.appendChild(n)),n.innerHTML+=e}},{key:"blur",value:function(e,t,n){var o=void 0,i=void 0,r=void 0,s=void 0,a=void 0,l=void 0,c=void 0,u=void 0,d=void 0,h={width:e.width,height:e.height,data:[]};if((t=Math.floor(t))<1)return e;t>5&&(t=5),(n=Math.abs(n))>1024&&(n=1024);var f=this.gks[t-1];for(i=0;i<e.height;i++)for(o=0;o<e.width;o++){for(a=0,l=0,c=0,u=0,d=0,r=-t;r<t+1;r++)o+r>0&&o+r<e.width&&(s=4*(i*e.width+o+r),a+=e.data[s]*f[r+t],l+=e.data[s+1]*f[r+t],c+=e.data[s+2]*f[r+t],u+=e.data[s+3]*f[r+t],d+=f[r+t]);s=4*(i*e.width+o),h.data[s]=Math.floor(a/d),h.data[s+1]=Math.floor(l/d),h.data[s+2]=Math.floor(c/d),h.data[s+3]=Math.floor(u/d)}var p=new Uint8ClampedArray(h.data);for(i=0;i<e.height;i++)for(o=0;o<e.width;o++){for(a=0,l=0,c=0,u=0,d=0,r=-t;r<t+1;r++)i+r>0&&i+r<e.height&&(a+=p[s=4*((i+r)*e.width+o)]*f[r+t],l+=p[s+1]*f[r+t],c+=p[s+2]*f[r+t],u+=p[s+3]*f[r+t],d+=f[r+t]);s=4*(i*e.width+o),h.data[s]=Math.floor(a/d),h.data[s+1]=Math.floor(l/d),h.data[s+2]=Math.floor(c/d),h.data[s+3]=Math.floor(u/d)}for(i=0;i<e.height;i++)for(o=0;o<e.width;o++)s=4*(i*e.width+o),Math.abs(h.data[s]-e.data[s])+Math.abs(h.data[s+1]-e.data[s+1])+Math.abs(h.data[s+2]-e.data[s+2])+Math.abs(h.data[s+3]-e.data[s+3])>n&&(h.data[s]=e.data[s],h.data[s+1]=e.data[s+1],h.data[s+2]=e.data[s+2],h.data[s+3]=e.data[s+3]);return h}},{key:"loadImage",value:function(e,t,n){var o=new Image;n&&n.corsenabled&&(o.crossOrigin="Anonymous"),o.src=e,o.onload=function(){var e=document.createElement("canvas");e.width=o.width,e.height=o.height,e.getContext("2d").drawImage(o,0,0),t(e)}}},{key:"getImgdata",value:function(e){return e.getContext("2d").getImageData(0,0,e.width,e.height)}},{key:"drawLayers",value:function(e,t,n,o){n=n||1;var i=void 0,r=void 0,s=void 0,a=void 0,l=void 0,c=void 0;for(l in o?(c=document.getElementById(o))||((c=document.createElement("div")).id=o,document.body.appendChild(c)):(c=document.createElement("div"),document.body.appendChild(c)),e)if(e.hasOwnProperty(l)){i=e[l][0].length,r=e[l].length;var u=document.createElement("canvas");u.width=i*n,u.height=r*n;var d=u.getContext("2d");for(a=0;a<r;a+=1)for(s=0;s<i;s+=1)d.fillStyle=this.torgbastr(t[e[l][a][s]%t.length]),d.fillRect(s*n,a*n,n,n);c.appendChild(u)}}}]),e}();t.default=i},"./src/js/helper/selectionModifyHelper.js":
|
|
/*!************************************************!*\
|
|
!*** ./src/js/helper/selectionModifyHelper.js ***!
|
|
\************************************************/
|
|
/*! no static exports found */function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.setCachedUndoDataForDimension=function(e){i=e},t.getCachedUndoDataForDimension=function(){return i},t.makeSelectionUndoData=function(e,t){var n=void 0;n="activeSelection"===e.type?e.getObjects().map((function(n){var o=n.angle,i=n.left,r=n.top,s=n.scaleX,a=n.scaleY,l=n.width,c=n.height;e.realizeTransform(n);var u=t(n);return n.set({angle:o,left:i,top:r,width:l,height:c,scaleX:s,scaleY:a}),u})):[t(e)];return n},t.makeSelectionUndoDatum=function(e,t,n){return n?{id:e,width:t.width,height:t.height,top:t.top,left:t.left,angle:t.angle,scaleX:t.scaleX,scaleY:t.scaleY}:(0,o.extend)({id:e},t)};var o=n(/*! tui-code-snippet */"tui-code-snippet"),i=null},"./src/js/helper/shapeFilterFillHelper.js":
|
|
/*!************************************************!*\
|
|
!*** ./src/js/helper/shapeFilterFillHelper.js ***!
|
|
\************************************************/
|
|
/*! no static exports found */function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getFillImageFromShape=f,t.rePositionFilterTypeFillImage=function(e){var t=e.angle,n=e.flipX,o=e.flipY,r=f(e),s=function(e){var t=v(e),n=t[0],o=n.x,i=n.y,r=t[1],s=r.x,a=r.y,l=t[2],c=l.x,u=l.y,d=t[3],h=d.x,f=d.y,p=Math.min(o,s,c,h),m=Math.min(i,a,u,f),g=Math.max(o,s,c,h),y=Math.max(i,a,u,f);return{left:p,top:m,right:g,bottom:y,width:g-p,height:y-m}}(e),l=s.right,c=s.bottom,d=s.width,p=s.height,m=(d-e.width)/2,g=(p-e.height)/2,y=e.left-e.width/2-m,_=e.top-e.height/2-g,b=d/2-m,j=p/2-g,k=Math.max(d,p)+Math.max(m,g),E=function(e){var t=e.shapeObj,n=e.left,o=e.top,r=e.width,s=e.height,a=e.cropX,l=e.cropY,c=e.flipX,d=e.flipY,f=e.right,p=e.bottom,m=function(e,n,o,r){return function(e){var t=e.type,n=e.shapeObj,o=e.outDistance,r=e.left,s=e.top,a=e.flipX,l=e.flipY,c=v(n),u=function(e,t,n){var o=0,r=0;(0,i.forEach)(t,(function(t,n){t[e]<o&&(o=t[e],r=n)}));var s=n[r],a=s[0],l=s[1];return{startPointIndex:r,endPointIndex1:a,endPointIndex2:l}}(t,c,[[1,2],[0,3],[0,3],[1,2]]),d=function(e,t,n){var o=n.startPointIndex,r=n.endPointIndex1,s=n.endPointIndex2,a="x"===e?180:270;return(0,i.map)([r,s],(function(e){var n=t[o],i=t[e],r=n.y-i.y,s=n.x-i.x;return 180*Math.atan2(r,s)/Math.PI-a}))}(t,c,u),h=u.startPointIndex,f=function(e){var t=e.outDistance,n=e.startPointIndex,o=e.flipX,i=e.flipY,r=e.reatAngles,s=t*Math.cos(r[0]*Math.PI/180),a=t*Math.cos(r[1]*Math.PI/180),l=2===n||3===n,c={top:l?s:a,left:l?a:s};(function(e,t,n){return(!t&&n||!t&&!n)&&0===e||(t&&n||t&&!n)&&1===e||(!t&&!n||!t&&n)&&2===e||(t&&!n||t&&n)&&3===e})(n,o,i)&&(c.left=-1*c.left);(function(e,t,n){return(t&&!n||!t&&!n)&&0===e||(!t&&!n||t&&!n)&&1===e||(t&&n||!t&&n)&&2===e||(!t&&n||t&&n)&&3===e})(n,o,i)&&(c.top=-1*c.top);return c}({outDistance:o,startPointIndex:h,flipX:a,flipY:l,reatAngles:d});return[r+f.left,s+f.top]}({type:e,outDistance:n,shapeObj:t,flipX:c,flipY:d,left:o,top:r})},g=r,y=s,_=function(e,t){var n=t.left,o=t.top,r=t.width,s=t.height,a=t.cropX,l=t.cropY,c={width:r,height:s};return(0,i.forEach)(["x","y"],(function(t){var i="x"===t?a:l,r=c[u[t]],s=h[u[t]];if(r>s){var d=(r-s)/2;c[u[t]]=s;var f=e(t,d,n,o);n=f[0],o=f[1]}if(i<0){var p=e(t,i,n,o);n=p[0],o=p[1]}})),[n,o,c.width,c.height]}(m,{left:n,top:o,width:r,height:s,cropX:a,cropY:l});n=_[0],o=_[1],r=_[2],s=_[3];var b=function(e,t){var n=t.left,o=t.top,r=t.insideCanvasRealImageWidth,s=t.insideCanvasRealImageHeight,a=t.right,l=t.bottom,c=t.cropX,u=t.cropY,d=t.originalWidth,f=t.originalHeight,p=r,m=s,v=h,g=v.width,y=v.height;a>g&&c>0&&(p=d-Math.abs(a-g));l>y&&u>0&&(m=f-Math.abs(l-y));var _={x:(r-p)/2,y:(s-m)/2};return(0,i.forEach)(["x","y"],(function(t){var i=_[t];if(i>0){var r=e(t,i,n,o);n=r[0],o=r[1]}})),[n,o,p,m]}(m,{left:n,top:o,insideCanvasRealImageWidth:r,insideCanvasRealImageHeight:s,right:f,bottom:p,cropX:a,cropY:l,originalWidth:g,originalHeight:y});return n=b[0],o=b[1],r=b[2],s=b[3],[n,o,r,s]}({shapeObj:e,left:b,top:j,width:d,height:p,cropX:y,cropY:_,flipX:n,flipY:o,right:l,bottom:c});b=E[0],j=E[1],d=E[2],p=E[3],r.set({angle:n===o?-t:t,left:b,top:j,width:d,height:p,cropX:y,cropY:_,flipX:n,flipY:o}),(0,a.setCustomProperty)(r,{fillImageMaxSize:k})},t.makeFilterOptionFromFabricImage=p,t.makeFillPatternForFilter=function(e,t,n){var o=g(m(e),e.angle,t);n.add(o);var i={fill:new fabric.Pattern({source:n.getElement(),repeat:"no-repeat"})};return(0,a.setCustomProperty)(i,{patternSourceCanvas:n}),i},t.resetFillPatternCanvas=function(e){var t=e.getObjects()[0],n=(0,a.getCustomProperty)(t,"fillImageMaxSize").fillImageMaxSize;n=Math.max(1,n),e.setDimensions({width:n,height:n}),e.renderAll()},t.reMakePatternImageSource=function(e,t){var n=(0,a.getCustomProperty)(e,"patternSourceCanvas").patternSourceCanvas,o=n.getObjects()[0],i=p(o);n.remove(o);var r=g(m(t,!0),t.angle,i);n.add(r)},t.getCachedCanvasImageElement=m;var o,i=n(/*! tui-code-snippet */"tui-code-snippet"),r=n(/*! @/helper/shapeResizeHelper */"./src/js/helper/shapeResizeHelper.js"),s=(o=r)&&o.__esModule?o:{default:o},a=n(/*! @/util */"./src/js/util.js");function l(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var c={pixelate:"blocksize",blur:"blur"},u={x:"width",y:"height"},d=(0,a.flipObject)(c),h=null;function f(e){return(0,a.getCustomProperty)(e,"patternSourceCanvas").patternSourceCanvas.getObjects()[0]}function p(e){return(0,i.map)(e.filters,(function(e){var t=Object.keys(e)[0];return l({},d[t],e[t])}))}function m(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return h&&!t||(h=e.toCanvasElement()),h}function v(e){return[e.getPointByOrigin("left","top"),e.getPointByOrigin("right","top"),e.getPointByOrigin("left","bottom"),e.getPointByOrigin("right","bottom")]}function g(e,t,n){var o=new fabric.Image(e);return(0,i.forEach)(i.extend.apply(void 0,[{}].concat(n)),(function(e,t){var n=(0,a.capitalizeString)(t),i=new fabric.Image.filters[n](l({},c[t],e));o.filters.push(i)})),o.applyFilters(),(0,a.setCustomProperty)(o,{originalAngle:t,fillImageMaxSize:Math.max(o.width,o.height)}),s.default.adjustOriginToCenter(o),o}},"./src/js/helper/shapeResizeHelper.js":
|
|
/*!********************************************!*\
|
|
!*** ./src/js/helper/shapeResizeHelper.js ***!
|
|
\********************************************/
|
|
/*! no static exports found */function(e,t,n){"use strict";var o={rect:1,circle:2,triangle:1},i={rect:{w:"width",h:"height"},circle:{w:"rx",h:"ry"},triangle:{w:"width",h:"height"}};function r(e,t,n){var o=e.x,i=e.y,r=t.x,s=t.y,a=n*Math.PI/180;return{originX:o>(r-o)*Math.cos(a)-(s-i)*Math.sin(a)+o?"right":"left",originY:i>(r-o)*Math.sin(a)+(s-i)*Math.cos(a)+i?"bottom":"top"}}e.exports={setOrigins:function(e){var t=e.getPointByOrigin("left","top"),n=e.getPointByOrigin("right","top"),o=e.getPointByOrigin("right","bottom"),i=e.getPointByOrigin("left","bottom");e.origins={lt:t,rt:n,rb:o,lb:i}},resize:function(e,t,n){(function(e){return"center"===e.originX&&"center"===e.originY})(e)&&(function(e,t){var n=t.getPointByOrigin("center","center"),o=r(n,e,-t.angle),i=o.originX,s=o.originY,a=t.getPointByOrigin(i,s),l=t.left-(n.x-a.x),c=t.top-(n.y-a.y);t.set({originX:i,originY:s,left:l,top:c}),t.setCoords()}(t,e),function(e){var t=e.originX,n=e.originY,o=t.substring(0,1)+n.substring(0,1);e.startPoint=e.origins[o]}(e)),n?function(e){var t=e.type,n=e.scaleX,o=e.scaleY,r=i[t],s=e[r.w]*n,a=e[r.h]*o;if(e.isRegular){var l=Math.max(n,o);s=e[r.w]*l,a=e[r.h]*l}var c={hasControls:!1,hasBorders:!1,scaleX:1,scaleY:1};c[r.w]=s,c[r.h]=a,e.set(c)}(e):function(e,t){var n=t.type,r=t.strokeWidth,s=t.startPoint,a=o[n],l=i[n],c=!("triangle"!==t.type),u={},d=Math.abs(s.x-e.x)/a,h=Math.abs(s.y-e.y)/a;d>r&&(d-=r/a),h>r&&(h-=r/a),t.isRegular&&(d=h=Math.max(d,h),c&&(h=Math.sqrt(3)/2*d)),u[l.w]=d,u[l.h]=h,t.set(u)}(t,e),function(e,t){var n=t.startPoint,o=r(n,e,-t.angle),i=o.originX,s=o.originY;t.setPositionByOrigin(n,i,s),t.setCoords()}(t,e)},adjustOriginToCenter:function(e){var t=e.getPointByOrigin("center","center"),n=e.originX,o=e.originY,i=e.getPointByOrigin(n,o),r=e.left+(t.x-i.x),s=e.top+(t.y-i.y);e.set({hasControls:!0,hasBorders:!0,originX:"center",originY:"center",left:r,top:s}),e.setCoords()}}},"./src/js/imageEditor.js":
|
|
/*!*******************************!*\
|
|
!*** ./src/js/imageEditor.js ***!
|
|
\*******************************/
|
|
/*! no static exports found */function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var o=function(){function e(e,t){for(var n=0;n<t.length;n++){var o=t[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}return function(t,n,o){return n&&e(t.prototype,n),o&&e(t,o),t}}(),i=f(n(/*! tui-code-snippet */"tui-code-snippet")),r=f(n(/*! @/invoker */"./src/js/invoker.js")),s=f(n(/*! @/ui */"./src/js/ui.js")),a=f(n(/*! @/action */"./src/js/action.js")),l=f(n(/*! @/factory/command */"./src/js/factory/command.js")),c=f(n(/*! @/graphics */"./src/js/graphics.js")),u=n(/*! @/helper/selectionModifyHelper */"./src/js/helper/selectionModifyHelper.js"),d=n(/*! @/util */"./src/js/util.js"),h=n(/*! @/consts */"./src/js/consts.js");function f(e){return e&&e.__esModule?e:{default:e}}function p(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var m=i.default.isUndefined,v=i.default.forEach,g=i.default.CustomEvents,y=h.eventNames.MOUSE_DOWN,_=h.eventNames.OBJECT_MOVED,b=h.eventNames.OBJECT_SCALED,j=h.eventNames.OBJECT_ACTIVATED,k=h.eventNames.OBJECT_ROTATED,E=h.eventNames.OBJECT_ADDED,x=h.eventNames.OBJECT_MODIFIED,w=h.eventNames.ADD_TEXT,O=h.eventNames.ADD_OBJECT,M=h.eventNames.TEXT_EDITING,C=h.eventNames.TEXT_CHANGED,S=h.eventNames.ICON_CREATE_RESIZE,P=h.eventNames.ICON_CREATE_END,T=h.eventNames.SELECTION_CLEARED,I=h.eventNames.SELECTION_CREATED,A=h.eventNames.ADD_OBJECT_AFTER,D=function(){function e(t,n){if(function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),n=i.default.extend({includeUI:!1,usageStatistics:!0},n),this.mode=null,this.activeObjectId=null,n.includeUI){var o=n.includeUI;o.usageStatistics=n.usageStatistics,this.ui=new s.default(t,o,this.getActions()),n=this.ui.setUiDefaultSelectionStyle(n)}this._invoker=new r.default,this._graphics=new c.default(this.ui?this.ui.getEditorArea():t,{cssMaxWidth:n.cssMaxWidth,cssMaxHeight:n.cssMaxHeight}),this._handlers={keydown:this._onKeyDown.bind(this),mousedown:this._onMouseDown.bind(this),objectActivated:this._onObjectActivated.bind(this),objectMoved:this._onObjectMoved.bind(this),objectScaled:this._onObjectScaled.bind(this),objectRotated:this._onObjectRotated.bind(this),objectAdded:this._onObjectAdded.bind(this),objectModified:this._onObjectModified.bind(this),createdPath:this._onCreatedPath,addText:this._onAddText.bind(this),addObject:this._onAddObject.bind(this),textEditing:this._onTextEditing.bind(this),textChanged:this._onTextChanged.bind(this),iconCreateResize:this._onIconCreateResize.bind(this),iconCreateEnd:this._onIconCreateEnd.bind(this),selectionCleared:this._selectionCleared.bind(this),selectionCreated:this._selectionCreated.bind(this)},this._attachInvokerEvents(),this._attachGraphicsEvents(),this._attachDomEvents(),this._setSelectionStyle(n.selectionStyle,{applyCropSelectionStyle:n.applyCropSelectionStyle,applyGroupSelectionStyle:n.applyGroupSelectionStyle}),n.usageStatistics&&(0,d.sendHostName)(),this.ui&&(this.ui.initCanvas(),this.setReAction(),this._attachColorPickerInputBoxEvents()),fabric.enableGLFiltering=!1}return o(e,[{key:"_attachColorPickerInputBoxEvents",value:function(){var e=this;this.ui.on(h.eventNames.INPUT_BOX_EDITING_STARTED,(function(){e.isColorPickerInputBoxEditing=!0})),this.ui.on(h.eventNames.INPUT_BOX_EDITING_STOPPED,(function(){e.isColorPickerInputBoxEditing=!1}))}},{key:"_detachColorPickerInputBoxEvents",value:function(){this.ui.off(h.eventNames.INPUT_BOX_EDITING_STARTED),this.ui.off(h.eventNames.INPUT_BOX_EDITING_STOPPED)}},{key:"_setSelectionStyle",value:function(e,t){var n=t.applyCropSelectionStyle,o=t.applyGroupSelectionStyle;e&&this._graphics.setSelectionStyle(e),n&&this._graphics.setCropSelectionStyle(e),o&&this.on("selectionCreated",(function(t){"activeSelection"===t.type&&t.set(e)}))}},{key:"_attachInvokerEvents",value:function(){var e=this,t=h.eventNames.UNDO_STACK_CHANGED,n=h.eventNames.REDO_STACK_CHANGED,o=h.eventNames.EXECUTE_COMMAND,i=h.eventNames.AFTER_UNDO,r=h.eventNames.AFTER_REDO,s=h.eventNames.HAND_STARTED,a=h.eventNames.HAND_STOPPED;if(this._invoker.on(t,this.fire.bind(this,t)),this._invoker.on(n,this.fire.bind(this,n)),this.ui){var l=this._graphics.getCanvas();this._invoker.on(o,(function(t){return e.ui.fire(o,t)})),this._invoker.on(i,(function(t){return e.ui.fire(i,t)})),this._invoker.on(r,(function(t){return e.ui.fire(r,t)})),l.on(s,(function(){return e.ui.fire(s)})),l.on(a,(function(){return e.ui.fire(a)}))}}},{key:"_attachGraphicsEvents",value:function(){var e;this._graphics.on((p(e={},y,this._handlers.mousedown),p(e,_,this._handlers.objectMoved),p(e,b,this._handlers.objectScaled),p(e,k,this._handlers.objectRotated),p(e,j,this._handlers.objectActivated),p(e,E,this._handlers.objectAdded),p(e,x,this._handlers.objectModified),p(e,w,this._handlers.addText),p(e,O,this._handlers.addObject),p(e,M,this._handlers.textEditing),p(e,C,this._handlers.textChanged),p(e,S,this._handlers.iconCreateResize),p(e,P,this._handlers.iconCreateEnd),p(e,T,this._handlers.selectionCleared),p(e,I,this._handlers.selectionCreated),e))}},{key:"_attachDomEvents",value:function(){document.addEventListener("keydown",this._handlers.keydown)}},{key:"_detachDomEvents",value:function(){document.removeEventListener("keydown",this._handlers.keydown)}},{key:"_onKeyDown",value:function(e){var t=e.ctrlKey,n=e.keyCode,o=e.metaKey;(t||o)&&(n===h.keyCodes.C?this._graphics.resetTargetObjectForCopyPaste():n===h.keyCodes.V?(this._graphics.pasteObject(),this.clearRedoStack()):n===h.keyCodes.Z?this.undo().catch((function(){})):n===h.keyCodes.Y&&this.redo().catch((function(){})));var i=n===h.keyCodes.BACKSPACE||n===h.keyCodes.DEL,r=this._graphics.isReadyRemoveObject();!this.isColorPickerInputBoxEditing&&r&&i&&(e.preventDefault(),this.removeActiveObject())}},{key:"removeActiveObject",value:function(){var e=this._graphics.getActiveObjectIdForRemove();this.removeObject(e)}},{key:"_onMouseDown",value:function(e,t){this.fire(h.eventNames.MOUSE_DOWN,e,t)}},{key:"_pushAddObjectCommand",value:function(e){var t=l.default.create(h.commandNames.ADD_OBJECT,this._graphics,e);this._invoker.pushUndoStack(t)}},{key:"_pushModifyObjectCommand",value:function(e){var t=this,n=e.type,o=(0,u.makeSelectionUndoData)(e,(function(e){return(0,u.makeSelectionUndoDatum)(t._graphics.getObjectId(e),e,"activeSelection"===n)})),i=l.default.create(h.commandNames.CHANGE_SELECTION,this._graphics,o);i.execute(this._graphics,o),this._invoker.pushUndoStack(i)}},{key:"_onObjectActivated",value:function(e){this.fire(h.eventNames.OBJECT_ACTIVATED,e)}},{key:"_onObjectMoved",value:function(e){this.fire(h.eventNames.OBJECT_MOVED,e)}},{key:"_onObjectScaled",value:function(e){this.fire(h.eventNames.OBJECT_SCALED,e)}},{key:"_onObjectRotated",value:function(e){this.fire(h.eventNames.OBJECT_ROTATED,e)}},{key:"getDrawingMode",value:function(){return this._graphics.getDrawingMode()}},{key:"clearObjects",value:function(){return this.execute(h.commandNames.CLEAR_OBJECTS)}},{key:"deactivateAll",value:function(){this._graphics.deactivateAll(),this._graphics.renderAll()}},{key:"discardSelection",value:function(){this._graphics.discardSelection()}},{key:"changeSelectableAll",value:function(e){this._graphics.changeSelectableAll(e)}},{key:"_initHistory",value:function(){this.ui&&this.ui.initHistory()}},{key:"_clearHistory",value:function(){this.ui&&this.ui.clearHistory()}},{key:"execute",value:function(e){for(var t,n=arguments.length,o=Array(n>1?n-1:0),i=1;i<n;i++)o[i-1]=arguments[i];var r=[this._graphics].concat(o);return(t=this._invoker).execute.apply(t,[e].concat(r))}},{key:"executeSilent",value:function(e){for(var t,n=arguments.length,o=Array(n>1?n-1:0),i=1;i<n;i++)o[i-1]=arguments[i];var r=[this._graphics].concat(o);return(t=this._invoker).executeSilent.apply(t,[e].concat(r))}},{key:"undo",value:function(){for(var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1,n=d.Promise.resolve(),o=0;o<t;o+=1)n=n.then((function(){return e._invoker.undo()}));return n}},{key:"redo",value:function(){for(var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1,n=d.Promise.resolve(),o=0;o<t;o+=1)n=n.then((function(){return e._invoker.redo()}));return n}},{key:"zoom",value:function(e){var t=e.x,n=e.y,o=e.zoomLevel;this._graphics.zoom({x:t,y:n},o)}},{key:"resetZoom",value:function(){this._graphics.resetZoom()}},{key:"loadImageFromFile",value:function(e,t){if(!e)return d.Promise.reject(h.rejectMessages.invalidParameters);var n=URL.createObjectURL(e);return t=t||e.name,this.loadImageFromURL(n,t).then((function(t){return URL.revokeObjectURL(e),t}))}},{key:"loadImageFromURL",value:function(e,t){return t&&e?this.execute(h.commandNames.LOAD_IMAGE,t,e):d.Promise.reject(h.rejectMessages.invalidParameters)}},{key:"addImageObject",value:function(e){return e?this.execute(h.commandNames.ADD_IMAGE_OBJECT,e):d.Promise.reject(h.rejectMessages.invalidParameters)}},{key:"startDrawingMode",value:function(e,t){return this._graphics.startDrawingMode(e,t)}},{key:"stopDrawingMode",value:function(){this._graphics.stopDrawingMode()}},{key:"crop",value:function(e){var t=this._graphics.getCroppedImageData(e);return t?this.loadImageFromURL(t.url,t.imageName):d.Promise.reject(h.rejectMessages.invalidParameters)}},{key:"getCropzoneRect",value:function(){return this._graphics.getCropzoneRect()}},{key:"setCropzoneRect",value:function(e){this._graphics.setCropzoneRect(e)}},{key:"_flip",value:function(e){return this.execute(h.commandNames.FLIP_IMAGE,e)}},{key:"flipX",value:function(){return this._flip("flipX")}},{key:"flipY",value:function(){return this._flip("flipY")}},{key:"resetFlip",value:function(){return this._flip("reset")}},{key:"_rotate",value:function(e,t,n){return n?this.executeSilent(h.commandNames.ROTATE_IMAGE,e,t):this.execute(h.commandNames.ROTATE_IMAGE,e,t)}},{key:"rotate",value:function(e,t){return this._rotate("rotate",e,t)}},{key:"setAngle",value:function(e,t){return this._rotate("setAngle",e,t)}},{key:"setBrush",value:function(e){this._graphics.setBrush(e)}},{key:"setDrawingShape",value:function(e,t){this._graphics.setDrawingShape(e,t)}},{key:"setDrawingIcon",value:function(e,t){this._graphics.setIconStyle(e,t)}},{key:"addShape",value:function(e,t){return t=t||{},this._setPositions(t),this.execute(h.commandNames.ADD_SHAPE,e,t)}},{key:"changeShape",value:function(e,t,n){return this[n?"executeSilent":"execute"](h.commandNames.CHANGE_SHAPE,e,t)}},{key:"addText",value:function(e,t){return e=e||"",t=t||{},this.execute(h.commandNames.ADD_TEXT,e,t)}},{key:"changeText",value:function(e,t){return t=t||"",this.execute(h.commandNames.CHANGE_TEXT,e,t)}},{key:"changeTextStyle",value:function(e,t,n){return this[n?"executeSilent":"execute"](h.commandNames.CHANGE_TEXT_STYLE,e,t)}},{key:"_changeActivateMode",value:function(e){"ICON"!==e&&this.getDrawingMode()!==e&&this.startDrawingMode(e)}},{key:"_onTextChanged",value:function(e){this.fire(h.eventNames.TEXT_CHANGED,e)}},{key:"_onIconCreateResize",value:function(e){this.fire(h.eventNames.ICON_CREATE_RESIZE,e)}},{key:"_onIconCreateEnd",value:function(e){this.fire(h.eventNames.ICON_CREATE_END,e)}},{key:"_onTextEditing",value:function(){this.fire(h.eventNames.TEXT_EDITING)}},{key:"_onAddText",value:function(e){this.fire(h.eventNames.ADD_TEXT,{originPosition:e.originPosition,clientPosition:e.clientPosition})}},{key:"_onAddObject",value:function(e){var t=this._graphics.getObject(e.id);this._invoker.fire(h.eventNames.EXECUTE_COMMAND,(0,d.getObjectType)(t.type)),this._pushAddObjectCommand(t)}},{key:"_onObjectAdded",value:function(e){this.fire(E,e),this.fire(A,e)}},{key:"_onObjectModified",value:function(e){e.type!==h.OBJ_TYPE.CROPZONE&&(this._invoker.fire(h.eventNames.EXECUTE_COMMAND,(0,d.getObjectType)(e.type)),this._pushModifyObjectCommand(e))}},{key:"_selectionCleared",value:function(){this.fire(T)}},{key:"_selectionCreated",value:function(e){this.fire(I,e)}},{key:"registerIcons",value:function(e){this._graphics.registerPaths(e)}},{key:"changeCursor",value:function(e){this._graphics.changeCursor(e)}},{key:"addIcon",value:function(e,t){return t=t||{},this._setPositions(t),this.execute(h.commandNames.ADD_ICON,e,t)}},{key:"changeIconColor",value:function(e,t){return this.execute(h.commandNames.CHANGE_ICON_COLOR,e,t)}},{key:"removeObject",value:function(e){var t=this._graphics.getObject(e).type;return this.execute(h.commandNames.REMOVE_OBJECT,e,(0,d.getObjectType)(t))}},{key:"hasFilter",value:function(e){return this._graphics.hasFilter(e)}},{key:"removeFilter",value:function(e){return this.execute(h.commandNames.REMOVE_FILTER,e)}},{key:"applyFilter",value:function(e,t,n){return this[n?"executeSilent":"execute"](h.commandNames.APPLY_FILTER,e,t)}},{key:"toDataURL",value:function(e){return this._graphics.toDataURL(e)}},{key:"getImageName",value:function(){return this._graphics.getImageName()}},{key:"clearUndoStack",value:function(){this._invoker.clearUndoStack()}},{key:"clearRedoStack",value:function(){this._invoker.clearRedoStack()}},{key:"isEmptyUndoStack",value:function(){return this._invoker.isEmptyUndoStack()}},{key:"isEmptyRedoStack",value:function(){return this._invoker.isEmptyRedoStack()}},{key:"resizeCanvasDimension",value:function(e){return e?this.execute(h.commandNames.RESIZE_CANVAS_DIMENSION,e):d.Promise.reject(h.rejectMessages.invalidParameters)}},{key:"destroy",value:function(){var e=this;this.stopDrawingMode(),this._detachDomEvents(),this._graphics.destroy(),this._graphics=null,this.ui&&(this._detachColorPickerInputBoxEvents(),this.ui.destroy()),v(this,(function(t,n){e[n]=null}),this)}},{key:"_setPositions",value:function(e){var t=this._graphics.getCenter();m(e.left)&&(e.left=t.left),m(e.top)&&(e.top=t.top)}},{key:"setObjectProperties",value:function(e,t){return this.execute(h.commandNames.SET_OBJECT_PROPERTIES,e,t)}},{key:"setObjectPropertiesQuietly",value:function(e,t){this._graphics.setObjectProperties(e,t)}},{key:"getObjectProperties",value:function(e,t){return this._graphics.getObject(e)?this._graphics.getObjectProperties(e,t):null}},{key:"getCanvasSize",value:function(){return this._graphics.getCanvasSize()}},{key:"getObjectPosition",value:function(e,t,n){return this._graphics.getObjectPosition(e,t,n)}},{key:"setObjectPosition",value:function(e,t){return this.execute(h.commandNames.SET_OBJECT_POSITION,e,t)}}]),e}();a.default.mixin(D),g.mixin(D),t.default=D},"./src/js/interface/command.js":
|
|
/*!*************************************!*\
|
|
!*** ./src/js/interface/command.js ***!
|
|
\*************************************/
|
|
/*! no static exports found */function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var o=function(){function e(e,t){for(var n=0;n<t.length;n++){var o=t[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}return function(t,n,o){return n&&e(t.prototype,n),o&&e(t,o),t}}(),i=s(n(/*! tui-code-snippet */"tui-code-snippet")),r=s(n(/*! @/factory/errorMessage */"./src/js/factory/errorMessage.js"));function s(e){return e&&e.__esModule?e:{default:e}}var a=r.default.create,l=r.default.types,c=function(){function e(t,n){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.name=t.name,this.args=n,this.execute=t.execute,this.undo=t.undo,this.executeCallback=t.executeCallback||null,this.undoCallback=t.undoCallback||null,this.undoData={}}return o(e,[{key:"execute",value:function(){throw new Error(a(l.UN_IMPLEMENTATION,"execute"))}},{key:"undo",value:function(){throw new Error(a(l.UN_IMPLEMENTATION,"undo"))}},{key:"setUndoData",value:function(e,t,n){return t&&(e=t),n?t||(t=e):(i.default.extend(this.undoData,e),t=null),t}},{key:"setExecuteCallback",value:function(e){return this.executeCallback=e,this}},{key:"setUndoCallback",value:function(e){return this.undoCallback=e,this}},{key:"isRedo",get:function(){return Object.keys(this.undoData).length>0}}]),e}();t.default=c},"./src/js/interface/component.js":
|
|
/*!***************************************!*\
|
|
!*** ./src/js/interface/component.js ***!
|
|
\***************************************/
|
|
/*! no static exports found */function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var o=function(){function e(e,t){for(var n=0;n<t.length;n++){var o=t[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}return function(t,n,o){return n&&e(t.prototype,n),o&&e(t,o),t}}();var i=function(){function e(t,n){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.name=t,this.graphics=n}return o(e,[{key:"fire",value:function(){for(var e=this.graphics,t=arguments.length,n=Array(t),o=0;o<t;o++)n[o]=arguments[o];return this.graphics.fire.apply(e,n)}},{key:"setCanvasImage",value:function(e,t){this.graphics.setCanvasImage(e,t)}},{key:"getCanvasElement",value:function(){return this.graphics.getCanvasElement()}},{key:"getCanvas",value:function(){return this.graphics.getCanvas()}},{key:"getCanvasImage",value:function(){return this.graphics.getCanvasImage()}},{key:"getImageName",value:function(){return this.graphics.getImageName()}},{key:"getEditor",value:function(){return this.graphics.getEditor()}},{key:"getName",value:function(){return this.name}},{key:"setImageProperties",value:function(e,t){this.graphics.setImageProperties(e,t)}},{key:"setCanvasCssDimension",value:function(e){this.graphics.setCanvasCssDimension(e)}},{key:"setCanvasBackstoreDimension",value:function(e){this.graphics.setCanvasBackstoreDimension(e)}},{key:"adjustCanvasDimension",value:function(){this.graphics.adjustCanvasDimension()}}]),e}();t.default=i},"./src/js/interface/drawingMode.js":
|
|
/*!*****************************************!*\
|
|
!*** ./src/js/interface/drawingMode.js ***!
|
|
\*****************************************/
|
|
/*! no static exports found */function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var o,i=function(){function e(e,t){for(var n=0;n<t.length;n++){var o=t[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}return function(t,n,o){return n&&e(t.prototype,n),o&&e(t,o),t}}(),r=n(/*! @/factory/errorMessage */"./src/js/factory/errorMessage.js"),s=(o=r)&&o.__esModule?o:{default:o};var a=s.default.create,l=s.default.types,c=function(){function e(t){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.name=t}return i(e,[{key:"getName",value:function(){return this.name}},{key:"start",value:function(){throw new Error(a(l.UN_IMPLEMENTATION,"start"))}},{key:"end",value:function(){throw new Error(a(l.UN_IMPLEMENTATION,"stop"))}}]),e}();t.default=c},"./src/js/invoker.js":
|
|
/*!***************************!*\
|
|
!*** ./src/js/invoker.js ***!
|
|
\***************************/
|
|
/*! no static exports found */function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var o=function(){function e(e,t){for(var n=0;n<t.length;n++){var o=t[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}return function(t,n,o){return n&&e(t.prototype,n),o&&e(t,o),t}}(),i=l(n(/*! tui-code-snippet */"tui-code-snippet")),r=l(n(/*! @/factory/command */"./src/js/factory/command.js")),s=n(/*! @/util */"./src/js/util.js"),a=n(/*! @/consts */"./src/js/consts.js");function l(e){return e&&e.__esModule?e:{default:e}}var c=i.default.isFunction,u=i.default.isString,d=i.default.CustomEvents,h=function(){function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this._undoStack=[],this._redoStack=[],this._isLocked=!1,this._isSilent=!1}return o(e,[{key:"_invokeExecution",value:function(e){var t=this,n=arguments.length>1&&void 0!==arguments[1]&&arguments[1];this.lock();var o=e.args;return o||(o=[]),e.execute.apply(e,o).then((function(o){return t._isSilent||(t.pushUndoStack(e),t.fire(n?a.eventNames.AFTER_REDO:a.eventNames.EXECUTE_COMMAND,e)),t.unlock(),c(e.executeCallback)&&e.executeCallback(o),o})).catch((function(e){return t.unlock(),s.Promise.reject(e)}))}},{key:"_invokeUndo",value:function(e){var t=this;this.lock();var n=e.args;return n||(n=[]),e.undo.apply(e,n).then((function(n){return t.pushRedoStack(e),t.fire(a.eventNames.AFTER_UNDO,e),t.unlock(),c(e.undoCallback)&&e.undoCallback(n),n})).catch((function(e){return t.unlock(),s.Promise.reject(e)}))}},{key:"_fireRedoStackChanged",value:function(){this.fire(a.eventNames.REDO_STACK_CHANGED,this._redoStack.length)}},{key:"_fireUndoStackChanged",value:function(){this.fire(a.eventNames.UNDO_STACK_CHANGED,this._undoStack.length)}},{key:"lock",value:function(){this._isLocked=!0}},{key:"unlock",value:function(){this._isLocked=!1}},{key:"executeSilent",value:function(){var e=this;this._isSilent=!0;for(var t=arguments.length,n=Array(t),o=0;o<t;o++)n[o]=arguments[o];return this.execute.apply(this,n.concat([this._isSilent])).then((function(){e._isSilent=!1}))}},{key:"execute",value:function(){var e=this;if(this._isLocked)return s.Promise.reject(a.rejectMessages.isLock);for(var t=arguments.length,n=Array(t),o=0;o<t;o++)n[o]=arguments[o];var i=n[0];return u(i)&&(i=r.default.create.apply(r.default,n)),this._invokeExecution(i).then((function(t){return e.clearRedoStack(),t}))}},{key:"undo",value:function(){var e=this._undoStack.pop(),t=void 0,n="";return e&&this._isLocked&&(this.pushUndoStack(e,!0),e=null),e?(this.isEmptyUndoStack()&&this._fireUndoStackChanged(),t=this._invokeUndo(e)):(n=a.rejectMessages.undo,this._isLocked&&(n=n+" Because "+a.rejectMessages.isLock),t=s.Promise.reject(n)),t}},{key:"redo",value:function(){var e=this._redoStack.pop(),t=void 0,n="";return e&&this._isLocked&&(this.pushRedoStack(e,!0),e=null),e?(this.isEmptyRedoStack()&&this._fireRedoStackChanged(),t=this._invokeExecution(e,!0)):(n=a.rejectMessages.redo,this._isLocked&&(n=n+" Because "+a.rejectMessages.isLock),t=s.Promise.reject(n)),t}},{key:"pushUndoStack",value:function(e,t){this._undoStack.push(e),t||this._fireUndoStackChanged()}},{key:"pushRedoStack",value:function(e,t){this._redoStack.push(e),t||this._fireRedoStackChanged()}},{key:"isEmptyRedoStack",value:function(){return 0===this._redoStack.length}},{key:"isEmptyUndoStack",value:function(){return 0===this._undoStack.length}},{key:"clearUndoStack",value:function(){this.isEmptyUndoStack()||(this._undoStack=[],this._fireUndoStackChanged())}},{key:"clearRedoStack",value:function(){this.isEmptyRedoStack()||(this._redoStack=[],this._fireRedoStackChanged())}}]),e}();d.mixin(h),t.default=h},"./src/js/polyfill.js":
|
|
/*!****************************!*\
|
|
!*** ./src/js/polyfill.js ***!
|
|
\****************************/
|
|
/*! no static exports found */function(e,t,n){"use strict";Element.prototype.matches=Element.prototype.msMatchesSelector||Element.prototype.webkitMatchesSelector,Element.prototype.closest||(Element.prototype.closest=function(e){var t=this;if(!document.documentElement.contains(t))return null;do{if(t.matches(e))return t;t=t.parentElement||t.parentNode}while(null!==t&&1===t.nodeType);return null})
|
|
/*! @source http://purl.eligrey.com/github/classList.js/blob/master/classList.js */,"document"in window.self&&((!("classList"in document.createElement("_"))||document.createElementNS&&!("classList"in document.createElementNS("http://www.w3.org/2000/svg","g")))&&function(e){if("Element"in e){var t="classList",n=e.Element.prototype,o=Object,i=String.prototype.trim||function(){return this.replace(/^\s+|\s+$/g,"")},r=Array.prototype.indexOf||function(e){for(var t=0,n=this.length;t<n;t++)if(t in this&&this[t]===e)return t;return-1},s=function(e,t){this.name=e,this.code=DOMException[e],this.message=t},a=function(e,t){if(""===t)throw new s("SYNTAX_ERR","An invalid or illegal string was specified");if(/\s/.test(t))throw new s("INVALID_CHARACTER_ERR","String contains an invalid character");return r.call(e,t)},l=function(e){for(var t=i.call(e.getAttribute("class")||""),n=t?t.split(/\s+/):[],o=0,r=n.length;o<r;o++)this.push(n[o]);this._updateClassName=function(){e.setAttribute("class",this.toString())}},c=l.prototype=[],u=function(){return new l(this)};if(s.prototype=Error.prototype,c.item=function(e){return this[e]||null},c.contains=function(e){return-1!==a(this,e+="")},c.add=function(){var e,t=arguments,n=0,o=t.length,i=!1;do{e=t[n]+"",-1===a(this,e)&&(this.push(e),i=!0)}while(++n<o);i&&this._updateClassName()},c.remove=function(){var e,t,n=arguments,o=0,i=n.length,r=!1;do{for(e=n[o]+"",t=a(this,e);-1!==t;)this.splice(t,1),r=!0,t=a(this,e)}while(++o<i);r&&this._updateClassName()},c.toggle=function(e,t){e+="";var n=this.contains(e),o=n?!0!==t&&"remove":!1!==t&&"add";return o&&this[o](e),!0===t||!1===t?t:!n},c.toString=function(){return this.join(" ")},o.defineProperty){var d={get:u,enumerable:!0,configurable:!0};try{o.defineProperty(n,t,d)}catch(e){void 0!==e.number&&-2146823252!==e.number||(d.enumerable=!1,o.defineProperty(n,t,d))}}else o.prototype.__defineGetter__&&n.__defineGetter__(t,u)}}(window.self),function(){var e=document.createElement("_");if(e.classList.add("c1","c2"),!e.classList.contains("c2")){var t=function(e){var t=DOMTokenList.prototype[e];DOMTokenList.prototype[e]=function(e){var n,o=arguments.length;for(n=0;n<o;n++)e=arguments[n],t.call(this,e)}};t("add"),t("remove")}if(e.classList.toggle("c3",!1),e.classList.contains("c3")){var n=DOMTokenList.prototype.toggle;DOMTokenList.prototype.toggle=function(e,t){return 1 in arguments&&!this.contains(e)==!t?t:n.call(this,e)}}e=null}())
|
|
/*!
|
|
* @copyright Copyright (c) 2017 IcoMoon.io
|
|
* @license Licensed under MIT license
|
|
* See https://github.com/Keyamoon/svgxuse
|
|
* @version 1.2.6
|
|
*/,function(){if("undefined"!=typeof window&&window.addEventListener){var e,t,n,o=Object.create(null),i=function(){clearTimeout(t),t=setTimeout(e,100)},r=function(){},s=function(e){function t(e){var t;return void 0!==e.protocol?t=e:(t=document.createElement("a")).href=e,t.protocol.replace(/:/g,"")+t.host}var n,o,i;return window.XMLHttpRequest&&(n=new XMLHttpRequest,o=t(location),i=t(e),n=void 0===n.withCredentials&&""!==i&&i!==o?XDomainRequest||void 0:XMLHttpRequest),n},a="http://www.w3.org/1999/xlink";e=function(){var e,t,n,l,c,u,d,h,f,p,m=0;function v(){var e;0===(m-=1)&&(r(),window.addEventListener("resize",i,!1),window.addEventListener("orientationchange",i,!1),window.MutationObserver?((e=new MutationObserver(i)).observe(document.documentElement,{childList:!0,subtree:!0,attributes:!0}),r=function(){try{e.disconnect(),window.removeEventListener("resize",i,!1),window.removeEventListener("orientationchange",i,!1)}catch(e){}}):(document.documentElement.addEventListener("DOMSubtreeModified",i,!1),r=function(){document.documentElement.removeEventListener("DOMSubtreeModified",i,!1),window.removeEventListener("resize",i,!1),window.removeEventListener("orientationchange",i,!1)}))}function g(e){return function(){!0!==o[e.base]&&(e.useEl.setAttributeNS(a,"xlink:href","#"+e.hash),e.useEl.hasAttribute("href")&&e.useEl.setAttribute("href","#"+e.hash))}}function y(e){return function(){var t,n=document.body,o=document.createElement("x");e.onload=null,o.innerHTML=e.responseText,(t=o.getElementsByTagName("svg")[0])&&(t.setAttribute("aria-hidden","true"),t.style.position="absolute",t.style.width=0,t.style.height=0,t.style.overflow="hidden",n.insertBefore(t,n.firstChild)),v()}}function _(e){return function(){e.onerror=null,e.ontimeout=null,v()}}for(r(),f=document.getElementsByTagName("use"),c=0;c<f.length;c+=1){try{t=f[c].getBoundingClientRect()}catch(e){t=!1}e=(h=(l=f[c].getAttribute("href")||f[c].getAttributeNS(a,"href")||f[c].getAttribute("xlink:href"))&&l.split?l.split("#"):["",""])[0],n=h[1],u=t&&0===t.left&&0===t.right&&0===t.top&&0===t.bottom,t&&0===t.width&&0===t.height&&!u?(f[c].hasAttribute("href")&&f[c].setAttributeNS(a,"xlink:href",l),e.length&&(!0!==(p=o[e])&&setTimeout(g({useEl:f[c],base:e,hash:n}),0),void 0===p&&void 0!==(d=s(e))&&(p=new d,o[e]=p,p.onload=y(p),p.onerror=_(p),p.ontimeout=_(p),p.open("GET",e),p.send(),m+=1))):u?e.length&&o[e]&&setTimeout(g({useEl:f[c],base:e,hash:n}),0):void 0===o[e]?o[e]=!0:o[e].onload&&(o[e].abort(),delete o[e].onload,o[e]=!0)}f="",m+=1,v()},n=function(){window.removeEventListener("load",n,!1),t=setTimeout(e,0)},"complete"!==document.readyState?window.addEventListener("load",n,!1):n()}}()},"./src/js/ui.js":
|
|
/*!**********************!*\
|
|
!*** ./src/js/ui.js ***!
|
|
\**********************/
|
|
/*! no static exports found */function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var o=function(){function e(e,t){for(var n=0;n<t.length;n++){var o=t[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}return function(t,n,o){return n&&e(t.prototype,n),o&&e(t,o),t}}(),i=j(n(/*! tui-code-snippet */"tui-code-snippet")),r=n(/*! @/util */"./src/js/util.js"),s=n(/*! @/consts */"./src/js/consts.js"),a=j(n(/*! @/ui/template/mainContainer */"./src/js/ui/template/mainContainer.js")),l=j(n(/*! @/ui/template/controls */"./src/js/ui/template/controls.js")),c=j(n(/*! @/ui/theme/theme */"./src/js/ui/theme/theme.js")),u=j(n(/*! @/ui/shape */"./src/js/ui/shape.js")),d=j(n(/*! @/ui/crop */"./src/js/ui/crop.js")),h=j(n(/*! @/ui/flip */"./src/js/ui/flip.js")),f=j(n(/*! @/ui/rotate */"./src/js/ui/rotate.js")),p=j(n(/*! @/ui/text */"./src/js/ui/text.js")),m=j(n(/*! @/ui/mask */"./src/js/ui/mask.js")),v=j(n(/*! @/ui/icon */"./src/js/ui/icon.js")),g=j(n(/*! @/ui/draw */"./src/js/ui/draw.js")),y=j(n(/*! @/ui/filter */"./src/js/ui/filter.js")),_=j(n(/*! @/ui/history */"./src/js/ui/history.js")),b=j(n(/*! @/ui/locale/locale */"./src/js/ui/locale/locale.js"));function j(e){return e&&e.__esModule?e:{default:e}}var k={Shape:u.default,Crop:d.default,Flip:h.default,Rotate:f.default,Text:p.default,Mask:m.default,Icon:v.default,Draw:g.default,Filter:y.default},E=i.default.CustomEvents,x="1300",w="on",O="zoomIn",M="hand",C=function(){function e(t,n,o){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.options=this._initializeOption(n),this._actions=o,this.submenu=!1,this.imageSize={},this.uiSize={},this._locale=new b.default(this.options.locale),this.theme=new c.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(t),this._setUiSize(),this._initMenuEvent=!1,this._makeSubMenu(),this._attachHistoryEvent(),this._attachZoomEvent()}return o(e,[{key:"destroy",value:function(){this._removeUiEvent(),this._destroyAllMenu(),this._selectedElement.innerHTML="",(0,r.assignmentForDestroy)(this)}},{key:"setUiDefaultSelectionStyle",value:function(e){return i.default.extend({applyCropSelectionStyle:!0,applyGroupSelectionStyle:!0,selectionStyle:{cornerStyle:"circle",cornerSize:16,cornerColor:"#fff",cornerStrokeColor:"#fff",transparentCorners:!1,lineWidth:2,borderColor:"#fff"}},e)}},{key:"resizeEditor",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.uiSize,n=e.imageSize,o=void 0===n?this.imageSize:n;o!==this.imageSize&&(this.imageSize=o),t&&this._setUiSize(t);var i=this._getCanvasMaxDimension(),r=i.width,s=i.height,a=this._editorElement.style,l=this.options.menuBarPosition;a.height=s+"px",a.width=r+"px",this._setEditorPosition(l),this._editorElementWrap.style.bottom="0px",this._editorElementWrap.style.top="0px",this._editorElementWrap.style.left="0px",this._editorElementWrap.style.width="100%";var c=this._selectedElement.classList;"top"===l&&this._selectedElement.offsetWidth<x?c.add("tui-image-editor-top-optimization"):c.remove("tui-image-editor-top-optimization")}},{key:"toggleZoomButtonStatus",value:function(e){this._buttonElements[e].classList.toggle(w),e===O?this._buttonElements[M].classList.remove(w):this._buttonElements[O].classList.remove(w)}},{key:"offZoomInButtonStatus",value:function(){this._buttonElements[O].classList.remove(w)}},{key:"changeHandButtonStatus",value:function(e){this._buttonElements[M].classList[e?"add":"remove"](w)}},{key:"changeHelpButtonEnabled",value:function(e,t){this._buttonElements[e].classList[t?"add":"remove"]("enabled")}},{key:"_initializeOption",value:function(e){return i.default.extend({loadImage:{path:"",name:""},locale:{},menuIconPath:"",menu:["crop","flip","rotate","draw","shape","icon","text","mask","filter"],initMenu:"",uiSize:{width:"100%",height:"100%"},menuBarPosition:"bottom"},e)}},{key:"_setUiSize",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.options.uiSize,t=this._selectedElement.style;t.width=e.width,t.height=e.height}},{key:"_makeSubMenu",value:function(){var e=this;i.default.forEach(this.options.menu,(function(t){var n=k[t.replace(/^[a-z]/,(function(e){return e.toUpperCase()}))];e._makeMenuElement(t),e._buttonElements[t]=e._menuBarElement.querySelector(".tie-btn-"+t),e[t]=new n(e._subMenuElement,{locale:e._locale,makeSvgIcon:e.theme.makeMenSvgIconSet.bind(e.theme),menuBarPosition:e.options.menuBarPosition,usageStatistics:e.options.usageStatistics})}))}},{key:"_attachHistoryEvent",value:function(){this.on(s.eventNames.EXECUTE_COMMAND,this._addHistory.bind(this)),this.on(s.eventNames.AFTER_UNDO,this._selectPrevHistory.bind(this)),this.on(s.eventNames.AFTER_REDO,this._selectNextHistory.bind(this))}},{key:"_attachZoomEvent",value:function(){var e=this;this.on(s.eventNames.HAND_STARTED,(function(){e.offZoomInButtonStatus(),e.changeHandButtonStatus(!0)})),this.on(s.eventNames.HAND_STOPPED,(function(){return e.changeHandButtonStatus(!1)}))}},{key:"_makeUiElement",value:function(e){var t=void 0;window.snippet=i.default,t=e.nodeType?e:document.querySelector(e);var n=(0,r.getSelector)(t);t.classList.add("tui-image-editor-container"),t.innerHTML=(0,l.default)({locale:this._locale,biImage:this.theme.getStyle("common.bi"),loadButtonStyle:this.theme.getStyle("loadButton"),downloadButtonStyle:this.theme.getStyle("downloadButton"),menuBarPosition:this.options.menuBarPosition})+(0,a.default)({locale:this._locale,biImage:this.theme.getStyle("common.bi"),commonStyle:this.theme.getStyle("common"),headerStyle:this.theme.getStyle("header"),loadButtonStyle:this.theme.getStyle("loadButton"),downloadButtonStyle:this.theme.getStyle("downloadButton"),submenuStyle:this.theme.getStyle("submenu")}),this._selectedElement=t,this._selectedElement.classList.add(this.options.menuBarPosition),this._mainElement=n(".tui-image-editor-main"),this._editorElementWrap=n(".tui-image-editor-wrap"),this._editorElement=n(".tui-image-editor"),this._helpMenuBarElement=n(".tui-image-editor-help-menu"),this._menuBarElement=n(".tui-image-editor-menu"),this._subMenuElement=n(".tui-image-editor-submenu"),this._buttonElements={download:this._selectedElement.querySelectorAll(".tui-image-editor-download-btn"),load:this._selectedElement.querySelectorAll(".tui-image-editor-load-btn")},this._addHelpMenus(),this._historyMenu=new _.default(this._buttonElements.history,{locale:this._locale,makeSvgIcon:this.theme.makeMenSvgIconSet.bind(this.theme)}),this._activateZoomMenus()}},{key:"_activateZoomMenus",value:function(){var e=this;i.default.forEach(s.ZOOM_HELP_MENUS,(function(t){e.changeHelpButtonEnabled(t,!0)}))}},{key:"_makeHelpMenuWithPartition",value:function(){return[].concat(s.ZOOM_HELP_MENUS,[""],s.COMMAND_HELP_MENUS,[""],s.DELETE_HELP_MENUS)}},{key:"_addHelpMenus",value:function(){var e=this,t=this._makeHelpMenuWithPartition();i.default.forEach(t,(function(t){t?(e._makeMenuElement(t,["normal","disabled","hover"],"help"),e._buttonElements[t]=e._helpMenuBarElement.querySelector(".tie-btn-"+t)):e._makeMenuPartitionElement()}))}},{key:"_makeMenuPartitionElement",value:function(){var e=document.createElement("li"),t=document.createElement("div");e.className=(0,r.cls)("item"),t.className=(0,r.cls)("icpartition"),e.appendChild(t),this._helpMenuBarElement.appendChild(e)}},{key:"_makeMenuElement",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:["normal","active","hover"],n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"normal",o=document.createElement("li"),i=this.theme.makeMenSvgIconSet(t,e);this._addTooltipAttribute(o,e),o.className="tie-btn-"+e+" "+(0,r.cls)("item")+" "+n,o.innerHTML=i,"normal"===n?this._menuBarElement.appendChild(o):this._helpMenuBarElement.appendChild(o)}},{key:"_addHelpActionEvent",value:function(){var e=this;i.default.forEach(s.HELP_MENUS,(function(t){e.eventHandler[t]=function(n){return e._actions.main[t](n)},e._buttonElements[t].addEventListener("click",e.eventHandler[t])}))}},{key:"_removeHelpActionEvent",value:function(){var e=this;i.default.forEach(s.HELP_MENUS,(function(t){e._buttonElements[t].removeEventListener("click",e.eventHandler[t])}))}},{key:"_addHistory",value:function(e){if(!(0,r.isSilentCommand)(e)){var t="string"==typeof e?{name:e}:(0,r.getHistoryTitle)(e);this._historyMenu.add(t)}}},{key:"initHistory",value:function(){this._historyMenu.init()}},{key:"clearHistory",value:function(){this._historyMenu.clear()}},{key:"_selectPrevHistory",value:function(){this._historyMenu.prev()}},{key:"_selectNextHistory",value:function(){this._historyMenu.next()}},{key:"toggleHistoryMenu",value:function(e){e.target.closest(".tie-panel-history")||this._buttonElements.history.classList.toggle("opened")}},{key:"_addTooltipAttribute",value:function(e,t){e.setAttribute("tooltip-content",this._locale.localize(t.replace(/^[a-z]/g,(function(e){return e.toUpperCase()}))))}},{key:"_addDownloadEvent",value:function(){var e=this;this.eventHandler.download=function(){return e._actions.main.download()},i.default.forEach(this._buttonElements.download,(function(t){t.addEventListener("click",e.eventHandler.download)}))}},{key:"_removeDownloadEvent",value:function(){var e=this;i.default.forEach(this._buttonElements.download,(function(t){t.removeEventListener("click",e.eventHandler.download)}))}},{key:"_addLoadEvent",value:function(){var e=this;this.eventHandler.loadImage=function(t){return e._actions.main.load(t.target.files[0])},i.default.forEach(this._buttonElements.load,(function(t){t.addEventListener("change",e.eventHandler.loadImage)}))}},{key:"_removeLoadEvent",value:function(){var e=this;i.default.forEach(this._buttonElements.load,(function(t){t.removeEventListener("change",e.eventHandler.loadImage)}))}},{key:"_addMainMenuEvent",value:function(e){var t=this;this.eventHandler[e]=function(){return t.changeMenu(e)},this._buttonElements[e].addEventListener("click",this.eventHandler[e])}},{key:"_addSubMenuEvent",value:function(e){var t=this;this[e].addEvent(this._actions[e]),this[e].on(s.eventNames.INPUT_BOX_EDITING_STARTED,(function(){return t.fire(s.eventNames.INPUT_BOX_EDITING_STARTED)})),this[e].on(s.eventNames.INPUT_BOX_EDITING_STOPPED,(function(){return t.fire(s.eventNames.INPUT_BOX_EDITING_STOPPED)}))}},{key:"_addMenuEvent",value:function(){var e=this;i.default.forEach(this.options.menu,(function(t){e._addMainMenuEvent(t),e._addSubMenuEvent(t)}))}},{key:"_removeMainMenuEvent",value:function(){var e=this;i.default.forEach(this.options.menu,(function(t){e._buttonElements[t].removeEventListener("click",e.eventHandler[t]),e[t].off(s.eventNames.INPUT_BOX_EDITING_STARTED),e[t].off(s.eventNames.INPUT_BOX_EDITING_STOPPED)}))}},{key:"getEditorArea",value:function(){return this._editorElement}},{key:"activeMenuEvent",value:function(){this._initMenuEvent||(this._addHelpActionEvent(),this._addDownloadEvent(),this._addMenuEvent(),this._initMenu(),this._historyMenu.addEvent(this._actions.history),this._initMenuEvent=!0)}},{key:"_removeUiEvent",value:function(){this._removeHelpActionEvent(),this._removeDownloadEvent(),this._removeLoadEvent(),this._removeMainMenuEvent(),this._historyMenu.removeEvent()}},{key:"_destroyAllMenu",value:function(){var e=this;i.default.forEach(this.options.menu,(function(t){e[t].destroy()})),this._historyMenu.destroy()}},{key:"initCanvas",value:function(){var e=this,t=this._getLoadImage();t.path&&this._actions.main.initLoadImage(t.path,t.name).then((function(){e.activeMenuEvent()})),this._addLoadEvent();var n=document.createElement("div");n.className=(0,r.cls)("grid-visual");n.innerHTML='<table>\n <tr><td class="dot left-top"></td><td></td><td class="dot right-top"></td></tr>\n <tr><td></td><td></td><td></td></tr>\n <tr><td class="dot left-bottom"></td><td></td><td class="dot right-bottom"></td></tr>\n </table>',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){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],n=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];this._submenuChangeTransection||(this._submenuChangeTransection=!0,this._changeMenu(e,t,n),this._submenuChangeTransection=!1)}},{key:"_changeMenu",value:function(e,t,n){this.submenu&&(this._buttonElements[this.submenu].classList.remove("active"),this._mainElement.classList.remove("tui-image-editor-menu-"+this.submenu),n&&this._actions.main.discardSelection(),this._actions.main.changeSelectableAll(!0),this[this.submenu].changeStandbyMode()),this.submenu===e&&t?this.submenu=null:(this._buttonElements[e].classList.add("active"),this._mainElement.classList.add("tui-image-editor-menu-"+e),this.submenu=e,this[this.submenu].changeStartMode()),this.resizeEditor()}},{key:"_initMenu",value:function(){if(this.options.initMenu){var e=document.createEvent("MouseEvents");e.initEvent("click",!0,!1),this._buttonElements[this.options.initMenu].dispatchEvent(e)}this.icon&&this.icon.registerDefaultIcon()}},{key:"_getCanvasMaxDimension",value:function(){var e=this._editorContainerElement.style,t=e.maxWidth,n=e.maxHeight;return{width:parseFloat(t),height:parseFloat(n)}}},{key:"_setEditorPosition",value:function(e){var t=this._getCanvasMaxDimension(),n=t.width,o=t.height,i=this._editorElement.style,r=0,s=0;this.submenu&&("bottom"===e?r=o>this._editorElementWrap.scrollHeight-150?(o-this._editorElementWrap.scrollHeight)/2:-75:"top"===e?r=o>this._editorElementWrap.offsetHeight-150?75-(o-(this._editorElementWrap.offsetHeight-150))/2:75:"left"===e?s=n>this._editorElementWrap.offsetWidth-248?124-(n-(this._editorElementWrap.offsetWidth-248))/2:124:"right"===e&&(s=n>this._editorElementWrap.scrollWidth-248?(n-this._editorElementWrap.scrollWidth)/2:-124)),i.top=r+"px",i.left=s+"px"}}]),e}();E.mixin(C),t.default=C},"./src/js/ui/crop.js":
|
|
/*!***************************!*\
|
|
!*** ./src/js/ui/crop.js ***!
|
|
\***************************/
|
|
/*! no static exports found */function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var o=function(){function e(e,t){for(var n=0;n<t.length;n++){var o=t[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}return function(t,n,o){return n&&e(t.prototype,n),o&&e(t,o),t}}(),i=l(n(/*! tui-code-snippet */"tui-code-snippet")),r=l(n(/*! @/ui/submenuBase */"./src/js/ui/submenuBase.js")),s=l(n(/*! @/ui/template/submenu/crop */"./src/js/ui/template/submenu/crop.js")),a=n(/*! @/util */"./src/js/util.js");function l(e){return e&&e.__esModule?e:{default:e}}var c=function(e){function t(e,n){var o=n.locale,i=n.makeSvgIcon,r=n.menuBarPosition,a=n.usageStatistics;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t);var l=function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e,{locale:o,name:"crop",makeSvgIcon:i,menuBarPosition:r,templateHtml:s.default,usageStatistics:a}));return l.status="active",l._els={apply:l.selector(".tie-crop-button .apply"),cancel:l.selector(".tie-crop-button .cancel"),preset:l.selector(".tie-crop-preset-button")},l.defaultPresetButton=l._els.preset.querySelector(".preset-none"),l}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,e),o(t,[{key:"destroy",value:function(){this._removeEvent(),(0,a.assignmentForDestroy)(this)}},{key:"addEvent",value:function(e){var t=this._applyEventHandler.bind(this),n=this._cancelEventHandler.bind(this),o=this._cropzonePresetEventHandler.bind(this);this.eventHandler={apply:t,cancel:n,cropzonePreset:o},this.actions=e,this._els.apply.addEventListener("click",t),this._els.cancel.addEventListener("click",n),this._els.preset.addEventListener("click",o)}},{key:"_removeEvent",value:function(){this._els.apply.removeEventListener("click",this.eventHandler.apply),this._els.cancel.removeEventListener("click",this.eventHandler.cancel),this._els.preset.removeEventListener("click",this.eventHandler.cropzonePreset)}},{key:"_applyEventHandler",value:function(){this.actions.crop(),this._els.apply.classList.remove("active")}},{key:"_cancelEventHandler",value:function(){this.actions.cancel(),this._els.apply.classList.remove("active")}},{key:"_cropzonePresetEventHandler",value:function(e){var t=e.target.closest(".tui-image-editor-button.preset");if(t){var n=t.className.match(/preset-[^\s]+/)[0];this._setPresetButtonActive(t),this.actions.preset(n)}}},{key:"changeStartMode",value:function(){this.actions.modeChange("crop")}},{key:"changeStandbyMode",value:function(){this.actions.stopDrawingMode(),this._setPresetButtonActive()}},{key:"changeApplyButtonStatus",value:function(e){e?this._els.apply.classList.add("active"):this._els.apply.classList.remove("active")}},{key:"_setPresetButtonActive",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.defaultPresetButton;i.default.forEach([].slice.call(this._els.preset.querySelectorAll(".preset")),(function(e){e.classList.remove("active")})),e&&e.classList.add("active")}}]),t}(r.default);t.default=c},"./src/js/ui/draw.js":
|
|
/*!***************************!*\
|
|
!*** ./src/js/ui/draw.js ***!
|
|
\***************************/
|
|
/*! no static exports found */function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var o=function(){function e(e,t){for(var n=0;n<t.length;n++){var o=t[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}return function(t,n,o){return n&&e(t.prototype,n),o&&e(t,o),t}}(),i=u(n(/*! @/ui/tools/colorpicker */"./src/js/ui/tools/colorpicker.js")),r=u(n(/*! @/ui/tools/range */"./src/js/ui/tools/range.js")),s=u(n(/*! @/ui/submenuBase */"./src/js/ui/submenuBase.js")),a=u(n(/*! @/ui/template/submenu/draw */"./src/js/ui/template/submenu/draw.js")),l=n(/*! @/util */"./src/js/util.js"),c=n(/*! @/consts */"./src/js/consts.js");function u(e){return e&&e.__esModule?e:{default:e}}var d=function(e){function t(e,n){var o=n.locale,s=n.makeSvgIcon,l=n.menuBarPosition,u=n.usageStatistics;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t);var d=function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e,{locale:o,name:"draw",makeSvgIcon:s,menuBarPosition:l,templateHtml:a.default,usageStatistics:u}));return d._els={lineSelectButton:d.selector(".tie-draw-line-select-button"),drawColorPicker:new i.default(d.selector(".tie-draw-color"),"#00a9ff",d.toggleDirection,d.usageStatistics),drawRange:new r.default({slider:d.selector(".tie-draw-range"),input:d.selector(".tie-draw-range-value")},c.defaultDrawRangeValues)},d.type=null,d.color=d._els.drawColorPicker.color,d.width=d._els.drawRange.value,d.colorPickerInputBox=d._els.drawColorPicker.colorpickerElement.querySelector(c.selectorNames.COLOR_PICKER_INPUT_BOX),d}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,e),o(t,[{key:"destroy",value:function(){this._removeEvent(),this._els.drawColorPicker.destroy(),this._els.drawRange.destroy(),(0,l.assignmentForDestroy)(this)}},{key:"addEvent",value:function(e){this.eventHandler.changeDrawType=this._changeDrawType.bind(this),this.actions=e,this._els.lineSelectButton.addEventListener("click",this.eventHandler.changeDrawType),this._els.drawColorPicker.on("change",this._changeDrawColor.bind(this)),this._els.drawRange.on("change",this._changeDrawRange.bind(this)),this.colorPickerInputBox.addEventListener(c.eventNames.FOCUS,this._onStartEditingInputBox.bind(this)),this.colorPickerInputBox.addEventListener(c.eventNames.BLUR,this._onStopEditingInputBox.bind(this))}},{key:"_removeEvent",value:function(){this._els.lineSelectButton.removeEventListener("click",this.eventHandler.changeDrawType),this._els.drawColorPicker.off(),this._els.drawRange.off(),this.colorPickerInputBox.removeEventListener(c.eventNames.FOCUS,this._onStartEditingInputBox.bind(this)),this.colorPickerInputBox.removeEventListener(c.eventNames.BLUR,this._onStopEditingInputBox.bind(this))}},{key:"setDrawMode",value:function(){this.actions.setDrawMode(this.type,{width:this.width,color:(0,l.getRgb)(this.color,.7)})}},{key:"changeStandbyMode",value:function(){this.type=null,this.actions.stopDrawingMode(),this.actions.changeSelectableAll(!0),this._els.lineSelectButton.classList.remove("free"),this._els.lineSelectButton.classList.remove("line")}},{key:"changeStartMode",value:function(){this.type="free",this._els.lineSelectButton.classList.add("free"),this.setDrawMode()}},{key:"_changeDrawType",value:function(e){var t=e.target.closest(".tui-image-editor-button");if(t){var n=this.getButtonType(t,["free","line"]);if(this.actions.discardSelection(),this.type===n)return void this.changeStandbyMode();this.changeStandbyMode(),this.type=n,this._els.lineSelectButton.classList.add(n),this.setDrawMode()}}},{key:"_changeDrawColor",value:function(e){this.color=e||"transparent",this.type?this.setDrawMode():this.changeStartMode()}},{key:"_changeDrawRange",value:function(e){this.width=e,this.type?this.setDrawMode():this.changeStartMode()}}]),t}(s.default);t.default=d},"./src/js/ui/filter.js":
|
|
/*!*****************************!*\
|
|
!*** ./src/js/ui/filter.js ***!
|
|
\*****************************/
|
|
/*! no static exports found */function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var o=function(){function e(e,t){for(var n=0;n<t.length;n++){var o=t[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}return function(t,n,o){return n&&e(t.prototype,n),o&&e(t,o),t}}(),i=d(n(/*! tui-code-snippet */"tui-code-snippet")),r=d(n(/*! @/ui/tools/colorpicker */"./src/js/ui/tools/colorpicker.js")),s=d(n(/*! @/ui/tools/range */"./src/js/ui/tools/range.js")),a=d(n(/*! @/ui/submenuBase */"./src/js/ui/submenuBase.js")),l=d(n(/*! @/ui/template/submenu/filter */"./src/js/ui/template/submenu/filter.js")),c=n(/*! @/util */"./src/js/util.js"),u=n(/*! @/consts */"./src/js/consts.js");function d(e){return e&&e.__esModule?e:{default:e}}var h="130px",f=["add","diff","subtract","multiply","screen","lighten","darken"],p=["grayscale","invert","sepia","vintage","blur","sharpen","emboss","remove-white","brightness","noise","pixelate","color-filter","tint","multiply","blend"],m={grayscale:"grayscale",invert:"invert",sepia:"sepia",blur:"blur",sharpen:"sharpen",emboss:"emboss",removeWhite:"removeColor",brightness:"brightness",contrast:"contrast",saturation:"saturation",vintage:"vintage",polaroid:"polaroid",noise:"noise",pixelate:"pixelate",colorFilter:"removeColor",tint:"blendColor",multiply:"blendColor",blend:"blendColor",hue:"hue",gamma:"gamma"},v=["removewhiteDistanceRange","colorfilterThresholdRange","pixelateRange","noiseRange","brightnessRange","tintOpacity"],g=["filterBlendColor","filterMultiplyColor","filterTintColor"],y=function(e){function t(e,n){var o=n.locale,i=n.menuBarPosition,r=n.usageStatistics;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t);var s=function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e,{locale:o,name:"filter",menuBarPosition:i,templateHtml:l.default,usageStatistics:r}));return s.selectBoxShow=!1,s.checkedMap={},s._makeControlElement(),s}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,e),o(t,[{key:"destroy",value:function(){this._removeEvent(),this._destroyToolInstance(),(0,c.assignmentForDestroy)(this)}},{key:"_removeEvent",value:function(){var e=this;i.default.forEach(p,(function(t){var n=e.selector(".tie-"+t),o=(0,c.toCamelCase)(t);n.removeEventListener("change",e.eventHandler[o])})),i.default.forEach([].concat(v,g),(function(t){e._els[t].off()})),this._els.blendType.removeEventListener("change",this.eventHandler.changeBlendFilter),this._els.blendType.removeEventListener("click",this.eventHandler.changeBlendFilter),i.default.forEachArray(this.colorPickerInputBoxes,(function(t){t.removeEventListener(u.eventNames.FOCUS,e._onStartEditingInputBox.bind(e)),t.removeEventListener(u.eventNames.BLUR,e._onStopEditingInputBox.bind(e))}),this)}},{key:"_destroyToolInstance",value:function(){var e=this;i.default.forEach([].concat(v,g),(function(t){e._els[t].destroy()}))}},{key:"addEvent",value:function(e){var t=this,n=e.applyFilter,o=function(e){return t._changeFilterState.bind(t,n,e)},r=function(e){return function(o,i){return t._changeFilterState(n,e,i)}};this.eventHandler={changeBlendFilter:o("blend"),blandTypeClick:function(e){return e.stopPropagation()}},i.default.forEach(p,(function(e){var n=t.selector(".tie-"+e),i=(0,c.toCamelCase)(e);t.checkedMap[i]=n,t.eventHandler[i]=o(i),n.addEventListener("change",t.eventHandler[i])})),this._els.removewhiteDistanceRange.on("change",r("removeWhite")),this._els.colorfilterThresholdRange.on("change",r("colorFilter")),this._els.pixelateRange.on("change",r("pixelate")),this._els.noiseRange.on("change",r("noise")),this._els.brightnessRange.on("change",r("brightness")),this._els.filterBlendColor.on("change",this.eventHandler.changeBlendFilter),this._els.filterMultiplyColor.on("change",o("multiply")),this._els.filterTintColor.on("change",o("tint")),this._els.tintOpacity.on("change",r("tint")),this._els.filterMultiplyColor.on("changeShow",this.colorPickerChangeShow.bind(this)),this._els.filterTintColor.on("changeShow",this.colorPickerChangeShow.bind(this)),this._els.filterBlendColor.on("changeShow",this.colorPickerChangeShow.bind(this)),this._els.blendType.addEventListener("change",this.eventHandler.changeBlendFilter),this._els.blendType.addEventListener("click",this.eventHandler.blandTypeClick),i.default.forEachArray(this.colorPickerInputBoxes,(function(e){e.addEventListener(u.eventNames.FOCUS,t._onStartEditingInputBox.bind(t)),e.addEventListener(u.eventNames.BLUR,t._onStopEditingInputBox.bind(t))}),this)}},{key:"setFilterState",value:function(e){var t=e.type,n=e.options,o=e.action,i=this._getFilterNameFromOptions(t,n),r="remove"===o;r||this._setFilterState(i,n),this.checkedMap[i].checked=!r}},{key:"initFilterCheckBoxState",value:function(){i.default.forEach(this.checkedMap,(function(e){e.checked=!1}),this)}},{key:"_setFilterState",value:function(e,t){"colorFilter"===e?this._els.colorfilterThresholdRange.value=t.distance:"removeWhite"===e?this._els.removewhiteDistanceRange.value=t.distance:"pixelate"===e?this._els.pixelateRange.value=t.blocksize:"brightness"===e?this._els.brightnessRange.value=t.brightness:"noise"===e?this._els.noiseRange.value=t.noise:"tint"===e?(this._els.tintOpacity.value=t.alpha,this._els.filterTintColor.color=t.color):"blend"===e?this._els.filterBlendColor.color=t.color:"multiply"===e&&(this._els.filterMultiplyColor.color=t.color)}},{key:"_getFilterNameFromOptions",value:function(e,t){var n=e;return"removeColor"===e?n=i.default.isExisty(t.useAlpha)?"removeWhite":"colorFilter":"blendColor"===e&&(n={add:"blend",multiply:"multiply",tint:"tint"}[t.mode]),n}},{key:"_changeFilterState",value:function(e,t){var n=!(arguments.length>2&&void 0!==arguments[2])||arguments[2],o=this.checkedMap[t].checked,i=m[t],r=this.checkedMap[t].closest(".tui-image-editor-checkbox-group");r&&(o?r.classList.remove("tui-image-editor-disabled"):r.classList.add("tui-image-editor-disabled")),e(o,i,this._getFilterOption(t),!n)}},{key:"_getFilterOption",value:function(e){var t={};switch(e){case"removeWhite":t.color="#FFFFFF",t.useAlpha=!1,t.distance=parseFloat(this._els.removewhiteDistanceRange.value);break;case"colorFilter":t.color="#FFFFFF",t.distance=parseFloat(this._els.colorfilterThresholdRange.value);break;case"pixelate":t.blocksize=(0,c.toInteger)(this._els.pixelateRange.value);break;case"noise":t.noise=(0,c.toInteger)(this._els.noiseRange.value);break;case"brightness":t.brightness=parseFloat(this._els.brightnessRange.value);break;case"blend":t.mode="add",t.color=this._els.filterBlendColor.color,t.mode=this._els.blendType.value;break;case"multiply":t.mode="multiply",t.color=this._els.filterMultiplyColor.color;break;case"tint":t.mode="tint",t.color=this._els.filterTintColor.color,t.alpha=this._els.tintOpacity.value;break;case"blur":t.blur=this._els.blurRange.value}return t}},{key:"_makeControlElement",value:function(){this._els={removewhiteDistanceRange:new s.default({slider:this.selector(".tie-removewhite-distance-range")},u.defaultFilterRangeValues.removewhiteDistanceRange),brightnessRange:new s.default({slider:this.selector(".tie-brightness-range")},u.defaultFilterRangeValues.brightnessRange),noiseRange:new s.default({slider:this.selector(".tie-noise-range")},u.defaultFilterRangeValues.noiseRange),pixelateRange:new s.default({slider:this.selector(".tie-pixelate-range")},u.defaultFilterRangeValues.pixelateRange),colorfilterThresholdRange:new s.default({slider:this.selector(".tie-colorfilter-threshold-range")},u.defaultFilterRangeValues.colorfilterThresholdRange),filterTintColor:new r.default(this.selector(".tie-filter-tint-color"),"#03bd9e",this.toggleDirection,this.usageStatistics),filterMultiplyColor:new r.default(this.selector(".tie-filter-multiply-color"),"#515ce6",this.toggleDirection,this.usageStatistics),filterBlendColor:new r.default(this.selector(".tie-filter-blend-color"),"#ffbb3b",this.toggleDirection,this.usageStatistics),blurRange:u.defaultFilterRangeValues.blurFilterRange},this._els.tintOpacity=this._pickerWithRange(this._els.filterTintColor.pickerControl),this._els.blendType=this._pickerWithSelectbox(this._els.filterBlendColor.pickerControl),this.colorPickerControls.push(this._els.filterTintColor),this.colorPickerControls.push(this._els.filterMultiplyColor),this.colorPickerControls.push(this._els.filterBlendColor),this.colorPickerInputBoxes=[],this.colorPickerInputBoxes.push(this._els.filterTintColor.colorpickerElement.querySelector(u.selectorNames.COLOR_PICKER_INPUT_BOX)),this.colorPickerInputBoxes.push(this._els.filterMultiplyColor.colorpickerElement.querySelector(u.selectorNames.COLOR_PICKER_INPUT_BOX)),this.colorPickerInputBoxes.push(this._els.filterBlendColor.colorpickerElement.querySelector(u.selectorNames.COLOR_PICKER_INPUT_BOX))}},{key:"_pickerWithRange",value:function(e){var t=document.createElement("div"),n=document.createElement("label"),o=document.createElement("div");return o.id="tie-filter-tint-opacity",n.innerHTML="Opacity",t.appendChild(n),t.appendChild(o),e.appendChild(t),e.style.height=h,new s.default({slider:o},u.defaultFilterRangeValues.tintOpacityRange)}},{key:"_pickerWithSelectbox",value:function(e){var t=document.createElement("div"),n=document.createElement("select"),o=document.createElement("ul");return t.className="tui-image-editor-selectlist-wrap",o.className="tui-image-editor-selectlist",t.appendChild(n),t.appendChild(o),this._makeSelectOptionList(n),e.appendChild(t),e.style.height=h,this._drawSelectOptionList(n,o),this._pickerWithSelectboxForAddEvent(n,o),n}},{key:"_drawSelectOptionList",value:function(e,t){var n=e.querySelectorAll("option");i.default.forEach(n,(function(e){var n=document.createElement("li");n.innerHTML=e.innerHTML,n.setAttribute("data-item",e.value),t.appendChild(n)}))}},{key:"_pickerWithSelectboxForAddEvent",value:function(e,t){var n=this;t.addEventListener("click",(function(o){var i=o.target.getAttribute("data-item"),r=document.createEvent("HTMLEvents");e.querySelector('[value="'+i+'"]').selected=!0,r.initEvent("change",!0,!0),e.dispatchEvent(r),n.selectBoxShow=!1,t.style.display="none"})),e.addEventListener("mousedown",(function(o){o.preventDefault(),n.selectBoxShow=!n.selectBoxShow,t.style.display=n.selectBoxShow?"block":"none",t.setAttribute("data-selectitem",e.value),t.querySelector("[data-item='"+e.value+"']").classList.add("active")}))}},{key:"_makeSelectOptionList",value:function(e){i.default.forEach(f,(function(t){var n=document.createElement("option");n.setAttribute("value",t),n.innerHTML=t.replace(/^[a-z]/,(function(e){return e.toUpperCase()})),e.appendChild(n)}))}}]),t}(a.default);t.default=y},"./src/js/ui/flip.js":
|
|
/*!***************************!*\
|
|
!*** ./src/js/ui/flip.js ***!
|
|
\***************************/
|
|
/*! no static exports found */function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var o=function(){function e(e,t){for(var n=0;n<t.length;n++){var o=t[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}return function(t,n,o){return n&&e(t.prototype,n),o&&e(t,o),t}}(),i=l(n(/*! tui-code-snippet */"tui-code-snippet")),r=l(n(/*! @/ui/submenuBase */"./src/js/ui/submenuBase.js")),s=l(n(/*! @/ui/template/submenu/flip */"./src/js/ui/template/submenu/flip.js")),a=n(/*! @/util */"./src/js/util.js");function l(e){return e&&e.__esModule?e:{default:e}}var c=function(e){function t(e,n){var o=n.locale,i=n.makeSvgIcon,r=n.menuBarPosition,a=n.usageStatistics;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t);var l=function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e,{locale:o,name:"flip",makeSvgIcon:i,menuBarPosition:r,templateHtml:s.default,usageStatistics:a}));return l.flipStatus=!1,l._els={flipButton:l.selector(".tie-flip-button")},l}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,e),o(t,[{key:"destroy",value:function(){this._removeEvent(),(0,a.assignmentForDestroy)(this)}},{key:"addEvent",value:function(e){this.eventHandler.changeFlip=this._changeFlip.bind(this),this._actions=e,this._els.flipButton.addEventListener("click",this.eventHandler.changeFlip)}},{key:"_removeEvent",value:function(){this._els.flipButton.removeEventListener("click",this.eventHandler.changeFlip)}},{key:"_changeFlip",value:function(e){var t=this,n=e.target.closest(".tui-image-editor-button");if(n){var o=this.getButtonType(n,["flipX","flipY","resetFlip"]);if(!this.flipStatus&&"resetFlip"===o)return;this._actions.flip(o).then((function(e){var n=t._els.flipButton.classList;t.flipStatus=!1,n.remove("resetFlip"),i.default.forEach(["flipX","flipY"],(function(o){n.remove(o),e[o]&&(n.add(o),n.add("resetFlip"),t.flipStatus=!0)}))}))}}}]),t}(r.default);t.default=c},"./src/js/ui/history.js":
|
|
/*!******************************!*\
|
|
!*** ./src/js/ui/history.js ***!
|
|
\******************************/
|
|
/*! no static exports found */function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var o=function(){function e(e,t){for(var n=0;n<t.length;n++){var o=t[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}return function(t,n,o){return n&&e(t.prototype,n),o&&e(t,o),t}}(),i=a(n(/*! @/ui/panelMenu */"./src/js/ui/panelMenu.js")),r=a(n(/*! @/ui/template/submenu/history */"./src/js/ui/template/submenu/history.js")),s=n(/*! @/util */"./src/js/util.js");function a(e){return e&&e.__esModule?e:{default:e}}var l="selected-item",c="disabled-item",u=function(e){function t(e,n){var o=n.locale,i=n.makeSvgIcon;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t);var r=function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e,{name:"history"}));return e.classList.add("enabled"),r.locale=o,r.makeSvgIcon=i,r._eventHandler={},r._historyIndex=r.getListLength(),r}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,e),o(t,[{key:"add",value:function(e){var t=e.name,n=e.detail;this._hasDisabledItem()&&this.deleteListItemElement(this._historyIndex+1,this.getListLength());var o=(0,r.default)({locale:this.locale,makeSvgIcon:this.makeSvgIcon,name:t,detail:n}),i=this.makeListItemElement(o);this.pushListItemElement(i),this._historyIndex=this.getListLength()-1,this._selectItem(this._historyIndex)}},{key:"init",value:function(){this.deleteListItemElement(1,this.getListLength()),this._historyIndex=0,this._selectItem(this._historyIndex)}},{key:"clear",value:function(){this.deleteListItemElement(0,this.getListLength()),this._historyIndex=-1}},{key:"prev",value:function(){this._historyIndex-=1,this._selectItem(this._historyIndex)}},{key:"next",value:function(){this._historyIndex+=1,this._selectItem(this._historyIndex)}},{key:"_hasDisabledItem",value:function(){return this.getListLength()-1>this._historyIndex}},{key:"_addHistoryEventListener",value:function(){var e=this;this._eventHandler.history=function(t){return e._clickHistoryItem(t)},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 o=Math.abs(n-this._historyIndex);n<this._historyIndex?this._actions.undo(o):this._actions.redo(o)}}}},{key:"_selectItem",value:function(e){for(var t=0;t<this.getListLength();t+=1)this.removeClass(t,l),this.removeClass(t,c),t>e&&this.addClass(t,c);this.addClass(e,l)}},{key:"destroy",value:function(){this.removeEvent(),(0,s.assignmentForDestroy)(this)}},{key:"addEvent",value:function(e){this._actions=e,this._addHistoryEventListener()}},{key:"removeEvent",value:function(){this._removeHistoryEventListener()}}]),t}(i.default);t.default=u},"./src/js/ui/icon.js":
|
|
/*!***************************!*\
|
|
!*** ./src/js/ui/icon.js ***!
|
|
\***************************/
|
|
/*! no static exports found */function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var o=function(){function e(e,t){for(var n=0;n<t.length;n++){var o=t[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}return function(t,n,o){return n&&e(t.prototype,n),o&&e(t,o),t}}(),i=u(n(/*! tui-code-snippet */"tui-code-snippet")),r=u(n(/*! @/ui/tools/colorpicker */"./src/js/ui/tools/colorpicker.js")),s=u(n(/*! @/ui/submenuBase */"./src/js/ui/submenuBase.js")),a=u(n(/*! @/ui/template/submenu/icon */"./src/js/ui/template/submenu/icon.js")),l=n(/*! @/util */"./src/js/util.js"),c=n(/*! @/consts */"./src/js/consts.js");function u(e){return e&&e.__esModule?e:{default:e}}var d=function(e){function t(e,n){var o=n.locale,i=n.makeSvgIcon,s=n.menuBarPosition,l=n.usageStatistics;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t);var u=function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e,{locale:o,name:"icon",makeSvgIcon:i,menuBarPosition:s,templateHtml:a.default,usageStatistics:l}));return u.iconType=null,u._iconMap={},u._els={registerIconButton:u.selector(".tie-icon-image-file"),addIconButton:u.selector(".tie-icon-add-button"),iconColorpicker:new r.default(u.selector(".tie-icon-color"),"#ffbb3b",u.toggleDirection,u.usageStatistics)},u.colorPickerInputBox=u._els.iconColorpicker.colorpickerElement.querySelector(c.selectorNames.COLOR_PICKER_INPUT_BOX),u}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,e),o(t,[{key:"destroy",value:function(){this._removeEvent(),this._els.iconColorpicker.destroy(),(0,l.assignmentForDestroy)(this)}},{key:"addEvent",value:function(e){var t=this._registerIconHandler.bind(this),n=this._addIconHandler.bind(this);this.eventHandler={registerIcon:t,addIcon:n},this.actions=e,this._els.iconColorpicker.on("change",this._changeColorHandler.bind(this)),this._els.registerIconButton.addEventListener("change",t),this._els.addIconButton.addEventListener("click",n),this.colorPickerInputBox.addEventListener(c.eventNames.FOCUS,this._onStartEditingInputBox.bind(this)),this.colorPickerInputBox.addEventListener(c.eventNames.BLUR,this._onStopEditingInputBox.bind(this))}},{key:"_removeEvent",value:function(){this._els.iconColorpicker.off(),this._els.registerIconButton.removeEventListener("change",this.eventHandler.registerIcon),this._els.addIconButton.removeEventListener("click",this.eventHandler.addIcon),this.colorPickerInputBox.removeEventListener(c.eventNames.FOCUS,this._onStartEditingInputBox.bind(this)),this.colorPickerInputBox.removeEventListener(c.eventNames.BLUR,this._onStopEditingInputBox.bind(this))}},{key:"clearIconType",value:function(){this._els.addIconButton.classList.remove(this.iconType),this.iconType=null}},{key:"registerDefaultIcon",value:function(){var e=this;i.default.forEach(c.defaultIconPath,(function(t,n){e.actions.registerDefaultIcons(n,t)}))}},{key:"setIconPickerColor",value:function(e){this._els.iconColorpicker.color=e}},{key:"changeStandbyMode",value:function(){this.clearIconType(),this.actions.cancelAddIcon()}},{key:"_changeColorHandler",value:function(e){e=e||"transparent",this.actions.changeColor(e)}},{key:"_addIconHandler",value:function(e){var t=e.target.closest(".tui-image-editor-button");if(t){var n=t.getAttribute("data-icontype"),o=this._els.iconColorpicker.color;this.actions.discardSelection(),this.actions.changeSelectableAll(!1),this._els.addIconButton.classList.remove(this.iconType),this._els.addIconButton.classList.add(n),this.iconType===n?this.changeStandbyMode():(this.actions.addIcon(n,o),this.iconType=n)}}},{key:"_registerIconHandler",value:function(e){var t=void 0;l.isSupportFileApi||alert("This browser does not support file-api");var n=e.target.files[0];n&&(t=URL.createObjectURL(n),this.actions.registerCustomIcon(t,n))}}]),t}(s.default);t.default=d},"./src/js/ui/locale/locale.js":
|
|
/*!************************************!*\
|
|
!*** ./src/js/ui/locale/locale.js ***!
|
|
\************************************/
|
|
/*! no static exports found */function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var o=function(){function e(e,t){for(var n=0;n<t.length;n++){var o=t[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}return function(t,n,o){return n&&e(t.prototype,n),o&&e(t,o),t}}();var i=function(){function e(t){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this._locale=t}return o(e,[{key:"localize",value:function(e){return this._locale[e]||e}}]),e}();t.default=i},"./src/js/ui/mask.js":
|
|
/*!***************************!*\
|
|
!*** ./src/js/ui/mask.js ***!
|
|
\***************************/
|
|
/*! no static exports found */function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var o=function(){function e(e,t){for(var n=0;n<t.length;n++){var o=t[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}return function(t,n,o){return n&&e(t.prototype,n),o&&e(t,o),t}}(),i=a(n(/*! @/ui/submenuBase */"./src/js/ui/submenuBase.js")),r=a(n(/*! @/ui/template/submenu/mask */"./src/js/ui/template/submenu/mask.js")),s=n(/*! @/util */"./src/js/util.js");function a(e){return e&&e.__esModule?e:{default:e}}var l=function(e){function t(e,n){var o=n.locale,i=n.makeSvgIcon,s=n.menuBarPosition,a=n.usageStatistics;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t);var l=function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e,{locale:o,name:"mask",makeSvgIcon:i,menuBarPosition:s,templateHtml:r.default,usageStatistics:a}));return l._els={applyButton:l.selector(".tie-mask-apply"),maskImageButton:l.selector(".tie-mask-image-file")},l}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,e),o(t,[{key:"destroy",value:function(){this._removeEvent(),(0,s.assignmentForDestroy)(this)}},{key:"addEvent",value:function(e){var t=this._loadMaskFile.bind(this),n=this._applyMask.bind(this);this.eventHandler={loadMaskFile:t,applyMask:n},this.actions=e,this._els.maskImageButton.addEventListener("change",t),this._els.applyButton.addEventListener("click",n)}},{key:"_removeEvent",value:function(){this._els.maskImageButton.removeEventListener("change",this.eventHandler.loadMaskFile),this._els.applyButton.removeEventListener("click",this.eventHandler.applyMask)}},{key:"_applyMask",value:function(){this.actions.applyFilter(),this._els.applyButton.classList.remove("active")}},{key:"_loadMaskFile",value:function(e){var t=void 0;(0,s.isSupportFileApi)()||alert("This browser does not support file-api");var n=e.target.files[0];n&&(t=URL.createObjectURL(n),this.actions.loadImageFromURL(t,n),this._els.applyButton.classList.add("active"))}}]),t}(i.default);t.default=l},"./src/js/ui/panelMenu.js":
|
|
/*!********************************!*\
|
|
!*** ./src/js/ui/panelMenu.js ***!
|
|
\********************************/
|
|
/*! no static exports found */function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var o=function(){function e(e,t){for(var n=0;n<t.length;n++){var o=t[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}return function(t,n,o){return n&&e(t.prototype,n),o&&e(t,o),t}}();var i=function(){function e(t,n){var o=n.name;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.name=o,this.items=[],this.panelElement=this._makePanelElement(),this.listElement=this._makeListElement(),this.panelElement.appendChild(this.listElement),t.appendChild(this.panelElement)}return o(e,[{key:"_makePanelElement",value:function(){var e=document.createElement("div");return e.className="tie-panel-"+this.name,e}},{key:"_makeListElement",value:function(){var e=document.createElement("ol");return e.className=this.name+"-list",e}},{key:"makeListItemElement",value:function(e){var t=document.createElement("li");return t.innerHTML=e,t.className=this.name+"-item",t.setAttribute("data-index",this.items.length),t}},{key:"pushListItemElement",value:function(e){this.listElement.appendChild(e),this.listElement.scrollTop+=e.offsetHeight,this.items.push(e)}},{key:"deleteListItemElement",value:function(e,t){for(var n=this.items,o=e;o<t;o+=1)this.listElement.removeChild(n[o]);n.splice(e,t-e+1)}},{key:"getListLength",value:function(){return this.items.length}},{key:"addClass",value:function(e,t){this.items[e]&&this.items[e].classList.add(t)}},{key:"removeClass",value:function(e,t){this.items[e]&&this.items[e].classList.remove(t)}},{key:"toggleClass",value:function(e,t){this.items[e]&&this.items[e].classList.toggle(t)}}]),e}();t.default=i},"./src/js/ui/rotate.js":
|
|
/*!*****************************!*\
|
|
!*** ./src/js/ui/rotate.js ***!
|
|
\*****************************/
|
|
/*! no static exports found */function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var o=function(){function e(e,t){for(var n=0;n<t.length;n++){var o=t[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}return function(t,n,o){return n&&e(t.prototype,n),o&&e(t,o),t}}(),i=c(n(/*! @/ui/tools/range */"./src/js/ui/tools/range.js")),r=c(n(/*! @/ui/submenuBase */"./src/js/ui/submenuBase.js")),s=c(n(/*! @/ui/template/submenu/rotate */"./src/js/ui/template/submenu/rotate.js")),a=n(/*! @/util */"./src/js/util.js"),l=n(/*! @/consts */"./src/js/consts.js");function c(e){return e&&e.__esModule?e:{default:e}}var u=function(e){function t(e,n){var o=n.locale,r=n.makeSvgIcon,a=n.menuBarPosition,c=n.usageStatistics;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t);var u=function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e,{locale:o,name:"rotate",makeSvgIcon:r,menuBarPosition:a,templateHtml:s.default,usageStatistics:c}));return u._value=0,u._els={rotateButton:u.selector(".tie-rotate-button"),rotateRange:new i.default({slider:u.selector(".tie-rotate-range"),input:u.selector(".tie-rotate-range-value")},l.defaultRotateRangeValues)},u}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,e),o(t,[{key:"destroy",value:function(){this._removeEvent(),this._els.rotateRange.destroy(),(0,a.assignmentForDestroy)(this)}},{key:"setRangeBarAngle",value:function(e,t){var n=t;"rotate"===e&&(n=parseInt(this._els.rotateRange.value,10)+t),this._setRangeBarRatio(n)}},{key:"_setRangeBarRatio",value:function(e){this._els.rotateRange.value=e}},{key:"addEvent",value:function(e){this.eventHandler.rotationAngleChanged=this._changeRotateForButton.bind(this),this.actions=e,this._els.rotateButton.addEventListener("click",this.eventHandler.rotationAngleChanged),this._els.rotateRange.on("change",this._changeRotateForRange.bind(this))}},{key:"_removeEvent",value:function(){this._els.rotateButton.removeEventListener("click",this.eventHandler.rotationAngleChanged),this._els.rotateRange.off()}},{key:"_changeRotateForRange",value:function(e,t){var n=(0,a.toInteger)(e);this.actions.setAngle(n,!t),this._value=n}},{key:"_changeRotateForButton",value:function(e){var t=e.target.closest(".tui-image-editor-button"),n=this._els.rotateRange.value;if(t){var o={clockwise:30,counterclockwise:-30}[this.getButtonType(t,["counterclockwise","clockwise"])],i=parseInt(n,10)+o;i>=-360&&i<=360&&this.actions.rotate(o)}}}]),t}(r.default);t.default=u},"./src/js/ui/shape.js":
|
|
/*!****************************!*\
|
|
!*** ./src/js/ui/shape.js ***!
|
|
\****************************/
|
|
/*! no static exports found */function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var o=function(){function e(e,t){for(var n=0;n<t.length;n++){var o=t[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}return function(t,n,o){return n&&e(t.prototype,n),o&&e(t,o),t}}(),i=d(n(/*! tui-code-snippet */"tui-code-snippet")),r=d(n(/*! @/ui/tools/colorpicker */"./src/js/ui/tools/colorpicker.js")),s=d(n(/*! @/ui/tools/range */"./src/js/ui/tools/range.js")),a=d(n(/*! @/ui/submenuBase */"./src/js/ui/submenuBase.js")),l=d(n(/*! @/ui/template/submenu/shape */"./src/js/ui/template/submenu/shape.js")),c=n(/*! @/util */"./src/js/util.js"),u=n(/*! @/consts */"./src/js/consts.js");function d(e){return e&&e.__esModule?e:{default:e}}var h={stroke:"#ffbb3b",fill:"",strokeWidth:3},f=function(e){function t(e,n){var o=n.locale,i=n.makeSvgIcon,a=n.menuBarPosition,c=n.usageStatistics;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t);var d=function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e,{locale:o,name:"shape",makeSvgIcon:i,menuBarPosition:a,templateHtml:l.default,usageStatistics:c}));return d.type=null,d.options=h,d._els={shapeSelectButton:d.selector(".tie-shape-button"),shapeColorButton:d.selector(".tie-shape-color-button"),strokeRange:new s.default({slider:d.selector(".tie-stroke-range"),input:d.selector(".tie-stroke-range-value")},u.defaultShapeStrokeValues),fillColorpicker:new r.default(d.selector(".tie-color-fill"),"",d.toggleDirection,d.usageStatistics),strokeColorpicker:new r.default(d.selector(".tie-color-stroke"),"#ffbb3b",d.toggleDirection,d.usageStatistics)},d.colorPickerControls.push(d._els.fillColorpicker),d.colorPickerControls.push(d._els.strokeColorpicker),d.colorPickerInputBoxes=[],d.colorPickerInputBoxes.push(d._els.fillColorpicker.colorpickerElement.querySelector(u.selectorNames.COLOR_PICKER_INPUT_BOX)),d.colorPickerInputBoxes.push(d._els.strokeColorpicker.colorpickerElement.querySelector(u.selectorNames.COLOR_PICKER_INPUT_BOX)),d}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,e),o(t,[{key:"destroy",value:function(){this._removeEvent(),this._els.strokeRange.destroy(),this._els.fillColorpicker.destroy(),this._els.strokeColorpicker.destroy(),(0,c.assignmentForDestroy)(this)}},{key:"addEvent",value:function(e){var t=this;this.eventHandler.shapeTypeSelected=this._changeShapeHandler.bind(this),this.actions=e,this._els.shapeSelectButton.addEventListener("click",this.eventHandler.shapeTypeSelected),this._els.strokeRange.on("change",this._changeStrokeRangeHandler.bind(this)),this._els.fillColorpicker.on("change",this._changeFillColorHandler.bind(this)),this._els.strokeColorpicker.on("change",this._changeStrokeColorHandler.bind(this)),this._els.fillColorpicker.on("changeShow",this.colorPickerChangeShow.bind(this)),this._els.strokeColorpicker.on("changeShow",this.colorPickerChangeShow.bind(this)),i.default.forEachArray(this.colorPickerInputBoxes,(function(e){e.addEventListener(u.eventNames.FOCUS,t._onStartEditingInputBox.bind(t)),e.addEventListener(u.eventNames.BLUR,t._onStopEditingInputBox.bind(t))}),this)}},{key:"_removeEvent",value:function(){var e=this;this._els.shapeSelectButton.removeEventListener("click",this.eventHandler.shapeTypeSelected),this._els.strokeRange.off(),this._els.fillColorpicker.off(),this._els.strokeColorpicker.off(),i.default.forEachArray(this.colorPickerInputBoxes,(function(t){t.removeEventListener(u.eventNames.FOCUS,e._onStartEditingInputBox.bind(e)),t.removeEventListener(u.eventNames.BLUR,e._onStopEditingInputBox.bind(e))}),this)}},{key:"setShapeStatus",value:function(e){var t=e.strokeWidth,n=e.strokeColor,o=e.fillColor;this._els.strokeRange.value=t,this._els.strokeColorpicker.color=n,this._els.fillColorpicker.color=o,this.options.stroke=n,this.options.fill=o,this.options.strokeWidth=t,this.actions.setDrawingShape(this.type,{strokeWidth:t})}},{key:"changeStartMode",value:function(){this.actions.stopDrawingMode()}},{key:"changeStandbyMode",value:function(){this.type=null,this.actions.changeSelectableAll(!0),this._els.shapeSelectButton.classList.remove("circle"),this._els.shapeSelectButton.classList.remove("triangle"),this._els.shapeSelectButton.classList.remove("rect")}},{key:"setMaxStrokeValue",value:function(e){var t=e;t<=0&&(t=u.defaultShapeStrokeValues.max),this._els.strokeRange.max=t}},{key:"setStrokeValue",value:function(e){this._els.strokeRange.value=e,this._els.strokeRange.trigger("change")}},{key:"getStrokeValue",value:function(){return this._els.strokeRange.value}},{key:"_changeShapeHandler",value:function(e){var t=e.target.closest(".tui-image-editor-button");if(t){this.actions.stopDrawingMode(),this.actions.discardSelection();var n=this.getButtonType(t,["circle","triangle","rect"]);if(this.type===n)return void this.changeStandbyMode();this.changeStandbyMode(),this.type=n,e.currentTarget.classList.add(n),this.actions.changeSelectableAll(!1),this.actions.modeChange("shape")}}},{key:"_changeStrokeRangeHandler",value:function(e,t){this.options.strokeWidth=(0,c.toInteger)(e),this.actions.changeShape({strokeWidth:e},!t),this.actions.setDrawingShape(this.type,this.options)}},{key:"_changeFillColorHandler",value:function(e){e=e||"transparent",this.options.fill=e,this.actions.changeShape({fill:e})}},{key:"_changeStrokeColorHandler",value:function(e){e=e||"transparent",this.options.stroke=e,this.actions.changeShape({stroke:e})}}]),t}(a.default);t.default=f},"./src/js/ui/submenuBase.js":
|
|
/*!**********************************!*\
|
|
!*** ./src/js/ui/submenuBase.js ***!
|
|
\**********************************/
|
|
/*! no static exports found */function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var o=function(){function e(e,t){for(var n=0;n<t.length;n++){var o=t[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}return function(t,n,o){return n&&e(t.prototype,n),o&&e(t,o),t}}(),i=n(/*! tui-code-snippet */"tui-code-snippet"),r=n(/*! @/consts */"./src/js/consts.js");var s=function(){function e(t,n){var o=n.locale,i=n.name,r=n.makeSvgIcon,s=n.menuBarPosition,a=n.templateHtml,l=n.usageStatistics;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.subMenuElement=t,this.menuBarPosition=s,this.toggleDirection="top"===s?"down":"up",this.colorPickerControls=[],this.usageStatistics=l,this.eventHandler={},this._makeSubMenuElement({locale:o,name:i,makeSvgIcon:r,templateHtml:a})}return o(e,[{key:"selector",value:function(e){return this.subMenuElement.querySelector(e)}},{key:"colorPickerChangeShow",value:function(e){this.colorPickerControls.forEach((function(t){e!==t&&t.hide()}))}},{key:"getButtonType",value:function(e,t){return e.className.match(RegExp("("+t.join("|")+")"))[0]}},{key:"changeClass",value:function(e,t,n){e.classList.remove(t),e.classList.add(n)}},{key:"changeStandbyMode",value:function(){}},{key:"changeStartMode",value:function(){}},{key:"_makeSubMenuElement",value:function(e){var t=e.locale,n=e.name,o=e.iconStyle,i=e.makeSvgIcon,r=e.templateHtml,s=document.createElement("div");s.className="tui-image-editor-menu-"+n,s.innerHTML=r({locale:t,iconStyle:o,makeSvgIcon:i}),this.subMenuElement.appendChild(s)}},{key:"_onStartEditingInputBox",value:function(){this.fire(r.eventNames.INPUT_BOX_EDITING_STARTED)}},{key:"_onStopEditingInputBox",value:function(){this.fire(r.eventNames.INPUT_BOX_EDITING_STOPPED)}}]),e}();i.CustomEvents.mixin(s),t.default=s},"./src/js/ui/template/controls.js":
|
|
/*!****************************************!*\
|
|
!*** ./src/js/ui/template/controls.js ***!
|
|
\****************************************/
|
|
/*! no static exports found */function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var o=n(/*! @/util */"./src/js/util.js");t.default=function(e){var t=e.locale,n=e.biImage,i=e.loadButtonStyle,r=e.downloadButtonStyle,s=e.menuBarPosition;return'\n <ul class="tui-image-editor-help-menu '+(0,o.getHelpMenuBarPosition)(s)+'"></ul>\n <div class="tui-image-editor-controls">\n <div class="tui-image-editor-controls-logo">\n <img src="'+n+'" />\n </div>\n <ul class="tui-image-editor-menu"></ul>\n\n <div class="tui-image-editor-controls-buttons">\n <div style="'+i+'">\n '+t.localize("Load")+'\n <input type="file" class="tui-image-editor-load-btn" />\n </div>\n <button class="tui-image-editor-download-btn" style="'+r+'">\n '+t.localize("Download")+"\n </button>\n </div>\n </div>\n"}},"./src/js/ui/template/mainContainer.js":
|
|
/*!*********************************************!*\
|
|
!*** ./src/js/ui/template/mainContainer.js ***!
|
|
\*********************************************/
|
|
/*! no static exports found */function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){var t=e.locale,n=(e.biImage,e.commonStyle),o=e.headerStyle,i=e.loadButtonStyle,r=e.downloadButtonStyle,s=e.submenuStyle;return'\n <div class="tui-image-editor-main-container" style="'+n+'">\n <div class="tui-image-editor-header" style="'+o+'">\n <div class="tui-image-editor-header-logo">\n</div>\n <div class="tui-image-editor-header-buttons">\n <div style="'+i+'">\n '+t.localize("Load")+'\n <input type="file" class="tui-image-editor-load-btn" />\n </div>\n <button class="tui-image-editor-download-btn" style="'+r+'">\n '+t.localize("Download")+'\n </button>\n </div>\n </div>\n <div class="tui-image-editor-main">\n <div class="tui-image-editor-submenu">\n <div class="tui-image-editor-submenu-style" style="'+s+'"></div>\n </div>\n <div class="tui-image-editor-wrap">\n <div class="tui-image-editor-size-wrap">\n <div class="tui-image-editor-align-wrap">\n <div class="tui-image-editor"></div>\n </div>\n </div>\n </div>\n </div>\n </div>\n'}},"./src/js/ui/template/style.js":
|
|
/*!*************************************!*\
|
|
!*** ./src/js/ui/template/style.js ***!
|
|
\*************************************/
|
|
/*! no static exports found */function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){var t=e.subMenuLabelActive,n=e.subMenuLabelNormal,o=e.subMenuRangeTitle,i=e.submenuPartitionVertical,r=e.submenuPartitionHorizontal,s=e.submenuCheckbox,a=e.submenuRangePointer,l=e.submenuRangeValue,c=e.submenuColorpickerTitle,u=e.submenuColorpickerButton,d=e.submenuRangeBar,h=e.submenuRangeSubbar,f=e.submenuDisabledRangePointer,p=e.submenuDisabledRangeBar,m=e.submenuDisabledRangeSubbar,v=e.submenuIconSize,g=e.menuIconSize,y=e.biSize,_=e.menuIconStyle,b=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 "+o+"\n }\n .tui-image-editor-container .tui-image-editor-partition > div {\n "+i+"\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 "+s+"\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 "+a+"\n }\n .tui-image-editor-container .tui-image-editor-virtual-range-bar {\n "+d+"\n }\n .tui-image-editor-container .tui-image-editor-virtual-range-subbar {\n "+h+"\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 "+m+"\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 "+g+"\n }\n .tui-image-editor-container .svg_ic-submenu {\n "+v+"\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: "+_.normal.color+";\n stroke: "+_.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: "+_.active.color+";\n stroke: "+_.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: "+_.hover.color+";\n stroke: "+_.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: "+_.disabled.color+";\n stroke: "+_.disabled.color+";\n }\n .tui-image-editor-submenu use.normal.use-default {\n fill-rule: evenodd;\n fill: "+b.normal.color+";\n stroke: "+b.normal.color+";\n }\n .tui-image-editor-submenu use.active.use-default {\n fill-rule: evenodd;\n fill: "+b.active.color+";\n stroke: "+b.active.color+";\n }\n"}},"./src/js/ui/template/submenu/crop.js":
|
|
/*!********************************************!*\
|
|
!*** ./src/js/ui/template/submenu/crop.js ***!
|
|
\********************************************/
|
|
/*! no static exports found */function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){var t=e.locale,n=e.makeSvgIcon;return'\n <ul class="tui-image-editor-submenu-item">\n <li class="tie-crop-preset-button">\n <div class="tui-image-editor-button preset preset-none active">\n <div>\n '+n(["normal","active"],"shape-rectangle",!0)+"\n </div>\n <label> "+t.localize("Custom")+' </label>\n </div>\n <div class="tui-image-editor-button preset preset-square">\n <div>\n '+n(["normal","active"],"crop",!0)+"\n </div>\n <label> "+t.localize("Square")+' </label>\n </div>\n <div class="tui-image-editor-button preset preset-3-2">\n <div>\n '+n(["normal","active"],"crop",!0)+"\n </div>\n <label> "+t.localize("3:2")+' </label>\n </div>\n <div class="tui-image-editor-button preset preset-4-3">\n <div>\n '+n(["normal","active"],"crop",!0)+"\n </div>\n <label> "+t.localize("4:3")+' </label>\n </div>\n <div class="tui-image-editor-button preset preset-5-4">\n <div>\n '+n(["normal","active"],"crop",!0)+"\n </div>\n <label> "+t.localize("5:4")+' </label>\n </div>\n <div class="tui-image-editor-button preset preset-7-5">\n <div>\n '+n(["normal","active"],"crop",!0)+"\n </div>\n <label> "+t.localize("7:5")+' </label>\n </div>\n <div class="tui-image-editor-button preset preset-16-9">\n <div>\n '+n(["normal","active"],"crop",!0)+"\n </div>\n <label> "+t.localize("16:9")+' </label>\n </div>\n </li>\n <li class="tui-image-editor-partition tui-image-editor-newline">\n </li>\n <li class="tui-image-editor-partition only-left-right">\n <div></div>\n </li>\n <li class="tie-crop-button action">\n <div class="tui-image-editor-button apply">\n '+n(["normal","active"],"apply")+"\n <label>\n "+t.localize("Apply")+'\n </label>\n </div>\n <div class="tui-image-editor-button cancel">\n '+n(["normal","active"],"cancel")+"\n <label>\n "+t.localize("Cancel")+"\n </label>\n </div>\n </li>\n </ul>\n"}},"./src/js/ui/template/submenu/draw.js":
|
|
/*!********************************************!*\
|
|
!*** ./src/js/ui/template/submenu/draw.js ***!
|
|
\********************************************/
|
|
/*! no static exports found */function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){var t=e.locale,n=e.makeSvgIcon;return'\n <ul class="tui-image-editor-submenu-item">\n <li class="tie-draw-line-select-button">\n <div class="tui-image-editor-button free">\n <div>\n '+n(["normal","active"],"draw-free",!0)+"\n </div>\n <label>\n "+t.localize("Free")+'\n </label>\n </div>\n <div class="tui-image-editor-button line">\n <div>\n '+n(["normal","active"],"draw-line",!0)+"\n </div>\n <label>\n "+t.localize("Straight")+'\n </label>\n </div>\n </li>\n <li class="tui-image-editor-partition">\n <div></div>\n </li>\n <li>\n <div class="tie-draw-color" title="'+t.localize("Color")+'"></div>\n </li>\n <li class="tui-image-editor-partition only-left-right">\n <div></div>\n </li>\n <li class="tui-image-editor-newline tui-image-editor-range-wrap">\n <label class="range">'+t.localize("Range")+'</label>\n <div class="tie-draw-range"></div>\n <input class="tie-draw-range-value tui-image-editor-range-value" value="0" />\n </li>\n </ul>\n'}},"./src/js/ui/template/submenu/filter.js":
|
|
/*!**********************************************!*\
|
|
!*** ./src/js/ui/template/submenu/filter.js ***!
|
|
\**********************************************/
|
|
/*! no static exports found */function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){var t=e.locale;return'\n <ul class="tui-image-editor-submenu-item">\n <li class="tui-image-editor-submenu-align">\n <div class="tui-image-editor-checkbox-wrap fixed-width">\n <div class="tui-image-editor-checkbox">\n <label>\n <input type="checkbox" class="tie-grayscale">\n <span>'+t.localize("Grayscale")+'</span>\n </label>\n </div>\n <div class="tui-image-editor-checkbox">\n <label>\n <input type="checkbox" class="tie-invert">\n <span>'+t.localize("Invert")+'</span>\n </label>\n </div>\n <div class="tui-image-editor-checkbox">\n <label>\n <input type="checkbox" class="tie-sepia">\n <span>'+t.localize("Sepia")+'</span>\n </label>\n </div>\n <div class="tui-image-editor-checkbox">\n <label>\n <input type="checkbox" class="tie-vintage">\n <span>'+t.localize("Sepia2")+'</span>\n </label>\n </div>\n <div class="tui-image-editor-checkbox">\n <label>\n <input type="checkbox" class="tie-blur">\n <span>'+t.localize("Blur")+'</span>\n </label>\n </div>\n <div class="tui-image-editor-checkbox">\n <label>\n <input type="checkbox" class="tie-sharpen">\n <span>'+t.localize("Sharpen")+'</span>\n </label>\n </div>\n <div class="tui-image-editor-checkbox">\n <label>\n <input type="checkbox" class="tie-emboss">\n <span>'+t.localize("Emboss")+'</span>\n </label>\n </div>\n </div>\n </li>\n <li class="tui-image-editor-partition">\n <div></div>\n </li>\n <li class="tui-image-editor-submenu-align">\n <div class="tui-image-editor-checkbox-group tui-image-editor-disabled" style="margin-bottom: 7px;">\n <div class="tui-image-editor-checkbox-wrap">\n <div class="tui-image-editor-checkbox">\n <label>\n <input type="checkbox" class="tie-remove-white">\n <span>'+t.localize("Remove White")+'</span>\n </label>\n </div>\n </div>\n <div class="tui-image-editor-newline tui-image-editor-range-wrap short">\n <label>'+t.localize("Distance")+'</label>\n <div class="tie-removewhite-distance-range"></div>\n </div>\n </div>\n <div class="tui-image-editor-checkbox-group tui-image-editor-disabled">\n <div class="tui-image-editor-checkbox">\n <label>\n <input type="checkbox" class="tie-brightness">\n <span>'+t.localize("Brightness")+'</span>\n </label>\n </div>\n <div class="tui-image-editor-range-wrap short">\n <div class="tie-brightness-range"></div>\n </div>\n </div>\n <div class="tui-image-editor-checkbox-group tui-image-editor-disabled">\n <div class="tui-image-editor-checkbox">\n <label>\n <input type="checkbox" class="tie-noise">\n <span>'+t.localize("Noise")+'</span>\n </label>\n </div>\n <div class="tui-image-editor-range-wrap short">\n <div class="tie-noise-range"></div>\n </div>\n </div>\n </li>\n <li class="tui-image-editor-partition only-left-right">\n <div></div>\n </li>\n <li class="tui-image-editor-submenu-align">\n <div class="tui-image-editor-checkbox-group tui-image-editor-disabled">\n <div class="tui-image-editor-checkbox">\n <label>\n <input type="checkbox" class="tie-pixelate">\n <span>'+t.localize("Pixelate")+'</span>\n </label>\n </div>\n <div class="tui-image-editor-range-wrap short">\n <div class="tie-pixelate-range"></div>\n </div>\n </div>\n <div class="tui-image-editor-checkbox-group tui-image-editor-disabled">\n <div class="tui-image-editor-newline tui-image-editor-checkbox-wrap">\n <div class="tui-image-editor-checkbox">\n <label>\n <input type="checkbox" class="tie-color-filter">\n <span>'+t.localize("Color Filter")+'</span>\n </label>\n </div>\n </div>\n <div class="tui-image-editor-newline tui-image-editor-range-wrap short">\n <label>'+t.localize("Threshold")+'</label>\n <div class="tie-colorfilter-threshold-range"></div>\n </div>\n </div>\n </li>\n <li class="tui-image-editor-partition">\n <div></div>\n </li>\n <li>\n <div class="filter-color-item">\n <div class="tie-filter-tint-color" title="'+t.localize("Tint")+'"></div>\n <div class="tui-image-editor-checkbox">\n <label>\n <input type="checkbox" class="tie-tint">\n <span></span>\n </label>\n </div>\n </div>\n <div class="filter-color-item">\n <div class="tie-filter-multiply-color" title="'+t.localize("Multiply")+'"></div>\n <div class="tui-image-editor-checkbox">\n <label>\n <input type="checkbox" class="tie-multiply">\n <span></span>\n </label>\n </div>\n </div>\n <div class="filter-color-item">\n <div class="tie-filter-blend-color" title="'+t.localize("Blend")+'"></div>\n <div class="tui-image-editor-checkbox">\n <label>\n <input type="checkbox" class="tie-blend">\n <span></span>\n </label>\n </div>\n </div>\n </li>\n </ul>\n'}},"./src/js/ui/template/submenu/flip.js":
|
|
/*!********************************************!*\
|
|
!*** ./src/js/ui/template/submenu/flip.js ***!
|
|
\********************************************/
|
|
/*! no static exports found */function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){var t=e.locale,n=e.makeSvgIcon;return'\n <ul class="tie-flip-button tui-image-editor-submenu-item">\n <li>\n <div class="tui-image-editor-button flipX">\n <div>\n '+n(["normal","active"],"flip-x",!0)+"\n </div>\n <label>\n "+t.localize("Flip X")+'\n </label>\n </div>\n <div class="tui-image-editor-button flipY">\n <div>\n '+n(["normal","active"],"flip-y",!0)+"\n </div>\n <label>\n "+t.localize("Flip Y")+'\n </label>\n </div>\n </li>\n <li class="tui-image-editor-partition">\n <div></div>\n </li>\n <li>\n <div class="tui-image-editor-button resetFlip">\n <div>\n '+n(["normal","active"],"flip-reset",!0)+"\n </div>\n <label>\n "+t.localize("Reset")+"\n </label>\n </div>\n </li>\n </ul>\n"}},"./src/js/ui/template/submenu/history.js":
|
|
/*!***********************************************!*\
|
|
!*** ./src/js/ui/template/submenu/history.js ***!
|
|
\***********************************************/
|
|
/*! no static exports found */function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){var t=e.locale,n=e.makeSvgIcon,o=e.name,i=e.detail;return'\n <div class="tui-image-editor-history-item history">\n <div class="history-item-icon">\n '+n(["normal","active"],"history-"+o.toLowerCase(),!0)+"\n </div>\n <span>\n "+t.localize(o)+"\n "+(i?"("+t.localize(i)+")":"")+'\n </span>\n <div class="history-item-checkbox">\n '+n(["normal"],"history-check",!0)+"\n </div>\n </div>\n"}},"./src/js/ui/template/submenu/icon.js":
|
|
/*!********************************************!*\
|
|
!*** ./src/js/ui/template/submenu/icon.js ***!
|
|
\********************************************/
|
|
/*! no static exports found */function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){var t=e.locale,n=e.makeSvgIcon;return'\n <ul class="tui-image-editor-submenu-item">\n <li class="tie-icon-add-button">\n <div class="tui-image-editor-button" data-icontype="icon-arrow">\n <div>\n '+n(["normal","active"],"icon-arrow",!0)+"\n </div>\n <label>\n "+t.localize("Arrow")+'\n </label>\n </div>\n <div class="tui-image-editor-button" data-icontype="icon-arrow-2">\n <div>\n '+n(["normal","active"],"icon-arrow-2",!0)+"\n </div>\n <label>\n "+t.localize("Arrow-2")+'\n </label>\n </div>\n <div class="tui-image-editor-button" data-icontype="icon-arrow-3">\n <div>\n '+n(["normal","active"],"icon-arrow-3",!0)+"\n </div>\n <label>\n "+t.localize("Arrow-3")+'\n </label>\n </div>\n <div class="tui-image-editor-button" data-icontype="icon-star">\n <div>\n '+n(["normal","active"],"icon-star",!0)+"\n </div>\n <label>\n "+t.localize("Star-1")+'\n </label>\n </div>\n <div class="tui-image-editor-button" data-icontype="icon-star-2">\n <div>\n '+n(["normal","active"],"icon-star-2",!0)+"\n </div>\n <label>\n "+t.localize("Star-2")+'\n </label>\n </div>\n\n <div class="tui-image-editor-button" data-icontype="icon-polygon">\n <div>\n '+n(["normal","active"],"icon-polygon",!0)+"\n </div>\n <label>\n "+t.localize("Polygon")+'\n </label>\n </div>\n\n <div class="tui-image-editor-button" data-icontype="icon-location">\n <div>\n '+n(["normal","active"],"icon-location",!0)+"\n </div>\n <label>\n "+t.localize("Location")+'\n </label>\n </div>\n\n <div class="tui-image-editor-button" data-icontype="icon-heart">\n <div>\n '+n(["normal","active"],"icon-heart",!0)+"\n </div>\n <label>\n "+t.localize("Heart")+'\n </label>\n </div>\n\n <div class="tui-image-editor-button" data-icontype="icon-bubble">\n <div>\n '+n(["normal","active"],"icon-bubble",!0)+"\n </div>\n <label>\n "+t.localize("Bubble")+'\n </label>\n </div>\n </li>\n <li class="tui-image-editor-partition">\n <div></div>\n </li>\n <li class="tie-icon-add-button">\n <div class="tui-image-editor-button" style="margin:0">\n <div>\n <input type="file" accept="image/*" class="tie-icon-image-file">\n '+n(["normal","active"],"icon-load",!0)+"\n </div>\n <label>\n "+t.localize("Custom icon")+'\n </label>\n </div>\n </li>\n <li class="tui-image-editor-partition">\n <div></div>\n </li>\n <li>\n <div class="tie-icon-color" title="'+t.localize("Color")+'"></div>\n </li>\n </ul>\n'}},"./src/js/ui/template/submenu/mask.js":
|
|
/*!********************************************!*\
|
|
!*** ./src/js/ui/template/submenu/mask.js ***!
|
|
\********************************************/
|
|
/*! no static exports found */function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){var t=e.locale,n=e.makeSvgIcon;return'\n <ul class="tui-image-editor-submenu-item">\n <li>\n <div class="tui-image-editor-button">\n <div>\n <input type="file" accept="image/*" class="tie-mask-image-file">\n '+n(["normal","active"],"mask-load",!0)+"\n </div>\n <label> "+t.localize("Load Mask Image")+' </label>\n </div>\n </li>\n <li class="tui-image-editor-partition only-left-right">\n <div></div>\n </li>\n <li class="tie-mask-apply tui-image-editor-newline apply" style="margin-top: 22px;margin-bottom: 5px">\n <div class="tui-image-editor-button apply">\n '+n(["normal","active"],"apply")+"\n <label>\n "+t.localize("Apply")+"\n </label>\n </div>\n </li>\n </ul>\n"}},"./src/js/ui/template/submenu/rotate.js":
|
|
/*!**********************************************!*\
|
|
!*** ./src/js/ui/template/submenu/rotate.js ***!
|
|
\**********************************************/
|
|
/*! no static exports found */function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){var t=e.locale,n=e.makeSvgIcon;return'\n <ul class="tui-image-editor-submenu-item">\n <li class="tie-rotate-button">\n <div class="tui-image-editor-button clockwise">\n <div>\n '+n(["normal","active"],"rotate-clockwise",!0)+'\n </div>\n <label> 30 </label>\n </div>\n <div class="tui-image-editor-button counterclockwise">\n <div>\n '+n(["normal","active"],"rotate-counterclockwise",!0)+'\n </div>\n <label> -30 </label>\n </div>\n </li>\n <li class="tui-image-editor-partition only-left-right">\n <div></div>\n </li>\n <li class="tui-image-editor-newline tui-image-editor-range-wrap">\n <label class="range">'+t.localize("Range")+'</label>\n <div class="tie-rotate-range"></div>\n <input class="tie-rotate-range-value tui-image-editor-range-value" value="0" />\n </li>\n </ul>\n'}},"./src/js/ui/template/submenu/shape.js":
|
|
/*!*********************************************!*\
|
|
!*** ./src/js/ui/template/submenu/shape.js ***!
|
|
\*********************************************/
|
|
/*! no static exports found */function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){var t=e.locale,n=e.makeSvgIcon;return'\n <ul class="tui-image-editor-submenu-item">\n <li class="tie-shape-button">\n <div class="tui-image-editor-button rect">\n <div>\n '+n(["normal","active"],"shape-rectangle",!0)+"\n </div>\n <label> "+t.localize("Rectangle")+' </label>\n </div>\n <div class="tui-image-editor-button circle">\n <div>\n '+n(["normal","active"],"shape-circle",!0)+"\n </div>\n <label> "+t.localize("Circle")+' </label>\n </div>\n <div class="tui-image-editor-button triangle">\n <div>\n '+n(["normal","active"],"shape-triangle",!0)+"\n </div>\n <label> "+t.localize("Triangle")+' </label>\n </div>\n </li>\n <li class="tui-image-editor-partition">\n <div></div>\n </li>\n <li class="tie-shape-color-button">\n <div class="tie-color-fill" title="'+t.localize("Fill")+'"></div>\n <div class="tie-color-stroke" title="'+t.localize("Stroke")+'"></div>\n </li>\n <li class="tui-image-editor-partition only-left-right">\n <div></div>\n </li>\n <li class="tui-image-editor-newline tui-image-editor-range-wrap">\n <label class="range">'+t.localize("Stroke")+'</label>\n <div class="tie-stroke-range"></div>\n <input class="tie-stroke-range-value tui-image-editor-range-value" value="0" />\n </li>\n </ul>\n'}},"./src/js/ui/template/submenu/text.js":
|
|
/*!********************************************!*\
|
|
!*** ./src/js/ui/template/submenu/text.js ***!
|
|
\********************************************/
|
|
/*! no static exports found */function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){var t=e.locale,n=e.makeSvgIcon;return'\n <ul class="tui-image-editor-submenu-item">\n <li class="tie-text-effect-button">\n <div class="tui-image-editor-button bold">\n <div>\n '+n(["normal","active"],"text-bold",!0)+"\n </div>\n <label> "+t.localize("Bold")+' </label>\n </div>\n <div class="tui-image-editor-button italic">\n <div>\n '+n(["normal","active"],"text-italic",!0)+"\n </div>\n <label> "+t.localize("Italic")+' </label>\n </div>\n <div class="tui-image-editor-button underline">\n <div>\n '+n(["normal","active"],"text-underline",!0)+"\n </div>\n <label> "+t.localize("Underline")+' </label>\n </div>\n </li>\n <li class="tui-image-editor-partition">\n <div></div>\n </li>\n <li class="tie-text-align-button">\n <div class="tui-image-editor-button left">\n <div>\n '+n(["normal","active"],"text-align-left",!0)+"\n </div>\n <label> "+t.localize("Left")+' </label>\n </div>\n <div class="tui-image-editor-button center">\n <div>\n '+n(["normal","active"],"text-align-center",!0)+"\n </div>\n <label> "+t.localize("Center")+' </label>\n </div>\n <div class="tui-image-editor-button right">\n <div>\n '+n(["normal","active"],"text-align-right",!0)+"\n </div>\n <label> "+t.localize("Right")+' </label>\n </div>\n </li>\n <li class="tui-image-editor-partition">\n <div></div>\n </li>\n <li>\n <div class="tie-text-color" title="'+t.localize("Color")+'"></div>\n </li>\n <li class="tui-image-editor-partition only-left-right">\n <div></div>\n </li>\n <li class="tui-image-editor-newline tui-image-editor-range-wrap">\n <label class="range">'+t.localize("Text size")+'</label>\n <div class="tie-text-range"></div>\n <input class="tie-text-range-value tui-image-editor-range-value" value="0" />\n </li>\n </ul>\n'}},"./src/js/ui/text.js":
|
|
/*!***************************!*\
|
|
!*** ./src/js/ui/text.js ***!
|
|
\***************************/
|
|
/*! no static exports found */function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var o=function(){function e(e,t){for(var n=0;n<t.length;n++){var o=t[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}return function(t,n,o){return n&&e(t.prototype,n),o&&e(t,o),t}}(),i=u(n(/*! @/ui/tools/range */"./src/js/ui/tools/range.js")),r=u(n(/*! @/ui/tools/colorpicker */"./src/js/ui/tools/colorpicker.js")),s=u(n(/*! @/ui/submenuBase */"./src/js/ui/submenuBase.js")),a=u(n(/*! @/ui/template/submenu/text */"./src/js/ui/template/submenu/text.js")),l=n(/*! @/util */"./src/js/util.js"),c=n(/*! @/consts */"./src/js/consts.js");function u(e){return e&&e.__esModule?e:{default:e}}var d=function(e){function t(e,n){var o=n.locale,s=n.makeSvgIcon,l=n.menuBarPosition,u=n.usageStatistics;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t);var d=function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e,{locale:o,name:"text",makeSvgIcon:s,menuBarPosition:l,templateHtml:a.default,usageStatistics:u}));return d.effect={bold:!1,italic:!1,underline:!1},d.align="left",d._els={textEffectButton:d.selector(".tie-text-effect-button"),textAlignButton:d.selector(".tie-text-align-button"),textColorpicker:new r.default(d.selector(".tie-text-color"),"#ffbb3b",d.toggleDirection,d.usageStatistics),textRange:new i.default({slider:d.selector(".tie-text-range"),input:d.selector(".tie-text-range-value")},c.defaultTextRangeValues)},d.colorPickerInputBox=d._els.textColorpicker.colorpickerElement.querySelector(c.selectorNames.COLOR_PICKER_INPUT_BOX),d}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,e),o(t,[{key:"destroy",value:function(){this._removeEvent(),this._els.textColorpicker.destroy(),this._els.textRange.destroy(),(0,l.assignmentForDestroy)(this)}},{key:"addEvent",value:function(e){var t=this._setTextEffectHandler.bind(this),n=this._setTextAlignHandler.bind(this);this.eventHandler={setTextEffect:t,setTextAlign:n},this.actions=e,this._els.textEffectButton.addEventListener("click",t),this._els.textAlignButton.addEventListener("click",n),this._els.textRange.on("change",this._changeTextRnageHandler.bind(this)),this._els.textColorpicker.on("change",this._changeColorHandler.bind(this)),this.colorPickerInputBox.addEventListener(c.eventNames.FOCUS,this._onStartEditingInputBox.bind(this)),this.colorPickerInputBox.addEventListener(c.eventNames.BLUR,this._onStopEditingInputBox.bind(this))}},{key:"_removeEvent",value:function(){var e=this.eventHandler,t=e.setTextEffect,n=e.setTextAlign;this._els.textEffectButton.removeEventListener("click",t),this._els.textAlignButton.removeEventListener("click",n),this._els.textRange.off(),this._els.textColorpicker.off(),this.colorPickerInputBox.removeEventListener(c.eventNames.FOCUS,this._onStartEditingInputBox.bind(this)),this.colorPickerInputBox.removeEventListener(c.eventNames.BLUR,this._onStopEditingInputBox.bind(this))}},{key:"changeStandbyMode",value:function(){this.actions.stopDrawingMode()}},{key:"changeStartMode",value:function(){this.actions.modeChange("text")}},{key:"setTextStyleStateOnAction",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.fill,n=e.fontSize,o=e.fontStyle,i=e.fontWeight,r=e.textDecoration,s=e.textAlign;this.textColor=t,this.fontSize=n,this.setEffectState("italic",o),this.setEffectState("bold",i),this.setEffectState("underline",r),this.setAlignState(s)}},{key:"setEffectState",value:function(e,t){var n="italic"===t||"bold"===t||"underline"===t,o=this._els.textEffectButton.querySelector(".tui-image-editor-button."+e);this.effect[e]=n,o.classList[n?"add":"remove"]("active")}},{key:"setAlignState",value:function(e){var t=this._els.textAlignButton;t.classList.remove(this.align),t.classList.add(e),this.align=e}},{key:"_setTextEffectHandler",value:function(e){var t=e.target.closest(".tui-image-editor-button");if(t){var n=t.className.match(/(bold|italic|underline)/)[0],o={bold:{fontWeight:"bold"},italic:{fontStyle:"italic"},underline:{textDecoration:"underline"}}[n];this.effect[n]=!this.effect[n],t.classList.toggle("active"),this.actions.changeTextStyle(o)}}},{key:"_setTextAlignHandler",value:function(e){var t=e.target.closest(".tui-image-editor-button");if(t){var n=this.getButtonType(t,["left","center","right"]);e.currentTarget.classList.remove(this.align),this.align!==n&&e.currentTarget.classList.add(n),this.actions.changeTextStyle({textAlign:n}),this.align=n}}},{key:"_changeTextRnageHandler",value:function(e,t){this.actions.changeTextStyle({fontSize:e},!t)}},{key:"_changeColorHandler",value:function(e){e=e||"transparent",this.actions.changeTextStyle({fill:e})}},{key:"textColor",set:function(e){this._els.textColorpicker.color=e},get:function(){return this._els.textColorpicker.color}},{key:"fontSize",get:function(){return this._els.textRange.value},set:function(e){this._els.textRange.value=e}},{key:"fontStyle",get:function(){return this.effect.italic?"italic":"normal"}},{key:"fontWeight",get:function(){return this.effect.bold?"bold":"normal"}},{key:"underline",get:function(){return this.effect.underline}}]),t}(s.default);t.default=d},"./src/js/ui/theme/standard.js":
|
|
/*!*************************************!*\
|
|
!*** ./src/js/ui/theme/standard.js ***!
|
|
\*************************************/
|
|
/*! no static exports found */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"}},"./src/js/ui/theme/theme.js":
|
|
/*!**********************************!*\
|
|
!*** ./src/js/ui/theme/theme.js ***!
|
|
\**********************************/
|
|
/*! no static exports found */function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var o=function(){function e(e,t){for(var n=0;n<t.length;n++){var o=t[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}return function(t,n,o){return n&&e(t.prototype,n),o&&e(t,o),t}}(),i=n(/*! tui-code-snippet */"tui-code-snippet"),r=c(n(/*! @/ui/template/style */"./src/js/ui/template/style.js")),s=c(n(/*! @/ui/theme/standard */"./src/js/ui/theme/standard.js")),a=c(n(/*! @svg/default.svg */"./src/svg/default.svg")),l=n(/*! @/util */"./src/js/util.js");function c(e){return e&&e.__esModule?e:{default:e}}var u=function(){function e(t){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.styles=this._changeToObject((0,i.extend)({},s.default,t)),(0,l.styleLoad)(this._styleMaker()),this._loadDefaultSvgIcon()}return o(e,[{key:"getStyle",value:function(e){var t=null,n=e.replace(/\..+$/,""),o=this.styles[e];switch(e){case"common.bi":t=this.styles[e].image;break;case"menu.icon":t={active:this.styles[n+".activeIcon"],normal:this.styles[n+".normalIcon"],hover:this.styles[n+".hoverIcon"],disabled:this.styles[n+".disabledIcon"]};break;case"submenu.icon":t={active:this.styles[n+".activeIcon"],normal:this.styles[n+".normalIcon"]};break;case"submenu.label":t={active:this._makeCssText(this.styles[n+".activeLabel"]),normal:this._makeCssText(this.styles[n+".normalLabel"])};break;case"submenu.partition":t={vertical:this._makeCssText((0,i.extend)({},o,{borderLeft:"1px solid "+o.color})),horizontal:this._makeCssText((0,i.extend)({},o,{borderBottom:"1px solid "+o.color}))};break;case"range.disabledPointer":case"range.disabledBar":case"range.disabledSubbar":case"range.pointer":case"range.bar":case"range.subbar":o.backgroundColor=o.color,t=this._makeCssText(o);break;default:t=this._makeCssText(o)}return t}},{key:"_styleMaker",value:function(){var e=this.getStyle("submenu.label"),t=this.getStyle("submenu.partition");return(0,r.default)({subMenuLabelActive:e.active,subMenuLabelNormal:e.normal,submenuPartitionVertical:t.vertical,submenuPartitionHorizontal:t.horizontal,biSize:this.getStyle("common.bisize"),subMenuRangeTitle:this.getStyle("range.title"),submenuRangePointer:this.getStyle("range.pointer"),submenuRangeBar:this.getStyle("range.bar"),submenuRangeSubbar:this.getStyle("range.subbar"),submenuDisabledRangePointer:this.getStyle("range.disabledPointer"),submenuDisabledRangeBar:this.getStyle("range.disabledBar"),submenuDisabledRangeSubbar:this.getStyle("range.disabledSubbar"),submenuRangeValue:this.getStyle("range.value"),submenuColorpickerTitle:this.getStyle("colorpicker.title"),submenuColorpickerButton:this.getStyle("colorpicker.button"),submenuCheckbox:this.getStyle("checkbox"),menuIconSize:this.getStyle("menu.iconSize"),submenuIconSize:this.getStyle("submenu.iconSize"),menuIconStyle:this.getStyle("menu.icon"),submenuIconStyle:this.getStyle("submenu.icon")})}},{key:"_changeToObject",value:function(e){var t={};return(0,i.forEach)(e,(function(e,n){var o=n.match(/^(.+)\.([a-z]+)$/i),i=o[1],r=o[2];t[i]||(t[i]={}),t[i][r]=e})),t}},{key:"_makeCssText",value:function(e){var t=this,n=[];return(0,i.forEach)(e,(function(e,o){["backgroundImage"].indexOf(o)>-1&&"none"!==e&&(e="url("+e+")"),n.push(t._toUnderScore(o)+": "+e)})),n.join(";")}},{key:"_toUnderScore",value:function(e){return e.replace(/([A-Z])/g,(function(e,t){return"-"+t.toLowerCase()}))}},{key:"_loadDefaultSvgIcon",value:function(){if(!document.getElementById("tui-image-editor-svg-default-icons")){var e=(new DOMParser).parseFromString(a.default,"text/xml");document.body.appendChild(e.documentElement)}}},{key:"_makeIconClassName",value:function(e,t){var n=(t?this.getStyle("submenu.icon"):this.getStyle("menu.icon"))[e],o=n.path,i=n.name;return o&&i?e:e+" use-default"}},{key:"_makeSvgIconPrefix",value:function(e,t){var n=(t?this.getStyle("submenu.icon"):this.getStyle("menu.icon"))[e],o=n.path,i=n.name;return o&&i?o+"#"+i+"-":"#"}},{key:"_makeSvgItem",value:function(e,t,n){var o=this;return(0,i.map)(e,(function(e){return'<use xlink:href="'+o._makeSvgIconPrefix(e,n)+"ic-"+o._toUnderScore(t)+'" class="'+o._makeIconClassName(e,n)+'"/>'})).join("")}},{key:"makeMenSvgIconSet",value:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];return'<svg class="svg_ic-'+(n?"submenu":"menu")+'">'+this._makeSvgItem(e,t,n)+"</svg>"}}]),e}();t.default=u},"./src/js/ui/tools/colorpicker.js":
|
|
/*!****************************************!*\
|
|
!*** ./src/js/ui/tools/colorpicker.js ***!
|
|
\****************************************/
|
|
/*! no static exports found */function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var o=function(){function e(e,t){for(var n=0;n<t.length;n++){var o=t[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}return function(t,n,o){return n&&e(t.prototype,n),o&&e(t,o),t}}(),i=s(n(/*! tui-code-snippet */"tui-code-snippet")),r=s(n(/*! tui-color-picker */"tui-color-picker"));function s(e){return e&&e.__esModule?e:{default:e}}function a(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}var l=["#000000","#2a2a2a","#545454","#7e7e7e","#a8a8a8","#d2d2d2","#ffffff","","#ff4040","#ff6518","#ffbb3b","#03bd9e","#00a9ff","#515ce6","#9e5fff","#ff5583"],c=function(){function e(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"#7e7e7e",o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"up",i=arguments[3];a(this,e),this.colorpickerElement=t,this.usageStatistics=i,this._show=!1,this._colorpickerElement=t,this._toggleDirection=o,this._makePickerButtonElement(n),this._makePickerLayerElement(t,t.getAttribute("title")),this._color=n,this.picker=r.default.create({container:this.pickerElement,preset:l,color:n,usageStatistics:this.usageStatistics}),this._addEvent()}return o(e,[{key:"destroy",value:function(){var e=this;this._removeEvent(),this.picker.destroy(),this.colorpickerElement.innerHTML="",i.default.forEach(this,(function(t,n){e[n]=null}))}},{key:"_changeColorElement",value:function(e){e?(this.colorElement.classList.remove("transparent"),this.colorElement.style.backgroundColor=e):(this.colorElement.style.backgroundColor="#fff",this.colorElement.classList.add("transparent"))}},{key:"_makePickerButtonElement",value:function(e){this.colorpickerElement.classList.add("tui-image-editor-button"),this.colorElement=document.createElement("div"),this.colorElement.className="color-picker-value",e?this.colorElement.style.backgroundColor=e:this.colorElement.classList.add("transparent")}},{key:"_makePickerLayerElement",value:function(e,t){var n=document.createElement("label"),o=document.createElement("div");this.pickerControl=document.createElement("div"),this.pickerControl.className="color-picker-control",this.pickerElement=document.createElement("div"),this.pickerElement.className="color-picker",n.innerHTML=t,o.className="triangle",this.pickerControl.appendChild(this.pickerElement),this.pickerControl.appendChild(o),e.appendChild(this.pickerControl),e.appendChild(this.colorElement),e.appendChild(n)}},{key:"_addEvent",value:function(){var e=this;this.picker.on("selectColor",(function(t){e._changeColorElement(t.color),e._color=t.color,e.fire("change",t.color)})),this.eventHandler={pickerToggle:this._pickerToggleEventHandler.bind(this),pickerHide:function(){return e.hide()}},this.colorpickerElement.addEventListener("click",this.eventHandler.pickerToggle),document.body.addEventListener("click",this.eventHandler.pickerHide)}},{key:"_removeEvent",value:function(){this.colorpickerElement.removeEventListener("click",this.eventHandler.pickerToggle),document.body.removeEventListener("click",this.eventHandler.pickerHide),this.picker.off()}},{key:"_pickerToggleEventHandler",value:function(e){var t=e.target,n=t&&this._isElementInColorPickerControl(t);(!n||n&&this._isPaletteButton(t))&&(this._show=!this._show,this.pickerControl.style.display=this._show?"block":"none",this._setPickerControlPosition(),this.fire("changeShow",this)),e.stopPropagation()}},{key:"_isPaletteButton",value:function(e){return"tui-colorpicker-palette-button"===e.className}},{key:"_isElementInColorPickerControl",value:function(e){for(var t=e;t!==document.body&&t;){if(t===this.pickerControl)return!0;t=t.parentNode}return!1}},{key:"hide",value:function(){this._show=!1,this.pickerControl.style.display="none"}},{key:"_setPickerControlPosition",value:function(){var e=this.pickerControl.style,t=this._colorpickerElement.clientWidth/2+2,n=this.pickerControl.offsetWidth/2-t,o=-1*(this.pickerControl.offsetHeight+10);"down"===this._toggleDirection&&(o=30),e.top=o+"px",e.left="-"+n+"px"}},{key:"color",get:function(){return this._color},set:function(e){this._color=e,this._changeColorElement(e)}}]),e}();i.default.CustomEvents.mixin(c),t.default=c},"./src/js/ui/tools/range.js":
|
|
/*!**********************************!*\
|
|
!*** ./src/js/ui/tools/range.js ***!
|
|
\**********************************/
|
|
/*! no static exports found */function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var o,i=function(){function e(e,t){for(var n=0;n<t.length;n++){var o=t[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}return function(t,n,o){return n&&e(t.prototype,n),o&&e(t,o),t}}(),r=n(/*! tui-code-snippet */"tui-code-snippet"),s=(o=r)&&o.__esModule?o:{default:o},a=n(/*! @/util */"./src/js/util.js"),l=n(/*! @/consts */"./src/js/consts.js");function c(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}var u=/(-?)([0-9]*)[^0-9]*([0-9]*)/g,d=function(){function e(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};c(this,e),this._value=n.value||0,this.rangeElement=t.slider,this.rangeInputElement=t.input,this._drawRangeElement(),this.rangeWidth=this._getRangeWidth(),this._min=n.min||0,this._max=n.max||100,this._useDecimal=n.useDecimal,this._absMax=-1*this._min+this._max,this.realTimeEvent=n.realTimeEvent||!1,this.eventHandler={startChangingSlide:this._startChangingSlide.bind(this),stopChangingSlide:this._stopChangingSlide.bind(this),changeSlide:this._changeSlide.bind(this),changeSlideFinally:this._changeSlideFinally.bind(this),changeInput:this._changeValueWithInput.bind(this,!1),changeInputFinally:this._changeValueWithInput.bind(this,!0),changeInputWithArrow:this._changeValueWithInputKeyEvent.bind(this)},this._addClickEvent(),this._addDragEvent(),this._addInputEvent(),this.value=n.value,this.trigger("change")}return i(e,[{key:"destroy",value:function(){var e=this;this._removeClickEvent(),this._removeDragEvent(),this._removeInputEvent(),this.rangeElement.innerHTML="",s.default.forEach(this,(function(t,n){e[n]=null}))}},{key:"trigger",value:function(e){this.fire(e,this._value)}},{key:"_getRangeWidth",value:function(){var e=function(e){return(0,a.toInteger)(window.getComputedStyle(e,null).width)};return e(this.rangeElement)-e(this.pointer)}},{key:"_drawRangeElement",value:function(){this.rangeElement.classList.add("tui-image-editor-range"),this.bar=document.createElement("div"),this.bar.className="tui-image-editor-virtual-range-bar",this.subbar=document.createElement("div"),this.subbar.className="tui-image-editor-virtual-range-subbar",this.pointer=document.createElement("div"),this.pointer.className="tui-image-editor-virtual-range-pointer",this.bar.appendChild(this.subbar),this.bar.appendChild(this.pointer),this.rangeElement.appendChild(this.bar)}},{key:"_addInputEvent",value:function(){this.rangeInputElement&&(this.rangeInputElement.addEventListener("keydown",this.eventHandler.changeInputWithArrow),this.rangeInputElement.addEventListener("keyup",this.eventHandler.changeInput),this.rangeInputElement.addEventListener("blur",this.eventHandler.changeInputFinally))}},{key:"_removeInputEvent",value:function(){this.rangeInputElement&&(this.rangeInputElement.removeEventListener("keydown",this.eventHandler.changeInputWithArrow),this.rangeInputElement.removeEventListener("keyup",this.eventHandler.changeInput),this.rangeInputElement.removeEventListener("blur",this.eventHandler.changeInputFinally))}},{key:"_changeValueWithInputKeyEvent",value:function(e){var t=e.keyCode,n=e.target;if(!([l.keyCodes.ARROW_UP,l.keyCodes.ARROW_DOWN].indexOf(t)<0)){var o=Number(n.value);if(!((o=this._valueUpDownForKeyEvent(o,t))<this._min||o>this._max)){var i=(0,a.clamp)(o,this._min,this.max);this.value=i,this.fire("change",i,!1)}}}},{key:"_valueUpDownForKeyEvent",value:function(e,t){var n=this._useDecimal?.1:1;return t===l.keyCodes.ARROW_UP?e+=n:t===l.keyCodes.ARROW_DOWN&&(e-=n),e}},{key:"_changeValueWithInput",value:function(e,t){var n=t.keyCode,o=t.target;if(!([l.keyCodes.ARROW_UP,l.keyCodes.ARROW_DOWN].indexOf(n)>=0)){var i=this._filterForInputText(o.value),r=!i||isNaN(i);if(o.value=i,!r){var s=this._useDecimal?Number(i):(0,a.toInteger)(i);s=(0,a.clamp)(s,this._min,this.max),this.value=s,this.fire("change",s,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 o=n/this.rangeWidth,i=this._absMax*o+this._min,r=this._useDecimal?i:(0,a.toInteger)(i);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,a.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,a.toInteger)(e))-this._min)*this.rangeWidth/this._absMax;this.rangeWidth<t&&(t=this.rangeWidth),this.pointer.style.left=t+"px",this.subbar.style.right=this.rangeWidth-t+"px",this._value=e,this.rangeInputElement&&(this.rangeInputElement.value=e)}}]),e}();s.default.CustomEvents.mixin(d),t.default=d},"./src/js/util.js":
|
|
/*!************************!*\
|
|
!*** ./src/js/util.js ***!
|
|
\************************/
|
|
/*! no static exports found */function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Promise=void 0,t.clamp=function(e,t,n){if(t>n){var o=[n,t];t=o[0],n=o[1]}return u(t,c(e,n))},t.keyMirror=function(){for(var e={},t=arguments.length,n=Array(t),o=0;o<t;o++)n[o]=arguments[o];return(0,i.forEach)(n,(function(t){e[t]=t})),e},t.makeStyleText=function(e){var t="";return(0,i.forEach)(e,(function(e,n){t+=n+": "+e+";"})),t},t.getProperties=function(e,t){var n={},o=t.length,i=0,r=void 0;for(i=0;i<o;i+=1)r=t[i],n[r]=e[r];return n},t.toInteger=function(e){return parseInt(e,10)},t.toCamelCase=function(e){return e.replace(/-([a-z])/g,(function(e,t){return t.toUpperCase()}))},t.isSupportFileApi=function(){return!!(window.File&&window.FileList&&window.FileReader)},t.getRgb=function(e,t){4===e.length&&(e=""+e+e.slice(1,4));var n=parseInt(e.slice(1,3),16),o=parseInt(e.slice(3,5),16),i=parseInt(e.slice(5,7),16);return"rgba("+n+", "+o+", "+i+", "+(t||1)+")"},t.sendHostName=function(){if(d)return;d=!0,(0,i.sendHostname)("image-editor","UA-129999381-1")},t.styleLoad=function(e,t){var n=document.getElementsByTagName("head")[0],o=document.createElement("link"),i=encodeURIComponent(e);t&&(o.id=t);o.setAttribute("rel","stylesheet"),o.setAttribute("type","text/css"),o.setAttribute("href","data:text/css;charset=UTF-8,"+i),n.appendChild(o)},t.getSelector=function(e){return function(t){return e.querySelector(t)}},t.base64ToBlob=function(e){var t="",n=void 0,o=void 0,i=void 0;n=e.replace(/data:(image\/.+);base64,/,(function(e,n){return t=n,""}));var r=(n=atob(n)).length;for(o=new Uint8Array(r),i=0;i<r;i+=1)o[i]=n.charCodeAt(i);return new Blob([o],{type:t})},t.fixFloatingPoint=function(e){return Number(e.toFixed(2))},t.assignmentForDestroy=function(e){(0,i.forEach)(e,(function(t,n){e[n]=null}))},t.cls=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";if("."===e.charAt(0))return"."+l+t+e.slice(1);return""+l+t+e},t.changeOrigin=function(e,t){var n=t.originX,o=t.originY,i=e.getPointByOrigin(n,o),r=i.x,s=i.y;e.set({left:r,top:s,originX:n,originY:o}),e.setCoords()},t.flipObject=function(e){var t={};return Object.keys(e).forEach((function(n){t[e[n]]=n})),t},t.setCustomProperty=function(e,t){e.customProps=e.customProps||{},(0,i.extend)(e.customProps,t)},t.getCustomProperty=function(e,t){var n={};(0,i.isString)(t)&&(t=[t]);return(0,i.forEach)(t,(function(t){n[t]=e.customProps[t]})),n},t.capitalizeString=function(e){return e.charAt(0).toUpperCase()+e.slice(1)},t.includes=h,t.getFillTypeFromOption=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return(0,i.pick)(e,"type")||a.SHAPE_FILL_TYPE.COLOR},t.getFillTypeFromObject=function(e){var t=e.fill;if((void 0===t?{}:t).source)return a.SHAPE_FILL_TYPE.FILTER;return a.SHAPE_FILL_TYPE.COLOR},t.isShape=function(e){return(0,i.inArray)(e.get("type"),a.SHAPE_TYPE)>=0},t.getObjectType=function(e){if(h(a.SHAPE_TYPE,e))return"Shape";switch(e){case"i-text":return"Text";case"path":case"line":return"Draw";case"activeSelection":return"Group";default:return p(e)}},t.isSilentCommand=function(e){var t=a.commandNames.LOAD_IMAGE;return"string"==typeof e?t===e:t===e.name},t.getHistoryTitle=function(e){var t=a.commandNames.FLIP_IMAGE,n=a.commandNames.ROTATE_IMAGE,o=a.commandNames.ADD_TEXT,i=a.commandNames.APPLY_FILTER,r=a.commandNames.REMOVE_FILTER,s=a.commandNames.CHANGE_SHAPE,l=a.commandNames.CHANGE_ICON_COLOR,c=a.commandNames.CHANGE_TEXT_STYLE,u=a.commandNames.CLEAR_OBJECTS,d=a.commandNames.ADD_IMAGE_OBJECT,h=a.commandNames.REMOVE_OBJECT,p=e.name,m=e.args,v=void 0;switch(p){case t:v={name:p,detail:"reset"===m[1]?m[1]:m[1].slice(4)};break;case n:v={name:p,detail:m[2]};break;case i:v={name:a.historyNames.APPLY_FILTER,detail:f(m[1],m[2])};break;case r:v={name:a.historyNames.REMOVE_FILTER,detail:"Remove"};break;case s:v={name:a.historyNames.CHANGE_SHAPE,detail:"Change"};break;case l:v={name:a.historyNames.CHANGE_ICON_COLOR,detail:"Change"};break;case c:v={name:a.historyNames.CHANGE_TEXT_STYLE,detail:"Change"};break;case h:v={name:a.historyNames.REMOVE_OBJECT,detail:m[2]};break;case u:v={name:a.historyNames.CLEAR_OBJECTS,detail:"All"};break;case d:v={name:a.historyNames.ADD_IMAGE_OBJECT,detail:"Add"};break;case o:v={name:a.historyNames.ADD_TEXT};break;default:v={name:p}}"mask"===m[1]&&(v={name:a.historyNames.LOAD_MASK_IMAGE,detail:"Apply"});return v},t.getHelpMenuBarPosition=function(e){if("top"===e)return"bottom";if("left"===e)return"right";if("right"===e)return"left";return"top"},t.isEmptyCropzone=function(e){var t=e.left,n=e.top,o=e.width,i=e.height,r=a.emptyCropRectValues.LEFT,s=a.emptyCropRectValues.TOP,l=a.emptyCropRectValues.WIDTH,c=a.emptyCropRectValues.HEIGHT;return t===r&&n===s&&o===l&&i===c};var o,i=n(/*! tui-code-snippet */"tui-code-snippet"),r=n(/*! core-js-pure/features/promise */"./node_modules/core-js-pure/features/promise/index.js"),s=(o=r)&&o.__esModule?o:{default:o},a=n(/*! @/consts */"./src/js/consts.js");var l="tui-image-editor-",c=Math.min,u=Math.max,d=!1;function h(e,t){return e.indexOf(t)>=0}function f(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=t.useAlpha,o=void 0===n||n,i=t.mode,r=a.filterType.VINTAGE,s=a.filterType.REMOVE_COLOR,l=a.filterType.BLEND_COLOR,c=a.filterType.SEPIA2,u=a.filterType.COLOR_FILTER,d=a.filterType.REMOVE_WHITE,h=a.filterType.BLEND,f=void 0;switch(e){case r:f=c;break;case s:f=o?u:d;break;case l:f="add"===i?h:i;break;default:f=e}return p(f)}function p(e){return e.replace(/[a-z]/,(function(e){return e.toUpperCase()}))}t.Promise=s.default},"./src/svg/default.svg":
|
|
/*!*****************************!*\
|
|
!*** ./src/svg/default.svg ***!
|
|
\*****************************/
|
|
/*! no static exports found */function(e,t){e.exports='<svg display="none" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"><defs id="tui-image-editor-svg-default-icons"><symbol id="ic-apply" viewBox="0 0 24 24"><path d="M0 0h24v24H0z" stroke="none" fill="none"></path><path fill="none" stroke="inherit" d="M4 12.011l5 5L20.011 6"></path></symbol><symbol id="ic-cancel" viewBox="0 0 24 24"><path d="M0 0h24v24H0z" fill="none" stroke="none"></path><path fill="none" stroke="inherit" d="M6 6l12 12M18 6L6 18"></path></symbol><symbol id="ic-crop" viewBox="0 0 24 24"><path d="M0 0h24v24H0z" stroke="none" fill="none"></path><path stroke="none" fill="inherit" d="M4 0h1v20a1 1 0 0 1-1-1V0zM20 17h-1V5h1v12zm0 2v5h-1v-5h1z"></path><path stroke="none" fill="inherit" d="M5 19h19v1H5zM4.762 4v1H0V4h4.762zM7 4h12a1 1 0 0 1 1 1H7V4z"></path></symbol><symbol id="ic-delete-all" viewBox="0 0 24 24"><path stroke="none" fill="inherit" d="M5 23H3a1 1 0 0 1-1-1V6h1v16h2v1zm16-10h-1V6h1v7zM9 13H8v-3h1v3zm3 0h-1v-3h1v3zm3 0h-1v-3h1v3zM14.794 3.794L13 2h-3L8.206 3.794A.963.963 0 0 1 8 2.5l.703-1.055A1 1 0 0 1 9.535 1h3.93a1 1 0 0 1 .832.445L15 2.5a.965.965 0 0 1-.206 1.294zM14.197 4H8.803h5.394z"></path><path stroke="none" fill="inherit" d="M0 3h23v1H0zM11.286 21H8.714L8 23H7l1-2.8V20h.071L9.5 16h1l1.429 4H12v.2l1 2.8h-1l-.714-2zm-.357-1L10 17.4 9.071 20h1.858zM20 22h3v1h-4v-7h1v6zm-5 0h3v1h-4v-7h1v6z"></path></symbol><symbol id="ic-delete" viewBox="0 0 24 24"><path stroke="none" fill="inherit" d="M3 6v16h17V6h1v16a1 1 0 0 1-1 1H3a1 1 0 0 1-1-1V6h1zM14.794 3.794L13 2h-3L8.206 3.794A.963.963 0 0 1 8 2.5l.703-1.055A1 1 0 0 1 9.535 1h3.93a1 1 0 0 1 .832.445L15 2.5a.965.965 0 0 1-.206 1.294zM14.197 4H8.803h5.394z"></path><path stroke="none" fill="inherit" d="M0 3h23v1H0zM8 10h1v6H8v-6zm3 0h1v6h-1v-6zm3 0h1v6h-1v-6z"></path></symbol><symbol id="ic-draw-free" viewBox="0 0 32 32"><path fill="none" stroke="inherit" d="M2.5 20.929C2.594 10.976 4.323 6 7.686 6c5.872 0 2.524 19 7.697 19s1.89-14.929 6.414-14.929 1.357 10.858 5.13 10.858c1.802 0 2.657-2.262 2.566-6.786"></path></symbol><symbol id="ic-draw-line" viewBox="0 0 32 32"><path fill="none" stroke="inherit" d="M2 15.5h28"></path></symbol><symbol id="ic-draw" viewBox="0 0 24 24"><path fill="none" stroke="inherit" d="M2.5 21.5H5c.245 0 .48-.058.691-.168l.124-.065.14.01c.429.028.85-.127 1.16-.437L22.55 5.405a.5.5 0 0 0 0-.707l-3.246-3.245a.5.5 0 0 0-.707 0L3.162 16.888a1.495 1.495 0 0 0-.437 1.155l.01.14-.065.123c-.111.212-.17.448-.17.694v2.5z"></path><path stroke="none" fill="inherit" d="M16.414 3.707l3.89 3.89-.708.706-3.889-3.889z"></path></symbol><symbol id="ic-filter" viewBox="0 0 24 24"><path d="M0 0h24v24H0z" fill="none" stroke="none"></path><path stroke="none" fill="inherit" d="M12 7v1H2V7h10zm6 0h4v1h-4V7zM12 16v1h10v-1H12zm-6 0H2v1h4v-1z"></path><path stroke="none" fill="inherit" d="M8.5 20a3.5 3.5 0 1 1 0-7 3.5 3.5 0 0 1 0 7zm0-1a2.5 2.5 0 1 0 0-5 2.5 2.5 0 0 0 0 5zM15.5 11a3.5 3.5 0 1 1 0-7 3.5 3.5 0 0 1 0 7zm0-1a2.5 2.5 0 1 0 0-5 2.5 2.5 0 0 0 0 5z"></path></symbol><symbol id="ic-flip-reset" viewBox="0 0 31 32"><path fill="none" stroke="none" d="M31 0H0v32h31z"></path><path stroke="none" fill="inherit" d="M28 16a8 8 0 0 1-8 8H3v-1h1v-7H3a8 8 0 0 1 8-8h17v1h-1v7h1zM11 9a7 7 0 0 0-7 7v7h16a7 7 0 0 0 7-7V9H11z"></path><path fill="none" stroke="inherit" stroke-linecap="square" d="M24 5l3.5 3.5L24 12M7 20l-3.5 3.5L7 27"></path></symbol><symbol id="ic-flip-x" viewBox="0 0 32 32"><path fill="none" stroke="none" d="M32 32H0V0h32z"></path><path stroke="none" fill="inherit" d="M17 32h-1V0h1zM27.167 11l.5 3h-1.03l-.546-3h1.076zm-.5-3h-1.122L25 5h-5V4h5.153a1 1 0 0 1 .986.836L26.667 8zm1.5 9l.5 3h-.94l-.545-3h.985zm1 6l.639 3.836A1 1 0 0 1 28.819 28H26v-1h3l-.726-4h.894zM23 28h-3v-1h3v1zM13 4v1H7L3 27h10v1H3.18a1 1 0 0 1-.986-1.164l3.666-22A1 1 0 0 1 6.847 4H13z"></path></symbol><symbol id="ic-flip-y" viewBox="0 0 32 32"><path fill="none" stroke="none" d="M0 0v32h32V0z"></path><path stroke="none" fill="inherit" d="M0 16v1h32v-1zM11 27.167l3 .5v-1.03l-3-.546v1.076zm-3-.5v-1.122L5 25v-5H4v5.153a1 1 0 0 0 .836.986L8 26.667zm9 1.5l3 .5v-.94l-3-.545v.985zm6 1l3.836.639A1 1 0 0 0 28 28.82V26h-1v3l-4-.727v.894zM28 23v-3h-1v3h1zM4 13h1V7l22-4v10h1V3.18a1 1 0 0 0-1.164-.986l-22 3.667A1 1 0 0 0 4 6.847V13z"></path></symbol><symbol id="ic-flip" viewBox="0 0 24 24"><path d="M0 0h24v24H0z" fill="none" stroke="none"></path><path fill="inherit" stroke="none" d="M11 0h1v24h-1zM19 21v-1h2v-2h1v2a1 1 0 0 1-1 1h-2zm-2 0h-3v-1h3v1zm5-5h-1v-3h1v3zm0-5h-1V8h1v3zm0-5h-1V4h-2V3h2a1 1 0 0 1 1 1v2zm-5-3v1h-3V3h3zM9 3v1H2v16h7v1H2a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h7z"></path></symbol><symbol id="ic-history" viewBox="0 0 24 24"><path fill="none" stroke="none" d="M0 0H24V24H0z" transform="translate(-740 -16) translate(547 8) translate(193 8)"></path><path fill="inherit" stroke="none" d="M12.5 1C18.299 1 23 5.701 23 11.5S18.299 22 12.5 22c-5.29 0-9.665-3.911-10.394-8.999h1.012C3.838 17.534 7.764 21 12.5 21c5.247 0 9.5-4.253 9.5-9.5S17.747 2 12.5 2C8.49 2 5.06 4.485 3.666 8H3h4v1H2V4h1v3.022C4.68 3.462 8.303 1 12.5 1zm.5 5l-.001 5.291 2.537 2.537-.708.708L12.292 12H12V6h1z" transform="translate(-740 -16) translate(547 8) translate(193 8)"></path></symbol><symbol id="ic-history-check" viewBox="0 0 24 24"><g fill="none" fill-rule="evenodd"><path stroke="#555555" d="M4.5 -1L1.5 2 6.5 7" transform="translate(-60 -804) translate(60 804) translate(2 3) rotate(-90 4 3)"></path></g></symbol><symbol id="ic-history-crop" viewBox="0 0 24 24"><g fill="none" stroke="none" fill-rule="evenodd"><path d="M0 0H12V12H0z" transform="translate(-84 -804) translate(84 804)"></path><path fill="#434343" d="M2 0h1v10c-.552 0-1-.448-1-1V0zM10 9v3H9V9h1zM9 2h1v6H9V2z" transform="translate(-84 -804) translate(84 804)"></path><path fill="#434343" d="M2 9H12V10H2zM9 2c.513 0 .936.386.993.883L10 3H3V2h6zM2 3H0V2h2v1z" transform="translate(-84 -804) translate(84 804)"></path></g></symbol><symbol id="ic-history-draw" viewBox="0 0 24 24"><g fill="none" stroke="none" fill-rule="evenodd"><path d="M0 1H12V13H0z" transform="translate(-156 -804) translate(156 803)"></path><path stroke="#434343" d="M9.622 1.584l1.835 1.658-8.31 8.407L.5 12.5V11l9.122-9.416z" transform="translate(-156 -804) translate(156 803)"></path><path fill="#434343" d="M7.628 3.753L10.378 3.753 10.378 4.253 7.628 4.253z" transform="translate(-156 -804) translate(156 803) rotate(45 9.003 4.003)"></path></g></symbol><symbol id="ic-history-filter" viewBox="0 0 24 24"><g fill="none" stroke="none" fill-rule="evenodd"><path d="M0 0H12V12H0z" transform="translate(-276 -804) translate(276 804)"></path><path fill="#434343" d="M12 3v1H9V3h3zM7 4H0V3h7v1z" transform="translate(-276 -804) translate(276 804)"></path><path fill="#434343" d="M12 8v1H9V8h3zM7 9H0V8h7v1z" transform="translate(-276 -804) translate(276 804) matrix(-1 0 0 1 12 0)"></path><path fill="#434343" d="M8 1c1.105 0 2 .895 2 2s-.895 2-2 2-2-.895-2-2 .895-2 2-2zm0 1c-.552 0-1 .448-1 1s.448 1 1 1 1-.448 1-1-.448-1-1-1zM4 7c1.105 0 2 .895 2 2s-.895 2-2 2-2-.895-2-2 .895-2 2-2zm0 1c-.552 0-1 .448-1 1s.448 1 1 1 1-.448 1-1-.448-1-1-1z" transform="translate(-276 -804) translate(276 804)"></path></g></symbol><symbol id="ic-history-flip" viewBox="0 0 24 24"><g fill="none" stroke="none" fill-rule="evenodd"><path d="M0 0H12V12H0z" transform="translate(-108 -804) translate(108 804)"></path><path fill="#434343" d="M6 0L7 0 7 12 6 12zM11 10V9h1v1.5c0 .276-.224.5-.5.5H10v-1h1zM5 1v1H1v8h4v1H.5c-.276 0-.5-.224-.5-.5v-9c0-.276.224-.5.5-.5H5zm7 5v2h-1V6h1zm0-3v2h-1V3h1zM9 1v1H7V1h2zm2.5 0c.276 0 .5.224.5.5V2h-2V1h1.5zM9 11H7v-1h2v1z" transform="translate(-108 -804) translate(108 804)"></path></g></symbol><symbol id="ic-history-icon" viewBox="0 0 24 24"><g fill="none" stroke="none" fill-rule="evenodd"><path d="M0 0H12V12H0z" transform="translate(-204 -804) translate(204 804)"></path><path stroke="#434343" stroke-linecap="round" stroke-linejoin="round" stroke-width="1.1" d="M6 9.568L2.601 11 2.975 7.467 0.5 4.82 4.13 4.068 6 1 7.87 4.068 11.5 4.82 9.025 7.467 9.399 11z" transform="translate(-204 -804) translate(204 804)"></path></g></symbol><symbol id="ic-history-mask" viewBox="0 0 24 24"><g fill="none" stroke="none" fill-rule="evenodd"><g transform="translate(-252 -804) translate(252 804)"><path d="M0 0H12V12H0z"></path><circle cx="6" cy="6" r="2.5" stroke="#444"></circle><path fill="#434343" d="M11.5 0c.276 0 .5.224.5.5v11c0 .276-.224.5-.5.5H.5c-.276 0-.5-.224-.5-.5V.5C0 .224.224 0 .5 0h11zM11 1H1v10h10V1z"></path></g></g></symbol><symbol id="ic-history-rotate" viewBox="0 0 24 24"><defs><path id="rfn4rylffa" d="M7 12c-.335 0-.663-.025-.983-.074C3.171 11.492 1 9.205 1 6.444c0-1.363.534-2.613 1.415-3.58"></path><mask id="6f9gn2dysb" width="6" height="9.136" x="0" y="0" maskUnits="objectBoundingBox"><use xlink:href="#rfn4rylffa" stroke="434343"></use></mask></defs><g fill="none" stroke="none" fill-rule="evenodd"><g transform="translate(-132 -804) translate(132 804)"><path d="M0 0.5H12V12.5H0z"></path><path fill="#434343" d="M6.5 1C9.538 1 12 3.462 12 6.5c0 2.37-1.5 4.39-3.6 5.163l-.407-.916C9.744 10.13 11 8.462 11 6.5 11 4.015 8.985 2 6.5 2c-.777 0-1.509.197-2.147.544L4 1.75l-.205-.04C4.594 1.258 5.517 1 6.5 1z"></path><use stroke="#434343" stroke-dasharray="2 1.25" stroke-width="1" mask="url(#6f9gn2dysb)" xlink:href="#rfn4rylffa"></use><path fill="#434343" d="M4.279 0L6 1.75 4.25 3.571 3.543 2.864 4.586 1.75 3.572 0.707z" transform="matrix(-1 0 0 1 9.543 0)"></path></g></g></symbol><symbol id="ic-history-shape" viewBox="0 0 24 24"><g fill="none" stroke="none" fill-rule="evenodd"><path d="M0 0H12V12H0z" transform="translate(-180 -804) translate(180 804)"></path><path fill="#434343" d="M11.5 4c.276 0 .5.224.5.5v7c0 .276-.224.5-.5.5h-7c-.276 0-.5-.224-.5-.5V8.8h1V11h6V5H8.341l-.568-1H11.5z" transform="translate(-180 -804) translate(180 804)"></path><path stroke="#434343" stroke-linecap="round" stroke-linejoin="round" d="M4.5 0.5L8.5 7.611 0.5 7.611z" transform="translate(-180 -804) translate(180 804)"></path></g></symbol><symbol id="ic-history-text" viewBox="0 0 24 24"><g fill="none" stroke="none" fill-rule="evenodd"><path d="M0 0H12V12H0z" transform="translate(-228 -804) translate(228 804)"></path><path fill="#434343" d="M2 1h8c.552 0 1 .448 1 1H1c0-.552.448-1 1-1z" transform="translate(-228 -804) translate(228 804)"></path><path fill="#434343" d="M1 1H2V3H1zM10 1H11V3H10zM5.5 1L6.5 1 6.5 11 5.5 11z" transform="translate(-228 -804) translate(228 804)"></path><path fill="#434343" d="M4 10H8V11H4z" transform="translate(-228 -804) translate(228 804)"></path></g></symbol><symbol id="ic-history-load" viewBox="0 0 24 24"><g fill="none" stroke="none" fill-rule="evenodd"><path d="M0 0H12V12H0z" transform="translate(-324 -805) translate(324 805)"></path><path fill="#434343" d="M5 0c.552 0 1 .448 1 1v1h5.5c.276 0 .5.224.5.5v8c0 .276-.224.5-.5.5H.5c-.276 0-.5-.224-.5-.5V1c0-.552.448-1 1-1h4zm0 1H1v9h10V3H5V1z" transform="translate(-324 -805) translate(324 805)"></path><path fill="#434343" d="M1 2L5 2 5 3 1 3z" transform="translate(-324 -805) translate(324 805)"></path></g></symbol><symbol id="ic-history-delete" viewBox="0 0 24 24"><g fill="none" stroke="none" fill-rule="evenodd"><g fill="#434343"><path d="M2 9h8V1h1v8.5c0 .276-.224.5-.5.5h-9c-.276 0-.5-.224-.5-.5V1h1v8zM0 0H12V1H0z" transform="translate(-300 -804) translate(300 804) translate(0 2)"></path><path d="M4 3H5V7H4zM7 3H8V7H7z" transform="translate(-300 -804) translate(300 804) translate(0 2)"></path><path d="M4 1h4V0h1v1.5c0 .276-.224.5-.5.5h-5c-.276 0-.5-.224-.5-.5V0h1v1z" transform="translate(-300 -804) translate(300 804) matrix(1 0 0 -1 0 2)"></path></g></g></symbol><symbol id="ic-history-group" viewBox="0 0 24 24"><g fill="none" stroke="none" fill-rule="evenodd"><g transform="translate(-348 -804) translate(348 804)"><path d="M0 0H12V12H0z"></path><path fill="#434343" d="M1 9v2h1v1H.5c-.276 0-.5-.224-.5-.5V9h1zm11 1v1.5c0 .276-.224.5-.5.5H9v-1h2v-1h1zm-4 1v1H6v-1h2zm-3 0v1H3v-1h2zm7-4v2h-1V7h1zM1 6v2H0V6h1zm11-2v2h-1V4h1zM1 3v2H0V3h1zm10.5-3c.276 0 .5.224.5.5V3h-1V1h-1V0h1.5zM6 0v1H4V0h2zm3 0v1H7V0h2zM0 .5C0 .224.224 0 .5 0H3v1H1v1H0V.5zM9.5 4c.276 0 .5.224.5.5v5c0 .276-.224.5-.5.5h-5c-.276 0-.5-.224-.5-.5V8.355c.317.094.652.145 1 .145V9h4V5h-.5c0-.348-.05-.683-.145-1H9.5z"></path><circle cx="5" cy="5" r="2.5" stroke="#434343"></circle></g></g></symbol><symbol id="ic-icon-arrow-2" viewBox="0 0 32 32"><path fill="none" stroke="inherit" stroke-linecap="round" stroke-linejoin="round" d="M21.793 18.5H2.5v-5h18.935l-7.6-8h5.872l10.5 10.5-10.5 10.5h-5.914l8-8z"></path></symbol><symbol id="ic-icon-arrow-3" viewBox="0 0 32 32"><path fill="none" stroke="inherit" stroke-linecap="round" stroke-linejoin="round" d="M25.288 16.42L14.208 27.5H6.792l11.291-11.291L6.826 4.5h7.381l11.661 11.661-.58.258z"></path></symbol><symbol id="ic-icon-arrow" viewBox="0 0 32 32"><path fill="none" stroke="inherit" d="M2.5 11.5v9h18v5.293L30.293 16 20.5 6.207V11.5h-18z"></path></symbol><symbol id="ic-icon-bubble" viewBox="0 0 32 32"><path fill="none" stroke="inherit" stroke-linecap="round" stroke-linejoin="round" d="M22.207 24.5L16.5 30.207V24.5H8A6.5 6.5 0 0 1 1.5 18V9A6.5 6.5 0 0 1 8 2.5h16A6.5 6.5 0 0 1 30.5 9v9a6.5 6.5 0 0 1-6.5 6.5h-1.793z"></path></symbol><symbol id="ic-icon-heart" viewBox="0 0 32 32"><path fill-rule="nonzero" fill="none" stroke="inherit" d="M15.996 30.675l1.981-1.79c7.898-7.177 10.365-9.718 12.135-13.012.922-1.716 1.377-3.37 1.377-5.076 0-4.65-3.647-8.297-8.297-8.297-2.33 0-4.86 1.527-6.817 3.824l-.38.447-.381-.447C13.658 4.027 11.126 2.5 8.797 2.5 4.147 2.5.5 6.147.5 10.797c0 1.714.46 3.375 1.389 5.098 1.775 3.288 4.26 5.843 12.123 12.974l1.984 1.806z"></path></symbol><symbol id="ic-icon-load" viewBox="0 0 32 32"><path fill="none" stroke="inherit" stroke-linecap="round" stroke-linejoin="round" d="M17.314 18.867l1.951-2.53 4 5.184h-17l6.5-8.84 4.549 6.186z"></path><path stroke="none" fill="inherit" d="M18.01 4a11.798 11.798 0 0 0 0 1H3v24h24V14.986a8.738 8.738 0 0 0 1 0V29a1 1 0 0 1-1 1H3a1 1 0 0 1-1-1V5a1 1 0 0 1 1-1h15.01z"></path><path stroke="none" fill="inherit" d="M25 3h1v9h-1z"></path><path fill="none" stroke="inherit" d="M22 6l3.5-3.5L29 6"></path></symbol><symbol id="ic-icon-location" viewBox="0 0 32 32"><path fill="none" stroke="inherit" d="M16 31.28C23.675 23.302 27.5 17.181 27.5 13c0-6.351-5.149-11.5-11.5-11.5S4.5 6.649 4.5 13c0 4.181 3.825 10.302 11.5 18.28z"></path><circle fill="none" stroke="inherit" cx="16" cy="13" r="4.5"></circle></symbol><symbol id="ic-icon-polygon" viewBox="0 0 32 32"><path fill="none" stroke="inherit" d="M.576 16L8.29 29.5h15.42L31.424 16 23.71 2.5H8.29L.576 16z"></path></symbol><symbol id="ic-icon-star-2" viewBox="0 0 32 32"><path fill="none" stroke="inherit" d="M19.446 31.592l2.265-3.272 3.946.25.636-3.94 3.665-1.505-1.12-3.832 2.655-2.962-2.656-2.962 1.12-3.832-3.664-1.505-.636-3.941-3.946.25-2.265-3.271L16 3.024 12.554 1.07 10.289 4.34l-3.946-.25-.636 3.941-3.665 1.505 1.12 3.832L.508 16.33l2.656 2.962-1.12 3.832 3.664 1.504.636 3.942 3.946-.25 2.265 3.27L16 29.638l3.446 1.955z"></path></symbol><symbol id="ic-icon-star" viewBox="0 0 32 32"><path fill="none" stroke="inherit" d="M25.292 29.878l-1.775-10.346 7.517-7.327-10.388-1.51L16 1.282l-4.646 9.413-10.388 1.51 7.517 7.327-1.775 10.346L16 24.993l9.292 4.885z"></path></symbol><symbol id="ic-icon" viewBox="0 0 24 24"><path fill="none" stroke="inherit" stroke-linecap="round" stroke-linejoin="round" d="M11.923 19.136L5.424 22l.715-7.065-4.731-5.296 6.94-1.503L11.923 2l3.574 6.136 6.94 1.503-4.731 5.296L18.42 22z"></path></symbol><symbol id="ic-mask-load" viewBox="0 0 32 32"><path stroke="none" fill="none" d="M0 0h32v32H0z"></path><path stroke="none" fill="inherit" d="M18.01 4a11.798 11.798 0 0 0 0 1H3v24h24V14.986a8.738 8.738 0 0 0 1 0V29a1 1 0 0 1-1 1H3a1 1 0 0 1-1-1V5a1 1 0 0 1 1-1h15.01zM15 23a6 6 0 1 1 0-12 6 6 0 0 1 0 12zm0-1a5 5 0 1 0 0-10 5 5 0 0 0 0 10z"></path><path stroke="none" fill="inherit" d="M25 3h1v9h-1z"></path><path fill="none" stroke="inherit" d="M22 6l3.5-3.5L29 6"></path></symbol><symbol id="ic-mask" viewBox="0 0 24 24"><circle cx="12" cy="12" r="4.5" stroke="inherit" fill="none"></circle><path stroke="none" fill="inherit" d="M2 1h20a1 1 0 0 1 1 1v20a1 1 0 0 1-1 1H2a1 1 0 0 1-1-1V2a1 1 0 0 1 1-1zm0 1v20h20V2H2z"></path></symbol><symbol id="ic-redo" viewBox="0 0 24 24"><path d="M0 0h24v24H0z" opacity=".5" fill="none" stroke="none"></path><path stroke="none" fill="inherit" d="M21 6H9a6 6 0 1 0 0 12h12v1H9A7 7 0 0 1 9 5h12v1z"></path><path fill="none" stroke="inherit" stroke-linecap="square" d="M19 3l2.5 2.5L19 8"></path></symbol><symbol id="ic-reset" viewBox="0 0 24 24"><path d="M0 0h24v24H0z" opacity=".5" stroke="none" fill="none"></path><path stroke="none" fill="inherit" d="M2 13v-1a7 7 0 0 1 7-7h13v1h-1v5h1v1a7 7 0 0 1-7 7H2v-1h1v-5H2zm7-7a6 6 0 0 0-6 6v6h12a6 6 0 0 0 6-6V6H9z"></path><path fill="none" stroke="inherit" stroke-linecap="square" d="M19 3l2.5 2.5L19 8M5 16l-2.5 2.5L5 21"></path></symbol><symbol id="ic-rotate-clockwise" viewBox="0 0 32 32"><path stroke="none" fill="inherit" d="M29 17h-.924c0 6.627-5.373 12-12 12-6.628 0-12-5.373-12-12C4.076 10.398 9.407 5.041 16 5V4C8.82 4 3 9.82 3 17s5.82 13 13 13 13-5.82 13-13z"></path><path fill="none" stroke="inherit" stroke-linecap="square" d="M16 1.5l4 3-4 3"></path><path stroke="none" fill="inherit" fill-rule="nonzero" d="M16 4h4v1h-4z"></path></symbol><symbol id="ic-rotate-counterclockwise" viewBox="0 0 32 32"><path stroke="none" d="M3 17h.924c0 6.627 5.373 12 12 12 6.628 0 12-5.373 12-12 0-6.602-5.331-11.96-11.924-12V4c7.18 0 13 5.82 13 13s-5.82 13-13 13S3 24.18 3 17z"></path><path stroke="none" fill="inherit" fill-rule="nonzero" d="M12 4h4v1h-4z"></path><path fill="none" stroke="inherit" stroke-linecap="square" d="M16 1.5l-4 3 4 3"></path></symbol><symbol id="ic-rotate" viewBox="0 0 24 24"><path d="M0 0h24v24H0z" fill="none" stroke="none"></path><path fill="inherit" stroke="none" d="M8.349 22.254a10.002 10.002 0 0 1-2.778-1.719l.65-.76a9.002 9.002 0 0 0 2.495 1.548l-.367.931zm2.873.704l.078-.997a9 9 0 1 0-.557-17.852l-.14-.99A10.076 10.076 0 0 1 12.145 3c5.523 0 10 4.477 10 10s-4.477 10-10 10c-.312 0-.62-.014-.924-.042zm-7.556-4.655a9.942 9.942 0 0 1-1.253-2.996l.973-.234a8.948 8.948 0 0 0 1.124 2.693l-.844.537zm-1.502-5.91A9.949 9.949 0 0 1 2.88 9.23l.925.382a8.954 8.954 0 0 0-.644 2.844l-.998-.062zm2.21-5.686c.687-.848 1.51-1.58 2.436-2.166l.523.852a9.048 9.048 0 0 0-2.188 1.95l-.771-.636z"></path><path stroke="inherit" fill="none" stroke-linecap="square" d="M13 1l-2.5 2.5L13 6"></path></symbol><symbol id="ic-shape-circle" viewBox="0 0 32 32"><circle cx="16" cy="16" r="14.5" fill="none" stroke="inherit"></circle></symbol><symbol id="ic-shape-rectangle" viewBox="0 0 32 32"><rect width="27" height="27" x="2.5" y="2.5" fill="none" stroke="inherit" rx="1"></rect></symbol><symbol id="ic-shape-triangle" viewBox="0 0 32 32"><path fill="none" stroke-linecap="round" stroke-linejoin="round" d="M16 2.5l15.5 27H.5z"></path></symbol><symbol id="ic-shape" viewBox="0 0 24 24"><path stroke="none" fill="inherit" d="M14.706 8H21a1 1 0 0 1 1 1v12a1 1 0 0 1-1 1H9a1 1 0 0 1-1-1v-4h1v4h12V9h-5.706l-.588-1z"></path><path fill="none" stroke="inherit" stroke-linecap="round" stroke-linejoin="round" d="M8.5 1.5l7.5 13H1z"></path></symbol><symbol id="ic-text-align-center" viewBox="0 0 32 32"><path stroke="none" fill="none" d="M0 0h32v32H0z"></path><path stroke="none" fill="inherit" d="M2 5h28v1H2zM8 12h16v1H8zM2 19h28v1H2zM8 26h16v1H8z"></path></symbol><symbol id="ic-text-align-left" viewBox="0 0 32 32"><path stroke="none" fill="none" d="M0 0h32v32H0z"></path><path stroke="none" fill="inherit" d="M2 5h28v1H2zM2 12h16v1H2zM2 19h28v1H2zM2 26h16v1H2z"></path></symbol><symbol id="ic-text-align-right" viewBox="0 0 32 32"><path stroke="none" fill="none" d="M0 0h32v32H0z"></path><path stroke="none" fill="inherit" d="M2 5h28v1H2zM14 12h16v1H14zM2 19h28v1H2zM14 26h16v1H14z"></path></symbol><symbol id="ic-text-bold" viewBox="0 0 32 32"><path fill="none" stroke="none" d="M0 0h32v32H0z"></path><path stroke="none" fill="inherit" d="M7 2h2v2H7zM7 28h2v2H7z"></path><path fill="none" stroke="inherit" stroke-width="2" d="M9 3v12h9a6 6 0 1 0 0-12H9zM9 15v14h10a7 7 0 0 0 0-14H9z"></path></symbol><symbol id="ic-text-italic" viewBox="0 0 32 32"><path fill="none" stroke="none" d="M0 0h32v32H0z"></path><path stroke="none" fill="inherit" d="M15 2h5v1h-5zM11 29h5v1h-5zM17 3h1l-4 26h-1z"></path></symbol><symbol id="ic-text-underline" viewBox="0 0 32 32"><path stroke="none" fill="none" d="M0 0h32v32H0z"></path><path stroke="none" fill="inherit" d="M8 2v14a8 8 0 1 0 16 0V2h1v14a9 9 0 0 1-18 0V2h1zM3 29h26v1H3z"></path><path stroke="none" fill="inherit" d="M5 2h5v1H5zM22 2h5v1h-5z"></path></symbol><symbol id="ic-text" viewBox="0 0 24 24"><path stroke="none" fill="inherit" d="M4 3h15a1 1 0 0 1 1 1H3a1 1 0 0 1 1-1zM3 4h1v1H3zM19 4h1v1h-1z"></path><path stroke="none" fill="inherit" d="M11 3h1v18h-1z"></path><path stroke="none" fill="inherit" d="M10 20h3v1h-3z"></path></symbol><symbol id="ic-undo" viewBox="0 0 24 24"><path d="M24 0H0v24h24z" opacity=".5" fill="none" stroke="none"></path><path stroke="none" fill="inherit" d="M3 6h12a6 6 0 1 1 0 12H3v1h12a7 7 0 0 0 0-14H3v1z"></path><path fill="none" stroke="inherit" stroke-linecap="square" d="M5 3L2.5 5.5 5 8"></path></symbol><symbol id="ic-zoom-in" viewBox="0 0 24 24"><g transform="translate(-229 -290) translate(229 290)"><circle cx="10.5" cy="10.5" r="9" stroke="inherit" fill="none"></circle><path fill="inherit" d="M18.828 15.828H19.828V22.828H18.828z" transform="rotate(-45 19.328 19.328)"></path><path fill="inherit" d="M7 10H14V11H7z"></path><path fill="inherit" d="M10 7H11V14H10z"></path></g></symbol><symbol id="ic-zoom-out" viewBox="0 0 24 24"><g transform="translate(-263 -290) translate(263 290)"><circle cx="10.5" cy="10.5" r="9" stroke="inherit" fill="none"></circle><path fill="inherit" d="M18.828 15.828H19.828V22.828H18.828z" transform="rotate(-45 19.328 19.328)"></path><path fill="inherit" d="M7 10H14V11H7z"></path></g></symbol><symbol id="ic-hand" viewBox="0 0 24 24"><g fill="none" fill-rule="evenodd" stroke-linejoin="round"><path fill="inherit" fill-rule="nonzero" d="M8.672 3.36c1.328 0 2.114.78 2.29 1.869l.014.101.023.006v1.042l-.638-.185c-.187-.055-.323-.211-.354-.399L10 5.713c0-.825-.42-1.353-1.328-1.353C7.695 4.36 7 5.041 7 5.713v7.941c0 .439-.524.665-.843.364l-1.868-1.761c-.595-.528-1.316-.617-1.918-.216-.522.348-.562 1.203-.18 1.8L7.738 22h11.013l.285-.518c1.247-2.326 1.897-4.259 1.96-5.785l.004-.239V8.035c0-.656-.5-1.17-1-1.17-.503 0-1 .456-1 1.17 0 .333-.32.573-.64.48L18 8.41V7.368l.086.026.042-.136c.279-.805.978-1.332 1.738-1.388L20 5.865c1.057 0 2 .967 2 2.17v7.423c0 1.929-.845 4.352-2.521 7.29-.09.156-.255.252-.435.252H7.474c-.166 0-.321-.082-.414-.219l-5.704-8.39c-.653-1.019-.584-2.486.46-3.182 1-.666 2.216-.516 3.148.31L6 12.495V5.713c0-1.18 1.058-2.263 2.49-2.348z" transform="translate(-297 -290) translate(297 290)"></path><path fill="inherit" fill-rule="nonzero" d="M12.5 1.5c1.325 0 2.41 1.032 2.495 2.336L15 4v7.22h-1V4c0-.828-.672-1.5-1.5-1.5-.78 0-1.42.595-1.493 1.356L11 4v7.22h-1V4c0-1.38 1.12-2.5 2.5-2.5z" transform="translate(-297 -290) translate(297 290)"></path><path fill="inherit" fill-rule="nonzero" d="M16.5 3.5c1.325 0 2.41 1.032 2.495 2.336L19 6v6.3h-1V6c0-.828-.672-1.5-1.5-1.5-.78 0-1.42.595-1.493 1.356L15 6v2.44h-1V6c0-1.38 1.12-2.5 2.5-2.5z" transform="translate(-297 -290) translate(297 290)"></path></g></symbol></defs></svg>'},fabric:
|
|
/*!****************************************************************************************************************!*\
|
|
!*** external {"commonjs":["fabric","fabric"],"commonjs2":["fabric","fabric"],"amd":"fabric","root":"fabric"} ***!
|
|
\****************************************************************************************************************/
|
|
/*! no static exports found */function(t,n){t.exports=e},"tui-code-snippet":
|
|
/*!******************************************************************************************************************************!*\
|
|
!*** external {"commonjs":"tui-code-snippet","commonjs2":"tui-code-snippet","amd":"tui-code-snippet","root":["tui","util"]} ***!
|
|
\******************************************************************************************************************************/
|
|
/*! no static exports found */function(e,n){e.exports=t},"tui-color-picker":
|
|
/*!*************************************************************************************************************************************!*\
|
|
!*** external {"commonjs":"tui-color-picker","commonjs2":"tui-color-picker","amd":"tui-color-picker","root":["tui","colorPicker"]} ***!
|
|
\*************************************************************************************************************************************/
|
|
/*! no static exports found */function(e,t){e.exports=n}})})); |