diff --git a/docs/bundle.css b/docs/bundle.css index 21be557e8..fd00d4b45 100644 --- a/docs/bundle.css +++ b/docs/bundle.css @@ -8478,6 +8478,9 @@ html, body { .csseditor[data-theme=dark] .timeline-value-area .timeline-value-editor .tab-content .css-property-editor { margin-top: 0px; } +.csseditor[data-theme=dark] .timeline-value-area .timeline-value-editor .tab-content .css-property-item > .title { + display: none; +} .csseditor[data-theme=dark] .timeline-value-area .timeline-value-editor .tab-content .css-property-item > .title > .tools { display: none; } @@ -16034,6 +16037,9 @@ html, body { .csseditor[data-theme=light] .timeline-value-area .timeline-value-editor .tab-content .css-property-editor { margin-top: 0px; } +.csseditor[data-theme=light] .timeline-value-area .timeline-value-editor .tab-content .css-property-item > .title { + display: none; +} .csseditor[data-theme=light] .timeline-value-area .timeline-value-editor .tab-content .css-property-item > .title > .tools { display: none; } diff --git a/docs/bundle.css.gz b/docs/bundle.css.gz index 1a2122821..6a56bafc6 100644 Binary files a/docs/bundle.css.gz and b/docs/bundle.css.gz differ diff --git a/docs/main.js b/docs/main.js index 28b9639df..3916f1017 100644 --- a/docs/main.js +++ b/docs/main.js @@ -1 +1 @@ -!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define([],e):"object"==typeof exports?exports.EasylogicStudio=e():t.EasylogicStudio=e()}(window,function(){return function(t){var e={};function n(r){if(e[r])return e[r].exports;var o=e[r]={i:r,l:!1,exports:{}};return t[r].call(o.exports,o,o.exports,n),o.l=!0,o.exports}return n.m=t,n.c=e,n.d=function(t,e,r){n.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:r})},n.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},n.t=function(t,e){if(1&e&&(t=n(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var o in t)n.d(r,o,function(e){return t[e]}.bind(null,o));return r},n.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return n.d(e,"a",e),e},n.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},n.p="",n(n.s=1)}([function(t,e,n){},function(t,e,n){"use strict";n.r(e);var r={};n.r(r),n.d(r,"debounce",function(){return k}),n.d(r,"throttle",function(){return O}),n.d(r,"keyEach",function(){return S}),n.d(r,"keyMap",function(){return j}),n.d(r,"get",function(){return P}),n.d(r,"defaultValue",function(){return T}),n.d(r,"isUndefined",function(){return _}),n.d(r,"isNotUndefined",function(){return E}),n.d(r,"isArray",function(){return C}),n.d(r,"isBoolean",function(){return $}),n.d(r,"isString",function(){return R}),n.d(r,"isNotString",function(){return V}),n.d(r,"isObject",function(){return I}),n.d(r,"isFunction",function(){return A}),n.d(r,"isNumber",function(){return D}),n.d(r,"clone",function(){return M}),n.d(r,"cleanObject",function(){return L}),n.d(r,"combineKeyArray",function(){return B}),n.d(r,"repeat",function(){return z}),n.d(r,"html",function(){return H}),n.d(r,"CSS_TO_STRING",function(){return X}),n.d(r,"STRING_TO_CSS",function(){return Y}),n.d(r,"OBJECT_TO_PROPERTY",function(){return N}),n.d(r,"OBJECT_TO_CLASS",function(){return K});var o={};n.r(o),n.d(o,"format",function(){return W}),n.d(o,"hex",function(){return U}),n.d(o,"rgb",function(){return Z}),n.d(o,"hsl",function(){return q});var i={};n.r(i),n.d(i,"randomNumber",function(){return J}),n.d(i,"random",function(){return Q});var a={};n.r(a),n.d(a,"round",function(){return tt}),n.d(a,"degreeToRadian",function(){return et}),n.d(a,"radianToDegree",function(){return nt}),n.d(a,"getXInCircle",function(){return rt}),n.d(a,"getYInCircle",function(){return ot}),n.d(a,"getXYInCircle",function(){return it}),n.d(a,"getDist",function(){return at}),n.d(a,"calculateAngle",function(){return ct}),n.d(a,"uuid",function(){return st}),n.d(a,"uuidShort",function(){return lt}),n.d(a,"cubicBezier",function(){return pt}),n.d(a,"getGradientLine",function(){return ht});var c={};n.r(c),n.d(c,"ReverseXyz",function(){return yt}),n.d(c,"ReverseRGB",function(){return dt}),n.d(c,"XYZtoRGB",function(){return vt}),n.d(c,"LABtoXYZ",function(){return bt}),n.d(c,"PivotXyz",function(){return gt}),n.d(c,"XYZtoLAB",function(){return mt}),n.d(c,"LABtoRGB",function(){return wt});var u={};n.r(u),n.d(u,"RGBtoHSV",function(){return kt}),n.d(u,"RGBtoCMYK",function(){return Ot}),n.d(u,"RGBtoHSL",function(){return St}),n.d(u,"c",function(){return jt}),n.d(u,"gray",function(){return Pt}),n.d(u,"RGBtoSimpleGray",function(){return xt}),n.d(u,"RGBtoGray",function(){return Tt}),n.d(u,"brightness",function(){return _t}),n.d(u,"RGBtoYCrCb",function(){return Et}),n.d(u,"PivotRGB",function(){return Ct}),n.d(u,"RGBtoXYZ",function(){return $t}),n.d(u,"RGBtoLAB",function(){return Rt});var s={};n.r(s),n.d(s,"CMYKtoRGB",function(){return Vt});var l={};n.r(l),n.d(l,"HSVtoRGB",function(){return It}),n.d(l,"HSVtoHSL",function(){return At});var f={};n.r(f),n.d(f,"HUEtoRGB",function(){return Dt}),n.d(f,"HSLtoHSV",function(){return Mt}),n.d(f,"HSLtoRGB",function(){return Lt});var p={};n.r(p),n.d(p,"YCrCbtoRGB",function(){return Bt});var h={};n.r(h),n.d(h,"matches",function(){return Nt}),n.d(h,"convertMatches",function(){return Kt}),n.d(h,"convertMatchesArray",function(){return Wt}),n.d(h,"reverseMatches",function(){return Ut}),n.d(h,"trim",function(){return qt}),n.d(h,"parse",function(){return Jt}),n.d(h,"parseGradient",function(){return Qt});var d={};n.r(d),n.d(d,"interpolateRGB",function(){return te}),n.d(d,"interpolateRGBObject",function(){return ee}),n.d(d,"scale",function(){return ne}),n.d(d,"blend",function(){return re}),n.d(d,"mix",function(){return oe}),n.d(d,"contrast",function(){return ie}),n.d(d,"contrastColor",function(){return ae}),n.d(d,"gradient",function(){return ce}),n.d(d,"scaleHSV",function(){return ue}),n.d(d,"scaleH",function(){return se}),n.d(d,"scaleS",function(){return le}),n.d(d,"scaleV",function(){return fe});var v={};n.r(v),n.d(v,"start",function(){return sa});n(0);function b(t){return function(t){if(Array.isArray(t))return t}(t)||m(t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance")}()}function g(t){return function(t){if(Array.isArray(t)){for(var e=0,n=new Array(t.length);e]*)\/\>/gim,G={image:!0,input:!0,br:!0,path:!0},H=function(t){for(var e=arguments.length,n=new Array(e>1?e-1:0),r=1;r",">"))})};function X(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",n=t;return Object.keys(n).filter(function(t){return n[t]}).map(function(t){return"".concat(t,": ").concat(n[t])}).join(";"+e)}function Y(t){var e={};return(t+="").split(";").forEach(function(t){var n=b(t.split(":").map(function(t){return t.trim()})),r=n[0],o=n.slice(1);""!=r&&(e[r]=o.join(":"))}),e}function N(t){return Object.keys(t).map(function(e){return"class"===e&&I(t[e])?"".concat(e,'="').concat(K(t[e]),'"'):$(t[e])?t[e]?e:"":"".concat(e,'="').concat(t[e],'"')}).join(" ")}function K(t){return Object.keys(t).filter(function(e){return t[e]}).map(function(t){return t}).join(" ")}function W(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"rgba(0, 0, 0, 0)";return Array.isArray(t)&&(t={r:t[0],g:t[1],b:t[2],a:t[3]}),"hex"==e?U(t):"rgb"==e?Z(t,n):"hsl"==e?q(t):t}function U(t){Array.isArray(t)&&(t={r:t[0],g:t[1],b:t[2],a:t[3]});var e=t.r.toString(16);t.r<16&&(e="0"+e);var n=t.g.toString(16);t.g<16&&(n="0"+n);var r=t.b.toString(16);return t.b<16&&(r="0"+r),"#".concat(e).concat(n).concat(r)}function Z(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"rgba(0, 0, 0, 0)";if(C(t)&&(t={r:t[0],g:t[1],b:t[2],a:t[3]}),!_(t))return 1==t.a||_(t.a)?isNaN(t.r)?e:"rgb(".concat(t.r,",").concat(t.g,",").concat(t.b,")"):"rgba(".concat(t.r,",").concat(t.g,",").concat(t.b,",").concat(t.a,")")}function q(t){return C(t)&&(t={r:t[0],g:t[1],b:t[2],a:t[3]}),1==t.a||_(t.a)?"hsl(".concat(t.h,",").concat(t.s,"%,").concat(t.l,"%)"):"hsla(".concat(t.h,",").concat(t.s,"%,").concat(t.l,"%,").concat(t.a,")")}function J(t,e){return Math.floor(Math.random()*(e-t+1))+t}function Q(){return Z({r:J(0,255),g:J(0,255),b:J(0,255)})}function tt(t,e){return e=_(e)?1:e,Math.round(t*e)/e}function et(t){return t*Math.PI/180}function nt(t){var e=180*t/Math.PI;return e<0&&(e=360+e),e}function rt(t,e){return(arguments.length>2&&void 0!==arguments[2]?arguments[2]:0)+e*Math.cos(et(t))}function ot(t,e){return(arguments.length>2&&void 0!==arguments[2]?arguments[2]:0)+e*Math.sin(et(t))}function it(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0;return{x:rt(t,e,n),y:ot(t,e,r)}}function at(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0;return Math.sqrt(Math.pow(Math.abs(n-t),2)+Math.pow(Math.abs(r-e),2))}function ct(t,e){return nt(Math.atan2(e,t))}var ut=/[xy]/g;function st(){var t=(new Date).getTime();return"xxx12-xx-34xx".replace(ut,function(e){var n=(t+16*Math.random())%16|0;return t=Math.floor(t/16),("x"==e?n:3&n|8).toString(16)})}function lt(){var t=(new Date).getTime();return"idxxxxxxx".replace(ut,function(e){var n=(t+16*Math.random())%16|0;return t=Math.floor(t/16),("x"==e?n:3&n|8).toString(16)})}var ft={B1:function(t){return t*t*t},B2:function(t){return 3*t*t*(1-t)},B3:function(t){return 3*t*(1-t)*(1-t)},B4:function(t){return(1-t)*(1-t)*(1-t)}};function pt(t,e,n,r){var o=e,i=r;return function(t){return 1-(o*ft.B2(t)+i*ft.B3(t)+ft.B4(t))}}function ht(t,e){var n=Math.abs(e.width*Math.sin(t))+Math.abs(e.height*Math.cos(t)),r={x:e.x+e.width/2,y:e.y+e.height/2},o=Math.sin(t-Math.PI/2)*n/2,i=Math.cos(t-Math.PI/2)*n/2;return{length:n,center:r,start:{x:r.x-i,y:r.y-o},end:{x:r.x+i,y:r.y+o}}}function yt(t){return Math.pow(t,3)>.008856?Math.pow(t,3):(t-16/116)/7.787}function dt(t){return t>.0031308?1.055*Math.pow(t,1/2.4)-.055:12.92*t}function vt(t,e,n){if(1==arguments.length){var r=arguments[0];t=r.x,e=r.y,n=r.z}var o=t/100,i=e/100,a=n/100,c=3.2406*o+-1.5372*i+-.4986*a,u=-.9689*o+1.8758*i+.0415*a,s=.0557*o+-.204*i+1.057*a;return c=dt(c),u=dt(u),s=dt(s),{r:tt(255*c),g:tt(255*u),b:tt(255*s)}}function bt(t,e,n){if(1==arguments.length){var r=arguments[0];t=r.l,e=r.a,n=r.b}var o=(t+16)/116,i=e/500+o,a=o-n/200;return o=yt(o),{x:95.047*(i=yt(i)),y:100*o,z:108.883*(a=yt(a))}}function gt(t){return t>.008856?Math.pow(t,1/3):(7.787*t+16)/116}function mt(t,e,n){if(1==arguments.length){var r=arguments[0];t=r.x,e=r.y,n=r.z}var o=t/95.047,i=e/100,a=n/108.883;return o=gt(o),{l:116*(i=gt(i))-16,a:500*(o-i),b:200*(i-(a=gt(a)))}}function wt(t,e,n){if(1==arguments.length){var r=arguments[0];t=r.l,e=r.a,n=r.b}return vt(bt(t,e,n))}function kt(t,e,n){if(1==arguments.length){var r=arguments[0];t=r.r,e=r.g,n=r.b}var o=t/255,i=e/255,a=n/255,c=Math.max(o,i,a),u=c-Math.min(o,i,a),s=0;0==u?s=0:c==o?s=(i-a)/u%6*60:c==i?s=60*((a-o)/u+2):c==a&&(s=60*((o-i)/u+4)),s<0&&(s=360+s);return{h:s,s:0==c?0:u/c,v:c}}function Ot(t,e,n){if(1==arguments.length){var r=arguments[0];t=r.r,e=r.g,n=r.b}var o=t/255,i=e/255,a=n/255,c=1-Math.max(o,i,a);return{c:(1-o-c)/(1-c),m:(1-i-c)/(1-c),y:(1-a-c)/(1-c),k:c}}function St(t,e,n){if(1==arguments.length){var r=arguments[0];t=r.r,e=r.g,n=r.b}t/=255,e/=255,n/=255;var o,i,a=Math.max(t,e,n),c=Math.min(t,e,n),u=(a+c)/2;if(a==c)o=i=0;else{var s=a-c;switch(i=u>.5?s/(2-a-c):s/(a+c),a){case t:o=(e-n)/s+(e90?0:255)}function Pt(t){return{r:t,g:t,b:t}}function xt(t,e,n){if(1==arguments.length){var r=arguments[0];t=r.r,e=r.g,n=r.b}return Pt(Math.ceil((t+e+n)/3))}function Tt(t,e,n){if(1==arguments.length){var r=arguments[0];t=r.r,e=r.g,n=r.b}return Pt(Et(t,e,n).y)}function _t(t,e,n){return Math.ceil(.2126*t+.7152*e+.0722*n)}function Et(t,e,n){if(1==arguments.length){var r=arguments[0];t=r.r,e=r.g,n=r.b}var o=_t(t,e,n);return{y:o,cr:.713*(t-o),cb:.564*(n-o)}}function Ct(t){return 100*(t>.04045?Math.pow((t+.055)/1.055,2.4):t/12.92)}function $t(t,e,n){if(1==arguments.length){var r=arguments[0];t=r.r,e=r.g,n=r.b}var o=t/255,i=e/255,a=n/255;return{x:.4124*(o=Ct(o))+.3576*(i=Ct(i))+.1805*(a=Ct(a)),y:.2126*o+.7152*i+.0722*a,z:.0193*o+.1192*i+.9505*a}}function Rt(t,e,n){if(1==arguments.length){var r=arguments[0];t=r.r,e=r.g,n=r.b}return mt($t(t,e,n))}function Vt(t,e,n,r){if(1==arguments.length){var o=arguments[0];t=o.c,e=o.m,n=o.y,r=o.k}return{r:255*(1-t)*(1-r),g:255*(1-e)*(1-r),b:255*(1-n)*(1-r)}}function It(t,e,n){if(1==arguments.length){var r=arguments[0];t=r.h,e=r.s,n=r.v}var o=t,i=n;o>=360&&(o=0);var a=e*i,c=a*(1-Math.abs(o/60%2-1)),u=i-a,s=[];return 0<=o&&o<60?s=[a,c,0]:60<=o&&o<120?s=[c,a,0]:120<=o&&o<180?s=[0,a,c]:180<=o&&o<240?s=[0,c,a]:240<=o&&o<300?s=[c,0,a]:300<=o&&o<360&&(s=[a,0,c]),{r:tt(255*(s[0]+u)),g:tt(255*(s[1]+u)),b:tt(255*(s[2]+u))}}function At(t,e,n){if(1==arguments.length){var r=arguments[0];t=r.h,e=r.s,n=r.v}var o=It(t,e,n);return St(o.r,o.g,o.b)}function Dt(t,e,n){return n<0&&(n+=1),n>1&&(n-=1),n<1/6?t+6*(e-t)*n:n<.5?e:n<2/3?t+(e-t)*(2/3-n)*6:t}function Mt(t,e,n){if(1==arguments.length){var r=arguments[0];t=r.h,e=r.s,n=r.l}var o=Lt(t,e,n);return kt(o.r,o.g,o.b)}function Lt(t,e,n){if(1==arguments.length){var r=arguments[0];t=r.h,e=r.s,n=r.l}var o,i,a;if(t/=360,n/=100,0==(e/=100))o=i=a=n;else{var c=n<.5?n*(1+e):n+e-n*e,u=2*n-c;o=Dt(u,c,t+1/3),i=Dt(u,c,t),a=Dt(u,c,t-1/3)}return{r:tt(255*o),g:tt(255*i),b:tt(255*a)}}function Bt(t,e,n,r){if(1==arguments.length){var o=arguments[0];t=o.y,e=o.cr,n=o.cb;r=(r=o.bit)||0}var i=t+1.402*(e-r),a=t-.344*(n-r)-.714*(e-r),c=t+1.772*(n-r);return{r:Math.ceil(i),g:Math.ceil(a),b:Math.ceil(c)}}var zt={aliceblue:"rgb(240, 248, 255)",antiquewhite:"rgb(250, 235, 215)",aqua:"rgb(0, 255, 255)",aquamarine:"rgb(127, 255, 212)",azure:"rgb(240, 255, 255)",beige:"rgb(245, 245, 220)",bisque:"rgb(255, 228, 196)",black:"rgb(0, 0, 0)",blanchedalmond:"rgb(255, 235, 205)",blue:"rgb(0, 0, 255)",blueviolet:"rgb(138, 43, 226)",brown:"rgb(165, 42, 42)",burlywood:"rgb(222, 184, 135)",cadetblue:"rgb(95, 158, 160)",chartreuse:"rgb(127, 255, 0)",chocolate:"rgb(210, 105, 30)",coral:"rgb(255, 127, 80)",cornflowerblue:"rgb(100, 149, 237)",cornsilk:"rgb(255, 248, 220)",crimson:"rgb(237, 20, 61)",cyan:"rgb(0, 255, 255)",darkblue:"rgb(0, 0, 139)",darkcyan:"rgb(0, 139, 139)",darkgoldenrod:"rgb(184, 134, 11)",darkgray:"rgb(169, 169, 169)",darkgrey:"rgb(169, 169, 169)",darkgreen:"rgb(0, 100, 0)",darkkhaki:"rgb(189, 183, 107)",darkmagenta:"rgb(139, 0, 139)",darkolivegreen:"rgb(85, 107, 47)",darkorange:"rgb(255, 140, 0)",darkorchid:"rgb(153, 50, 204)",darkred:"rgb(139, 0, 0)",darksalmon:"rgb(233, 150, 122)",darkseagreen:"rgb(143, 188, 143)",darkslateblue:"rgb(72, 61, 139)",darkslategray:"rgb(47, 79, 79)",darkslategrey:"rgb(47, 79, 79)",darkturquoise:"rgb(0, 206, 209)",darkviolet:"rgb(148, 0, 211)",deeppink:"rgb(255, 20, 147)",deepskyblue:"rgb(0, 191, 255)",dimgray:"rgb(105, 105, 105)",dimgrey:"rgb(105, 105, 105)",dodgerblue:"rgb(30, 144, 255)",firebrick:"rgb(178, 34, 34)",floralwhite:"rgb(255, 250, 240)",forestgreen:"rgb(34, 139, 34)",fuchsia:"rgb(255, 0, 255)",gainsboro:"rgb(220, 220, 220)",ghostwhite:"rgb(248, 248, 255)",gold:"rgb(255, 215, 0)",goldenrod:"rgb(218, 165, 32)",gray:"rgb(128, 128, 128)",grey:"rgb(128, 128, 128)",green:"rgb(0, 128, 0)",greenyellow:"rgb(173, 255, 47)",honeydew:"rgb(240, 255, 240)",hotpink:"rgb(255, 105, 180)",indianred:"rgb(205, 92, 92)",indigo:"rgb(75, 0, 130)",ivory:"rgb(255, 255, 240)",khaki:"rgb(240, 230, 140)",lavender:"rgb(230, 230, 250)",lavenderblush:"rgb(255, 240, 245)",lawngreen:"rgb(124, 252, 0)",lemonchiffon:"rgb(255, 250, 205)",lightblue:"rgb(173, 216, 230)",lightcoral:"rgb(240, 128, 128)",lightcyan:"rgb(224, 255, 255)",lightgoldenrodyellow:"rgb(250, 250, 210)",lightgreen:"rgb(144, 238, 144)",lightgray:"rgb(211, 211, 211)",lightgrey:"rgb(211, 211, 211)",lightpink:"rgb(255, 182, 193)",lightsalmon:"rgb(255, 160, 122)",lightseagreen:"rgb(32, 178, 170)",lightskyblue:"rgb(135, 206, 250)",lightslategray:"rgb(119, 136, 153)",lightslategrey:"rgb(119, 136, 153)",lightsteelblue:"rgb(176, 196, 222)",lightyellow:"rgb(255, 255, 224)",lime:"rgb(0, 255, 0)",limegreen:"rgb(50, 205, 50)",linen:"rgb(250, 240, 230)",magenta:"rgb(255, 0, 255)",maroon:"rgb(128, 0, 0)",mediumaquamarine:"rgb(102, 205, 170)",mediumblue:"rgb(0, 0, 205)",mediumorchid:"rgb(186, 85, 211)",mediumpurple:"rgb(147, 112, 219)",mediumseagreen:"rgb(60, 179, 113)",mediumslateblue:"rgb(123, 104, 238)",mediumspringgreen:"rgb(0, 250, 154)",mediumturquoise:"rgb(72, 209, 204)",mediumvioletred:"rgb(199, 21, 133)",midnightblue:"rgb(25, 25, 112)",mintcream:"rgb(245, 255, 250)",mistyrose:"rgb(255, 228, 225)",moccasin:"rgb(255, 228, 181)",navajowhite:"rgb(255, 222, 173)",navy:"rgb(0, 0, 128)",oldlace:"rgb(253, 245, 230)",olive:"rgb(128, 128, 0)",olivedrab:"rgb(107, 142, 35)",orange:"rgb(255, 165, 0)",orangered:"rgb(255, 69, 0)",orchid:"rgb(218, 112, 214)",palegoldenrod:"rgb(238, 232, 170)",palegreen:"rgb(152, 251, 152)",paleturquoise:"rgb(175, 238, 238)",palevioletred:"rgb(219, 112, 147)",papayawhip:"rgb(255, 239, 213)",peachpuff:"rgb(255, 218, 185)",peru:"rgb(205, 133, 63)",pink:"rgb(255, 192, 203)",plum:"rgb(221, 160, 221)",powderblue:"rgb(176, 224, 230)",purple:"rgb(128, 0, 128)",rebeccapurple:"rgb(102, 51, 153)",red:"rgb(255, 0, 0)",rosybrown:"rgb(188, 143, 143)",royalblue:"rgb(65, 105, 225)",saddlebrown:"rgb(139, 69, 19)",salmon:"rgb(250, 128, 114)",sandybrown:"rgb(244, 164, 96)",seagreen:"rgb(46, 139, 87)",seashell:"rgb(255, 245, 238)",sienna:"rgb(160, 82, 45)",silver:"rgb(192, 192, 192)",skyblue:"rgb(135, 206, 235)",slateblue:"rgb(106, 90, 205)",slategray:"rgb(112, 128, 144)",slategrey:"rgb(112, 128, 144)",snow:"rgb(255, 250, 250)",springgreen:"rgb(0, 255, 127)",steelblue:"rgb(70, 130, 180)",tan:"rgb(210, 180, 140)",teal:"rgb(0, 128, 128)",thistle:"rgb(216, 191, 216)",tomato:"rgb(255, 99, 71)",turquoise:"rgb(64, 224, 208)",violet:"rgb(238, 130, 238)",wheat:"rgb(245, 222, 179)",white:"rgb(255, 255, 255)",whitesmoke:"rgb(245, 245, 245)",yellow:"rgb(255, 255, 0)",yellowgreen:"rgb(154, 205, 50)",transparent:"rgba(0, 0, 0, 0)"};var Ft={isColorName:function(t){return!!zt[t]},getColorByName:function(t){return zt[t]}};function Gt(t){return function(t){if(Array.isArray(t)){for(var e=0,n=new Array(t.length);e-1||e[r].indexOf("rgb")>-1||e[r].indexOf("hsl")>-1)n.push({color:e[r]});else{var i=Ft.getColorByName(e[r]);i&&n.push({color:e[r],nameColor:i})}var a={next:0};return n.forEach(function(e){var n=t.indexOf(e.color,a.next);e.startIndex=n,e.endIndex=n+e.color.length,a.next=e.endIndex}),n}function Kt(t){var e=Nt(t);return e.forEach(function(e,n){t=t.replace(e.color,"@"+n)}),{str:t,matches:e}}function Wt(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:",",n=Kt(t);return n.str.split(e).map(function(t,e){return t=qt(t),n.matches[e]&&(t=t.replace("@"+e,n.matches[e].color)),t})}function Ut(t,e){return e.forEach(function(e,n){t=t.replace("@"+n,e.color)}),t}var Zt=/^\s+|\s+$/g;function qt(t){return t.replace(Zt,"")}function Jt(t){if(R(t)){if(Ft.isColorName(t)&&(t=Ft.getColorByName(t)),t.indexOf("rgb(")>-1){for(var e=0,n=(r=t.replace("rgb(","").replace(")","").split(",")).length;e-1){for(e=0,n=(r=t.replace("rgba(","").replace(")","").split(",")).length;e-1){for(e=0,n=(r=t.replace("hsl(","").replace(")","").split(",")).length;e-1){for(e=0,n=(r=t.replace("hsla(","").replace(")","").split(",")).length;e>16,g:(65280&t)>>8,b:(255&t)>>0,a:1},St(i));if(0<=t&&t<=4294967295)return i=Ht({},i={type:"hex",r:(4278190080&t)>>24,g:(16711680&t)>>16,b:(65280&t)>>8,a:(255&t)/255},St(i))}return t}function Qt(t){R(t)&&(t=Wt(t));var e=(t=t.map(function(t){if(R(t)){var e=Kt(t),n=qt(e.str).split(" ");return n[1]?n[1].indexOf("%")>-1?n[1]=parseFloat(n[1].replace(/%/,""))/100:n[1]=parseFloat(n[1]):n[1]="*",n[0]=Ut(n[0],e.matches),n}if(Array.isArray(t))return t[1]?R(t[1])&&(t[1].indexOf("%")>-1?t[1]=parseFloat(t[1].replace(/%/,""))/100:t[1]=+t[1]):t[1]="*",Gt(t)})).filter(function(t){return"*"===t[1]}).length;if(e>0){var n=(1-t.filter(function(t){return"*"!=t[1]&&1!=t[1]}).map(function(t){return t[1]}).reduce(function(t,e){return t+e},0))/e;t.forEach(function(e,r){"*"==e[1]&&r>0&&(t.length-1==r||(e[1]=n))})}return t}function te(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:.5,r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"hex",o=ee(t,e,n);return W(o,o.a<1?"rgb":r)}function ee(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:.5;return{r:tt(t.r+(e.r-t.r)*n),g:tt(t.g+(e.g-t.g)*n),b:tt(t.b+(e.b-t.b)*n),a:tt(t.a+(e.a-t.a)*n,100)}}function ne(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:5;if(!t)return[];R(t)&&(t=Wt(t));for(var n=(t=t||[]).length,r=[],o=0;o2&&void 0!==arguments[2]?arguments[2]:.5,r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"hex";return te(Jt(t),Jt(e),n,r)}function oe(t,e){return re(t,e,arguments.length>2&&void 0!==arguments[2]?arguments[2]:.5,arguments.length>3&&void 0!==arguments[3]?arguments[3]:"hex")}function ie(t){return t=Jt(t),(Math.round(299*t.r)+Math.round(587*t.g)+Math.round(114*t.b))/1e3}function ae(t){return ie(t)>=128?"black":"white"}function ce(t){for(var e=[],n=(arguments.length>1&&void 0!==arguments[1]?arguments[1]:10)-((t=Qt(t)).length-1),r=n,o=1,i=t.length;o1&&void 0!==arguments[1]?arguments[1]:"h",n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:9,r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"rgb",o=arguments.length>4&&void 0!==arguments[4]?arguments[4]:0,i=arguments.length>5&&void 0!==arguments[5]?arguments[5]:1,a=arguments.length>6&&void 0!==arguments[6]?arguments[6]:100,c=kt(Jt(t)),u=(i-o)*a/n,s=[],l=1;l<=n;l++)c[e]=Math.abs((a-u*l)/a),s.push(W(It(c),r));return s}function se(t){return ue(t,"h",arguments.length>1&&void 0!==arguments[1]?arguments[1]:9,arguments.length>2&&void 0!==arguments[2]?arguments[2]:"rgb",arguments.length>3&&void 0!==arguments[3]?arguments[3]:0,arguments.length>4&&void 0!==arguments[4]?arguments[4]:360,1)}function le(t){return ue(t,"s",arguments.length>1&&void 0!==arguments[1]?arguments[1]:9,arguments.length>2&&void 0!==arguments[2]?arguments[2]:"rgb",arguments.length>3&&void 0!==arguments[3]?arguments[3]:0,arguments.length>4&&void 0!==arguments[4]?arguments[4]:1,100)}function fe(t){return ue(t,"v",arguments.length>1&&void 0!==arguments[1]?arguments[1]:9,arguments.length>2&&void 0!==arguments[2]?arguments[2]:"rgb",arguments.length>3&&void 0!==arguments[3]?arguments[3]:0,arguments.length>4&&void 0!==arguments[4]?arguments[4]:1,100)}function pe(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}ne.parula=function(t){return ne(["#352a87","#0f5cdd","#00b5a6","#ffc337","#fdff00"],t)},ne.jet=function(t){return ne(["#00008f","#0020ff","#00ffff","#51ff77","#fdff00","#ff0000","#800000"],t)},ne.hsv=function(t){return ne(["#ff0000","#ffff00","#00ff00","#00ffff","#0000ff","#ff00ff","#ff0000"],t)},ne.hot=function(t){return ne(["#0b0000","#ff0000","#ffff00","#ffffff"],t)},ne.pink=function(t){return ne(["#1e0000","#bd7b7b","#e7e5b2","#ffffff"],t)},ne.bone=function(t){return ne(["#000000","#4a4a68","#a6c6c6","#ffffff"],t)},ne.copper=function(t){return ne(["#000000","#3d2618","#9d623e","#ffa167","#ffc77f"],t)};var he=function(t){for(var e=1;e=t){e=ye[r-1],n=ye[r];break}return e&&n?he.interpolateRGB(e,n,(t-e.start)/(n.start-e.start)):ye[0].rgb}};function ve(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}var be=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=function(t){for(var e=1;e0&&void 0!==arguments[0]?arguments[0]:"",n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";if(Se(this,t),this.value=e,D(this.value)&&isNaN(this.value))throw new Error("NaN is not able to set");this.unit=n}var e,n,r;return e=t,n=[{key:Symbol.toPrimitive,value:function(t){return"number"==t?this.value:this.toString()}},{key:"toString",value:function(){switch(this.unit){case"string":case"number":return this.value+"";case"var":return"var(--".concat(this.value,")");case"calc":return"calc(".concat(this.value,")");default:return this.value+this.unit}}},{key:"isUnitType",value:function(t){return this.unit===t}},{key:"isCalc",value:function(){return this.isUnitType("calc")}},{key:"isFr",value:function(){return this.isUnitType("fr")}},{key:"isPercent",value:function(){return this.isUnitType("%")}},{key:"isPx",value:function(){return this.isUnitType("px")}},{key:"isEm",value:function(){return this.isUnitType("em")}},{key:"isDeg",value:function(){return this.isUnitType("deg")}},{key:"isRad",value:function(){return this.isUnitType("rad")}},{key:"isTurn",value:function(){return this.isUnitType("turn")}},{key:"isSecond",value:function(){return this.isUnitType("s")}},{key:"isMs",value:function(){return this.isUnitType("ms")}},{key:"isNumber",value:function(){return this.isUnitType("number")}},{key:"isString",value:function(){return this.isUnitType("")}},{key:"isVar",value:function(){return this.isUnitType("--")}},{key:"isNaN",value:function(t){function e(){return t.apply(this,arguments)}return e.toString=function(){return t.toString()},e}(function(){return D(this.value)&&isNaN(this.value)})},{key:"set",value:function(t){return this.value=t,this}},{key:"add",value:function(t){return this.value+=+t,this}},{key:"sub",value:function(t){return this.add(-1*t)}},{key:"mul",value:function(t){return this.value*=+t,this}},{key:"div",value:function(t){return this.value/=+t,this}},{key:"mod",value:function(t){return this.value%=+t,this}},{key:"clone",value:function(){return new t(this.value,this.unit)}},{key:"getUnitName",value:function(){return"%"===this.unit?"percent":this.unit}},{key:"toJSON",value:function(){return this.toString()}},{key:"rate",value:function(t){return t/this.value}},{key:"stringToPercent",value:function(){return E(je[this.value])?t.percent(je[this.value]):t.percent(0)}},{key:"stringToEm",value:function(t){return this.stringToPercent().toEm(t)}},{key:"stringToPx",value:function(t){return this.stringToPercent().toPx(t)}},{key:"toPercent",value:function(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:16;return this.isPercent()?this.clone():this.isPx()?t.percent(100*this.value/e):this.isEm()?t.percent(this.value*n*100/e):this.isString()?this.stringToPercent(e):this.isDeg()?t.percent(this.value/360*100):void 0}},{key:"toEm",value:function(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:16;return this.isPercent()?t.em(this.value/100*e/n):this.isPx()?t.em(this.value/n):this.isEm()?this.clone():this.isString()?this.stringToEm(e):void 0}},{key:"toPx",value:function(e){arguments.length>1&&void 0!==arguments[1]&&arguments[1];return this.isPercent()?t.px(this.value/100*e):this.isPx()?this.clone():this.isEm()?t.px(this.value/100*e/16):this.isString()?this.stringToPx(e):void 0}},{key:"toDeg",value:function(){return this.isDeg()?this.clone():this.isTurn()?t.deg(360*this.value):this.isRad()?t.deg(this.value*(180/Math.PI)):void 0}},{key:"toTurn",value:function(){return this.isTurn()?this.clone():this.isDeg()?t.turn(this.value/360):void 0}},{key:"toSecond",value:function(){return this.isSecond()?this:this.isMs()?t.second(this.value/1e3):void 0}},{key:"toMs",value:function(){return this.isSecond()?t.ms(1e3*this.value):this.isMs()?this:void 0}},{key:"to",value:function(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:16;return"px"===t?this.toPx(e,n):"%"===t||"percent"===t?this.toPercent(e,n):"em"===t?this.toEm(e,n):"deg"===t?this.toDeg():"turn"===t?this.toTurn():void 0}},{key:"toUnit",value:function(e){return new t(this.value,e)}},{key:"calculate",value:function(t,e){var n=this[t];return n?n.call(this,e):this}},{key:"includes",value:function(){for(var t=arguments.length,e=new Array(t),n=0;ne[o].value&&(r=e[o]);return r}},{key:"max",value:function(){for(var t=arguments.length,e=new Array(t),n=0;n-1)return new t(e.split("calc(")[1].split(")")[0],"calc");var n=e.replace(xe,"$1 $2").split(" ").map(function(t){return t.trim()});return+n[0]==n[0]?new t(+n[0],n[1]):new t(n[0])}if(e instanceof t)return e;if(e.unit){if("%"==e.unit||"percent"==e.unit){var r=0;return E(e.percent)?r=e.percent:E(e.value)&&(r=e.value),t.percent(r)}if("px"==e.unit){r=0;return E(e.px)?r=e.px:E(e.value)&&(r=e.value),t.px(r)}if("em"==e.unit){r=0;return E(e.em)?r=e.em:E(e.value)&&(r=e.value),t.em(r)}if("deg"==e.unit){r=0;return E(e.deg)?r=e.deg:E(e.value)&&(r=e.value),t.deg(r)}if("turn"==e.unit){r=0;return E(e.deg)?r=e.turn:E(e.value)&&(r=e.value),t.turn(r)}if("s"==e.unit){r=0;return E(e.second)?r=e.second:E(e.value)&&(r=e.value),t.second(r)}if("ms"==e.unit){r=0;return E(e.ms)?r=e.ms:E(e.value)&&(r=e.value),t.ms(r)}if("number"==e.unit){r=0;return E(e.value)&&(r=e.value),t.number(r)}if("--"==e.unit){r=0;return E(e.value)&&(r=e.value),t.var(r)}if(""===e.unit||"string"===e.unit){r="";return E(e.str)?r=e.str:E(e.value)&&(r=e.value),t.string(r)}}return t.string(e)}}],n&&Oe(e.prototype,n),r&&Oe(e,r),t}();function _e(t){return function(t){if(Array.isArray(t)){for(var e=0,n=new Array(t.length);e0&&void 0!==arguments[0]?arguments[0]:"block";return this.css("display","none"!=t?t:"block")}},{key:"hide",value:function(){return this.css("display","none")}},{key:"isHide",value:function(){return"none"==this.css("display")}},{key:"toggle",value:function(t){var e=this.isHide();return 1==arguments.length?e&&t?this.show():this.hide():e?this.show():this.hide()}},{key:"scrollIntoView",value:function(){this.el.scrollIntoView()}},{key:"addScrollLeft",value:function(t){return this.el.scrollLeft+=t,this}},{key:"addScrollTop",value:function(t){return this.el.scrollTop+=t,this}},{key:"setScrollTop",value:function(t){return this.el.scrollTop=t,this}},{key:"setScrollLeft",value:function(t){return this.el.scrollLeft=t,this}},{key:"scrollTop",value:function(){return this.el===document.body?t.getScrollTop():this.el.scrollTop}},{key:"scrollLeft",value:function(){return this.el===document.body?t.getScrollLeft():this.el.scrollLeft}},{key:"scrollHeight",value:function(){return this.el.scrollHeight}},{key:"scrollWidth",value:function(){return this.el.scrollWidth}},{key:"on",value:function(t,e,n,r){return this.el.addEventListener(t,e,n,r),this}},{key:"off",value:function(t,e){return this.el.removeEventListener(t,e),this}},{key:"getElement",value:function(){return this.el}},{key:"createChild",value:function(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},i=t.create(e,n,r);return i.css(o),this.append(i),i}},{key:"firstChild",value:function(){return t.create(this.el.firstElementChild)}},{key:"children",value:function(){var e=this.el.firstElementChild;if(!e)return[];var n=[];do{n.push(t.create(e)),e=e.nextElementSibling}while(e);return n}},{key:"childLength",value:function(){return this.el.children.length}},{key:"replace",value:function(t){return this.el.parentNode&&this.el.parentNode.replaceChild(t.el||t,this.el),this}},{key:"replaceChild",value:function(t,e){return this.el.replaceChild(e.el||e,t.el||t),this}},{key:"checked",value:function(){var t=arguments.length>0&&void 0!==arguments[0]&&arguments[0];return 0==arguments.length?!!this.el.checked:(this.el.checked=!!t,this)}},{key:"click",value:function(){return this.el.click(),this}},{key:"focus",value:function(){return this.el.focus(),this}},{key:"select",value:function(){return this.el.select(),this}},{key:"blur",value:function(){return this.el.blur(),this}},{key:"select",value:function(){return this.el.select(),this}},{key:"context",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"2d";return this._initContext||(this._initContext=this.el.getContext(t)),this._initContext}},{key:"resize",value:function(t){var e=t.width,n=t.height;this._initContext=null;var r=this.context(),o=window.devicePixelRatio||1;this.px("width",e),this.px("height",n),this.el.width=e*o,this.el.height=n*o,r.scale(o,o)}},{key:"clear",value:function(){this.context().clearRect(0,0,this.el.width,this.el.height)}},{key:"update",value:function(t){this.clear(),t.call(this,this)}},{key:"drawOption",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=this.context();Object.assign(e,t)}},{key:"drawLine",value:function(t,e,n,r){var o=this.context();o.beginPath(),o.moveTo(t,e),o.lineTo(n,r),o.stroke(),o.closePath()}},{key:"drawPath",value:function(){var t=this.context();t.beginPath();for(var e=arguments.length,n=new Array(e),r=0;r1&&void 0!==arguments[1]?arguments[1]:Le;return" ".concat(e," ").concat(t)},Ie=/^load (.*)/gi,Ae=/^bind (.*)/gi,De=["click|dblclick","mouse(down|up|move|over|out|enter|leave)","pointer(start|move|end)","touch(start|move|end)","key(down|up|press)","drag|drop|drag(start|over|enter|leave|exit|end)","contextmenu","change|input|focus|blur|focus(in|out)","paste","resize|scroll|wheel|mousewheel|DOMMouseScroll","submit","animation(start|end|iteration)","transition(start|end|cancel|run)"].join("|"),Me=new RegExp("^(".concat(De,")"),"ig"),Le="|",Be={},ze=function(){for(var t=arguments.length,e=new Array(t),n=0;n1&&void 0!==arguments[1]?arguments[1]:Le;return Ve(t,e)}),fn=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Le;return Ve("after(".concat(t,")"),e)},pn=ln,hn=ln,yn=(ln("ArrowUp"),ln("ArrowDown"),ln("ArrowLeft"),ln("ArrowRight"),ln("Enter"),ln("Space"),ln("isAltKey")),dn=(ln("isShiftKey"),ln("isMetaKey"),ln("isCtrlKey")),vn=(ln("self"),ln("fit"),ln("passive"),ln("vdom")),bn=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:100;return ln("debounce(".concat(t,")"))},gn=(bn(1e3),function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:100;return ln("throttle(".concat(t,")"))}),mn=(ln("capture()"),function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"move";return fn("bodyMouseMove ".concat(t))}),wn=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"end";return fn("bodyMouseUp ".concat(t))},kn=fn("preventDefault"),On=fn("stopPropagation"),Sn=function(){return"load "+(arguments.length>0&&void 0!==arguments[0]?arguments[0]:"$el")},jn=function(){return!0},Pn=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"$el",e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";return"bind "+t+(e?Le+function(t){if(""===t)return"";var e=st();return Be[e]=t,e}(e):"")},xn={addEvent:function(t,e,n){var r=arguments.length>3&&void 0!==arguments[3]&&arguments[3];t&&t.addEventListener(e,n,r)},removeEvent:function(t,e,n){t&&t.removeEventListener(e,n)},pos:function(t){return t.touches&&t.touches[0]?t.touches[0]:t},posXY:function(t){var e=this.pos(t);return{x:e.pageX,y:e.pageY}}};function Tn(t,e){for(var n=0;n0&&void 0!==arguments[0]&&arguments[0];!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.cachedCallback={},this.callbacks={},this.commandes=[]}var e,n,r;return e=t,(n=[{key:"getCallbacks",value:function(t){return this.callbacks[t]||(this.callbacks[t]=[]),this.callbacks[t]}},{key:"setCallbacks",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];this.callbacks[t]=e}},{key:"on",value:function(t,e,n){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0,o=r>0?k(e,r):e;this.getCallbacks(t).push({event:t,callback:o,context:n,originalCallback:e})}},{key:"off",value:function(t,e){1==arguments.length?this.setCallbacks(t):2==arguments.length&&this.setCallbacks(t,this.getCallbacks(t).filter(function(t){return t.originalCallback!==e}))}},{key:"offAll",value:function(t){var e=this;Object.keys(this.callbacks).forEach(function(n){e.setCallbacks(n,e.getCallbacks(n).filter(function(e){return e.context!==t}))})}},{key:"getCachedCallbacks",value:function(t){return this.getCallbacks(t)}},{key:"sendMessage",value:function(t,e,n,r,o,i){var a=this;setTimeout(function(){var c=a.getCachedCallbacks(e);c&&c.filter(function(e){return e.originalCallback.source!==t}).forEach(function(t){t.callback(n,r,o,i)})},0)}},{key:"triggerMessage",value:function(t,e,n,r,o,i){var a=this;setTimeout(function(){var c=a.getCachedCallbacks(e);c?c.filter(function(e){return e.originalCallback.source===t}).forEach(function(t){t.callback(n,r,o,i)}):console.warn(e," is not valid event")},0)}},{key:"emit",value:function(t,e,n,r,o){this.sendMessage(this.source,t,e,n,r,o)}},{key:"trigger",value:function(t,e,n,r,o){this.triggerMessage(this.source,t,e,n,r,o)}},{key:"execute",value:function(t,e,n,r,o){this.runCommand(this.source,t,e,n,r,o)}}])&&Tn(e.prototype,n),r&&Tn(e,r),t}();function Cn(){var t=Rn(["",""]);return Cn=function(){return t},t}function $n(){var t=Rn(["\n ","\n "]);return $n=function(){return t},t}function Rn(t,e){return e||(e=t.slice(0)),Object.freeze(Object.defineProperties(t,{raw:{value:Object.freeze(e)}}))}function Vn(t,e){for(var n=0;n-1||!!e.key&&n.codes.indexOf(e.key.toLowerCase())>-1);var o=!0;return n.checkMethodList.length&&(o=n.checkMethodList.every(function(n){var r=t[n];return A(r)&&r?r.call(t,e):!E(r)||!!r})),r&&o},Kn=function(t,e){var n=t.filter(function(t){return t.indexOf("".concat(e,"("))>-1}),r=n.map(function(t){var n=Ln(t.split("".concat(e,"("))[1].split(")")[0].trim().split(" "),2);return{target:n[0],param:n[1]}});return[n,r]},Wn=function(t,e,n){e.callback=function(t,e,n){return e.delegate?Xn(t,e,n):Hn(t,e,n)}(t,e,n),t.addBinding(e),xn.addEvent(e.dom,e.eventName,e.callback,!!e.captures.length)},Un=function(t,e,n,r){var o=An(e),i=o[0],a=o[1],c=o.slice(2),u=function(t,e,n){var r=n,o=r.filter(function(e){return!!t[e]}),i=Ln(Kn(r,"after"),2),a=i[0],c=i[1],u=Ln(Kn(r,"before"),2),s=u[0],l=u[1],f=Ln(Kn(r,"debounce"),2),p=f[0],h=f[1],y=Ln(Kn(r,"throttle"),2),d=y[0],v=y[1],b=Ln(Kn(r,"capture"),1)[0],g=[].concat(Dn(o),Dn(a),Dn(s),Dn(p),Dn(d),Dn(b));return{eventName:e,codes:r.filter(function(t){return-1===g.indexOf(t)}).map(function(t){return t.toLowerCase()}),captures:b,afterMethods:c,beforeMethods:l,debounceMethods:h,throttleMethods:v,checkMethodList:o}}(t,i,n);if(u.dom=function(t,e){var n;return(n=e?t.refs[e]||t[e]||window[e]:t.el||t.$el||t.$root)instanceof Re?n.getElement():n}(t,a),u.delegate=c.join(" "),u.debounceMethods.length)r=k(r,+u.debounceMethods[0].target);else if(u.throttleMethods.length){r=O(r,+u.throttleMethods[0].target)}Wn(t,u,r)},Zn=function(t,e){var n=e.split(Le).map(function(t){return t.trim()}),r=An(n.shift().split(" ")),o=r[0],i=r.slice(1),a=function(t){var e=[];return t.split(":").forEach(function(t){var n=t.split(":");e.push.apply(e,Dn(n))}),e}(o),c=t[e].bind(t);a.forEach(function(e){Un(t,[e].concat(Dn(i)),n,c)})},qn=(In(_n={constructor:!0,initState:!0,refresh:!0,updateData:!0},"constructor",!0),In(_n,"initializeProperty",!0),In(_n,"created",!0),In(_n,"getRealEventName",!0),In(_n,"initializeStoreEvent",!0),In(_n,"destoryStoreEvent",!0),In(_n,"destroy",!0),In(_n,"emit",!0),In(_n,"trigger",!0),In(_n,"on",!0),In(_n,"off",!0),In(_n,"setState",!0),In(_n,"_reload",!0),In(_n,"render",!0),In(_n,"initialize",!0),In(_n,"afterRender",!0),In(_n,"components",!0),In(_n,"getRef",!0),In(_n,"parseTemplate",!0),In(_n,"childrenIds",!0),In(_n,"exists",!0),In(_n,"parseProperty",!0),In(_n,"parseSourceName",!0),In(_n,"parseComponent",!0),In(_n,"clean",!0),In(_n,"refresh",!0),In(_n,"loadTemplate",!0),In(_n,"load",!0),In(_n,"bindData",!0),In(_n,"template",!0),In(_n,"templateClass",!0),In(_n,"eachChildren",!0),In(_n,"initializeEvent",!0),In(_n,"destroy",!0),In(_n,"destroyDomEvent",!0),In(_n,"initializeDomEvent",!0),In(_n,"collectProps",!0),In(_n,"filterProps",!0),In(_n,"self",!0),In(_n,"isAltKey",!0),In(_n,"isCtrlKey",!0),In(_n,"isShiftKey",!0),In(_n,"isMetaKey",!0),In(_n,"preventDefault",!0),In(_n,"stopPropagation",!0),In(_n,"bodyMouseMove",!0),In(_n,"bodyMouseUp",!0),In(_n,"getBindings",!0),In(_n,"addBinding",!0),In(_n,"initBindings",!0),In(_n,"removeEventAll",!0),In(_n,"removeEvent",!0),_n),Jn=function(){function t(){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.state={},this.prevState={},this.refs={},this.children={},this._bindings=[],this.id=st(),this.initComponents()}var e,n,r;return e=t,(n=[{key:"initComponents",value:function(){var t=this;this.childComponents=this.components(),this.childComponentKeys=Object.keys(this.childComponents),this.childComponentSet=new Map,this.childComponentKeys.forEach(function(e){t.childComponentSet.set(e.toLowerCase(),e)}),this.childComponentKeysString=Dn(this.childComponentSet.keys()).join(",")}},{key:"initState",value:function(){return{}}},{key:"setState",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];this.prevState=this.state,this.state=Object.assign({},this.state,t),e&&this.load()}},{key:"_reload",value:function(t){this.props=t,this.setState(this.initState(),!1),this.refresh(!0)}},{key:"render",value:function(t){this.$el=this.parseTemplate(H($n(),this.template())),this.refs.$el=this.$el,t&&t.append(this.$el),this.load(),this.parseComponent(!1),this.afterRender()}},{key:"initialize",value:function(){this.state=this.initState()}},{key:"afterRender",value:function(){}},{key:"components",value:function(){return{}}},{key:"getRef",value:function(){for(var t=arguments.length,e=new Array(t),n=0;n-1}},{key:"parseProperty",value:function(t){var e={},n=!0,r=!1,o=void 0;try{for(var i,a=t.el.attributes[Symbol.iterator]();!(n=(i=a.next()).done);n=!0){var c=i.value;e[c.nodeName]=c.nodeValue}}catch(t){r=!0,o=t}finally{try{n||null==a.return||a.return()}finally{if(r)throw o}}return t.$$("property").forEach(function(t){var n=Ln(t.attrs("name","value","type"),3),r=n[0],o=n[1],i=n[2],a=o||t.text();"json"===i&&(a=JSON.parse(a)),e[r]=a}),e}},{key:"parseSourceName",value:function(t){return t.parent?[t.sourceName].concat(Dn(this.parseSourceName(t.parent))):[t.sourceName]}},{key:"parseComponent",value:function(){var t=this,e=this.$el,n=[];this.childComponentKeysString&&(n=e.$$(this.childComponentKeysString)),n.forEach(function(e){var n=e.el.tagName.toLowerCase(),r=t.childComponentSet.get(n),o=t.childComponents[r],i=t.parseProperty(e),a=e.attr("ref"),c=null;t.children[a]?(c=t.children[a])._reload(i):(c=new o(t,i),t.children[a||c.id]=c,c.render(),c.initializeEvent()),e.replace(c.$el)}),S(this.children,function(e,n){n&&n.clean()&&delete t.children[e]})}},{key:"clean",value:function(){if(this.$el&&!this.$el.hasParent())return S(this.children,function(t,e){e.clean()}),this.destroy(),this.$el=null,!0}},{key:"refresh",value:function(){this.load()}},{key:"loadTemplate",value:function(){for(var t=arguments.length,e=new Array(t),n=0;n-1}).forEach(function(e){var r=An(e.split("load ")[1].split(Le).map(function(t){return t.trim()})),o=r[0],i=r.slice(1),a=(i=i.map(function(t){return t.trim()})).indexOf(vn.value)>-1;if(t.refs[o]){var c,u=(c=t[e]).call.apply(c,[t].concat(n));C(u)&&(u=u.join(""));var s=t.parseTemplate(H(Cn(),u),!0);a?t.refs[o].htmlDiff(s):t.refs[o].html(s),t.initializeDomEvent()}}),this.bindData(),this.parseComponent()}},{key:"bindData",value:function(){for(var t=this,e=arguments.length,n=new Array(e),r=0;r-1}).forEach(function(e){var r,o=t[e],i=Ln(e.split(Le),2),a=(e=i[0],i[1]),c=t.getRef(a),u=jn;""!=c&&R(c)?(r=c,u=function(){return this.prevState[r]!=this.state[r]}):A(c)&&(u=c);var s=e.split("bind ")[1],l=t.refs[s],f=A(u)&&u.call(t);if(l&&f){var p=o.call.apply(o,[t].concat(n));if(!p)return;S(p,function(t,e){!function(t,e,n){if("cssText"===e)t.cssText(n);else{if("style"===e)return void(V(n)&&S(n,function(e,n){n?t.css(e,n):t.removeStyle(e)}));if("class"===e)return void(C(n)?t.addClass.apply(t,Dn(n)):I(n)?S(n,function(e,n){return t.toggleClass(e,n)}):t.addClass(n))}_(n)?t.removeAttr(e):"TEXTAREA"===t.el.nodeName&&"value"===e?t.text(n):"text"===e||"textContent"===e?t.text(n):"innerHTML"===e||"html"===e?t.html(n):t.attr(e,n)}(l,t,e)})}})}},{key:"template",value:function(){var t=this.templateClass(),e=t?'class="'.concat(t,'"'):"";return"
")}},{key:"templateClass",value:function(){return null}},{key:"eachChildren",value:function(t){A(t)&&S(this.children,function(e,n){t(n)})}},{key:"initializeEvent",value:function(){this.initializeDomEvent()}},{key:"destroy",value:function(){this.eachChildren(function(t){t.destroy()}),this.destroyDomEvent()}},{key:"destroyDomEvent",value:function(){this.removeEventAll()}},{key:"initializeDomEvent",value:function(){var t=this;this.destroyDomEvent(),this._domEvents||(this._domEvents=this.filterProps(Me)),this._domEvents.forEach(function(e){return Zn(t,e)})}},{key:"collectProps",value:function(){var t=this,e=this.__proto__,n=[];do{if(!1===e instanceof Object)break;var r=Object.getOwnPropertyNames(e).filter(function(e){return A(t[e])&&!qn[e]});n.push.apply(n,Dn(r)),e=e.__proto__}while(e);return n}},{key:"filterProps",value:function(t){return this.collectProps().filter(function(e){return e.match(t)})}},{key:"self",value:function(t){return t&&t.$delegateTarget&&t.$delegateTarget.is(t.target)}},{key:"isAltKey",value:function(t){return t.altKey}},{key:"isCtrlKey",value:function(t){return t.ctrlKey}},{key:"isShiftKey",value:function(t){return t.shiftKey}},{key:"isMetaKey",value:function(t){return t.metaKey||"Meta"==t.key||t.code.indexOf("Meta")>-1}},{key:"preventDefault",value:function(t){return t.preventDefault(),!0}},{key:"stopPropagation",value:function(t){return t.stopPropagation(),!0}},{key:"bodyMouseMove",value:function(t,e){this[e]&&this.emit("add/body/mousemove",this[e],this,t.xy)}},{key:"bodyMouseUp",value:function(t,e){this[e]&&this.emit("add/body/mouseup",this[e],this,t.xy)}},{key:"getBindings",value:function(){return this._bindings||this.initBindings(),this._bindings}},{key:"addBinding",value:function(t){this.getBindings().push(t)}},{key:"initBindings",value:function(){this._bindings=[]}},{key:"removeEventAll",value:function(){var t=this;this.getBindings().forEach(function(e){t.removeEvent(e)}),this.initBindings()}},{key:"removeEvent",value:function(t){var e=t.eventName,n=t.dom,r=t.callback;xn.removeEvent(n,e,r)}}])&&Vn(e.prototype,n),r&&Vn(e,r),t}();function Qn(t){return(Qn="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function tr(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var n=[],r=!0,o=!1,i=void 0;try{for(var a,c=t[Symbol.iterator]();!(r=(a=c.next()).done)&&(n.push(a.value),!e||n.length!==e);r=!0);}catch(t){o=!0,i=t}finally{try{r||null==c.return||c.return()}finally{if(o)throw i}}return n}(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance")}()}function er(t,e){for(var n=0;n1&&void 0!==arguments[1]?arguments[1]:{};return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),(n=nr(this,or(e).call(this,t))).initializeProperty(t,r),n.created(),n.initialize(),n.initializeStoreEvent(),n}var n,r,o;return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&ir(t,e)}(e,Jn),n=e,(r=[{key:"initializeProperty",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};this.opt=t||{},this.parent=this.opt,this.props=e,this.source=st(),this.sourceName=this.constructor.name,t&&t.$store&&(this.$store=t.$store)}},{key:"created",value:function(){}},{key:"getRealEventName",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"ME@",n=t.indexOf(e);return t.substr(n<0?0:n+e.length)}},{key:"initializeStoreEvent",value:function(){var t=this;this.storeEvents={},this.filterProps(ar).forEach(function(e){var n=t.getRealEventName(e,"ME@"),r=tr(Kn(n.split("|"),"debounce"),2),o=r[0],i=r[1],a=0;o.length&&(a=+i[0].target||0),n.split("|").filter(function(t){return-1===o.indexOf(t)}).map(function(t){return t.trim()}).forEach(function(n){var r=t[e].bind(t);r.displayName=n,r.source=t.source,t.storeEvents[n]=r,t.$store.on(n,t.storeEvents[n],t,a)})})}},{key:"destoryStoreEvent",value:function(){this.$store.offAll(this),this.storeEvents={}}},{key:"destroy",value:function(){rr(or(e.prototype),"destroy",this).call(this),this.destoryStoreEvent()}},{key:"emit",value:function(t,e,n,r,o){this.$store.source=this.source,this.$store.sourceContext=this,this.$store.emit(t,e,n,r,o)}},{key:"trigger",value:function(t,e,n,r,o){this.$store.source=this.source,this.$store.trigger(t,e,n,r,o)}},{key:"on",value:function(t,e){this.$store.on(t,e)}},{key:"off",value:function(t,e){this.$store.off(t,e)}}])&&er(n.prototype,r),o&&er(n,o),e}();function lr(t,e){for(var n=0;n0&&void 0!==arguments[0]?arguments[0]:{};return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.ref=new Proxy(this,{get:function(t,e){var n=t[e];return A(n)?function(){for(var e=arguments.length,r=new Array(e),o=0;o-1}},{key:"isNot",value:function(){return!1===this.is.apply(this,arguments)}},{key:"convert",value:function(t){var e=this;return t.layers.forEach(function(t){t.parent=e.ref}),t}},{key:"checkField",value:function(t,e){return!0}},{key:"toCloneObject",value:function(){return{itemType:this.json.itemType,elementType:this.json.elementType,type:this.json.type,visible:this.json.visible,lock:this.json.lock,selected:this.json.selected,layers:this.json.layers.map(function(t){return t.clone()})}}},{key:"clone",value:function(){var t=new(0,this.constructor)(this.toCloneObject());return t.parent=this.json.parent,t}},{key:"reset",value:function(e){e instanceof t&&(e=e.toJSON()),this.json=this.convert(hr({},this.json,e))}},{key:"getDefaultObject",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return hr({id:lt(),visible:!0,lock:!1,selected:!1,layers:[]},t)}},{key:"add",value:function(t){return this.json.layers.push(t),t.parent=this.ref,t}},{key:"toggle",value:function(t,e){_(e)?this.json[t]=!this.json[t]:this.json[t]=!!e}},{key:"expectJSON",value:function(t){return"parent"!==t&&""!==this.json[t]}},{key:"toJSON",value:function(){var t=this,e=this.json,n={};return Object.keys(e).filter(function(e){return t.expectJSON(e)}).forEach(function(t){n[t]=e[t]}),n}},{key:"resize",value:function(){}},{key:"copy",value:function(){return this.json.parent.copyItem(this.ref)}},{key:"copyItem",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:10,n=t.clone();n.x.add(e),n.y.add(e);for(var r=this.json.layers,o=-1,i=0,a=r.length;i-1&&this.json.layers.splice(o+1,0,n),n}},{key:"remove",value:function(){this.json.parent.removeItem(this.ref)}},{key:"removeItem",value:function(t){for(var e=this.json.layers,n=-1,r=0,o=e.length;r-1&&this.json.layers.splice(n,1)}},{key:"searchById",value:function(t){if(this.id===t)return this.ref;for(var e=0,n=this.layers.length;e").concat(r.map(function(t){return t.html}).join(""),"")}},{key:"allLayers",get:function(){return vr(function t(e){var n=[];return e.layers.length&&e.layers.forEach(function(e){n.push.apply(n,vr(t(e)))}),n.push(e),n}(this.ref))}}])&&dr(e.prototype,n),r&&dr(e,r),t}();function gr(t){return(gr="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function mr(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function wr(t,e){for(var n=0;nthis.screenX2.value)&&!(t.y.value>this.screenY2.value)))}},{key:"toBoundCSS",value:function(){return{top:"".concat(this.json.y),left:"".concat(this.json.x),width:"".concat(this.json.width),height:"".concat(this.json.height)}}},{key:"move",value:function(t,e){return this.reset({x:t,y:e}),this}},{key:"moveX",value:function(t){return this.reset({x:t}),this}},{key:"moveY",value:function(t){return this.reset({y:t}),this}},{key:"resize",value:function(t,e){return t.value>=0&&e.value>=0&&this.reset({width:t,height:e}),this}},{key:"resizeWidth",value:function(t){return t.value>=0&&this.reset({width:t}),this}},{key:"resizeHeight",value:function(t){return t.value>=0&&this.reset({height:t}),this}},{key:"isAbsolute",get:function(){return"absolute"===this.json.position}},{key:"isRelative",get:function(){return"relative"===this.json.position}},{key:"isChild",get:function(){if(this.json.parent&&(!1===this.json.parent.is("project")&&this.isAbsolute))return!0;return!1}},{key:"screenX",get:function(){return this.isChild?Te.px(this.json.parent.screenX.value+this.json.x.value):this.json.x||Te.px(0)}},{key:"screenY",get:function(){return this.isChild?Te.px(this.json.parent.screenY.value+this.json.y.value):this.json.y||Te.px(0)}},{key:"screenX2",get:function(){return Te.px(this.screenX.value+this.json.width.value)}},{key:"screenY2",get:function(){return Te.px(this.screenY.value+this.json.height.value)}},{key:"screenWidth",get:function(){return this.json.width}},{key:"screenHeight",get:function(){return this.json.height}},{key:"screenRect",get:function(){return{left:this.screenX,top:this.screenY,width:this.screenWidth,height:this.screenHeight}}},{key:"centerX",get:function(){var t=0;return 0!=this.json.width.value&&(t=Math.floor(this.json.width.value/2)),Te.px(this.screenX.value+t)}},{key:"centerY",get:function(){var t=0;return 0!=this.json.height.value&&(t=Math.floor(this.json.height.value/2)),Te.px(this.screenY.value+t)}}])&&wr(n.prototype,r),o&&wr(n,o),e}();function xr(t){return(xr="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function Tr(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function _r(t,e){for(var n=0;n0&&void 0!==arguments[0]?arguments[0]:{})}}])&&_r(n.prototype,r),o&&_r(n,o),e}();function Vr(t,e){for(var n=0;n1&&void 0!==arguments[1]?arguments[1]:1;return Te.px(t).round(e)};var Dr=function(){function t(){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.project=null,this.artboard=null,this.items=[],this.itemKeys={}}var e,n,r;return e=t,(n=[{key:"initialize",value:function(){this.items=[],this.itemKeys={}}},{key:"selectProject",value:function(t){this.project=t,this.artboard=null,this.project.artboards.length&&this.selectArtboard(this.project.artboards[0])}},{key:"selectArtboard",value:function(t){this.artboard=t,this.items=[],this.artboard.layers.length&&this.select(this.artboard.layers[0])}},{key:"select",value:function(){for(var t=this,e=arguments.length,n=new Array(e),r=0;r0&&void 0!==arguments[0])||arguments[0];this.cachedItems=this.items.map(function(e){return t&&e.setCache(),e.clone()}),this.setAllRectCache()}},{key:"setAllRectCache",value:function(){var t=Number.MAX_SAFE_INTEGER,e=Number.MAX_SAFE_INTEGER,n=Number.MIN_SAFE_INTEGER,r=Number.MIN_SAFE_INTEGER;this.cachedItems.forEach(function(o){t=Math.min(o.screenX.value,t),e=Math.min(o.screenY.value,e),n=Math.max(o.screenX2.value,n),r=Math.max(o.screenY2.value,r)}),t===Number.MAX_SAFE_INTEGER&&(t=0),e===Number.MAX_SAFE_INTEGER&&(e=0),n===Number.MIN_SAFE_INTEGER&&(n=0),r===Number.MIN_SAFE_INTEGER&&(r=0),this.allRect=new Rr({x:Te.px(t),y:Te.px(e),width:Te.px(n-t),height:Te.px(r-e)})}},{key:"each",value:function(t){var e=this;A(t)&&this.items.forEach(function(n,r){t(n,e.cachedItems[r])})}},{key:"reset",value:function(t){this.each(function(e){return e.reset(t)})}},{key:"resize",value:function(){this.each(function(t){return t.resize()})}},{key:"remove",value:function(){this.each(function(t){return t.remove()}),this.empty()}},{key:"copy",value:function(){this.copyItems=this.items.map(function(t){return t})}},{key:"paste",value:function(){this.select.apply(this,Ir(this.copyItems.map(function(t){return t.copy()}))),this.copy()}},{key:"move",value:function(t,e){this.each(function(n,r){n.move(Ar(r.x.value+t),Ar(r.y.value+e))})}},{key:"moveRight",value:function(t){this.each(function(e,n){e.resizeWidth(Ar(n.width.value+t))})}},{key:"moveLeft",value:function(t){this.each(function(e,n){n.width.value-t>=0&&(e.moveX(Ar(n.x.value+t)),e.resizeWidth(Ar(n.width.value-t)))})}},{key:"moveBottom",value:function(t){this.each(function(e,n){e.resizeHeight(Ar(n.height.value+t))})}},{key:"moveTop",value:function(t){this.each(function(e,n){n.height.value-t>=0&&(e.moveY(Ar(n.y.value+t)),e.resizeHeight(Ar(n.height.value-t)))})}},{key:"current",get:function(){return this.items[0]}},{key:"currentProject",get:function(){return this.project}},{key:"currentArtboard",get:function(){return this.artboard}},{key:"isEmpty",get:function(){return!this.length}},{key:"length",get:function(){return this.items.length}},{key:"isRelative",get:function(){return"relative"===(this.items[0]||{}).position}}])&&Vr(e.prototype,n),r&&Vr(e,r),t}();function Mr(t){return function(t){if(Array.isArray(t)){for(var e=0,n=new Array(t.length);e0&&void 0!==arguments[0]?arguments[0]:{})}},{key:"isAttribute",value:function(){return!0}},{key:"toCSS",value:function(){return{}}},{key:"toString",value:function(){return X(this.toCSS())}}])&&Hr(n.prototype,r),o&&Hr(n,o),e}();function Wr(t){return(Wr="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function Ur(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function Zr(t,e){for(var n=0;n0&&void 0!==arguments[0]?arguments[0]:{};return Jr(Qr(e.prototype),"getDefaultObject",this).call(this,function(t){for(var e=1;e")}}])&&Zr(n.prototype,r),o&&Zr(n,o),e}();function oo(t){return(oo="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function io(t,e){for(var n=0;n\n \n ')}}])&&io(n.prototype,r),o&&io(n,o),e}();function fo(t){return(fo="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function po(t,e){for(var n=0;n\n \n \n ')}}])&&po(n.prototype,r),o&&po(n,o),e}();function mo(t){return(mo="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function wo(t,e){for(var n=0;n")}}])&&wo(n.prototype,r),o&&wo(n,o),e}();function xo(t){return(xo="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function To(t,e){for(var n=0;n")}}])&&To(n.prototype,r),o&&To(n,o),e}();function Vo(t){return(Vo="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function Io(t,e){for(var n=0;n")}}])&&Io(n.prototype,r),o&&Io(n,o),e}();function zo(t){return(zo="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function Fo(t,e){for(var n=0;n")}}])&&Fo(n.prototype,r),o&&Fo(n,o),e}();function Ko(t){return(Ko="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function Wo(t,e){for(var n=0;n")}}])&&Wo(n.prototype,r),o&&Wo(n,o),e}();function ti(t){return(ti="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function ei(t,e){for(var n=0;n")}}])&&ei(n.prototype,r),o&&ei(n,o),e}();function ci(t){return(ci="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function ui(t,e){for(var n=0;n")}}])&&ui(n.prototype,r),o&&ui(n,o),e}();function yi(t){return(yi="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function di(t,e){for(var n=0;n")}}])&&di(n.prototype,r),o&&di(n,o),e}();function Oi(t){return(Oi="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function Si(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function ji(t,e){for(var n=0;n0&&void 0!==arguments[0]?arguments[0]:{};return xi(Ti(e.prototype),"getDefaultObject",this).call(this,function(t){for(var e=1;e")}}])&&ji(n.prototype,r),o&&ji(n,o),e}(),$i={RotaMatrix:lo,GaussianBlur:hi,Flood:ki,Merge:go,Composite:Po,Morphology:Ro,Turbulence:Bo,DisplacementMap:No,ColorMatrix:Qo,ConvolveMatrix:ai},Ri={RotaMatrixSVGFilter:lo,GaussianBlurSVGFilter:hi,FloodSVGFilter:ki,MergeSVGFilter:go,CompositeSVGFilter:Po,MorphologySVGFilter:Ro,TurbulenceSVGFilter:Bo,DisplacementMapSVGFilter:No,ColorMatrixSVGFilter:Qo,ConvolveMatrixSVGFilter:ai};function Vi(t){return(Vi="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function Ii(t){for(var e=1;e0&&void 0!==arguments[0]?arguments[0]:{};return Li(Bi(e.prototype),"getDefaultObject",this).call(this,Ii({colors:[],gradients:[],svgfilters:[],svgimages:[],images:[]},t))}},{key:"copyPropertyList",value:function(t,e){var n=Ii({},t[e]);t.splice(e,0,n)}},{key:"toSVGString",value:function(){var t=this.json.svgfilters.map(function(t){var e=t.filters.map(function(t){return Ci.parse(t)});return"\n ").concat(e.join("\n"),"\n\n")}).join("\n\n");return"\n ".concat(t,"\n ")}},{key:"toCloneObject",value:function(){return Ii({},Li(Bi(e.prototype),"toCloneObject",this).call(this),{colors:M(this.json.colors),gradients:M(this.json.gradients),svgfilters:M(this.json.svgfilters),svgimages:M(this.json.svgimages),images:M(this.json.images)})}},{key:"removePropertyList",value:function(t,e){t.splice(e,1)}},{key:"removeColor",value:function(t){this.removePropertyList(this.json.colors,t)}},{key:"copyColor",value:function(t){this.copyPropertyList(this.json.colors,t)}},{key:"sortColor",value:function(t,e){this.sortItem(this.json.colors,t,e)}},{key:"setColorValue",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};this.json.colors[t]=Ii({},this.json.colors[t],e)}},{key:"getColor",value:function(t){return this.json.colors.filter(function(e){return e.name===t})[0]}},{key:"addColor",value:function(t){return this.json.colors.push(t),t}},{key:"createColor",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return this.addColor(t)}},{key:"removeImage",value:function(t){this.removePropertyList(this.json.images,t)}},{key:"copyImage",value:function(t){this.copyPropertyList(this.json.images,t)}},{key:"sortImage",value:function(t,e){this.sortItem(this.json.images,t,e)}},{key:"setImageValue",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};this.json.images[t]=Ii({},this.json.images[t],e)}},{key:"addImage",value:function(t){return this.json.images.push(t),t}},{key:"createImage",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return this.addImage(t)}},{key:"removeGradient",value:function(t){this.removePropertyList(this.json.gradients,t)}},{key:"copyGradient",value:function(t){this.copyPropertyList(this.json.gradients,t)}},{key:"sortGradient",value:function(t,e){this.sortItem(this.json.gradients,t,e)}},{key:"setGradientValue",value:function(t,e){this.json.gradients[t]=Ii({},this.json.gradients[t],e)}},{key:"getGradient",value:function(t){return this.json.gradients.filter(function(e){return e.name===t})[0]}},{key:"addGradient",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return this.json.gradients.push(t),t}},{key:"createGradient",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return this.addGradient(t)}},{key:"getSVGFilterIndex",value:function(t){var e=this.json.svgfilters.map(function(t,e){return{id:t.id,index:e}}).filter(function(e){return e.id===t})[0];return e?e.index:-1}},{key:"removeSVGFilter",value:function(t){this.removePropertyList(this.json.svgfilters,t)}},{key:"copySVGFilter",value:function(t){this.copyPropertyList(this.json.svgfilters,t)}},{key:"sortSVGFilter",value:function(t,e){this.sortItem(this.json.svgfilters,t,e)}},{key:"setSVGFilterValue",value:function(t,e){this.json.svgfilters[t]=Ii({},this.json.svgfilters[t],e)}},{key:"addSVGFilter",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return this.json.svgfilters.push(t),this.json.svgfilters.length-1}},{key:"createSVGFilter",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return this.addSVGFilter(t)}}])&&Di(n.prototype,r),o&&Di(n,o),e}();function Gi(t){return(Gi="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function Hi(t){for(var e=1;e0&&void 0!==arguments[0]&&arguments[0];return this.json.keyframes.map(function(e){return e.toString(t)}).join("\n\n")}},{key:"getDefaultObject",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return Wi(Ui(e.prototype),"getDefaultObject",this).call(this,Hi({itemType:"project",name:"new Project",keyframes:[],rootVariable:""},t))}},{key:"toCloneObject",value:function(){return Hi({},Wi(Ui(e.prototype),"toCloneObject",this).call(this),{name:this.json.name,keyframes:M(this.json.keyframes),rootVariable:this.json.rootVariable})}},{key:"isAbsolute",get:function(){return!1}},{key:"artboards",get:function(){return this.json.layers||[]}},{key:"html",get:function(){return this.artboards.map(function(t){return t.html}).join("\n\n")}}])&&Ni(n.prototype,r),o&&Ni(n,o),e}();function Ji(t,e){for(var n=0;n0&&void 0!==arguments[0]?arguments[0]:Qi;this.mode=t}},{key:"isMode",value:function(t){return this.mode===t}},{key:"isAddMode",value:function(){return this.isMode("ADD")}},{key:"isSelectionMode",value:function(){return this.isMode(Qi)}},{key:"changeAddType",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";this.changeMode("ADD"),this.addType=t}},{key:"changeTheme",value:function(t){t="light"===t?"light":"dark",this.theme=t,window.localStorage.setItem("easylogic.studio.theme",t)}},{key:"getFile",value:function(t){return this.images[t]||t}},{key:"setStore",value:function(t){this.$store=t}},{key:"send",value:function(){this.emit.apply(this,arguments)}},{key:"emit",value:function(){var t;this.$store&&(this.$store.source="EDITOR_ID",(t=this.$store).emit.apply(t,arguments))}},{key:"load",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];this.projects=t}},{key:"add",value:function(t){return this.projects.push(t),t}},{key:"remove",value:function(t){this.projects.splice(t,1)}},{key:"clear",value:function(){this.projects=[]}},{key:"get",value:function(t){return this.projects[t]}},{key:"zIndex",get:function(){return this.popupZIndex++}}])&&Ji(e.prototype,n),r&&Ji(e,r),t}());function ea(t){return(ea="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function na(t){return function(t){if(Array.isArray(t)){for(var e=0,n=new Array(t.length);e0&&void 0!==arguments[0]?arguments[0]:[];this.$store=new En({modules:[].concat(na(this.getModuleList()),na(t))}),ta.setStore(this.$store),this.$container=Re.create(this.getContainer()),this.$container.addClass(this.getClassName()),this.render(this.$container),this.initializeEvent(),this.initBodyMoves()}},{key:"initBodyMoves",value:function(){this.moves=new Set,this.ends=new Set,this.modifyBodyMoveSecond(10)}},{key:"modifyBodyMoveSecond",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:10;ta.config.set("body.move.ms",t),this.funcBodyMoves=k(this.loopBodyMoves.bind(this),ta.config.get("body.move.ms"))}},{key:"loopBodyMoves",value:function(){var t=ta.config.get("pos"),e=ta.config.get("lastPos")||ua;!(e.x===t.x&&e.y===t.y)&&this.moves.size&&(this.moves.forEach(function(e){var n=t.x-e.xy.x,r=t.y-e.xy.y;0==n&&0==r||e.func.call(e.context,n,r,"move")}),ta.config.set("lastPos",t)),requestAnimationFrame(this.funcBodyMoves)}},{key:"removeBodyMoves",value:function(){var t=ta.config.get("pos");this.ends.forEach(function(e){e.func.call(e.context,t.x-e.xy.x,t.y-e.xy.y,"end")}),this.moves.clear(),this.ends.clear()}},{key:cr("add/body/mousemove"),value:function(t,e,n){this.moves.add({func:t,context:e,xy:n})}},{key:cr("add/body/mouseup"),value:function(t,e,n){this.ends.add({func:t,context:e,xy:n})}},{key:"getModuleList",value:function(){return t.modules||[]}},{key:"getClassName",value:function(){return t.className||"csseditor"}},{key:"getContainer",value:function(){return t.container||document.body}},{key:"template",value:function(){return"
".concat(t.template,"
")}},{key:"components",value:function(){return t.components||{}}},{key:on("document"),value:function(t){var e=t.xy||ca;ta.config.set("bodyEvent",t),ta.config.set("pos",e),this.requestId||(this.requestId=requestAnimationFrame(this.funcBodyMoves))}},{key:an("document")+bn(30),value:function(t){ta.config.set("bodyEvent",t),this.removeBodyMoves(),this.requestId=null}}])&&ra(r.prototype,o),i&&ra(r,i),n}())(t)},la={App:v,Color:he,HueColor:de,ColorNames:Ft};function fa(t){for(var e=1;e0&&void 0!==arguments[0]?arguments[0]:[];this.state.currentColorSets.colors=t,this.$store.emit("changeCurrentColorSets")}},{key:"removeCurrentColor",value:function(t){this.state.currentColorSets.colors[t]&&(this.state.currentColorSets.colors.splice(t,1),this.$store.emit("changeCurrentColorSets"))}},{key:"removeCurrentColorToTheRight",value:function(t){this.state.currentColorSets.colors[t]&&(this.state.currentColorSets.colors.splice(t,Number.MAX_VALUE),this.$store.emit("changeCurrentColorSets"))}},{key:"clearPalette",value:function(){this.state.currentColorSets.colors&&(this.state.currentColorSets.colors=[],this.$store.emit("changeCurrentColorSets"))}},{key:"getUserList",value:function(){return Array.isArray(this.state.userList)&&this.state.userList.length?this.state.userList:this.state.colorSetsList}},{key:"getCurrentColors",value:function(){return this.getColors(this.state.currentColorSets)}},{key:"getColors",value:function(t){return t.scale?he.scale(t.scale,t.count):t.colors||[]}},{key:"getColorSetsList",value:function(){var t=this;return this.getUserList().map(function(e){return{name:e.name,edit:e.edit,colors:t.getColors(e)}})}},{key:"hsv",get:function(){return this.state.hsv}},{key:"rgb",get:function(){return this.state.rgb}},{key:"hsl",get:function(){return this.state.hsl}},{key:"hex",get:function(){return this.state.hex}},{key:"alpha",get:function(){return this.state.alpha}},{key:"format",get:function(){return this.state.format}}])&&ha(e.prototype,n),r&&ha(e,r),t}();function da(t){return(da="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function va(t,e){for(var n=0;n0&&void 0!==arguments[0]&&arguments[0];this.$body=null,this.$root=null,this.$store=new En,this.callbackChange=function(){t.callbackChangeValue()},this.colorpickerShowCallback=function(){},this.colorpickerHideCallback=function(){},this.$body=Re.create(this.getContainer()),this.$root=Re.create("div","codemirror-colorpicker"),"inline"==this.opt.position&&this.$body.append(this.$root),this.opt.type&&this.$root.addClass(this.opt.type),this.opt.hideInformation&&this.$root.addClass("hide-information"),this.opt.hideColorsets&&this.$root.addClass("hide-colorsets"),this.opt.width&&this.$root.css("width",this.opt.width),this.$arrow=Re.create("div","arrow"),this.$root.append(this.$arrow),this.manager.setUserPalette(this.opt.colorSets),this.render(this.$root),this.initColorWithoutChangeEvent(this.opt.color),this.initializeEvent()}},{key:"initColorWithoutChangeEvent",value:function(t){this.manager.initColor(t),this.emit("initColor")}},{key:"show",value:function(t,e,n,r){this.colorpickerShowCallback=n,this.colorpickerHideCallback=r,this.$root.css(this.getInitalizePosition()).show(),this.definePosition(t),this.isColorPickerShow=!0,this.isShortCut=t.isShortCut||!1,this.outputFormat=t.outputFormat,this.hideDelay=+T(t.hideDelay,2e3),this.hideDelay>0&&this.setHideDelay(this.hideDelay),this.$root.appendTo(this.$body),this.initColorWithoutChangeEvent(e)}},{key:"initColor",value:function(t,e){this.manager.changeColor(t,e),this.emit("changeColor")}},{key:"changeColor",value:function(t,e){this.manager.changeColor(t,e)}},{key:"hide",value:function(){this.isColorPickerShow&&(this.$root.hide(),this.$root.remove(),this.isColorPickerShow=!1,this.callbackHideValue())}},{key:"setColorsInPalette",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];this.manager.setCurrentColorAll(t)}},{key:"setUserPalette",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];this.manager.setUserPalette(t)}},{key:"getOption",value:function(t){return this.opt[t]}},{key:"setOption",value:function(t,e){this.opt[t]=e}},{key:"getContainer",value:function(){return this.opt.container||document.body}},{key:"getColor",value:function(t){return this.manager.toColor(t)}},{key:"definePositionForArrow",value:function(t,e,n){}},{key:"definePosition",value:function(t){var e=this.$root.width(),n=this.$root.height(),r=t.left-this.$body.scrollLeft();e+r>window.innerWidth&&(r-=e+r-window.innerWidth),r<0&&(r=0);var o=t.top-this.$body.scrollTop();n+o>window.innerHeight&&(o-=n+o-window.innerHeight),o<0&&(o=0),this.$root.css({left:Te.px(r),top:Te.px(o)})}},{key:"getInitalizePosition",value:function(){return"inline"==this.opt.position?{position:"relative",left:"auto",top:"auto",display:"inline-block"}:{position:"absolute"==this.opt.position?"absolute":"fixed",left:Te.px(-1e4),top:Te.px(-1e4)}}},{key:"setHideDelay",value:function(t){var e=this;t=t||0;var n=this.hide.bind(this);this.$root.off("mouseenter"),this.$root.off("mouseleave"),this.$root.on("mouseenter",function(){clearTimeout(e.timerCloseColorPicker)}),this.$root.on("mouseleave",function(){clearTimeout(e.timerCloseColorPicker),e.timerCloseColorPicker=setTimeout(n,t)}),clearTimeout(this.timerCloseColorPicker)}},{key:"callbackChangeValue",value:function(t){t=t||this.getCurrentColor(),A(this.opt.onChange)&&this.opt.onChange.call(this,t),A(this.colorpickerShowCallback)&&this.colorpickerShowCallback(t)}},{key:"callbackHideValue",value:function(t){t=t||this.getCurrentColor(),A(this.opt.onHide)&&this.opt.onHide.call(this,t),A(this.colorpickerHideCallback)&&this.colorpickerHideCallback(t)}},{key:"getCurrentColor",value:function(){return this.manager.toColor(this.outputFormat)}},{key:"checkColorPickerClass",value:function(t){var e=Re.create(t),n=e.closest("codemirror-colorview"),r=e.closest("codemirror-colorpicker"),o=e.closest("CodeMirror");t.nodeName;return!!(r||n||o)}},{key:"checkInHtml",value:function(t){return"HTML"==t.nodeName}},{key:"initializeStoreEvent",value:function(){ga(ma(e.prototype),"initializeStoreEvent",this).call(this),this.$store.on("changeColor",this.callbackChange,this),this.$store.on("changeFormat",this.callbackChange,this)}},{key:"destroy",value:function(){ga(ma(e.prototype),"destroy",this).call(this),this.$store.off("changeColor",this.callbackChange),this.$store.off("changeFormat",this.callbackChange),this.callbackChange=void 0,this.colorpickerShowCallback=void 0,this.colorpickerHideCallback=void 0}},{key:Xe("document"),value:function(t){this.checkInHtml(t.target)||0==this.checkColorPickerClass(t.target)&&this.hide()}},{key:"hsv",get:function(){return this.manager.hsv}},{key:"rgb",get:function(){return this.manager.rgb}},{key:"hsl",get:function(){return this.manager.hsl}},{key:"hex",get:function(){return this.manager.hex}},{key:"alpha",get:function(){return this.manager.alpha}},{key:"format",get:function(){return this.manager.format}}])&&va(n.prototype,r),o&&va(n,o),e}();function Oa(t){return(Oa="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function Sa(t,e){for(var n=0;nr?100:(t-n)/(r-n)*100}},{key:"getCalculatedDist",value:function(t){var e=t?this.getMousePosition(t):this.getCurrent(this.getDefaultValue()/this.state.maxValue);return this.getDist(e)}},{key:"getDefaultValue",value:function(){return 0}},{key:"setMousePosition",value:function(t){this.refs.$bar.css({left:Te.px(t)})}},{key:"getMousePosition",value:function(t){return xn.pos(t).pageX}},{key:"refresh",value:function(){this.setColorUI()}},{key:"setColorUI",value:function(t){(t=t||this.getDefaultValue())<=this.state.minValue?this.refs.$bar.addClass("first").removeClass("last"):t>=this.maxValue?this.refs.$bar.addClass("last").removeClass("first"):this.refs.$bar.removeClass("last").removeClass("first"),this.setMousePosition(this.getMaxDist()*((t||0)/this.state.maxValue))}}])&&Ea(n.prototype,r),o&&Ea(n,o),e}();function Ia(t){return(Ia="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function Aa(t,e){for(var n=0;n\n
\n
\n
\n \n '}},{key:Pn("$container"),value:function(){return{style:{"background-color":this.parent.manager.toString("rgb")}}}},{key:"getDefaultValue",value:function(){return this.parent.hsv.v}},{key:"refreshColorUI",value:function(t){var e=this.getCalculatedDist(t);this.setColorUI(e/100*this.state.maxValue),this.changeColor({type:"hsv",v:e/100*this.state.maxValue})}}])&&Aa(n.prototype,r),o&&Aa(n,o),e}();function za(t){return(za="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function Fa(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function Ga(t,e){for(var n=0;n\n
\n
\n
\n
\n \n '}},{key:"refresh",value:function(){Xa(Ya(e.prototype),"refresh",this).call(this),this.setOpacityColorBar()}},{key:"setOpacityColorBar",value:function(){var t=function(t){for(var e=1;e\n \n
\n
\n \n '}},{key:"refresh",value:function(t){this.setColorUI(t)}},{key:"setColorUI",value:function(t){this.renderCanvas(),this.renderValue(),this.setHueColor(null,t)}},{key:"renderValue",value:function(){var t=1-this.parent.hsv.v;this.refs.$valuewheel.css("background-color","rgba(0, 0, 0, ".concat(t,")"))}},{key:"renderWheel",value:function(t,e){this.width&&!t&&(t=this.width),this.height&&!e&&(e=this.height);var n=Re.create("canvas"),r=n.el.getContext("2d");n.el.width=t,n.el.height=e,n.px("width",t),n.px("height",e);for(var o=r.getImageData(0,0,t,e),i=o.data,a=Math.floor(t/2),c=Math.floor(e/2),u=t>e?c:a,s=a,l=c,f=0;f0&&(r.globalCompositeOperation="destination-out",r.fillStyle="black",r.beginPath(),r.arc(s,l,u-this.thinkness,0,2*Math.PI),r.closePath(),r.fill()),n}},{key:"renderCanvas",value:function(){if(!this.parent.createdWheelCanvas){var t=this.refs.$colorwheel,e=t.el.getContext("2d"),n=ec(t.size(),2),r=n[0],o=n[1];this.width&&!r&&(r=this.width),this.height&&!o&&(o=this.height),t.el.width=r,t.el.height=o,t.px("width",r),t.px("height",o);var i=this.renderWheel(r,o);e.drawImage(i.el,0,0),this.parent.createdWheelCanvas=!0}}},{key:"getDefaultValue",value:function(){return this.parent.hsv.h}},{key:"getDefaultSaturation",value:function(){return this.parent.hsv.s}},{key:"getCurrentXY",value:function(t,e,n,r,o){return t?t.xy:it(e,n,r,o)}},{key:"getRectangle",value:function(){var t=this.$el.width(),e=this.$el.height(),n=this.refs.$colorwheel.width()/2,r=this.$el.offsetLeft(),o=r+t/2,i=this.$el.offsetTop();return{minX:r,minY:i,width:t,height:e,radius:n,centerX:o,centerY:i+e/2}}},{key:"setHueColor",value:function(t,e){var n=this.getRectangle(),r=n.minX,o=n.minY,i=n.radius,a=n.centerX,c=n.centerY,u=this.getCurrentXY(t,this.getDefaultValue(),this.getDefaultSaturation()*i,a,c),s=(y=u.x)-a,l=(d=u.y)-c,f=s*s+l*l,p=ct(s,l);if(f>i*i)var h=this.getCurrentXY(null,p,i,a,c),y=h.x,d=h.y;var v=Math.min(Math.sqrt(f)/i,1);this.refs.$drag_pointer.px("left",y-r),this.refs.$drag_pointer.px("top",d-o),e||this.changeColor({type:"hsv",h:p,s:v})}},{key:"changeColor",value:function(t){this.parent.manager.changeColor(t||{})}},{key:cr("changeColor"),value:function(){this.refresh(!0)}},{key:cr("initColor"),value:function(){this.refresh(!0)}},{key:an("document"),value:function(t){this.isDown=!1}},{key:on("document"),value:function(t){this.isDown&&this.setHueColor(t)}},{key:rn("$drag_pointer"),value:function(t){t.preventDefault(),this.isDown=!0}},{key:rn(),value:function(t){this.isDown=!0,this.setHueColor(t)}}])&&nc(n.prototype,r),o&&nc(n,o),e}();function uc(t){return(uc="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function sc(t,e){for(var n=0;n\n
\n \n
\n
\n
\n \n
HEX
\n
\n
\n
\n
\n \n
R
\n
\n
\n \n
G
\n
\n
\n \n
B
\n
\n
\n \n
A
\n
\n
\n
\n
\n \n
H
\n
\n
\n \n
%
\n
S
\n
\n
\n \n
%
\n
L
\n
\n
\n \n
A
\n
\n
\n \n '}},{key:"setCurrentFormat",value:function(t){this.format=t,this.initFormat()}},{key:"initFormat",value:function(){var t=this.format||"hex";this.$el.removeClass("hex"),this.$el.removeClass("rgb"),this.$el.removeClass("hsl"),this.$el.addClass(t)}},{key:"nextFormat",value:function(){var t=this.format||"hex",e="hex";"hex"==t?e="rgb":"rgb"==t?e="hsl":"hsl"==t&&(e=1==this.parent.alpha?"hex":"rgb"),this.$el.removeClass(t),this.$el.addClass(e),this.format=e,this.parent.manager.changeFormat(this.format)}},{key:"getFormat",value:function(){return this.format||"hex"}},{key:"checkNumberKey",value:function(t){return xn.checkNumberKey(t)}},{key:"checkNotNumberKey",value:function(t){return!xn.checkNumberKey(t)}},{key:"changeRgbColor",value:function(){this.parent.changeColor({type:"rgb",r:this.refs.$rgb_r.int(),g:this.refs.$rgb_g.int(),b:this.refs.$rgb_b.int(),a:this.refs.$rgb_a.float()})}},{key:"changeHslColor",value:function(){this.parent.changeColor({type:"hsl",h:this.refs.$hsl_h.int(),s:this.refs.$hsl_s.int(),l:this.refs.$hsl_l.int(),a:this.refs.$hsl_a.float()})}},{key:cr("changeColor","initColor"),value:function(){this.refresh()}},{key:Je("$rgb_r"),value:function(t){this.changeRgbColor()}},{key:Je("$rgb_g"),value:function(t){this.changeRgbColor()}},{key:Je("$rgb_b"),value:function(t){this.changeRgbColor()}},{key:Je("$rgb_a"),value:function(t){this.changeRgbColor()}},{key:Je("$hsl_h"),value:function(t){this.changeHslColor()}},{key:Je("$hsl_s"),value:function(t){this.changeHslColor()}},{key:Je("$hsl_l"),value:function(t){this.changeHslColor()}},{key:Je("$hsl_a"),value:function(t){this.changeHslColor()}},{key:Ye("$hexCode"),value:function(t){if(t.which<65||t.which>70)return this.checkNumberKey(t)}},{key:Ne("$hexCode"),value:function(t){var e=this.refs.$hexCode.val();"#"==e.charAt(0)&&7==e.length&&this.parent.initColor(e)}},{key:Ge("$formatChangeButton"),value:function(t){this.nextFormat()}},{key:"setRGBInput",value:function(){this.refs.$rgb_r.val(this.parent.rgb.r),this.refs.$rgb_g.val(this.parent.rgb.g),this.refs.$rgb_b.val(this.parent.rgb.b),this.refs.$rgb_a.val(this.parent.alpha)}},{key:"setHSLInput",value:function(){this.refs.$hsl_h.val(this.parent.hsl.h),this.refs.$hsl_s.val(this.parent.hsl.s),this.refs.$hsl_l.val(this.parent.hsl.l),this.refs.$hsl_a.val(this.parent.alpha)}},{key:"setHexInput",value:function(){this.refs.$hexCode.val(this.parent.manager.toString("hex"))}},{key:"refresh",value:function(){this.setCurrentFormat(this.parent.format),this.setRGBInput(),this.setHSLInput(),this.setHexInput()}}])&&sc(n.prototype,r),o&&sc(n,o),e}();function yc(t){return(yc="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function dc(t,e){for(var n=0;n\n
\n
\n

Color Palettes

\n ×\n
\n
\n
\n '}},{key:cr("changeCurrentColorSets"),value:function(){this.refresh()}},{key:cr("toggleColorChooser"),value:function(){this.toggle()}},{key:Sn("$colorsetsList"),value:function(){var t=this.parent.manager.getColorSetsList();return"\n
\n ".concat(t.map(function(t,e){return'\n
\n

').concat(t.name,'

\n
\n
\n ').concat(t.colors.filter(function(t,e){return e<5}).map(function(t){return'
\n
\n
')}).join(""),"\n
\n
\n
")}).join(""),"\n
\n ")}},{key:"show",value:function(){this.$el.addClass("open")}},{key:"hide",value:function(){this.$el.removeClass("open")}},{key:"toggle",value:function(){this.$el.toggleClass("open")}},{key:Ge("$toggleButton"),value:function(t){this.toggle()}},{key:Ge("$colorsetsList .colorsets-item"),value:function(t,e){if(e){var n=parseInt(e.attr("data-colorsets-index"));this.parent.manager.setCurrentColorSets(n),this.hide()}}},{key:"destroy",value:function(){bc(gc(e.prototype),"destroy",this).call(this),this.hide()}}])&&dc(n.prototype,r),o&&dc(n,o),e}();function kc(t){return(kc="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function Oc(t,e){for(var n=0;n\n \n
\n \n '}},{key:Sn("$colorSetsColorList"),value:function(){var t=this.parent.manager.getCurrentColorSets(),e=this.parent.manager.getCurrentColors();return'
\n '.concat(e.map(function(t,e){return'
\n
\n
\n
')}).join("")," \n ").concat(t.edit?'
+
':""," \n
")}},{key:"addColor",value:function(t){this.parent.manager.addCurrentColor(t),this.refresh()}},{key:cr("changeCurrentColorSets"),value:function(){this.refresh()}},{key:cr("initColor"),value:function(){this.refresh()}},{key:Ge("$colorSetsChooseButton"),value:function(t){this.emit("toggleColorChooser")}},{key:Ze("$colorSetsColorList"),value:function(t){if(t.preventDefault(),this.parent.manager.getCurrentColorSets().edit){var e=Re.create(t.target).closest("color-item");if(e){var n=parseInt(e.attr("data-index"));this.emit("showContextMenu",t,n)}else this.emit("showContextMenu",t)}}},{key:Ge("$colorSetsColorList .add-color-item"),value:function(t){this.addColor(this.parent.getColor())}},{key:Ge("$colorSetsColorList .color-item"),value:function(t,e){this.parent.initColor(e.attr("data-color"))}}])&&Oc(n.prototype,r),o&&Oc(n,o),e}();function Tc(t){return(Tc="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function _c(t,e){for(var n=0;n\n \n \n \n \n '}},{key:"show",value:function(t,e){var n=xn.pos(t);this.$el.px("top",n.clientY-10),this.$el.px("left",n.clientX),this.$el.addClass("show"),this.selectedColorIndex=e,_(this.selectedColorIndex)?this.$el.addClass("small"):this.$el.removeClass("small")}},{key:"hide",value:function(){this.$el.removeClass("show")}},{key:"runCommand",value:function(t){switch(t){case"remove-color":this.parent.manager.removeCurrentColor(this.selectedColorIndex);break;case"remove-all-to-the-right":this.parent.manager.removeCurrentColorToTheRight(this.selectedColorIndex);break;case"clear-palette":this.parent.manager.clearPalette()}}},{key:cr("showContextMenu"),value:function(t,e){this.show(t,e)}},{key:Ge("$el .menu-item"),value:function(t,e){t.preventDefault(),this.runCommand(e.attr("data-type")),this.hide()}}])&&_c(n.prototype,r),o&&_c(n,o),e}();function Vc(t){return(Vc="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function Ic(t,e){for(var n=0;n\n \n
\n \n \n
\n \n
\n \n \n \n \n \n '}},{key:"components",value:function(){return{Value:Ba,Opacity:Ka,ColorView:Qa,ColorWheel:cc,Information:hc,CurrentColorSets:xc,ColorSetsChooser:wc,ContextMenu:Rc}}}])&&Ic(n.prototype,r),o&&Ic(n,o),e}();function Bc(t){return(Bc="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function zc(t,e){for(var n=0;n\n
\n
\n
\n \n '}},{key:"getDefaultValue",value:function(){return this.parent.hsv.h}},{key:"refreshColorUI",value:function(t){var e=this.getCalculatedDist(t);this.setColorUI(e/100*this.state.maxValue),this.changeColor({h:e/100*this.state.maxValue,type:"hsv"})}}])&&zc(n.prototype,r),o&&zc(n,o),e}();function Yc(t){return(Yc="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function Nc(t,e){for(var n=0;n\n
\n
\n
\n
\n
\n \n '}},{key:"setBackgroundColor",value:function(t){this.$el.css("background-color",t)}},{key:"refresh",value:function(){this.setColorUI()}},{key:"calculateSV",value:function(){var t=this.drag_pointer_pos||{x:0,y:0},e=this.$el.width(),n=this.$el.height(),r=t.x/e,o=(n-t.y)/n;this.parent.initColor({type:"hsv",s:r,v:o})}},{key:"setColorUI",value:function(){var t=this.$el.width()*this.parent.hsv.s,e=this.$el.height()*(1-this.parent.hsv.v);this.refs.$drag_pointer.px("left",t),this.refs.$drag_pointer.px("top",e),this.drag_pointer_pos={x:t,y:e},this.setBackgroundColor(this.parent.manager.getHueColor())}},{key:"setMainColor",value:function(t){var e=this.$el.offset(),n=this.$el.contentWidth(),r=this.$el.contentHeight(),o=xn.pos(t).pageX-e.left,i=xn.pos(t).pageY-e.top;o<0?o=0:o>n&&(o=n),i<0?i=0:i>r&&(i=r),this.refs.$drag_pointer.px("left",o),this.refs.$drag_pointer.px("top",i),this.drag_pointer_pos={x:o,y:i},this.calculateSV()}},{key:cr("changeColor","initColor"),value:function(){this.refresh()}},{key:an("document"),value:function(t){this.isDown=!1}},{key:on("document"),value:function(t){this.isDown&&this.setMainColor(t)}},{key:rn(),value:function(t){this.isDown=!0,this.setMainColor(t)}},{key:an(),value:function(t){this.isDown=!1}}])&&Nc(n.prototype,r),o&&Nc(n,o),e}();function qc(t){return(qc="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function Jc(t,e){for(var n=0;n\n \n
\n \n \n
\n \n
\n \n \n \n \n '}},{key:"components",value:function(){return{Hue:Xc,Opacity:Ka,ColorView:Qa,Palette:Zc,Information:hc,CurrentColorSets:xc,ColorSetsChooser:wc,ContextMenu:Rc}}}])&&Jc(n.prototype,r),o&&Jc(n,o),e}();function ru(t){return(ru="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function ou(t,e){for(var n=0;n\n \n
\n \n \n
\n \n "}},{key:"components",value:function(){return{Hue:Xc,Opacity:Ka,Palette:Zc}}}])&&ou(n.prototype,r),o&&ou(n,o),e}();function su(t){return(su="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function lu(t,e){for(var n=0;n=this.maxValue?this.refs.$bar.addClass("last").removeClass("first"):this.refs.$bar.removeClass("last").removeClass("first");var e=1-(t||0)/this.state.maxValue;this.setMousePosition(this.getMaxDist()*e)}}])&&lu(n.prototype,r),o&&lu(n,o),e}();function du(t){return(du="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function vu(t,e){for(var n=0;n\n
\n
\n
\n \n '}},{key:"getDefaultValue",value:function(){return this.parent.hsv.h}},{key:"refreshColorUI",value:function(t){var e=this.getCalculatedDist(t);this.setColorUI(e/100*this.maxValue),this.changeColor({h:e/100*this.maxValue,type:"hsv"})}}])&&vu(n.prototype,r),o&&vu(n,o),e}();function Ou(t){return(Ou="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function Su(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function ju(t,e){for(var n=0;n\n
\n
\n
\n
\n \n '}},{key:"refresh",value:function(){xu(Tu(e.prototype),"refresh",this).call(this),this.setOpacityColorBar()}},{key:"setOpacityColorBar",value:function(){var t=function(t){for(var e=1;e\n
\n \n "}},{key:"components",value:function(){return{Hue:ku,Opacity:Eu,Palette:Zc}}}])&&$u(n.prototype,r),o&&$u(n,o),e}();function Du(t){return(Du="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function Mu(t,e){for(var n=0;n\n \n
\n '}},{key:"setColorUI",value:function(t){this.renderCanvas(),this.setHueColor(null,t)}},{key:"getDefaultValue",value:function(){return this.parent.hsv.h}},{key:"setHueColor",value:function(t,e){var n=this.getRectangle(),r=n.minX,o=n.minY,i=n.radius,a=n.centerX,c=n.centerY,u=this.getCurrentXY(t,this.getDefaultValue(),i,a,c),s=ct((f=u.x)-a,(p=u.y)-c),l=this.getCurrentXY(null,s,i-this.half_thinkness,a,c),f=l.x,p=l.y;this.refs.$drag_pointer.px("left",f-r),this.refs.$drag_pointer.px("top",p-o),e||this.changeColor({type:"hsv",h:s})}}])&&Mu(n.prototype,r),o&&Mu(n,o),e}();function Hu(t){return(Hu="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function Xu(t,e){for(var n=0;n\n \n \n
\n \n \n
\n \n
\n \n \n \n \n \n '}},{key:"components",value:function(){return{Value:Ba,Opacity:Ka,ColorView:Qa,ColorRing:Gu,Palette:Zc,Information:hc,CurrentColorSets:xc,ColorSetsChooser:wc,ContextMenu:Rc}}}])&&Xu(n.prototype,r),o&&Xu(n,o),e}();function Uu(t){return(Uu="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function Zu(t,e){for(var n=0;n\n \n
\n \n \n
\n \n \n \n \n \n "}},{key:"components",value:function(){return{Hue:ku,Opacity:Eu,Palette:Zc,Information:hc,CurrentColorSets:xc,ColorSetsChooser:wc,ContextMenu:Rc}}}])&&Zu(n.prototype,r),o&&Zu(n,o),e}();function es(t){return(es="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function ns(t,e){for(var n=0;n\n
\n
\n
".concat(this.opt.tabTitle,' Color
\n
Swatch
\n
Color Set
\n
\n
\n
\n \n \n
\n \n \n
\n \n
\n \n
\n
\n \n \n
\n
\n \n
\n
\n
\n ')}},{key:Ge("$tabHeader .color-tab-item"),value:function(t,e){if(!e.hasClass("active")){var n;(n=this.refs.$tabHeader.$(".active"))&&n.removeClass("active"),e.addClass("active"),(n=this.refs.$tabBody.$(".active"))&&n.removeClass("active");var r=this.refs.$tabBody.$("[item-id='".concat(e.attr("item-id"),"']"));r&&r.addClass("active")}}},{key:"components",value:function(){return{Value:Ba,Opacity:Ka,ColorView:Qa,ColorRing:Gu,Palette:Zc,Information:hc,CurrentColorSets:xc,ColorSetsChooser:wc,ContextMenu:Rc}}}])&&ns(n.prototype,r),o&&ns(n,o),e}();function cs(t){return(cs="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function us(t,e){for(var n=0;n\n
\n
\n
".concat(this.opt.tabTitle,' Color
\n
Swatch
\n
Color Set
\n
\n
\n
\n \n
\n \n \n
\n \n
\n
\n \n \n
\n
\n \n
\n
\n\n
\n ')}},{key:Ge("$tabHeader .color-tab-item"),value:function(t,e){if(!e.hasClass("active")){var n;(n=this.refs.$tabHeader.$(".active"))&&n.removeClass("active"),e.addClass("active"),(n=this.refs.$tabBody.$(".active"))&&n.removeClass("active");var r=this.refs.$tabBody.$("[item-id='".concat(e.attr("item-id"),"']"));r&&r.addClass("active")}}},{key:"components",value:function(){return{Hue:ku,Opacity:Eu,Palette:Zc,Information:hc,CurrentColorSets:xc,ColorSetsChooser:wc,ContextMenu:Rc}}}])&&us(n.prototype,r),o&&us(n,o),e}(),hs={create:function(t){switch(t.type){case"macos":return new Lc(t);case"xd":return new ts(t);case"xd-tab":return new ps(t);case"ring":return new Wu(t);case"ring-tab":return new as(t);case"mini":return new uu(t);case"mini-vertical":return new Au(t);case"sketch":case"palette":default:return new nu(t)}},ColorPicker:nu,ChromeDevToolColorPicker:nu,MacOSColorPicker:Lc,RingColorPicker:Wu,MiniColorPicker:uu,MiniVerticalColorPicker:Au,XDColorPicker:ts};function ys(t){return(ys="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function ds(t,e){for(var n=0;n0&&void 0!==arguments[0]&&arguments[0];return bs(gs(e.prototype),"getDefaultObject",this).call(this,{itemType:"display",type:"block",direction:"row",alignItems:"normal",alignCentent:"normal",flexWrap:"nowrap",justifyContent:"flex-start",gap:Te.px(0),rowGap:Te.percent(1),columnGap:Te.percent(1),columns:[Te.fr(1)],rows:[Te.fr(1)],areas:[]})}},{key:"toCSS",value:function(){var t=this.json,e={display:t.type};return"flex"==e.display?("row"!=t.direction&&(e["flex-direction"]=t.direction),"normal"!=t.alignItems&&(e["align-items"]=t.alignItems),"normal"!=t.alignContent&&(e["align-content"]=t.alignContent),"nowrap"!=t.flexWrap&&(e["flex-wrap"]=t.flexWrap),"flex-start"!=t.justifyContent&&(e["justify-content"]=t.justifyContent)):"grid"==e.display&&(t.gap.value>0&&(e["grid-gap"]=t.gap),t.rowGap.value>0&&(e["grid-row-gap"]=t.rowGap),t.columnGap.value>0&&(e["grid-column-gap"]=t.columnGap),t.columns.length&&(e["grid-template-columns"]=t.columns.join(" ")),t.rows.length&&(e["grid-template-rows"]=t.rows.join(" ")),t.areas.length&&(e["grid-template-areas"]=t.areas.map(function(t){return'"'.concat(t.join(" "),'"')}).join(" ")),"normal"!=t.alignItems&&(e["align-items"]=t.alignItems),"normal"!=t.alignContent&&(e["align-content"]=t.alignContent),"flex-start"!=t.justifyContent&&(e["justify-content"]=t.justifyContent)),e}},{key:"isLayout",value:function(){return this.isGrid()||this.isFlex()}},{key:"isFlex",value:function(){return"flex"==this.json.type}},{key:"isGrid",value:function(){return"grid"==this.json.type}},{key:"isInline",value:function(){return"inline"==this.json.type}},{key:"isInlineBlock",value:function(){return"inline-block"==this.json.type}},{key:"isBlock",value:function(){return"block"==this.json.type}},{key:"changeColumn",value:function(t,e){var n=this.json.columns[t],r=this.json.columns[e];this.json.columns[e]=n,this.json.columns[t]=r}},{key:"removeColumn",value:function(t){this.json.columns.splice(t,1)}},{key:"updateColumn",value:function(t,e){this.json.columns[t]=e}},{key:"changeRow",value:function(t,e){var n=this.json.rows[t],r=this.json.rows[e];this.json.rows[e]=n,this.json.rows[t]=r}},{key:"removeRow",value:function(t){this.json.rows.splice(t,1)}},{key:"updateRow",value:function(t,e){this.json.rows[t]=e}}])&&ds(n.prototype,r),o&&ds(n,o),e}();function ks(t){return(ks="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function Os(t,e){for(var n=0;n0&&void 0!==arguments[0]?arguments[0]:{};return Rs(Vs(e.prototype),"getDefaultObject",this).call(this,function(t){for(var e=1;e0&&void 0!==arguments[0]?arguments[0]:{};return Zs(qs(e.prototype),"getDefaultObject",this).call(this,Ns({type:"gradient",colorsteps:[]},t))}},{key:"toCloneObject",value:function(){return Ns({},Zs(qs(e.prototype),"toCloneObject",this).call(this),{colorsteps:this.json.colorsteps.map(function(t){return t.clone()})})}},{key:"convert",value:function(t){return t.colorsteps=t.colorsteps.map(function(t){return new Xs(t)}),t}},{key:"calculateAngle",value:function(){var t=this.json.angle;return _(Qs[t])?t:Qs[t]||0}},{key:"addColorStep",value:function(t){var e=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];return this.json.colorsteps.push(t),e&&this.sortColorStep(),t}},{key:"insertColorStep",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"rgba(216,216,216,0)",n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"rgba(216,216,216,1)",r=this.colorsteps;if(r.length){if(te.percent?1:t.percente.index?1:-1:void 0}),t.forEach(function(t,e){t.index=100*e})}},{key:"addColorStepList",value:function(){var t=this;(arguments.length>0&&void 0!==arguments[0]?arguments[0]:[]).forEach(function(e){t.addColorStep(e,!1)}),this.sortColorStep()}},{key:"getColorStep",value:function(t){return this.json.colorsteps.filter(function(e){return e.id==t})[0]}},{key:"clear",value:function(){arguments.length?this.json.colorsteps.splice(+(arguments.length<=0?void 0:arguments[0]),1):this.json.colorsteps=[]}},{key:"getColorString",value:function(){var t=this.colorsteps;return t.length?t.map(function(e,n){return e.prevColorStep=e.cut&&n>0?t[n-1]:null,e}).map(function(t){return"".concat(t)}).join(","):""}},{key:"colorsteps",get:function(){return this.json.colorsteps}}])&&Ws(n.prototype,r),o&&Ws(n,o),e}();function el(t){return(el="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function nl(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function rl(t,e){for(var n=0;n0&&void 0!==arguments[0]?arguments[0]:"transparent";return new e({colorsteps:[new Xs({color:t,percent:0,index:0})]})}}],(r=[{key:"getDefaultObject",value:function(){return il(al(e.prototype),"getDefaultObject",this).call(this,{type:"static-gradient",static:!0,colorsteps:[new Xs({color:"red",percent:0,index:0}),new Xs({color:"red",percent:100,index:0})]})}},{key:"toCloneObject",value:function(){return function(t){for(var e=1;e0&&void 0!==arguments[0]?arguments[0]:{};return vl(bl(e.prototype),"getDefaultObject",this).call(this,ll({type:"url",url:"",datauri:""},t))}},{key:"toCloneObject",value:function(){return ll({},vl(bl(e.prototype),"toCloneObject",this).call(this),{url:this.json.url,datauri:this.json.datauri})}},{key:"isUrl",value:function(){return!0}},{key:"toString",value:function(){var t=arguments.length>0&&void 0!==arguments[0]&&arguments[0],e=this.json;return"url(".concat(t?ta.getFile(e.url):e.url,")")}}],[{key:"parse",value:function(t){return new e({url:t.split("(")[1].split(")")[0]})}},{key:"isImageFile",value:function(t){return wl.includes(t)}}]),e}();function Ol(t){return(Ol="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function Sl(t){return function(t){if(Array.isArray(t)){for(var e=0,n=new Array(t.length);e360?e%360:e,"deg")),"".concat(this.json.type,"(").concat(e,", ").concat(t,")")}}])&&xl(n.prototype,r),o&&xl(n,o),e}();function Il(t){return(Il="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function Al(t,e){for(var n=0;n0&&void 0!==arguments[0]?arguments[0]:{};return Wl(Ul(e.prototype),"getDefaultObject",this).call(this,Yl({type:"radial-gradient",radialType:"ellipse",radialPosition:[Pe.CENTER,Pe.CENTER]},t))}},{key:"toCloneObject",value:function(){return Yl({},Wl(Ul(e.prototype),"toCloneObject",this).call(this),{radialType:this.json.radialType,radialPosition:M(this.json.radialPosition)})}},{key:"isRadial",value:function(){return!0}},{key:"toString",value:function(){if(0===this.colorsteps.length)return"";var t,e=this.getColorString(),n=this.json,r=n.radialType,o=n.radialPosition||["center","center"];return t=(o=Jl[o]?o:o.join(" "))?"".concat(r," at ").concat(o):r,"".concat(n.type||"radial-gradient","(").concat(t,", ").concat(e,")")}}])&&Nl(n.prototype,r),o&&Nl(n,o),e}();function tf(t){return(tf="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function ef(t,e){for(var n=0;n0&&void 0!==arguments[0]?arguments[0]:{};return df(vf(e.prototype),"getDefaultObject",this).call(this,pf({type:"conic-gradient",angle:0,radialPosition:[Pe.CENTER,Pe.CENTER]},t))}},{key:"toCloneObject",value:function(){return pf({},df(vf(e.prototype),"toCloneObject",this).call(this),{angle:this.json.angle,radialPosition:M(this.json.radialPosition)})}},{key:"isConic",value:function(){return!0}},{key:"hasAngle",value:function(){return!0}},{key:"getColorString",value:function(){if(0===this.colorsteps.length)return"";var t=this.colorsteps;return t?(t.sort(function(t,e){return t.percent==e.percent?0:t.percent>e.percent?1:-1}),t.map(function(e,n){return e.prevColorStep=e.cut&&n>0?t[n-1]:null,e}).map(function(t){var e=Math.floor(3.6*t.percent),n="";if(t.cut&&t.prevColorStep){var r=Math.floor(3.6*t.prevColorStep.percent);n="".concat(r,"deg")}return"".concat(t.color," ").concat(n," ").concat(e,"deg")}).join(",")):""}},{key:"toString",value:function(){var t=this.getColorString(),e=[],n=this.json,r=n.angle,o=n.radialPosition||Pe.CENTER;o=mf[o]?o:o.join(" "),E(r)&&(r=+(wf[r]||r),e.push("from ".concat(r,"deg"))),o&&e.push("at ".concat(o));var i=e.length?e.join(" ")+",":"";return"".concat(n.type,"(").concat(i," ").concat(t,")")}}])&&hf(n.prototype,r),o&&hf(n,o),e}();function Of(t){return(Of="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function Sf(t,e){for(var n=0;n0&&void 0!==arguments[0]&&arguments[0];if(!this.json.image)return{};var e=this.json.image.toString(t);return{"border-image-source":"".concat(e)}}},{key:"toBorderImageRepeatCSS",value:function(){return this.json.repeat?{"border-image-repeat":"".concat(this.json.repeat)}:{}}},{key:"toBorderImageWidthCSS",value:function(){var t=this;if(!this.json.width)return{};if(0===Object.keys(this.json.width).filter(function(e){return t.json.width[e].value>0}).length)return{};var e=Object.keys(this.json.width).map(function(e){return t.json.width[e].toString()}).join(" ");return{"border-image-width":"".concat(e)}}},{key:"toBorderImageSliceCSS",value:function(){var t=this;if(!this.json.slice)return{};var e=Object.keys(this.json.slice).map(function(e){var n=t.json.slice[e];return n.isPercent()?n.toString():n.value}).join(" ");return{"border-image-slice":"".concat(e)}}},{key:"toCSS",value:function(){var t=arguments.length>0&&void 0!==arguments[0]&&arguments[0];return Cf({},this.toBorderImageCSS(t),this.toBorderImageRepeatCSS(),this.toBorderImageSliceCSS(),this.toBorderImageWidthCSS())}},{key:"toString",value:function(){return j(this.toCSS(),function(t,e){return"".concat(t,": ").concat(e)}).join(";")}},{key:"image",get:function(){return this.json.image},set:function(t){this.json.image=t}}])&&Rf(n.prototype,r),o&&Rf(n,o),e}();function Lf(t){return(Lf="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function Bf(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function zf(t,e){for(var n=0;n0&&void 0!==arguments[0]?arguments[0]:{};return this.addProperty(np({checked:!0,value:Te.px(0)},t))}},{key:"addProperty",value:function(t){this.json.properties.push(t)}},{key:"removeProperty",value:function(t){this.json.properties.splice(t,1)}},{key:"sortItem",value:function(t,e,n){t.splice.apply(t,[n+(e1&&void 0!==arguments[1]?arguments[1]:{};Object.assign(this.json.properties[+t],np({},e))}},{key:"updatePropertyByKey",value:function(t){for(var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=-1,r=0,o=this.json.properties.length;re.offset.value?1:-1}),e.map(function(e){return 0===e.properties.length?"":t.toOffsetString(e)}).join("\n")}},{key:"toCSSText",value:function(){return this.json.offsets.map(function(t){return t}).sort(function(t,e){return t.offset.value>e.offset.value?1:-1}),"\n@keyframes ".concat(this.json.name," {\n\n ").concat(this.toOffsetText(),"\n\n}\n")}},{key:"createOffset",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return this.addOffset(new sp(yp({checked:!0},t)))}},{key:"addOffset",value:function(t){this.json.offsets.push(t)}},{key:"removeOffset",value:function(t){this.json.offsets.splice(t,1)}},{key:"sortItem",value:function(t,e,n){t.splice.apply(t,[n+(e1&&void 0!==arguments[1]?arguments[1]:{};this.json.offsets[+t].reset(e)}},{key:"toCSS",value:function(){return{}}},{key:"toString",value:function(){return this.toCSSText()}}])&&vp(n.prototype,r),o&&vp(n,o),e}();function Op(t){return(Op="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function Sp(t){for(var e=1;e0&&void 0!==arguments[0]?arguments[0]:"";return"".concat(t).concat(this.json.selector," {\n ").concat(this.toPropertyString(),"\n}")}},{key:"toCSS",value:function(){return{}}},{key:"toString",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";return this.toCSSText(t)}}])&&Pp(n.prototype,r),o&&Pp(n,o),e}(),$p={doc:'',storage:'',archive:'',file_copy:'',gps_fixed:'',refresh:'',cat:'\n\n\n\n\n',shuffle:'',replay:'',speed:'',alternate_reverse:'',alternate:'',note:'',rect:'',circle:'',color_lens:'',cube:'',polygon:'',star:'',dahaze:'',brush:'',expand:'',list:'',grid:'',align_center:'',align_justify:'',align_left:'',align_right:'',color:'',size:'',edit:'',outline_image:'',ballot:'',shape:'',scatter:'',transform:'',gradient:'',close:'',build:'',code:'',autorenew:'',play:'',pause:'',skip_next:'',skip_prev:'',fast_forward:'',fast_rewind:'',filter:'',input:'',timer:'',title:'',paint:'',border_all:'',border_inner:'',check:'',arrowRight:'',screen:'',repeat:'',remove2:'',setting:'',image:'\n',artboard:'',folder:'',publish:'',add_note:'',add:'',save:'\n',export:'',redo:'',undo:'',lock:'',lock_open:'',remove:'',copy:'\n',visible:'\n',add_box:'',add_circle:'',create_folder:'\n \n',chevron_right:'\n \n',chevron_left:''};function Rp(t){return(Rp="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function Vp(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var n=[],r=!0,o=!1,i=void 0;try{for(var a,c=t[Symbol.iterator]();!(r=(a=c.next()).done)&&(n.push(a.value),!e||n.length!==e);r=!0);}catch(t){o=!0,i=t}finally{try{r||null==c.return||c.return()}finally{if(o)throw i}}return n}(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance")}()}function Ip(t){return function(t){if(Array.isArray(t)){for(var e=0,n=new Array(t.length);e0&&void 0!==arguments[0]?arguments[0]:{};return Bp(zp(e.prototype),"getDefaultObject",this).call(this,Ap({position:"absolute",x:Te.px(0),y:Te.px(0),right:"",bottom:"",width:Te.px(300),height:Te.px(300),rootVariable:"",variable:"",transform:"",filter:"","backdrop-filter":"","background-color":"","background-clip":"","background-image":"","border-radius":"","box-shadow":"","text-shadow":"","text-clip":"","clip-path":"",color:"","font-size":Te.px(13),"font-stretch":"","line-height":"","text-align":"","text-transform":"","text-decoration":"","letter-spacing":"","word-spacing":"","text-indent":"","perspective-origin":"","transform-origin":"","transform-style":"",perspective:"","mix-blend-mode":"",opacity:"",rotate:"","text-fill-color":"","text-stroke-color":"","text-stroke-width":"","offset-path":"","offset-distance":"",border:{},outline:{},borderRadius:{},animations:[],transitions:[],keyframes:[],selectors:[],svg:[]},t))}},{key:"toCloneObject",value:function(){var t=this.json;return Ap({},Bp(zp(e.prototype),"toCloneObject",this).call(this),{position:t.position,right:t.right+"",bottom:t.bottom+"",rootVariable:t.rootVariable,variable:t.variable,transform:t.transform,filter:t.filter,"backdrop-filter":t["backdrop-filter"],"background-color":t["background-color"],"background-image":t["background-image"],"text-clip":t["text-clip"],"border-radius":t["border-radius"],"box-shadow":t["box-shadow"],"text-shadow":t["text-shadow"],"clip-path":t["clip-path"],color:t.color,"font-size":t["font-size"]+"","font-stretch":t["font-stretch"]+"","line-height":t["line-height"]+"","text-align":t["text-align"]+"","text-transform":t["text-transform"]+"","text-decoration":t["text-decoration"]+"","letter-spacing":t["letter-spacing"]+"","word-spacing":t["word-spacing"]+"","text-indent":t["text-indent"]+"","perspective-origin":t["perspective-origin"],"transform-origin":t["transform-origin"],"transform-style":t["transform-style"],perspective:t.perspective+"","mix-blend-mode":t["mix-blend-mode"],opacity:t.opacity+"",rotate:t.rotate+"",border:M(t.border),outline:M(t.outline),borderRadius:M(t.borderRadius),animations:t.animations.map(function(t){return t.clone()}),transitions:t.transitions.map(function(t){return t.clone()}),keyframes:t.keyframes.map(function(t){return t.clone()}),selectors:t.selectors.map(function(t){return t.clone()}),svg:t.svg.map(function(t){return t.clone()})})}},{key:"convert",value:function(t){return t=Bp(zp(e.prototype),"convert",this).call(this,t)}},{key:"addAnimation",value:function(t){return this.json.animations.push(t),t}},{key:"addTransition",value:function(t){return this.json.transitions.push(t),t}},{key:"addKeyframe",value:function(t){return this.json.keyframes.push(t),t}},{key:"addSelector",value:function(t){return this.json.selectors.push(t),t}},{key:"createAnimation",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return this.addAnimation(new Yf(Ap({checked:!0},t)))}},{key:"createKeyframe",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return this.addKeyframe(new kp(Ap({checked:!0},t)))}},{key:"createSelector",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return this.addSelector(new Cp(Ap({checked:!0},t)))}},{key:"createTransition",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return this.addTransition(new Qf(Ap({checked:!0},t)))}},{key:"removePropertyList",value:function(t,e){t.splice(e,1)}},{key:"removeAnimation",value:function(t){this.removePropertyList(this.json.animations,t)}},{key:"removeKeyframe",value:function(t){this.removePropertyList(this.json.keyframes,t)}},{key:"removeSelector",value:function(t){this.removePropertyList(this.json.selectors,t)}},{key:"removeTransition",value:function(t){this.removePropertyList(this.json.transitions,t)}},{key:"enableHasChildren",value:function(){return!0}},{key:"sortItem",value:function(t,e,n){t.splice.apply(t,[n+(e1&&void 0!==arguments[1]?arguments[1]:{};this.json.animations[+t].reset(e)}},{key:"updateTransition",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};this.json.transitions[+t].reset(e)}},{key:"updateKeyframe",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};this.json.keyframes[+t].reset(e)}},{key:"updateSelector",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};this.json.selectors[+t].reset(e)}},{key:"setSize",value:function(t){this.reset(t)}},{key:"setBorder",value:function(t){var e=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:void 0,r=this.json.border;if("all"===t)n?this.json.border={all:n}:["top","right","bottom","left"].forEach(function(t){delete e.json.border[t]});else{if(r.all&&_(n)){var o=Ap({},r.all);r.top=Ap({},o),r.bottom=Ap({},o),r.left=Ap({},o),r.right=Ap({},o)}r.all&&delete r.all,n&&(this.json.border[t]=n)}}},{key:"getBorder",value:function(t){return this.json.border[t]||{}}},{key:"setOutline",value:function(t){this.json.outline=Ap({},this.json.outline,t)}},{key:"setBorderRadius",value:function(t,e){this.json.borderRadius=e}},{key:"traverse",value:function(t,e,n){var r=this;t.isAttribute()||(n||!t.isLayoutItem()||t.isRootItem())&&(e.push(t),t.children.forEach(function(t){r.traverse(t,e)}))}},{key:"tree",value:function(t){var e=this,n=[];return this.children.forEach(function(r){e.traverse(r,n,t)}),n}},{key:"toPropertyCSS",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n={};return t.forEach(function(t){S(t.toCSS(e),function(t,e){n[t]||(n[t]=[]),n[t].push(e)})}),B(n)}},{key:"toStringPropertyCSS",value:function(t){return Y(this.json[t])}},{key:"toBackgroundImageCSS",value:function(){arguments.length>0&&void 0!==arguments[0]&&arguments[0];return this.toStringPropertyCSS("background-image")}},{key:"getBorderString",value:function(t){return"".concat(t.width," ").concat(t.style," ").concat(t.color)}},{key:"toBorderCSS",value:function(){var t=this,e={},n=this.json.border;return n.all?e={border:this.getBorderString(n.all)}:S(n,function(n,r){e["border-".concat(n)]=t.getBorderString(r)}),e}},{key:"toOutlineCSS",value:function(){var t=this.json.outline;return t?0===Object.keys(t).length?{}:{outline:"".concat(t.color," ").concat(t.style," ").concat(t.width)}:{}}},{key:"toKeyCSS",value:function(t){return this.json[t]?Dp({},t,this.json[t]):{}}},{key:"toAnimationKeyframes",value:function(t){return[{selector:'[data-id="'.concat(this.json.id,'"]'),properties:t}]}},{key:"toAnimationCSS",value:function(){return this.toPropertyCSS(this.json.animations)}},{key:"toTransitionCSS",value:function(){return this.toPropertyCSS(this.json.transitions)}},{key:"toString",value:function(){return X(this.toCSS())}},{key:"toExport",value:function(){return X(this.toCSS(!0))}},{key:"toBoxModelCSS",value:function(){var t=this.json,e={};return t["margin-top"]&&(e["margin-top"]=t["margin-top"]),t["margin-bottom"]&&(e["margin-bottom"]=t["margin-bottom"]),t["margin-left"]&&(e["margin-left"]=t["margin-left"]),t["margin-right"]&&(e["margin-right"]=t["margin-right"]),t["padding-top"]&&(e["padding-top"]=t["padding-top"]),t["padding-bottom"]&&(e["padding-bottom"]=t["padding-bottom"]),t["padding-left"]&&(e["padding-left"]=t["padding-left"]),t["padding-right"]&&(e["padding-right"]=t["padding-right"]),e}},{key:"toKeyListCSS",value:function(){for(var t=this.json,e={},n=arguments.length,r=new Array(n),o=0;o0&&void 0!==arguments[0]&&arguments[0];var t={};return this.isAbsolute&&(this.json.x&&(t.left=this.json.x),this.json.y&&(t.top=this.json.y)),t.visibility=this.json.visible?"visible":"hidden",Ap({},t,this.toKeyListCSS("position","right","bottom","width","height","overflow","background-color","color","opacity","mix-blend-mode","transform-origin","transform-style","perspective","perspective-origin","font-size","font-stretch","line-height","font-weight","font-family","font-style","text-align","text-transform","text-decoration","letter-spacing","word-spacing","text-indent","border-radius","filter","clip-path","backdrop-filter","box-shadow","text-shadow","offset-path"))}},{key:"toTransformCSS",value:function(){return this.json.rotate&&this.json.transform&&-1===this.json.transform.indexOf("rotate")?{transform:[this.json.transform,"rotate(".concat(this.json.rotate,")")].join(" ")}:this.json.rotate?{transform:"rotate(".concat(this.json.rotate,")")}:this.toKeyListCSS("transform")}},{key:"toVariableCSS",value:function(){var t={};return this.json.variable.split(";").filter(function(t){return t.trim()}).forEach(function(e){var n=Vp(e.split(":"),2),r=n[0],o=n[1];t["--".concat(r)]=o}),t}},{key:"toRootVariableCSS",value:function(){var t={};return this.json.rootVariable.split(";").filter(function(t){return t.trim()}).forEach(function(e){var n=Vp(e.split(":"),2),r=n[0],o=n[1];t["--".concat(r)]=o}),t}},{key:"toRootVariableString",value:function(){return X(this.toRootVariableCSS())}},{key:"toWebkitCSS",value:function(){var t=this.toKeyListCSS("text-fill-color","text-stroke-color","text-stroke-width","background-clip"),e={};return S(t,function(t,n){e["-webkit-".concat(t)]=n}),e}},{key:"toTextClipCSS",value:function(){var t={};return"text"===this.json["text-clip"]&&(t["-webkit-background-clip"]="text",t["-webkit-text-fill-color"]="transparent",t.color="transparent"),t}},{key:"toCSS",value:function(){var t=arguments.length>0&&void 0!==arguments[0]&&arguments[0];return Ap({},this.toVariableCSS(),this.toDefaultCSS(t),this.toWebkitCSS(),this.toTextClipCSS(),this.toBoxModelCSS(),this.toBorderCSS(),this.toOutlineCSS(),this.toTransformCSS(),this.toBackgroundImageCSS(t),this.toAnimationCSS(),this.toTransitionCSS())}},{key:"toEmbedCSS",value:function(){var t=arguments.length>0&&void 0!==arguments[0]&&arguments[0];return Ap({},this.toVariableCSS(),this.toDefaultCSS(),this.toWebkitCSS(),this.toTextClipCSS(),this.toBoxModelCSS(),this.toBorderCSS(),this.toOutlineCSS(),this.toTransformCSS(),this.toAnimationCSS(),this.toTransitionCSS(),this.toBackgroundImageCSS(t))}},{key:"toKeyframeString",value:function(){var t=arguments.length>0&&void 0!==arguments[0]&&arguments[0];return this.json.keyframes.map(function(e){return e.toString(t)}).join("\n\n")}},{key:"toSelectorString",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";return this.json.selectors.map(function(e){return e.toString(t)}).join("\n\n")}},{key:"toSVGString",value:function(){var t=this;return this.json.svg.map(function(e){if("filter"===e.type)return"\n<".concat(e.type," id='").concat(e.name,"'>\n ").concat(e.value.join("\n"),"\n");if("clip-path"===e.type){var n=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",e=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=arguments.length>2?arguments[2]:void 0,r=arguments.length>3?arguments[3]:void 0,o=Re.create("div").html(t).$("svg");if(!o)return{paths:"",transform:""};var i=o.html(),a=Te.parse(o.attr("width")),c=Te.parse(o.attr("height")),u="";if(e){var s=n.value/a.value,l=r.value/c.value;u='transform="scale('.concat(s," ").concat(l,')"')}return{paths:i,transform:u}}($p[e.value.icon],e.value.fit,t.json.width,t.json.height);return"\n\n ").concat(n.paths,"\n")}}).join("\n\n")}},{key:"toNestedCSS",value:function(t){return[]}},{key:"generateEmbed",value:function(){return{css:this.toEmbedCSS(),selectorString:this.toSelectorString()}}},{key:"generateView",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";return"\n".concat(t," { /* ").concat(this.json.itemType," */\n ").concat(X(this.toCSS(),"\n"),"; \n ").concat(e,"\n}\n\n").concat(this.toNestedCSS().map(function(e){return"".concat(t," ").concat(e.selector," { \n ").concat(e.cssText?e.cssText:X(e.css||{},"\n\t\t"),"; \n }")}).join("\n"),"\n\n").concat(this.toSelectorString(t),"\n")}},{key:"toBound",value:function(){var t={x:this.json.x?this.json.x.clone():Te.px(0),y:this.json.y?this.json.y.clone():Te.px(0),width:this.json.width.clone(),height:this.json.height.clone()};return t.x2=Te.px(t.x.value+t.width.value),t.y2=Te.px(t.y.value+t.height.value),t}}])&&Mp(n.prototype,r),o&&Mp(n,o),e}();function Hp(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var n=[],r=!0,o=!1,i=void 0;try{for(var a,c=t[Symbol.iterator]();!(r=(a=c.next()).done)&&(n.push(a.value),!e||n.length!==e);r=!0);}catch(t){o=!0,i=t}finally{try{r||null==c.return||c.return()}finally{if(o)throw i}}return n}(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance")}()}function Xp(t,e){if(R(e)){var n=Hp(e.split(":"),4),r=n[0],o=n[1],i=n[2],a=n[3];return 3600*(r=parseInt(r,10))+60*(o=parseInt(o,10))+(i=parseInt(i,10))+(a=parseInt(a,10))*(1/t)}return D(e)?e/t:0}function Yp(t,e){var n=Math.floor(e/3600),r=Math.floor(e/60%60),o=Math.floor(e%60),i=Math.round((e-Math.floor(e))*t);return i===t&&(i=0,60===(o+=1)&&60===(r+=1)&&(n+=1)),[n,r,o,i].map(function(t){return(t+"").padStart(2,"0")}).join(":")}function Np(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;return Yp(t,Xp(t,e)-Xp(t,n))}function Kp(t){var e={id:0,start:0,speed:t.speed||1,elapsed:t.elapsed||0,duration:t.duration||0,iterationStartCount:1,iterationCount:t.iterationCount||Number.MAX_SAFE_INTEGER,direction:t.direction||"normal",log:[],logIndex:0,tick:t.tick||function(){},startCallback:t.start||function(){},endCallback:t.end||function(){},firstCallback:t.first||function(){},lastCallback:t.last||function(){}},n=function(t){return"normal"===e.direction||"reverse"!==e.direction&&("alternate"===e.direction?e.iterationStartCount%2==1:"alternate-reverse"===e.direction?e.iterationStartCount%2==0:void 0)?t:1-t},r=function(t){var r=!1;null===e.start&&(e.start=t,r=!0);var a=t-e.start;e.elapsed+=a*e.speed,e.start=t,e.elapsed>e.duration&&(e.elapsed=e.duration);var c=n(e.elapsed/e.duration)*e.duration;r&&e.startCallback(c,e),e.log[e.logIndex++]={elapsed:c,dt:e.lastTime-c},e.lastTime=c,e.tick(c,e),e.elapsed===e.duration?i():o()},o=function(){e.id=requestAnimationFrame(r)},i=function(){e.endCallback(e.elapsed,e),e.iterationStartCount++,e.iterationStartCount>e.iterationCount?(e.lastCallback(e.elapsed,e),cancelAnimationFrame(e.id)):(e.start=null,e.elapsed=0,o())},a=function(t){e.elapsed=t,e.tick(e.elapsed,e)};return{play:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};e.start=null,e.iterationStartCount=1,e.log=[],e.lastTime=0,e.logIndex=0,D(t.elapsed)&&(e.elapsed=t.elapsed),D(t.speed)&&(e.speed=t.speed),D(t.duration)&&(e.duration=t.duration),D(t.iterationCount)&&(e.iterationCount=t.iterationCount||Number.MAX_SAFE_INTEGER),R(t.direction)&&(e.direction=t.direction),A(t.tick)&&(e.tick=t.tick),A(t.start)&&(e.startCallback=t.start),A(t.end)&&(e.endCallback=t.end),A(t.first)&&(e.firstCallback=t.first),A(t.last)&&(e.lastCallback=t.last),e.firstCallback(e.elapsed,e),o()},stop:function(){cancelAnimationFrame(e.id)},tick:r,first:function(t){a(0)},last:function(t){a(e.duration)},seek:a,timer:e}}function Wp(t){return function(t){if(Array.isArray(t)){for(var e=0,n=new Array(t.length);e8&&void 0!==arguments[8]?arguments[8]:1e3,s=eh({x:t,y:e},{x:n,y:r},{x:o,y:i},{x:a,y:c}),l=0,f=s(0),p=0;p<=u;p++){var h=s(p/u);l+=at(f.x,f.y,h.x,h.y),f=h}return l},ih=function(t,e,n,r,o,i){for(var a=arguments.length>6&&void 0!==arguments[6]?arguments[6]:1e3,c=nh({x:t,y:e},{x:n,y:r},{x:o,y:i}),u=0,s=c(0),l=0;l<=a;l++){var f=c(l/a);u+=at(s.x,s.y,f.x,f.y),s=f}return u},ah=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:100,n={minDist:1/0,minT:0};return function(r,o){for(var i=0;i<=e;i++)rh(n,t,i/e,r,o);var a=1/(2*e),c=n.minT;for(i=0;i2&&void 0!==arguments[2]?arguments[2]:100;return ah(function(t,e){var n=[t,e];return function(t){return ph(n,t)}}(t,e),n)},uh=function(t){var e=th(t),n={x:e[0],y:e[1]},r={x:e[2],y:e[3]};return eh({x:0,y:0},n,r,{x:1,y:1})},sh=function(t,e,n){return{x:t.x+(e.x-t.x)*n,y:t.y+(e.y-t.y)*n}},lh=function(t,e){var n=sh(t[0],t[1],e),r=sh(t[1],t[2],e),o=sh(t[2],t[3],e),i=sh(n,r,e),a=sh(r,o,e);return sh(i,a,e)},fh=function(t,e){var n=sh(t[0],t[1],e),r=sh(t[1],t[2],e);return sh(n,r,e)},ph=function(t,e){return sh(t[0],t[1],e)},hh=function(t,e){var n=sh(t[0],t[1],e);return{first:[t[0],n],second:[n,t[1]]}};function yh(t,e,n,r){var o=arguments.length>4&&void 0!==arguments[4]?arguments[4]:void 0;return function(t,e){if(0===e)return n;if(1===e)return r;var i=n+(r-n)*t;return o?i+o:i}}function dh(t,e,n){return function(t,e){return n}}function vh(t,e,n){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"width",o=arguments.length>4&&void 0!==arguments[4]?arguments[4]:"parent",i=null;return"parent"===o?i=t[o][r]:"self"===o&&(i=t[r]),i?n.toPx(i.value):n}function bh(t,e,n,r){var o=arguments.length>4&&void 0!==arguments[4]?arguments[4]:"width",i=arguments.length>5&&void 0!==arguments[5]?arguments[5]:"parent",a=Te.parse(n),c=Te.parse(r);return a.unit===c.unit?yh(t,e,a.value,c.value,a.unit):a.equals(c)?dh(0,0,a):function(n,r){var u=vh(t,e,a,o,i),s=vh(t,e,c,o,i);return 0===r?u:1===r?s:function(t,e,n,r){var o=arguments.length>4&&void 0!==arguments[4]?arguments[4]:"width",i=arguments.length>5&&void 0!==arguments[5]?arguments[5]:"parent",a=null;return"parent"===i?a=t[i][o]:"self"===i&&(a=t[o]),a?n.to(r,a.value):n}(t,e,Te.px(u.value+(s.value-u.value)*n),a.unit,o,i)}}function gh(t,e){for(var n=0;n0&&void 0!==arguments[0]?arguments[0]:1,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"end";return t=+t,function(n){var r=1/t;return"start"==e?r*Math.ceil(n/r):"end"==e?r*Math.floor(n/r):void 0}};function Ah(){return Ih(1,"start")}function Dh(){return Ih(1,"end")}var Mh=function(){return function(t){return Math.pow(2,-10*t)*Math.sin(5*(t-.1)*Math.PI)+1}},Lh={step:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"end";return Ih(t,e)},"step-start":Ah,"step-end":Dh,stepStart:Ah,stepEnd:Dh,"ease-out-elastic":Mh,easeOutElastic:Mh};function Bh(t,e,n){return n.toDeg()}function zh(t,e,n,r){var o=Te.parse(n),i=Te.parse(r);return function(t,e){var n=Bh(0,0,o),r=Bh(0,0,i);return 0===e?n:1===e?r:Te.deg(n.value+(r.value-n.value)*t).to(o.unit)}}function Fh(t){return(Fh="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function Gh(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function Hh(t,e){for(var n=0;n1&&void 0!==arguments[1]&&arguments[1],n={};return t.forEach(function(t){S(t.toCSS(e),function(t,e){n[t]||(n[t]=[]),n[t].push(e)})}),B(n)}},{key:"join",value:function(t){return X(e.toPropertyCSS(t.map(function(t){return e.parse(t)})))}}],(r=[{key:"addImageResource",value:function(t){return this.clear("image-resource"),this.addItem("image-resource",t)}},{key:"addGradient",value:function(t){return this.addImageResource(t)}},{key:"setImageUrl",value:function(t){t.images&&t.images.length&&this.reset({type:"image",image:e.createImage(t.images[0])})}},{key:"setGradient",value:function(t){this.reset({type:t.type,image:e.createGradient(t,this.json.image)})}},{key:"getDefaultObject",value:function(){return ny(ry(e.prototype),"getDefaultObject",this).call(this,{itemType:"background-image",checked:!1,blendMode:"normal",size:"auto",repeat:"repeat",width:Te.percent(100),height:Te.percent(100),x:Te.percent(0),y:Te.percent(0),image:new ul})}},{key:"toCloneObject",value:function(){var t=this.json;return Jh({},ny(ry(e.prototype),"toCloneObject",this).call(this),{checked:t.checked,blendMode:t.blendMode,size:t.size,repeat:t.repeat,width:t.width+"",height:t.height+"",x:t.x+"",y:t.y+"",image:t.image.clone()})}},{key:"convert",value:function(t){return t.x=Te.parse(t.x),t.y=Te.parse(t.y),t.width&&(t.width=Te.parse(t.width)),t.height&&(t.height=Te.parse(t.height)),t}},{key:"checkField",value:function(t,n){return"repeat"===t?ay.includes(n):ny(ry(e.prototype),"checkField",this).call(this,t,n)}},{key:"toBackgroundImageCSS",value:function(){var t=arguments.length>0&&void 0!==arguments[0]&&arguments[0];return this.json.image?{"background-image":this.json.image.toString(t)}:{}}},{key:"toBackgroundPositionCSS",value:function(){var t=this.json;return{"background-position":"".concat(t.x," ").concat(t.y)}}},{key:"toBackgroundSizeCSS",value:function(){var t=this.json,e="auto";return"contain"==t.size||"cover"==t.size?e=t.size:t.width.isPercent()&&t.width.isPercent()&&100==+t.width&&100==+t.height||(e="".concat(t.width," ").concat(t.height)),{"background-size":e}}},{key:"toBackgroundRepeatCSS",value:function(){return{"background-repeat":this.json.repeat}}},{key:"toBackgroundBlendCSS",value:function(){return{"background-blend-mode":this.json.blendMode}}},{key:"toCSS",value:function(){var t=arguments.length>0&&void 0!==arguments[0]&&arguments[0];return Jh({},this.toBackgroundImageCSS(t),this.toBackgroundPositionCSS(),this.toBackgroundSizeCSS(),this.toBackgroundRepeatCSS(),this.toBackgroundBlendCSS())}},{key:"toString",value:function(){return j(this.toCSS(),function(t,e){return"".concat(t,": ").concat(e)}).join(";")}},{key:"toBackgroundCSS",value:function(){var t=this.toCSS();return{background:"".concat(t["background-image"]," ")}}},{key:"image",get:function(){return this.json.image},set:function(t){this.json.image=t}}])&&ty(n.prototype,r),o&&ty(n,o),e}();function sy(t,e,n,r){var o={cut:Ch(0,0,n.cut,r.cut),percent:yh(t,e,n.percent,r.percent),px:yh(t,e,n.px,r.px),em:yh(t,e,n.em,r.em),unit:Vh(0,0,n.unit,r.unit),color:$h(0,0,n.color,r.color)};return function(t,e){return new Xs({cut:o.cut(t,e),percent:o.percent(t,e),px:o.px(t,e),em:o.em(t,e),unit:o.unit(t,e),color:o.color(t,e)})}}function ly(t,e){for(var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[],r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:[],o=Math.max(n.length,r.length),i=[],a=0;a0&&void 0!==arguments[0]?arguments[0]:{};return xy(Ty(e.prototype),"getDefaultObject",this).call(this,wy({itemType:"filter"},t))}},{key:"toString",value:function(){return"".concat(this.json.type,"(").concat(this.json.value||"",")")}}],[{key:"parse",value:function(t){var e=Hy[t.type];return e?new e(t):new Vy({value:t.type})}},{key:"parseStyle",value:function(t){var n=[];if(!t)return n;var r=Kt(t);return(r.str.match(Cy)||[]).forEach(function(t,o){var i=my(t.split("("),2),a=i[0],c=i[1];if(c=c.split(")")[0],"drop-shadow"===a){var u=c.split(" "),s=u.filter(function(t){return t.includes("@")}).map(function(t){return r.matches[+t.replace("@","")].color}),l=u.filter(function(t){return!t.includes("@")});n[o]=e.parse({type:a,offsetX:Te.parse(l[0]),offsetY:Te.parse(l[1]),blurRadius:Te.parse(l[2]),color:s[0]||"rgba(0, 0, 0, 1)"})}else n[o]=e.parse({type:a,value:Te.parse(c)})}),n}},{key:"join",value:function(t){return t.map(function(t){return e.parse(t)}).join(" ")}}]),e}(),Ry=function(t){function e(){return Oy(this,e),Py(this,Ty(e).apply(this,arguments))}return _y(e,$y),jy(e,[{key:"getDefaultObject",value:function(){return xy(Ty(e.prototype),"getDefaultObject",this).call(this,{type:"blur",value:e.spec.defaultValue})}},{key:"toCloneObject",value:function(){return wy({},xy(Ty(e.prototype),"toCloneObject",this).call(this),{value:Te.parse(this.json.value)})}}]),e}();Ry.spec={title:"Blur",inputType:"range",min:0,max:100,step:1,unit:"px",units:["px","em"],defaultValue:Te.px(0)};var Vy=function(t){function e(){return Oy(this,e),Py(this,Ty(e).apply(this,arguments))}return _y(e,$y),jy(e,[{key:"getDefaultObject",value:function(){return xy(Ty(e.prototype),"getDefaultObject",this).call(this,{type:"svg",value:e.spec.defaultValue})}},{key:"toCloneObject",value:function(){return wy({},xy(Ty(e.prototype),"toCloneObject",this).call(this),{value:Te.parse(this.json.value)})}},{key:"toString",value:function(){return"url(#".concat(this.json.value||"",")")}}]),e}();Vy.spec={title:"SVG",inputType:"select",defaultValue:""};var Iy=function(t){function e(){return Oy(this,e),Py(this,Ty(e).apply(this,arguments))}return _y(e,$y),jy(e,[{key:"getDefaultObject",value:function(){return xy(Ty(e.prototype),"getDefaultObject",this).call(this,{type:"grayscale",value:e.spec.defaultValue})}},{key:"toCloneObject",value:function(){return wy({},xy(Ty(e.prototype),"toCloneObject",this).call(this),{value:Te.parse(this.json.value)})}}]),e}();Iy.spec={title:"Grayscale",inputType:"range",min:0,max:100,step:1,unit:"%",units:["%"],defaultValue:Te.percent(0)};var Ay=function(t){function e(){return Oy(this,e),Py(this,Ty(e).apply(this,arguments))}return _y(e,$y),jy(e,[{key:"getDefaultObject",value:function(){return xy(Ty(e.prototype),"getDefaultObject",this).call(this,{type:"hue-rotate",value:e.spec.defaultValue})}}]),e}();Ay.spec={title:"Hue",inputType:"range",min:0,max:360,step:1,unit:"deg",units:["deg"],defaultValue:Te.deg(0)};var Dy=function(t){function e(){return Oy(this,e),Py(this,Ty(e).apply(this,arguments))}return _y(e,$y),jy(e,[{key:"getDefaultObject",value:function(){return xy(Ty(e.prototype),"getDefaultObject",this).call(this,{type:"invert",value:e.spec.defaultValue})}}]),e}();Dy.spec={title:"Invert",inputType:"range",min:0,max:100,step:1,unit:"%",units:["%"],defaultValue:Te.percent(0)};var My=function(t){function e(){return Oy(this,e),Py(this,Ty(e).apply(this,arguments))}return _y(e,$y),jy(e,[{key:"getDefaultObject",value:function(){return xy(Ty(e.prototype),"getDefaultObject",this).call(this,{type:"brightness",value:e.spec.defaultValue})}}]),e}();My.spec={title:"Brightness",inputType:"range",min:0,max:200,step:1,unit:"%",units:["%"],defaultValue:Te.percent(100)};var Ly=function(t){function e(){return Oy(this,e),Py(this,Ty(e).apply(this,arguments))}return _y(e,$y),jy(e,[{key:"getDefaultObject",value:function(){return xy(Ty(e.prototype),"getDefaultObject",this).call(this,{type:"contrast",value:e.spec.defaultValue})}}]),e}();Ly.spec={title:"Contrast",inputType:"range",min:0,max:200,step:1,unit:"%",units:["%"],defaultValue:Te.percent(100)};var By=function(t){function e(){return Oy(this,e),Py(this,Ty(e).apply(this,arguments))}return _y(e,$y),jy(e,[{key:"getDefaultObject",value:function(){return xy(Ty(e.prototype),"getDefaultObject",this).call(this,{type:"opacity",value:e.spec.defaultValue})}}]),e}();By.spec={title:"Opacity",inputType:"range",min:0,max:100,step:1,unit:"%",units:["%"],defaultValue:Te.percent(100)};var zy=function(t){function e(){return Oy(this,e),Py(this,Ty(e).apply(this,arguments))}return _y(e,$y),jy(e,[{key:"getDefaultObject",value:function(){return xy(Ty(e.prototype),"getDefaultObject",this).call(this,{type:"saturate",value:e.spec.defaultValue})}}]),e}();zy.spec={title:"Saturate",inputType:"range",min:0,max:100,step:1,unit:"%",units:["%"],defaultValue:Te.percent(100)};var Fy=function(t){function e(){return Oy(this,e),Py(this,Ty(e).apply(this,arguments))}return _y(e,$y),jy(e,[{key:"getDefaultObject",value:function(){return xy(Ty(e.prototype),"getDefaultObject",this).call(this,{type:"sepia",value:e.spec.defaultValue})}}]),e}();Fy.spec={title:"Sepia",inputType:"range",min:0,max:100,step:1,unit:"%",units:["%"],defaultValue:Te.percent(0)};var Gy=function(t){function e(){return Oy(this,e),Py(this,Ty(e).apply(this,arguments))}return _y(e,$y),jy(e,[{key:"getDefaultObject",value:function(){return xy(Ty(e.prototype),"getDefaultObject",this).call(this,{type:"drop-shadow",multi:!0,offsetX:e.spec.offsetX.defaultValue,offsetY:e.spec.offsetY.defaultValue,blurRadius:e.spec.blurRadius.defaultValue,color:e.spec.color.defaultValue})}},{key:"toString",value:function(){var t=this.json;return"drop-shadow(".concat(t.offsetX," ").concat(t.offsetY," ").concat(t.blurRadius," ").concat(t.color,")")}}]),e}();Gy.spec={offsetX:{title:"Offset X",inputType:"range",min:-100,max:100,step:1,defaultValue:Te.px(0),unit:"px",units:["px","em"]},offsetY:{title:"Offset Y",inputType:"range",min:-100,max:100,step:1,defaultValue:Te.px(0),unit:"px",units:["px","em"]},blurRadius:{title:"Blur Radius",inputType:"range",min:0,max:100,step:1,defaultValue:Te.px(0),unit:"px",units:["px","em","%"]},color:{title:"Color",inputType:"color",defaultValue:"rgba(0, 0, 0, 1)",unit:"color"}};var Hy={blur:Ry,grayscale:Iy,"hue-rotate":Ay,invert:Dy,brightness:My,contrast:Ly,opacity:By,saturate:zy,sepia:Fy,"drop-shadow":Gy,svg:Vy},Xy={BlurFilter:Ry,GrayscaleFilter:Iy,HueRotateFilter:Ay,InvertFilter:Dy,BrightnessFilter:My,ContrastFilter:Ly,OpacityFilter:By,SaturateFilter:zy,SepiaFilter:Fy,DropshadowFilter:Gy,URLSvgFilter:Vy};function Yy(t,e,n,r){var o={type:Vh(0,0,n.type,r.type),value:Ch(0,0,n.value,r.value)};switch(n.type){case"blur":o.value=bh(t,e,n.value,r.value);break;case"grayscale":case"invert":case"brightness":case"contrast":case"opacity":case"saturate":case"sepia":case"hue-rotate":o.value=yh(t,e,n.value.value,r.value.value,n.value.unit);break;case"drop-shadow":o.offsetX=bh(t,e,n.offsetX,r.offsetX,"width","self"),o.offsetY=bh(t,e,n.offsetY,r.offsetY,"height","self"),o.blurRadius=bh(t,e,n.blurRadius,r.blurRadius,"width","self"),o.spreadRadius=bh(t,e,n.spreadRadius,r.spreadRadius,"width","self"),o.color=$h(0,0,n.color,r.color)}return function(t,e){return"drop-shadow"===o.type(t,e)?{type:o.type(t,e),offsetX:o.offsetX(t,e),offsetY:o.offsetY(t,e),blurRadius:o.blurRadius(t,e),spreadRadius:o.spreadRadius(t,e),color:o.color(t,e)}:{type:o.type(t,e),value:o.value(t,e)}}}function Ny(t,e,n,r){for(var o=$y.parseStyle(n),i=$y.parseStyle(r),a=Math.max(o.length,i.length),c=[],u=0,s=a;u0&&void 0!==arguments[0]?arguments[0]:"50% 50%",e="50% 50%",n="";if((t=t||"50%").includes("at")){var r=Zy(t.split("at").map(function(t){return t.trim()}),2);e=r[0],n=r[1]}else n=t.trim();var o=Zy(n.split(" "),2),i=o[0],a=o[1];_(a)&&(a=i),i=Te.parse(i),a=Te.parse(a);var c=Zy(e.split(" "),2),u=c[0],s=c[1];return _(s)&&(s=u),{radiusX:u=Te.parse(u),radiusY:s=Te.parse(s),x:i,y:a}}},{key:"parseStyleForInset",value:function(){var t=Zy((arguments.length>0&&void 0!==arguments[0]?arguments[0]:"").split("round"),2),e=t[0],n=t[1],r=Zy(Wy.parse(e),5),o=r[0],i=r[1],a=r[2],c=r[3],u=r[4];if(n)var s=Zy(Wy.parse(n),5),l=s[0],f=s[1],p=s[2],h=s[3],y=s[4];return{isAll:1===o,top:i,right:a,bottom:c,left:u,round:n,isAllRadius:1===l,topRadius:f,rightRadius:p,bottomRadius:h,leftRadius:y}}},{key:"parseStyleForPolygon",value:function(){return(arguments.length>0&&void 0!==arguments[0]?arguments[0]:"").split(",").filter(function(t){return t.trim()}).map(function(t){var e=Zy(t.trim().split(" "),2),n=e[0],r=e[1];return{x:Te.parse(n),y:Te.parse(r)}})}}],(r=[{key:"getDefaultObject",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return ed(nd(e.prototype),"getDefaultObject",this).call(this,qy({itemType:"clip-path",type:"none",value:""},t))}},{key:"toCloneObject",value:function(){return qy({},ed(nd(e.prototype),"toCloneObject",this).call(this),{value:this.json.value})}},{key:"toString",value:function(){var t=this.json.type,e=this.json.value,n=this.json.box,r="";switch(t){case"circle":case"inset":case"ellipse":case"polygon":case"path":r="".concat(t,"(").concat(e,")");break;case"svg":r="url(#".concat(e,")");break;default:r="none"}return n?"".concat(n," ").concat(r):r}},{key:"toCSS",value:function(){return{"clip-path":this.toString()}}}])&&Qy(n.prototype,r),o&&Qy(n,o),e}();function ad(t,e,n,r){var o=id.parseStyle(n),i=id.parseStyle(r),a={type:Ch(0,0,o.type,o.type),value:Ch(0,0,n,r)};if(o.type==i.type&&"none"!=o)switch(o.type){case"circle":o.value=id.parseStyleForCircle(o.value),i.value=id.parseStyleForCircle(i.value),a.value=function(t,e,n,r){var o={};return"closest-side"===n.radius||"farthest-side"===n.radius||"closest-side"===r.radius||"farthest-side"===r.radius?o.radius=Ch(0,0,n.radius,r.radius):n.radius.unit===r.radius.unit?o.radius=makeInterpolateNumber(t,e,n.radius.value,r.radius.value,n.radius.unit):o.radius=bh(t,e,n.radius,r.radius,"width","self"),o.x=bh(t,e,n.x,r.x,"width","self"),o.y=bh(t,e,n.y,r.y,"height","self"),function(t,e){var n=o.radius(t,e),r=o.x(t,e),i=o.y(t,e),a="".concat(r," ").concat(i),c=n+"";return c.includes("closest-side")?c="closest-side":c.includes("farthest-side")&&(c="farthest-side"),n?"".concat(c," at ").concat(a):"".concat(a)}}(t,e,o.value,i.value);break;case"ellipse":o.value=id.parseStyleForEllipse(o.value),i.value=id.parseStyleForEllipse(i.value),a.value=function(t,e,n,r){var o={radiusX:bh(t,e,n.radiusX,r.radiusX,"width","self"),radiusY:bh(t,e,n.radiusY,r.radiusY,"height","self"),x:bh(t,e,n.x,r.x,"width","self"),y:bh(t,e,n.y,r.y,"height","self")};return function(t,e){var n=o.radiusX(t,e),r=o.radiusY(t,e),i=o.x(t,e),a=o.y(t,e);return"".concat(n," ").concat(r," at ").concat(i," ").concat(a)}}(t,e,o.value,i.value);break;case"inset":o.value=id.parseStyleForInset(o.value),i.value=id.parseStyleForInset(i.value),a.value=function(t,e,n,r){var o={top:yh(t,e,n.top.value,r.top.value,n.top.unit),left:yh(t,e,n.left.value,r.left.value,n.left.unit),right:yh(t,e,n.right.value,r.right.value,n.right.unit),bottom:yh(t,e,n.bottom.value,r.bottom.value,n.bottom.unit),round:Ch(0,0,n.round,r.round),topRadius:yh(t,e,n.topRadius.value,r.topRadius.value,n.topRadius.unit),leftRadius:yh(t,e,n.leftRadius.value,r.leftRadius.value,n.leftRadius.unit),rightRadius:yh(t,e,n.rightRadius.value,r.rightRadius.value,n.rightRadius.unit),bottomRadius:yh(t,e,n.bottomRadius.value,r.bottomRadius.value,n.bottomRadius.unit)};return function(t,e){var n=o.top(t,e),r=o.right(t,e),i=o.bottom(t,e),a=o.left(t,e),c=o.round(t,e),u=o.topRadius(t,e),s=o.leftRadius(t,e),l=o.bottomRadius(t,e),f=o.rightRadius(t,e),p=[n,r,i,a].join(" "),h=[u,f,l,s].join(" ");return"".concat(p," ").concat(c&&h.trim()?"round ".concat(h):"")}}(t,e,o.value,i.value);break;case"polygon":o.value=id.parseStyleForPolygon(o.value),i.value=id.parseStyleForPolygon(i.value),a.value=function(t,e,n,r){for(var o=Math.max(n.length,r.length),i=[],a=0;a0&&void 0!==arguments[0]?arguments[0]:{};return yd(dd(e.prototype),"getDefaultObject",this).call(this,ld({itemType:"transform",type:"",value:[]},t))}},{key:"toCloneObject",value:function(){return ld({},yd(dd(e.prototype),"toCloneObject",this).call(this),{value:JSON.parse(JSON.stringify(this.json.value))})}},{key:"toString",value:function(){return"".concat(this.json.type,"(").concat(this.json.value.join(", ")||"",")")}},{key:"convert",value:function(t){return(t=yd(dd(e.prototype),"convert",this).call(this,t)).type.includes("matrix")||t.type.includes("scale")?t.value=t.value.map(function(t){return Te.number(t)}):t.value=t.value.map(function(t){return Te.parse(t)}),t}},{key:"hasNumberValue",value:function(){var t=this.json.type;return t.includes("matrix")||t.includes("scale")}}])&&pd(n.prototype,r),o&&pd(n,o),e}();function md(t,e,n,r){for(var o={type:Ch(0,0,n.type,r.type)},i=[],a=Math.max(n.value.length,r.value.length),c=0;c0;r--)if("M"===t[r].command){n=r;break}-1===n&&(n=0);var o=t[n];return o&&(o.index=n),o}},{key:"getPrevPoint",value:function(e,n){var r=n-1;if(r<0)return t.getLastPoint(e,n);var o=e[r];return o&&(o.index=r),o}},{key:"getNextPoint",value:function(e,n){return e[n].connected?t.getFirstPoint(e,n):e[n+1]}}],(n=null)&&xd(e.prototype,n),r&&xd(e,r),t}();function _d(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var n=[],r=!0,o=!1,i=void 0;try{for(var a,c=t[Symbol.iterator]();!(r=(a=c.next()).done)&&(n.push(a.value),!e||n.length!==e);r=!0);}catch(t){o=!0,i=t}finally{try{r||null==c.return||c.return()}finally{if(o)throw i}}return n}(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance")}()}function Ed(t){return function(t){if(Array.isArray(t)){for(var e=0,n=new Array(t.length);e0&&void 0!==arguments[0]?arguments[0]:"";!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.reset(e)}var e,n,r;return e=t,(n=[{key:"reset",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";this.segments=[],this.pathString=t,this.parse()}},{key:"resetSegments",value:function(t){this.segments=t||[],this.pathString=this.joinPath()}},{key:"trim",value:function(){return((arguments.length>0&&void 0!==arguments[0]?arguments[0]:"").match(Rd)||[]).filter(function(t){return""!=t})}},{key:"parse",value:function(){var t=this,e=this.pathString.match($d)||[];this.segments=e.map(function(e){var n=e[0];return{command:n,values:t.trim(e.replace(n,"")).map(function(t){return+t})}}),this.segments=this.segments.map(function(e,n){switch(e.command){case"c":case"m":case"l":case"q":case"s":case"t":case"v":case"h":for(var r=t.segments[n-1],o=r.values[r.values.length-2],i=r.values[r.values.length-1],a=0,c=e.values.length;a1&&void 0!==arguments[1]&&arguments[1],r=this.segments.map(function(n){return t.call(e,n)});if(n)return r;this.segments=r}},{key:"_loop",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return this.each(function(e){var n=e.values;switch(e.command){case"M":case"L":var r=t(n,0);e.values=[r[0],r[1]];break;case"V":r=t([+n[0],0]);e.values=[r[0]];break;case"H":r=t([0,+n[0]]);e.values=[r[1]];break;case"C":case"S":case"T":case"Q":for(var o=0,i=n.length;o1&&void 0!==arguments[1]?arguments[1]:[];return this.pathArray.push("".concat(t," ").concat(this.getPointString(e))),this}},{key:"M",value:function(){for(var t=arguments.length,e=new Array(t),n=0;n0&&void 0!==arguments[0]?arguments[0]:"object";return'")}},{key:"d",get:function(){return this.pathArray.join(" ").trim()}}])&&Ad(e.prototype,n),r&&Ad(e,r),t}();function Md(t){return(Md="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function Ld(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var n=[],r=!0,o=!1,i=void 0;try{for(var a,c=t[Symbol.iterator]();!(r=(a=c.next()).done)&&(n.push(a.value),!e||n.length!==e);r=!0);}catch(t){o=!0,i=t}finally{try{r||null==c.return||c.return()}finally{if(o)throw i}}return n}(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance")}()}function Bd(t,e){for(var n=0;n0&&void 0!==arguments[0]?arguments[0]:"";return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),zd(this,Fd(e).call(this,t))}var n,r,o;return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&Gd(t,e)}(e,Id),n=e,(r=[{key:"reset",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";this.segments=[],this.points=t,this.parse()}},{key:"resetSegments",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];this.segments=t,this.points=this.joinPoints()}},{key:"parse",value:function(){var t=this.points;C(t)&&(t=t.join(" "));for(var e=t.trim().split(Hd),n=[],r=0,o=e.length;r1&&void 0!==arguments[1]&&arguments[1],r=this.segments.map(function(n){return t.call(e,n)});if(n)return r;this.segments=r}},{key:"_loop",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return this.each(function(e){var n=Ld(t([e.x,e.y],0),2),r=n[0],o=n[1];return e.x=r,e.y=o,e},e)}},{key:"clone",value:function(){return new e(this.joinPoints())}},{key:"toString",value:function(){return this.joinPoints()}}])&&Bd(n.prototype,r),o&&Bd(n,o),e}();function Yd(t,e,n,r){for(var o=Math.max(n.length,r.length),i=[],a=n[n.length-1],c=r[r.length-1],u=0;u1&&(e-=1);var c=i[0];0===e?c=i[0]:1===e&&(c=i[i.length-1]);var u=i.find(function(t){return t.startT<=e&&e0&&void 0!==arguments[0]?arguments[0]:"linear",e=nv(t.split("(").map(function(t){return t.trim()}),2),n=e[0],r=e[1];r=(r||"").split(")")[0].trim();var o=Lh[n];if(o){var i=t.split("(")[1].split(")")[0].split(",").map(function(t){return t.trim()});return o.apply(void 0,ev(i))}return function(t){var e=uh(t);return function(t){return e(t).y}}(t)}function cv(t){return(cv="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function uv(t){return function(t){if(Array.isArray(t)){for(var e=0,n=new Array(t.length);e0&&void 0!==arguments[0]?arguments[0]:{};return hv(yv(e.prototype),"getDefaultObject",this).call(this,sv({timeline:[],compiledTimeline:{}},t))}},{key:"expectJSON",value:function(t){return"compiledTimeline"!==t&&hv(yv(e.prototype),"expectJSON",this).call(this,t)}},{key:"setTimelineInfo",value:function(t){var e=this.getSelectedTimeline();e&&["speed","iterationCount","direction"].forEach(function(n){E(t[n])&&(e[n]=t[n])})}},{key:"compileAll",value:function(){var t=this,e=this.getSelectedTimeline();this.json.compiledTimeline={},e&&e.animations.forEach(function(e){e.properties.forEach(function(n){t.compiledTimingFunction(e.id,n.property)})})}},{key:"searchTimelineOffset",value:function(t){var e=this,n=this.getSelectedTimeline(),r=[];return n&&n.animations.forEach(function(n){n.properties.forEach(function(o){var i=e.getCompiledTimingFunction(n.id,o.property);r.push(i.find(function(e){return!!(e.isOnlyTime&&e.startTime<=t)||e.startTime<=t&&t1&&void 0!==arguments[1]?arguments[1]:function(t){return t},n=this.getSelectedTimeline();if(n){E(t)&&this.setTimelineCurrentTime(t);var r=n.currentTime;this.searchTimelineOffset(r).filter(e).forEach(function(t){"offset-path"===t.property?t.func(r):t.layer.reset(lv({},t.property,t.func(r)))})}}},{key:"getSelectedTimeline",value:function(){var t=this.json.timeline,e=t.filter(function(t){return t.selected});return(e.length?e[0]:t[0])||null}},{key:"getKeyframeListReturnArray",value:function(){var t=this.getSelectedTimeline(),e=[];return t&&t.animations.forEach(function(t){t.properties.forEach(function(t){e.push.apply(e,uv(t.keyframes))})}),e}},{key:"getKeyframeList",value:function(t){var e=this.getSelectedTimeline();e&&e.animations.forEach(function(n){n.properties.forEach(function(n){n.keyframes.forEach(function(n){t&&t(e,n)})})})}},{key:"getSelectedTimelineLastTime",value:function(){var t=0;return this.getKeyframeList(function(e,n){t=Math.max(n.time,t)}),t}},{key:"getSelectedTimelineFirstTime",value:function(){var t=Number.MAX_SAFE_INTEGER;return this.getKeyframeList(function(e,n){t=Math.min(n.time,t)}),t}},{key:"getSelectedTimelinePrevTime",value:function(){var t=this.getSelectedTimelineFirstTime();return this.getKeyframeList(function(e,n){Yp(e.fps,n.time)e.currentTimecode&&(t=Math.min(n.time,t))}),t}},{key:"setTimelineTitle",value:function(t,e){var n=this.json.timeline.find(function(e){return e.id===t});n&&(n.title=e)}},{key:"selectTimeline",value:function(t){t?this.json.timeline.forEach(function(e){e.selected=e.id===t}):this.json.timeline.filter(function(t){return t.selected}).length||this.json.timeline.length&&(this.json.timeline.selected=!0);this.compileAll()}},{key:"removeAnimation",value:function(t){this.json.timeline=this.json.timeline.filter(function(e){return e.id!==t}),this.json.timeline.length&&(this.json.timeline[0].selected=!0),this.compileAll()}},{key:"addTimeline",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:60,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"00:00:10:00",n=lt(),r=sv({id:n,title:"sample"},this.getTimelineLayerInfo(t,e),{animations:[]});return this.json.timeline.push(r),this.selectTimeline(n),r}},{key:"addTimelineLayer",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:60,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"00:00:10:00",r=this.getSelectedTimeline();(r||(r=this.addTimeline(e,n)),r.selected=!0,t)&&(r.animations.filter(function(e){return e.id===t})[0]||r.animations.push({id:t,properties:[]}))}},{key:"getTimelineLayerInfo",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:60,e=Xp(t,arguments.length>1&&void 0!==arguments[1]?arguments[1]:"00:00:10:00");return{fps:t,speed:1,direction:"normal",iterationCount:1,currentTimecode:Yp(t,0),totalTimecode:Yp(t,e),currentTime:0,totalTime:e,displayStartTime:0,displayEndTime:e}}},{key:"setTimelineCurrentTime",value:function(t){var e=this.getSelectedTimeline(),n=e.fps,r=e.totalTimecode;if(e){var o=t,i=t;+o+""===o&&(i=Np(n,o=+o)),i>r&&(i=r);var a=Xp(n,i);e.currentTime=a,e.currentTimecode=Yp(n,a)}}},{key:"setDisplayTimeDxRate",value:function(t,e,n){var r=this.getSelectedTimeline();if(r){var o=t*r.totalTime,i=e+o,a=n+o;i=Math.max(i,0),0===(i=Math.min(i,a))&&(a=n-e),a=Math.max(a,i),(a=Math.min(a,r.totalTime))===r.totalTime&&(i=r.totalTime-(n-e)),r.displayStartTime=i,r.displayEndTime=a}}},{key:"setDisplayStartTimeRate",value:function(t){var e=this.getSelectedTimeline();e&&(e.displayStartTime=t*e.totalTime)}},{key:"setDisplayEndTimeRate",value:function(t){var e=this.getSelectedTimeline();e&&(e.displayEndTime=t*e.totalTime)}},{key:"setTimelineCurrentTimeRate",value:function(t){var e=this.getSelectedTimeline();if(e){var n=e.displayStartTime,r=e.displayEndTime,o=e.fps,i=n+(r-n)*t;this.setTimelineCurrentTime(Yp(o,i))}}},{key:"setTimelineTotalTime",value:function(t){var e=this.getSelectedTimeline();if(e){var n=t,r=t;+n+""===n&&(n=+n,r=Np(e.fps,n)),Xp(e.fps,r)3&&void 0!==arguments[3]?arguments[3]:void 0,o=arguments.length>4&&void 0!==arguments[4]?arguments[4]:void 0,i=arguments.length>5&&void 0!==arguments[5]?arguments[5]:void 0,a=this.getTimelineKeyframeById(t,e,n);a&&(E(i)&&(a.time=i),E(r)&&(a.value=r),E(o)&&(a.timing=o),this.compiledTimingFunction(t,e))}},{key:"addTimelineKeyframe",value:function(t){var e=t.layerId,n=t.property,r=t.value,o=t.timing,i=t.time,a=t.editor;this.addTimelineProperty(e,n);var c=this.getSelectedTimeline(),u=this.getTimelineProperty(e,n);if(u){var s=i||c.currentTime;if(!u.keyframes.filter(function(t){return t.time===s}).length){r=_(r)||""===r?this.getDefaultPropertyValue(n):r;var l={id:lt(),layerId:e,property:n,time:s,value:r,timing:o||"linear",editor:a};return u.keyframes.push(l),u.keyframes.sort(function(t,e){return t.time>e.time?1:-1}),this.compiledTimingFunction(e,n),l}}}},{key:"getDefaultPropertyValue",value:function(t){switch(t){case"mix-blend-mode":return"normal";case"rotate":return"0deg";case"box-shadow":return"0px 0px 0px 0px rgba(0, 0, 0, 1)";case"text-shadow":return"0px 0px 0px rgba(0, 0, 0, 1)";case"opacity":return 1;default:return""}}},{key:"copyTimelineKeyframe",value:function(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null,r=this.getTimelineProperty(t,e);if(r){var o=this.getSelectedTimeline(),i=n||o.currentTime,a=r.keyframes.filter(function(t){return t.timee.time?-1:1}),c=a[0].value+"",u=a[0].timing+"",editor=a[0].editor),this.addTimelineKeyframe({layerId:t,property:e,value:c,timing:u,editor:editor})}}},{key:"getTimelineKeyframe",value:function(t,e,n){var r=this.getTimelineProperty(t,e);if(r)return r.keyframes.find(function(t){return t.time===n})}},{key:"getTimelineKeyframeById",value:function(t,e,n){var r=this.getTimelineProperty(t,e);if(r)return r.keyframes.find(function(t){return t.id===n})}},{key:"sortTimelineKeyframe",value:function(t,e){var n=this.getTimelineProperty(t,e);n&&(n.keyframes.sort(function(t,e){return t.time>e.time?1:-1}),this.compiledTimingFunction(t,e))}},{key:"setFps",value:function(t){var e=this.getSelectedTimeline();e&&(e.fps=t,e.currentTimecode=Yp(t,e.currentTime),e.totalTimecode=Yp(t,e.totalTime))}},{key:"toCloneObject",value:function(){return sv({},hv(yv(e.prototype),"toCloneObject",this).call(this),{timeline:M(this.json.timeline)})}}])&&fv(n.prototype,r),o&&fv(n,o),e}();function bv(t){return(bv="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function gv(t){for(var e=1;e0&&void 0!==arguments[0]?arguments[0]:{};return Ov(Sv(e.prototype),"getDefaultObject",this).call(this,gv({itemType:"artboard",name:"New ArtBoard",width:Te.px(1e3),height:Te.px(1e3),"background-color":"white"},t))}},{key:"toCloneObject",value:function(){return gv({},Ov(Sv(e.prototype),"toCloneObject",this).call(this),{name:this.json.name})}},{key:"getDefaultTitle",value:function(){return"ArtBoard"}},{key:"checkInAreaForLayers",value:function(t){return this.layers.filter(function(e){return e.checkInArea(t)})}},{key:"toDefaultCSS",value:function(){return gv({},Ov(Sv(e.prototype),"toDefaultCSS",this).call(this))}}])&&wv(n.prototype,r),o&&wv(n,o),e}();function Rv(t,e){for(var n=0;n1&&void 0!==arguments[1]?arguments[1]:1;return Te.px(t).round(e)},Yv=function(){function t(){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t)}var e,n,r;return e=t,(n=[{key:"makeGuideCache",value:function(){var t=this,e=ta.selection.currentArtboard;return this.cachedExtraItems=[],e&&(this.cachedExtraItems=e.allLayers.filter(function(t){return!ta.selection.check(t)}),this.rect=ta.selection.allRect?ta.selection.allRect.clone():null),this.cachedPosition={},ta.selection.items.map(function(e){t.cachedPosition[e.id]={x:t.setupX(e),y:t.setupY(e)}}),this.rect}},{key:"move",value:function(t,e,n){var r=ta.selection.allRect;this.pointerType=t,"move"===t?this.rect.move(Xv(r.x.value+e),Xv(r.y.value+n)):(Fv.isRight(t)?this.rect.resizeWidth(Xv(r.width.value+e)):Fv.isLeft(t)&&r.width.value-e>=0&&(this.rect.moveX(Xv(r.x.value+e)),this.rect.resizeWidth(Xv(r.width.value-e))),Fv.isBottom(t)?this.rect.resizeHeight(Xv(r.height.value+n)):Fv.isTop(t)&&r.height.value-n>=0&&(this.rect.moveY(Xv(r.y.value+n)),this.rect.resizeHeight(Xv(r.height.value-n))))}},{key:"recover",value:function(t){if(this.rect){var e=this.cachedPosition[t.id].x,n=e.xDistRate,r=e.x2DistRate,o=this.cachedPosition[t.id].y,i=o.yDistRate,a=o.y2DistRate,c=this.rect.screenX.value,u=this.rect.screenX2.value,s=this.rect.screenY.value,l=this.rect.screenY2.value,f=u-c,p=f*n,h=f*r,y=l-s,d=y*i,v=y*a;this.setX(t,c,u,p,h),this.setY(t,s,l,d,v)}}},{key:"setY",value:function(t,e,n,r,o){var i=Math.round(r),a=Math.round(o)-i;t.setScreenY(i+e),t.height.set(a)}},{key:"setX",value:function(t,e,n,r,o){var i=Math.round(r),a=Math.round(o)-i;t.setScreenX(i+e),t.width.set(a)}},{key:"setupX",value:function(t){var e=ta.selection.allRect,n=e.screenX.value,r=e.screenX2.value-n;return 0===r?{xDistRate:0,x2DistRate:1}:{xDistRate:(t.screenX.value-n)/r,x2DistRate:(t.screenX2.value-n)/r}}},{key:"setupY",value:function(t){var e=ta.selection.allRect,n=e.screenY.value,r=e.screenY2.value-n;return 0===r?{yDistRate:0,y2DistRate:1}:{yDistRate:(t.screenY.value-n)/r,y2DistRate:(t.screenY2.value-n)/r}}},{key:"compareX",value:function(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:3,r=[t.screenX.value,t.centerX.value,t.screenX2.value],o=[e.screenX.value,e.centerX.value,e.screenX2.value],i=[];if(r.forEach(function(r,a){o.forEach(function(o,c){Math.abs(r-o)<=n&&i.push({A:t,B:e,source:a,target:c,ax:r,bx:o})})}),i.length){var a=Fv.getXDirection(this.pointerType),c=i.filter(function(t){return t.source==a});return c.length?c:[i[0]]}return i}},{key:"compareY",value:function(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:3,r=[t.screenY.value,t.centerY.value,t.screenY2.value],o=[e.screenY.value,e.centerY.value,e.screenY2.value],i=[];if(r.forEach(function(r,a){o.forEach(function(o,c){Math.abs(r-o)<=n&&i.push({A:t,B:e,source:a,target:c,ay:r,by:o})})}),i.length){var a=Fv.getYDirection(this.pointerType),c=i.filter(function(t){return t.source==a});return c.length?c:[i[0]]}return i}},{key:"compare",value:function(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:3;return{x:this.compareX(t,e,n),y:this.compareY(t,e,n)}}},{key:"getLayers",value:function(){var t=this,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:3,n=this.cachedExtraItems,r=[],o=[];return n.forEach(function(n){var i=t.compare(t.rect,n,e);r.push.apply(r,Gv(i.x)),o.push.apply(o,Gv(i.y))}),[r[0],o[0]].filter(function(t){return E(t)})}},{key:"calculate",value:function(){var t=this,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:3,n=this.getLayers(e);return Fv.isMove(this.pointerType)?n.forEach(function(e){return t.moveSnap(e)}):n.forEach(function(e){return t.sizeSnap(e)}),n}},{key:"sizeSnap",value:function(t){var e,n,r,o;if(E(t.ax))switch(t.source){case 2:e=this.rect.screenX.value,n=t.bx-e,this.rect.width.set(n);break;case 0:e=t.bx,n=this.rect.screenX2.value-e,this.rect.x.set(e),this.rect.width.set(n)}else switch(t.source){case 2:r=this.rect.screenY.value,o=t.by-r,this.rect.y.set(r),this.rect.height.set(o);break;case 0:r=t.by,o=this.rect.screenY2.value-r,this.rect.y.set(r),this.rect.height.set(o)}}},{key:"moveSnap",value:function(t){if(E(t.ax)){var e=Math.round(this.rect.width.value/2*t.source),n=t.bx-e;this.rect.x.set(n)}else if(E(t.ay)){var r=Math.round(this.rect.height.value/2*t.source),o=t.by-r;this.rect.y.set(o)}}},{key:"recoverAll",value:function(){var t=this;ta.selection.items.forEach(function(e){t.recover(e),e.recover()})}}])&&Hv(e.prototype,n),r&&Hv(e,r),t}();function Nv(t){return(Nv="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function Kv(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var n=[],r=!0,o=!1,i=void 0;try{for(var a,c=t[Symbol.iterator]();!(r=(a=c.next()).done)&&(n.push(a.value),!e||n.length!==e);r=!0);}catch(t){o=!0,i=t}finally{try{r||null==c.return||c.return()}finally{if(o)throw i}}return n}(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance")}()}function Wv(t){return function(t){if(Array.isArray(t)){for(var e=0,n=new Array(t.length);e\n
\n
\n
".concat($p.scatter,"
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n\n
\n
\n
\n
\n
\n
\n
\n
\n
\n ")}},{key:He("$rotate3d"),value:function(t){t.altKey?(ta.selection.each(function(t){t.reset({"transform-origin":""})}),this.bindData("$rotate3d")):t.shiftKey?(ta.selection.each(function(t){var e=gd.join(gd.parseStyle(t.transform).filter(function(t){switch(t.type){case"translate":case"translateX":case"translateY":case"translateZ":return!1}return!0}));t.reset({transform:e})}),this.bindData("$rotateZ"),this.bindData("$rotateArea")):(ta.selection.each(function(t){var e=gd.join(gd.parseStyle(t.transform).filter(function(t){switch(t.type){case"rotate":case"rotate3d":case"rotateX":case"rotateY":case"rotateZ":return!1}return!0}));t.reset({transform:e})}),this.bindData("$rotateZ"),this.bindData("$rotateArea")),this.emit("refreshSelectionStyleView")}},{key:He('$selectionTool .selection-tool-item[data-position="move"]'),value:function(t){this.trigger("openPathEditor")}},{key:"toggleEditingPath",value:function(t){this.refs.$selectionTool.toggleClass("editing-path",t)}},{key:"toggleEditingPolygon",value:function(t){this.refs.$selectionTool.toggleClass("editing-polygon",t)}},{key:cr("hideSelectionToolView"),value:function(){this.refs.$selectionTool.css({left:"-10000px",top:"-10000px"})}},{key:cr("hideSubEditor"),value:function(t){this.toggleEditingPath(!1),this.toggleEditingPolygon(!1)}},{key:cr("openPathEditor"),value:function(){var t=ta.selection.current;t&&t.is("svg-path")?(this.toggleEditingPolygon(!1),this.toggleEditingPath(!0),this.emit("showPathEditor","modify",{changeEvent:"updatePathItem",current:t,d:t.d,screenX:t.screenX,screenY:t.screenY,screenWidth:t.screenWidth,screenHeight:t.screenHeight})):t.is("svg-polygon")&&this.trigger("openPolygonEditor")}},{key:cr("openPolygonEditor"),value:function(){var t=ta.selection.current;t&&t.is("svg-polygon")&&(this.toggleEditingPath(!1),this.toggleEditingPolygon(!0),this.emit("showPolygonEditor","modify",{changeEvent:"updatePolygonItem",current:t,points:t.points,screenX:t.screenX,screenY:t.screenY,screenWidth:t.screenWidth,screenHeight:t.screenHeight}))}},{key:cr("finishPathEdit"),value:function(){this.toggleEditingPath(!1)}},{key:cr("finishPolygonEdit"),value:function(){this.toggleEditingPolygon(!1)}},{key:cr("updatePathItem"),value:function(t){var e,n=ta.selection.current;n&&(n.is("svg-path")&&(n.updatePathItem(t),(e=this.parent).selectCurrent.apply(e,Wv(ta.selection.items)),ta.selection.setRectCache(),this.emit("refreshSelectionStyleView")))}},{key:cr("updatePolygonItem"),value:function(t){var e,n=ta.selection.current;n&&(n.is("svg-polygon")&&(n.updatePolygonItem(t),(e=this.parent).selectCurrent.apply(e,Wv(ta.selection.items)),ta.selection.setRectCache(),this.emit("refreshSelectionStyleView"),this.emit("refreshCanvasForPartial",n)))}},{key:"setCacheBaseTrasnform",value:function(){for(var t=arguments.length,e=new Array(t),n=0;n0&&void 0!==arguments[0]?arguments[0]:[]).map(function(e){var n,r,o,i,a=new Rr(t.calculateWorldPosition(e.A)),c=new Rr(t.calculateWorldPosition(e.B));return E(e.ax)&&(n=e.ax*ta.scale),E(e.bx)&&(r=e.bx*ta.scale),E(e.ay)&&(o=e.ay*ta.scale),E(e.by)&&(i=e.by*ta.scale),{A:a,B:c,ax:n,bx:r,ay:o,by:i}})}},{key:"calculateWorldPosition",value:function(t){var e=Te.px(t.x||0),n=Te.px(t.y||0);return{x:Te.px(e.value*ta.scale),y:Te.px(n.value*ta.scale),width:Te.px(t.width.value*ta.scale),height:Te.px(t.height.value*ta.scale),transform:t.transform}}},{key:cr("refreshCanvas"),value:function(){arguments.length>0&&void 0!==arguments[0]&&arguments[0];ta.selection.setRectCache(),this.initSelectionTool()}},{key:cr("refreshSelectionStyleView"),value:function(){this.bindData("$rotate3d"),this.bindData("$rotateArea"),this.bindData("$rotateZ")}}])&&Uv(n.prototype,r),o&&Uv(n,o),e}();function eb(t){return(eb="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function nb(t){for(var e=1;e0&&void 0!==arguments[0]?arguments[0]:{};return ab(cb(e.prototype),"getDefaultObject",this).call(this,nb({itemType:"layer",name:"New Layer",tagName:"div"},t))}},{key:"getDefaultTitle",value:function(){return"Layer"}},{key:"toCloneObject",value:function(){return nb({},ab(cb(e.prototype),"toCloneObject",this).call(this),{tagName:this.json.tagName})}},{key:"screenX",get:function(){return this.json.parent?Te.px(this.json.parent.screenX.value+(this.json.x||zero).value):this.json.x||Te.px(0)}},{key:"screenY",get:function(){return this.json.parent?Te.px(this.json.parent.screenY.value+(this.json.y||zero).value):this.json.y||Te.px(0)}}])&&ob(n.prototype,r),o&&ob(n,o),e}();function lb(t){return(lb="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function fb(t,e){for(var n=0;n"}},{key:"createBackgroundImage",value:function(t,e,n,r,o){return{"background-image":"linear-gradient(to right, ".concat(t,", ").concat(t,")"),"background-size":"".concat(r," ").concat(o),"background-position":"".concat(e," ").concat(n),"background-repeat":"no-repeat"}}},{key:"createGuideLine",value:function(t){var e=this,n=Te.px(1),r=[];t.forEach(function(t){var o=t.B;if(E(t.ax)){r.push(e.createBackgroundImage("rgb(244, 140, 255)",Te.px(t.bx),t.A.screenY,n,t.A.height)),o instanceof sb&&r.push(e.createBackgroundImage("rgb(244, 140, 255)",Te.px(t.bx),o.screenY,n,o.height));var i=Te.min(o.screenY,t.A.screenY),a=Te.max(o.screenY2,t.A.screenY2);r.push(e.createBackgroundImage("rgb(180, 199, 254)",Te.px(t.bx),i,n,Te.px(a.value-i.value)))}else{r.push(e.createBackgroundImage("rgb(244, 140, 255)",t.A.screenX,Te.px(t.by),t.A.width,n));var c=Te.min(o.screenX,t.A.screenX),u=Te.max(o.screenX2,t.A.screenX2);r.push(e.createBackgroundImage("rgb(180, 199, 254)",c,Te.px(t.by),Te.px(u.value-c.value),n))}});var o={};return r.forEach(function(t){S(t,function(t,e){o[t]||(o[t]=[]),o[t].push(e)})}),B(o)}},{key:"removeGuideLine",value:function(){this.$el.cssText("")}},{key:"setGuideLine",value:function(t){this.$el.cssText(X(this.createGuideLine(t)))}},{key:cr("removeGuideLine"),value:function(){this.removeGuideLine()}},{key:cr("refreshGuideLine"),value:function(t){this.setGuideLine(t)}}])&&fb(n.prototype,r),o&&fb(n,o),e}();function vb(t){for(var e=1;e"):t.curve?"\n '):t.start?"\n '):"\n ')}).join("")}}])&&gb(e.prototype,n),r&&gb(e,r),t}();function wb(t){return function(t){if(Array.isArray(t)){for(var e=0,n=new Array(t.length);e3&&void 0!==arguments[3]?arguments[3]:null,o=this.state,i=o.originalSegment[t],a=o.segment[t];r&&(i=o.originalConnectedPoint[t],a=o.connectedPoint[t]),this.moveSegmentDistance(i,a,e,n)}},{key:"convertToCurve",value:function(t){var e=this.state.points,n=e[t];if(n.curve)if(n.curve=!1,n.reversePoint=M(n.startPoint),n.endPoint=M(n.startPoint),"M"===n.command){var r=Td.getPrevPoint(e,n.index);r.connected&&(r.curve=!1,r.reversePoint=M(r.startPoint),r.endPoint=M(r.startPoint))}else{if("M"===(o=Td.getNextPoint(e,t)).command)(a=o).curve=!1,a.reversePoint=M(a.startPoint),a.endPoint=M(a.startPoint)}else{n.curve=!0;var o,i=Td.getPrevPoint(e,t);if("M"===(o=Td.getNextPoint(e,t)).command){var a=o,c=((o=Td.getNextPoint(e,a.index)).startPoint.x+i.startPoint.x)/2,u=(o.startPoint.y+i.startPoint.y)/2,s=(o.startPoint.x-c)/2,l=(o.startPoint.y-u)/2;n.endPoint={x:n.startPoint.x+s,y:n.startPoint.y+l},n.reversePoint={x:n.startPoint.x-s,y:n.startPoint.y-l},a.curve=!0,a.endPoint={x:a.startPoint.x+s,y:a.startPoint.y+l},a.reversePoint={x:a.startPoint.x-s,y:a.startPoint.y-l}}else{c=(o.startPoint.x+i.startPoint.x)/2,u=(o.startPoint.y+i.startPoint.y)/2,s=(o.startPoint.x-c)/2,l=(o.startPoint.y-u)/2;n.endPoint={x:n.startPoint.x+s,y:n.startPoint.y+l},n.reversePoint={x:n.startPoint.x-s,y:n.startPoint.y-l}}}}},{key:"moveCurveSegment",value:function(t,e,n,r){var o=this.state;if("endPoint"===t)if(r){this.moveSegment("endPoint",e,n,r);var i=Td.getReversePoint(r.startPoint,r.endPoint);(c=r.reversePoint).x=i.x,c.y=i.y}else{this.moveSegment("endPoint",e,n);i=Td.getReversePoint(o.segment.startPoint,o.segment.endPoint);(c=o.segment.reversePoint).x=i.x,c.y=i.y}else if("reversePoint"===t)if(r){this.moveSegment("reversePoint",e,n,r);var a=Td.getReversePoint(r.startPoint,r.reversePoint);(c=r.endPoint).x=a.x,c.y=a.y}else{this.moveSegment("reversePoint",e,n);var c;a=Td.getReversePoint(o.segment.startPoint,o.segment.reversePoint);(c=o.segment.endPoint).x=a.x,c.y=a.y}}},{key:"rotateSegmentTarget",value:function(t,e,n){var r=this.state;if(n&&r.originalConnectedPoint[e]&&n[t]){var o=r.originalConnectedPoint.startPoint,i=o.x,a=o.y,c=n[t],u=c.x,s=c.y,l=r.originalConnectedPoint[e],f=at(l.x,l.y,i,a),p=it((ct(u-i,s-a)+180)%360,f,i,a),h=p.x,y=p.y;n[e]={x:h,y:y}}else if(r.originalSegment&&r.segment){var d=r.originalSegment.startPoint,v=(i=d.x,a=d.y,r.segment[t]),b=(u=v.x,s=v.y,r.originalSegment[e]),g=(f=at(b.x,b.y,i,a),it((ct(u-i,s-a)+180)%360,f,i,a));h=g.x,y=g.y;r.segment[e]={x:h,y:y}}}},{key:"rotateSegment",value:function(t,e){this.rotateSegmentTarget(t,"endPoint"===t?"reversePoint":"endPoint",e)}},{key:"calculateSnapPoint",value:function(t,e,n,r){var o=this.state.cachedPoints.filter(function(n){return!!n&&Math.abs(n[t]-e)<=r}).map(function(n){return{dist:Math.abs(n[t]-e),point:n}});o.sort(function(t,e){return t.dist>e.dist?-1:1});var i=null;return o.length&&(n+=(i=o[0].point)[t]-e),{point:i,distanceValue:n}}},{key:"calculateSnap",value:function(t,e,n){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:1,o=this.state.originalSegment[t];if(!t)return{dx:e,dy:n,snapPointList:[]};var i=o.x+e,a=o.y+n,c=this.calculateSnapPoint("x",i,e,r),u=c.point,s=(e=c.distanceValue,this.calculateSnapPoint("y",a,n,r)),l=s.point,f=(n=s.distanceValue,{x:o.x+e,y:o.y+n}),p=[];return u&&p.push({startPoint:u,endPoint:f}),l&&p.push({startPoint:l,endPoint:f}),{dx:e,dy:n,snapPointList:p}}},{key:"calculatePointDist",value:function(t,e,n){var r=this.state.points,o=[],i=jb;return r.filter(function(t){return t}).forEach(function(r){i.filter(function(t){return r[t]}).forEach(function(i){var a=r[i],c=Math.abs(a[t]-e);c<=n&&o.push({dist:c,point:a})})}),o.sort(function(t,e){return t.dist>e.dist?1:-1}),o.length?o[0].point:null}},{key:"calculateMovePointSnap",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1,n=this.calculatePointDist("x",t.x,e),r=this.calculatePointDist("y",t.y,e),o=kb({},t);n&&(o.x=n.x),r&&(o.y=r.y);var i=[];return n&&i.push({startPoint:n,endPoint:o}),r&&i.push({startPoint:r,endPoint:o}),{snapPointList:i,moveXY:o}}},{key:"move",value:function(t,e,n){var r=this,o=this.state,i=o.isCurveSegment,a=o.segmentKey,c=o.connectedPoint,u=this.calculateSnap(a,t,e,2),s=(t=u.dx,e=u.dy,u.snapPointList);this.snapPointList=s,i?n.shiftKey?(this.moveCurveSegment(a,t,e),c&&this.moveCurveSegment(a,t,e,c)):n.altKey?(this.moveSegment(a,t,e),c&&this.moveSegment(a,t,e,c)):(this.moveSegment(a,t,e),this.rotateSegment(a),c&&this.rotateSegment(a,c)):jb.forEach(function(n){r.moveSegment(n,t,e),c&&r.moveSegment(n,t,e,c)})}},{key:"moveEnd",value:function(t,e){var n=this.state,r=n.points,o=n.dragXY.x+t,i=n.dragXY.y+e;n.endPoint={x:o,y:i},n.reversePoint={x:o,y:i},n.dragPoints&&(n.reversePoint=Td.getReversePoint(n.startPoint,n.endPoint));var a={startPoint:n.startPoint,endPoint:n.endPoint,curve:n.dragPoints,reversePoint:n.reversePoint},c=Td.getLastPoint(r,r.length-1);c&&c.close?a.command="M":c||(a.command="M"),r.push(a),n.startPoint=null,n.endPoint=null,n.reversePoint=null,n.dragPoints=!1,n.moveXY=null}},{key:"setPoint",value:function(t){var e=t.first[0],n=t.second[t.second.length-1],r=this.clonePoints,o=Td.getPoint(r,e),i=Td.getPoint(r,n),a=[kb({},o,{endPoint:t.first[1]}),{startPoint:t.first[3],reversePoint:t.first[2],curve:!0,endPoint:t.second[1]},kb({},i,{reversePoint:t.second[2]})],c=Td.getIndex(r,e);r.splice.apply(r,[c,2].concat(a)),this.state.points=r}},{key:"setPointQuard",value:function(t){var e=t.first[0],n=(t.second[t.second.length-1],this.clonePoints),r=Td.getPoint(n,e),o=[kb({},r,{endPoint:{x:r.startPoint.x+(r.endPoint.x-r.startPoint.x)/3,y:r.startPoint.y+(r.endPoint.y-r.startPoint.y)/3}}),{startPoint:t.first[2],reversePoint:t.first[1],curve:!0,endPoint:t.second[1]}],i=Td.getIndex(n,e);n.splice.apply(n,[i,1].concat(o)),this.state.points=n}},{key:"setPointLine",value:function(t){var e=t.first[0],n=this.clonePoints,r=[{command:"L",startPoint:t.first[1],curve:!1,endPoint:t.first[1],reversePoint:t.first[1]}],o=Td.getIndex(n,e);n.splice.apply(n,[o+1,0].concat(r)),this.state.points=n}},{key:"toPath",value:function(t,e){for(var n=this,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1,o=[],i=this.clonePoints,a=0,c=i.length;a3&&void 0!==arguments[3]?arguments[3]:1,o=n.command,i=n.values;switch(o){case"Z":return"Z";default:var a=i.map(function(n){var o=(n.x-t)/r,i=(n.y-e)/r;return"".concat(o," ").concat(i)}).join(" ");return"".concat(o," ").concat(a)}}},{key:"makeSVGPath",value:function(){return this.initialize(),this.makePointGuide(this.clonePoints),this.makeMovePositionGuide(),this.toSVGString()}},{key:"makeStartPointGuide",value:function(t,e,n,r){e.startPoint.isFirst=!0,this.pathStringManager.M(e.startPoint),!1===e.curve?this.segmentManager.addPoint({},e.startPoint,r,"startPoint"):this.segmentManager.addPoint({},e.startPoint,r,"startPoint").addLine(e.startPoint,e.endPoint).addCurvePoint(e.endPoint,r,"endPoint")}},{key:"makeMiddlePointGuide",value:function(t,e,n,r){!1===e.curve?!1===t.curve?(this.pathStringManager.L(e.startPoint),this.segmentManager.addPoint({},e.startPoint,r,"startPoint"),this.splitLines.push((new Dd).M(t.startPoint).L(e.startPoint).toString("split-path"))):(this.pathStringManager.Q(t.endPoint,e.startPoint),this.splitLines.push((new Dd).M(t.startPoint).Q(t.endPoint,e.startPoint).toString("split-path")),this.segmentManager.addLine(t.startPoint,t.endPoint).addCurvePoint(e.startPoint,r,"startPoint").addCurvePoint(t.endPoint,t.index,"endPoint")):!1===t.curve?Td.isEqual(e.reversePoint,e.startPoint)?(this.pathStringManager.L(e.startPoint),this.splitLines.push((new Dd).M(t.startPoint).L(e.startPoint).toString("split-path")),this.segmentManager.addPoint({},e.startPoint,r,"startPoint")):(this.pathStringManager.Q(e.reversePoint,e.startPoint),this.splitLines.push((new Dd).M(t.startPoint).Q(e.reversePoint,e.startPoint).toString("split-path")),this.segmentManager.addLine(e.startPoint,e.reversePoint).addCurvePoint(e.startPoint,r,"startPoint").addCurvePoint(e.reversePoint,r,"reversePoint")):e.connected?(this.pathStringManager.C(t.endPoint,e.reversePoint,e.startPoint),this.splitLines.push((new Dd).M(t.startPoint).C(t.endPoint,e.reversePoint,e.startPoint).toString("split-path")),this.segmentManager.addLine(t.startPoint,t.endPoint).addLine(e.startPoint,e.reversePoint).addCurvePoint(t.endPoint,t.index,"endPoint").addCurvePoint(e.reversePoint,r,"reversePoint")):(this.pathStringManager.C(t.endPoint,e.reversePoint,e.startPoint),this.splitLines.push((new Dd).M(t.startPoint).C(t.endPoint,e.reversePoint,e.startPoint).toString("split-path")),this.segmentManager.addLine(t.startPoint,t.endPoint).addLine(e.startPoint,e.reversePoint).addCurvePoint(e.startPoint,r,"startPoint").addCurvePoint(t.endPoint,t.index,"endPoint").addCurvePoint(e.reversePoint,r,"reversePoint"))}},{key:"makePointGuide",value:function(t){for(var e=0,n=t.length;e")}},{key:"toSVGString",value:function(){return'\n \n '.concat(this.makeSelectedSVGZone(),"\n ").concat(this.guideLineManager.toString("guide"),"\n ").concat(this.pathStringManager.toString("object"),"\n ").concat(this.splitLines.join(""),"\n ").concat(this.makeSnapLines(),"\n ").concat(this.segmentManager.toString(),"\n \n ")}},{key:"state",get:function(){return this.pathEditor.state}},{key:"clonePoints",get:function(){return wb(this.state.points)}}])&&Sb(e.prototype,n),r&&Sb(e,r),t}();function xb(t){return(xb="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function Tb(t){for(var e=1;e0&&void 0!==arguments[0]?arguments[0]:{};return $b(Rb(e.prototype),"getDefaultObject",this).call(this,Tb({itemType:"svg",name:"New SVG",elementType:"svg",overflow:"visible",stroke:"black","stroke-width":1,fill:"transparent","fill-rule":"","fill-opacity":"","stroke-linecap":"","stroke-linejoin":"","stroke-dashoffset":"","stroke-dasharray":" ","motion-based":!1},t))}},{key:"toCloneObject",value:function(){var t=this.json;return Tb({},$b(Rb(e.prototype),"toCloneObject",this).call(this),{overflow:t.overflow,stroke:t.stroke,"stroke-width":t["stroke-width"],fill:t.fill,"fill-rule":t["fill-rule"],"fill-opacity":t["fill-opacity"],"stroke-linecap":t["stroke-linecap"],"stroke-linejoin":t["stroke-linejoin"],"stroke-dashoffset":t["stroke-dashoffset"],"stroke-dasharray":t["stroke-dasharray"],"motion-based":t["motion-based"]})}},{key:"toSVGDefaultCSS",value:function(){return this.json["motion-based"]?{fill:"transparent","fill-opacity":1,"marker-start":"url(#start)","marker-end":"url(#head)",stroke:"rgba(0, 0, 0, 0.2)"}:Tb({},this.toKeyListCSS("stroke","stroke-width","stroke-linecap","stroke-linejoin","stroke-dasharray","stroke-dashoffset","fill","fill-opacity","fill-rule"))}},{key:"getDefaultTitle",value:function(){return"SVG"}}])&&Eb(n.prototype,r),o&&Eb(n,o),e}();function Ab(t){return Lb(t)||function(t){if(Symbol.iterator in Object(t)||"[object Arguments]"===Object.prototype.toString.call(t))return Array.from(t)}(t)||Mb()}function Db(t,e){return Lb(t)||function(t,e){var n=[],r=!0,o=!1,i=void 0;try{for(var a,c=t[Symbol.iterator]();!(r=(a=c.next()).done)&&(n.push(a.value),!e||n.length!==e);r=!0);}catch(t){o=!0,i=t}finally{try{r||null==c.return||c.return()}finally{if(o)throw i}}return n}(t,e)||Mb()}function Mb(){throw new TypeError("Invalid attempt to destructure non-iterable instance")}function Lb(t){if(Array.isArray(t))return t}function Bb(t,e){for(var n=0;n1&&void 0!==arguments[1]&&arguments[1],r=Db(e.split("data:"),2),o=(r[0],Ab(r[1].split(","))),i=o[0],a=o.slice(1),c=Db(i.split(";"),2),u=c[0],s=c[1];return a=a.join(","),{mimeType:u,local:n&&t.getLink(u,s,a)}}},{key:"getLink",value:function(t,e,n){if("base64"===e){for(var r=atob(n),o=r.length,i=new Uint8Array(o),a=0;a-1&&(n[e.local]=e.original)}),Object.keys(n).forEach(function(e){t.indexOf(e)>-1&&(t=t.replace(new RegExp(e,"g"),n[e]))}),t},Ub=function(t){var e,n,r,o=JSON.stringify(t);return e=o,n=ta.projects,r={},n.forEach(function(t){t.images.forEach(function(t){e.indexOf(t.local)>-1&&(r[t.local]="#"+t.id)})}),Object.keys(r).forEach(function(t){e.indexOf(t)>-1&&(e=e.replace(new RegExp(t,"g"),r[t]))}),o=e},Zb=function(t){var e=JSON.parse(t||"[]"),n={};return e.forEach(function(t){t.images.forEach(function(t){n["#".concat(t.id)]=t})}),Object.keys(n).map(function(t){var e=n[t],r=zb.parse(e.original,!0);e.local=r.local}),e.forEach(function(t){t.layers=function t(e,n){return C(e)?e=e.map(function(e){return t(e,n)}):I(e)?Object.keys(e).forEach(function(r){e[r]=t(e[r],n)}):R(e)&&Object.keys(n).forEach(function(t){var r=n[t];e.indexOf("#".concat(r.id))>-1&&(e=e.replace(new RegExp("#".concat(r.id),"g"),r.local))}),e}(t.layers,n)}),e};function qb(t){return(qb="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function Jb(t){for(var e=1;e0&&void 0!==arguments[0]?arguments[0]:{};return ng(rg(e.prototype),"getDefaultObject",this).call(this,Jb({itemType:"svg-path",name:"New Path",d:"",segments:[],totalLength:0},t))}},{key:"enableHasChildren",value:function(){return!1}},{key:"updatePathItem",value:function(t){this.json.d=t.d,this.json.totalLength=t.totalLength,this.json.path=new Id(t.d),t.segments&&this.json.path.resetSegment(t.segments)}},{key:"updateFunction",value:function(t){this.json.totalLength=t.$("path").el.getTotalLength()}},{key:"setCache",value:function(){this.rect=this.clone(),this.cachePath=this.json.path.clone()}},{key:"recover",value:function(){var t=this.json.width.value/this.rect.width.value,e=this.json.height.value/this.rect.height.value;this.scale(t,e)}},{key:"scale",value:function(t,e){this.json.d=this.cachePath.clone().scaleTo(t,e),this.json.path.reset(this.json.d)}},{key:"convert",value:function(t){return(t=ng(rg(e.prototype),"convert",this).call(this,t)).d&&(t.path=new Id(t.d)),t}},{key:"toCloneObject",value:function(){var t=this.json;return Jb({},ng(rg(e.prototype),"toCloneObject",this).call(this),{totalLength:t.totalLength,d:t.d,segments:M(this.json.segments)})}},{key:"getDefaultTitle",value:function(){return"Path"}},{key:"toNestedCSS",value:function(){this.json;return[{selector:"path",css:Jb({},ng(rg(e.prototype),"toSVGDefaultCSS",this).call(this))}]}},{key:"toAnimationKeyframes",value:function(t){var e=t.filter(function(t){return Nb(t.property)}),n=t.filter(function(t){return Kb(t.property)});return[{selector:'[data-id="'.concat(this.json.id,'"]'),properties:n},{selector:'[data-id="'.concat(this.json.id,'"] path'),properties:e}]}},{key:"updateFunction",value:function(t){var e=t.$("path");e.attr("d",this.json.d),this.json.totalLength=e.el.getTotalLength()}},{key:"html",get:function(){var t=this.json.id;return"')}}])&&tg(n.prototype,r),o&&tg(n,o),e}();function ag(t){return(ag="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function cg(t){return function(t){if(Array.isArray(t)){for(var e=0,n=new Array(t.length);e"}},{key:"isShow",value:function(){return this.state.isShow}},{key:Ne("document")+pn("isShow")+hn("Escape")+hn("Enter")+kn+On,value:function(){if(this.state.current)this.refreshPathLayer();else{var t=this.refs.$view.$("path.object").rect();t.x-=this.state.rect.x,t.y-=this.state.rect.y,this.addPathLayer(t)}this.trigger("hidePathEditor")}},{key:"makePathLayer",value:function(t){var e,n=this.refs.$view.$("path.object").el.getTotalLength(),r=this.pathGenerator.toPath(t.x,t.y,this.scale).d,o=ta.selection.currentArtboard;if(o){var i=t.x/this.scale,a=t.y/this.scale,c=t.width/this.scale,u=t.height/this.scale;(e=o.add(new ig({width:Te.px(c),height:Te.px(u),d:r,totalLength:n}))).setScreenX(i),e.setScreenY(a)}return e}},{key:"updatePathLayer",value:function(){var t=this.refs.$view.$("path.object").el.getTotalLength(),e=this.pathGenerator.toPath(this.state.screenX.value*this.scale,this.state.screenY.value*this.scale,this.scale).d;this.emit(this.state.changeEvent,{d:e,totalLength:t})}},{key:"addPathLayer",value:function(t){this.changeMode("modify");var e=this.makePathLayer(t);e&&(ta.selection.select(e),this.emit("refreshAll"),this.emit("refreshSelection"))}},{key:"changeMode",value:function(t,e){this.setState(function(t){for(var e=1;e0&&void 0!==arguments[0]?arguments[0]:"draw",e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};"move"===t?(e.current=null,e.points=[]):e.current||(e.current=null),this.changeMode(t,e),this.refresh(e),this.state.isShow=!0,this.$el.show(),this.$el.focus(),this.emit("showPathManager",{mode:this.state.mode})}},{key:cr("hidePathEditor"),value:function(){this.pathParser.reset(""),this.setState(this.initState(),!1),this.refs.$view.empty(),this.$el.hide(),this.emit("finishPathEdit"),this.emit("hidePathManager")}},{key:cr("hideSubEditor"),value:function(){}},{key:Pn("$view"),value:function(){return{class:{draw:"draw"===this.state.mode,modify:"modify"===this.state.mode,"segment-move":"segment-move"===this.state.mode},innerHTML:this.pathGenerator.makeSVGPath()}}},{key:"getXY",value:function(t){var e=ug(t,2);return{x:e[0],y:e[1]}}},{key:Ge("$view .split-path"),value:function(t){var e=new Id(t.$delegateTarget.attr("d")),n={x:t.xy.x-this.state.rect.x,y:t.xy.y-this.state.rect.y};if("C"===e.segments[1].command){var r=[this.getXY(e.segments[0].values),this.getXY(e.segments[1].values.slice(0,2)),this.getXY(e.segments[1].values.slice(2,4)),this.getXY(e.segments[1].values.slice(4,6))],o=function(t,e,n,r){var o=arguments.length>4&&void 0!==arguments[4]?arguments[4]:100;return ah(eh(t,e,n,r),o)}.apply(void 0,cg(r).concat([200]))(n.x,n.y);this.changeMode("modify"),this.pathGenerator.setPoint(function(t,e){var n=sh(t[0],t[1],e),r=sh(t[1],t[2],e),o=sh(t[2],t[3],e),i=sh(n,r,e),a=sh(r,o,e),c=sh(i,a,e);return{first:[t[0],n,i,c],second:[c,a,o,t[3]]}}(r,o))}else if("Q"===e.segments[1].command){r=[this.getXY(e.segments[0].values),this.getXY(e.segments[1].values.slice(0,2)),this.getXY(e.segments[1].values.slice(2,4))],o=function(t,e,n){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:100;return ah(nh(t,e,n),r)}.apply(void 0,cg(r).concat([200]))(n.x,n.y);this.changeMode("modify"),this.pathGenerator.setPointQuard(function(t,e){var n=sh(t[0],t[1],e),r=sh(t[1],t[2],e),o=sh(n,r,e);return{first:[t[0],n,o],second:[o,r,t[2]]}}(r,o))}else if("L"===e.segments[1].command){r=[this.getXY(e.segments[0].values),this.getXY(e.segments[1].values.slice(0,2))],o=ch.apply(void 0,cg(r).concat([200]))(n.x,n.y);this.changeMode("modify"),this.pathGenerator.setPointLine(hh(r,o))}this.bindData("$view"),this.refreshPathLayer()}},{key:"refreshPathLayer",value:function(){this.updatePathLayer()}},{key:on("$view")+kn,value:function(t){this.isMode("draw")&&this.state.rect&&(this.state.moveXY={x:t.xy.x-this.state.rect.x,y:t.xy.y-this.state.rect.y},this.state.altKey=t.altKey,this.bindData("$view"))}},{key:He("$view [data-segment]"),value:function(t){this.state.$target=t.$delegateTarget;var e=+this.state.$target.attr("data-index");this.pathGenerator.convertToCurve(e),this.bindData("$view"),this.refreshPathLayer()}},{key:rn("$view :not(.split-path)")+mn()+wn(),value:function(t){if(this.state.rect=this.parent.refs.$body.rect(),this.state.canvasOffset=this.refs.$view.rect(),this.state.altKey=!1,this.state.dragXY={x:t.xy.x-this.state.rect.x,y:t.xy.y-this.state.rect.y},this.state.$target=Re.create(t.target),this.state.isSegment="true"===this.state.$target.attr("data-segment"),this.state.isFirstSegment=this.state.isSegment&&"true"===this.state.$target.attr("data-is-first"),this.state.isSegment)if(this.state.isFirstSegment&&this.isMode("draw")){var e=+this.state.$target.attr("data-index");this.state.startPoint=this.state.points[e].startPoint,this.state.dragPoints=!1,this.state.endPoint=null}else{this.changeMode("segment-move");e=+this.state.$target.attr("data-index");this.pathGenerator.setCachePoint(e)}else this.isMode("draw")&&(this.state.startPoint=this.state.dragXY,this.state.dragPoints=!1,this.state.endPoint=null)}},{key:"move",value:function(t,e){if(this.isMode("segment-move"))this.pathGenerator.move(t,e,ta.config.get("bodyEvent")),this.bindData("$view"),this.updatePathLayer();else if(this.isMode("draw")){var n=ta.config.get("bodyEvent");this.state.dragPoints=!n.altKey}}},{key:"end",value:function(t,e){if(this.state.$target.is(this.refs.$view)&&ta.config.get("bodyEvent").altKey)return this.changeMode("modify"),void this.trigger("hidePathEditor");if(this.isMode("segment-move"))this.changeMode("modify");else if(this.isMode("draw"))if(this.state.isFirstSegment)if(this.changeMode("modify"),this.pathGenerator.setConnectedPoint(t,e),this.bindData("$view"),this.state.current)this.refreshPathLayer();else{var n=this.refs.$view.$("path.object").rect();n.x-=this.state.rect.x,n.y-=this.state.rect.y,this.addPathLayer(n),this.trigger("hidePathEditor")}else this.pathGenerator.moveEnd(t,e),this.bindData("$view")}},{key:"scale",get:function(){return ta.scale}}])&&lg(n.prototype,r),o&&lg(n,o),e}();function vg(t){return function(t){if(Array.isArray(t)){for(var e=0,n=new Array(t.length);ee.dist?-1:1});var i=null;return o.length&&(n+=(i=o[0].point)[t]-e),{point:i,distanceValue:n}}},{key:"calculateSnap",value:function(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1,r=this.state.originalSegment,o=r.x+t,i=r.y+e,a=this.calculateSnapPoint("x",o,t,n),c=a.point,u=(t=a.distanceValue,this.calculateSnapPoint("y",i,e,n)),s=u.point,l=(e=u.distanceValue,{x:r.x+t,y:r.y+e}),f=[];return c&&f.push({startPoint:c,endPoint:l}),s&&f.push({startPoint:s,endPoint:l}),{dx:t,dy:e,snapPointList:f}}},{key:"calculatePointDist",value:function(t,e,n){var r=this.state,o=[];return r.segments.forEach(function(r){var i=Math.abs(r[t]-e);i<=n&&o.push({dist:i,point:r})}),o.sort(function(t,e){return t.dist>e.dist?1:-1}),o.length?o[0].point:null}},{key:"calculateMovePointSnap",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1,n=this.calculatePointDist("x",t.x,e),r=this.calculatePointDist("y",t.y,e),o=function(t){for(var e=1;e2&&void 0!==arguments[2]?arguments[2]:1;return{points:this.cloneSegments.map(function(r){var o=(r.x-t)/n,i=(r.y-e)/n;return"".concat(o," ").concat(i)}).join(" ")}}},{key:"makeSVGPath",value:function(){return this.initialize(),this.makeMoveGuide(this.cloneSegments),this.makeMovePositionGuide(),this.toSVGString()}},{key:"makeMoveGuide",value:function(t){var e=this;this.points=[],t.forEach(function(n,r){var o=0===r;e.points.push(n),e.splitLines.push((new Dd).M(Td.getPrevPoint(t,r)).L(n).toString("split-path")),e.segmentManager.addPoint({isFirst:o},n,r)})}},{key:"makeMovePositionGuide",value:function(){var t=this.state,e=t.moveXY,n=t.snapPointList;if(e){var r;n=n||[];var o=this.calculateMovePointSnap(e,2),i=o.snapPointList,a=o.moveXY;(r=n).push.apply(r,vg(i)),t.moveXY=a,this.snapPointList=n,this.points.push(t.moveXY),this.segmentManager.addStartPoint({},t.dragXY)}}},{key:"makeSnapLines",value:function(){var t=[];if(this.snapPointList){var e=new Dd;t=this.snapPointList.map(function(t){return e.reset(),e.M(t.startPoint).L(t.endPoint).toString("snap-path")})}return t.join("")}},{key:"makeSelectedSVGZone",value:function(){var t=this.state,e=t.screenX,n=t.screenY,r=t.screenWidth,o=t.screenHeight,i=this.polygonEditor.scale,a=e.value*i,c=n.value*i,u=r.value*i,s=o.value*i;return"")}},{key:"toSVGString",value:function(){return'\n \n '.concat(this.makeSelectedSVGZone(),"\n \n ').concat(this.makeSnapLines(),"\n ").concat(this.splitLines.join("")," \n ").concat(this.segmentManager.toString(),"\n \n ")}},{key:"state",get:function(){return this.polygonEditor.state}},{key:"cloneSegments",get:function(){return vg(this.state.segments)}}])&&gg(e.prototype,n),r&&gg(e,r),t}();function wg(t){return(wg="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function kg(t){for(var e=1;e0&&void 0!==arguments[0]?arguments[0]:{};return Pg(xg(e.prototype),"getDefaultObject",this).call(this,kg({itemType:"svg-polygon",name:"New Polygon",points:"",totalLength:0},t))}},{key:"enableHasChildren",value:function(){return!1}},{key:"updatePolygonItem",value:function(t){this.json.points=t.points,this.json.totalLength=t.totalLength,this.json.polygon=new Xd(t.points)}},{key:"setCache",value:function(){this.rect={width:this.json.width.clone(),height:this.json.height.clone()},this.cachePolygon=this.json.polygon.clone()}},{key:"recover",value:function(){var t=this.json.width.value/this.rect.width.value,e=this.json.height.value/this.rect.height.value;this.scale(t,e)}},{key:"scale",value:function(t,e){this.json.points=this.cachePolygon.clone().scaleTo(t,e),this.json.polygon.reset(this.json.points)}},{key:"convert",value:function(t){return(t=Pg(xg(e.prototype),"convert",this).call(this,t)).points&&(t.polygon=new Xd(t.points)),t}},{key:"toCloneObject",value:function(){var t=this.json;return kg({},Pg(xg(e.prototype),"toCloneObject",this).call(this),{totalLength:t.totalLength,points:t.points})}},{key:"getDefaultTitle",value:function(){return"Polygon"}},{key:"toNestedCSS",value:function(){return[{selector:"polygon",css:Pg(xg(e.prototype),"toSVGDefaultCSS",this).call(this)}]}},{key:"updateFunction",value:function(t){var e=t.$("polygon");e.attr("points",this.json.points),this.json.totalLength=e.el.getTotalLength()}},{key:"toAnimationKeyframes",value:function(t){var e=t.filter(function(t){return hasSVGProperty(t.property)});return[{properties:t.filter(function(t){return hasCSSProperty(t.property)}),selector:'[data-id="'.concat(this.json.id,'"]')},{properties:e,selector:'[data-id="'.concat(this.json.id,'"] polygon')}]}},{key:"d",get:function(){return this.json.polygon.toPathString()}},{key:"html",get:function(){var t=this.json,e=t.id,n=t.points;return"')}}])&&Sg(n.prototype,r),o&&Sg(n,o),e}();function Eg(t){return(Eg="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function Cg(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var n=[],r=!0,o=!1,i=void 0;try{for(var a,c=t[Symbol.iterator]();!(r=(a=c.next()).done)&&(n.push(a.value),!e||n.length!==e);r=!0);}catch(t){o=!0,i=t}finally{try{r||null==c.return||c.return()}finally{if(o)throw i}}return n}(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance")}()}function $g(t){for(var e=1;e"}},{key:"isStarMode",value:function(){return this.isMode("star")}},{key:"isShow",value:function(){return this.state.isShow}},{key:Ne()+hn(1)+hn(2)+pn("isStarMode")+kn+On,value:function(t){var e=1;"1"===t.key&&(e=-1),this.state.starCount+=e,this.refreshStar(),this.emit("changeStarManager",this.state.starCount,this.state.starInnerRadiusRate)}},{key:"refreshStar",value:function(){this.polygonGenerator.refreshStar(),this.bindData("$view"),this.updatePolygonLayer()}},{key:Ne()+hn(3)+hn(4)+pn("isStarMode")+kn+On,value:function(t){var e=.1;"3"===t.key&&(e=-.1),this.state.starInnerRadiusRate+=e,this.refreshStar(),this.emit("changeStarManager",this.state.starCount,this.state.starInnerRadiusRate)}},{key:Ne("document")+pn("isShow")+hn("Escape")+hn("Enter")+kn,value:function(t){this.state.current?this.refreshPolygonLayer():this.addPolygonLayer(this.getViewRect()),this.trigger("hidePolygonEditor")}},{key:"makePolygonLayer",value:function(t){var e,n=this.refs.$view.$("polygon.object").el.getTotalLength(),r=this.polygonGenerator.toPolygon(t.x,t.y,this.scale).points,o=ta.selection.currentArtboard;if(o){var i=t.x/this.scale,a=t.y/this.scale,c=t.width/this.scale,u=t.height/this.scale;(e=o.add(new _g({width:Te.px(c),height:Te.px(u),points:r,totalLength:n}))).setScreenX(i),e.setScreenY(a)}return e}},{key:"updatePolygonLayer",value:function(){var t=this.refs.$view.$("polygon.object").el.getTotalLength(),e=this.polygonGenerator.toPolygon(this.state.screenX.value*this.scale,this.state.screenY.value*this.scale,this.scale).points;this.emit("updatePolygonItem",{points:e,totalLength:t})}},{key:"addPolygonLayer",value:function(t){this.changeMode("modify");var e=this.makePolygonLayer(t);e&&(ta.selection.select(e),this.state.segments=[],this.polygonParser.reset(""),this.bindData("$view"),this.emit("refreshAll"),this.emit("refreshSelection"))}},{key:"changeMode",value:function(t,e){this.setState($g({mode:t,moveXY:null},e),!1)}},{key:"isMode",value:function(t){return this.state.mode===t}},{key:cr("changeScale"),value:function(){this.refresh()}},{key:"refresh",value:function(t){t&&t.points?(this.polygonParser.reset(t.points),this.polygonParser.scale(this.scale,this.scale),this.polygonParser.translate(t.screenX.value*this.scale,t.screenY.value*this.scale),this.state.segments=this.polygonParser.convertGenerator()):this.state.segments=[],this.bindData("$view")}},{key:cr("showPolygonEditor"),value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"draw",e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};"move"===t?e.current=null:e.current||(e.current=null);var n=$g({},e,{points:e.points||""});this.changeMode(t,e),this.refresh(n),this.state.isShow=!0,this.$el.show(),this.$el.focus(),"star"===t?(this.emit("showStarManager",{changeEvent:"changeStarManager",count:this.state.starCount,radius:this.state.starInnerRadiusRate}),this.emit("hidePolygonManager")):(this.emit("showPolygonManager",{mode:this.state.mode}),this.emit("hideStarManager"))}},{key:cr("changeStarManager"),value:function(t,e){this.state.starCount=t,this.state.starInnerRadiusRate=e,this.refreshStar()}},{key:cr("hidePolygonEditor"),value:function(){this.polygonParser.reset(""),this.setState(this.initState(),!1),this.refs.$view.empty(),this.$el.hide(),this.emit("hideStarManager"),this.emit("hidePolygonManager"),this.emit("finishPolygonEdit")}},{key:cr("hideSubEditor"),value:function(){}},{key:Pn("$view"),value:function(){return{class:{draw:"draw"===this.state.mode,modify:"modify"===this.state.mode,"segment-move":"segment-move"===this.state.mode},innerHTML:this.polygonGenerator.makeSVGPath()}}},{key:"getXY",value:function(t){var e=Cg(t,2);return{x:e[0],y:e[1]}}},{key:Ge("$view .split-path"),value:function(t){var e=new Id(t.$delegateTarget.attr("d")),n={x:t.xy.x-this.state.rect.x,y:t.xy.y-this.state.rect.y},r=[this.getXY(e.segments[0].values),this.getXY(e.segments[1].values.slice(0,2))],o=ch.apply(void 0,r.concat([200]))(n.x,n.y);this.polygonGenerator.setPointLine(hh(r,o)),this.changeMode("modify"),this.bindData("$view"),this.refreshPolygonLayer()}},{key:"getViewRect",value:function(){var t=this.refs.$view.$("polygon.object").rect();return t.x-=this.state.rect.x,t.y-=this.state.rect.y,t}},{key:"refreshPolygonLayer",value:function(){this.updatePolygonLayer(this.getViewRect())}},{key:on("$view")+kn,value:function(t){this.isMode("draw")&&this.state.rect&&(this.state.moveXY={x:t.xy.x-this.state.rect.x,y:t.xy.y-this.state.rect.y},this.state.altKey=t.altKey,this.bindData("$view"))}},{key:rn("$view :not(.split-path)")+mn()+wn(),value:function(t){if(this.state.rect=this.parent.refs.$body.rect(),this.state.canvasOffset=this.refs.$view.rect(),this.state.altKey=!1,this.state.dragXY={x:t.xy.x-this.state.rect.x,y:t.xy.y-this.state.rect.y},this.$el.focus(),this.state.$target=Re.create(t.target),this.state.isSegment="true"===this.state.$target.attr("data-segment"),this.state.isSegment){this.changeMode("segment-move");var e=+this.state.$target.attr("data-index");this.polygonGenerator.setCachePoint(e)}else this.isMode("star")?this.polygonGenerator.moveStart():this.isMode("draw")}},{key:"move",value:function(t,e){this.isMode("star")?(this.polygonGenerator.moveStar(t,e,ta.config.get("bodyEvent")),this.bindData("$view")):this.isMode("segment-move")?(this.polygonGenerator.move(t,e,ta.config.get("bodyEvent")),this.bindData("$view"),this.updatePolygonLayer()):this.isMode("draw")||this.isMode("move")}},{key:"end",value:function(t,e){if(this.state.$target.is(this.refs.$view)&&ta.config.get("bodyEvent").altKey)return this.trigger("hidePolygonEditor"),void this.changeMode("modify");this.isMode("segment-move")?this.changeMode("modify"):this.isMode("star")?(this.polygonGenerator.moveEndStar(t,e),this.bindData("$view")):this.isMode("draw")&&(this.polygonGenerator.moveEnd(t,e),this.bindData("$view"))}},{key:"scale",get:function(){return ta.scale}}])&&Vg(n.prototype,r),o&&Vg(n,o),e}();function Bg(t){return(Bg="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function zg(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var n=[],r=!0,o=!1,i=void 0;try{for(var a,c=t[Symbol.iterator]();!(r=(a=c.next()).done)&&(n.push(a.value),!e||n.length!==e);r=!0);}catch(t){o=!0,i=t}finally{try{r||null==c.return||c.return()}finally{if(o)throw i}}return n}(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance")}()}function Fg(t){return function(t){if(Array.isArray(t)){for(var e=0,n=new Array(t.length);e\n
\n
\n \n \n \n \n \n "}},{key:cr("after.change.mode"),value:function(){this.$el.attr("data-mode",ta.mode)}},{key:cr("hideSubEditor"),value:function(t){this.children.$pathEditorView.$el.hide(),this.children.$polygonEditorView.$el.hide()}},{key:"getElement",value:function(t){return this.refs.$view.$('[data-id="'.concat(t,'"]'))}},{key:"checkEmptyElement",value:function(t){var e=Re.create(t.target);return!!ta.isAddMode()||"selection"===this.state.mode&&(!1===e.hasClass("element-item")&&!1===e.hasClass("selection-tool-item")&&!1===e.hasClass("path-editor-view")&&!1===e.hasClass("polygon-editor-view")&&!1===e.hasClass("point")&&!1===e.hasClass("perspective-handle")&&!1===e.isTag("svg")&&!1===e.isTag("path")&&!1===e.isTag("polygon")&&"true"!==e.attr("data-segment"))}},{key:rn("$el")+pn("checkEmptyElement")+mn("movePointer")+wn("moveEndPointer"),value:function(t){if(this.$target=Re.create(t.target),this.dragXY={x:t.xy.x,y:t.xy.y},this.rect=this.refs.$body.rect(),this.canvasOffset=this.refs.$view.rect(),this.canvasPosition={x:this.canvasOffset.left-this.rect.x,y:this.canvasOffset.top-this.rect.y},this.dragXY.x-=this.rect.x,this.dragXY.y-=this.rect.y,ta.isSelectionMode()){var e={left:Te.px(this.dragXY.x),top:Te.px(this.dragXY.y),width:Te.px(0),height:Te.px(0)};this.refs.$dragAreaRect.css(e),ta.selection.empty(),this.cachedCurrentElement={},this.$el.$$(".selected").forEach(function(t){return t.removeClass("selected")}),this.emit("initSelectionTool")}}},{key:"movePointer",value:function(t,e){var n={left:Te.px(this.dragXY.x+(t<0?t:0)),top:Te.px(this.dragXY.y+(e<0?e:0)),width:Te.px(Math.abs(t)),height:Te.px(Math.abs(e))};if(this.refs.$dragAreaRect.css(n),ta.isSelectionMode()){var r,o=n.left,i=n.top,a=n.width,c=n.height,u={x:Te.px(o.value-this.canvasPosition.x),y:Te.px(i.value-this.canvasPosition.y),width:a,height:c};u.x2=Te.px(u.x.value+u.width.value),u.y2=Te.px(u.y.value+u.height.value);var s=ta.selection.currentArtboard;if(s){var l;Object.keys(u).forEach(function(t){u[t].div(ta.scale)});var f=s.checkInAreaForLayers(u);(l=ta.selection).select.apply(l,Fg(f)),this.selectCurrentForBackgroundView.apply(this,Fg(f))}(r=ta.selection).select.apply(r,Fg(f)),this.emit("refreshSelection")}}},{key:"moveEndPointer",value:function(t,e){var n=zg(this.refs.$dragAreaRect.styles("left","top","width","height").map(function(t){return Te.parse(t)}),4),r=n[0],o=n[1],i=n[2],a=n[3],c={x:Te.px(r.value-this.canvasPosition.x),y:Te.px(o.value-this.canvasPosition.y),width:i,height:a};if(c.x2=Te.px(c.x.value+c.width.value),c.y2=Te.px(c.y.value+c.height.value),this.refs.$dragAreaRect.css({left:Te.px(-1e4),top:Te.px(0),width:Te.px(0),height:Te.px(0)}),ta.isSelectionMode()){var u,s=ta.selection.currentArtboard,l=[];if(s)Object.keys(c).forEach(function(t){c[t].div(ta.scale)}),l=s.checkInAreaForLayers(c),0===c.width.value&&0===c.height.value&&l.length&&(l=[l.pop()]),0===l.length&&s.checkInArea(c)&&(l=[s]),(u=ta.selection).select.apply(u,Fg(l)),this.selectCurrentForBackgroundView.apply(this,Fg(l)),l.length?this.emit("refreshSelection"):(ta.selection.select(),this.emit("emptySelection"));else ta.selection.select(),this.emit("emptySelection")}else{var f={x:Te.px(c.x.value/ta.scale),y:Te.px(c.y.value/ta.scale),width:Te.px(c.width.value/ta.scale),height:Te.px(c.height.value/ta.scale)};"image"===ta.addType?this.emit("addImage",f):this.emit("new.layer",ta.addType,f)}}},{key:Ne("$view .element-item.text"),value:function(t){var e=t.$delegateTarget.html(),n=t.$delegateTarget.attr("data-id");ta.selection.items.filter(function(t){return t.id===n}).forEach(function(t){t.reset({content:e})}),this.emit("refreshContent")}},{key:"checkEditMode",value:function(){return ta.isSelectionMode()}},{key:rn("$view .element-item")+pn("checkEditMode")+mn("calculateMovedElement")+wn("calculateEndedElement"),value:function(t){if(this.startXY=t.xy,this.$element=t.$delegateTarget,this.$element.hasClass("text")&&this.$element.hasClass("selected"))return!1;if(this.$element.hasClass("selected"));else{var e=this.$element.attr("data-id");ta.selection.selectById(e)}ta.selection.isRelative||(this.selectCurrent.apply(this,Fg(ta.selection.items)),this.emit("refreshSelection"),ta.selection.setRectCache())}},{key:"calculateMovedElement",value:function(t,e){this.children.$selectionTool.refreshSelectionToolView(t,e,"move"),this.updateRealPosition()}},{key:"updateRealPosition",value:function(){var t=this;ta.selection.items.forEach(function(e){var n=e.toBound(),r=n.x,o=n.y,i=n.width,a=n.height,c=t.cachedCurrentElement[e.id];c&&(c.cssText("left: ".concat(r,";top:").concat(o,";width:").concat(i,";height:").concat(a)),e.is("svg-path")&&c.firstChild().cssText("d: path('".concat(e.d,"')")))}),this.emit("refreshRect")}},{key:"updateRealTransform",value:function(){var t=this;ta.selection.items.forEach(function(e){var n=e.transform,r=t.cachedCurrentElement[e.id];r&&r.css({transform:n})}),this.emit("refreshTransform")}},{key:"updateRealTransformWillChange",value:function(){var t=this;ta.selection.items.forEach(function(e){var n=t.cachedCurrentElement[e.id];n&&n.css("will-change","transform")})}},{key:cr("removeRealPosition","removeRealTransform"),value:function(){var t=this;ta.selection.items.forEach(function(e){var n=t.cachedCurrentElement[e.id];n&&(n.cssText(""),e.is("svg-path")&&n.firstChild().cssText(""))})}},{key:"calculateEndedElement",value:function(t,e){this.children.$selectionTool.refreshSelectionToolView(t,e,"move");var n=1===ta.selection.items.length?ta.selection.current:null;this.emit("refreshElement",n),this.emit("removeGuideLine"),this.trigger("removeRealPosition")}},{key:Pn("$body"),value:function(){var t=Te.px(1e4),e=Te.px(1e4);return{"data-mode":ta.mode,style:{position:"relative",width:t,height:e}}}},{key:Pn("$view"),value:function(){return{style:{transform:"scale(".concat(ta.scale,")")},innerHTML:this.state.html}}},{key:cr("addElement"),value:function(){var t=(ta.selection.currentArtboard||{html:""}).html;this.setState({html:t},!1);var e=Re.create("div").html(t);ke(this.refs.$view,e),this.emit("refreshSelectionTool")}},{key:"selectCurrent",value:function(){var t=this;this.cachedCurrentElement={};var e=this.$el.$$(".selected");e&&e.forEach(function(t){return t.removeClass("selected")});for(var n=arguments.length,r=new Array(n),o=0;o"}},{key:Sn("$body"),value:function(){var t=this.state,e=t.min,n=t.max,r=t.step,o=t.label,i=t.type,a=t.removable,c=t.layout,u=+this.state.value.value.toString();isNaN(u)&&(u=0);var s=o?"has-label":"",l=a?"is-removable":"",f=c,p=(+u).toString();return"\n
\n ").concat(o?""):"","\n
\n
\n \n \n
\n
\n \n
\n ")}},{key:"getValue",value:function(){return this.state.value}},{key:"setValue",value:function(t){this.setState({value:Te.parse(t)})}},{key:Ge("$remove"),value:function(t){this.updateData({value:""})}},{key:"updateData",value:function(t){this.setState(t,!1),this.parent.trigger(this.props.onchange,this.props.key,this.state.value,this.props.params)}},{key:Je("$propertyNumber"),value:function(t){var e=+this.getRef("$propertyNumber").value;this.getRef("$property").val(e),this.updateData({value:this.state.value.set(e)})}},{key:Je("$property"),value:function(t){var e=+this.getRef("$property").value;this.getRef("$propertyNumber").val(e),""===this.state.value&&(this.state.value=Te.number(0)),this.updateData({value:this.state.value.set(e)})}}])&&Wg(n.prototype,r),o&&Wg(n,o),e}();function Qg(t){return(Qg="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function tm(t,e){for(var n=0;n\n \n \n
\n \n
\n \n \n\n ')}},{key:cr("changeScaleValue"),value:function(t){this.children.$scale.setValue(100*ta.scale),this.emit("update.scale",t)}},{key:cr("changeRangeEditor"),value:function(t,e){this.trigger("changeScaleValue",e/100)}},{key:Ge("$plus")+kn+On,value:function(){this.trigger("changeScaleValue",1.1*ta.scale)}},{key:Ge("$minus")+kn+On,value:function(){this.trigger("changeScaleValue",.9*ta.scale)}}])&&tm(n.prototype,r),o&&tm(n,o),e}();function im(t){return(im="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function am(t,e){for(var n=0;n\n
\n \n \n \n \n \n \n \n \n \n \n \n \n \n\n \n
\n \n ')}},{key:Pn("$count"),value:function(){return{value:this.state.count}}},{key:Pn("$radius"),value:function(){return{value:this.state.radius}}},{key:"refresh",value:function(){this.load()}},{key:Ge("$c [data-type]"),value:function(t){var e="plus"===t.$delegateTarget.attr("data-type")?1:-1;this.updateData({count:this.state.count+e}),this.refresh()}},{key:Ge("$r [data-type]"),value:function(t){var e="plus"===t.$delegateTarget.attr("data-type")?.1:-.1;this.updateData({radius:this.state.radius+e}),this.refresh()}},{key:cn("$count"),value:function(){var t=+this.refs.$count.value;t<3&&(t=3),this.updateData({count:t}),this.refresh()}},{key:cn("$radius"),value:function(){var t=+this.refs.$radius.value;this.updateData({radius:t})}},{key:"updateData",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};this.setState(t,!1),this.emit(this.state.changeEvent,this.state.count,this.state.radius)}},{key:cr("changeStarManager"),value:function(t,e){this.setState({count:t,radius:e},!1),this.refresh()}},{key:cr("showStarManager"),value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};t.changeEvent=t.changeEvent||"changeStarManager",this.setState(t,!1),this.refresh(),this.$el.show()}},{key:cr("hideStarManager"),value:function(){this.$el.hide()}},{key:cr("hideSubEditor"),value:function(){this.trigger("hideStarManager")}}])&&am(n.prototype,r),o&&am(n,o),e}();function fm(t){return(fm="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function pm(t,e){for(var n=0;n\n
\n \n \n \n \n
\n \n "}},{key:"refresh",value:function(){var t=this.$el.$("[value=".concat(this.state.mode,"]"));t&&t.checked(!0)}},{key:Ge('$el input[type="radio"]'),value:function(t){var e=t.$delegateTarget.value;this.updateData({mode:e})}},{key:"updateData",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};this.setState(t,!1),this.emit(this.state.changeEvent,this.state.mode)}},{key:cr("changePathManager"),value:function(t){this.setState({mode:t},!1),this.refresh()}},{key:cr("showPathManager"),value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};t.changeEvent=t.changeEvent||"changePathManager",this.setState(t,!1),this.refresh(),this.$el.show()}},{key:cr("hidePathManager"),value:function(){this.$el.hide()}},{key:cr("hideSubEditor"),value:function(){this.trigger("hidePathManager")}}])&&pm(n.prototype,r),o&&pm(n,o),e}();function bm(t){return(bm="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function gm(t,e){for(var n=0;n\n
\n \n \n \n \n
\n \n "}},{key:Ge('$el input[type="radio"]'),value:function(t){var e=t.$delegateTarget.value;this.updateData({mode:e})}},{key:"refresh",value:function(){var t=this.$el.$("[value=".concat(this.state.mode,"]"));t&&t.checked(!0)}},{key:"updateData",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};this.setState(t,!1),this.emit(this.state.changeEvent,this.state.mode)}},{key:cr("changePolygonManager"),value:function(t){this.setState({mode:t},!1),this.refresh()}},{key:cr("showPolygonManager"),value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};t.changeEvent=t.changeEvent||"changePolygonManager",this.setState(t,!1),this.refresh(),this.$el.show()}},{key:cr("hidePolygonManager"),value:function(){this.$el.hide()}},{key:cr("hideSubEditor"),value:function(){this.trigger("hidePolygonManager")}}])&&gm(n.prototype,r),o&&gm(n,o),e}();function Sm(t){return(Sm="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function jm(t,e){for(var n=0;n\n \n \n \n \n \n "}}])&&jm(n.prototype,r),o&&jm(n,o),e}();function Em(t){return(Em="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function Cm(t){return function(t){if(Array.isArray(t)){for(var e=0,n=new Array(t.length);e\n
\n
\n \n
\n
\n \n \n \n "}},{key:Ne("$el")+dn+hn("c")+kn,value:function(t){this.emit("copy")}},{key:Ne("$el")+dn+hn("v")+kn,value:function(){this.emit("paste")}},{key:"isNumberKey",value:function(t){return+t.key+""===t.key}},{key:"isNotFormElement",value:function(t){var e=t.target.tagName.toLowerCase();return!1===["input"].includes(e)}},{key:Ne("$el")+pn("isNumberKey")+pn("isNotFormElement")+kn+On,value:function(t){this.emit("keyup.canvas.view",t.key)}},{key:un("$lock")+yn+kn+gn(10),value:function(t){var e=t.deltaY<0?1.1:.9;this.emit("changeScaleValue",ta.scale*e)}},{key:"getScrollTop",value:function(){return this.refs.$lock?this.refs.$lock.scrollTop():0}},{key:"getScrollLeft",value:function(){return this.refs.$lock?this.refs.$lock.scrollLeft():0}},{key:"setScrollTop",value:function(t){this.refs.$lock.setScrollTop(t)}},{key:"addScrollTop",value:function(t){this.setScrollTop(this.getScrollTop()+t)}},{key:"setScrollLeft",value:function(t){this.refs.$lock.setScrollLeft(t)}},{key:"addScrollLeft",value:function(t){this.setScrollLeft(this.getScrollLeft()+t)}},{key:cr("focusCanvasView"),value:function(){this.$el.focus()}},{key:Ne()+pn("Backspace"),value:function(t){Re.create(t.target).attr("contenteditable")||(ta.selection.remove(),this.emit("refreshAllSelectArtBoard"))}},{key:cr("refreshComputedStyle")+bn(100),value:function(t){var e,n=(e=this.refs.$canvas).getComputedStyle.apply(e,Cm(t));this.emit("refreshComputedStyleCode",n)}},{key:"scrollXY",get:function(){return{screenX:Te.px(this.getScrollLeft()),screenY:Te.px(this.getScrollTop())}}},{key:"screenSize",get:function(){return this.refs.$lock?this.refs.$lock.rect():{width:0,height:0}}}])&&$m(n.prototype,r),o&&$m(n,o),e}();function Dm(t){return(Dm="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function Mm(t,e){for(var n=0;n\n
').concat(this.getIconString(),'
\n
').concat(this.getTitle(),"
\n \n ")}},{key:"getClassName",value:function(){return""}},{key:"clickButton",value:function(t){}},{key:"getChecked",value:function(){return!1}},{key:"getTitle",value:function(){return""}},{key:"getIcon",value:function(){return""}},{key:"getIconString",value:function(){return""}},{key:"isHideTitle",value:function(){return!1}},{key:Ge(),value:function(t){this.clickButton(t)}}])&&Mm(n.prototype,r),o&&Mm(n,o),e}();function Gm(t){return(Gm="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function Hm(t,e){for(var n=0;n1&&void 0!==arguments[1]?arguments[1]:"anipa"){case"anipa":return new Zm(t).generateCode()}return""},Jm={makeProjectStyle:function(t){var e=t.toKeyframeString(),n=t.toRootVariableCSS();return"\n :root {\n ".concat(X(n),"\n }\n /* keyframe */\n ").concat(e,"\n ")},makeStyle:function(t){var e=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";if(t.is("project"))return this.makeProjectStyle(t);var r=t.generateView("[data-id='".concat(t.id,"']"),n);return"\n ".concat(r,"\n ")+t.layers.map(function(t){return e.makeStyle(t)}).join("")},makeSvg:function(t){var e=t.toSVGString?t.toSVGString():"";return"\n ".concat(e?''.concat(e,""):"","\n ")},generate:function(){var t=ta.selection.currentProject,e=ta.selection.currentArtboard,n="\n".concat(this.makeStyle(t),"\n").concat(this.makeStyle(e,"\n left: 0px;\n top: 0px;\n")),r="\n".concat(e.html,"\n").concat(this.makeSvg(t),"\n "),o=qm(e,"anipa");return{html:r=Wb(r),css:n=Wb(n),js:o=Wb(o)}}};function Qm(t){return(Qm="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function tw(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function ew(t,e){for(var n=0;n\n \n \n \n '}},{key:nn(),value:function(){var t=Jm.generate();return this.refs.$codepen.val(JSON.stringify(function(t){for(var e=1;e\n \n \n \n \n \n \n \n \n '}},{key:nn(),value:function(){this.refs.$title.val("sapa - editor.easylogic.studio"),this.refs.$description.val("https://editor.easylogic.studio");var t=Jm.generate(),e=["https://cdn.jsdelivr.net/npm/@easylogic/anipa@0.0.3/dist/main.js"].join(",");return this.refs.$html.val(t.html),this.refs.$css.val(t.css),this.refs.$resources.val(e),!1}}])&&cw(n.prototype,r),o&&cw(n,o),e}();function pw(t){return(pw="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function hw(t,e){for(var n=0;n1&&(ta.selection.each(function(t){t.setScreenX(ta.selection.allRect.x.value),t.width.set(ta.selection.allRect.width.value)}),ta.selection.setRectCache())}},{key:"sameHeight",value:function(){var t=ta.selection.items.length;1==t||t>1&&(ta.selection.each(function(t){t.setScreenY(ta.selection.allRect.y.value),t.height.set(ta.selection.allRect.height.value)}),ta.selection.setRectCache())}}],(n=null)&&jw(e.prototype,n),r&&jw(e,r),t}();function xw(t){return(xw="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function Tw(t,e){for(var n=0;n\n
\n
\n \x3c!----\x3e\n \n \n \n \n \n \x3c!-- AddSphere / --\x3e\n
\n \x3c!----\x3e\n \n \n \n \x3c!-- --\x3e\n
\n
\n\n \n "}},{key:cr("noneSelectMenu"),value:function(){var t=this.refs.$items.$(".selected");t&&t.removeClass("selected")}},{key:Ge("$items button"),value:function(t){t.$delegateTarget.onlyOneClass("selected")}}])&&YO(n.prototype,r),o&&YO(n,o),e}();function ZO(t){return(ZO="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function qO(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function JO(t){return function(t){if(Array.isArray(t)){for(var e=0,n=new Array(t.length);e\n
\n \n
\n \n
\n
\n
\n \n ")}},{key:"getColorStepList",value:function(t){switch(t.type){case"static-gradient":case"linear-gradient":case"repeating-linear-gradient":case"radial-gradient":case"repeating-radial-gradient":case"conic-gradient":case"repeating-conic-gradient":return this.getColorStepString(t.colorsteps)}return""}},{key:"getColorStepString",value:function(t){return t.map(function(t,e){return"\n
\n
\n
\n ")}).join("")}},{key:Sn("$fillList"),value:function(){var t=this;return this.state.images.map(function(e,n){var r=e.image,o=oS[r.type],i=rS[r.type],a="background-image: ".concat(r.toString(),"; background-size: cover;"),c=e.selected?"selected":"";return e.selected&&(t.selectedIndex=n),"\n
\n
\n
\n
\n
\n
\n
\n
\n
').concat(i,"
\n
\n ').concat(t.getColorStepList(r),"\n
\n
\n \n
\n
\n
\n
\n ")})}},{key:"modifyBackgroundImage",value:function(){var t=X(uy.toPropertyCSS(this.state.images));this.parent.trigger(this.props.onchange,t)}},{key:cr("add"),value:function(){this.state.images.push(new uy),this.refresh(),this.modifyBackgroundImage()}},{key:Ge("$add"),value:function(){this.trigger("add")}},{key:Ge("$fillList .colorsteps .step"),value:function(t){this.getRef("colorsteps",this.selectedIndex).$('[data-selected="true"]').removeAttr("data-selected"),t.$delegateTarget.attr("data-selected",!0);var e=t.$delegateTarget.attr("data-index"),n=t.$delegateTarget.closest("fill-item").$(".preview");this.viewFillPopup(n,e)}},{key:Ke("$fillList .fill-item"),value:function(t){this.startIndex=+t.$delegateTarget.attr("data-index")}},{key:Ue("$fillList .fill-item")+kn,value:function(t){}},{key:"sortItem",value:function(t,e,n){t.splice.apply(t,[n+(e1&&void 0!==arguments[1])||arguments[1]?this.refs["fillIndex".concat(t)].addClass("selected"):this.refs["fillIndex".concat(t)].removeClass("selected"),this.state.images.forEach(function(e,n){e.selected=n===t})}},{key:"viewFillPopup",value:function(t,e){"number"==typeof this.selectedIndex&&this.selectItem(this.selectedIndex,!1),this.selectedIndex=+t.attr("data-index"),this.selectItem(this.selectedIndex,!0),this.currentBackgroundImage=this.getCurrentBackgroundImage();var n=this.currentBackgroundImage,r=n.x,o=n.y,i=n.width,a=n.height,c=n.repeat,u=n.size,s=n.blendMode;this.emit("showFillPopup",{hideBackgroundProperty:!1,changeEvent:"changeBackgroundImageEditor",x:r,y:o,width:i,height:a,repeat:c,size:u,blendMode:s,image:this.currentBackgroundImage.image+"",selectColorStepIndex:e,refresh:!0,isImageHidden:!0})}},{key:Ge("$fillList .preview"),value:function(t){this.viewFillPopup(t.$delegateTarget)}},{key:"viewChangeImage",value:function(t){var e,n=this.currentBackgroundImage;n&&((e=this.getRef("miniView",this.selectedIndex))&&e.css(function(t){for(var e=1;e\n
\n \n
\n ").concat(this.props.title?"":"Add","\n
\n
\n
\n \n ")}},{key:Sn("$shadowList"),value:function(){var t=this.state.boxShadows.map(function(t,e){return'\n
\n
\n
\n
\n
\n
').concat($p.check,'
\n
').concat(t.offsetX,'
\n
').concat(t.offsetY,'
\n
').concat(t.blurRadius,'
\n
').concat(t.spreadRadius,'
\n
\n \n
\n
\n ")});return t.length&&t.push('\n
\n
\n
Inset
\n\n
X
\n
Y
\n
Blur
\n
Spread
\n
\n
\n
\n '),t.join("")}},{key:cr("refreshSelection"),value:function(){this.refresh()}},{key:"modifyBoxShadow",value:function(){var t=this.state.boxShadows.join(", ");this.parent.trigger(this.props.onchange,t)}},{key:cr("add"),value:function(){this.state.boxShadows.push(new Eh),this.refresh(),this.modifyBoxShadow()}},{key:Ge("$add"),value:function(){this.trigger("add")}},{key:Ge("$shadowList .remove"),value:function(t){var e=+t.$delegateTarget.attr("data-index");this.state.boxShadows.splice(e,1),this.refresh(),this.modifyBoxShadow(),this.emit("hideBoxShadowPropertyPopup")}},{key:Ge("$shadowList .shadow-item.real > div:not(.tools)"),value:function(t){var e=+t.$delegateTarget.closest("shadow-item").attr("data-index"),n=this.state.boxShadows[e];this.viewShadowPopup(n,e)}},{key:"viewShadowPopup",value:function(t,e){this.selectedIndex=e,this.viewBoxShadowPropertyPopup(t)}},{key:"viewBoxShadowPropertyPopup",value:function(t){this.emit("showBoxShadowPropertyPopup",{changeEvent:"changeBoxShadowEditorPopup",color:t.color,inset:t.inset,offsetX:t.offsetX,offsetY:t.offsetY,blurRadius:t.blurRadius,spreadRadius:t.spreadRadius},{id:this.id})}},{key:cr("changeBoxShadowEditorColor"),value:function(t){this.trigger("changeBoxShadowEditorPopup",{color:t})}},{key:cr("changeBoxShadowEditorPopup"),value:function(t,e){if(e.id===this.id){var n=this.state.boxShadows[this.selectedIndex];n&&(n.reset(t),this.refresh(),this.modifyBoxShadow())}}}])&&cS(n.prototype,r),o&&cS(n,o),e}();function pS(t){return(pS="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function hS(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var n=[],r=!0,o=!1,i=void 0;try{for(var a,c=t[Symbol.iterator]();!(r=(a=c.next()).done)&&(n.push(a.value),!e||n.length!==e);r=!0);}catch(t){o=!0,i=t}finally{try{r||null==c.return||c.return()}finally{if(o)throw i}}return n}(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance")}()}function yS(t,e){for(var n=0;n\n ").concat(t?""):"","\n \n \n ")}},{key:"getValue",value:function(){return this.refs.$options.value}},{key:"setValue",value:function(t){this.state.value=t+"",this.refs.$options.val(this.state.value),this.refresh()}},{key:"refresh",value:function(){arguments.length>0&&void 0!==arguments[0]&&arguments[0];this.load()}},{key:Pn("$options"),value:function(){return{"data-count":this.state.options.length.toString()}}},{key:Sn("$options"),value:function(){var t=this;return this.state.options.map(function(e){var n=e;if((o=e).includes(":")){var r=hS(o.split(":"),2),o=r[0];n=r[1]}""===n?n=t.props["none-value"]?t.props["none-value"]:"":"-"===n&&(n="----------",o="");var i=o===t.state.value?"selected":"";return"")})}},{key:"setOptions",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";this.setState({options:t.split(this.state.splitChar).map(function(t){return t.trim()})})}},{key:qe("$options"),value:function(){this.updateData({value:this.refs.$options.value})}},{key:"updateData",value:function(t){this.setState(t,!1),this.parent.trigger(this.props.onchange,this.props.key,this.state.value,this.props.params)}}])&&yS(n.prototype,r),o&&yS(n,o),e}();function mS(t){return(mS="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function wS(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function kS(t,e){for(var n=0;n"}},{key:"refresh",value:function(){this.load()}},{key:Sn("$body"),value:function(){var t=this.state,e=t.min,n=t.max,r=t.step,o=t.label,i=t.calc,a=t.type,c=t.removable,u=t.layout,s=+this.state.value.value.toString();isNaN(s)&&(s=0);var l=u,f=(+s).toString();return"\n
\n ").concat(o?""):"","\n \n
\n
\n \n \n \n \n \n
\n
\n
\n
\n \n\n \n
\n
\n \n
\n ")}},{key:"getValue",value:function(){return this.state.value.clone()}},{key:"setValue",value:function(t){this.setState({value:Te.parse(t)})}},{key:Ge("$toggleType"),value:function(t){var e="calc"===this.state.type?"range":"calc";r="";if("calc"===e){r=Te.calc(this.refs.$calc.value);var n=r.unit;this.children.$varType.setValue(n)}else{var r=this.getRef("$propertyNumber").value,o=this.children.$unit.getValue();r=new Te(r,o)}this.updateData({type:e,value:r}),this.refs.$range.attr("data-selected-type",e)}},{key:Ge("$remove"),value:function(t){this.updateData({value:""})}},{key:Je("$calc"),value:function(){this.updateData({value:new Te(this.refs.$calc.value,this.children.$varType.getValue())})}},{key:"updateData",value:function(t){this.setState(t,!1),this.parent.trigger(this.props.onchange,this.props.key,this.state.value,this.props.params)}},{key:"updateCalc",value:function(){this.refs.$calc.val(this.state.value)}},{key:"initValue",value:function(){""==this.state.value&&(this.state.value=new Te(0,this.children.$unit.getValue()))}},{key:Je("$propertyNumber"),value:function(t){var e=+this.getRef("$propertyNumber").value;this.getRef("$property").val(e),this.initValue(),this.updateData({value:new Te(e,this.children.$unit.getValue())}),this.updateCalc()}},{key:Je("$property"),value:function(t){var e=+this.getRef("$property").value;this.getRef("$propertyNumber").val(e),this.initValue(),this.updateData({value:new Te(e,this.children.$unit.getValue())}),this.updateCalc()}},{key:cr("changeUnit"),value:function(t,e){this.initValue(),this.updateData({value:this.state.value.toUnit(e)}),this.updateCalc()}},{key:cr("changeVarType"),value:function(t,e){this.updateData({value:new Te(this.refs.$calc.value,e)})}}])&&kS(n.prototype,r),o&&kS(n,o),e}();function xS(t){return(xS="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function TS(t,e){for(var n=0;n"}},{key:cr("changeBorderRadius"),value:function(t,e){var n=this;"border-radius"===t&&RS.forEach(function(t){n.children["$".concat(t)].setValue(e.clone())}),this.setBorderRadius()}},{key:Sn("$body"),value:function(){var t=this,e=this.state.isAll?"all":"partitial",n=this.state["border-radius"];return'\n
\n
\n \n \n
\n
\n \n
\n
\n