diff --git a/dist/editor.js b/dist/editor.js index 3822d2fc2..7d40d9f60 100644 --- a/dist/editor.js +++ b/dist/editor.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,"randomNumber",(function(){return m})),n.d(r,"randomByCount",(function(){return g})),n.d(r,"random",(function(){return w})),n.d(r,"randomRGBA",(function(){return O}));var o={};n.r(o),n.d(o,"debounce",(function(){return _})),n.d(o,"throttle",(function(){return C})),n.d(o,"keyEach",(function(){return T})),n.d(o,"keyMap",(function(){return D})),n.d(o,"keyMapJoin",(function(){return A})),n.d(o,"get",(function(){return I})),n.d(o,"defaultValue",(function(){return V})),n.d(o,"isUndefined",(function(){return M})),n.d(o,"isNotUndefined",(function(){return L})),n.d(o,"isArray",(function(){return B})),n.d(o,"isBoolean",(function(){return z})),n.d(o,"isString",(function(){return F})),n.d(o,"isNotString",(function(){return G})),n.d(o,"isObject",(function(){return H})),n.d(o,"isFunction",(function(){return X})),n.d(o,"isNumber",(function(){return Y})),n.d(o,"clone",(function(){return N})),n.d(o,"cleanObject",(function(){return K})),n.d(o,"combineKeyArray",(function(){return U})),n.d(o,"repeat",(function(){return W})),n.d(o,"randomItem",(function(){return Z})),n.d(o,"html",(function(){return J})),n.d(o,"CSS_TO_STRING",(function(){return Q})),n.d(o,"STRING_TO_CSS",(function(){return tt})),n.d(o,"OBJECT_TO_PROPERTY",(function(){return et})),n.d(o,"OBJECT_TO_CLASS",(function(){return nt})),n.d(o,"TAG_TO_STRING",(function(){return rt})),n.d(o,"mapjoin",(function(){return ot}));var i={};n.r(i),n.d(i,"format",(function(){return it})),n.d(i,"hex",(function(){return at})),n.d(i,"rgb",(function(){return ct})),n.d(i,"hsl",(function(){return ut}));var a={};n.r(a),n.d(a,"round",(function(){return ft})),n.d(a,"degreeToRadian",(function(){return pt})),n.d(a,"div",(function(){return yt})),n.d(a,"radianToDegree",(function(){return ht})),n.d(a,"getXInCircle",(function(){return dt})),n.d(a,"getYInCircle",(function(){return vt})),n.d(a,"getXYInCircle",(function(){return bt})),n.d(a,"getDist",(function(){return mt})),n.d(a,"calculateAngle",(function(){return gt})),n.d(a,"calculateAngleByPoints",(function(){return wt})),n.d(a,"calculateAnglePointDistance",(function(){return Ot})),n.d(a,"calculateAngle360",(function(){return kt})),n.d(a,"uuid",(function(){return jt})),n.d(a,"uuidShort",(function(){return Pt})),n.d(a,"cubicBezier",(function(){return Et})),n.d(a,"getGradientLine",(function(){return _t})),n.d(a,"CCW",(function(){return Ct})),n.d(a,"incircle",(function(){return Tt})),n.d(a,"initPolygon",(function(){return Dt})),n.d(a,"Deluanay",(function(){return It})),n.d(a,"generate_sample_points",(function(){return Vt})),n.d(a,"getCenterInTriangle",(function(){return Mt})),n.d(a,"normalize",(function(){return Bt}));var c={};n.r(c),n.d(c,"ReverseXyz",(function(){return zt})),n.d(c,"ReverseRGB",(function(){return Ft})),n.d(c,"XYZtoRGB",(function(){return Gt})),n.d(c,"LABtoXYZ",(function(){return Ht})),n.d(c,"PivotXyz",(function(){return Xt})),n.d(c,"XYZtoLAB",(function(){return Yt})),n.d(c,"LABtoRGB",(function(){return Nt}));var u={};n.r(u),n.d(u,"RGBtoHSV",(function(){return Kt})),n.d(u,"RGBtoCMYK",(function(){return Ut})),n.d(u,"RGBtoHSL",(function(){return Wt})),n.d(u,"c",(function(){return Zt})),n.d(u,"gray",(function(){return qt})),n.d(u,"RGBtoSimpleGray",(function(){return Jt})),n.d(u,"RGBtoGray",(function(){return Qt})),n.d(u,"brightness",(function(){return te})),n.d(u,"RGBtoYCrCb",(function(){return ee})),n.d(u,"PivotRGB",(function(){return ne})),n.d(u,"RGBtoXYZ",(function(){return re})),n.d(u,"RGBtoLAB",(function(){return oe}));var s={};n.r(s),n.d(s,"CMYKtoRGB",(function(){return ie}));var l={};n.r(l),n.d(l,"HSVtoRGB",(function(){return ae})),n.d(l,"HSVtoHSL",(function(){return ce}));var f={};n.r(f),n.d(f,"HUEtoRGB",(function(){return ue})),n.d(f,"HSLtoHSV",(function(){return se})),n.d(f,"HSLtoRGB",(function(){return le}));var p={};n.r(p),n.d(p,"YCrCbtoRGB",(function(){return fe}));var h={};n.r(h),n.d(h,"getColorIndexString",(function(){return we})),n.d(h,"isColor",(function(){return Oe})),n.d(h,"matches",(function(){return ke})),n.d(h,"convertMatches",(function(){return Se})),n.d(h,"convertMatchesArray",(function(){return je})),n.d(h,"reverseMatches",(function(){return Pe})),n.d(h,"trim",(function(){return Re})),n.d(h,"parse",(function(){return $e})),n.d(h,"parseGradient",(function(){return Ee}));var d={};n.r(d),n.d(d,"interpolateRGB",(function(){return _e})),n.d(d,"interpolateRGBObject",(function(){return Ce})),n.d(d,"scale",(function(){return Te})),n.d(d,"blend",(function(){return De})),n.d(d,"mix",(function(){return Ae})),n.d(d,"contrast",(function(){return Ie})),n.d(d,"contrastColor",(function(){return Ve})),n.d(d,"gradient",(function(){return Me})),n.d(d,"scaleHSV",(function(){return Le})),n.d(d,"scaleH",(function(){return Be})),n.d(d,"scaleS",(function(){return ze})),n.d(d,"scaleV",(function(){return Fe}));var v={};n.r(v),n.d(v,"start",(function(){return bp}));var b;n(0);function m(t,e){return Math.floor(Math.random()*(e-t+1))+t}function g(){for(var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1,e=[],n=0;nt.length)&&(e=t.length);for(var n=0,r=new Array(e);n1&&void 0!==arguments[1]?arguments[1]:0;if(0===e)return t;var n=void 0;return function(r,o,i,a,c){n&&clearTimeout(n),n=setTimeout((function(){t(r,o,i,a,c)}),e||300)}}function C(t,e){var n=void 0;return function(r,o,i,a,c){n||(n=setTimeout((function(){t(r,o,i,a,c),n=null}),e||300))}}function T(t,e){Object.keys(t).forEach((function(n,r){e(n,t[n],r)}))}function D(t,e){return Object.keys(t).map((function(n,r){return e(n,t[n],r)}))}function A(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"";return D(t,e).join(n)}function I(t,e,n){var r=V(t[e],e);return X(n)?n(r):r}function V(t,e){return void 0===t?e:t}function M(t){return null==t}function L(t){return!1===M(t)}function B(t){return Array.isArray(t)}function z(t){return"boolean"==typeof t}function F(t){return"string"==typeof t}function G(t){return!1===F(t)}function H(t){return"object"==E(t)&&!B(t)&&!Y(t)&&!F(t)&&null!==t}function X(t){return"function"==typeof t}function Y(t){return"number"==typeof t}function N(t){return JSON.parse(JSON.stringify(t))}function K(t){var e={};return Object.keys(t).filter((function(e){return!!t[e]})).forEach((function(n){e[n]=t[n]})),e}function U(t){return Object.keys(t).forEach((function(e){Array.isArray(t[e])&&(t[e]=t[e].join(", "))})),t}function W(t){return j(Array(t))}function Z(){for(var t=arguments.length,e=new Array(t),n=0;n1?e-1:0),r=1;r]*)\/\>/gim,(function(t,e){return q[e.toLowerCase()]?t:t.replace("/>",">"))}))};function Q(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 tt(){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&&void 0!==arguments[2]?arguments[2]:":",r={};return""===(t+="")||t.split(e).forEach((function(t){var e=k(t.split(n).map((function(t){return t.trim()}))),o=e[0],i=e.slice(1);""!=o&&(r[o]=i.join(n))})),r}function et(t){return Object.keys(t).map((function(e){return"class"===e&&H(t[e])?"".concat(e,'="').concat(nt(t[e]),'"'):z(t[e])||M(t[e])||"undefined"===t[e]?t[e]?e:"":"".concat(e,'="').concat(t[e],'"')})).join(" ")}function nt(t){return Object.keys(t).filter((function(e){return t[e]})).map((function(t){return t})).join(" ")}function rt(t){return t.replace(/\/g,">")}function ot(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"";return t.map(e).join(n)}function it(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?at(t):"rgb"==e?ct(t,n):"hsl"==e?ut(t):t}function at(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 ct(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"rgba(0, 0, 0, 0)";if(B(t)&&(t={r:t[0],g:t[1],b:t[2],a:t[3]}),!M(t))return 1==t.a||M(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 ut(t){return B(t)&&(t={r:t[0],g:t[1],b:t[2],a:t[3]}),1==t.a||M(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,")")}var st={create:function(t,e,n){return{x:t||0,y:e||0,z:n||0}},add:function(t,e){return{x:t.x+e.x,y:t.y+e.y,z:t.z+e.z}},sub:function(t,e){return{x:t.x-e.x,y:t.y-e.y,z:t.z-e.z}},mul:function(t,e){return{x:t.x*e.x,y:t.y*e.y,z:t.z*e.z}},div:function(t,e){return{x:t.x/e.x,y:t.y/e.y,z:t.z/e.z}},muls:function(t,e){return{x:t.x*e,y:t.y*e,z:t.z*e}},divs:function(t,e){return{x:t.x/e,y:t.y/e,z:t.z/e}},len:function(t){return Math.sqrt(t.x*t.x+t.y*t.y+t.z*t.z)},dot:function(t,e){return t.x*e.x+t.y*e.y+t.z*e.z},cross2d:function(t,e){return t.x*e.y-t.y*e.x},cross:function(t,e){return{x:t.y*e.z-t.z*e.y,y:t.z*e.x-t.x*e.z,z:t.x*e.y-t.y*e.x}},normalize:function(t){return st.divs(t,st.len(t))},ang:function(t,e){return Math.acos(st.dot(t,e)/(st.len(t)*st.len(e)))},copy:function(t){return{x:t.x,y:t.y,z:t.z}},equal:function(t,e){return t.x===e.x&&t.y===e.y&&t.z===e.z},rotate:function(t,e){var n=t.x,r=t.y,o=t.z,i=0!==e.x?e.x/2:0,a=0!==e.y?e.y/2:0,c=0!==e.z?e.z/2:0,u=Math.cos(i),s=Math.cos(a),l=Math.cos(c),f=Math.sin(i),p=Math.sin(a),y=Math.sin(c),h=u*s*l+-f*p*y,d=f*s*l- -u*p*y,v=u*p*l+f*s*-y,b=u*s*y- -f*p*l;return{x:n*(1-2*(v*v+b*b))+r*(2*(d*v-b*h))+o*(2*(d*b+v*h)),y:n*(2*(d*v+b*h))+r*(1-2*(d*d+b*b))+o*(2*(v*b-d*h)),z:n*(2*(d*b-v*h))+r*(2*(b*v+d*h))+o*(1-2*(d*d+v*v))}}},lt={matrix2d:{multiply:function(t){return function(e,n){var r=+e[n],o=+e[n+1];return[t[0][0]*r+t[0][1]*o+t[0][2],t[1][0]*r+t[1][1]*o+t[1][2],1]}},translate:function(t,e){return this.multiply([[1,0,t],[0,1,e],[0,0,1]])},rotate:function(t){return this.multiply([[Math.cos(t),Math.sin(t),0],[-Math.sin(t),Math.cos(t),0],[0,0,1]])},scale:function(t,e){return this.multiply([[t,0,0],[0,e,0],[0,0,1]])},skewX:function(t){return this.multiply([[1,Math.tan(t),0],[0,1,0],[0,0,1]])},skewY:function(t){return this.multiply([[1,0,0],[Math.tan(t),1,0],[0,0,1]])},flip:function(){return this.multiply([[-1,0,0],[0,-1,0],[0,0,1]])},flipX:function(){return this.multiply([[-1,0,0],[0,1,0],[0,0,1]])},flipY:function(){return this.multiply([[1,0,0],[0,-1,0],[0,0,1]])}},Vect3:st,addVector:function(t,e){return st.add(t,e)},rotateVector:function(t,e){return st.rotate(t,e)}};function ft(t,e){return e=M(e)?1:e,Math.round(t*e)/e}function pt(t){return t*Math.PI/180}function yt(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1;return 0===t?0:t/e}function ht(t){var e=180*t/Math.PI;return e<0&&(e=360+e),e}function dt(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;return n+e*Math.cos(pt(t))}function vt(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;return n+e*Math.sin(pt(t))}function bt(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:dt(t,e,n),y:vt(t,e,r)}}function mt(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 gt(t,e){return ht(Math.atan2(e,t))}function wt(t,e){return gt(t.x,t.y)-gt(e.x,e.y)}function Ot(t,e,n){var r=gt(t.x-e.x,t.y-e.y);return gt(t.x+n.dx-e.x,t.y+n.dy-e.y)-r}function kt(t,e){return(ht(Math.atan2(e,t))+180)%360}var St=/[xy]/g;function jt(){var t=(new Date).getTime();return"xxx12-xx-34xx".replace(St,(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 Pt(){var t=(new Date).getTime();return"idxxxxxxx".replace(St,(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 xt=function(t){return 3*t*t*(1-t)},Rt=function(t){return 3*t*(1-t)*(1-t)},$t=function(t){return(1-t)*(1-t)*(1-t)};function Et(t,e,n,r){var o=e,i=r;return function(t){return 1-(o*xt(t)+i*Rt(t)+$t(t))}}function _t(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 Ct(t,e,n){return M(n)?st.cross2d(t,e):st.cross2d(st.sub(e,t),st.sub(n,t))}function Tt(t,e,n,r){var o=Ct(t,e,n),i=t.x-r.x,a=t.y-r.y,c=e.x-r.x,u=e.y-r.y,s=n.x-r.x,l=n.y-r.y,f=(i*i+a*a)*(c*l-s*u)+(c*c+u*u)*(s*a-i*l)+(s*s+l*l)*(i*u-c*a);return o>0?f>=0:f<=0}function Dt(t,e,n){for(var r=st.create(Math.min(e,n),Math.max(e,n)),o=-1,i=0,a=t.length;i-1?t.splice(o,1):t.push(r)}function At(t,e,n){var r=t[e];t[e]=t[n],t[n]=r}function It(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],e=t.length;t[e]=st.create(-2e9,-2e9),t[e+1]=st.create(2e9,-2e9),t[e+2]=st.create(0,2e9);for(var n=[st.create(e,e+1,e+2)],r=0;r=e||f.y>=e||f.z>=e)&&(At(n,r,n.length-1),n.pop(),r--)}return n.map((function(e){return{a:t[e.x],b:t[e.y],c:t[e.z]}}))}function Vt(t,e){for(var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:50,r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:50,o=arguments.length>4&&void 0!==arguments[4]?arguments[4]:100,i=arguments.length>5&&void 0!==arguments[5]?arguments[5]:1,a=arguments.length>6&&void 0!==arguments[6]?arguments[6]:function(){return Math.random()},c=[],u=-n,s=t+n,l=-r,f=e+r,p=u;p.008856?Math.pow(t,3):(t-16/116)/7.787}function Ft(t){return t>.0031308?1.055*Math.pow(t,1/2.4)-.055:12.92*t}function Gt(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;c=Ft(c),u=Ft(u),s=Ft(s);var l=ft(255*c),f=ft(255*u),p=ft(255*s);return{r:l,g:f,b:p}}function Ht(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;o=zt(o);var c=95.047*(i=zt(i)),u=100*o,s=108.883*(a=zt(a));return{x:c,y:u,z:s}}function Xt(t){return t>.008856?Math.pow(t,1/3):(7.787*t+16)/116}function Yt(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;o=Xt(o);var c=116*(i=Xt(i))-16,u=500*(o-i),s=200*(i-(a=Xt(a)));return{l:c,a:u,b:s}}function Nt(t,e,n){if(1==arguments.length){var r=arguments[0];t=r.l,e=r.a,n=r.b}return Gt(Ht(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=Math.min(o,i,a),s=c-u,l=0;0==s?l=0:c==o?l=(i-a)/s%6*60:c==i?l=60*((a-o)/s+2):c==a&&(l=60*((o-i)/s+4)),l<0&&(l=360+l);return{h:l,s:0==c?0:s/c,v:c}}function Ut(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),u=(1-o-c)/(1-c),s=(1-i-c)/(1-c),l=(1-a-c)/(1-c);return{c:u,m:s,y:l,k:c}}function Wt(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 qt(t){return{r:t,g:t,b:t}}function Jt(t,e,n){if(1==arguments.length){var r=arguments[0];t=r.r,e=r.g,n=r.b}return qt(Math.ceil((t+e+n)/3))}function Qt(t,e,n){if(1==arguments.length){var r=arguments[0];t=r.r,e=r.g,n=r.b}return qt(ee(t,e,n).y)}function te(t,e,n){return Math.ceil(.2126*t+.7152*e+.0722*n)}function ee(t,e,n){if(1==arguments.length){var r=arguments[0];t=r.r,e=r.g,n=r.b}var o=te(t,e,n),i=.564*(n-o),a=.713*(t-o);return{y:o,cr:a,cb:i}}function ne(t){return 100*(t>.04045?Math.pow((t+.055)/1.055,2.4):t/12.92)}function re(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=.4124*(o=ne(o))+.3576*(i=ne(i))+.1805*(a=ne(a)),u=.2126*o+.7152*i+.0722*a,s=.0193*o+.1192*i+.9505*a;return{x:c,y:u,z:s}}function oe(t,e,n){if(1==arguments.length){var r=arguments[0];t=r.r,e=r.g,n=r.b}return Yt(re(t,e,n))}function ie(t,e,n,r){if(1==arguments.length){var o=arguments[0];t=o.c,e=o.m,n=o.y,r=o.k}var i=255*(1-t)*(1-r),a=255*(1-e)*(1-r),c=255*(1-n)*(1-r);return{r:i,g:a,b:c}}function ae(t,e,n){if(1==arguments.length){var r=arguments[0];t=r.h,e=r.s,n=r.v}var o=t,i=e,a=n;o>=360&&(o=0);var c=i*a,u=c*(1-Math.abs(o/60%2-1)),s=a-c,l=[];return 0<=o&&o<60?l=[c,u,0]:60<=o&&o<120?l=[u,c,0]:120<=o&&o<180?l=[0,c,u]:180<=o&&o<240?l=[0,u,c]:240<=o&&o<300?l=[u,0,c]:300<=o&&o<360&&(l=[c,0,u]),{r:ft(255*(l[0]+s)),g:ft(255*(l[1]+s)),b:ft(255*(l[2]+s))}}function ce(t,e,n){if(1==arguments.length){var r=arguments[0];t=r.h,e=r.s,n=r.v}var o=ae(t,e,n);return Wt(o.r,o.g,o.b)}function ue(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 se(t,e,n){if(1==arguments.length){var r=arguments[0];t=r.h,e=r.s,n=r.l}var o=le(t,e,n);return Kt(o.r,o.g,o.b)}function le(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=ue(u,c,t+1/3),i=ue(u,c,t),a=ue(u,c,t-1/3)}return{r:ft(255*o),g:ft(255*i),b:ft(255*a)}}function fe(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 pe={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)",currentColor:"currentColor"};var ye={isColorName:function(t){return!!pe[t]},getColorByName:function(t){return pe[t]}};function he(t){return function(t){if(Array.isArray(t))return de(t)}(t)||function(t){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(t))return Array.from(t)}(t)||function(t,e){if(!t)return;if("string"==typeof t)return de(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);"Object"===n&&t.constructor&&(n=t.constructor.name);if("Map"===n||"Set"===n)return Array.from(t);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return de(t,e)}(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function de(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n1&&void 0!==arguments[1]?arguments[1]:"@";return"".concat(e).concat(t.startIndex).padEnd(10,"0")}function Oe(t){return!!ke(t).length}function ke(t){var e=t.match(ge),n=[];if(!e)return n;for(var r=0,o=e.length;r-1||e[r].indexOf("rgb")>-1||e[r].indexOf("hsl")>-1)n.push({color:e[r]});else{var i=ye.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 Se(t){var e=ke(t);return e.forEach((function(e){t=t.replace(e.color,we(e))})),{str:t,matches:e}}function je(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:",",n=Se(t);return n.str.split(e).map((function(t,e){return t=Re(t),n.matches[e]&&(t=t.replace(we(n.matches[e]),n.matches[e].color)),t}))}function Pe(t,e){return e.forEach((function(e){t=t.replace(we(e),e.color)})),t}var xe=/^\s+|\s+$/g;function Re(t){return t.replace(xe,"")}function $e(t){if(F(t)){if(ye.isColorName(t)&&(t=ye.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}),Wt(i));if(0<=t&&t<=4294967295)return i=be(be({},i={type:"hex",r:(4278190080&t)>>24,g:(16711680&t)>>16,b:(65280&t)>>8,a:(255&t)/255}),Wt(i))}return t}function Ee(t){F(t)&&(t=je(t));var e=(t=t.map((function(t){if(F(t)){var e=Se(t),n=Re(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]=Pe(n[0],e.matches),n}if(Array.isArray(t))return t[1]?F(t[1])&&(t[1].indexOf("%")>-1?t[1]=parseFloat(t[1].replace(/%/,""))/100:t[1]=+t[1]):t[1]="*",he(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 _e(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=Ce(t,e,n);return it(o,o.a<1?"rgb":r)}function Ce(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:.5;return{r:ft(t.r+(e.r-t.r)*n),g:ft(t.g+(e.g-t.g)*n),b:ft(t.b+(e.b-t.b)*n),a:ft(t.a+(e.a-t.a)*n,100)}}function Te(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:5;if(!t)return[];F(t)&&(t=je(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",o=$e(t),i=$e(e);return _e(o,i,n,r)}function Ae(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";return De(t,e,n,r)}function Ie(t){return t=$e(t),(Math.round(299*t.r)+Math.round(587*t.g)+Math.round(114*t.b))/1e3}function Ve(t){return Ie(t)>=128?"black":"white"}function Me(t){for(var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:10,n=[],r=e-((t=Ee(t)).length-1),o=r,i=1,a=t.length;i1&&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=$e(t),u=Kt(c),s=(i-o)*a/n,l=[],f=1;f<=n;f++)u[e]=Math.abs((a-s*f)/a),l.push(it(ae(u),r));return l}function Be(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:9,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"rgb",r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0,o=arguments.length>4&&void 0!==arguments[4]?arguments[4]:360;return Le(t,"h",e,n,r,o,1)}function ze(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:9,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"rgb",r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0,o=arguments.length>4&&void 0!==arguments[4]?arguments[4]:1;return Le(t,"s",e,n,r,o,100)}function Fe(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:9,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"rgb",r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0,o=arguments.length>4&&void 0!==arguments[4]?arguments[4]:1;return Le(t,"v",e,n,r,o,100)}function Ge(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function He(t){for(var e=1;e=t){e=Ne[r-1],n=Ne[r];break}return e&&n?Ye.interpolateRGB(e,n,(t-e.start)/(n.start-e.start)):Ne[0].rgb}};function Ue(t,e){var n;if("undefined"==typeof Symbol||null==t[Symbol.iterator]){if(Array.isArray(t)||(n=function(t,e){if(!t)return;if("string"==typeof t)return We(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);"Object"===n&&t.constructor&&(n=t.constructor.name);if("Map"===n||"Set"===n)return Array.from(t);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return We(t,e)}(t))||e&&t&&"number"==typeof t.length){n&&(t=n);var r=0,o=function(){};return{s:o,n:function(){return r>=t.length?{done:!0}:{done:!1,value:t[r++]}},e:function(t){throw t},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,c=!1;return{s:function(){n=t[Symbol.iterator]()},n:function(){var t=n.next();return a=t.done,t},e:function(t){c=!0,i=t},f:function(){try{a||null==n.return||n.return()}finally{if(c)throw i}}}}function We(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=qe(qe({},e),n);Object.keys(r).forEach((function(r){Qe(t,r,e[r],n[r])}))}(e,tn(n.attributes),tn(e.attributes));var o=nn(e),i=nn(n),a=Math.max(o.length,i.length);for(r=0;r0&&void 0!==arguments[0]?arguments[0]:"",n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";if(an(this,t),this.value=e,Y(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 Y(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 L(cn[this.value])?t.percent(cn[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){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;nt.length)&&(e=t.length);for(var n=0,r=new Array(e);n1&&void 0!==arguments[1]?arguments[1]:"div";rn(this,t.create(n).html(e))}},{key:"updateSVGDiff",value:function(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"div";rn(this,t.create(n).html("".concat(e,"")).firstChild)}},{key:"find",value:function(t){return this.el.querySelector(t)}},{key:"$",value:function(e){var n=this.find(e);return n?t.create(n):null}},{key:"findAll",value:function(t){return this.el.querySelectorAll(t)}},{key:"$$",value:function(e){var n=this.findAll(e);return Object.keys(n).map((function(e){return t.create(n[e])}))}},{key:"empty",value:function(){for(;this.el.firstChild;)this.el.removeChild(this.el.firstChild);return this}},{key:"append",value:function(t){return F(t)?this.el.appendChild(document.createTextNode(t)):this.el.appendChild(t.el||t),this}},{key:"prepend",value:function(t){return F(t)?this.el.prepend(document.createTextNode(t)):this.el.prepend(t.el||t),this}},{key:"appendHTML",value:function(e){var n=t.create("div").html(e);this.append(n.createChildrenFragment())}},{key:"createChildrenFragment",value:function(){var t=this.children(),e=document.createDocumentFragment();return t.forEach((function(t){return e.appendChild(t.el)})),e}},{key:"appendTo",value:function(t){return(t.el?t.el:t).appendChild(this.el),this}},{key:"remove",value:function(){return this.el.parentNode&&this.el.parentNode.removeChild(this.el),this}},{key:"removeChild",value:function(t){return this.el.removeChild(t.el||t),this}},{key:"text",value:function(e){if(M(e))return this.el.textContent;var n=e;return e instanceof t&&(n=e.text()),this.el.textContent=n,this}},{key:"css",value:function(t,e){if(L(t)&&L(e))Object.assign(this.el.style,yn({},t,e));else if(L(t)){if(F(t))return getComputedStyle(this.el)[t];Object.assign(this.el.style,t)}return this}},{key:"getComputedStyle",value:function(t){function e(){return t.apply(this,arguments)}return e.toString=function(){return t.toString()},e}((function(){for(var t=getComputedStyle(this.el),e={},n=arguments.length,r=new Array(n),o=0;o0&&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:"isShow",value:function(){return!this.isHide()}},{key:"toggle",value:function(t){var e=this.isHide();return 1==arguments.length?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:"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:"toDataURL",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"image/png",e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1;return this.el.toDataURL(t,e)}},{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:"drawImage",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,r=this.context(),o=window.devicePixelRatio||1;r.drawImage(t,e,n,t.width,t.height,0,0,this.el.width/o,this.el.height/o)}},{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]:wn;return" ".concat(e," ").concat(t)},bn=/^dom (.*)/gi,mn=/^load (.*)/gi,gn=/^bind (.*)/gi,wn="|",On={},kn=function(){for(var t=arguments.length,e=new Array(t),n=0;n1&&void 0!==arguments[1]?arguments[1]:wn;return vn(t,e)}),Wn=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:wn;return vn("after(".concat(t,")"),e)},Zn=Un,qn=Un,Jn=(Un("ArrowUp"),Un("ArrowDown"),Un("ArrowLeft"),Un("ArrowRight"),Un("Enter")),Qn=(Un("Space"),Un("Escape")),tr=Un("isAltKey"),er=(Un("isShiftKey"),Un("isMetaKey"),Un("isCtrlKey"),Un("self"),Un("fit"),Un("passive"),Un("vdom")),nr=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:100;return Un("debounce(".concat(t,")"))},rr=(nr(1e3),function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:100;return Un("throttle(".concat(t,")"))}),or=(Un("capture()"),function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"move";return Wn("bodyMouseMove ".concat(t))}),ir=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"end";return Wn("bodyMouseUp ".concat(t))},ar=Wn("preventDefault"),cr=Wn("stopPropagation"),ur=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"$el";return"load "+t},sr=function(t){if(""===t)return"";var e=jt();return On[e]=t,e},lr=function(t){return function(){return this.prevState[t]!=this.state[t]}},fr=function(){return!0},pr=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?wn+sr(e):"")},yr={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 hr(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function dr(t,e){for(var n=0;n1&&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?_(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;Promise.resolve().then((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)}))}))}},{key:"triggerMessage",value:function(t,e,n,r,o,i){var a=this;Promise.resolve().then((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")}))}},{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)}}])&&dr(e.prototype,n),r&&dr(e,r),t}();function mr(t){return function(t){if(Array.isArray(t))return Or(t)}(t)||function(t){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(t))return Array.from(t)}(t)||wr(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function gr(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(t)))return;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)||wr(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function wr(t,e){if(t){if("string"==typeof t)return Or(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Or(t,e):void 0}}function Or(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n1&&void 0!==arguments[1]?arguments[1]:{};kr(this,t),this.context=e,this.options=n}var e,n,r;return e=t,(n=[{key:"initialize",value:function(){}},{key:"load",value:function(){}},{key:"refresh",value:function(){}},{key:"render",value:function(){}},{key:"getRef",value:function(t){return this.context.getRef(t)}},{key:"splitMethodByKeyword",value:function(t,e){var n=t.filter((function(t){return t.indexOf("".concat(e,"("))>-1})),r=n.map((function(t){var n=gr(t.split("".concat(e,"("))[1].split(")")[0].trim().split(" "),2);return{target:n[0],param:n[1]}}));return[n,r]}},{key:"collectProps",value:function(){var t=this.context,e=t.__proto__,n=[];do{if(!1==e instanceof Object)break;var r=Object.getOwnPropertyNames(e).filter((function(e){return t&&X(t[e])&&!Pr[e]}));n.push.apply(n,mr(r)),e=e.__proto__}while(e);return n}},{key:"filterProps",value:function(t){return this.collectProps().filter((function(e){return e.match(t)}))}},{key:"run",value:function(){}},{key:"destroy",value:function(){}}])&&Sr(e.prototype,n),r&&Sr(e,r),t}();function Rr(t){return(Rr="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 $r(t){return function(t){if(Array.isArray(t))return Dr(t)}(t)||Er(t)||Tr(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Er(t){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(t))return Array.from(t)}function _r(t,e){return Ar(t)||function(t,e){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(t)))return;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)||Tr(t,e)||Cr()}function Cr(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function Tr(t,e){if(t){if("string"==typeof t)return Dr(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Dr(t,e):void 0}}function Dr(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n-1||!!t.key&&e.codes.indexOf(t.key.toLowerCase())>-1);var o=!0;return e.checkMethodList.length&&(o=e.checkMethodList.every((function(e){var r=n[e];return X(r)&&r?r.call(n,t):!L(r)||!!r}))),r&&o}},{key:"getDefaultDomElement",value:function(t){var e,n=this.context;return(e=t?n.refs[t]||n[t]||window[t]:n.el||n.$el||n.$root)instanceof dn?e.getElement():e}},{key:"getDefaultEventObject",value:function(t,e){var n=this.context,r=e,o=r.filter((function(t){return!!n[t]})),i=_r(this.splitMethodByKeyword(r,"after"),2),a=i[0],c=i[1],u=_r(this.splitMethodByKeyword(r,"before"),2),s=u[0],l=u[1],f=_r(this.splitMethodByKeyword(r,"debounce"),2),p=f[0],y=f[1],h=_r(this.splitMethodByKeyword(r,"throttle"),2),d=h[0],v=h[1],b=_r(this.splitMethodByKeyword(r,"capture"),1)[0],m=[].concat($r(o),$r(a),$r(s),$r(p),$r(d),$r(b));return{eventName:t,codes:r.filter((function(t){return-1===m.indexOf(t)})).map((function(t){return t.toLowerCase()})),captures:b,afterMethods:c,beforeMethods:l,debounceMethods:y,throttleMethods:v,checkMethodList:o}}},{key:"addEvent",value:function(t,e){t.callback=this.makeCallback(t,e),this.addBinding(t);var n=!!t.captures.length;Fr[t.eventName]&&(n={passive:!0,capture:n}),yr.addEvent(t.dom,t.eventName,t.callback,n)}},{key:"bindingEvent",value:function(t,e,n){var r=function(t){return Ar(t)||Er(t)||Tr(t)||Cr()}(t),o=r[0],i=r[1],a=r.slice(2),c=(this.context,this.getDefaultEventObject(o,e));c.dom=this.getDefaultDomElement(i),c.delegate=a.join(" "),c.debounceMethods.length?n=_(n,+c.debounceMethods[0].target):c.throttleMethods.length&&(n=C(n,+c.throttleMethods[0].target)),this.addEvent(c,n)}},{key:"getEventNames",value:function(t){var e=[];return t.split(":").forEach((function(t){var n=t.split(":");e.push.apply(e,$r(n))})),e}},{key:"parseEvent",value:function(t){var e=this,n=this.context,r=t.split(wn).map((function(t){return t.trim()})),o=r.shift().split("dom ")[1].split(" "),i=this.getEventNames(o[0]),a=n[t].bind(n);i.forEach((function(t){o[0]=t,e.bindingEvent(o,r,a)}))}}])&&Vr(e.prototype,n),r&&Vr(e,r),i}(xr);function Hr(t){return(Hr="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 Xr(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(t)))return;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)||Jr(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Yr(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function Nr(t,e){for(var n=0;nt.length)&&(e=t.length);for(var n=0,r=new Array(e);n-1})).forEach((function(e){var r=t.context[e],o=Xr(e.split(wn),2),i=(e=o[0],o[1]),a=t.getRef(i),c=fr;""!=a&&F(a)?c=lr(a):X(a)&&(c=a);var u=e.split("bind ")[1],s=t.context.refs[u],l=X(c)&&c.call(t.context);if(s&&l){var f=r.call.apply(r,[t.context].concat(n));if(!f)return;T(f,(function(t,e){eo(s,t,e)}))}}))}},{key:"destroy",value:function(){this._bindMethods=void 0}}])&&Nr(e.prototype,n),r&&Nr(e,r),i}(xr);function ro(){var t=ao(["",""]);return ro=function(){return t},t}function oo(t){return vo(t)||uo(t)||yo(t)||po()}function io(){var t=ao(["\n ","\n "]);return io=function(){return t},t}function ao(t,e){return e||(e=t.slice(0)),Object.freeze(Object.defineProperties(t,{raw:{value:Object.freeze(e)}}))}function co(t){return function(t){if(Array.isArray(t))return ho(t)}(t)||uo(t)||yo(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function uo(t){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(t))return Array.from(t)}function so(t,e){for(var n=0;nt.length)&&(e=t.length);for(var n=0,r=new Array(e);n0&&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.state={},this.setState(this.initState(),!1),this.refresh(!0)}},{key:"render",value:function(t){this.$el=this.parseTemplate(J(io(),this.template())),this.refs.$el=this.$el,t&&t.append(this.$el),this.load(),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={},r=function(t,e){var n;if("undefined"==typeof Symbol||null==t[Symbol.iterator]){if(Array.isArray(t)||(n=yo(t))||e&&t&&"number"==typeof t.length){n&&(t=n);var r=0,o=function(){};return{s:o,n:function(){return r>=t.length?{done:!0}:{done:!1,value:t[r++]}},e:function(t){throw t},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,c=!1;return{s:function(){n=t[Symbol.iterator]()},n:function(){var t=n.next();return a=t.done,t},e:function(t){c=!0,i=t},f:function(){try{a||null==n.return||n.return()}finally{if(c)throw i}}}}(t.el.attributes);try{for(r.s();!(e=r.n()).done;){var o=e.value;n[o.nodeName]=o.nodeValue}}catch(t){r.e(t)}finally{r.f()}return t.$$("property").forEach((function(t){var e=fo(t.attrs("name","value","type"),3),r=e[0],o=e[1],i=e[2],a=o||t.text();"json"===i&&(a=JSON.parse(a)),n[r]=a})),n}},{key:"parseSourceName",value:function(t){return t.parent?[t.sourceName].concat(co(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()),e.replace(c.$el)})),T(this.children,(function(e,n){n&&n.clean()&&delete t.children[e]}))}},{key:"clean",value:function(){if(this.$el&&!this.$el.hasParent())return T(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=oo(e.split("load ")[1].split(wn).map((function(t){return t.trim()}))),o=r[0],i=r.slice(1),a=(i=i.map((function(t){return t.trim()}))).indexOf(er.value)>-1;if(t.refs[o]){var c,u=(c=t[e]).call.apply(c,[t].concat(n));B(u)&&(u=u.join(""));var s=t.parseTemplate(J(ro(),u),!0);a?t.refs[o].htmlDiff(s):t.refs[o].html(s)}})),this.runHandlers("initialize"),this.bindData(),this.parseComponent()}},{key:"runHandlers",value:function(){for(var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"run",e=arguments.length,n=new Array(e>1?e-1:0),r=1;r"}},{key:"eachChildren",value:function(t){X(t)&&T(this.children,(function(e,n){t(n)}))}},{key:"rerender",value:function(){var t=this.$el.parent();this.destroy(),this.render(t)}},{key:"destroy",value:function(){this.eachChildren((function(t){t.destroy()})),this.runHandlers("destroy"),this.$el.remove(),this.$el=null,this.refs={},this.children={}}},{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 t&&X(t[e])&&!go[e]}));n.push.apply(n,co(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.$dt&&t.$dt.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)}}])&&so(e.prototype,n),r&&so(e,r),t}();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 ko(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(t)))return;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(t,e){if(!t)return;if("string"==typeof t)return So(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);"Object"===n&&t.constructor&&(n=t.constructor.name);if("Map"===n||"Set"===n)return Array.from(t);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return So(t,e)}(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function So(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n1&&void 0!==arguments[1]?arguments[1]:{};return jo(this,i),(e=o.call(this,t,n)).created(),e.initialize(),e.initializeStoreEvent(),e}return e=i,(n=[{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=jt(),this.sourceName=this.constructor.name,t&&t.$store&&(this.$store=t.$store),t&&t.$editor&&(this.$editor=t.$editor)}},{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.filterProps(Co).forEach((function(e){var n=t.getRealEventName(e,"ME@"),r=ko(function(t,e){var n=t.filter((function(t){return t.indexOf("".concat(e,"("))>-1})),r=n.map((function(t){var n=fo(t.split("".concat(e,"("))[1].split(")")[0].trim().split(" "),2);return{target:n[0],param:n[1]}}));return[n,r]}(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="".concat(t.sourceName,".").concat(n),r.source=t.source,t.$store.on(n,r,t,a)}))}))}},{key:"destoryStoreEvent",value:function(){this.$store.offAll(this)}},{key:"destroy",value:function(){xo(_o(i.prototype),"destroy",this).call(this),this.destoryStoreEvent()}},{key:"rerender",value:function(){xo(_o(i.prototype),"rerender",this).call(this),this.initialize(),this.initializeStoreEvent()}},{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)}},{key:"$i18n",value:function(t){return this.$editor.i18n(t)}},{key:"$initI18n",value:function(t){return this.$editor.initI18n(t)}},{key:"$theme",value:function(t){return this.$editor.themeValue(t)}},{key:"$config",get:function(){return this.$editor.config}},{key:"$selection",get:function(){return this.$editor.selection}},{key:"$timeline",get:function(){return this.$editor.timeline}}])&&Po(e.prototype,n),r&&Po(e,r),i}(wo),Io={en_US:{"app.title":"EASYLOGIC","app.sample":function(t,e,n){return"".concat(t,"-").concat(e,"-").concat(n)},"app.lang.en_US":"English","app.lang.ko_KR":"한국어","app.label.lang":"Language","app.theme.dark":"Dark","app.theme.light":"Light","app.theme.gray":"Gray","app.label.theme":"Theme","app.tab.title.projects":"Projects","app.tab.title.layers":"Layers","app.tab.title.libraries":"Library","app.tab.title.components":"Object","app.tab.title.assets":"Assets","app.tab.title.keyMap":"KeyMap","menu.item.download.title":"Download","menu.item.save.title":"Save","menu.item.export.title":"Export","menu.item.codepen.title":"CodePen","menu.item.fullscreen.title":"Screen","menu.item.github.title":"Github","menu.item.learn.title":"Learn","project.property.title":"Project","project.information.property.title":"Project information","project.information.property.name":"Name","project.information.property.description":"Description","artboard.property.title":"ArtBoards","artboard.property.layout.title.flex":"Flex","artboard.property.layout.title.grid":"Grid","layer.tree.property.title":"Layers","layer.tree.property.layout.title.flex":"Flex","layer.tree.property.layout.title.grid":"Grid","alignment.property.title":"Alignment","position.property.title":"Position","position.property.X":"X","position.property.Y":"Y","size.property.title":"Size","size.property.width":"Width","size.property.height":"Height","background.color.property.title":"Appearance","background.color.property.color":"Color","background.color.property.zindex":"z-index","background.color.property.opacity":"Opacity","background.color.property.blend":"Blend","background.color.property.overflow":"Overflow","background.color.property.overflow.visible":"Visible","background.color.property.overflow.hidden":"Hidden","background.color.property.overflow.scroll":"Scroll","background.color.property.overflow.auto":"Auto","blend.normal":"normal","blend.multiply":"multiply","blend.screen":"screen","blend.overlay":"overlay","blend.darken":"darken","blend.lighten":"lighten","blend.color-dodge":"color-dodge","blend.color-burn":"color-burn","blend.hard-light":"hard-light","blend.soft-light":"soft-light","blend.difference":"difference","blend.exclusion":"exclusion","blend.hue":"hue","blend.saturation":"saturation","blend.color":"color","blend.luminosity":"luminosity","background.image.property.title":"Fill","border.property.title":"Border","border.radius.property.title":"Border Radius","boxshadow.property.title":"Box Shadows","filter.property.title":"Filter","filter.property.blur":"Blur","filter.property.grayscale":"GrayScale","filter.property.hue-rotate":"Hue Rotate","filter.property.invert":"Invert","filter.property.brightness":"Brightness","filter.property.contrast":"Contrast","filter.property.drop-shadow":"Drop Shadow","filter.property.drop-shadow.color":"Color","filter.property.drop-shadow.offsetX":"Offset X","filter.property.drop-shadow.offsetY":"Offset Y","filter.property.drop-shadow.blurRadius":"Blur","filter.property.opacity":"Opacity","filter.property.saturate":"Saturate","filter.property.sepia":"Sepia","filter.property.svg":"SVG","font.property.title":"Font","font.property.color":"Color","font.property.size":"Size","font.property.stretch":"Stretch","font.property.weight":"Weight","font.property.style":"Style","font.property.family":"Family","font.spacing.property.title":"Font spacing","font.spacing.property.lineHeight":"Line height","font.spacing.property.letterSpacing":"Letter spacing","font.spacing.property.wordSpacing":"Word spacing","font.spacing.property.indent":"Indent","backdrop.filter.property.title":"Backdrop Filter","clippath.property.title":"Clip Path","export.property.title":"Export","export.property.download":"Download","image.property.title":"Image","image.property.origin":"Origin","image.property.size":"Size","image.property.width":"Width","image.property.height":"height","video.property.title":"Video","video.property.play":"Play","video.property.pause":"Pause","video.property.volume":"Volume","video.property.playbackRate":"Playback Rate","video.property.currentTime":"Current Time","video.property.playTime":"Play Time Distance","motion.property.title":"Motion","text.property.title":"Text Style","text.property.align":"Align","text.property.transform":"Transform","text.property.decoration":"Decoration","text.clip.property.title":"Text Clip","text.shadow.property.title":"Text Shadows","text.fill.property.title":"Text Fill","text.fill.property.fill":"Fill","text.fill.property.stroke":"Stroke","text.fill.property.strokeWidth":"Width","transform.property.title":"Transform","transform.origin.property.title":"Transform Origin","transition.property.title":"CSS Transition","keyframe.property.title":"CSS Keyframe","selector.property.title":"Selector","selector.property.none":"None selector","path.data.property.title":"Path Information","polygon.data.property.title":"Polygon Information","perspective.property.title":"Perspective","perspective.origin.property.title":"Perspective Origin","svg.item.property.title":"SVG","svg.item.property.isMotionPath":"Motion Path","svg.item.property.fill":"Fill","svg.item.property.fillOpacity":"Opacity","svg.item.property.path":"Path","svg.item.property.polygon":"Polygon","svg.item.property.totalLength":"Total Length","svg.item.property.fillRule":"Fill Rule","svg.item.property.stroke":"Stroke","svg.item.property.strokeWidth":"Width","svg.item.property.dashArray":"Dash Array","svg.item.property.dashOffset":"Dash Offset","svg.item.property.lineCap":"Line Cap","svg.item.property.lineJoin":"Line Join","svg.item.property.filter":"Filter","border.editor.all":"All","border.editor.width":"Width","border.editor.style":"Style","border.editor.color":"C","border.editor.top":"Top","border.editor.left":"Left","border.editor.right":"Right","border.editor.bottom":"Bottom","border.radius.editor.topLeft":"Top Left","border.radius.editor.topRight":"Top Right","border.radius.editor.bottomLeft":"Bottom Left","border.radius.editor.bottomRight":"Bottom Right","boxshadow.editor.blur":"Blur","boxshadow.editor.spread":"Spread","css.property.editor.properties":"Properties","offset.path.list.editor.path":"Path","offset.path.list.editor.totalLength":"Total Length","offset.path.list.editor.distance":"Distance","offset.path.list.editor.direction":"Direction","offset.path.list.editor.rotate":"Rotate","svgfilter.select.editor.message.create":"Create new svg filter","svgfilter.select.editor.message.select":"Select a filter","fill.editor.message.click.image":"Click the preview area if you want to select a image","fill.editor.message.drag.position":"Drag if you want to move center position","fill.editor.x1":"Start X","fill.editor.x2":"End X","fill.editor.y1":"Start Y","fill.editor.y2":"End Y","fill.editor.spread":"Spread","fill.editor.offset":"Offset","fill.editor.cx":"Center X","fill.editor.cy":"Center Y","fill.editor.r":"End radius","fill.editor.fx":"Start X","fill.editor.fy":"Start Y","fill.editor.fr":"Start radius","perspective.origin.editor.originX":"Origin X","perspective.origin.editor.originY":"Origin Y","path.manager.msg":"Keydown ESC or Enter key to close editing","path.manager.mode.modify":"Modify","path.manager.mode.path":"Path","path.manager.mode.transform":"Transform","path.manager.mode.flipX":"Flip X","path.manager.mode.flipY":"Flip Y","path.manager.mode.flipOrigin":"Flip Origin","colorpicker.popup.title":"ColorPicker","selector.popup.title":"Selector Property","selector.popup.selector":"Selector","background.image.position.popup.title":"Background Pattern","background.image.position.popup.size":"Size","background.image.position.popup.width":"Width","background.image.position.popup.height":"Height","background.image.position.popup.repeat":"Repeat","background.image.position.popup.blend":"Blend","background.image.position.popup.type.repeat":"repeat","background.image.position.popup.type.no-repeat":"no repeat","background.image.position.popup.type.repeat-x":"repeat-x","background.image.position.popup.type.repeat-y":"repeat-y","background.image.position.popup.type.space":"space","background.image.position.popup.type.round":"round","gradient.picker.popup.title":"Gradient & Image Picker","image.asset.property.title":"Image","video.asset.property.title":"Video","color.asset.property.title":"Color","gradient.asset.property.title":"Gradient","pattern.asset.property.title":"Pattern","svgfilter.asset.property.title":"SVG Filter","inspector.tab.title.style":"Style","inspector.tab.title.component":"Component","inspector.tab.title.transition":"Transition & Animation","inspector.tab.title.asset":"Assets","inspector.tab.title.text":"Text","inspector.tab.title.code":"Code","timeline.property.title":"Timeline","timeline.animation.property.title":"Animations","timeline.play.control.play":"Play","timeline.play.control.pause":"Pause","timeline.play.control.first":"First","timeline.play.control.prev":"Previous","timeline.play.control.next":"Next","timeline.play.control.last":"Last","timeline.play.control.direction":"Direction","timeline.play.control.speed":"Speed","timeline.play.control.repeat":"Repeat","timeline.play.control.infinite":"Infinite","timeline.play.control.normal":"normal","timeline.play.control.alternate":"alternate","timeline.play.control.reverse":"reverse","timeline.play.control.alternate.reverse":"alternate reverse","timeline.value.editor.value":"Value","timeline.value.editor.time":"Time","timeline.value.editor.timing":"Timing","svgfilter.popup.title":"SVG Filter","css.item.rotate":"Rotate","css.item.rotateX":"Rotate X","css.item.rotateY":"Rotate Y","css.item.rotateZ":"Rotate Z","css.item.rotate3d":"3D Rotate","css.item.skewX":"Skew X","css.item.skewY":"Skew Y","css.item.translate":"Translate","css.item.translateX":"Translate X","css.item.translateY":"Translate Y","css.item.translateZ":"Translate Z","css.item.translate3d":"3D Translate","css.item.perspective":"Perspective","css.item.scale":"Scale","css.item.scaleX":"Scale X","css.item.scaleY":"Scale Y","css.item.scaleZ":"Scale Z","css.item.scale3d":"3D Scale","css.item.matrix":"Matrix","css.item.matrix3d":"3D Matrix","animation.property.title":"CSS Animation","animation.property.direction":"Direction","animation.property.play.state":"Play State","animation.property.fill.mode":"Fill Mode","animation.property.delay":"Delay","animation.property.duration":"Duration","animation.property.iteration.count":"Iteration Count","animation.property.Select a keyframe":"Select a keyframe","animation.property.popup.title":"Animation","animation.property.popup.timing.function":"Timing Function","animation.property.popup.keyframe":"Keyframe","animation.property.popup.direction":"Direction","animation.property.popup.play.state":"Play State","animation.property.popup.fill.mode":"Fill Mode","animation.property.popup.delay":"Delay","animation.property.popup.duration":"Duration","animation.property.popup.iteration":"Iteration","animation.property.popup.normal":"normal","animation.property.popup.reverse":"reverse","animation.property.popup.alternate":"alternate","animation.property.popup.alternate-reverse":"alternate-reverse","animation.property.popup.none":"none","animation.property.popup.forwards":"forwards","animation.property.popup.backwards":"backwards","animation.property.popup.both":"both","animation.property.popup.Select a keyframe":"Select a keyframe","keyframe.popup.title":"Keyframe","code.view.property.title":"CodeView","svg.filter.editor.tab.filter":"Filter","svg.filter.editor.tab.preset":"Preset","svg.filter.editor.tab.asset":"Assets","svg.filter.editor.GRAPHIC REFERENCES":"GRAPHIC REFERENCES","svg.filter.editor.SOURCES":"SOURCES","svg.filter.editor.MODIFIER":"MODIFIER","svg.filter.editor.LIGHTING":"LIGHTING","svg.filter.editor.COMBINERS":"COMBINERS","svg.filter.editor.Template":"Template","layout.property.title":"Layout","layout.property.flex":"Flex Box","layout.property.grid":"Grid","layout.property.default":"Default","flex.layout.editor.row":"Row","flex.layout.editor.column":"column","flex.layout.editor.row-reverse":"Row Reverse","flex.layout.editor.column-reverse":"Column Reverse","flex.layout.editor.nowrap":"Nowrap","flex.layout.editor.wrap":"Wrap","flex.layout.editor.wrap-reverse":"Wrap Reverse","flex.layout.editor.flex-start":"Start","flex.layout.editor.flex-end":"End","flex.layout.editor.center":"Center","flex.layout.editor.space-between":"Between","flex.layout.editor.space-around":"Around","flex.layout.editor.baseline":"BaseLine","flex.layout.editor.stretch":"Stretch","flex.layout.editor.direction":"Direction","flex.layout.editor.justify-content":"Justify Content","flex.layout.editor.align-items":"Align Items","flex.layout.editor.align-content":"Align Content","flex.layout.item.property.title":"Layout Item Detail","flex.layout.item.property.grow":"Flex Grow","flex.layout.item.property.shrink":"Flex Shrink","flex.layout.item.property.basis":"Flex Basis","flex.layout.item.property.none":"none","flex.layout.item.property.auto":"auto","flex.layout.item.property.value":"value","grid.layout.editor.template.columns":"Columns","grid.layout.editor.column.gap":"Column Gap","grid.layout.editor.template.rows":"Rows","grid.layout.editor.row.gap":"Row Gap","grid.box.editor.box.title":"Box","grid.box.editor.type":"Type","grid.box.editor.repeat":"Repeat","grid.box.editor.length":"Length","grid.box.editor.none":"None","grid.box.editor.auto":"Auto","grid.box.editor.count":"Count","grid.box.editor.value":"Size","grid.layout.item.property.title":"Layout Item Detail","grid.layout.item.property.column":"Column","grid.layout.item.property.row":"Row","grid.layout.item.property.start":"Start","grid.layout.item.property.end":"End","grid.layout.item.property.none":"none","grid.layout.item.property.value":"value","box.model.property.title":"Box Model","box.model.property.margin":"Margin","box.model.property.padding":"Padding","component.items.canvas":"Canvas","component.items.layer":"Layer","component.items.3dlayer":"3D Layer","component.items.drawing":"Drawing","component.items.custom":"Custom Component","svg.text.property.title":"SVG Text Style","svg.text.property.textarea":"Text Area","svg.text.property.size":"Font Size","svg.text.property.weight":"Font Weight","svg.text.property.style":"Font Style","svg.text.property.anchor":"Text Anchor","svg.text.property.family":"Font Family","svg.text.property.length.adjust":"Length Adjust","svg.text.property.text.length":"Text Length","svg.text.property.start.offset":"Start Offset","fill.picker.popup.title":"SVG Fragment picker","gradient.editor.drag.message":"Drag if you want to move center pointer.","draw.manager.tolerance":"Tolerance","pattern.property.title":"Pattern","pattern.info.popup.title":"Pattern Info","pattern.info.popup.width":"Width","pattern.info.popup.height":"Height","pattern.info.popup.lineWidth":"Line Width","pattern.info.popup.lineHeight":"Line Height","pattern.info.popup.rotate":"Rotate","pattern.info.popup.blend":"Blend Mode","pattern.info.popup.foreColor":"Fore","pattern.info.popup.backColor":"Back","stroke.dasharray.editor.add":"Add Dash"},ko_KR:{"app.title":"EASYLOGIC","app.sample":function(t,e,n){return"".concat(t,"-").concat(e,"-").concat(n)},"app.lang.en_US":"English","app.lang.ko_KR":"한국어","app.label.lang":"언어","app.theme.dark":"어두운","app.theme.light":"밝은","app.theme.gray":"회색","app.label.theme":"테마","app.tab.title.projects":"프로젝트","app.tab.title.layers":"레이어","app.tab.title.libraries":"라이브러리","app.tab.title.components":"컴포넌트","app.tab.title.assets":"에셋","app.tab.title.keyMap":"단축키","menu.item.download.title":"다운로드","menu.item.save.title":"저장","menu.item.export.title":"내보내기","menu.item.codepen.title":"CodePen","menu.item.fullscreen.title":"전체화면","menu.item.github.title":"Github","menu.item.learn.title":"배우기","project.property.title":"프로젝트","project.information.property.title":"프로젝트 정보","project.information.property.name":"이름","project.information.property.description":"설명","artboard.property.title":"아트보드","artboard.property.layout.title.flex":"플렉스","artboard.property.layout.title.grid":"그리드","layer.tree.property.title":"레이어","layer.tree.property.layout.title.flex":"플렉스","layer.tree.property.layout.title.grid":"그리드","alignment.property.title":"정렬","position.property.title":"위치","position.property.X":"X","position.property.Y":"Y","size.property.title":"크기","size.property.width":"넓이","size.property.height":"높이","background.color.property.title":"표시","background.color.property.color":"배경색","background.color.property.zindex":"z-index","background.color.property.opacity":"투명도","background.color.property.blend":"블렌드모드","background.color.property.overflow":"오버플로우","background.color.property.overflow.visible":"보이기","background.color.property.overflow.hidden":"숨기기","background.color.property.overflow.scroll":"스크롤","background.color.property.overflow.auto":"자동","blend.normal":"Normal(표준) 혼합모드","blend.multiply":"Multiply(곱하기) 모드","blend.screen":"Screen(스크린) 모드 ","blend.overlay":"Overlay(오버레이) 모드","blend.darken":"Darken(어둡기) 모드","blend.lighten":"Lighten(밝기) 모드 ","blend.color-dodge":"Color Dodge(컬러 닷지) 모드 ","blend.color-burn":"Color Burn(컬러 번) 모드 ","blend.hard-light":"Hard Light(하드 라이트) 모드 ","blend.soft-light":"Soft Light(소프트 라이트) 모드 ","blend.difference":"Difference(차이) 모드","blend.exclusion":"Exclusion(제외) 모드","blend.hue":"Hue(색조) 모드 ","blend.saturation":"Saturation(채도) 모드","blend.color":"Color(색상) 모드","blend.luminosity":"Luminosity(광도) 모드 ","background.image.property.title":"배경(그라디언트)","border.property.title":"외곽선","border.radius.property.title":"둥근 외곽선","boxshadow.property.title":"그림자","filter.property.title":"필터","filter.property.blur":"흐림(Blur)","filter.property.grayscale":"회색(GrayScale)","filter.property.hue-rotate":"색조(HueRotate)","filter.property.invert":"반전(Invert)","filter.property.brightness":"밝기(Brightness)","filter.property.contrast":"대\b조(Contrast)","filter.property.drop-shadow":"그림자(Drop Shadow)","filter.property.drop-shadow.color":"색","filter.property.drop-shadow.offsetX":"X 간격","filter.property.drop-shadow.offsetY":"Y 간격","filter.property.drop-shadow.blurRadius":"흐림","filter.property.opacity":"투명도(Opacity)","filter.property.saturate":"채도(Saturate)","filter.property.sepia":"갈색톤(Sepia)","filter.property.svg":"SVG","font.property.title":"폰트","font.property.color":"색","font.property.size":"크기","font.property.stretch":"뻗기","font.property.weight":"굵기","font.property.style":"스타일","font.property.family":"글꼴","font.spacing.property.title":"폰트 공간","font.spacing.property.lineHeight":"줄 높이","font.spacing.property.letterSpacing":"글자 간격","font.spacing.property.wordSpacing":"단어 간격","font.spacing.property.indent":"들여쓰기","backdrop.filter.property.title":"후면 필터","clippath.property.title":"클립패스","export.property.title":"내보내기","export.property.download":"다운로드","image.property.title":"이미지","image.property.origin":"원본","image.property.size":"크기","image.property.width":"넓이","image.property.height":"높이","video.property.title":"비디오","video.property.play":"시작","video.property.pause":"멈춤","video.property.volume":"볼륨","video.property.playbackRate":"빠르기","video.property.currentTime":"현재 시간","video.property.playTime":"플레이 시간 간격","motion.property.title":"모션","path.data.property.title":"패스 정보","polygon.data.property.title":"폴리곤 정보","text.property.title":"텍스트 스타일","text.property.align":"정렬","text.property.transform":"변형","text.property.decoration":"장식","text.clip.property.title":"텍스트 클립","text.shadow.property.title":"텍스트 그림자","text.fill.property.title":"텍스트 채우기","text.fill.property.fill":"채우기","text.fill.property.stroke":"윤곽선","text.fill.property.strokeWidth":"윤곽선 굵기","transform.property.title":"트랜스폼","transform.origin.property.title":"트랜스폼 Origin","transition.property.title":"CSS 트랜지션","keyframe.property.title":"CSS 키프레임","selector.property.title":"CSS 셀렉터","selector.property.none":"선택자 없음","perspective.property.title":"투영(perspective)","perspective.origin.property.title":"투영 중심점","svg.item.property.title":"SVG","svg.item.property.isMotionPath":"모션 패스","svg.item.property.fill":"채우기","svg.item.property.fillOpacity":"투명도","svg.item.property.path":"패스","svg.item.property.polygon":"폴리곤","svg.item.property.totalLength":"전체 길이","svg.item.property.fillRule":"채우기 규칙","svg.item.property.stroke":"선","svg.item.property.strokeWidth":"선 굵기","svg.item.property.dashArray":"점선 길이","svg.item.property.dashOffset":"점선 위치","svg.item.property.lineCap":"선 모양","svg.item.property.lineJoin":"겹친 선","svg.item.property.filter":"필터","border.editor.all":"전체","border.editor.width":"크기","border.editor.style":"스타일","border.editor.color":"색","border.editor.top":"위","border.editor.left":"왼쪽","border.editor.right":"오른쪽","border.editor.bottom":"아래","border.radius.editor.topLeft":"왼쪽 위","border.radius.editor.topRight":"오른쪽 위","border.radius.editor.bottomLeft":"왼쪽 아래","border.radius.editor.bottomRight":"오른쪽 아래","boxshadow.editor.blur":"흐림","boxshadow.editor.spread":"길이","css.property.editor.properties":"속성","offset.path.list.editor.path":"패스","offset.path.list.editor.totalLength":"전체 길이","offset.path.list.editor.distance":"거리","offset.path.list.editor.direction":"방향","offset.path.list.editor.rotate":"회전","svgfilter.select.editor.message.create":"새로운 SVG Filter 를 만드세요.","svgfilter.select.editor.message.select":"필터를 선택하세요.","fill.editor.message.click.image":"이미지를 선택하고 싶으면 프리뷰 영역을 클릭하세요.","fill.editor.message.drag.position":"가운데 위치를 드래그 해보세요.","fill.editor.x1":"시작 X","fill.editor.x2":"끝 X","fill.editor.y1":"시작 Y","fill.editor.y2":"끝 Y","fill.editor.spread":"확산","fill.editor.offset":"위치","fill.editor.cx":"중심점 X","fill.editor.cy":"중심점 Y","fill.editor.r":"끝 반지름","fill.editor.fx":"시작 X","fill.editor.fy":"시작 Y","fill.editor.fr":"시작 반지름","perspective.origin.editor.originX":"중심점 X","perspective.origin.editor.originY":"중심점 Y","path.manager.msg":"편집을 종료할 때는 ESC 키나 Enter 키를 누르세요. 또는 화면을 클릭하시면 됩니다.","path.manager.mode.modify":"점 편집","path.manager.mode.path":"점 추가","path.manager.mode.transform":"변형","path.manager.mode.flipX":"X축 회전","path.manager.mode.flipY":"Y축 회전","path.manager.mode.flipOrigin":"전체 회전","colorpicker.popup.title":"색상 선택","selector.popup.title":"선택자 속성","selector.popup.selector":"선택자","background.image.position.popup.title":"배경 패턴","background.image.position.popup.size":"크기","background.image.position.popup.width":"넓이","background.image.position.popup.height":"높이","background.image.position.popup.repeat":"반복","background.image.position.popup.blend":"블렌드","background.image.position.popup.type.repeat":"반복","background.image.position.popup.type.no-repeat":"반복 안함","background.image.position.popup.type.repeat-x":"x축 반복","background.image.position.popup.type.repeat-y":"y축 반복","background.image.position.popup.type.space":"공백유지","background.image.position.popup.type.round":"반올림","gradient.picker.popup.title":"그라디언트와 이미지","image.asset.property.title":"이미지","video.asset.property.title":"비디오","color.asset.property.title":"색","gradient.asset.property.title":"그라디언트","pattern.asset.property.title":"패턴","svgfilter.asset.property.title":"SVG 필터","inspector.tab.title.style":"스타일 속성","inspector.tab.title.component":"컴포넌트 속성","inspector.tab.title.transition":"트랜지션과 애니메이션 속성","inspector.tab.title.asset":"에셋 관리자","inspector.tab.title.text":"텍스트","inspector.tab.title.code":"코드","timeline.property.title":"타임라인","timeline.animation.property.title":"애니메이션","timeline.play.control.play":"플레이","timeline.play.control.pause":"멈춤","timeline.play.control.first":"처음으로","timeline.play.control.prev":"이전으로","timeline.play.control.next":"다음으로","timeline.play.control.last":"마지막으로","timeline.play.control.direction":"방향","timeline.play.control.speed":"속력","timeline.play.control.repeat":"반복","timeline.play.control.infinite":"무한","timeline.play.control.normal":"normal","timeline.play.control.alternate":"alternate","timeline.play.control.reverse":"reverse","timeline.play.control.alternate.reverse":"alternate reverse","timeline.value.editor.value":"값","timeline.value.editor.time":"시간","timeline.value.editor.timing":"타이밍 함수","svgfilter.popup.title":"SVG 필터","css.item.rotate":"회전","css.item.rotateX":"X축 회전","css.item.rotateY":"Y축 회전","css.item.rotateZ":"Z축 회전","css.item.rotate3d":"3D 회전","css.item.skewX":"X축 늘이기","css.item.skewY":"Y축 늘이기","css.item.translate":"이동","css.item.translateX":"X축 이동","css.item.translateY":"Y축 이동","css.item.translateZ":"Z축 이동","css.item.translate3d":"3D 이동","css.item.perspective":"원근","css.item.scale":"크기변경","css.item.scaleX":"X축 크기변경","css.item.scaleY":"Y축 크기변경","css.item.scaleZ":"Z축 크기변경","css.item.scale3d":"3D 크기변경","css.item.matrix":"변환 행렬","css.item.matrix3d":"3D 변환 행렬","animation.property.title":"CSS 애니메이션","animation.property.direction":"방향","animation.property.play.state":"플레이 상태","animation.property.fill.mode":"채우기 모드","animation.property.delay":"대기시간","animation.property.duration":"시간","animation.property.iteration.count":"반복 횟수","animation.property.select a keyframe":"키프레임을 선택해주세요","animation.property.popup.title":"CSS 애니메이션","animation.property.popup.timing.function":"타이밍 함수","animation.property.popup.keyframe":"키프레임","animation.property.popup.direction":"방향","animation.property.popup.play.state":"플레이 상태","animation.property.popup.fill.mode":"채우기 모드","animation.property.popup.delay":"대기시간","animation.property.popup.duration":"시간","animation.property.popup.iteration":"반복 횟수","animation.property.popup.normal":"시간순","animation.property.popup.reverse":"역시간순","animation.property.popup.alternate":"왕복 시간순","animation.property.popup.alternate-reverse":"왕복 역시간순","animation.property.popup.none":"none","animation.property.popup.forwards":"forwards","animation.property.popup.backwards":"backwards","animation.property.popup.both":"both","animation.property.popup.Select a keyframe":"키프레임을 선택해주세요.","keyframe.popup.title":"키프레임","code.view.property.title":"코드뷰","svg.filter.editor.tab.filter":"필터","svg.filter.editor.tab.preset":"프리셋","svg.filter.editor.tab.asset":"에셋","svg.filter.editor.GRAPHIC REFERENCES":"참조 그래픽","svg.filter.editor.SOURCES":"원본","svg.filter.editor.MODIFIER":"수정","svg.filter.editor.LIGHTING":"빛","svg.filter.editor.COMBINERS":"결합","svg.filter.editor.Template":"템플릿","layout.property.title":"레이아웃","layout.property.flex":"플렉스 박스","layout.property.grid":"그리드","layout.property.default":"기본 좌표","flex.layout.editor.row":"행","flex.layout.editor.column":"열","flex.layout.editor.row-reverse":"역방향 행","flex.layout.editor.column-reverse":"역방향 열","flex.layout.editor.nowrap":"감싸지 않기","flex.layout.editor.wrap":"감싸기","flex.layout.editor.wrap-reverse":"역방향 감싸기","flex.layout.editor.flex-start":"시작","flex.layout.editor.flex-end":"끝","flex.layout.editor.center":"중간","flex.layout.editor.space-between":"공간 중간 채움","flex.layout.editor.space-around":"공간 양끝 채움","flex.layout.editor.baseline":"기본선","flex.layout.editor.stretch":"펼치기","flex.layout.editor.direction":"방향","flex.layout.editor.justify-content":"컨텐츠 조정","flex.layout.editor.align-items":"아이템 정렬","flex.layout.editor.align-content":"컨텐츠 정렬","flex.layout.item.property.title":"플렉스 아이템 설정","flex.layout.item.property.grow":"공간 비율","flex.layout.item.property.shrink":"축소 비율","flex.layout.item.property.basis":"초기 크기","flex.layout.item.property.none":"없음","flex.layout.item.property.auto":"자동","flex.layout.item.property.value":"값","grid.layout.editor.template.columns":"열","grid.layout.editor.column.gap":"열 간격","grid.layout.editor.template.rows":"행","grid.layout.editor.row.gap":"행 간격","grid.box.editor.box.title":"영역","grid.box.editor.type":"타입","grid.box.editor.repeat":"반복","grid.box.editor.length":"길이","grid.box.editor.none":"없음","grid.box.editor.auto":"자동","grid.box.editor.count":"개수","grid.box.editor.value":"크기","grid.layout.item.property.title":"그리드 아이템 설정","grid.layout.item.property.column":"열","grid.layout.item.property.row":"행","grid.layout.item.property.start":"시작","grid.layout.item.property.End":"끝","grid.layout.item.property.none":"없음","grid.layout.item.property.value":"값","box.model.property.title":"박스 모델","box.model.property.margin":"마진","box.model.property.padding":"패딩","component.items.canvas":"캔버스","component.items.layer":"레이어","component.items.3dlayer":"3D 레이어","component.items.drawing":"그리기","component.items.custom":"사용자 정의 컴포넌트","svg.text.property.title":"SVG Text 스타일","svg.text.property.textarea":"텍스트 입력","svg.text.property.size":"폰트 크기","svg.text.property.weight":"폰트 굵기","svg.text.property.style":"폰트 스타일","svg.text.property.anchor":"텍스트 위치","svg.text.property.family":"폰트 글꼴","svg.text.property.length.adjust":"길이 대응","svg.text.property.text.length":"텍스트 길이","svg.text.property.start.offset":"시작 지점","fill.picker.popup.title":"색 채우기","gradient.editor.drag.message":"드래그 하면 중심점을 옮길 수 있습니다.","draw.manager.tolerance":"포인트 허용 오차","pattern.property.title":"패턴","pattern.info.popup.title":"패턴 정보","pattern.info.popup.width":"넓이","pattern.info.popup.height":"높이","pattern.info.popup.lineWidth":"선 넓이","pattern.info.popup.lineHeight":"선 높이","pattern.info.popup.rotate":"회전","pattern.info.popup.blend":"블렌드","pattern.info.popup.foreColor":"패턴색","pattern.info.popup.backColor":"배경색","stroke.dasharray.editor.add":"점 추가"}},Vo={locales:Io,get:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"en_US",r=Io[n][t]||Io.en_US[t]||t||void 0;if(X(r))return r(e);var o=r;return t===o?t.split(".").pop():(T(e,(function(t,e){o=o.replace(new RegExp("{".concat(t,"}"),"ig"),e)})),o)},hasKey:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"en_US";return!(!Io[e][t]&&!Io.en_US[t])}},Mo={dark:{left_size:250,left_max_size:400,timeline_grid_font_color:"#ececec",timeline_line_color:"red",timeline_timeview_bottom_color:"black"},light:{left_size:250,left_max_size:400,timeline_grid_font_color:"black",timeline_line_color:"#4778d4",timeline_timeview_bottom_color:"#ececec"},gray:{left_size:250,left_max_size:400,timeline_grid_font_color:"black",timeline_line_color:"#4778d4",timeline_timeview_bottom_color:"#ececec"}};function Lo(t){return function(t){if(Array.isArray(t))return Bo(t)}(t)||function(t){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(t))return Array.from(t)}(t)||function(t,e){if(!t)return;if("string"==typeof t)return Bo(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);"Object"===n&&t.constructor&&(n=t.constructor.name);if("Map"===n||"Set"===n)return Array.from(t);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return Bo(t,e)}(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Bo(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);nt.length)&&(e=t.length);for(var n=0,r=new Array(e);n0&&void 0!==arguments[0]?arguments[0]:{};return Ko(this,t),this.ref=new Proxy(this,{get:function(t,e){var n=t[e];return X(n)?function(){for(var e=arguments.length,r=new Array(e),o=0;o0&&void 0!==arguments[0]?arguments[0]:"";return this.json.id+t}},{key:"recover",value:function(){}},{key:"setCache",value:function(){}},{key:"is",value:function(){if(!this.json)return!1;for(var t=arguments.length,e=new Array(t),n=0;n-1}},{key:"isNot",value:function(){return!1===this.is.apply(this,arguments)}},{key:"convert",value:function(t){var e=this;return t.layers&&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(Object.assign(this.json,e))}},{key:"getDefaultObject",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=Pt();return Yo({id:e,visible:!0,lock:!1,selected:!1,layers:[]},t)}},{key:"add",value:function(t){var e=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"self";if(t.parent&&t.remove(),"self"===n)this.json.layers.push(t),t.parent=this.ref;else if("before"===n){t.parent=this.parent.ref;var r=[];this.parent.layers.forEach((function(n){n===e.ref&&r.push(t),r.push(n)})),this.parent.layers=r}else"after"===n&&(t.parent=this.parent.ref,r=[],this.parent.layers.forEach((function(n){r.push(n),n===e.ref&&r.push(t)})),this.parent.layers=r);return t}},{key:"toggle",value:function(t,e){M(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:"hasParent",value:function(t){var e=this.json.parent.id===t;return e||!1!==this.json.parent.is("project")?e:this.json.parent.hasParent(t)}},{key:"getIndex",value:function(){for(var t=-1,e=0,n=this.json.parent.layers.length;e-1&&this.setOrder(t+1)}},{key:"orderPrev",value:function(){var t=this.getIndex();t>0&&this.setOrder(t-1)}},{key:"orderFirst",value:function(){this.setOrder(0)}},{key:"orderLast",value:function(){this.setOrder(this.json.parent.layers.length-1)}},{key:"searchById",value:function(t){if(this.id===t)return this.ref;for(var e=0,n=this.layers.length;e0&&void 0!==arguments[0]?arguments[0]:{};return ti({selected:!1,layers:[]},t)}},{key:"isAttribute",value:function(){return!0}},{key:"toCSS",value:function(){return{}}},{key:"toString",value:function(){return Q(this.toCSS())}}])&&ri(e.prototype,n),r&&ri(e,r),i}(qo);function si(t){return(si="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 li(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(t)))return;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)||pi(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function fi(t){return function(t){if(Array.isArray(t))return yi(t)}(t)||function(t){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(t))return Array.from(t)}(t)||pi(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function pi(t,e){if(t){if("string"==typeof t)return yi(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?yi(t,e):void 0}}function yi(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n1&&void 0!==arguments[1]?arguments[1]:[];return F(e)&&(e=[e]),i.filter(t,(function(t){return!1===e.includes(t.type)}))}},{key:"filter",value:function(t,e){return i.join(i.parseStyle(t).filter((function(t){return e(t)})))}},{key:"replace",value:function(t,e){var n=i.parseStyle(t),r=n.find((function(t){return t.type===e.type}));return r?r.value=e.value:n.push(e),i.join(n)}},{key:"replaceAll",value:function(t,e){for(var n=i.parseStyle(t),r=i.parseStyle(e),o=0,a=r.length;o0&&void 0!==arguments[0]?arguments[0]:{};return gi(Si(i.prototype),"getDefaultObject",this).call(this,di({itemType:"transform",type:"",value:[]},t))}},{key:"toCloneObject",value:function(){return di(di({},gi(Si(i.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=gi(Si(i.prototype),"convert",this).call(this,t)).type.includes("matrix")||t.type.includes("scale")?t.value=t.value.map((function(t){return ln.number(t)})):t.value=t.value.map((function(t){return ln.parse(t)})),t}},{key:"hasNumberValue",value:function(){var t=this.json.type;return t.includes("matrix")||t.includes("scale")}}])&&mi(e.prototype,n),r&&mi(e,r),i}(ui);function xi(t){return(xi="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 Ri(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(t)))return;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)||Ei(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function $i(t){return function(t){if(Array.isArray(t))return _i(t)}(t)||function(t){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(t))return Array.from(t)}(t)||Ei(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Ei(t,e){if(t){if("string"==typeof t)return _i(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?_i(t,e):void 0}}function _i(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);nthis.screenX2.value||t.y.value>this.screenY2.value)}},{key:"toBoundCSS",value:function(){var t=this.json,e=t.x;return{top:t.y,left:e,width:t.width,height:t.height,transform:t.transform,"transform-origin":t["transform-origin"]}}},{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:"getTransform",value:function(t){var e=Pi.parseStyle(dn.create(t).css("transform")),n=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1];if(!e.length)return{rotate:{x:0,y:0,z:0},translate:{x:0,y:0,z:0}};var r,o,i=(n=e[0].value.map((function(t){return+t})))[0],a=(n[1],n[2]),c=(n[3],n[4]),u=n[5],s=(n[6],n[7],n[8]),l=n[9],f=n[10],p=(n[11],n[12]),y=n[13],h=n[14],d=(n[15],Math.asin(-s));return 0!==Math.cos(d)?(r=Math.atan2(l,f),o=Math.atan2(c,i)):(r=Math.atan2(a,u),o=0),{rotate:{x:r,y:d,z:o},translate:{x:p,y:y,z:h}}}},{key:"verties",value:function(t,e){for(var n=t.offsetRect(),r=n.height,o=n.width/2,i=r/2,a={a:{x:-o,y:-i,z:0},b:{x:o,y:-i,z:0},c:{x:o,y:i,z:0},d:{x:-o,y:i,z:0}},c=this.getTransform(t.el);t.el&&(c=this.getTransform(t.el),a.a=lt.addVector(lt.rotateVector(a.a,c.rotate),c.translate),a.b=lt.addVector(lt.rotateVector(a.b,c.rotate),c.translate),a.c=lt.addVector(lt.rotateVector(a.c,c.rotate),c.translate),a.d=lt.addVector(lt.rotateVector(a.d,c.rotate),c.translate),(t=t.parent()).el!==e););return a}},{key:"checkInAreaForLayers",value:function(t){var e=[];return this.layers.forEach((function(n){e.push.apply(e,$i(n.checkInAreaForLayers(t))),n.checkInArea(t)&&e.push(n)})),e}},{key:"isAbsolute",get:function(){return"absolute"===this.json.position}},{key:"isRelative",get:function(){return"relative"===this.json.position}},{key:"isChild",get:function(){return!(!this.json.parent||!1!==this.json.parent.is("project")||!this.isAbsolute)}},{key:"screenX",get:function(){return this.isChild?ln.px(this.json.parent.screenX.value+this.json.x.value):this.json.x||ln.px(0)}},{key:"screenY",get:function(){return this.isChild?ln.px(this.json.parent.screenY.value+this.json.y.value):this.json.y||ln.px(0)}},{key:"screenX2",get:function(){return ln.px(this.screenX.value+this.json.width.value)}},{key:"screenY2",get:function(){return ln.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)),ln.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)),ln.px(this.screenY.value+t)}},{key:"transformOrigin",get:function(){var t=Ri((this.json["transform-origin"]||"50% 50%").split(" ").map((function(t){return ln.parse(t||"50%")})),2),e=t[0],n=t[1];return{left:e=e.toPx(this.screenWidth.value),top:n=n.toPx(this.screenHeight.value)}}},{key:"screenTransform",get:function(){return Pi.addTransform(this.json.parent.screenTransform,this.json.transform)}}])&&Ii(e.prototype,n),r&&Ii(e,r),i}(qo);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,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function Xi(t){for(var e=1;e0&&void 0!==arguments[0]?arguments[0]:{};return Xi({selected:!1,layers:[]},t)}}])&&Ki(e.prototype,n),r&&Ki(e,r),i}(Fi);function Qi(t,e){for(var n=0;nt.length)&&(e=t.length);for(var n=0,r=new Array(e);n1&&void 0!==arguments[1]?arguments[1]:1;return ln.px(t).round(e)};function oa(t,e){var n=[];return t.layers.length&&t.layers.forEach((function(t){n.push.apply(n,ta(oa(t,e)))})),(e.id||e.includes(t.id))&&n.push(t),n}var ia=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={},this.colorsteps=[]}var e,n,r;return e=t,(n=[{key:"initialize",value:function(){this.colorsteps=[],this.items=[],this.itemKeys={}}},{key:"getRootItem",value:function(t){var e=t||this.currentArtboard;return t&&(t.is("artboard")?e=t:t.parent&&(e=t.parent)),e}},{key:"selectColorStep",value:function(){for(var t=arguments.length,e=new Array(t),n=0;n=t.length?{done:!0}:{done:!1,value:t[r++]}},e:function(t){throw t},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,c=!1;return{s:function(){n=t[Symbol.iterator]()},n:function(){var t=n.next();return a=t.done,t},e:function(t){c=!0,i=t},f:function(){try{a||null==n.return||n.return()}finally{if(c)throw i}}}}(r);try{for(i.s();!(e=i.n()).done;){var a=e.value;n.has(a)&&o++}}catch(t){i.e(t)}finally{i.f()}return r.size!=o}},{key:"select",value:function(){for(var t=this,e=arguments.length,n=new Array(e),r=0;r0&&void 0!==arguments[0]?arguments[0]:null;return B(t)?oa(this.artboard,t):F(t)||H(t)?oa(this.artboard,[t]):this.items}},{key:"selectById",value:function(t){this.select.apply(this,ta(oa(this.artboard,t)))}},{key:"addById",value:function(t){this.itemKeys[t]||this.select.apply(this,ta(this.items).concat(ta(oa(this.artboard,t))))}},{key:"removeById",value:function(t){this.select.apply(this,ta(this.items.filter((function(e){return e.id!=t}))))}},{key:"toggleById",value:function(t){this.itemKeys[t]?this.removeById(t):this.addById(t)}},{key:"setRectCache",value:function(){var t=!(arguments.length>0&&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 Ji({x:ln.px(t),y:ln.px(e),width:ln.px(n-t),height:ln.px(r-e)})}},{key:"each",value:function(t){var e=this;X(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:"resetCallback",value:function(t){this.each((function(e){return e.reset(t(e))}))}},{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,ta(this.copyItems.map((function(t){return t.copy()})))),this.copy()}},{key:"isInParent",value:function(t){for(var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],n=t,r=n.parent,o=!n.is("artboard")&&e.includes(r);!o&&!M(r);)n=r,r=r.parent,o=!n.is("artboard")&&e.includes(r);return o}},{key:"move",value:function(t,e){var n=this;this.each((function(r,o){n.isInParent(r,n.items)||r.move(ra(o.x.value+t),ra(o.y.value+e))})),this.reselect()}},{key:"moveRight",value:function(t){this.each((function(e,n){e.resizeWidth(ra(n.width.value+t))}))}},{key:"moveLeft",value:function(t){this.each((function(e,n){n.width.value-t>=0&&(e.moveX(ra(n.x.value+t)),e.resizeWidth(ra(n.width.value-t)))}))}},{key:"moveBottom",value:function(t){this.each((function(e,n){e.resizeHeight(ra(n.height.value+t))}))}},{key:"moveTop",value:function(t){this.each((function(e,n){n.height.value-t>=0&&(e.moveY(ra(n.y.value+t)),e.resizeHeight(ra(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}}])&&Qi(e.prototype,n),r&&Qi(e,r),t}();function aa(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function ca(t,e){for(var n=0;n1&&void 0!==arguments[1]?arguments[1]:{},n=this.getComponentClass(t);if(!n)throw new Error("".concat(t," type is not valid."));return new n(e)}}])&&ca(e.prototype,n),r&&ca(e,r),t}());function sa(t,e){for(var n=0;n1&&void 0!==arguments[1]?arguments[1]:"keydown",r=this.checkShortCut(this.makeKeyString(t),this.makeCodeString(t));if(r){var o=r.filter((function(t){return t.eventType===n})).filter((function(t){return e.checkWhen(t)}));o.length&&t.preventDefault(),o.forEach((function(t){e.$editor.emit(t.command,t.args)}))}}}])&&ha(e.prototype,n),r&&ha(e,r),t}();function ba(t,e){for(var n=0;nt.length)&&(e=t.length);for(var n=0,r=new Array(e);n1&&void 0!==arguments[1]&&arguments[1],r=e.split("data:"),o=Oa(r,2),i=(o[0],o[1]),a=i.split(","),c=wa(a),u=c[0],s=c.slice(1),l=u.split(";"),f=Oa(l,2),p=f[0],y=f[1];return s=s.join(","),{mimeType:p,local:n&&t.getLink(p,y,s)}}},{key:"getLink",value:function(t,e,n){if("base64"===e){for(var r=atob(n),o=r.length,i=new Uint8Array(o),a=0;a1&&void 0!==arguments[1]&&arguments[1];t.emit("noneSelectMenu"),e?t.emit("refreshSelectionStyleView"):t.emit("refreshAll"),t.emit("refreshAllElementBoundSize"),t.emit("refreshSelection"),t.emit("refreshSelectionTool")}function _a(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(t)))return;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(t,e){if(!t)return;if("string"==typeof t)return Ca(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);"Object"===n&&t.constructor&&(n=t.constructor.name);if("Map"===n||"Set"===n)return Array.from(t);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return Ca(t,e)}(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Ca(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);nt.length)&&(e=t.length);for(var n=0,r=new Array(e);nc&&(n[a].mark=!0,t.DouglasPeuker(e,n,r,a),t.DouglasPeuker(e,n,a,o))}}},{key:"simply",value:function(e,n){return e.length<=2?e:((e=N(e))[0].mark=!0,e[e.length-1].mark=!0,t.DouglasPeuker(n,e,0,e.length-1),e.filter((function(t){return Boolean(t.mark)})))}},{key:"segmentDistance2",value:function(t,e,n,r){var o=r.x-n.x,i=r.y-n.y,a=o*o+i*i,c=t-n.x,u=e-n.y,s=o*c+i*u;if(0===a)return c*c+u*u;if(s<=0)return c*c+u*u;if(s>=a)return(c=t-r.x)*c+(u=e-r.y)*u;var l=c*i-u*o;return l*l/a}},{key:"isInLine",value:function(t,e,n){return t.x===n.x?e.x===n.x:t.y===n.y?e.y===n.y:(t.x-n.x)*(t.y-n.y)==(n.x-e.x)*(n.y-e.y)}},{key:"isLine",value:function(e){return t.isInLine(e.endPoint,e.startPoint,e,reversePoint)}},{key:"getReversePoint",value:function(t,e){var n=t.x-e.x,r=t.y-e.y;return{x:t.x+n,y:t.y+r}}},{key:"getIndexPoint",value:function(t,e){return t[e]}},{key:"getPoint",value:function(e,n){return e.filter((function(e){return t.isEqual(e.startPoint,n)}))[0]}},{key:"getIndex",value:function(e,n){for(var r=-1,o=0,i=e.length;o0;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){var r=e[n],o=e[n+1];return o&&(o.index=n+1),r.connected&&(o=t.getFirstPoint(e,n)),o}},{key:"removePoint",value:function(t,e,n){if("startPoint"===n)return t.filter((function(t,n){return n!==e}))}},{key:"splitPoints",value:function(e){var n=[],r=[];return e.forEach((function(e){t.isFirst(e)?(r=[e],n.push(r)):r.push(e)})),n}},{key:"recoverPoints",value:function(t){var e=[];return t.forEach((function(t){t.forEach((function(t,e){0===e&&(t.command="M",t.originalCommand="M")})),e.push.apply(e,Ta(t))})),e.forEach((function(t,e){t.index=e})),e}}],(n=null)&&Aa(e.prototype,n),r&&Aa(e,r),t}();function Va(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(t)))return;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)||La(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Ma(t){return function(t){if(Array.isArray(t))return Ba(t)}(t)||function(t){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(t))return Array.from(t)}(t)||La(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function La(t,e){if(t){if("string"==typeof t)return Ba(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Ba(t,e):void 0}}function Ba(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n1&&void 0!==arguments[1]?arguments[1]:0,r=+e[n],o=+e[n+1];return[t[0][0]*r+t[0][1]*o+t[0][2],t[1][0]*r+t[1][1]*o+t[1][2],1]}},toPercent:function(t,e){return function(n){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,o=+n[r],i=+n[r+1];return[o/t,i/e,1]}},toPixel:function(t,e){return function(n){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,o=+n[r],i=+n[r+1];return[o*t,i*e,1]}},translate:function(t,e){return this.multiply([[1,0,t],[0,1,e],[0,0,1]])},rotate:function(t){return this.multiply([[Math.cos(t),-Math.sin(t),0],[Math.sin(t),Math.cos(t),0],[0,0,1]])},rotateCenter:function(t,e,n){return this.multiply([[Math.cos(t),-Math.sin(t),-e*Math.cos(t)+n*Math.sin(t)+e],[Math.sin(t),Math.cos(t),-e*Math.sin(t)-n*Math.cos(t)+n],[0,0,1]])},scale:function(t,e){return this.multiply([[t,0,0],[0,e,0],[0,0,1]])},skewX:function(t){return this.multiply([[1,t,0],[0,1,0],[0,0,1]])},skewY:function(t){return this.multiply([[1,0,0],[t,1,0],[0,0,1]])},reflectionOrigin:function(){return this.multiply([[-1,0,0],[0,-1,0],[0,0,1]])},flipX:function(){return this.multiply([[1,0,0],[0,-1,0],[0,0,1]])},flipY:function(){return this.multiply([[-1,0,0],[0,1,0],[0,0,1]])}},Ya=function(){function t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";za(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(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",e=t.match(Ha)||[];return e.filter((function(t){return""!=t}))}},{key:"parse",value:function(){var t=this,e=this.pathString.match(Ga)||[];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;o0&&void 0!==arguments[0]?arguments[0]:[],n=new t,r=0,o=e.length;r1&&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()}}])&&Ja(e.prototype,n),r&&Ja(e,r),t}();function tc(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function ec(t){for(var e=1;e1&&void 0!==arguments[1]?arguments[1]:[];t.emit("updateResource",e)}},oc={command:"updateImage",execute:function(t,e,n){var r=new FileReader;r.onload=function(r){var o=r.target.result,i=URL.createObjectURL(e);t.emit("addImageAssetItem",{id:Pt(),type:e.type,name:e.name,original:o,local:i},n)},r.readAsDataURL(e)}},ic={command:"updateVideo",execute:function(t,e,n){var r=new FileReader;r.onload=function(r){var o=r.target.result,i=URL.createObjectURL(e);t.emit("addVideoAssetItem",{id:Pt(),type:e.type,name:e.name,original:o,local:i},n)},r.readAsDataURL(e)}};function ac(t,e){var n=new Image;n.onload=function(){var r={local:t.local,naturalWidth:ln.px(n.naturalWidth),naturalHeight:ln.px(n.naturalHeight),width:ln.px(n.naturalWidth),height:ln.px(n.naturalHeight)};e&&e(r,n)},n.src=t.local}function cc(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function uc(t){for(var e=1;e2&&void 0!==arguments[2]?arguments[2]:{},r=t.selection.currentProject;r&&(r.createImage(e),t.emit("addImageAsset"),ac(e,(function(r){t.emit("addImage",uc(uc({src:e.local},r),n)),t.changeMode(ap),t.emit("afterChangeMode")})))}};function fc(t,e){var n=document.createElement("video");n.onloadeddata=function(){var r={local:t.local,naturalWidth:ln.px(n.videoWidth),naturalHeight:ln.px(n.videoHeight),width:ln.px(n.videoWidth),height:ln.px(n.videoHeight),duration:n.duration,playTime:"0:1:".concat(n.duration),volume:n.volume,muted:n.muted,placebackRate:n.playbackRate};e&&e(r,n)},n.src=t.local}function pc(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function yc(t){for(var e=1;e2&&void 0!==arguments[2]?arguments[2]:{},r=t.selection.currentProject;r&&(r.createVideo(e),t.emit("addVideoAsset"),fc(e,(function(r){t.emit("addVideo",yc(yc({src:e.local},r),n)),t.changeMode(ap),t.emit("afterChangeMode")})))}};function vc(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function bc(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}var mc={command:"dropImageUrl",execute:function(t,e){ac({local:e},(function(e){t.emit("addImage",function(t){for(var e=1;e-1){var r=Ra.parse(n,!0);switch(r.mimeType){case"image/png":case"image/gif":case"image/jpg":case"image/jpeg":t.emit("addImageAssetItem",{id:Pt(),type:r.mimeType,name:"",original:n,local:r.local})}}else{var o=e.data.split(".").pop(),i=e.data.split("/").pop();switch(o){case"png":case"jpg":case"gif":case"svg":t.emit("addImageAssetItem",{id:Pt(),type:"image/"+o,name:i,original:e.data,local:e.data})}}}};function Sc(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"easylogic.json",n=document.createElement("a");n.href=t,n.download=e,n.click()}var jc={command:"downloadJSON",execute:function(t,e){var n=JSON.stringify(t.projects);Sc("data:application/json;base64,"+window.btoa(n),e||"easylogic.json")}};function Pc(t){return function(t){if(Array.isArray(t))return xc(t)}(t)||function(t){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(t))return Array.from(t)}(t)||function(t,e){if(!t)return;if("string"==typeof t)return xc(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);"Object"===n&&t.constructor&&(n=t.constructor.name);if("Map"===n||"Set"===n)return Array.from(t);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return xc(t,e)}(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function xc(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n1&&void 0!==arguments[1]?arguments[1]:"anipa";switch(e){case"anipa":return new $c(t).generateCode()}return""},_c={makeProjectStyle:function(t){var e=t.toKeyframeString(),n=t.toRootVariableCSS();return"\n :root {\n ".concat(Q(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(t){var e=t.selection.currentProject,n=t.selection.currentArtboard,r="\n".concat(this.makeStyle(e),"\n").concat(this.makeStyle(n,"\n left: 0px;\n top: 0px;\n")),o="\n".concat(n.html,"\n").concat(this.makeSvg(e),"\n "),i=Ec(n,"anipa");return{html:o=t.replaceLocalUrltoRealUrl(o),css:r=t.replaceLocalUrltoRealUrl(r),js:i=t.replaceLocalUrltoRealUrl(i)}},generateSVG:function(t,e){return t.replaceLocalUrltoRealUrl(e.generateSVG(!0))}},Cc={command:"downloadSVG",execute:function(t){var e=t.selection.current||t.$selection.currentArtboard,n=_c.generateSVG(t,e).trim();Sc("data:image/svg+xml;base64,"+window.btoa(n),e.id)}};var Tc={command:"downloadPNG",execute:function(t){var e=t.selection.current||t.selection.currentArtboard,n=_c.generateSVG(t,e).trim(),r="data:image/svg+xml;base64,"+window.btoa(n),o=e.id;ac({local:r},(function(t,e){!function(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"image/png",r=dn.create("canvas"),o=t.width,i=t.height;r.resize({width:o,height:i}),r.drawImage(t),e&&e(r.toDataURL(n))}(e,(function(t){Sc(t,o)}))}))}},Dc={command:"load.json",execute:function(t,e){var n=(e=e||t.loadResource("projects",[])).map((function(e){return function t(e,n){return n.layers=n.layers.map((function(n){return t(e,n)})),e.components.createComponent(n.itemType,n)}(t,e)}));if(n.forEach((function(t){t.artboards.forEach((function(t){t.selectTimeline()}))})),n.length){var r=n[0];if(t.selection.selectProject(r),r.artboards.length){var o=r.artboards[0];t.selection.selectArtboard(o),o.layers.length?t.selection.select(o.layers[0]):t.selection.select(o)}t.load(n),Ea(t)}else t.emit("addArtBoard")}};function Ac(t,e){var n=t.selection.currentArtboard;if(n){var r=n.getSelectedTimeline();e&&e(n,r)}}var Ic={command:"addTimelineProperty",execute:function(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{timing:"linear"};Ac(t,(function(r,o){var i;!1===B(e)&&(e=[e]);var a=[];e.forEach((function(t){var e={layerId:t,property:n.property,value:n.value+"",timing:n.timing,editor:n.editor},o=r.addTimelineKeyframe(e);o&&a.push(o)})),(i=t.timeline).select.apply(i,a),t.emit("refreshTimeline"),t.emit("refreshSelectedOffset")}))}},Vc={command:"setTimelineOffset",debounce:100,execute:function(t,e){Ac(t,(function(n,r){n.setTimelineKeyframeOffsetValue(e.layerId,e.property,e.id,e.value,e.timing,e.time),t.emit("refreshTimeline")}))}},Mc={command:"addTimelineCurrentProperty",execute:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{timing:"linear"};Ac(t,(function(n,r){var o,i=[];t.selection.each((function(t){var r={layerId:t.id,property:e.property,value:t[e.property]+"",timing:e.timing,editor:e.editor},o=n.addTimelineKeyframe(r);o&&i.push(o)})),(o=t.timeline).select.apply(o,i),t.emit("refreshTimeline"),t.emit("refreshSelectedOffset")}))}},Lc={command:"removeTimelineProperty",execute:function(t,e,n){Ac(t,(function(r,o){r.removeTimelineProperty(e,n),t.timeline.empty(),t.emit("refreshTimeline"),t.emit("refreshSelectedOffset")}))}},Bc={command:"deleteTimelineKeyframe",execute:function(t){Ac(t,(function(e,n){t.timeline.each((function(t){e.deleteTimelineKeyframe(t.layerId,t.property,t.id)})),t.timeline.empty(),t.emit("refreshTimeline"),t.emit("refreshSelectedOffset")}))}},zc={command:"selectTimelineItem",execute:function(t,e){Ac(t,(function(n,r){n.selectTimeline(e),t.emit("refreshTimeline"),t.emit("selectTimeline")}))}},Fc={command:"removeTimeline",execute:function(t,e){Ac(t,(function(n,r){n.removeTimeline(e),t.timeline.empty(),t.emit("refreshTimeline"),t.emit("refreshSelectedOffset")}))}},Gc={command:"removeAnimationItem",execute:function(t,e){Ac(t,(function(n,r){n.removeAnimation(e),t.timeline.empty(),t.emit("refreshTimeline"),t.emit("removeAnimation")}))}},Hc={command:"addTimelineKeyframe",execute:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{timing:"linear"};Ac(t,(function(n,r){var o=n.searchById(e.layerId),i={layerId:e.layerId,property:e.property,time:e.time,value:o[e.property]+"",timing:e.timing,editor:e.editor},a=n.addTimelineKeyframe(i);t.timeline.select(a),t.emit("refreshTimeline"),t.emit("refreshSelectedOffset")}))}},Xc={command:"copyTimelineProperty",execute:function(t,e,n){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:null;Ac(t,(function(o,i){o.copyTimelineKeyframe(e,n,r),t.emit("refreshTimeline")}))}};function Yc(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(t)))return;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(t,e){if(!t)return;if("string"==typeof t)return Nc(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);"Object"===n&&t.constructor&&(n=t.constructor.name);if("Map"===n||"Set"===n)return Array.from(t);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return Nc(t,e)}(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Nc(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n2&&void 0!==arguments[2]?arguments[2]:null;return Uc(t,Kc(t,e)-Kc(t,n))}function Zc(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,Y(t.elapsed)&&(e.elapsed=t.elapsed),Y(t.speed)&&(e.speed=t.speed),Y(t.duration)&&(e.duration=t.duration),Y(t.iterationCount)&&(e.iterationCount=t.iterationCount||Number.MAX_SAFE_INTEGER),F(t.direction)&&(e.direction=t.direction),X(t.tick)&&(e.tick=t.tick),X(t.start)&&(e.startCallback=t.start),X(t.end)&&(e.endCallback=t.end),X(t.first)&&(e.firstCallback=t.first),X(t.last)&&(e.lastCallback=t.last),X(t.stop)&&(e.stopCallback=t.stop),e.firstCallback(e.elapsed,e),o()},stop:function(){e.stopCallback(e.elapsed,e),cancelAnimationFrame(e.id)},tick:r,first:function(t){a(0)},last:function(t){a(e.duration)},seek:a,timer:e}}var qc={command:"playTimelineItem",execute:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1,r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"normal";t.selection.empty(),t.emit("refreshSelection"),t.changeMode("play"),t.emit("afterChangeMode"),Ac(t,(function(o,i){var a=o.getSelectedTimelineLastTime();t.timer?t.timer.stop():t.timer=Zc({elapsed:1e3*i.currentTime,speed:e,duration:1e3*a,iterationCount:n,direction:r}),t.timer.play({duration:1e3*a,elapsed:1e3*i.currentTime,speed:e,iterationCount:n,direction:r,tick:function(e,n){o.seek(Uc(i.fps,e/1e3)),t.emit("playTimeline")},last:function(e,n){t.emit("stopTimeline"),t.changeMode("SELECTION"),t.emit("afterChangeMode")},stop:function(e,n){o.stop(Uc(i.fps,e/1e3)),t.emit("stopTimeline"),t.changeMode("SELECTION"),t.emit("afterChangeMode")}})}))}},Jc={command:"prevTimelineItem",execute:function(t){Ac(t,(function(e,n){var r=e.getSelectedTimelinePrevTime();e.setTimelineCurrentTime(Uc(n.fps,r)),e.seek(),t.emit("playTimeline"),t.changeMode("SELECTION"),t.emit("afterChangeMode")}))}},Qc={command:"firstTimelineItem",execute:function(t){Ac(t,(function(e,n){var r=e.getSelectedTimelineFirstTime();e.setTimelineCurrentTime(Uc(n.fps,r)),e.seek(),t.emit("playTimeline"),t.changeMode("SELECTION"),t.emit("afterChangeMode")}))}},tu={command:"nextTimelineItem",execute:function(t){Ac(t,(function(e,n){var r=e.getSelectedTimelineNextTime();e.setTimelineCurrentTime(Uc(n.fps,r)),e.seek(),t.emit("playTimeline"),t.changeMode("SELECTION"),t.emit("afterChangeMode")}))}},eu={command:"lastTimelineItem",execute:function(t){Ac(t,(function(e,n){var r=e.getSelectedTimelineLastTime();e.setTimelineCurrentTime(Uc(n.fps,r)),e.seek(),t.emit("playTimeline"),t.changeMode("SELECTION"),t.emit("afterChangeMode")}))}},nu={command:"addTimelineItem",execute:function(t,e){Ac(t,(function(n,r){e?n.addTimelineLayer(e):n.addTimeline(),t.emit("refreshTimeline"),t.emit("addTimeline")}))}},ru={command:"drop.asset",execute:function(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;e.color?t.emit("addBackgroundColor",e.color,n):e.gradient?t.emit("addBackgroundImageGradient",e.gradient,n):e.imageUrl&&t.emit("addBackgroundImageAsset",e.imageUrl,n),Ea(t,!0)}};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 iu(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function au(t){for(var e=1;e0&&void 0!==arguments[0]?arguments[0]:{};return lu(hu(i.prototype),"getDefaultObject",this).call(this,au({itemType:"image-resource",type:"image"},t))}},{key:"isGradient",value:function(){return!1}},{key:"isLinear",value:function(){return!1}},{key:"isRadial",value:function(){return!1}},{key:"isConic",value:function(){return!1}},{key:"isStatic",value:function(){return!1}},{key:"isImage",value:function(){return!1}},{key:"hasAngle",value:function(){return!1}},{key:"isUrl",value:function(){return!1}},{key:"isFile",value:function(){return!1}},{key:"isAttribute",value:function(){return!0}},{key:"toString",value:function(){return"none"}}])&&su(e.prototype,n),r&&su(e,r),i}(ui);function vu(t){return(vu="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 bu(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function mu(t){for(var e=1;e0&&void 0!==arguments[0]?arguments[0]:2,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:100,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"%",r=m(2,t),o=e/r,i=W(r).map((function(t,e){return"".concat(Ye.random()," ").concat(e*o).concat(n)})).join(",");return i}},{key:"createRepeatColorStep",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:2,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:ln.px(1),n=m(2,t),r=W(n).map((function(t,n){return"".concat(Ye.random()," ").concat(ln.parse(e).mul(n+1))})).join(",");return r}}],(n=[{key:"getDefaultObject",value:function(){return{id:"c"+Ru++,cut:!1,percent:0,unit:"%",px:0,em:0,color:"rgba(0, 0, 0, 0)",prevColorStep:null}}},{key:"toCloneObject",value:function(){return mu(mu({},ku(xu(i.prototype),"toCloneObject",this).call(this)),{},{cut:this.json.cut,percent:this.json.percent,unit:this.json.unit,px:this.json.px,em:this.json.em,color:this.json.color})}},{key:"on",value:function(){this.json.cut=!0}},{key:"off",value:function(){this.json.cut=!1}},{key:"toggle",value:function(){this.json.cut=!this.json.cut}},{key:"getUnit",value:function(){return"%"==this.json.unit?"percent":this.json.unit}},{key:"add",value:function(t){var e=this.getUnit();return this.json[e]+=+t,this}},{key:"sub",value:function(t){var e=this.getUnit();return this.json[e]-=+t,this}},{key:"mul",value:function(t){var e=this.getUnit();return this.json[e]*=+t,this}},{key:"div",value:function(t){var e=this.getUnit();return this.json[e]/=+t,this}},{key:"mod",value:function(t){var e=this.getUnit();return this.json[e]%=+t,this}},{key:"toLength",value:function(t){return ln.parse(this.json)}},{key:"getPrevLength",value:function(){return this.json.prevColorStep?this.json.prevColorStep.toLength():""}},{key:"toString",value:function(){var t=this.json.cut?this.getPrevLength():"",e=this.json.color||"transparent";return"".concat(e," ").concat(t," ").concat(this.toLength())}},{key:"reset",value:function(t){ku(xu(i.prototype),"reset",this).call(this,t),this.parent&&this.parent.sortColorStep()}},{key:"isPx",get:function(){return"px"==this.json.unit}},{key:"isPercent",get:function(){return"%"==this.json.unit||"percent"===this.json.unit}},{key:"isEm",get:function(){return"em"==this.json.unit}}])&&Ou(e.prototype,n),r&&Ou(e,r),i}(qo);function Eu(t){return(Eu="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 _u(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function Cu(t){for(var e=1;e0&&void 0!==arguments[0]?arguments[0]:[];if(!t.length)return"";var e=t.map((function(e,n){return e.prevColorStep=e.cut&&n>0?t[n-1]:null,e}));return 1===e.length&&e.push(new $u({color:e[0].color||"transparent",percent:100})),e.map((function(t){return"".concat(t)})).join(",")}}],(n=[{key:"isGradient",value:function(){return!0}},{key:"toString",value:function(){return"none"}},{key:"getDefaultObject",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return Iu(Bu(i.prototype),"getDefaultObject",this).call(this,Cu({type:"gradient",colorsteps:[]},t))}},{key:"toCloneObject",value:function(){return Cu(Cu({},Iu(Bu(i.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 $u(t)})),t}},{key:"calculateAngle",value:function(){var t=this.json.angle;return M(zu[t])?t:zu[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,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];e.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:"removeColorStep",value:function(t){this.json.colorsteps=this.json.colorsteps.filter((function(e){return e.id!=t}))}},{key:"getColorString",value:function(){var t=this.colorsteps;return i.toColorString(t)}},{key:"colorsteps",get:function(){return this.json.colorsteps}}])&&Au(e.prototype,n),r&&Au(e,r),i}(du);function Gu(t){return(Gu="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 Hu(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function Xu(t){for(var e=1;e0&&void 0!==arguments[0]?arguments[0]:"transparent";return new i({colorsteps:[new $u({color:t,percent:0,index:0}),new $u({color:t,percent:100,index:1})]})}}],(n=[{key:"getDefaultObject",value:function(){return Uu(Ju(i.prototype),"getDefaultObject",this).call(this,{type:"static-gradient",static:!0,colorsteps:[new $u({color:"red",percent:0,index:0}),new $u({color:"red",percent:100,index:0})]})}},{key:"toCloneObject",value:function(){return Xu(Xu({},Uu(Ju(i.prototype),"toCloneObject",this).call(this)),{},{static:!0})}},{key:"toString",value:function(){var t=this.json.colorsteps[0].color;return"linear-gradient(to right, ".concat(t," 0%, ").concat(t," 100%)")}},{key:"isStatic",value:function(){return!0}}])&&Ku(e.prototype,n),r&&Ku(e,r),i}(Fu);function ts(t){return(ts="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 es(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function ns(t){for(var e=1;e0&&void 0!==arguments[0]?arguments[0]:{};return cs(ps(n.prototype),"getDefaultObject",this).call(this,ns({type:"url",url:"",datauri:""},t))}},{key:"toCloneObject",value:function(){return ns(ns({},cs(ps(n.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=this.json;return"url(".concat(t.url,")")}}],[{key:"parse",value:function(t){return new n({url:t.split("(")[1].split(")")[0]})}},{key:"isImageFile",value:function(t){return ys.includes(t)}}]),n}(du);function ds(t){return(ds="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 vs(t){return function(t){if(Array.isArray(t))return bs(t)}(t)||function(t){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(t))return Array.from(t)}(t)||function(t,e){if(!t)return;if("string"==typeof t)return bs(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);"Object"===n&&t.constructor&&(n=t.constructor.name);if("Map"===n||"Set"===n)return Array.from(t);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return bs(t,e)}(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function bs(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n360?e%360:e,"deg")),"".concat(this.json.type,"(").concat(e,", ").concat(t,")")}}])&&ks(e.prototype,n),r&&ks(e,r),i}(Fu);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 Ts(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function Ds(t,e){for(var n=0;nt.length)&&(e=t.length);for(var n=0,r=new Array(e);n0&&void 0!==arguments[0]?arguments[0]:{};return Zs(tl(i.prototype),"getDefaultObject",this).call(this,Ks({type:"radial-gradient",radialType:"ellipse",radialPosition:[un.CENTER,un.CENTER]},t))}},{key:"toCloneObject",value:function(){return Ks(Ks({},Zs(tl(i.prototype),"toCloneObject",this).call(this)),{},{radialType:this.json.radialType,radialPosition:N(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=nl[o]?o:o.join(" "))?"".concat(r," at ").concat(o):r,"".concat(n.type||"radial-gradient","(").concat(t,", ").concat(e,")")}}])&&Ws(e.prototype,n),r&&Ws(e,r),i}(Fu);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 il(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function al(t,e){for(var n=0;nt.length)&&(e=t.length);for(var n=0,r=new Array(e);n0&&void 0!==arguments[0]?arguments[0]:{};return Sl(Rl(i.prototype),"getDefaultObject",this).call(this,wl({type:"conic-gradient",angle:0,radialPosition:[un.CENTER,un.CENTER]},t))}},{key:"toCloneObject",value:function(){return wl(wl({},Sl(Rl(i.prototype),"toCloneObject",this).call(this)),{},{angle:this.json.angle,radialPosition:N(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||un.CENTER;o=El[o]?o:o.join(" "),L(r)&&(r=+(_l[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,")")}}])&&kl(e.prototype,n),r&&kl(e,r),i}(Fu);function Tl(t){return(Tl="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 Dl(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function Al(t,e){for(var n=0;nt.length)&&(e=t.length);for(var n=0,r=new Array(e);n2&&void 0!==arguments[2]?arguments[2]:null,r=t.selection.itemsByIds(n);r.forEach((function(n){var r=nf.parseStyle(tt(n["background-image"]));r.unshift(new nf({image:nf.parseImage(e)})),t.emit("setAttribute",{"background-image":nf.join(r)},n.id)})),Ea(t,!0)}},of={command:"addBackgroundImageAsset",execute:function(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null,r=t.selection.itemsByIds(n);r.forEach((function(n){var r=nf.parseStyle(tt(n["background-image"]));r.unshift(new nf({image:new hs({url:e})}));var o=Q(nf.toPropertyCSS(r));t.emit("setAttribute",{"background-image":o},n.id)})),Ea(t,!0)}},af={command:"item.move.left",execute:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{dx:1},n=+e.dx;t.selection.move(-1*n,0),t.emit("refresh"),Ea(t,!0)}},cf={command:"item.move.right",execute:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{dx:1},n=+e.dx;t.selection.move(n,0),t.emit("refresh"),Ea(t,!0)}},uf={command:"item.move.up",execute:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{dy:1},n=+e.dy;t.selection.move(0,-1*n),t.emit("refresh"),Ea(t,!0)}},sf={command:"item.move.down",execute:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{dy:1},n=+e.dy;t.selection.move(0,n),t.emit("refresh"),Ea(t,!0)}};var lf={command:"change.mode.view",execute:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"CanvasView";t.changeModeView(e)}},ff={command:"segment.move.down",execute:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{dy:1},n=+e.dy;t.emit("moveSegment",0,n)}},pf={command:"segment.move.up",execute:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{dy:1},n=+e.dy;t.emit("moveSegment",0,-1*n)}},yf={command:"segment.move.right",execute:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{dx:1},n=+e.dx;t.emit("moveSegment",n,0)}},hf={command:"segment.move.left",execute:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{dx:1},n=+e.dx;t.emit("moveSegment",-1*n,0)}},df={command:"toggle.fullscreen",execute:function(t,e){dn.body().fullscreen()}};function vf(t){return(vf="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){return function(t){if(Array.isArray(t))return wf(t)}(t)||function(t){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(t))return Array.from(t)}(t)||gf(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function mf(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(t)))return;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)||gf(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function gf(t,e){if(t){if("string"==typeof t)return wf(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?wf(t,e):void 0}}function wf(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n0&&void 0!==arguments[0]?arguments[0]:{};return Rf(Tf(n.prototype),"getDefaultObject",this).call(this,kf({itemType:"pattern"},t))}},{key:"toString",value:function(){return"".concat(this.json.type,"(").concat(this.json.value||"",")")}}],[{key:"parse",value:function(t){var e=Hf[t.type];if(e)return new e(t)}},{key:"parseStyle",value:function(t){var e=[];if(!t)return e;var r=Se(t);return(r.str.match(Df)||[]).forEach((function(t,o){var i=mf(t.split("("),2),a=i[0],c=i[1],u=mf((c=c.split(")")[0]).split(",").map((function(t){return t.trim()})),6),s=u[0],l=u[1],f=u[2],p=u[3],y=u[4],h=u[5],d=mf(s.split(" "),2),v=d[0],b=d[1],m=mf(l.split(" "),2),g=m[0],w=m[1],O=mf((h||"").split(" "),2),k=O[0],S=O[1];e[o]=n.parse({type:a,x:ln.parse(g),y:ln.parse(w),width:ln.parse(v),height:ln.parse(b),foreColor:Pe(f,r.matches),backColor:Pe(p,r.matches),blendMode:y||"normal",lineWidth:ln.parse(k||"1px"),lineHeight:ln.parse(S||"1px")})})),e}},{key:"join",value:function(t){return t.map((function(t){return n.parse(t)})).join(" ")}},{key:"toCSS",value:function(t){var e=[];return n.parseStyle(t).forEach((function(t){e.push.apply(e,bf(nf.parseStyle(tt(t.toCSS()))))})),nf.joinCSS(e)}}]),n}(ui),If=function(t){$f(n,t);var e=_f(n);function n(){return jf(this,n),e.apply(this,arguments)}return xf(n,[{key:"getDefaultObject",value:function(){return Rf(Tf(n.prototype),"getDefaultObject",this).call(this,{type:"base",x:ln.px(0),y:ln.px(0),width:ln.px(20),height:ln.px(20),lineWidth:ln.px(1),lineHeight:ln.px(1),foreColor:"black",backColor:"white",blendMode:"normal"})}},{key:"convert",value:function(t){return(t=Rf(Tf(n.prototype),"convert",this).call(this,t)).width=ln.parse(t.width),t.height=ln.parse(t.height),t.lineWidth=ln.parse(t.lineWidth),t.lineHeight=ln.parse(t.lineHeight),t.x=ln.parse(t.x),t.y=ln.parse(t.y),t}},{key:"toString",value:function(){var t=this.json,e=t.type,n=t.width,r=t.height,o=t.x,i=t.y,a=t.foreColor,c=t.backColor,u=t.blendMode,s=t.lineWidth,l=t.lineHeight;return"".concat(e,"(").concat(n," ").concat(r,", ").concat(o," ").concat(i,", ").concat(a,", ").concat(c,", ").concat(u,", ").concat(s," ").concat(l,")")}}]),n}(Af),Vf=function(t){$f(n,t);var e=_f(n);function n(){return jf(this,n),e.apply(this,arguments)}return xf(n,[{key:"getDefaultObject",value:function(){return Rf(Tf(n.prototype),"getDefaultObject",this).call(this,{type:"check"})}},{key:"toCSS",value:function(){var t=this.json,e=t.width,n=t.height,r=t.x,o=t.y,i=t.backColor,a=t.foreColor,c=t.blendMode;return i=i||"transparent","\n background-image: repeating-linear-gradient(45deg, ".concat(a=a||"black"," 25%, ").concat(i," 25%, ").concat(i," 75%, ").concat(a," 75%, ").concat(a," 100%),repeating-linear-gradient(45deg, ").concat(a," 25%, ").concat(i," 25%, ").concat(i," 75%, ").concat(a," 75%, ").concat(a," 100%);\n background-position: 0px 0px, ").concat(r," ").concat(o,";\n background-size: ").concat(e," ").concat(n,", ").concat(e," ").concat(n,";\n background-blend-mode: ").concat(c,", ").concat(c,";\n ")}}]),n}(If),Mf=function(t){$f(n,t);var e=_f(n);function n(){return jf(this,n),e.apply(this,arguments)}return xf(n,[{key:"getDefaultObject",value:function(){return Rf(Tf(n.prototype),"getDefaultObject",this).call(this,{type:"grid"})}},{key:"toCSS",value:function(){var t=this.json,e=t.width,n=t.height,r=t.lineWidth,o=t.lineHeight,i=t.backColor,a=t.foreColor,c=t.blendMode;return i=i||"transparent","\n background-image: linear-gradient(".concat(a=a||"black"," ").concat(o,", ").concat(i," ").concat(o,"),linear-gradient(to right, ").concat(a," ").concat(r,", ").concat(i," ").concat(r,");\n background-size: ").concat(e.value/2,"px ").concat(n.value/2,"px, ").concat(e.value/2,"px ").concat(n.value/2,"px; \n background-blend-mode: ").concat(c,", ").concat(c,"; \n ")}}]),n}(If),Lf=function(t){$f(n,t);var e=_f(n);function n(){return jf(this,n),e.apply(this,arguments)}return xf(n,[{key:"getDefaultObject",value:function(){return Rf(Tf(n.prototype),"getDefaultObject",this).call(this,{type:"dot"})}},{key:"toCSS",value:function(){var t=this.json,e=t.width,n=t.height,r=t.lineWidth,o=(t.lineHeight,t.backColor),i=t.foreColor,a=t.blendMode;return o=o||"transparent","\n background-image: radial-gradient(".concat(i=i||"black"," ").concat(r,", ").concat(o," ").concat(r,");\n background-size: ").concat(e.value/2,"px ").concat(n.value/2,"px; \n background-blend-mode: ").concat(a,"; \n ")}}]),n}(If),Bf=function(t){$f(n,t);var e=_f(n);function n(){return jf(this,n),e.apply(this,arguments)}return xf(n,[{key:"getDefaultObject",value:function(){return Rf(Tf(n.prototype),"getDefaultObject",this).call(this,{type:"cross-dot"})}},{key:"toCSS",value:function(){var t=this.json,e=t.width,n=t.height,r=t.x,o=t.y,i=t.lineWidth,a=(t.lineHeight,t.backColor),c=t.foreColor,u=t.blendMode;return a=a||"transparent","\n background-image: radial-gradient(".concat(c=c||"black"," ").concat(i,", ").concat(a," ").concat(i,"),radial-gradient(").concat(c," ").concat(i,", ").concat(a," ").concat(i,");\n background-size: ").concat(e," ").concat(n,",").concat(e," ").concat(n,";\n background-position: 0px 0px, ").concat(r," ").concat(o,"; \n background-blend-mode: multiply, ").concat(u,";\n ")}}]),n}(If),zf=function(t){$f(n,t);var e=_f(n);function n(){return jf(this,n),e.apply(this,arguments)}return xf(n,[{key:"getDefaultObject",value:function(){return Rf(Tf(n.prototype),"getDefaultObject",this).call(this,{type:"diagonal-line"})}},{key:"toCSS",value:function(){var t=this.json,e=t.width,n=t.height,r=t.x,o=t.lineWidth,i=t.backColor,a=t.foreColor,c=t.blendMode;return i=i||"transparent",a=a||"black","\n background-image: repeating-linear-gradient(".concat(r,", ").concat(a," 0, ").concat(a," ").concat(o,", ").concat(i," 0, ").concat(i," 50%);\n background-size: ").concat(e," ").concat(n,"; \n background-blend-mode: ").concat(c,";\n ")}}]),n}(If),Ff=function(t){$f(n,t);var e=_f(n);function n(){return jf(this,n),e.apply(this,arguments)}return xf(n,[{key:"getDefaultObject",value:function(){return Rf(Tf(n.prototype),"getDefaultObject",this).call(this,{type:"vertical-line"})}},{key:"toCSS",value:function(){var t=this.json,e=t.width,n=t.height,r=t.x,o=t.y,i=t.lineWidth,a=t.backColor,c=t.foreColor,u=t.blendMode;return a=a||"transparent","\n background-image: repeating-linear-gradient(to right, ".concat(c=c||"black"," 0px, ").concat(c," ").concat(i,", ").concat(a," ").concat(i,", ").concat(a," 100%);\n background-size: ").concat(e," ").concat(n,"; \n background-position: ").concat(r," ").concat(o,"; \n background-blend-mode: ").concat(u,";\n ")}}]),n}(If),Gf=function(t){$f(n,t);var e=_f(n);function n(){return jf(this,n),e.apply(this,arguments)}return xf(n,[{key:"getDefaultObject",value:function(){return Rf(Tf(n.prototype),"getDefaultObject",this).call(this,{type:"horizontal-line"})}},{key:"toCSS",value:function(){var t=this.json,e=t.width,n=t.height,r=t.x,o=t.y,i=t.lineWidth,a=t.backColor,c=t.foreColor,u=t.blendMode;return a=a||"transparent","\n background-image: repeating-linear-gradient(0deg, ".concat(c=c||"black"," 0px, ").concat(c," ").concat(i,", ").concat(a," ").concat(i,", ").concat(a," 100%); \n background-position: ").concat(r," ").concat(o,";\n background-size: ").concat(e," ").concat(n,"; \n background-blend-mode: ").concat(u,";\n ")}}]),n}(If),Hf={check:Vf,grid:Mf,dot:Lf,"cross-dot":Bf,"diagonal-line":zf,"vertical-line":Ff,"horizontal-line":Gf},Xf={CheckPattern:Vf,GridPattern:Mf,DotPattern:Lf,CrossDotPattern:Bf,DiagonalLinePattern:zf,VerticalLinePattern:Ff,HorizontalLinePattern:Gf};function Yf(t){return function(t){if(Array.isArray(t))return Nf(t)}(t)||function(t){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(t))return Array.from(t)}(t)||function(t,e){if(!t)return;if("string"==typeof t)return Nf(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);"Object"===n&&t.constructor&&(n=t.constructor.name);if("Map"===n||"Set"===n)return Array.from(t);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return Nf(t,e)}(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Nf(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n2&&void 0!==arguments[2]?arguments[2]:null,r=t.selection.itemsByIds(n);r.forEach((function(n){t.emit("setAttribute",{pattern:Af.join([].concat(Yf(Af.parseStyle(e)),Yf(Af.parseStyle(n.pattern))))},n.id)})),Ea(t,!0)}},Uf={command:"addBackgroundColor",execute:function(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null,r=t.selection.itemsByIds(n);r.forEach((function(n){t.emit("setAttribute",{"background-color":e},n.id)})),Ea(t,!0)}};function Wf(t,e){for(var n=0;n1&&void 0!==arguments[1]?arguments[1]:{},n=t.selection.currentProject;n||(n=t.add(t.components.createComponent("project")),t.selection.selectProject(n));var r=n.add(t.components.createComponent("artboard",Ka({x:ln.px(300),y:ln.px(200),width:ln.px(375),height:ln.px(667)},e)));t.selection.selectArtboard(r),t.selection.select(r),Ea(t)},addImage:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};t.emit("newComponent","image",e,e)},addVideo:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};t.emit("newComponent","video",e,e)},addLayer:function t(e,n){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},o=e.selection.current||e.selection.currentArtboard;o?(o.enableHasChildren()||(o=o.parent),o.add(n),r.x&&n.setScreenX(r.x.value),r.y&&n.setScreenY(r.y.value),e.selection.select(n),Ea(e)):(e.emit("addArtBoard"),setTimeout((function(){t(e,n,r)}),50))},addPath:function(t){t.selection.empty(),t.emit("refreshSelectionTool"),t.emit("showPathEditor","path")},addProject:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=t.add(t.components.createComponent("project",Za({},e)));t.selection.selectProject(n),Ea(t)},convertPath:function(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null,r=t.selection.current;if(r){if(r.is("svg-path","svg-brush","svg-textpath")){var o=e;if(n)(i=new Ya(e)).scale(r.width.value/n.width,r.height.value/n.height),o=i.d;r.updatePathItem({d:o})}else if(r["clip-path"].includes("path")){var i;o=e;if(n)(i=new Ya(e)).scale(r.width.value/n.width,r.height.value/n.height),o=i.d;r.reset({"clip-path":"path(".concat(o,")")})}t.emit("refreshElement",r)}},newComponent:function(t,e,n){e.includes("text")||(n["background-color"]=Ye.random()),"svg-textpath"===e?n=ec(ec({},n),{},{text:"Insert a newText","font-size":ln.parse(n.height),textLength:"100%",d:Qa.makeLine(0,n.height.value,n.width.value,n.height.value)}):"svg-circle"===e?(e="svg-path",n=ec(ec({},n),{},{"background-color":void 0,d:Qa.makeCircle(0,0,n.width.value,n.height.value)})):"svg-rect"===e?(e="svg-path",n=ec(ec({},n),{},{"background-color":void 0,d:Qa.makeRect(0,0,n.width.value,n.height.value)})):"text"===e&&(n=ec(ec({},n),{},{content:"Insert a text",width:ln.px(300),height:ln.px(50),"font-size":ln.px(30)})),t.emit("addLayer",t.components.createComponent(e,ec({},n)),n),t.changeMode(ap),t.emit("afterChangeMode")},refreshElement:function(t,e){var n=arguments.length>2&&void 0!==arguments[2]&&arguments[2],r=arguments.length>3&&void 0!==arguments[3]&&arguments[3];t.emit("refreshSelectionStyleView",e,n,e&&!1===e.enableHasChildren()),!0===r&&t.emit("refreshElementBoundSize",t.selection.getRootItem(e))},refreshProject:function(t,e){t.emit("refreshStyleView",e,!0)},resizeArtBoard:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",n=t.selection.currentArtboard;if(n&&n.is("artboard")){if(!e.trim())return;var r=e.split("x"),o=_a(r,2),i=o[0],a=o[1];i=ln.px(i),a=ln.px(a),n.reset({width:i,height:a}),t.selection.select(n),Ea(t)}},selectItem:function(t){t.changeMode(ap),t.emit("afterChangeMode")},selectArtboard:function(t,e){e&&(t.selection.selectArtboard(e),t.selection.select(e),t.emit("refreshArtboard"),t.emit("resetSelection"))},setAttribute:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null,r=arguments.length>3&&void 0!==arguments[3]&&arguments[3],o=arguments.length>4&&void 0!==arguments[4]&&arguments[4];t.selection.itemsByIds(n).forEach((function(n){Object.keys(e).forEach((function(t){var r=e[t];X(r)&&(r=r()),n.reset($a({},t,r))})),t.emit("refreshElement",n,r,o)}))},sortBottom:Jf,sortCenter:{command:"sort.center",execute:function(t){var e=qf.getContainer(t),n=e.screenX.value+e.width.value/2;t.selection.each((function(t){t.setScreenXCenter(n)})),t.emit("resetSelection")}},sortLeft:{command:"sort.left",execute:function(t){var e=qf.getContainer(t).screenX.value;t.selection.each((function(t){t.setScreenX(e)})),t.emit("resetSelection")}},sortMiddle:{command:"sort.middle",execute:function(t){var e=qf.getContainer(t),n=e.screenY.value+e.height.value/2;t.selection.each((function(t){t.setScreenYMiddle(n)})),t.emit("resetSelection")}}},"sortBottom",Jf),ep(Zf,"sortTop",Qf),ep(Zf,"sortRight",tp),ep(Zf,"sameWidth",{command:"same.width",execute:function(t){var e=t.selection.items.length;if(1==e);else if(e>1){var n=t.selection.allRect;t.selection.each((function(t){t.setScreenX(n.x.value),t.width.set(n.width.value)}))}t.emit("resetSelection")}}),ep(Zf,"sameHeight",{command:"same.width",execute:function(t){var e=t.selection.items.length;if(1==e);else if(e>1){var n=t.selection.allRect;t.selection.each((function(t){t.setScreenY(n.y.value),t.height.set(n.height.value)}))}t.emit("resetSelection")}}),Zf),rp=[{key:"1",command:"addComponentType",args:"rect",description:"Add rect layer",when:"CanvasView"},{key:"2",command:"addComponentType",args:"circle",description:"Add circle layer",when:"CanvasView"},{key:"3",command:"addComponentType",args:"text",description:"Add text layer",when:"CanvasView"},{key:"4",command:"addComponentType",args:"image",description:"Add image layer",when:"CanvasView"},{key:"5",command:"addComponentType",args:"cube",description:"Add cube layer",when:"CanvasView"},{key:"6",command:"addPath",description:"Add svg path",when:"CanvasView"},{key:"ArrowDown",command:"segment.move.down",description:"move 1px to down",args:{dy:1},when:"PathEditorView"},{key:"ArrowUp",command:"segment.move.up",description:"move 1px to up",args:{dy:1},when:"PathEditorView"},{key:"ArrowRight",command:"segment.move.right",description:"move 1px to right",args:{dx:1},when:"PathEditorView"},{key:"ArrowLeft",command:"segment.move.left",description:"move 1px to left",args:{dx:1},when:"PathEditorView"},{key:"Shift+ArrowDown",command:"segment.move.down",description:"move 10px to down",args:{dy:10},when:"PathEditorView"},{key:"Shift+ArrowUp",command:"segment.move.up",description:"move 10px to up",args:{dy:10},when:"PathEditorView"},{key:"Shift+ArrowLeft",command:"segment.move.left",description:"move 10px to left",args:{dx:10},when:"PathEditorView"},{key:"Shift+ArrowRight",command:"segment.move.right",description:"move 10px to right",args:{dx:10},when:"PathEditorView"},{key:"Alt+ArrowDown",command:"segment.move.down",description:"move 5px to down",args:{dy:5},when:"PathEditorView"},{key:"Alt+ArrowUp",command:"segment.move.up",description:"move 5px to up ",args:{dy:5},when:"PathEditorView"},{key:"Alt+ArrowLeft",command:"segment.move.left",description:"move 5px to left",args:{dx:5},when:"PathEditorView"},{key:"Alt+ArrowRight",command:"segment.move.right",description:"move 5px to right",args:{dx:5},when:"PathEditorView"},{key:"Backspace",command:"segment.delete",description:"Delete selected segment",when:"PathEditorView"},{key:"ArrowLeft",command:"item.move.left",description:"move 1px to left",args:{dx:1},when:"CanvasView"},{key:"ArrowRight",command:"item.move.right",description:"move 1px to right",args:{dx:1},when:"CanvasView"},{key:"ArrowDown",command:"item.move.down",description:"move 1px to down",args:{dy:1},when:"CanvasView"},{key:"ArrowUp",command:"item.move.up",description:"move 1px to up",args:{dy:1},when:"CanvasView"},{key:"Shift+ArrowDown",command:"item.move.down",description:"move 10px to down",args:{dy:10},when:"CanvasView"},{key:"Shift+ArrowRight",command:"item.move.right",description:"move 10px to right",args:{dx:10},when:"CanvasView"},{key:"Shift+ArrowUp",command:"item.move.up",description:"move 10px to up",args:{dy:10},when:"CanvasView"},{key:"Shift+ArrowLeft",command:"item.move.left",description:"move 10px to left",args:{dx:10},when:"CanvasView"},{key:"Alt+ArrowLeft",command:"item.move.left",description:"move 5px to left",args:{dx:5},when:"CanvasView"},{key:"Alt+ArrowDown",command:"item.move.down",description:"move 5px to down",args:{dy:5},when:"CanvasView"},{key:"Alt+ArrowRight",command:"item.move.right",description:"move 5px to right",args:{dx:5},when:"CanvasView"},{key:"Alt+ArrowUp",command:"item.move.up",description:"move 5px to up",args:{dy:5},when:"CanvasView"},{key:"Backspace",command:"item.delete",description:"Delete selected items",when:"CanvasView"},{key:"Minus",command:"scale.minus",description:"Minus scale",when:"CanvasView"},{key:"Equal",command:"scale.plus",description:"Plus scale",when:"CanvasView"},{key:"cmd+c",command:"clipboard.copy",description:"Copy objects",when:"CanvasView"},{key:"cmd+v",command:"clipboard.paste",description:"Paste selected objects",when:"CanvasView"}];function op(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function ip(t,e){for(var n=0;n0&&void 0!==arguments[0]?arguments[0]:{};op(this,t),this.config=new ga(this),this.commands=new la(this),this.shortcuts=new va(this),this.selection=new ia(this),this.timeline=new Ho(this),this.components=ua,this.projects=[],this.popupZIndex=1e4,this.canvasWidth=1e5,this.canvasHeight=1e5,this.scale=1,this.symbols={},this.images={},this.openRightPanel=!0,this.mode=ap,this.modeView="CanvasView",this.addComponentType="",this.locale=this.loadItem("locale")||"en_US",this.$store=e.$store,this.initTheme(),this.loadCommands(),this.loadShortCuts()}var e,n,r;return e=t,(n=[{key:"loadCommands",value:function(){var t=this;Object.keys(np).forEach((function(e){X(np[e])?t.commands.registerCommand(e,np[e]):t.commands.registerCommand(np[e])}))}},{key:"loadShortCuts",value:function(){var t=this;rp.forEach((function(e){t.shortcuts.registerShortCut(e)})),this.shortcuts.sort()}},{key:"i18n",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2?arguments[2]:void 0;return Vo.get(t,e,n||this.locale)}},{key:"hasI18nkey",value:function(t,e){return Vo.hasKey(t,e||this.locale)}},{key:"initI18n",value:function(){var t=this,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";return function(n){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},o=arguments.length>2?arguments[2]:void 0,i="".concat(e,".").concat(n);return t.hasI18nkey(i,o)?t.$i18n("".concat(e,".").concat(n),r,o):t.$i18n("".concat(n),r,o)}}},{key:"setLocale",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"en_US";this.locale=t,this.saveItem("locale",this.locale)}},{key:"setUser",value:function(t){this.user=t}},{key:"initTheme",value:function(){var t="dark";window.localStorage&&(t=window.localStorage.getItem("easylogic.studio.theme"),t=["gray","light"].includes(t)?t:"dark"),this.theme=t||"dark",window.localStorage.setItem("easylogic.studio.theme",this.theme)}},{key:"themeValue",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";return Mo[this.theme][t]||e}},{key:"changeMode",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:ap;this.mode=t}},{key:"changeModeView",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"CanvasView";this.modeView=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(ap)}},{key:"changeAddType",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",e=arguments.length>1&&void 0!==arguments[1]&&arguments[1];this.changeMode("ADD"),this.addComponentType=t,this.isComponent=e}},{key:"changeTheme",value:function(t){t=["light","gray"].includes(t)?t:"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:"replaceLocalUrltoRealUrl",value:function(t){var e=this.selection.currentProject,n={};return e.images.forEach((function(e){t.indexOf(e.local)>-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}},{key:"replaceLocalUrltoId",value:function(t){var e=this.projects,n={};return e.forEach((function(e){e.images.forEach((function(e){t.indexOf(e.local)>-1&&(n[e.local]="#"+e.id)}))})),Object.keys(n).forEach((function(e){t.indexOf(e)>-1&&(t=t.replace(new RegExp(e,"g"),n[e]))})),t}},{key:"makeResource",value:function(t){var e=JSON.stringify(t);return e=this.replaceLocalUrltoId(e)}},{key:"saveResource",value:function(t,e){window.localStorage.setItem("easylogic.studio.".concat(t),this.makeResource(e))}},{key:"saveItem",value:function(t,e){window.localStorage.setItem("easylogic.studio.".concat(t),JSON.stringify(e))}},{key:"revokeResource",value:function(t){var e=this,n=JSON.parse(t||"[]"),r={};return n.forEach((function(t){t.images.forEach((function(t){r["#".concat(t.id)]=t}))})),Object.keys(r).map((function(t){var e=r[t],n=Ra.parse(e.original,!0);e.local=n.local})),n.forEach((function(t){t.layers=e.applyAsset(t.layers,r)})),n}},{key:"applyAsset",value:function(t,e){var n=this;return B(t)?t=t.map((function(t){return n.applyAsset(t,e)})):H(t)?Object.keys(t).forEach((function(r){t[r]=n.applyAsset(t[r],e)})):F(t)&&Object.keys(e).forEach((function(n){var r=e[n];t.indexOf("#".concat(r.id))>-1&&(t=t.replace(new RegExp("#".concat(r.id),"g"),r.local))})),t}},{key:"loadResource",value:function(t){return this.revokeResource(window.localStorage.getItem("easylogic.studio.".concat(t)))}},{key:"loadItem",value:function(t){return JSON.parse(window.localStorage.getItem("easylogic.studio.".concat(t))||JSON.stringify(""))}},{key:"zIndex",get:function(){return this.popupZIndex++}}])&&ip(e.prototype,n),r&&ip(e,r),t}();function up(t){return(up="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,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function lp(t,e){for(var n=0;n0&&void 0!==arguments[0]?arguments[0]:0;this.$config.set("body.move.ms",t),this.funcBodyMoves=_(this.loopBodyMoves.bind(this),this.$config.get("body.move.ms"))}},{key:"loopBodyMoves",value:function(){var t=this.$config.get("pos"),e=this.$config.get("bodyEvent"),n=this.$config.get("lastPos")||vp;!(n.x===t.x&&n.y===t.y)&&this.moves.size&&(this.moves.forEach((function(n){var r=t.x-n.xy.x,o=t.y-n.xy.y;0==r&&0==o||n.func.call(n.context,r,o,"move",e.pressure)})),this.$config.set("lastPos",t)),requestAnimationFrame(this.funcBodyMoves)}},{key:"removeBodyMoves",value:function(){var t=this.$config.get("pos"),e=this.$config.get("bodyEvent");t&&this.ends.forEach((function(n){n.func.call(n.context,t.x-n.xy.x,t.y-n.xy.y,"end",e.pressure)})),this.moves.clear(),this.ends.clear()}},{key:Do("add/body/mousemove"),value:function(t,e,n){this.moves.add({func:t,context:e,xy:n})}},{key:Do("add/body/mouseup"),value:function(t,e,n){this.ends.add({func:t,context:e,xy:n})}},{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:Hn("document"),value:function(t){if("INPUT"!==t.target.nodeName&&"SELECT"!==t.target.nodeName&&"TEXTAREA"!==t.target.nodeName){var e=t.xy||dp;this.$config.set("bodyEvent",t),this.$config.set("pos",e),this.requestId||(this.requestId=requestAnimationFrame(this.funcBodyMoves))}}},{key:Xn("document"),value:function(t){"INPUT"!==t.target.nodeName&&"SELECT"!==t.target.nodeName&&"TEXTAREA"!==t.target.nodeName&&(this.$config.set("bodyEvent",t),this.removeBodyMoves(),this.requestId=null)}},{key:Bn("window")+nr(100),value:function(){this.emit("resize.window")}},{key:"commands",get:function(){return this.$editor.commands}},{key:"shortcuts",get:function(){return this.$editor.shortcuts}}])&&lp(n.prototype,r),o&&lp(n,o),a}(Ao))(t)},mp={App:v,Color:Ye,HueColor:Ke,ColorNames:ye,Dom:dn,EventMachine:wo,UIElement:Ao};function gp(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function wp(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?Ye.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}}])&&kp(e.prototype,n),r&&kp(e,r),t}();function jp(t){return(jp="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 Pp(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function xp(t,e){for(var n=0;n0&&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),this.emit("changeColor")}},{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:ln.px(r),top:ln.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:ln.px(-1e4),top:ln.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(),X(this.opt.onChange)&&this.opt.onChange.call(this,t),X(this.colorpickerShowCallback)&&this.colorpickerShowCallback(t)}},{key:"callbackHideValue",value:function(t){t=t||this.getCurrentColor(),X(this.opt.onHide)&&this.opt.onHide.call(this,t),X(this.colorpickerHideCallback)&&this.colorpickerHideCallback(t)}},{key:"getCurrentColor",value:function(){return this.manager.toColor(this.outputFormat)}},{key:"checkColorPickerClass",value:function(t){var e=dn.create(t),n=e.closest("codemirror-colorview"),r=e.closest("colorpicker"),o=e.closest("CodeMirror");return t.nodeName,!!(r||n||o)}},{key:"checkInHtml",value:function(t){return"HTML"==t.nodeName}},{key:"initializeStoreEvent",value:function(){Rp(Cp(i.prototype),"initializeStoreEvent",this).call(this),this.$store.on("changeColor",this.callbackChange,this),this.$store.on("changeFormat",this.callbackChange,this)}},{key:"destroy",value:function(){Rp(Cp(i.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:xn("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}}])&&xp(e.prototype,n),r&&xp(e,r),i}(Ao);function Dp(t){return(Dp="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 Ap(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function Ip(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:ln.px(t)})}},{key:"getMousePosition",value:function(t){return yr.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))}}])&&Gp(e.prototype,n),r&&Gp(e,r),i}(function(t){!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&&Vp(t,e)}(i,t);var e,n,r,o=Mp(i);function i(){return Ap(this,i),o.apply(this,arguments)}return e=i,(n=[{key:"refresh",value:function(){}},{key:"refreshColorUI",value:function(t){}},{key:"changeColor",value:function(t){this.parent.changeColor(t||{}),this.emit("changeColor")}},{key:Xn("document"),value:function(t){this.onDragEnd(t)}},{key:Hn("document"),value:function(t){this.onDragMove(t)}},{key:Gn("$bar"),value:function(t){this.isDown=!0}},{key:Gn("$container"),value:function(t){this.isDown=!0,this.onDragStart(t)}},{key:"onDragStart",value:function(t){this.isDown=!0,this.refreshColorUI(t)}},{key:"onDragMove",value:function(t){this.isDown&&this.refreshColorUI(t)}},{key:"onDragEnd",value:function(t){this.isDown=!1}},{key:Do("changeColor","initColor"),value:function(){this.refresh()}}])&&Ip(e.prototype,n),r&&Ip(e,r),i}(Ao));function Up(t){return(Up="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 Wp(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function Zp(t,e){for(var n=0;n\n
\n
\n
\n \n '}},{key:pr("$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})}}])&&Zp(e.prototype,n),r&&Zp(e,r),i}(Kp);function ny(t){return(ny="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 ry(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function oy(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function iy(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function ay(t,e){for(var n=0;n\n
\n
\n
\n
\n \n '}},{key:"refresh",value:function(){cy(fy(i.prototype),"refresh",this).call(this),this.setOpacityColorBar()}},{key:"setOpacityColorBar",value:function(){var t=function(t){for(var e=1;e"}},{key:pr("$el"),value:function(){return{style:{"background-color":this.parent.manager.toString("rgb")}}}},{key:Do("changeColor","initColor"),value:function(){this.refresh()}}])&&dy(e.prototype,n),r&&dy(e,r),i}(Ao);function Oy(t){return(Oy="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 ky(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(t)))return;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(t,e){if(!t)return;if("string"==typeof t)return Sy(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);"Object"===n&&t.constructor&&(n=t.constructor.name);if("Map"===n||"Set"===n)return Array.from(t);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return Sy(t,e)}(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Sy(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n\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=dn.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=ky(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:bt(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=(h=u.x)-a,l=(d=u.y)-c,f=s*s+l*l,p=gt(s,l);if(f>i*i)var y=this.getCurrentXY(null,p,i,a,c),h=y.x,d=y.y;var v=Math.min(Math.sqrt(f)/i,1);this.refs.$drag_pointer.px("left",h-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:Do("changeColor"),value:function(){this.refresh(!0)}},{key:Do("initColor"),value:function(){this.refresh(!0)}},{key:Xn("document"),value:function(t){this.isDown=!1}},{key:Hn("document"),value:function(t){this.isDown&&this.setHueColor(t)}},{key:Gn("$drag_pointer"),value:function(t){this.isDown=!0}},{key:Gn(),value:function(t){this.isDown=!0,this.setHueColor(t)}}])&&Py(e.prototype,n),r&&Py(e,r),i}(Ao);function Ty(t){return(Ty="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 Dy(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function Ay(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,e=this.format||"hex";["hex","rgb","hsl"].filter((function(t){return t!==e})).forEach((function(e){t.$el.removeClass(e)})),this.$el.addClass(e)}},{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.format=e,this.initFormat(),this.parent.manager.changeFormat(this.format)}},{key:"goToFormat",value:function(t){this.format=t,"rgb"!==t&&"hsl"!==t||this.initFormat(),this.parent.manager.changeFormat(this.format)}},{key:"getFormat",value:function(){return this.format||"hex"}},{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:Do("changeColor","initColor"),value:function(){this.refresh()}},{key:In("$rgb_r"),value:function(t){this.changeRgbColor()}},{key:In("$rgb_g"),value:function(t){this.changeRgbColor()}},{key:In("$rgb_b"),value:function(t){this.changeRgbColor()}},{key:In("$rgb_a"),value:function(t){this.changeRgbColor()}},{key:In("$hsl_h"),value:function(t){this.changeHslColor()}},{key:In("$hsl_s"),value:function(t){this.changeHslColor()}},{key:In("$hsl_l"),value:function(t){this.changeHslColor()}},{key:In("$hsl_a"),value:function(t){this.changeHslColor()}},{key:$n("$hexCode"),value:function(t){var e=this.refs.$hexCode.val();"#"!=e.charAt(0)||7!=e.length&&9!==e.length||this.parent.initColor(e)}},{key:jn("$formatChangeButton"),value:function(t){this.nextFormat()}},{key:jn("$el .information-item.hex .input-field .title"),value:function(t){this.goToFormat("hex")}},{key:jn("$el .information-item.rgb .input-field .title"),value:function(t){this.goToFormat("hsl")}},{key:jn("$el .information-item.hsl .input-field .title"),value:function(t){this.goToFormat("rgb")}},{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()}}])&&Ay(e.prototype,n),r&&Ay(e,r),i}(Ao);function zy(t){return(zy="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 Fy(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function Gy(t,e){for(var n=0;n\n
\n
\n

Color Palettes

\n ×\n
\n
\n
\n '}},{key:Do("changeCurrentColorSets"),value:function(){this.refresh()}},{key:Do("toggleColorChooser"),value:function(){this.toggle()}},{key:ur("$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:jn("$toggleButton"),value:function(t){this.toggle()}},{key:jn("$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(){Hy(Ky(i.prototype),"destroy",this).call(this),this.hide()}}])&&Gy(e.prototype,n),r&&Gy(e,r),i}(Ao);function Wy(t){return(Wy="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 Zy(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function qy(t,e){for(var n=0;n\n \n
\n \n '}},{key:ur("$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:Do("changeCurrentColorSets"),value:function(){this.refresh()}},{key:Do("initColor"),value:function(){this.refresh()}},{key:jn("$colorSetsChooseButton"),value:function(t){this.emit("toggleColorChooser")}},{key:Dn("$colorSetsColorList"),value:function(t){if(t.preventDefault(),this.parent.manager.getCurrentColorSets().edit){var e=dn.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:jn("$colorSetsColorList .add-color-item"),value:function(t){this.addColor(this.parent.getColor())}},{key:jn("$colorSetsColorList .color-item"),value:function(t,e){this.parent.initColor(e.attr("data-color"))}}])&&qy(e.prototype,n),r&&qy(e,r),i}(Ao);function rh(t){return(rh="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 oh(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function ih(t,e){for(var n=0;n\n \n \n \n \n '}},{key:"show",value:function(t,e){var n=yr.pos(t);this.$el.px("top",n.clientY-10),this.$el.px("left",n.clientX),this.$el.addClass("show"),this.selectedColorIndex=e,M(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:Do("showContextMenu"),value:function(t,e){this.show(t,e)}},{key:jn("$el .menu-item"),value:function(t,e){t.preventDefault(),this.runCommand(e.attr("data-type")),this.hide()}}])&&ih(e.prototype,n),r&&ih(e,r),i}(Ao);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 ph(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function yh(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:ey,Opacity:py,ColorView:wy,ColorWheel:Cy,Information:By,CurrentColorSets:nh,ColorSetsChooser:Uy,ContextMenu:lh}}}])&&yh(e.prototype,n),r&&yh(e,r),i}(Tp);function gh(t){return(gh="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 wh(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function Oh(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"})}}])&&Oh(e.prototype,n),r&&Oh(e,r),i}(Kp);function Rh(t){return(Rh="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 $h(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function Eh(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=yr.pos(t).pageX-e.left,i=yr.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:Do("changeColor","initColor"),value:function(){this.refresh()}},{key:Xn("document"),value:function(t){this.isDown=!1}},{key:Hn("document"),value:function(t){this.isDown&&this.setMainColor(t)}},{key:Gn(),value:function(t){this.isDown=!0,this.setMainColor(t)}},{key:Xn(),value:function(t){this.isDown=!1}}])&&Eh(e.prototype,n),r&&Eh(e,r),i}(Ao);function Ih(t){return(Ih="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 Vh(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function Mh(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{Hue:xh,Opacity:py,ColorView:wy,Palette:Ah,Information:By,CurrentColorSets:nh,ColorSetsChooser:Uy,ContextMenu:lh}}}])&&Mh(e.prototype,n),r&&Mh(e,r),i}(Tp);function Hh(t){return(Hh="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 Xh(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function Yh(t,e){for(var n=0;n\n \n
\n \n \n
\n \n "}},{key:"components",value:function(){return{Hue:xh,Opacity:py,Palette:Ah}}}])&&Yh(e.prototype,n),r&&Yh(e,r),i}(Tp);function qh(t){return(qh="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 Jh(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function Qh(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)}}])&&Qh(e.prototype,n),r&&Qh(e,r),i}(Kp);function id(t){return(id="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 ad(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function cd(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"})}}])&&cd(e.prototype,n),r&&cd(e,r),i}(od);function hd(t){return(hd="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 dd(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function vd(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function bd(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function md(t,e){for(var n=0;n\n
\n
\n
\n
\n \n '}},{key:"refresh",value:function(){gd(Sd(i.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:yd,Opacity:jd,Palette:Ah}}}])&&Rd(e.prototype,n),r&&Rd(e,r),i}(Tp);function Dd(t){return(Dd="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 Ad(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function Id(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=gt((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}),this.emit("changeColor"))}}])&&Id(e.prototype,n),r&&Id(e,r),i}(Cy);function Gd(t){return(Gd="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 Hd(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function Xd(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:ey,Opacity:py,ColorView:wy,ColorRing:Fd,Palette:Ah,Information:By,CurrentColorSets:nh,ColorSetsChooser:Uy,ContextMenu:lh}}}])&&Xd(e.prototype,n),r&&Xd(e,r),i}(Tp);function Zd(t){return(Zd="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 qd(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function Jd(t,e){for(var n=0;n\n \n
\n \n \n
\n \n \n \n \n \n "}},{key:"components",value:function(){return{Hue:yd,Opacity:jd,Palette:Ah,Information:By,CurrentColorSets:nh,ColorSetsChooser:Uy,ContextMenu:lh}}}])&&Jd(e.prototype,n),r&&Jd(e,r),i}(Tp);function ov(t){return(ov="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 iv(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function av(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:jn("$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:ey,Opacity:py,ColorView:wy,ColorRing:Fd,Palette:Ah,Information:By,CurrentColorSets:nh,ColorSetsChooser:Uy,ContextMenu:lh}}}])&&av(e.prototype,n),r&&av(e,r),i}(Tp);function pv(t){return(pv="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 yv(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function hv(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:jn("$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:yd,Opacity:jd,Palette:Ah,Information:By,CurrentColorSets:nh,ColorSetsChooser:Uy,ContextMenu:lh}}}])&&hv(e.prototype,n),r&&hv(e,r),i}(Tp),wv={create:function(t){switch(t.type){case"macos":return new mh(t);case"xd":return new rv(t);case"xd-tab":return new gv(t);case"ring":return new Wd(t);case"ring-tab":return new fv(t);case"mini":return new Zh(t);case"mini-vertical":return new Td(t);case"sketch":case"palette":default:return new Gh(t)}},ColorPicker:Gh,ChromeDevToolColorPicker:Gh,MacOSColorPicker:mh,RingColorPicker:Wd,MiniColorPicker:Zh,MiniVerticalColorPicker:Td,XDColorPicker:rv};function Ov(t){return(Ov="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){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function Sv(t,e){for(var n=0;n0&&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)}}])&&ib(e.prototype,n),r&&ib(e,r),i}(ui);function pb(t,e){for(var n=0;nt.length)&&(e=t.length);for(var n=0,r=new Array(e);n0&&void 0!==arguments[0]?arguments[0]:"50% 50%",e="50% 50%",n="";if((t=t||"50%").includes("at")){var r=t.split("at").map((function(t){return t.trim()})),o=db(r,2);e=o[0],n=o[1]}else n=t.trim();var i=n.split(" "),a=db(i,2),c=a[0],u=a[1];M(u)&&(u=c),c=ln.parse(c),u=ln.parse(u);var s=e.split(" "),l=db(s,2),f=l[0],p=l[1];return M(p)&&(p=f),{radiusX:f=ln.parse(f),radiusY:p=ln.parse(p),x:c,y:u}}},{key:"parseStyleForInset",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",e=t.split("round"),n=db(e,2),r=n[0],o=n[1],i=yb.parse(r),a=db(i,5),c=a[0],u=a[1],s=a[2],l=a[3],f=a[4];if(o)var p=yb.parse(o),y=db(p,5),h=y[0],d=y[1],v=y[2],b=y[3],m=y[4];return{isAll:1===c,top:u,right:s,bottom:l,left:f,round:o,isAllRadius:1===h,topRadius:d,rightRadius:v,bottomRadius:b,leftRadius:m}}},{key:"parseStyleForPolygon",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";return t.split(",").filter((function(t){return t.trim()})).map((function(t){var e=db(t.trim().split(" "),2),n=e[0],r=e[1];return{x:ln.parse(n),y:ln.parse(r)}}))}}],(n=[{key:"getDefaultObject",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return kb(xb(i.prototype),"getDefaultObject",this).call(this,mb({itemType:"clip-path",type:"none",value:""},t))}},{key:"toCloneObject",value:function(){return mb(mb({},kb(xb(i.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()}}}])&&Ob(e.prototype,n),r&&Ob(e,r),i}(ui);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 _b(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(t)))return;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)||Tb(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Cb(t){return function(t){if(Array.isArray(t))return Db(t)}(t)||function(t){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(t))return Array.from(t)}(t)||Tb(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Tb(t,e){if(t){if("string"==typeof t)return Db(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Db(t,e):void 0}}function Db(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n0&&void 0!==arguments[0]?arguments[0]:{};return Bb(Hb(i.prototype),"getDefaultObject",this).call(this,Ib({position:"absolute",x:ln.px(0),y:ln.px(0),right:"",bottom:"",width:ln.px(300),height:ln.px(300),rootVariable:"",variable:"",transform:"",filter:"","backdrop-filter":"","background-color":"","background-clip":"","background-image":"",pattern:"",border:"","border-radius":"","box-shadow":"","box-sizing":"border-box","text-shadow":"","text-clip":"","clip-path":"",color:"black","font-size":ln.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":"",overflow:"visible",opacity:"",rotate:"","text-fill-color":"","text-stroke-color":"","text-stroke-width":"","offset-path":"","offset-distance":"","z-index":ln.auto,layout:"default","flex-layout":"display:flex;","grid-layout":"display:grid;",outline:{},animations:[],transitions:[],selectors:[],svg:[]},t))}},{key:"toCloneObject",value:function(){var t=this.json;return Ib(Ib({},Bb(Hb(i.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"],border:t.border,"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"],overflow:t.overflow,opacity:t.opacity+"",rotate:t.rotate+"","flex-layout":t["flex-layout"],"grid-layout":t["grid-layout"],outline:N(t.outline),animations:t.animations.map((function(t){return t.clone()})),transitions:t.transitions.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=Bb(Hb(i.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:"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 Fv(Ib({checked:!0},t)))}},{key:"createSelector",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return this.addSelector(new fb(Ib({checked:!0},t)))}},{key:"createTransition",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return this.addTransition(new Qv(Ib({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:"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:"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&&M(n)){var o=Ib({},r.all);r.top=Ib({},o),r.bottom=Ib({},o),r.left=Ib({},o),r.right=Ib({},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=Ib(Ib({},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={};return t.forEach((function(t){T(t.toCSS(),(function(t,n){e[t]||(e[t]=[]),e[t].push(n)}))})),U(e)}},{key:"toStringPropertyCSS",value:function(t){return tt(this.json[t])}},{key:"toBackgroundImageCSS",value:function(){var t=[];return Af.parseStyle(this.json.pattern).forEach((function(e){t.push.apply(t,Cb(nf.parseStyle(tt(e.toCSS()))))})),t.push.apply(t,Cb(nf.parseStyle(tt(this.json["background-image"])))),nf.joinCSS(t)}},{key:"toLayoutCSS",value:function(){var t=this.json.layout;if(this.hasLayout()){if("flex"===t)return this.toFlexLayoutCSS();if("grid"===t)return this.toGridLayoutCSS()}return{}}},{key:"toLayoutItemCSS",value:function(){var t=this.json.parent.layout,e={};return"flex"===t?e={position:"relative",left:"auto !important",top:"auto !important"}:"grid"===t&&(e={position:"relative",left:"auto !important",top:"auto !important",width:"auto !important",height:"auto !important"}),"flex"===t?e=Ib(Ib({},e),tt(this.json["flex-layout-item"])):"grid"===t&&(e=Ib(Ib({},e),tt(this.json["grid-layout-item"]))),e}},{key:"toFlexLayoutCSS",value:function(){return Ib({display:"flex"},this.toStringPropertyCSS("flex-layout"))}},{key:"toGridLayoutCSS",value:function(){return Ib({display:"grid"},this.toStringPropertyCSS("grid-layout"))}},{key:"toBorderCSS",value:function(){return this.toStringPropertyCSS("border")}},{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]?Vb({},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 Q(this.toCSS())}},{key:"toExport",value:function(){return Q(this.toCSS(!0))}},{key:"toExportSVGCode",value:function(){return""}},{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]:"";return this.json.selectors.map((function(e){return e.toString(t)})).join("\n\n")}},{key:"toNestedCSS",value:function(t){return[]}},{key:"toNestedBoundCSS",value:function(t){return[]}},{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]:"",n="\n".concat(t," { /* ").concat(this.json.itemType," */\n ").concat(Q(this.toCSS(),"\n "),"; \n ").concat(e,"\n}\n").concat(this.toNestedCSS().map((function(e){return"".concat(t," ").concat(e.selector," { \n ").concat(e.cssText?e.cssText:Q(e.css||{},"\n\t\t"),"; \n }")})).join("\n"),"\n").concat(this.toSelectorString(t),"\n");return n}},{key:"generateDragView",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",n=this.generateView(t,e).replace(/background\-/gi,"");return n}},{key:"generateSVG",value:function(){var t=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if(t){var e=this.json.width.value,n=this.json.height.value;return'\n\n ').concat(this.rootSVG,"\n")}return this.svg}},{key:"wrapperRootSVG",value:function(t,e,n,r,o){return"\n \n ".concat(this.toDefString,"\n ").concat(o,"\n \n ")}},{key:"toSVG",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]&&arguments[2],r=this.json,o=r.layers,i=r.width,a=r.height,c=r.elementType,u=c||"div",s=this.toCSS();return n?(delete s.left,delete s.top,"absolute"===s.position&&delete s.position,this.wrapperRootSVG(t,e,i,a,'\n \n \n
\n <').concat(u,' style="').concat(Q(s),'" > \n
\n
\n
\n ").concat(o.map((function(t){return t.svg})).join("\n\t"),"\n "))):"\n ".concat(this.toDefString,'\n \n \n
\n <').concat(u,' style="').concat(Q(s),'" > \n
\n
\n \n
\n ").concat(o.map((function(t){return t.svg})).join("\n\t")," \n ")}},{key:"toBound",value:function(){var t={x:this.json.x?this.json.x.clone():ln.px(0),y:this.json.y?this.json.y.clone():ln.px(0),width:this.json.width.clone(),height:this.json.height.clone()};return t.x2=ln.px(t.x.value+t.width.value),t.y2=ln.px(t.y.value+t.height.value),t}},{key:"updateFunction",value:function(t){var e=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];if(e){var n=t.$('[data-id="'.concat(this.innerSVGId,'"]'));if(n){var r=this.toDefInnerString.trim();if(r){var o=n.$("defs");o.html(r)}}else{var i=this.toDefString.trim();if(i){var a=dn.createByHTML(i);a&&t.prepend(a)}}}}},{key:"html",get:function(){var t=this.json,e=t.elementType,n=t.id,r=t.name,o=t.layers,i=t.itemType,a=e||"div";return"<".concat(a,' class="').concat(nt(Vb({"element-item":!0},i,!0)),'" ').concat(et({"data-id":n,"data-title":r}),">\n ").concat(this.toDefString,"\n ").concat(o.map((function(t){return t.html})).join("\n\t"),"\n")}},{key:"svg",get:function(){var t=this.json,e=t.x,n=t.y;return e=e.value,n=n.value,this.toSVG(e,n)}},{key:"rootSVG",get:function(){return this.toSVG(0,0,!0)}},{key:"toDefInnerString",get:function(){return"\n ".concat(this.toClipPath,"\n ")}},{key:"toClipPath",get:function(){var t=$b.parseStyle(this.json["clip-path"]),e=t.value;switch(t.type){case"path":return'');case"svg":return'').concat(e,"")}return""}},{key:"innerSVGId",get:function(){return this.json.id+"inner-svg"}},{key:"toDefString",get:function(){var t=this.toDefInnerString.trim();return t?"\n \n \n ').concat(t,"\n \n \n "):""}},{key:"clipPathId",get:function(){return this.json.id+"clip-path"}}])&&Lb(e.prototype,n),r&&Lb(e,r),i}(Ev),Yb='';function Nb(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function Kb(t){for(var e=1;e\n \n \n',volume_up:'\n \n',volume_off:'\n\n \n\n',pentool:'\n\n \n \n \n',launch:'\n \n \n ',apps:'',outline_rect:'\n \n \n \n',outline_circle:'\n \n \n \n',keyboard:'',local_movie:'',same_height:'\n\n \n\n',same_width:'\n\n \n\n',middle:'\n\n \n\n',bottom:'\n\n \n\n',top:'\n\n \n\n',right:'\n\n \n\n',center:'\n\n \n\n',left:'\n\n \n\n',flag:'',lens:'',local_library:'',italic:'',strikethrough:'',underline:'',cylinder:'\n\n\n\n\n\n',text_rotate:'',device_hub:'',control_point:'',flip_camera:'\n\n \n \n \n\n',flipY:'',flip:'',account_tree:'',format_shapes:'',merge:'',texture:'',settings_input_component:'',view_comfy:'',camera_roll:'',broken_image:'',shadow:'',opacity:'',looks:'',vintage:'',waves:'',blur_linear:'',blur:'',landscape:'',palette:'',diffuse:'',specular:'',photo:'',near_me:'',view_list:'',flash_on:'',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:Yb,check:'',video:'\n \n \n \n',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 Zb(t){return(Zb="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 qb(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function Jb(t){for(var e=1;e0&&void 0!==arguments[0]?arguments[0]:{};return nm(am(i.prototype),"getDefaultObject",this).call(this,Jb({itemType:"layer",name:"New Layer",tagName:"div"},t))}},{key:"getDefaultTitle",value:function(){return"Layer"}},{key:"getIcon",value:function(){return Wb.rect}},{key:"toCloneObject",value:function(){return Jb(Jb({},nm(am(i.prototype),"toCloneObject",this).call(this)),{},{tagName:this.json.tagName})}},{key:"screenX",get:function(){return this.json.parent?ln.px(this.json.parent.screenX.value+(this.json.x||zero).value):this.json.x||ln.px(0)}},{key:"screenY",get:function(){return this.json.parent?ln.px(this.json.parent.screenY.value+(this.json.y||zero).value):this.json.y||ln.px(0)}}])&&em(e.prototype,n),r&&em(e,r),i}(Xb);function um(t){return(um="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 sm(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function lm(t){for(var e=1;e0&&void 0!==arguments[0]?arguments[0]:{},e=Pt();return hm(mm(i.prototype),"getDefaultObject",this).call(this,lm({itemType:"svgfilter",id:e,in:[],bound:{x:100,y:100,targetX:0,targetY:0},connected:[]},t))}},{key:"getInCount",value:function(){return 0}},{key:"setIn",value:function(t,e){this.json.in[t]={id:e.id,type:e.type}}},{key:"setConnected",value:function(t){0===this.json.connected.filter((function(e){return e.id===t.id})).length&&this.json.connected.push({id:t.id})}},{key:"convert",value:function(t){return F(t.in)&&(t.in=JSON.parse(t.in)),F(t.bound)&&(t.bound=JSON.parse(t.bound)),F(t.connected)&&(t.connected=JSON.parse(t.connected)),t}},{key:"toCloneObject",value:function(){return lm(lm({},hm(mm(i.prototype),"toCloneObject",this).call(this)),{},{id:this.json.id,in:N(this.json.in),bound:N(this.json.bound),connected:N(this.json.connected)})}},{key:"getDefaultAttribute",value:function(){var t=this,e=[];return this.json.connected.length&&e.push('result="'.concat(this.json.id,'result"')),Object.keys(wm).filter((function(e){return!!t.json[e]})).forEach((function(n){e.push("".concat(n,'="').concat(t.json[n],'"'))})),e.join(" ")+" "+this.getSourceInAttribute()}},{key:"hasInIndex",value:function(){return!1}},{key:"getSourceInAttribute",value:function(t){var e=this;return(t||this.json.in).map((function(t,n){if(!t)return"";var r=0===n?"":n+1+"";return e.hasInIndex()||(r=""),gm.includes(t.type)?"in".concat(r,'="').concat(t.type,'"'):"in".concat(r,'="').concat(t.id,'result"')})).join(" ")}},{key:"toString",value:function(){var t=this.json,e=t.type,n=t.value;return"")}}])&&ym(e.prototype,n),r&&ym(e,r),i}(ui);function km(t){return(km="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 Sm(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function jm(t,e){for(var n=0;n\n \n ')}}])&&jm(e.prototype,n),r&&jm(e,r),i}(Om);function Cm(t){return(Cm="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){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function Dm(t,e){for(var n=0;n\n ").concat(e.map((function(e){return"")})).join(""),"\n ")}}])&&Dm(e.prototype,n),r&&Dm(e,r),i}(Om);function zm(t){return(zm="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 Fm(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function Gm(t,e){for(var n=0;n")}},{key:"hasInIndex",value:function(){return!0}}])&&Gm(e.prototype,n),r&&Gm(e,r),i}(Om);function Wm(t){return(Wm="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 Zm(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function qm(t,e){for(var n=0;n")}}])&&qm(e.prototype,n),r&&qm(e,r),i}(Om);function og(t){return(og="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 ig(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function ag(t,e){for(var n=0;n")}}])&&ag(e.prototype,n),r&&ag(e,r),i}(Om);function yg(t){return(yg="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 hg(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function dg(t,e){for(var n=0;n")}},{key:"hasInIndex",value:function(){return!0}}])&&dg(e.prototype,n),r&&dg(e,r),i}(Om);function kg(t){return(kg="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 Sg(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function jg(t,e){for(var n=0;n")}}])&&jg(e.prototype,n),r&&jg(e,r),i}(Om);function Cg(t){return(Cg="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 Tg(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function Dg(t,e){for(var n=0;n")}}])&&Dg(e.prototype,n),r&&Dg(e,r),i}(Om);function zg(t){return(zg="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 Fg(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function Gg(t,e){for(var n=0;n")}}])&&Gg(e.prototype,n),r&&Gg(e,r),i}(Om);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 Zg(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function qg(t,e){for(var n=0;n")}}])&&qg(e.prototype,n),r&&qg(e,r),i}(Om);function ow(t){return(ow="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 iw(t,e){return lw(t)||function(t,e){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(t)))return;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)||uw(t,e)||cw()}function aw(t){return lw(t)||function(t){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(t))return Array.from(t)}(t)||uw(t)||cw()}function cw(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function uw(t,e){if(t){if("string"==typeof t)return sw(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?sw(t,e):void 0}}function sw(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n\n ").concat(e&&""),"\n ").concat(n&&""),"\n ").concat(r&&""),"\n ").concat(o&&""),"\n ")}}])&&pw(e.prototype,n),r&&pw(e,r),i}(Om);function gw(t){return(gw="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 ww(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function Ow(t,e){for(var n=0;n")}}])&&Ow(e.prototype,n),r&&Ow(e,r),i}(Om);function $w(t){return($w="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 Ew(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function _w(t,e){for(var n=0;n")}}])&&_w(e.prototype,n),r&&_w(e,r),i}(Om);function Mw(t){return(Mw="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 Lw(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function Bw(t,e){for(var n=0;n")}}])&&Bw(e.prototype,n),r&&Bw(e,r),i}(Om);function Nw(t){return(Nw="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 Kw(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function Uw(t){for(var e=1;e\n ").concat(this.json.lightInfo,"\n ")}}])&&qw(e.prototype,n),r&&qw(e,r),i}(Om);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){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function aO(t){for(var e=1;e\n ").concat(this.json.lightInfo,"\n ")}},{key:"getSourceInAttribute",value:function(){return""}}])&&sO(e.prototype,n),r&&sO(e,r),i}(Om);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 bO(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function mO(t,e){for(var n=0;n")}}])&&mO(e.prototype,n),r&&mO(e,r),i}(Om);function PO(t){return(PO="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 xO(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function RO(t,e){for(var n=0;n")}},{key:"hasInIndex",value:function(){return!0}}])&&RO(e.prototype,n),r&&RO(e,r),i}(Om);function AO(t){return(AO="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){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function VO(t){for(var e=1;e0&&void 0!==arguments[0]?arguments[0]:{};return zO(XO(i.prototype),"getDefaultObject",this).call(this,VO({type:"Source"},t))}},{key:"isSource",value:function(){return!0}},{key:"toString",value:function(){return""}}])&&BO(e.prototype,n),r&&BO(e,r),i}(Om);function NO(t){return(NO="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 KO(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function UO(t,e){for(var n=0;n")}}])&&Uk(e.prototype,n),r&&Uk(e,r),i}(Om);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){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function rS(t,e){for(var n=0;n")}}])&&rS(e.prototype,n),r&&rS(e,r),i}(Om);function lS(t){return(lS="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 fS(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function pS(t,e){for(var n=0;n")}}])&&pS(e.prototype,n),r&&pS(e,r),i}(Om);function gS(t){return(gS="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){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function OS(t,e){for(var n=0;n")}}])&&OS(e.prototype,n),r&&OS(e,r),i}(Om);function $S(t){return($S="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 ES(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function _S(t,e){for(var n=0;n")}}])&&_S(e.prototype,n),r&&_S(e,r),i}(Om);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 LS(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function BS(t,e){for(var n=0;n")}}])&&BS(e.prototype,n),r&&BS(e,r),i}(Om);function NS(t){return(NS="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 KS(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function US(t){for(var e=1;e0&&void 0!==arguments[0]?arguments[0]:{};return JS(nj(i.prototype),"getDefaultObject",this).call(this,US({itemType:"svgfilter",result:""},t))}},{key:"getDefaultAttribute",value:function(){var t=this;return rj.map((function(e){return"".concat(e,'="').concat(t.json[e],'"')})).join(" ")}},{key:"toString",value:function(){var t=this.json,e=t.type,n=t.value;return"")}}])&&qS(e.prototype,n),r&&qS(e,r),i}(ui),ij={Image:YS,Tile:VS,Saturate:sS,HueRotate:mS,LuminanceAlpha:RS,DropShadow:tS,SourceGraphic:tk,SourceAlpha:sk,BackgroundImage:mk,BackgroundAlpha:Rk,FillPaint:Vk,StrokePaint:Yk,ComponentTransfer:mw,DistantLight:Rw,PointLight:Vw,SpotLight:Yw,DiffuseLighting:rO,SpecularLighting:dO,Blend:DO,Offset:jO,RotaMatrix:_m,GaussianBlur:Ug,Flood:rw,Merge:Bm,Composite:Um,Morphology:rg,Turbulence:pg,DisplacementMap:Og,ColorMatrix:_g,ConvolveMatrix:Bg},aj={Image:YS.spec,Tile:VS.spec,DropShadow:tS.spec,Saturate:sS.spec,HueRotate:mS.spec,LuminanceAlpha:RS.spec,Offset:jO.spec,ComponentTransfer:mw.spec,SpecularLighting:dO.spec,SpotLight:Yw.spec,PointLight:Vw.spec,DistantLight:Rw.spec,DiffuseLighting:rO.spec,Blend:DO.spec,RotaMatrix:_m.spec,Merge:Bm.spec,GaussianBlur:Ug.spec,Flood:rw.spec,Morphology:rg.spec,Composite:Um.spec,Turbulence:pg.spec,DisplacementMap:Og.spec,ColorMatrix:_g.spec,ConvolveMatrix:Bg.spec};function cj(t){return(cj="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 uj(t){return function(t){if(Array.isArray(t))return sj(t)}(t)||function(t){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(t))return Array.from(t)}(t)||function(t,e){if(!t)return;if("string"==typeof t)return sj(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);"Object"===n&&t.constructor&&(n=t.constructor.name);if("Map"===n||"Set"===n)return Array.from(t);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return sj(t,e)}(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function sj(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n0&&void 0!==arguments[0]?arguments[0]:{};return this.addProperty(fj({checked:!0,value:ln.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],fj({},e))}},{key:"updatePropertyByKey",value:function(t){for(var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=this.json.properties,r=-1,o=0,i=n.length;ot.length)&&(e=t.length);for(var n=0,r=new Array(e);ne.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 wj($j({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()}}])&&Cj(e.prototype,n),r&&Cj(e,r),i}(ui);function Lj(t){return(Lj="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 Bj(t){return function(t){if(Array.isArray(t))return zj(t)}(t)||function(t){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(t))return Array.from(t)}(t)||function(t,e){if(!t)return;if("string"==typeof t)return zj(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);"Object"===n&&t.constructor&&(n=t.constructor.name);if("Map"===n||"Set"===n)return Array.from(t);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return zj(t,e)}(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function zj(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);nt.length)&&(e=t.length);for(var n=0,r=new Array(e);n0&&void 0!==arguments[0]?arguments[0]:{};return iP(sP(i.prototype),"getDefaultObject",this).call(this,Qj({itemType:"project",name:"new Project",description:"",rootVariable:""},t))}},{key:"toCloneObject",value:function(){var t=this.json,e=t.name,n=t.description,r=t.rootVariable;return Qj(Qj({},iP(sP(i.prototype),"toCloneObject",this).call(this)),{},{name:e,description:n,rootVariable:r})}},{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")}}])&&oP(e.prototype,n),r&&oP(e,r),i}(function(t){!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&&Kj(t,e)}(i,t);var e,n,r,o=Uj(i);function i(){return Xj(this,i),o.apply(this,arguments)}return e=i,(n=[{key:"getDefaultObject",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return Nj(Zj(i.prototype),"getDefaultObject",this).call(this,Gj({colors:[],gradients:[],svgfilters:[],svgimages:[],keyframes:[],images:[],videos:[],audios:[]},t))}},{key:"addKeyframe",value:function(t){return this.json.keyframes.push(t),t}},{key:"createKeyframe",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return this.addKeyframe(new Mj(Gj({checked:!0},t)))}},{key:"removeKeyframe",value:function(t){this.removePropertyList(this.json.keyframes,t)}},{key:"sortItem",value:function(t,e,n){t.splice.apply(t,[n+(e1&&void 0!==arguments[1]?arguments[1]:{};this.json.keyframes[+t].reset(e)}},{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:"copyPropertyList",value:function(t,e){var n=Gj({},t[e]);t.splice(e,0,n)}},{key:"toSVGString",value:function(){return this.json.svgfilters.map((function(t){var e=t.filters.map((function(t){return oj.parse(t)}));return"\n ").concat(e.join("\n"),"\n\n")})).join("\n\n")}},{key:"toCloneObject",value:function(){var t=this.json;return Gj(Gj({},Nj(Zj(i.prototype),"toCloneObject",this).call(this)),{},{colors:N(t.colors),gradients:N(t.gradients),svgfilters:N(t.svgfilters),svgimages:N(t.svgimages),images:N(t.images),keyframes:t.keyframes.map((function(t){return t.clone()}))})}},{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]=Gj(Gj({},this.json.colors[t]),e)}},{key:"getColorIndex",value:function(t){return this.json.colors[t]}},{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]=Gj(Gj({},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:"removeVideo",value:function(t){this.removePropertyList(this.json.videos,t)}},{key:"copyVideo",value:function(t){this.copyPropertyList(this.json.videos,t)}},{key:"sortVideo",value:function(t,e){this.sortItem(this.json.videos,t,e)}},{key:"setVideoValue",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};this.json.videos[t]=Gj(Gj({},this.json.videos[t]),e)}},{key:"addVideo",value:function(t){return this.json.videos.push(t),t}},{key:"createVideo",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return this.addVideo(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]=Gj(Gj({},this.json.gradients[t]),e)}},{key:"getGradientIndex",value:function(t){return this.json.gradients[t]}},{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]=Gj(Gj({},this.json.svgfilters[t]),e)}},{key:"addSVGFilter",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};this.json.svgfilters.push(t);var e=this.json.svgfilters.length-1;return e}},{key:"createSVGFilter",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return this.addSVGFilter(t)}},{key:"getSVGImageIndex",value:function(t){var e=this.json.svgimages.map((function(t,e){return{id:t.id,index:e}})).filter((function(e){return e.id===t}))[0];return e?e.index:-1}},{key:"removeSVGImage",value:function(t){this.removePropertyList(this.json.svgimages,t)}},{key:"copySVGImage",value:function(t){this.copyPropertyList(this.json.svgimages,t)}},{key:"sortSVGImage",value:function(t,e){this.sortItem(this.json.svgimages,t,e)}},{key:"setSVGImageValue",value:function(t,e){this.json.svgimages[t]=Gj(Gj({},this.json.svgimages[t]),e)}},{key:"addSVGImage",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};this.json.svgimages.push(t);var e=this.json.svgimages.length-1;return e}},{key:"createSVGImage",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return this.addSVGImage(t)}}])&&Yj(e.prototype,n),r&&Yj(e,r),i}(qo));function fP(t){return(fP="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 pP(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function yP(t,e){for(var n=0;nt.length)&&(e=t.length);for(var n=0,r=new Array(e);n0&&void 0!==arguments[0]?arguments[0]:{};return $P(TP(i.prototype),"getDefaultObject",this).call(this,jP({itemType:"cube",name:"New Cube","transform-style":"preserve-3d","backface-visibility":"visible",rate:ln.number(1),transform:"rotateX(10deg) rotateY(30deg)",border:"border:1px solid black"},t))}},{key:"getProps",value:function(){return[{key:"rate",editor:"NumberRangeEditor",editorOptions:{label:"radius",min:0,max:10,step:.1},refresh:!0,defaultValue:this.json.rate.value},{key:"backface-visibility",editor:"SelectIconEditor",editorOptions:{label:"visibility",options:"visible,hidden"},refresh:!0,defaultValue:this.json["backface-visibility"]},"Background Color"].concat(OP(DP.map((function(t){return{key:"".concat(t,".color"),editor:"ColorViewEditor",editorOptions:{label:t,params:"".concat(t,".color")},defaultValue:"rgba(0, 0, 0, 1)"}}))),["Background Image"],OP(DP.map((function(t){return{key:"".concat(t,".background"),editor:"BackgroundImageEditor",editorOptions:{title:t},defaultValue:""}}))))}},{key:"setCustomKeyframes",value:function(t,e){e.property.includes(".color")&&t.push({selector:'[data-id="'.concat(this.json.id,'"] ').concat(AP[e.property]),properties:[jP(jP({},e),{},{property:"background-color"})]}),e.property.includes(".background")&&t.push({selector:'[data-id="'.concat(this.json.id,'"] ').concat(AP[e.property]),properties:[jP(jP({},e),{},{property:"background-image"})]})}},{key:"toAnimationKeyframes",value:function(t){var e=this,n=[],r=[],o=[];t.forEach((function(t){t.property.includes(".color")||t.property.includes(".background")?n.push(t):IP[t.property]?r.push(t):VP[t.property]&&o.push(t)}));var i=[];return r.length&&i.push({selector:'[data-id="'.concat(this.json.id,'"]'),properties:r}),o.length&&i.push({selector:'[data-id="'.concat(this.json.id,'"] div'),properties:o}),n.length&&n.forEach((function(t){e.setCustomKeyframes(i,t)})),i}},{key:"convert",value:function(t){return(t=$P(TP(i.prototype),"convert",this).call(this,t)).rate=ln.parse(t.rate),t}},{key:"toCloneObject",value:function(){var t=this,e={};return DP.forEach((function(n){e["".concat(n,".color")]=t.json["".concat(n,".color")],e["".concat(n,".background")]=t.json["".concat(n,".background")]})),jP(jP({},$P(TP(i.prototype),"toCloneObject",this).call(this)),{},{rate:this.json.rate.clone()},e)}},{key:"enableHasChildren",value:function(){return!1}},{key:"getDefaultTitle",value:function(){return"Cube"}},{key:"getIcon",value:function(){return Wb.cube}},{key:"toDefaultCSS",value:function(){var t={};return this.json.x&&(t.left=this.json.x),this.json.y&&(t.top=this.json.y),t.visibility=this.json.visible?"visible":"hidden",jP(jP({},t),this.toKeyListCSS("position","right","bottom","width","height","transform-origin","transform","transform-style","perspective","perspective-origin"))}},{key:"toCSS",value:function(){return jP(jP(jP(jP(jP(jP(jP({},this.toVariableCSS()),this.toDefaultCSS()),this.toWebkitCSS()),this.toBoxModelCSS()),this.toAnimationCSS()),this.toTransitionCSS()),this.toLayoutItemCSS())}},{key:"toNestedCSS",value:function(){var t=this.json,e=t.rate.value,n=t.width,r=t.height,o=n.value/2,i=r.value/2,a=t["backface-visibility"],c=jP(jP(jP(jP({},this.toKeyListCSS("filter","mix-blend-mode","border-radius","background-color","opacity","color")),this.toClipPathCSS()),this.toBackgroundImageCSS()),this.toBorderCSS());return[{selector:"div",cssText:"\n position: absolute;\n left: 0px;\n top: 0px;\n bottom: 0px;\n right: 0px;\n opacity: 1;\n pointer-events: none;\n ".concat(Q(c),"\n ").trim()},{selector:".front",cssText:"\n transform:rotateY(0deg) translateZ(".concat(o*e,"px);\n width: ").concat(n,";\n height: ").concat(r,"; \n backface-visibility: ").concat(a,"; \n ").concat(t["front.color"]?"background-color: ".concat(t["front.color"],";"):"","\n ").concat(t["front.background"]?"".concat(t["front.background"],";"):"","\n\n ").trim()},{selector:".back",cssText:"\n transform: rotateY(180deg) translateZ(".concat(o*e,"px);\n width: ").concat(n,";\n height: ").concat(r,"; \n backface-visibility: ").concat(a,"; \n ").concat(t["back.color"]?"background-color: ".concat(t["back.color"],";"):""," \n ").concat(t["back.background"]?"".concat(t["back.background"],";"):"","\n ").trim()},{selector:".left",cssText:"\n transform: rotateY(-90deg) translateZ(".concat(o*e,"px);\n width: ").concat(n,";\n height: ").concat(r,"; \n backface-visibility: ").concat(a,"; \n ").concat(t["left.color"]?"background-color: ".concat(t["left.color"],";"):""," \n ").concat(t["left.background"]?"".concat(t["left.background"],";"):"","\n ").trim()},{selector:".right",cssText:"\n transform: rotateY(90deg) translateZ(".concat(o*e,"px);\n width: ").concat(n,";\n height: ").concat(r,"; \n backface-visibility: ").concat(a,"; \n ").concat(t["right.color"]?"background-color: ".concat(t["right.color"],";"):""," \n ").concat(t["right.background"]?"".concat(t["right.background"],";"):""," \n ").trim()},{selector:".top",cssText:"\n transform: rotateX(90deg) translateZ(".concat(i*e,"px);\n top: ").concat(i-o,"px;\n width: ").concat(n,";\n height: ").concat(n,";\n backface-visibility: ").concat(a,"; \n ").concat(t["top.color"]?"background-color: ".concat(t["top.color"],";"):""," \n ").concat(t["top.background"]?"".concat(t["top.background"],";"):""," \n ").trim()},{selector:".bottom",cssText:"\n transform: rotateX(-90deg) translateZ(".concat(i*e,"px);\n top: ").concat(i-o,"px; \n width: ").concat(n,";\n height: ").concat(n,"; \n backface-visibility: ").concat(a,"; \n ").concat(t["bottom.color"]?"background-color: ".concat(t["bottom.color"],";"):"","\n ").concat(t["bottom.background"]?"".concat(t["bottom.background"],";"):""," \n ").trim()}]}},{key:"toSVG",value:function(t,e){var n=arguments.length>2&&void 0!==arguments[2]&&arguments[2],r=this.json,o=r.width,i=r.height,a=this.toCSS(),c=this.toNestedCSS(),u={},s=c.find((function(t){return"div"===t.selector}))||{cssText:""};return s=s.cssText.replace(/\n/g,""),DP.forEach((function(t){u[t]=c.find((function(e){return e.selector==="."+t}))||{cssText:""},u[t]=u[t].cssText.replace(/\n/g,"")})),n?(delete a.left,delete a.top,"absolute"===a.position&&delete a.position,this.wrapperRootSVG(t,e,o,i,"\n \n
\n
\n ').concat(DP.map((function(t){return'
')})).join("")," \n
\n
\n
\n\n "))):"\n ".concat(this.toDefString,"\n \n
\n
\n ').concat(DP.map((function(t){return'
')})).join("")," \n
\n
\n
\n ")}},{key:"html",get:function(){var t=this.json,e=t.id,n=t.itemType;return"\n
\n ').concat(this.toDefString,"\n ").concat(DP.map((function(t){return"
")})).join(""),"\n
")}},{key:"svg",get:function(){var t=this.json.x.value,e=this.json.y.value;return this.toSVG(t,e)}}])&&RP(e.prototype,n),r&&RP(e,r),i}(gP);function LP(t){return(LP="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 BP(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(t)))return;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)||FP(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function zP(t){return function(t){if(Array.isArray(t))return GP(t)}(t)||function(t){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(t))return Array.from(t)}(t)||FP(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function FP(t,e){if(t){if("string"==typeof t)return GP(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?GP(t,e):void 0}}function GP(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n0&&void 0!==arguments[0]?arguments[0]:{};return UP(JP(i.prototype),"getDefaultObject",this).call(this,XP({itemType:"cylinder",name:"New Cylinder","transform-style":"preserve-3d","backface-visibility":"visible",transform:"rotateX(10deg) rotateY(30deg)",count:ln.number(40),rate:ln.number(1),border:"border-top: 1px solid black;border-bottom: 1px solid black;"},t))}},{key:"getProps",value:function(){var t=this.json.count.value;return["Side",{key:"count",editor:"NumberRangeEditor",editorOptions:{label:"Count",min:3,max:100,step:1},refresh:!0,defaultValue:t},{key:"rate",editor:"NumberRangeEditor",editorOptions:{label:"radius",min:0,max:10,step:.1},refresh:!0,defaultValue:this.json.rate.value},{key:"backface-visibility",editor:"SelectIconEditor",editorOptions:{label:"visibility",options:"visible,hidden"},refresh:!0,defaultValue:this.json["backface-visibility"]},"Color"].concat(zP(W(t).map((function(t,e){return{key:"face.".concat(e,".color"),editor:"ColorViewEditor",editorOptions:{label:"face ".concat(e),params:"face.".concat(e,".color")},defaultValue:"rgba(0, 0, 0, 1)"}}))),["Background"],zP(W(t).map((function(t,e){return{key:"face.".concat(e,".background"),editor:"BackgroundImageEditor",editorOptions:{title:"face ".concat(e)},defaultValue:""}}))))}},{key:"setCustomKeyframes",value:function(t,e){var n=this;if("rate"===e.property){var r=this.json.width,o=this.json.count.value,i=r.value/2,a=360/o,c=W(o).map((function(t,r){var o=r*a;return{selector:'[data-id="'.concat(n.json.id,'"] .face[data-index="').concat(r,'"]'),properties:[{keyframes:e.keyframes.map((function(t){var e=t.time,n=t.value,r=t.timing;return{time:e,value:"rotateY(".concat(o,"deg) translateZ(").concat(i*n,"px)"),timing:r}})),property:"transform"}]}}));t.push.apply(t,zP(c))}if(e.property.includes(".color")){var u=BP(e.property.split("."),3),s=(u[0],u[1]);u[2],t.push({selector:'[data-id="'.concat(this.json.id,'"] .face[data-index="').concat(s,'"]'),properties:[XP(XP({},e),{},{property:"background-color"})]})}if(e.property.includes(".background")){var l=BP(e.property.split("."),3);l[0],s=l[1],l[2],t.push({selector:'[data-id="'.concat(this.json.id,'"] .face[data-index="').concat(s,'"]'),properties:[XP(XP({},e),{},{property:"background-image"})]})}}},{key:"toAnimationKeyframes",value:function(t){var e=this,n=[],r=[],o=[];t.forEach((function(t){t.property.includes("face")||QP[t.property]?n.push(t):tx[t.property]?r.push(t):ex[t.property]&&o.push(t)}));var i=[];return r.length&&i.push({selector:'[data-id="'.concat(this.json.id,'"]'),properties:r}),o.length&&i.push({selector:'[data-id="'.concat(this.json.id,'"] div'),properties:o}),n.length&&n.forEach((function(t){e.setCustomKeyframes(i,t)})),i}},{key:"convert",value:function(t){return(t=UP(JP(i.prototype),"convert",this).call(this,t)).count=ln.parse(t.count),t.rate=ln.parse(t.rate),t}},{key:"toCloneObject",value:function(){var t=this,e={};return W(this.json.count.value).forEach((function(n,r){e["face.".concat(r,".color")]=t.json["face.".concat(r,".color")],e["face.".concat(r,".background")]=t.json["face.".concat(r,".background")]})),XP(XP({},UP(JP(i.prototype),"toCloneObject",this).call(this)),{},{count:this.json.count.clone(),rate:this.json.rate.clone()},e)}},{key:"enableHasChildren",value:function(){return!1}},{key:"getDefaultTitle",value:function(){return"Cylinder"}},{key:"getIcon",value:function(){return Wb.cylinder}},{key:"toDefaultCSS",value:function(){var t={};return this.json.x&&(t.left=this.json.x),this.json.y&&(t.top=this.json.y),XP(XP({},t),this.toKeyListCSS("position","right","bottom","width","height","transform-origin","transform","transform-style","perspective","perspective-origin"))}},{key:"toCSS",value:function(){return XP(XP(XP(XP(XP(XP({},this.toVariableCSS()),this.toDefaultCSS()),this.toWebkitCSS()),this.toBoxModelCSS()),this.toAnimationCSS()),this.toTransitionCSS())}},{key:"toNestedCSS",value:function(){var t=this.json,e=t.count.value,n=t.width,r=t["backface-visibility"],o=t.rate.value,i=this.cylinderInfo,a=i.angle,c=i.r,u=i.faceWidth,s=XP(XP(XP(XP({},this.toKeyListCSS("filter","mix-blend-mode","border-radius","opacity","background-color")),this.toBackgroundImageCSS()),this.toBorderCSS()),this.toClipPathCSS()),l=W(e).map((function(e,n){var r=n*a,i="face.".concat(n,".color"),u="face.".concat(n,".background");return{selector:'.face[data-index="'.concat(n,'"]'),cssText:"\n transform:rotateY(".concat(r,"deg) translateZ(").concat(c*o,"px);\n ").concat(t[i]?"background-color: ".concat(t[i],";"):"","\n ").concat(t[u]?"".concat(t[u],";"):"","\n ").trim()}}));return[{selector:".face",cssText:"\n position: absolute;\n left: ".concat(n.value/2-u/2,"px;\n top: 0px;\n bottom: 0px;\n right: 0px;\n width: ").concat(u,"px;\n backface-visibility: ").concat(r,";\n opacity: 1;\n pointer-events: none;\n ").concat(Q(s),"\n ").trim()}].concat(zP(l))}},{key:"updateFunction",value:function(t){var e=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];if(UP(JP(i.prototype),"updateFunction",this).call(this,t,e),e){var n=+t.attr("data-count");if(n!==this.json.count.value){t.$$(".face").forEach((function(t){return t.remove()}));var r=W(this.json.count.value).map((function(t,e){return"
')})).join("");t.appendHTML(r),t.attr("data-count",this.json.count)}}}},{key:"cylinderInfo",get:function(){var t=this.json.width.value,e={x:a=t/2,y:t/2},n=[],r=this.json.count.value;r<3&&(r=3);for(var o=360/r,i=0;i<360;i+=o)n.push(bt(i,a,e.x,e.y));var a,c=mt(n[0].x,n[0].y,n[1].x,n[1].y),u={x:(n[0].x+n[1].x)/2,y:(n[0].y+n[1].y)/2};return{polygon:n,faceWidth:c,angle:o,r:a=mt(u.x,u.y,e.x,e.y)}}},{key:"html",get:function(){var t=this.json,e=t.id,n=t.itemType,r=this.json.count.value;return"\n
\n ').concat(this.toDefString,"\n ").concat(W(r).map((function(t,e){return"
')})).join(""),"\n
")}},{key:"svg",get:function(){var t=this.json,e=t.width,n=t.height,r=t.x,o=t.y;r=r.value,o=o.value;var i=this.toCSS(),a=this.toNestedCSS(),c=this.json.count.value,u=a.find((function(t){return".face"===t.selector}))||{cssText:""};u=u.cssText.replace(/\n/g,"");var s=W(c).map((function(t,e){return a[e+1].cssText.replace(/\n/g,"")}));return delete i.left,delete i.top,"absolute"===i.position&&delete i.position,'\n \n ').concat(this.toDefString,"\n \n
\n
\n ').concat(W(c).map((function(t,e){return"
")})).join(""),"\n
\n
\n
\n
\n")}}])&&KP(e.prototype,n),r&&KP(e,r),i}(gP);function rx(t){return function(t){if(Array.isArray(t))return ox(t)}(t)||function(t){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(t))return Array.from(t)}(t)||function(t,e){if(!t)return;if("string"==typeof t)return ox(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);"Object"===n&&t.constructor&&(n=t.constructor.name);if("Map"===n||"Set"===n)return Array.from(t);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return ox(t,e)}(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function ox(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n8&&void 0!==arguments[8]?arguments[8]:1e3,s=fx({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 y=p/u,h=s(y);l+=mt(f.x,f.y,h.x,h.y),f=h}return l},vx=function(t,e,n,r,o,i){for(var a=arguments.length>6&&void 0!==arguments[6]?arguments[6]:1e3,c=px({x:t,y:e},{x:n,y:r},{x:o,y:i}),u=0,s=c(0),l=0;l<=a;l++){var f=l/a,p=c(f);u+=mt(s.x,s.y,p.x,p.y),s=p}return u},bx=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++)hx(n,t,i/e,r,o);var a=1/(2*e),c=n.minT;for(i=0;i4&&void 0!==arguments[4]?arguments[4]:100;return bx(fx(t,e,n,r),o)},gx=function(t,e,n){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:100;return bx(px(t,e,n),r)},wx=function(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:100;return bx(yx(t,e),n)},Ox=function(t){if("linear"===t)return yx(n={x:0,y:0},r={x:1,y:1});var e=lx(t),n={x:0,y:0},r={x:e[0],y:e[1]},o={x:e[2],y:e[3]};return fx(n,r,o,{x:1,y:1})},kx=function(t,e,n){return{x:t.x+(e.x-t.x)*n,y:t.y+(e.y-t.y)*n}},Sx=function(t,e){var n=kx(t[0],t[1],e),r=kx(t[1],t[2],e),o=kx(t[2],t[3],e),i=kx(n,r,e),a=kx(r,o,e);return kx(i,a,e)},jx=function(t,e){var n=kx(t[0],t[1],e),r=kx(t[1],t[2],e);return kx(n,r,e)},Px=function(t,e){return kx(t[0],t[1],e)},xx=function(t,e){var n=kx(t[0],t[1],e),r=kx(t[1],t[2],e),o=kx(t[2],t[3],e),i=kx(n,r,e),a=kx(r,o,e),c=kx(i,a,e);return{first:[t[0],n,i,c],second:[c,a,o,t[3]]}},Rx=function(t,e){var n=kx(t[0],t[1],e),r=kx(t[1],t[2],e),o=kx(n,r,e);return{first:[t[0],n,o],second:[o,r,t[2]]}},$x=function(t,e){var n=kx(t[0],t[1],e);return{first:[t[0],n],second:[n,t[1]]}};function Ex(t,e,n,r){var o=arguments.length>4&&void 0!==arguments[4]?arguments[4]:void 0;return function(t,e){var i=0;return i=0===e?n:1===e?r:n+(r-n)*t,o?i+o:i}}function _x(t,e,n){return function(t,e){return n}}function Cx(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 Tx(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}function Dx(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=ln.parse(n),c=ln.parse(r);return a.unit===c.unit?Ex(t,e,a.value,c.value,a.unit):a.equals(c)?_x(0,0,a):function(n,r){var u=Cx(t,e,a,o,i),s=Cx(t,e,c,o,i);return 0===r?u:1===r?s:Tx(t,e,ln.px(u.value+(s.value-u.value)*n),a.unit,o,i)}}function Ax(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 eR(){return tR(1,"start")}function nR(){return tR(1,"end")}var rR=function(){return function(t){return Math.pow(2,-10*t)*Math.sin(5*(t-.1)*Math.PI)+1}},oR={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 tR(t,e)},"step-start":eR,"step-end":nR,stepStart:eR,stepEnd:nR,"ease-out-elastic":rR,easeOutElastic:rR};function iR(t,e,n){return n.toDeg()}function aR(t,e,n,r){var o=ln.parse(n),i=ln.parse(r);return function(t,e){var n=iR(0,0,o),r=iR(0,0,i);return 0===e?n:1===e?r:ln.deg(n.value+(r.value-n.value)*t).to(o.unit)}}function cR(t){return(cR="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){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function sR(t){for(var e=1;e2&&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;at.length)&&(e=t.length);for(var n=0,r=new Array(e);n0&&void 0!==arguments[0]?arguments[0]:{};return BR(XR(n.prototype),"getDefaultObject",this).call(this,AR({itemType:"filter"},t))}},{key:"toString",value:function(){return"".concat(this.json.type,"(").concat(this.json.value||"",")")}}],[{key:"parse",value:function(t){var e=o$[t.type];return e?new e(t):new UR({value:t.type})}},{key:"parseStyle",value:function(t){var e=[];if(!t)return e;var r=Se(t);return(r.str.match(YR)||[]).forEach((function(t,o){var i=CR(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("@")}));e[o]=n.parse({type:a,offsetX:ln.parse(l[0]),offsetY:ln.parse(l[1]),blurRadius:ln.parse(l[2]),color:s[0]||"rgba(0, 0, 0, 1)"})}else e[o]=n.parse({type:a,value:ln.parse(c)})})),e}},{key:"join",value:function(t){return t.map((function(t){return n.parse(t)})).join(" ")}}]),n}(ui),KR=function(t){zR(n,t);var e=GR(n);function n(){return VR(this,n),e.apply(this,arguments)}return LR(n,[{key:"getDefaultObject",value:function(){return BR(XR(n.prototype),"getDefaultObject",this).call(this,{type:"blur",value:n.spec.defaultValue})}},{key:"toCloneObject",value:function(){return AR(AR({},BR(XR(n.prototype),"toCloneObject",this).call(this)),{},{value:ln.parse(this.json.value)})}}]),n}(NR);KR.spec={inputType:"range",min:0,max:100,step:1,unit:"px",units:["px","em"],defaultValue:ln.px(0)};var UR=function(t){zR(n,t);var e=GR(n);function n(){return VR(this,n),e.apply(this,arguments)}return LR(n,[{key:"getDefaultObject",value:function(){return BR(XR(n.prototype),"getDefaultObject",this).call(this,{type:"svg",value:n.spec.defaultValue})}},{key:"toCloneObject",value:function(){return AR(AR({},BR(XR(n.prototype),"toCloneObject",this).call(this)),{},{value:ln.parse(this.json.value)})}},{key:"toString",value:function(){return"url(#".concat(this.json.value||"",")")}}]),n}(NR);UR.spec={inputType:"select",defaultValue:""};var WR=function(t){zR(n,t);var e=GR(n);function n(){return VR(this,n),e.apply(this,arguments)}return LR(n,[{key:"getDefaultObject",value:function(){return BR(XR(n.prototype),"getDefaultObject",this).call(this,{type:"grayscale",value:n.spec.defaultValue})}},{key:"toCloneObject",value:function(){return AR(AR({},BR(XR(n.prototype),"toCloneObject",this).call(this)),{},{value:ln.parse(this.json.value)})}}]),n}(NR);WR.spec={inputType:"range",min:0,max:100,step:1,unit:"%",units:["%"],defaultValue:ln.percent(0)};var ZR=function(t){zR(n,t);var e=GR(n);function n(){return VR(this,n),e.apply(this,arguments)}return LR(n,[{key:"getDefaultObject",value:function(){return BR(XR(n.prototype),"getDefaultObject",this).call(this,{type:"hue-rotate",value:n.spec.defaultValue})}}]),n}(NR);ZR.spec={inputType:"range",min:0,max:360,step:1,unit:"deg",units:["deg"],defaultValue:ln.deg(0)};var qR=function(t){zR(n,t);var e=GR(n);function n(){return VR(this,n),e.apply(this,arguments)}return LR(n,[{key:"getDefaultObject",value:function(){return BR(XR(n.prototype),"getDefaultObject",this).call(this,{type:"invert",value:n.spec.defaultValue})}}]),n}(NR);qR.spec={inputType:"range",min:0,max:100,step:1,unit:"%",units:["%"],defaultValue:ln.percent(0)};var JR=function(t){zR(n,t);var e=GR(n);function n(){return VR(this,n),e.apply(this,arguments)}return LR(n,[{key:"getDefaultObject",value:function(){return BR(XR(n.prototype),"getDefaultObject",this).call(this,{type:"brightness",value:n.spec.defaultValue})}}]),n}(NR);JR.spec={inputType:"range",min:0,max:200,step:1,unit:"%",units:["%"],defaultValue:ln.percent(100)};var QR=function(t){zR(n,t);var e=GR(n);function n(){return VR(this,n),e.apply(this,arguments)}return LR(n,[{key:"getDefaultObject",value:function(){return BR(XR(n.prototype),"getDefaultObject",this).call(this,{type:"contrast",value:n.spec.defaultValue})}}]),n}(NR);QR.spec={inputType:"range",min:0,max:200,step:1,unit:"%",units:["%"],defaultValue:ln.percent(100)};var t$=function(t){zR(n,t);var e=GR(n);function n(){return VR(this,n),e.apply(this,arguments)}return LR(n,[{key:"getDefaultObject",value:function(){return BR(XR(n.prototype),"getDefaultObject",this).call(this,{type:"opacity",value:n.spec.defaultValue})}}]),n}(NR);t$.spec={inputType:"range",min:0,max:100,step:1,unit:"%",units:["%"],defaultValue:ln.percent(100)};var e$=function(t){zR(n,t);var e=GR(n);function n(){return VR(this,n),e.apply(this,arguments)}return LR(n,[{key:"getDefaultObject",value:function(){return BR(XR(n.prototype),"getDefaultObject",this).call(this,{type:"saturate",value:n.spec.defaultValue})}}]),n}(NR);e$.spec={inputType:"range",min:0,max:100,step:1,unit:"%",units:["%"],defaultValue:ln.percent(100)};var n$=function(t){zR(n,t);var e=GR(n);function n(){return VR(this,n),e.apply(this,arguments)}return LR(n,[{key:"getDefaultObject",value:function(){return BR(XR(n.prototype),"getDefaultObject",this).call(this,{type:"sepia",value:n.spec.defaultValue})}}]),n}(NR);n$.spec={inputType:"range",min:0,max:100,step:1,unit:"%",units:["%"],defaultValue:ln.percent(0)};var r$=function(t){zR(n,t);var e=GR(n);function n(){return VR(this,n),e.apply(this,arguments)}return LR(n,[{key:"getDefaultObject",value:function(){return BR(XR(n.prototype),"getDefaultObject",this).call(this,{type:"drop-shadow",multi:!0,offsetX:n.spec.offsetX.defaultValue,offsetY:n.spec.offsetY.defaultValue,blurRadius:n.spec.blurRadius.defaultValue,color:n.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,")")}}]),n}(NR);r$.spec={offsetX:{title:"Offset X",inputType:"range",min:-100,max:100,step:1,defaultValue:ln.px(0),unit:"px",units:["px","em"]},offsetY:{title:"Offset Y",inputType:"range",min:-100,max:100,step:1,defaultValue:ln.px(0),unit:"px",units:["px","em"]},blurRadius:{title:"Blur Radius",inputType:"range",min:0,max:100,step:1,defaultValue:ln.px(0),unit:"px",units:["px","em","%"]},color:{title:"Color",inputType:"color",defaultValue:"rgba(0, 0, 0, 1)",unit:"color"}};var o$={blur:KR,grayscale:WR,"hue-rotate":ZR,invert:qR,brightness:JR,contrast:QR,opacity:t$,saturate:e$,sepia:n$,"drop-shadow":r$,svg:UR},i$={BlurFilter:KR,GrayscaleFilter:WR,HueRotateFilter:ZR,InvertFilter:qR,BrightnessFilter:JR,ContrastFilter:QR,OpacityFilter:t$,SaturateFilter:e$,SepiaFilter:n$,DropshadowFilter:r$,URLSvgFilter:UR};function a$(t,e,n,r){var o={type:Qx(0,0,n.type,r.type),value:Zx(0,0,n.value,r.value)};switch(n.type){case"blur":o.value=Dx(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=Ex(t,e,n.value.value,r.value.value,n.value.unit);break;case"drop-shadow":o.offsetX=Dx(t,e,n.offsetX,r.offsetX,"width","self"),o.offsetY=Dx(t,e,n.offsetY,r.offsetY,"height","self"),o.blurRadius=Dx(t,e,n.blurRadius,r.blurRadius,"width","self"),o.spreadRadius=Dx(t,e,n.spreadRadius,r.spreadRadius,"width","self"),o.color=qx(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 c$(t,e,n,r){for(var o=NR.parseStyle(n),i=NR.parseStyle(r),a=Math.max(o.length,i.length),c=[],u=0,s=a;ut.length)&&(e=t.length);for(var n=0,r=new Array(e);n0&&void 0!==arguments[0]?arguments[0]:"";return g$(this,i),o.call(this,t)}return e=i,(n=[{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;B(t)&&(t=t.join(" "));for(var e=t.trim().split(P$).filter((function(t){return t})),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=b$(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 i(this.joinPoints())}},{key:"toString",value:function(){return this.joinPoints()}}])&&w$(e.prototype,n),r&&w$(e,r),i}(Ya);function R$(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;ut.length)&&(e=t.length);for(var n=0,r=new Array(e);nt.length)&&(e=t.length);for(var n=0,r=new Array(e);n1&&(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&&et.length)&&(e=t.length);for(var n=0,r=new Array(e);nt.length)&&(e=t.length);for(var n=0,r=new Array(e);n0&&void 0!==arguments[0]?arguments[0]:"linear",e=t.split("(").map((function(t){return t.trim()})),n=K$(e,2),r=n[0],o=n[1];o=(o||"").split(")")[0].trim();var i=oR[r];if(i){var a=t.split("(")[1].split(")")[0].split(",").map((function(t){return t.trim()}));return i.apply(void 0,N$(a))}return tE(t)}function tE(t){var e=Ox(t);return function(t){return e(t).y}}function eE(t){return(eE="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 nE(t){return function(t){if(Array.isArray(t))return rE(t)}(t)||function(t){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(t))return Array.from(t)}(t)||function(t,e){if(!t)return;if("string"==typeof t)return rE(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);"Object"===n&&t.constructor&&(n=t.constructor.name);if("Map"===n||"Set"===n)return Array.from(t);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return rE(t,e)}(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function rE(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n0&&void 0!==arguments[0]?arguments[0]:{};return wE(jE(i.prototype),"getDefaultObject",this).call(this,vE({itemType:"artboard",name:"New ArtBoard",width:ln.px(1e3),height:ln.px(1e3),"background-color":"white"},t))}},{key:"isLeaf",value:function(){return!1}},{key:"toCloneObject",value:function(){return vE(vE({},wE(jE(i.prototype),"toCloneObject",this).call(this)),{},{name:this.json.name})}},{key:"getDefaultTitle",value:function(){return"ArtBoard"}},{key:"getIcon",value:function(){return Wb.artboard}},{key:"toDefaultCSS",value:function(){return vE({},wE(jE(i.prototype),"toDefaultCSS",this).call(this))}}])&&gE(e.prototype,n),r&&gE(e,r),i}(function(t){!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&&lE(t,e)}(i,t);var e,n,r,o=fE(i);function i(){return cE(this,i),o.apply(this,arguments)}return e=i,(n=[{key:"getDefaultObject",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return sE(yE(i.prototype),"getDefaultObject",this).call(this,iE({timeline:[],compiledTimeline:{}},t))}},{key:"expectJSON",value:function(t){return"compiledTimeline"!==t&&sE(yE(i.prototype),"expectJSON",this).call(this,t)}},{key:"setTimelineInfo",value:function(t){var e=this.getSelectedTimeline();e&&["speed","iterationCount","direction"].forEach((function(n){L(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){L(t)&&this.setTimelineCurrentTime(t);var r=n.currentTime;this.searchTimelineOffset(r).filter(e).forEach((function(t){"offset-path"===t.property||"playTime"===t.property?t.func(r):t.layer&&t.layer.reset(aE({},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,nE(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){Uc(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=Pt(),r=iE(iE({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();if(r||(r=this.addTimeline(e,n)),r.selected=!0,t){var o=r.animations.filter((function(e){return e.id===t}));o[0]||r.animations.push({id:t,properties:[]})}}},{key:"getTimelineLayerInfo",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=Kc(t,e);return{fps:t,speed:1,direction:"normal",iterationCount:1,currentTimecode:Uc(t,0),totalTimecode:Uc(t,n),currentTime:0,totalTime:n,displayStartTime:0,displayEndTime:n}}},{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=Wc(n,o=+o)),i>r&&(i=r);var a=Kc(n,i);e.currentTime=a,e.currentTimecode=Uc(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(Uc(o,i))}}},{key:"setTimelineTotalTime",value:function(t){var e=this.getSelectedTimeline();if(e){var n=t,r=t;+n+""===n&&(n=+n,r=Wc(e.fps,n)),Kc(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&&(L(i)&&(a.time=i),L(r)&&(a.value=r),L(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=M(r)||""===r?this.getDefaultPropertyValue(n):r;var l={id:Pt(),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+"",s=a[0].editor),this.addTimelineKeyframe({layerId:t,property:e,value:c,timing:u,editor:s})}}},{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=Uc(t,e.currentTime),e.totalTimecode=Uc(t,e.totalTime))}},{key:"toCloneObject",value:function(){return iE(iE({},sE(yE(i.prototype),"toCloneObject",this).call(this)),{},{timeline:N(this.json.timeline)})}}])&&uE(e.prototype,n),r&&uE(e,r),i}(Xb));function xE(t){return(xE="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 RE(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function $E(t){for(var e=1;e0&&void 0!==arguments[0]?arguments[0]:{};return TE(VE(i.prototype),"getDefaultObject",this).call(this,$E({itemType:"image",name:"New Image",elementType:"image",src:""},t))}},{key:"enableHasChildren",value:function(){return!1}},{key:"getDefaultTitle",value:function(){return"Image"}},{key:"getIcon",value:function(){return Wb.image}},{key:"toCloneObject",value:function(){return $E($E({},TE(VE(i.prototype),"toCloneObject",this).call(this)),{},{src:this.json.src+""})}},{key:"resize",value:function(){this.reset({width:this.json.naturalWidth.clone(),height:this.json.naturalHeight.clone()})}},{key:"updateFunction",value:function(t){var e=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],n=this.json.src;e&&t.$("img").attr("src",n),TE(VE(i.prototype),"updateFunction",this).call(this,t,e)}},{key:"toNestedCSS",value:function(){return this.json,$E($E($E($E({},this.toKeyListCSS("filter","mix-blend-mode","border-radius","background-color","opacity")),this.toClipPathCSS()),this.toBackgroundImageCSS()),this.toBorderCSS()),[{selector:"img",cssText:"\n width: 100%;\n height: 100%;\n pointer-events: none;\n ".trim()}]}},{key:"toSVG",value:function(t,e){var n=arguments.length>2&&void 0!==arguments[2]&&arguments[2],r=this.json,o=r.width,i=r.height,a=r.src,c=this.toCSS();return n?(delete c.left,delete c.top,"absolute"===c.position&&delete c.position,this.wrapperRootSVG(t,e,o,i,'\n \n '))):"\n ".concat(this.toDefString,' \n \n ')}},{key:"html",get:function(){var t=this.json,e=t.id,n=t.itemType,r=t.src;return"\n
\n ').concat(this.toDefString,"\n \n
")}},{key:"svg",get:function(){var t=this.json.x.value,e=this.json.y.value;return this.toSVG(t,e)}}])&&CE(e.prototype,n),r&&CE(e,r),i}(cm);function LE(t){return(LE="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 BE(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function zE(t,e){for(var n=0;nt.length)&&(e=t.length);for(var n=0,r=new Array(e);n\n ").concat(this.colorsteps.map((function(t){return'')})).join("\n"),"\n\n ")}},{key:"toFillValue",value:function(t){return"url(#".concat(t,")")}}])&&e_(e.prototype,n),r&&e_(e,r),i}(YE);function u_(t){return(u_="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 s_(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(t)))return;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)||f_(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function l_(t){return function(t){if(Array.isArray(t))return p_(t)}(t)||function(t){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(t))return Array.from(t)}(t)||f_(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function f_(t,e){if(t){if("string"==typeof t)return p_(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?p_(t,e):void 0}}function p_(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n0&&void 0!==arguments[0]?arguments[0]:{};return m_(k_(i.prototype),"getDefaultObject",this).call(this,h_({type:"radial-gradient",cx:"50%",cy:"50%",r:"50%",fx:"50%",fy:"50%",fr:"0%",spreadMethod:"pad"},t))}},{key:"toCloneObject",value:function(){var t=this.json,e=t.cx,n=t.cy,r=t.r,o=t.fx,a=t.fy,c=t.fr,u=t.spreadMethod;return h_(h_({},m_(k_(i.prototype),"toCloneObject",this).call(this)),{},{cx:e,cy:n,r:r,fx:o,fy:a,fr:c,spreadMethod:u})}},{key:"toString",value:function(){if(0===this.colorsteps.length)return"";var t=this.getColorString(),e=this.json,n=[e.cx,e.cy,e.r,e.fx,e.fy,e.fr,e.spreadMethod].join(" ");return"".concat(this.json.type,"(").concat(n,", ").concat(t,")")}},{key:"toSVGString",value:function(t){var e=this.json,n=e.cx,r=e.cy,o=e.r,i=e.fx,a=e.fy,c=e.fr,u=e.spreadMethod;return"\n\n ").concat(this.colorsteps.map((function(t){return'')})).join("\n"),"\n\n")}},{key:"toFillValue",value:function(t){return"url(#".concat(t,")")}}])&&b_(e.prototype,n),r&&b_(e,r),i}(YE);function j_(t){return(j_="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 P_(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function x_(t){for(var e=1;e0&&void 0!==arguments[0]?arguments[0]:"transparent";return new i({colorsteps:[new $u({color:t,percent:0,index:0}),new $u({color:t,percent:100,index:0})]})}}],(n=[{key:"getDefaultObject",value:function(){return __(A_(i.prototype),"getDefaultObject",this).call(this,{type:"static-gradient",static:!0,colorsteps:[new $u({color:"red",percent:0,index:0}),new $u({color:"red",percent:100,index:1})]})}},{key:"toCloneObject",value:function(){return x_(x_({},__(A_(i.prototype),"toCloneObject",this).call(this)),{},{static:!0})}},{key:"setColor",value:function(t){this.colorsteps.forEach((function(e){e.color=t}))}},{key:"toString",value:function(){return this.json.colorsteps[0].color}},{key:"toSVGString",value:function(){return""}},{key:"toFillValue",value:function(){return this.toString()}},{key:"isStatic",value:function(){return!0}}])&&E_(e.prototype,n),r&&E_(e,r),i}(YE);function V_(t){return(V_="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 M_(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(t)))return;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(t,e){if(!t)return;if("string"==typeof t)return L_(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);"Object"===n&&t.constructor&&(n=t.constructor.name);if("Map"===n||"Set"===n)return Array.from(t);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return L_(t,e)}(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function L_(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n0&&void 0!==arguments[0]?arguments[0]:{};return X_(U_(i.prototype),"getDefaultObject",this).call(this,z_({type:"url",url:"",datauri:"",patternUnits:"userSpaceOnUse",patternWidth:"100%",patternHeight:"100%",imageX:"0%",imageY:"0%",imageWidth:"100%",imageHeight:"100%"},t))}},{key:"toCloneObject",value:function(){return z_(z_({},X_(U_(i.prototype),"toCloneObject",this).call(this)),{},{url:this.json.url,datauri:this.json.datauri,patternUnits:this.json.patternUnits,patternWidth:this.json.patternWidth,patternHeight:this.json.patternHeight,imageX:this.json.imageX,imageY:this.json.imageY,imageWidth:this.json.imageWidth,imageHeight:this.json.imageHeight})}},{key:"isUrl",value:function(){return!0}},{key:"toString",value:function(){var t=this.json,e=t.patternUnits,n=t.patternWidth,r=t.patternHeight,o=t.imageX,i=t.imageY,a=t.imageWidth,c=t.imageHeight,u=t.url,s=[e,n,r,o,i,a,c].join(",").trim();return"url(".concat(u,"#").concat(s,")")}},{key:"toSVGString",value:function(t){var e=this.json,n=e.patternUnits,r=e.patternWidth,o=e.patternHeight,i=e.imageX,a=e.imageY,c=e.imageWidth,u=e.imageHeight;return"\n \n \n \n ")}},{key:"toFillValue",value:function(t){return"url(#".concat(t,")")}}])&&H_(e.prototype,n),r&&H_(e,r),i}(du);function q_(t){return(q_="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 J_(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function Q_(t){for(var e=1;e0&&void 0!==arguments[0]?arguments[0]:{};return dC(gC(i.prototype),"getDefaultObject",this).call(this,fC({itemType:"svg",name:"New SVG",elementType:"svg",overflow:"visible",stroke:"black","stroke-width":1,svgfilter:"",fill:"transparent","fill-rule":"","fill-opacity":"","stroke-linecap":"","stroke-linejoin":"","stroke-dashoffset":"","stroke-dasharray":" ","text-anchor":"start","motion-based":!1},t))}},{key:"toCloneObject",value:function(){var t=this.json;return fC(fC({},dC(gC(i.prototype),"toCloneObject",this).call(this)),{},{overflow:t.overflow,stroke:t.stroke,"stroke-width":t["stroke-width"],svgfilter:t.svgfilter,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"],"text-anchor":t["text-anchor"],"motion-based":t["motion-based"]})}},{key:"toDefaultCSS",value:function(){return fC(fC({},dC(gC(i.prototype),"toDefaultCSS",this).call(this)),this.toKeyListCSS("stroke-width","stroke-linecap","stroke-linejoin","stroke-dasharray","stroke-dashoffset","fill-opacity","fill-rule","text-anchor"))}},{key:"toSVGAttribute",value:function(){return fC(fC({},this.toDefaultSVGCSS()),this.toKeyListCSS("stroke-width","stroke-linecap","stroke-linejoin","stroke-dasharray","stroke-dashoffset","fill-opacity","fill-rule","text-anchor"))}},{key:"toLayoutCSS",value:function(){return{}}},{key:"getDefaultTitle",value:function(){return"SVG"}},{key:"updateDefString",value:function(t){var e=t.$("defs");if(e)e.html(this.toDefInnerString);else{var n=this.toDefString.trim();t.prepend(dn.createByHTML(n))}}},{key:"toExportSVGCode",value:function(){return"\n ".concat(this.toFillSVG,"\n ").concat(this.toStrokeSVG,"\n ")}},{key:"toDefInnerString",get:function(){return"\n ".concat(this.toFillSVG,"\n ").concat(this.toStrokeSVG,"\n ")}},{key:"toDefString",get:function(){var t=this.toDefInnerString.trim();return"\n \n ".concat(t,"\n \n ")}},{key:"fillId",get:function(){return this.getInnerId("fill")}},{key:"strokeId",get:function(){return this.getInnerId("stroke")}},{key:"toFillSVG",get:function(){return uC.parseImage(this.json.fill||"transparent").toSVGString(this.fillId)}},{key:"toStrokeSVG",get:function(){return uC.parseImage(this.json.stroke||"black").toSVGString(this.strokeId)}},{key:"toFillValue",get:function(){return uC.parseImage(this.json.fill||"transparent").toFillValue(this.fillId)}},{key:"toFillOpacityValue",get:function(){return Ye.parse(this.json.fill||"transparent").a}},{key:"toStrokeValue",get:function(){return uC.parseImage(this.json.stroke||"black").toFillValue(this.strokeId)}},{key:"toFilterValue",get:function(){return this.json.svgfilter?"url(#".concat(this.json.svgfilter,")"):""}}])&&hC(e.prototype,n),r&&hC(e,r),i}(cm);function OC(t){return function(t){if(Array.isArray(t))return kC(t)}(t)||function(t){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(t))return Array.from(t)}(t)||function(t,e){if(!t)return;if("string"==typeof t)return kC(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);"Object"===n&&t.constructor&&(n=t.constructor.name);if("Map"===n||"Set"===n)return Array.from(t);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return kC(t,e)}(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function kC(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n0&&void 0!==arguments[0]?arguments[0]:{};return zC(XC(i.prototype),"getDefaultObject",this).call(this,VC({itemType:"svg-path",name:"New Path","stroke-width":5,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 Ya(t.d),t.segments&&this.json.path.resetSegment(t.segments)}},{key:"setCache",value:function(){this.rect=this.clone(),this.cachePath=this.json.path.clone()}},{key:"recover",value:function(){var t=this.rect.width.value;0===t&&(t=1);var e=this.rect.height.value;0===e&&(e=1);var n=this.json.width.value/t,r=this.json.height.value/e;this.scale(n,r)}},{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=zC(XC(i.prototype),"convert",this).call(this,t)).d&&(t.path=new Ya(t.d)),t}},{key:"toCloneObject",value:function(){var t=this.json;return VC(VC({},zC(XC(i.prototype),"toCloneObject",this).call(this)),{},{totalLength:t.totalLength,d:t.d,segments:N(this.json.segments)})}},{key:"getDefaultTitle",value:function(){return"Path"}},{key:"toAnimationKeyframes",value:function(t){var e=t.filter((function(t){return CC(t.property)&&TC(t.property)})),n=t.filter((function(t){return DC(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=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],n=arguments.length>2&&void 0!==arguments[2]&&arguments[2],r=t.$("path");r.attr("d",this.json.d),e&&(r.setAttr({filter:this.toFilterValue,fill:this.toFillValue,stroke:this.toStrokeValue}),this.updateDefString(t)),n&&(this.json.totalLength=r.totalLength)}},{key:"toSVG",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return'\n \n ').concat(this.toDefString,"\n \n \n ")}},{key:"html",get:function(){var t=this.json.id,e={"motion-based":this.json["motion-based"]};return"\n \n ').concat(this.toDefString,"\n \n ")}},{key:"svg",get:function(){var t=this.json.x.value,e=this.json.y.value;return this.toSVG(t,e)}}])&&BC(e.prototype,n),r&&BC(e,r),i}(wC);function NC(t){return(NC="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 KC(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(t)))return;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(t,e){if(!t)return;if("string"==typeof t)return UC(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);"Object"===n&&t.constructor&&(n=t.constructor.name);if("Map"===n||"Set"===n)return Array.from(t);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return UC(t,e)}(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function UC(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n0&&void 0!==arguments[0]?arguments[0]:"50% 50%",e="50% 50%",n="";if((t=t||"50%").includes("at")){var r=t.split("at").map((function(t){return t.trim()})),o=KC(r,2);e=o[0],n=o[1]}else n=t.trim();var i=n.split(" "),a=KC(i,2),c=a[0],u=a[1];M(u)&&(u=c),c=ln.parse(c),u=ln.parse(u);var s=e.split(" "),l=KC(s,2),f=l[0],p=l[1];return M(p)&&(p=f),{radiusX:f=ln.parse(f),radiusY:p=ln.parse(p),x:c,y:u}}},{key:"parseStyleForInset",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",e=t.split("round"),n=KC(e,2),r=n[0],o=n[1],i=yb.parse(r),a=KC(i,5),c=a[0],u=a[1],s=a[2],l=a[3],f=a[4];if(o)var p=yb.parse(o),y=KC(p,5),h=y[0],d=y[1],v=y[2],b=y[3],m=y[4];return{isAll:1===c,top:u,right:s,bottom:l,left:f,round:o,isAllRadius:1===h,topRadius:d,rightRadius:v,bottomRadius:b,leftRadius:m}}},{key:"parseStyleForPolygon",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";return t.split(",").filter((function(t){return t.trim()})).map((function(t){var e=KC(t.trim().split(" "),2),n=e[0],r=e[1];return{x:ln.parse(n),y:ln.parse(r)}}))}}],(n=[{key:"getDefaultObject",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return tT(oT(i.prototype),"getDefaultObject",this).call(this,ZC({itemType:"shape",type:"none",value:""},t))}},{key:"toCloneObject",value:function(){return ZC(ZC({},tT(oT(i.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()}}}])&&QC(e.prototype,n),r&&QC(e,r),i}(ui);function cT(t){return(cT="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 uT(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function sT(t){for(var e=1;e0&&void 0!==arguments[0]?arguments[0]:{};return yT(bT(i.prototype),"getDefaultObject",this).call(this,sT({itemType:"svg-text",name:"New Text",totalLength:0,fill:"rgba(0, 0, 0, 1)",text:"Insert a text","font-weight":ln.number(100),textLength:ln.em(0),lengthAdjust:"spacingAndGlyphs","shape-inside":"","shape-subtract":"","shape-margin":"","shape-padding":""},t))}},{key:"enableHasChildren",value:function(){return!1}},{key:"toShapeInsideCSS",value:function(){var t=this.json["shape-inside"];switch(aT.parseStyle(t).type){case"path":case"svg":t="url(#".concat(this.shapeInsideId,")")}return{"shape-inside":t,"inline-size":this.json.width}}},{key:"updatePathItem",value:function(t){this.json.d=t.d,this.json.totalLength=t.totalLength,this.json.path=new Ya(t.d),t.segments&&this.json.path.resetSegment(t.segments)}},{key:"setCache",value:function(){this.rect=this.clone()}},{key:"convert",value:function(t){return(t=yT(bT(i.prototype),"convert",this).call(this,t)).textLength=ln.parse(t.textLength),t}},{key:"toCloneObject",value:function(){var t=this.json;return sT(sT({},yT(bT(i.prototype),"toCloneObject",this).call(this)),{},{totalLength:t.totalLength,text:t.text,textLength:"".concat(t.textLength),lengthAdjust:t.lengthAdjust,"shape-inside":t["shape-inside"]})}},{key:"getDefaultTitle",value:function(){return"Text"}},{key:"toAnimationKeyframes",value:function(t){var e=t.filter((function(t){return CC(t.property)})),n=t.filter((function(t){return DC(t.property)}));return[{selector:'[data-id="'.concat(this.json.id,'"]'),properties:n},{selector:'[data-id="'.concat(this.json.id,'"] text'),properties:e}]}},{key:"updateFunction",value:function(t){var e=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];if(e){var n=t.$("text");n.text(this.json.text),n.setAttr({filter:this.toFilterValue,fill:this.toFillValue,stroke:this.toStrokeValue,y:this.json["font-size"]||"13px",textLength:this.json.textLength,lengthAdjust:this.json.lengthAdjust}),this.updateDefString(t)}}},{key:"toNestedCSS",value:function(){return[{selector:"> text",css:sT({},this.toShapeInsideCSS())}]}},{key:"toSVGCSS",value:function(){return sT(sT({},yT(bT(i.prototype),"toSVGCSS",this).call(this)),this.toShapeInsideCSS())}},{key:"toSVG",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=this.json,r=n.textLength,o=n.lengthAdjust;return'\n \n ').concat(this.toDefString,"\n ").concat(this.json.text,"\n ")}},{key:"toShapeInside",get:function(){var t=aT.parseStyle(this.json["shape-inside"]),e=t.value;switch(t.type){case"path":return'')}return""}},{key:"toDefInnerString",get:function(){return"\n ".concat(this.toFillSVG,"\n ").concat(this.toStrokeSVG,"\n ").concat(this.toShapeInside,"\n ")}},{key:"shapeInsideId",get:function(){return this.getInnerId("shape-inside")}},{key:"html",get:function(){var t=this.json,e=t.id,n=t.textLength,r=t.lengthAdjust;return"\n \n ').concat(this.toDefString,"\n ").concat(this.json.text,"\n ")}},{key:"svg",get:function(){var t=this.json.x.value,e=this.json.y.value;return this.toSVG(t,e)}}])&&pT(e.prototype,n),r&&pT(e,r),i}(wC);function gT(t){return(gT="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 wT(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function OT(t){for(var e=1;e0&&void 0!==arguments[0]?arguments[0]:{};return PT(ET(i.prototype),"getDefaultObject",this).call(this,OT({itemType:"svg-textpath",name:"New TextPath",d:"",totalLength:0,fill:"rgba(0, 0, 0, 1)",text:"Insert a text",textLength:ln.em(0),lengthAdjust:"spacingAndGlyphs",startOffset:ln.em(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 Ya(t.d),t.segments&&this.json.path.resetSegment(t.segments)}},{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=PT(ET(i.prototype),"convert",this).call(this,t)).path=new Ya(t.d),t.textLength=ln.parse(t.textLength),t.startOffset=ln.parse(t.startOffset),t}},{key:"toCloneObject",value:function(){var t=this.json;return OT(OT({},PT(ET(i.prototype),"toCloneObject",this).call(this)),{},{totalLength:t.totalLength,d:t.d,text:t.text,textLength:"".concat(t.textLength),lengthAdjust:t.lengthAdjust,startOffset:"".concat(t.startOffset)})}},{key:"getDefaultTitle",value:function(){return"TextPath"}},{key:"toAnimationKeyframes",value:function(t){var e=t.filter((function(t){return CC(t.property)})),n=t.filter((function(t){return TC(t.property)})),r=t.filter((function(t){return DC(t.property)}));return[{selector:'[data-id="'.concat(this.json.id,'"]'),properties:r},{selector:'[data-id="'.concat(this.json.id,'"] textPath'),properties:e},{selector:'[data-id="'.concat(this.json.id,'"] path'),properties:n}]}},{key:"updateFunction",value:function(t){var e=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],n=t.$("path");if(n.attr("d",this.json.d),e){var r=t.$("textPath");r.text(this.json.text),r.setAttr({filter:this.toFilterValue,fill:this.toFillValue,stroke:this.toStrokeValue,textLength:this.json.textLength,lengthAdjust:this.json.lengthAdjust,startOffset:this.json.startOffset}),this.updateDefString(t)}this.json.totalLength=n.totalLength}},{key:"toSVG",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=this.json,r=n.textLength,o=n.lengthAdjust,i=n.startOffset;return'\n \n ').concat(this.toDefString,"\n \n ").concat(this.json.text,"\n \n ")}},{key:"toDefInnerString",get:function(){return"\n ".concat(this.toPathSVG,"\n ").concat(this.toFillSVG,"\n ").concat(this.toStrokeSVG,"\n ")}},{key:"toPathId",get:function(){return this.getInnerId("path")}},{key:"toPathSVG",get:function(){return"\n \n ")}},{key:"html",get:function(){var t=this.json,e=t.id,n=t.textLength,r=t.lengthAdjust,o=t.startOffset;return"\n \n ').concat(this.toDefString,"\n \n ").concat(this.json.text,"\n \n ")}},{key:"svg",get:function(){var t=this.json.x.value,e=this.json.y.value;return this.toSVG(t,e)}}])&&jT(e.prototype,n),r&&jT(e,r),i}(wC);function CT(t){return(CT="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 TT(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function DT(t){for(var e=1;e0&&void 0!==arguments[0]?arguments[0]:{};return MT(FT(i.prototype),"getDefaultObject",this).call(this,DT({itemType:"text",name:"New Text",elementType:"p",content:""},t))}},{key:"enableHasChildren",value:function(){return!1}},{key:"getDefaultTitle",value:function(){return"Text"}},{key:"toCloneObject",value:function(){return DT(DT({},MT(FT(i.prototype),"toCloneObject",this).call(this)),{},{content:this.json.content})}},{key:"updateFunction",value:function(t){var e=this.json.content;t.updateDiff(e)}},{key:"toCSS",value:function(){var t=MT(FT(i.prototype),"toCSS",this).call(this);return t.margin=t.margin||"0px",t}},{key:"toNestedCSS",value:function(){return[{selector:"> *",cssText:"\n pointer-events: none;\n "}]}},{key:"toSVG",value:function(t,e){var n=this.json,r=n.width,o=n.height,i=n.content,a=this.toCSS();return delete a.left,delete a.top,"absolute"===a.position&&delete a.position,'\n \n ').concat(this.toDefString,"\n \n
\n

').concat(i,"

\n
\n
\n
\n")}},{key:"html",get:function(){var t=this.json,e=t.id,n=t.itemType,r=t.content;return"

').concat(r,"

")}},{key:"svg",get:function(){var t=this.json.x.value,e=this.json.y.value;return this.toSVG(t,e)}}])&&VT(e.prototype,n),r&&VT(e,r),i}(cm);function HT(t){return(HT="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 XT(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function YT(t){for(var e=1;e0&&void 0!==arguments[0]?arguments[0]:{};return WT(QT(i.prototype),"getDefaultObject",this).call(this,YT({itemType:"rect",name:"New Rect"},t))}},{key:"getDefaultTitle",value:function(){return"Rect"}}])&&UT(e.prototype,n),r&&UT(e,r),i}(cm);function eD(t){return(eD="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 nD(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function rD(t){for(var e=1;e0&&void 0!==arguments[0]?arguments[0]:{};return cD(fD(i.prototype),"getDefaultObject",this).call(this,rD({itemType:"circle",name:"New Circle","border-radius":"100%"},t))}},{key:"getDefaultTitle",value:function(){return"Circle"}}])&&aD(e.prototype,n),r&&aD(e,r),i}(cm);function yD(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function hD(t){for(var e=1;e1&&(t-=1);var n=o[0];if(0===t)n=o[0];else if(1===t)n=o[o.length-1];else{var r=o.find((function(e){return e.startT<=t&&t0&&void 0!==arguments[0]?arguments[0]:{};return SD(RD(i.prototype),"getDefaultObject",this).call(this,gD({itemType:"svg-brush",name:"New Brush",d:"",segments:[],totalLength:0,distance: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 Ya(t.d),t.segments&&this.json.path.resetSegment(t.segments),t.rect&&(this.json.width=ln.px(t.rect.width),this.json.height=ln.px(t.rect.height),this.setScreenX(ln.px(t.rect.x)),this.setScreenY(ln.px(t.rect.y)))}},{key:"setCache",value:function(){this.rect=this.clone(),this.cachePath=this.json.path.clone()}},{key:"recover",value:function(){var t=this.rect.width.value;0===t&&(t=1);var e=this.rect.height.value;0===e&&(e=1);var n=this.json.width.value/t,r=this.json.height.value/e;this.scale(n,r)}},{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=SD(RD(i.prototype),"convert",this).call(this,t)).d&&(t.path=new Ya(t.d)),t}},{key:"toCloneObject",value:function(){var t=this.json;return gD(gD({},SD(RD(i.prototype),"toCloneObject",this).call(this)),{},{totalLength:t.totalLength,d:t.d,segments:N(this.json.segments)})}},{key:"getDefaultTitle",value:function(){return"Brush"}},{key:"toAnimationKeyframes",value:function(t){var e=t.filter((function(t){return CC(t.property)&&TC(t.property)})),n=t.filter((function(t){return DC(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=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],n=arguments.length>2&&void 0!==arguments[2]&&arguments[2],r=t.$("path.svg-brush-item");if(r.attr("d",this.json.d),e){this.updateDefString(t);var o=t.$(".svg-brush-items");o.attr("filter",this.toFilterValue),o.attr("fill",this.toFillValue),o.attr("fill-opacity",this.toFillOpacityValue),o.updateSVGDiff(this.makeBrushItem(this.json["stroke-width"]))}n&&(this.json.totalLength=r.totalLength)}},{key:"makeBrushShape",value:function(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1;return"\n \n ")}},{key:"makeBrushItem",value:function(){var t=this,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1;return this.makeBrushItemRate().map((function(n){return t.makeBrushShape(n.x,n.y,e*n.scale,n.t)})).join("")}},{key:"makeBrushItemRate",value:function(){var t=this.json,e=t.d,n=t.totalLength,r=t.distance;return function(t){for(var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:100,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,r=vD(t),o=r.totalLength,i=r.xy,a=o/e,c=n/o,u=a/o+c,s=[],l=1,f=0;fl)break;s.push(i(p))}return s}(new Ya(e),n,r).map((function(t){var e=t.t>.5?1-t.t:t.t;return gD(gD({},t),{},{scale:e/.4*1.3})}))}},{key:"toSVG",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return'\n \n ').concat(this.toDefString,"\n \n \n ")}},{key:"toDefInnerString",get:function(){return"\n ".concat(SD(RD(i.prototype),"toDefInnerString",this),"\n ")}},{key:"brushId",get:function(){return this.getInnerId("brush")}},{key:"html",get:function(){var t=this.json,e=t.id,n=t.d,r=this.makeBrushItem(this.json["stroke-width"]);return"\n \n ').concat(this.toDefString,"\n \n \n ').concat(r,"\n \n ")}},{key:"svg",get:function(){var t=this.json.x.value,e=this.json.y.value;return this.toSVG(t,e)}}])&&kD(e.prototype,n),r&&kD(e,r),i}(wC);function ED(t){return(ED="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 _D(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function CD(t){for(var e=1;e0&&void 0!==arguments[0]?arguments[0]:{};return ID(BD(i.prototype),"getDefaultObject",this).call(this,CD({itemType:"video",name:"New Video",elementType:"video",src:"",srcType:"video/mp4",controls:!1,preload:"auto",poster:"",autoplay:!1,buffered:!1,crossorigin:"anonymous",loop:!1,muted:!1,played:!1,currentTime:0,playbackRate:1,playTime:"0:1:1"},t))}},{key:"enableHasChildren",value:function(){return!1}},{key:"getDefaultTitle",value:function(){return"Video"}},{key:"getIcon",value:function(){return Wb.video}},{key:"toCloneObject",value:function(){return CD(CD({},ID(BD(i.prototype),"toCloneObject",this).call(this)),{},{src:this.json.src+""})}},{key:"resize",value:function(){this.reset({width:this.json.naturalWidth.clone(),height:this.json.naturalHeight.clone()})}},{key:"updateDiff",value:function(t,e){t.el[e]!=this.json[e]&&(t.el[e]=this.json[e])}},{key:"updateFunction",value:function(t){var e=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],n=arguments.length>2&&void 0!==arguments[2]&&arguments[2],r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:null,o=arguments.length>4&&void 0!==arguments[4]&&arguments[4],a=this.json;if(a.src,a.currentTime,a.playbackRate,e){var c=t.$("video");c&&(o||(this.updateDiff(c,"currentTime"),this.updateDiff(c,"playbackRate"),this.updateDiff(c,"volume")))}ID(BD(i.prototype),"updateFunction",this).call(this,t,e,n,r)}},{key:"toNestedCSS",value:function(){return[{selector:"video",cssText:"\n width: 100%;\n height: 100%;\n pointer-events: none;\n ".trim()}]}},{key:"toSVG",value:function(t,e){var n=arguments.length>2&&void 0!==arguments[2]&&arguments[2],r=this.json,o=r.width,i=r.height,a=r.src,c=r.srcType,u=this.toCSS();return n?(delete u.left,delete u.top,"absolute"===u.position&&delete u.position,this.wrapperRootSVG(t,e,o,i,'\n \n "))):"\n ".concat(this.toDefString,' \n \n ")}},{key:"html",get:function(){var t=this.json,e=t.id,n=t.itemType,r=t.src,o=t.controls,i=t.muted,a=t.poster,c=t.loop,u=t.crossorigin,s=t.autoplay;return"\n
\n ').concat(this.toDefString,"\n \n
")}},{key:"svg",get:function(){var t=this.json.x.value,e=this.json.y.value;return this.toSVG(t,e)}}])&&AD(e.prototype,n),r&&AD(e,r),i}(cm);ua.registerComponent("video",zD);var FD,GD,HD,XD,YD,ND,KD={Project:lP,ArtBoard:PE,Layer:cm,RectLayer:tD,CircleLayer:pD,ImageLayer:ME,TextLayer:GT,VideoLayer:zD,SVGPathItem:YC,SVGBrushItem:$D,SVGTextItem:mT,SVGTextPathItem:_T,Component:gP,CubeLayer:MP,CylinderLayer:nx};function UD(t,e){for(var n=0;nt.length)&&(e=t.length);for(var n=0,r=new Array(e);n1&&void 0!==arguments[1]?arguments[1]:1;return ln.px(t).round(e)},uA=function(){function t(e){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.$editor=e}var e,n,r;return e=t,(n=[{key:"makeGuideCache",value:function(){var t=this,e=this.$selection.currentArtboard;return this.cachedExtraItems=[],e&&(this.$selection.isArtBoard()?this.cachedExtraItems=[]:this.cachedExtraItems=e.allLayers.filter((function(e){return!t.$selection.check(e)||e.is("artboard")&&t.$selection.currentArtboard!=e})),this.rect=this.$selection.allRect?this.$selection.allRect.clone():null),this.cachedPosition={},this.$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=this.$selection.allRect;this.pointerType=t,"move"===t?this.rect.move(cA(r.x.value+e),cA(r.y.value+n)):(rA.isRight(t)?this.rect.resizeWidth(cA(r.width.value+e)):rA.isLeft(t)&&r.width.value-e>=0&&(this.rect.moveX(cA(r.x.value+e)),this.rect.resizeWidth(cA(r.width.value-e))),rA.isBottom(t)?this.rect.resizeHeight(cA(r.height.value+n)):rA.isTop(t)&&r.height.value-n>=0&&(this.rect.moveY(cA(r.y.value+n)),this.rect.resizeHeight(cA(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,y=f*r,h=l-s,d=h*i,v=h*a;this.setX(t,c,u,p,y),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=this.$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=this.$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]:2,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:o,bx:o})}))})),i.length){var a=rA.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]:2,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:o,by:o})}))})),i.length){var a=rA.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]:2,r=this.compareX(t,e,n),o=this.compareY(t,e,n);return{x:r,y:o}}},{key:"getLayers",value:function(){var t=this,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:2,n=this.cachedExtraItems,r=[],o=[];return n.forEach((function(n){var i=t.compare(t.rect,n,e);r.push.apply(r,oA(i.x)),o.push.apply(o,oA(i.y))})),[r[0],o[0]].filter((function(t){return L(t)}))}},{key:"calculate",value:function(){var t=this,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:2,n=this.getLayers(e);return rA.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(L(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(L(t.ax)){var e=Math.round(this.rect.width.value/2*t.source),n=t.bx-e;this.rect.x.set(n)}else if(L(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;rA.isMove(this.pointerType)?this.$selection.each((function(e){t.$selection.isInParent(e,t.$selection.items)||(t.recover(e),e.recover())})):this.$selection.each((function(e){t.recover(e),e.recover()}))}},{key:"$selection",get:function(){return this.$editor.selection}}])&&aA(e.prototype,n),r&&aA(e,r),t}();function sA(t){return(sA="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 lA(t,e,n){return(lA="undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function(t,e,n){var r=function(t,e){for(;!Object.prototype.hasOwnProperty.call(t,e)&&null!==(t=wA(t)););return t}(t,e);if(r){var o=Object.getOwnPropertyDescriptor(r,e);return o.get?o.get.call(n):o.value}})(t,e,n||t)}function fA(t){return function(t){if(Array.isArray(t))return pA(t)}(t)||function(t){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(t))return Array.from(t)}(t)||function(t,e){if(!t)return;if("string"==typeof t)return pA(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);"Object"===n&&t.constructor&&(n=t.constructor.name);if("Map"===n||"Set"===n)return Array.from(t);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return pA(t,e)}(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function pA(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n\n
\n
\n ".concat(Wb.flag,"\n \n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n ")}},{key:jn('$selectionTool .selection-tool-item[data-position="path"]'),value:function(t){this.trigger("openPathEditor")}},{key:"toggleEditingPath",value:function(t){this.refs.$selectionTool.toggleClass("editing-path",t)}},{key:"checkEditMode",value:function(){return this.$editor.isSelectionMode()}},{key:Gn("$selectionView .selection-tool-item")+Zn("checkEditMode")+or()+ir(),value:function(t){var e;this.initMoveType(t.$dt),(e=this.parent).selectCurrent.apply(e,fA(this.$selection.items)),this.$selection.setRectCache("move"!==this.pointerType),this.initSelectionTool()}},{key:"initMoveType",value:function(t){this.$target=t||this.refs.$selectionTool.$('.selection-tool-item[data-position="move"]'),this.$target&&(this.pointerType=this.$target.attr("data-position"),this.refs.$selectionTool.attr("data-selected-position",this.pointerType),this.refs.$selectionTool.attr("data-selected-movetype",OA[this.pointerType]))}},{key:"move",value:function(t,e){this.$config.get("bodyEvent").altKey&&(e=t),this.refreshSelectionToolView(t,e),this.parent.updateRealPosition(),this.emit("refreshSelectionDragStyleView",null,!0)}},{key:Do("moveByKey"),value:function(t,e){var n;if(0!==t||0!==e){this.pointerType="move",this.$selection.move(t,e),(n=this.parent).selectCurrent.apply(n,fA(this.$selection.items)),this.refs.$selectionTool.attr("data-selected-position",""),this.refs.$selectionTool.attr("data-selected-movetype",""),this.guideView.move(this.pointerType,t,e);var r=this.guideView.calculate();this.emit("refreshGuideLine",this.calculateWorldPositionForGuideLine(r)),this.makeSelectionTool()}}},{key:"end",value:function(){this.refs.$selectionTool.attr("data-selected-position",""),this.refs.$selectionTool.attr("data-selected-movetype",""),this.$selection.setRectCache(),this.emit("refreshAllElementBoundSize"),this.emit("removeGuideLine")}},{key:"refreshSelectionToolView",value:function(t,e,n){if(0===t&&0===e);else{this.guideView.move(n||this.pointerType,t/this.$editor.scale,e/this.$editor.scale);var r=this.guideView.calculate();this.emit("refreshGuideLine",this.calculateWorldPositionForGuideLine(r))}this.makeSelectionTool()}},{key:"getOriginalRect",value:function(){return this.originalRect||(this.originalRect=this.parent.$el.rect()),this.originalRect}},{key:"getOriginalArtboardRect",value:function(){return this.originalArtboardRect||(this.originalArtboardRect=this.parent.refs.$view.rect()),this.originalArtboardRect}},{key:"removeOriginalRect",value:function(){this.originalArtboardRect=null,this.originalRect=null}},{key:"initSelectionTool",value:function(){this.removeOriginalRect(),this.guideView.makeGuideCache();var t=this.$selection.current;if(t){var e=t.is("svg-path","svg-brush","svg-textpath");this.refs.$selectionTool.toggleClass("path",e)}this.$editor.isSelectionMode()&&this.$el.isHide()&&this.$el.show(),this.bindData("$selectionTool"),this.makeSelectionTool()}},{key:"makeSelectionTool",value:function(){this.guideView.recoverAll();var t=ln.px(0),e=ln.px(0),n=ln.px(0),r=ln.px(0);if(this.guideView.rect){var o=this.calculateWorldPosition(this.guideView.rect);t=o.x,e=o.y,n=o.width,r=o.height}t.is(0)&&e.is(0)&&n.is(0)&&r.is(0)?(t.add(-1e4),e.add(-1e4)):this.$selection.currentArtboard||(t.add(-1e4),e.add(-1e4));var i=t,a=e;this.refs.$selectionTool.css({left:i,top:a,width:n,height:r}),this.refreshPositionText(t,e,n,r)}},{key:"refreshPositionText",value:function(t,e,n,r){if(this.$selection.currentArtboard){var o=ln.px(t.value-this.$selection.currentArtboard.x.value/this.$editor.scale).round(1),i=ln.px(e.value-this.$selection.currentArtboard.y.value/this.$editor.scale).round(1),a=ln.px(n.value/this.$editor.scale).round(1),c=ln.px(r.value/this.$editor.scale).round(1),u="";switch(this.pointerType){case"move":u="X: ".concat(o,", Y: ").concat(i);break;case"to top":case"to bottom":u="Y: ".concat(i,", H: ").concat(c);break;case"to left":case"to right":u="X: ".concat(o,", W: ").concat(a);break;case"to top right":case"to top left":u="X: ".concat(o,", Y: ").concat(i,", W: ").concat(a,", H: ").concat(c);break;case"to bottom right":u="W: ".concat(a,", H: ").concat(c);break;case"to bottom left":u="X: ".concat(o,", Y: ").concat(i,", W: ").concat(a,", H: ").concat(c)}this.setPositionText(u);var s=this.$selection.length,l="";if(1===s){var f=this.$selection.current;l=f.title||f.getDefaultTitle();var p=Wb[kA[f.itemType]||kA.rect];this.refs.$selectionIcon.html(p)}else s>=2&&(l="multi : ".concat(s),this.refs.$selectionIcon.html(Wb.flag));this.refs.$selectionTitle.text(l),this.refs.$selectionMove.attr("title",l)}}},{key:"setPositionText",value:function(t){this.$target&&(this.$selection.current&&this.$selection.current.is("artboard")&&(t=t.split(",").filter((function(t){return!t.includes("X:")&&!t.includes("Y:")})).join(",")),this.$target.attr("data-position-text",t))}},{key:"calculateWorldPositionForGuideLine",value:function(){var t=this,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];return e.map((function(e){var n,r,o,i,a=new Ji(t.calculateWorldPosition(e.A)),c=new Ji(t.calculateWorldPosition(e.B));return L(e.ax)&&(n=e.ax*t.$editor.scale),L(e.bx)&&(r=e.bx*t.$editor.scale),L(e.ay)&&(o=e.ay*t.$editor.scale),L(e.by)&&(i=e.by*t.$editor.scale),{A:a,B:c,ax:n,bx:r,ay:o,by:i}}))}},{key:"calculateWorldPosition",value:function(t){return{x:ln.px(t.screenX.value*this.$editor.scale),y:ln.px(t.screenY.value*this.$editor.scale),width:ln.px(t.width.value*this.$editor.scale),height:ln.px(t.height.value*this.$editor.scale),transform:t.transform}}}]),n}(function(t){vA(n,t);var e=mA(n);function n(){return yA(this,n),e.apply(this,arguments)}return dA(n,[{key:pr("$selectionTool"),value:function(){var t=this.$selection.current;return{"data-is-layout-item":t&&t.isLayoutItem(),"data-is-layout-container":t&&t.hasLayout(),"data-layout-container":t&&(t.layout||t.parent.layout),"data-selection-length":this.$selection.length}}}]),n}(function(t){vA(n,t);var e=mA(n);function n(){return yA(this,n),e.apply(this,arguments)}return dA(n,[{key:Do("hideSelectionToolView"),value:function(){this.refs.$selectionTool.css({left:"-10000px",top:"-10000px"})}},{key:Do("hideSubEditor"),value:function(t){this.toggleEditingPath(!1)}},{key:Do("openPathEditor"),value:function(){var t=this.$selection.current;t&&t.is("svg-path","svg-brush","svg-textpath")&&(this.toggleEditingPath(!0),this.emit("showPathEditor","modify",{changeEvent:"updatePathItem",current:t,d:t.d,box:"box",screenX:t.screenX,screenY:t.screenY,screenWidth:t.screenWidth,screenHeight:t.screenHeight}))}},{key:Do("finishPathEdit"),value:function(){this.toggleEditingPath(!1)}},{key:Do("updatePathItem"),value:function(t){var e,n=this.$selection.current;n&&(n.updatePathItem&&(n.updatePathItem(t),(e=this.parent).selectCurrent.apply(e,fA(this.$selection.items)),this.$selection.setRectCache(),this.emit("refreshSelectionStyleView",n,!0,!0)))}},{key:Do("refreshSelectionTool"),value:function(){this.initSelectionTool()}},{key:Do("makeSelectionTool"),value:function(t){t&&this.removeOriginalRect();var e=this.guideView.calculate();this.makeSelectionTool(),0===this.$selection.length&&(e=[]),this.emit("refreshGuideLine",this.calculateWorldPositionForGuideLine(e))}}]),n}(Ao)));function jA(t){return(jA="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 PA(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function xA(t,e){for(var n=0;n2&&void 0!==arguments[2]?arguments[2]:"",r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"base-line";return'").concat(n,"")},TA=function(t,e,n,r){var o=arguments.length>4&&void 0!==arguments[4]?arguments[4]:"base-line";return"")},DA=function(t,e){(function(t,e){return t.includes(e)})(t,e)||t.push(e)},AA=function(t,e,n,r){if(0!==Math.abs(n-r)){e=Math.floor(e),DA(t,TA(e-2,n,e+2,n)),DA(t,TA(e,n,e,r)),DA(t,TA(e-2,r,e+2,r));var o=(r+n)/2,i=Math.floor(Math.abs(r-n));DA(t,CA(e+2,o,i))}},IA=function(t,e,n,r){if(0!==Math.abs(n-r)){e=Math.floor(e),DA(t,TA(n,e-2,n,e+2)),DA(t,TA(n,e,r,e)),DA(t,TA(r,e-2,r,e+2));var o=(r+n)/2,i=Math.floor(Math.abs(r-n));DA(t,CA(o,e-2,i,"text-center"))}},VA=function(t){!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&&RA(t,e)}(i,t);var e,n,r,o=$A(i);function i(){return PA(this,i),o.apply(this,arguments)}return e=i,(n=[{key:"template",value:function(){return''}},{key:"initState",value:function(){return{list:[]}}},{key:pr("$el"),value:function(){return{html:this.createGuideLine(this.state.list)}}},{key:"createGuideLine",value:function(t){var e=[];return(t=t.filter((function(t,e){return 0===e}))).forEach((function(t){var n=t.B;if(L(t.ax)){var r=ln.min(n.screenY,t.A.screenY),o=ln.max(n.screenY2,t.A.screenY2),i=t.bx;if(t.A.screenY.value>t.B.screenY2.value?AA(e,i,t.B.screenY2.value,t.A.screenY.value):AA(e,i,r.value,t.A.screenY.value),t.A.screenX.value-n.screenX.value>0&&t.A.screenY.value<=n.screenY2.value&&t.A.screenY.value>=n.screenY.value){var a=(t.A.screenY.value+t.A.screenY2.value)/2;IA(e,a,n.screenX.value,t.A.screenX.value)}n.screenX2.value-t.A.screenX2.value>0&&t.A.screenY.value<=t.B.screenY2.value&&t.A.screenY.value>=t.B.screenY.value&&(a=(t.A.screenY.value+t.A.screenY2.value)/2,IA(e,a,t.A.screenX2.value,n.screenX2.value)),t.A.screenY2.valuet.B.screenX2.value?IA(e,u,t.B.screenX2.value,t.A.screenX.value):IA(e,u,t.A.screenX.value,t.B.screenX.value),t.A.screenY.value-n.screenY.value>0&&t.A.screenX.value<=t.B.screenX2.value&&t.A.screenX.value>=t.B.screenX.value){var s=(t.A.screenX.value+t.A.screenX2.value)/2;AA(e,s,t.B.screenY.value,t.A.screenY.value)}n.screenY2.value-t.A.screenY2.value>0&&t.A.screenX.value<=t.B.screenX2.value&&t.A.screenX.value>=t.B.screenX.value&&(s=(t.A.screenX.value+t.A.screenX2.value)/2,AA(e,s,t.A.screenY2.value,t.B.screenY2.value)),t.A.screenX2.value4&&void 0!==arguments[4]&&arguments[4];return this.segmentList.push(LA(LA({},t),{},{cx:e.x,cy:e.y,selected:o,index:n,segment:r,isFirst:e.isFirst,isLast:e.isLast,isSecond:e.isSecond})),this}},{key:"addStartPoint",value:function(t,e){return this.segmentList.push(LA(LA({},t),{},{cx:e.x,cy:e.y,start:!0})),this}},{key:"addCurvePoint",value:function(t,e,n){var r=arguments.length>3&&void 0!==arguments[3]&&arguments[3];return this.segmentList.push({curve:!0,cx:t.x,cy:t.y,index:e,selected:r,segment:n,isFirst:t.isFirst,isLast:t.isLast,isSecond:t.isSecond}),this}},{key:"addText",value:function(t,e){return this.segmentList.push({type:"text",cx:t.x,cy:t.y,text:e+""}),this}},{key:"toString",value:function(){return this.segmentList.sort((function(t,e){return t.line&&!e.line?-1:!t.line&&e.line?1:0})),this.segmentList.map((function(t){return t.angle?"\n '):t.line?'\n "):t.text?'\n ').concat(t.text,"\n "):t.curve?"\n '):t.start?"\n '):"\n ')})).join("")}}])&&zA(e.prototype,n),r&&zA(e,r),t}();function GA(t){return function(t){if(Array.isArray(t))return YA(t)}(t)||function(t){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(t))return Array.from(t)}(t)||XA(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function HA(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(t)))return;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)||XA(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function XA(t,e){if(t){if("string"==typeof t)return YA(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?YA(t,e):void 0}}function YA(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);ne.dist?-1:1}));var a=null;return i.length&&(r+=(a=i[0].point)[e]-n),{point:a,distanceValue:r}}function QA(t,e,n,r){var o=[],i=qA;return t.filter((function(t){return t})).forEach((function(t){i.filter((function(e){return t[e]})).forEach((function(i){var a=t[i],c=Math.abs(a[e]-n);c<=r&&o.push({dist:c,point:a})}))})),o.sort((function(t,e){return t.dist>e.dist?1:-1})),o.length?o[0].point:null}function tI(t,e,n){for(var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:1,o=[],i=0,a=t.length;i3&&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==0?0:(n.x-t)/r,i=n.y-e==0?0:(n.y-e)/r;return"".concat(o," ").concat(i)})).join(" ");return"".concat(o," ").concat(a)}}var nI=function(){function t(e){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.pathEditor=e,this.pathStringManager=new Qa,this.guideLineManager=new Qa,this.segmentManager=new FA,this.initialize(),this.initializeSelect()}return KA(t,null,[{key:"generatorPathString",value:function(t,e,n,r){return tI(t,e,n,r).d}}]),KA(t,[{key:"initialize",value:function(){this.splitLines=[],this.guideLineManager.reset(),this.segmentManager.reset(),this.pathStringManager.reset()}},{key:"initializeSelect",value:function(){this.selectedPointKeys={},this.selectedPointList=[]}},{key:"selectInBox",value:function(t){var e=[],n=["startPoint","endPoint","reversePoint"];this.state.points.forEach((function(r,o){n.forEach((function(n){var i=r[n];(function(t,e){return!(t.x2.valuee.x)&&!(t.y.value>e.y)))})(t,i)&&e.push({x:i.x,y:i.y,key:n,index:o})}))})),this.select.apply(this,e)}},{key:"select",value:function(){var t=this;this.selectedPointKeys={};for(var e=arguments.length,n=new Array(e),r=0;r1?r-1:0),i=1;i1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,r=this.transformRect,o=r.x,i=r.y,a=r.width,c=r.height,u=a/2,s=c/2;switch(t){case"flipX":this.applyTransform(lt.matrix2d.translate(-e,0),lt.matrix2d.flipX());break;case"flipY":this.applyTransform(lt.matrix2d.translate(0,-n),lt.matrix2d.flipY());break;case"flip":this.applyTransform(lt.matrix2d.translate(-e,-n),lt.matrix2d.flip());break;case"to move":this.applyTransform(lt.matrix2d.translate(e,n));break;case"to rotate":var l=Ot({x:o+u,y:i},{x:o+u,y:i+s},{dx:e,dy:n});this.applyTransform(lt.matrix2d.translate(-u,-s),lt.matrix2d.rotate(pt(-l)),lt.matrix2d.translate(u,s));break;case"to skewX":l=wt({x:u,y:s},{x:u+e,y:s});this.applyTransform(lt.matrix2d.skewX(pt(l)));break;case"to skewY":l=wt({x:u,y:s},{x:u,y:s+n});this.applyTransform(lt.matrix2d.skewY(pt(l)));break;case"to bottom right":var f=yt(a+e,a),p=yt(c+n,c);this.applyTransform(lt.matrix2d.scale(f,p));break;case"to right":f=yt(a+e,a);this.applyTransform(lt.matrix2d.scale(f,1));break;case"to bottom":p=yt(c+n,c);this.applyTransform(lt.matrix2d.scale(1,p));break;case"to top right":f=yt(a+e,a),p=yt(c-n,c);this.applyTransform(lt.matrix2d.scale(f,p),lt.matrix2d.translate(0,n));break;case"to top left":f=yt(a-e,a),p=yt(c-n,c);this.applyTransform(lt.matrix2d.scale(f,p),lt.matrix2d.translate(e,n));break;case"to left":f=yt(a-e,a);this.applyTransform(lt.matrix2d.scale(f,1),lt.matrix2d.translate(e,0));break;case"to top":p=yt(c-n,c);this.applyTransform(lt.matrix2d.scale(1,p),lt.matrix2d.translate(0,n));break;case"to bottom left":f=yt(a-e,a),p=yt(c+n,c);this.applyTransform(lt.matrix2d.scale(f,p),lt.matrix2d.translate(e,0))}}},{key:"initTransform",value:function(t){this.transformRect=N(t),this.transformPoints=this.clonePoints.map((function(t){return{startPoint:N(t.startPoint),endPoint:N(t.endPoint),reversePoint:N(t.reversePoint)}}))}},{key:"setConnectedPoint",value:function(t,e){var n=this.state,r=n.dragXY.x+t,o=n.dragXY.y+e,i={x:r,y:o},a={x:r,y:o};n.dragPoints&&(n.reversePoint=Ia.getReversePoint(n.startPoint,i));var c={startPoint:n.startPoint,endPoint:i,curve:!!n.dragPoints,reversePoint:a,connected:!0,close:!0};n.points.push(c)}},{key:"setCachePoint",value:function(t,e){var n=this.state,r=n.points;if(this.snapPointList=[],n.selectedIndex=t,n.connectedPoint=Ia.getPrevPoint(r,t),n.connectedPoint&&!n.connectedPoint.connected&&(n.connectedPoint=null),n.segment=Ia.getIndexPoint(r,t),n.segment.connected&&(n.connectedPoint=Ia.getNextPoint(r,t)),Ia.isFirst(n.segment)){var o=Ia.getLastPoint(r,t);o.connected&&(n.connectedPoint=o)}n.segmentKey=e,n.isCurveSegment=n.segment.curve&&"startPoint"!=n.segmentKey,n.originalSegment=N(n.segment),n.connectedPoint&&(n.originalConnectedPoint=N(n.connectedPoint)),n.cachedPoints=[],r.filter((function(t){return t&&t!=n.segment})).forEach((function(t){n.cachedPoints.push(t.startPoint,t.reversePoint,t.endPoint)}))}},{key:"moveSegment",value:function(t,e,n){var r=this.state,o=r.originalSegment[t],i=r.segment[t];o&&(i.x=o.x+e,i.y=o.y+n)}},{key:"calculateToCurve",value:function(t,e,n){var r=(e.startPoint.x+n.startPoint.x)/2,o=(e.startPoint.y+n.startPoint.y)/2,i=(e.startPoint.x-r)/2,a=(e.startPoint.y-o)/2;return t.endPoint={x:t.startPoint.x+i,y:t.startPoint.y+a},t.reversePoint={x:t.startPoint.x-i,y:t.startPoint.y-a},{dx:i,dy:a}}},{key:"convertToCurve",value:function(t){var e=this.state.points,n=e[t];if(n.curve)if(n.curve=!1,n.reversePoint=N(n.startPoint),n.endPoint=N(n.startPoint),"M"===n.command){var r=Ia.getPrevPoint(e,n.index);r.connected&&(r.curve=!1,r.reversePoint=N(r.startPoint),r.endPoint=N(r.startPoint))}else{if((o=Ia.getNextPoint(e,t))&&"M"===o.command)(a=o).curve=!1,a.reversePoint=N(a.startPoint),a.endPoint=N(a.startPoint)}else{n.curve=!0;var o,i=Ia.getPrevPoint(e,t);if((o=Ia.getNextPoint(e,t))&&o.indext&&"M"!==o.command)this.calculateToCurve(n,o,i);else if(!o&&i){var c=(n.startPoint.x-i.startPoint.x)/3,u=(n.startPoint.y-i.startPoint.y)/3;n.endPoint={x:n.startPoint.x+c,y:n.startPoint.y+u},n.reversePoint=Ia.getReversePoint(n.startPoint,n.endPoint)}else if(!i&&o){c=(n.startPoint.x-o.startPoint.x)/3,u=(n.startPoint.y-o.startPoint.y)/3;n.endPoint={x:n.startPoint.x+c,y:n.startPoint.y+u},n.reverse=Ia.getReversePoint(n.startPoint,n.endPoint)}}}},{key:"moveCurveSegment",value:function(t,e,n){var r=this.state;this.moveSegment(t,e,n);var o="endPoint"===t?"reversePoint":"endPoint";r.segment[o]=Ia.getReversePoint(r.segment.startPoint,r.segment[t])}},{key:"rotateSegmentTarget",value:function(t,e){var n=this.state;if(n.originalSegment&&n.segment){var r=n.originalSegment.startPoint,o=r.x,i=r.y,a=n.segment[t],c=a.x,u=a.y,s=n.originalSegment[e],l=s.x,f=s.y,p=bt(kt(c-o,u-i),mt(l,f,o,i),o,i),y=p.x,h=p.y;n.segment[e]={x:y,y:h}}}},{key:"rotateSegment",value:function(t){this.rotateSegmentTarget(t,"endPoint"===t?"reversePoint":"endPoint")}},{key:"calculateSnap",value:function(t,e,n){var r=this,o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:1;return function(e,n){var i=r.state,a=i.cachedPoints,c=i.originalSegment[t];if(!t)return{dx:e,dy:n,snapPointList:[]};var u=c.x+e,s=c.y+n,l=JA(a,"x",u,e,o),f=l.point,p=(e=l.distanceValue,JA(a,"y",s,n,o)),y=p.point,h=(n=p.distanceValue,{x:c.x+e,y:c.y+n}),d=[];return f&&d.push({startPoint:f,endPoint:h}),y&&d.push({startPoint:y,endPoint:h}),{dx:e,dy:n,snapPointList:d}}(e,n)}},{key:"copySegment",value:function(t,e){e.startPoint=N(t.startPoint),e.endPoint=N(t.endPoint),e.reversePoint=N(t.reversePoint)}},{key:"moveSelectedSegment",value:function(t,e){var n=this;this.selectedPointList.forEach((function(r){var o=n.state.points[r.index][r.key];o.x=r.x+t,o.y=r.y+e}))}},{key:"removeSelectedSegment",value:function(){var t=this;this.selectedPointList.forEach((function(e){t.state.points[e.index][e.key].removed=!0}));var e=Ia.splitPoints(this.state.points),n=Ia.recoverPoints(e.map((function(t){return t.filter((function(t){return!t.startPoint.removed})).map((function(t){return t.endPoint.removed&&(t.endPoint=N(t.startPoint)),t.reversePoint.removed&&(t.reversePoint=N(t.startPoint)),Ia.isEqual(t.endPoint,t.startPoint,t.reversePoint)&&(t.command="L",t.curve=!1),t}))})));this.state.points=n,this.select()}},{key:"move",value:function(t,e,n){var r=this.state,o=r.isCurveSegment,i=r.segmentKey,a=r.connectedPoint,c=this.calculateSnap(i,t,e,2),u=(t=c.dx,e=c.dy,c.snapPointList);if(this.snapPointList=u||[],this.selectedPointList.length>1)this.moveSelectedSegment(t,e);else if(o)if(n.shiftKey){this.moveSegment(i,t,e);var s="endPoint"===i?"reversePoint":"endPoint";r.segment[s]=Ia.getReversePoint(r.segment.startPoint,r.segment[i])}else n.altKey?(this.moveSegment(i,t,e),this.rotateSegment(i)):this.moveSegment(i,t,e);else this.moveSegment("startPoint",t,e),this.moveSegment("endPoint",t,e),this.moveSegment("reversePoint",t,e);a&&this.copySegment(r.segment,r.connectedPoint)}},{key:"moveEnd",value:function(t,e){var n=this.state,r=n.points,o=n.dragXY.x+t,i=n.dragXY.y+e,a={x:o,y:i},c={x:o,y:i};n.dragPoints&&(c=Ia.getReversePoint(n.startPoint,a)),r.push({command:0===n.clickCount?"M":"",startPoint:n.startPoint,endPoint:a,curve:!!n.dragPoints,reversePoint:c}),n.startPoint=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=Ia.getPoint(r,e),i=Ia.getPoint(r,n),a=[WA(WA({},o),{},{endPoint:t.first[1]}),{startPoint:t.first[3],reversePoint:t.first[2],curve:!0,endPoint:t.second[1]},WA(WA({},i),{},{reversePoint:t.second[2]})],c=Ia.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=Ia.getPoint(n,e),o=r.startPoint.x+(r.endPoint.x-r.startPoint.x)/3,i=r.startPoint.y+(r.endPoint.y-r.startPoint.y)/3,a=[WA(WA({},r),{},{endPoint:{x:o,y:i}}),{startPoint:t.first[2],reversePoint:t.first[1],curve:!0,endPoint:t.second[1]}],c=Ia.getIndex(n,e);n.splice.apply(n,[c,1].concat(a)),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=Ia.getIndex(n,e);n.splice.apply(n,[o+1,0].concat(r)),this.state.points=n}},{key:"toPath",value:function(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1;return tI(this.clonePoints,t,e,n)}},{key:"changeScale",value:function(){this.pathEditor.scale}},{key:"makeSVGPath",value:function(){return this.initialize(),this.makePointGuide(this.clonePoints),this.makeMovePositionGuide(),this.toSVGString()}},{key:"makeTriangleDistancePointGuide",value:function(t,e){var n=Math.min(t.startPoint.x,e.startPoint.x),r=Math.max(t.startPoint.x,e.startPoint.x),o=Math.min(t.startPoint.y,e.startPoint.y),i=Math.max(t.startPoint.y,e.startPoint.y);if(t.startPoint.xe.startPoint.y?this.segmentManager.addDistanceLine({x:n,y:i},{x:r,y:i}).addDistanceLine({x:r,y:o},{x:r,y:i}):t.startPoint.x>e.startPoint.x&&t.startPoint.y>e.startPoint.y?this.segmentManager.addDistanceLine({x:n,y:o},{x:n,y:i}).addDistanceLine({x:n,y:i},{x:r,y:i}):t.startPoint.x>e.startPoint.x&&t.startPoint.y2&&void 0!==arguments[2]?arguments[2]:1,r=QA(t,"x",e.x,n),o=QA(t,"y",e.y,n),i=WA({},e);r&&(i.x=r.x),o&&(i.y=o.y);var a=[];return r&&a.push({startPoint:r,endPoint:i}),o&&a.push({startPoint:o,endPoint:i}),{snapPointList:a,moveXY:i}}(e,r,2),u=c.snapPointList,s=c.moveXY;(a=i).push.apply(a,GA(u)),t.moveXY=s,r=s,this.snapPointList=i;var l=e[e.length-1];if(o)if(l){if(l.curve){var f=Ia.getReversePoint(n,r);h=f.x,d=f.y;this.guideLineManager.M(l.startPoint).C(l.endPoint,{x:h,y:d},n),this.segmentManager.addGuideLine(l.startPoint,l.endPoint).addGuideLine(n,{x:h,y:d}).addGuideLine(n,r).addCurvePoint(l.endPoint).addCurvePoint({x:h,y:d}).addCurvePoint(r).addPoint(!1,n)}else if(!1===l.curve){var p=Ia.getReversePoint(n,r);h=p.x,d=p.y;this.guideLineManager.M(l.startPoint).Q({x:h,y:d},n),this.segmentManager.addGuideLine(r,{x:h,y:d}).addPoint(!1,n).addCurvePoint({x:h,y:d}).addCurvePoint(r)}}else{var y=Ia.getReversePoint(n,r),h=y.x,d=y.y;this.guideLineManager.M(r).L(n).L({x:h,y:d}),this.segmentManager.addCurvePoint(n).addCurvePoint(r).addCurvePoint({x:h,y:d})}else l&&(l.curve?(this.guideLineManager.M(l.startPoint).Q(l.endPoint,r),this.segmentManager.addGuideLine(l.endPoint,l.startPoint).addCurvePoint(l.endPoint)):l.close||(this.guideLineManager.M(l.startPoint).L(r),this.segmentManager.addPoint(!1,l.startPoint)))}}},{key:"makeSnapLines",value:function(){var t=[];if(this.snapPointList){var e=new Qa;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.pathEditor.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 ").concat(this.guideLineManager.toString("guide",this.state.isPolygon),"\n ").concat(this.pathStringManager.toString("object",this.state.isPolygon),"\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 GA(this.state.points)}},{key:"selectedLength",get:function(){return this.selectedPointList.length}}]),t}();function rI(t){return(rI="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 oI(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function iI(t){for(var e=1;et.length)&&(e=t.length);for(var n=0,r=new Array(e);n\n
\n
\n \n \n \n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n "}},{key:pr("$tool"),value:function(){this.resetTransformZone();var t=this.state.transformZoneRect;return{"data-show":"transform"===this.state.mode,"data-position":this.transformMoveType,style:{left:ln.px(t.x),top:ln.px(t.y),width:ln.px(t.width),height:ln.px(t.height)}}}},{key:"renderTransformTool",value:function(){this.bindData("$tool")}},{key:"isShow",value:function(){return this.state.isShow}},{key:"initRect",value:function(){var t=arguments.length>0&&void 0!==arguments[0]&&arguments[0];this.state.rect&&!t||(this.state.rect=this.parent.refs.$body.rect())}},{key:$n("document")+Zn("isShow")+Qn+Jn+ar+cr,value:function(){this.state.current?this.refreshPathLayer():this.addPathLayer(),this.trigger("hidePathEditor")}},{key:"makePathLayer",value:function(t){var e,n=this,r=this.pathGenerator.toPath(t.x,t.y,this.scale).d,o=this.$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 YC({width:ln.px(c),height:ln.px(u),d:r,totalLength:this.totalPathLength})),OI.forEach((function(t){n.state[t]&&e.reset(aI({},t,n.state[t]))})),e.setScreenX(i),e.setScreenY(a)}return e}},{key:"updatePathLayer",value:function(){var t=this.getPathRect(),e=t.x,n=t.y,r=this.state.current;if(r&&this.isBoxMode)e=r.screenX.value/this.scale,n=r.screenY.value/this.scale;var o=this.pathGenerator.toPath(e,n,this.scale).d,i=new Ya(o);this.emit(this.state.changeEvent,{d:i.toString(),totalLength:this.totalPathLength,rect:{x:0===t.x?0:t.x/this.scale,y:0===t.y?0:t.y/this.scale,width:0===t.width?0:t.width/this.scale,height:0===t.height?0:t.height/this.scale}}),this.emit("refreshPathLayer")}},{key:"addPathLayer",value:function(){var t=this.getPathRect();if(this.changeMode("modify"),0!==t.width&&0!==t.height){var e=this.makePathLayer(t);e&&(this.$selection.select(e),this.emit("refreshAll"),this.emit("refreshSelection"))}}},{key:"changeMode",value:function(t,e){this.setState(iI({mode:t,clickCount:0,moveXY:null},e),!1),this.emit("changePathManager",this.state.mode)}},{key:Do("changePathManager"),value:function(t){this.setState(iI(iI({},t),{},{clickCount:0}),!1),this.renderPath()}},{key:"isMode",value:function(t){return this.state.mode===t}},{key:Do("changeScale"),value:function(){this.refresh()}},{key:"getCurrentObject",value:function(){var t=this.state.current;return t?{current:t,d:t.d,screenX:t.screenX,screenY:t.screenY,screenWidth:t.screenWidth,screenHeight:t.screenHeight}:null}},{key:"refresh",value:function(t){if((t=t||this.getCurrentObject())&&t.d){this.pathParser.reset(t.d),this.pathParser.scale(this.scale,this.scale);var e=t.screenX.value*this.scale,n=t.screenY.value*this.scale;this.pathParser.translate(e,n),this.state.points=this.pathParser.convertGenerator(),this.state.hasTransform=!!t.current.transform}else this.state.hasTransform=!1;this.pathGenerator.initializeSelect(),this.renderPath()}},{key:Do("showPathEditor"),value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"path",e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};"move"===t?(e.current=null,e.points=[]):e.current||(e.current=null),e.box=e.box||"canvas",this.changeMode(t,e),this.refresh(e),this.state.isShow=!0,this.$el.show(),this.$el.focus(),this.emit("showPathManager",{mode:this.state.mode}),this.emit("hidePathDrawEditor"),this.emit("change.mode.view","PathEditorView")}},{key:Do("hidePathEditor"),value:function(){this.$el.isShow()&&(this.pathParser.reset(""),this.setState(this.initState(),!1),this.refs.$view.empty(),this.$el.hide(),this.emit("finishPathEdit"),this.emit("hidePathManager"),this.emit("change.mode.view"))}},{key:pr("$view"),value:function(){return{class:{path:"path"===this.state.mode,modify:"modify"===this.state.mode,transform:"transform"===this.state.mode,box:"box"===this.state.box,"has-transform":!!this.state.hasTransform,"segment-move":"segment-move"===this.state.mode},innerHTML:this.pathGenerator.makeSVGPath()}}},{key:pr("$splitCircle"),value:function(){return this.state.splitXY?{cx:this.state.splitXY.x,cy:this.state.splitXY.y,r:5}:{r:0}}},{key:"refreshPathLayer",value:function(){this.updatePathLayer()}},{key:"renderPath",value:function(){this.bindData("$view"),this.renderTransformTool()}},{key:"getPathRect",value:function(){this.initRect(!0);var t=this.refs.$view.$("path.object"),e={x:ln.px(0),y:ln.px(0),width:ln.px(0),height:ln.px(0)};return t&&((e=t.rect()).x-=this.state.rect.x,e.y-=this.state.rect.y),e}},{key:"resetTransformZone",value:function(){var t=this.getPathRect();this.state.transformZoneRect=t}},{key:Hn("$view"),value:function(t){if(this.initRect(),this.isMode("path")&&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.renderPath();else{var e=dn.create(t.target),n=e.hasClass("split-path");this.state.splitXY=n?this.calculatePointOnLine(e.attr("d"),{x:t.xy.x-this.state.rect.x,y:t.xy.y-this.state.rect.y}):null,this.bindData("$splitCircle"),this.state.altKey=!1}}},{key:Gn("$view :not(.split-path)")+or()+ir(),value:function(t){this.initRect(),this.state.altKey=!1;var e=this.isMode("path");this.state.dragXY={x:t.xy.x-this.state.rect.x,y:t.xy.y-this.state.rect.y},this.state.isOnCanvas=!1;var n=dn.create(t.target);if(n.hasClass("svg-editor-canvas")&&!e?this.state.isOnCanvas=!0:(this.pathGenerator.reselect(),this.state.isSegment="true"===n.attr("data-segment"),this.state.isFirstSegment=this.state.isSegment&&"true"===n.attr("data-is-first")),e){if(this.state.isFirstSegment){var r=+n.attr("data-index");this.state.startPoint=this.state.points[r].startPoint}else this.state.startPoint=this.state.dragXY;this.state.dragPoints=!1,this.state.endPoint=null}else if(this.isOnCanvas)this.renderSelectBox(this.state.dragXY);else if(this.state.isSegment){this.changeMode("segment-move");var o=bI(n.attrs("data-index","data-segment-point"),2),i=(r=o[0],o[1]);this.pathGenerator.setCachePoint(+r,i),this.pathGenerator.selectKeyIndex(i,r)}}},{key:"hideSelectBox",value:function(){this.refs.$segmentBox.css({left:ln.px(-1e5)})}},{key:"renderSelectBox",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,r={left:ln.px(t.x+(e<0?e:0)),top:ln.px(t.y+(n<0?n:0)),width:ln.px(Math.abs(e)),height:ln.px(Math.abs(n))};this.refs.$segmentBox.css(r)}},{key:"getSelectBox",value:function(){var t=bI(this.refs.$segmentBox.styles("left","top","width","height").map((function(t){return ln.parse(t)})),4),e={x:t[0],y:t[1],width:t[2],height:t[3]};return e.x2=ln.px(e.x.value+e.width.value),e.y2=ln.px(e.y.value+e.height.value),e}},{key:"move",value:function(t,e){if(this.state.isOnCanvas)this.renderSelectBox(this.state.dragXY,t,e);else if(this.isMode("segment-move")){var n=this.$config.get("bodyEvent");this.pathGenerator.move(t,e,n),this.renderPath(),this.updatePathLayer()}else if(this.isMode("path")){n=this.$config.get("bodyEvent");this.state.dragPoints=!n.altKey}}},{key:"renderSegment",value:function(t){this.pathGenerator.selectedLength&&(this.pathGenerator.reselect(),X(t)&&t(),this.renderPath(),this.updatePathLayer())}},{key:Do("deleteSegment"),value:function(){var t=this;this.renderSegment((function(){t.pathGenerator.removeSelectedSegment()}))}},{key:Do("moveSegment"),value:function(t,e){var n=this;this.renderSegment((function(){n.pathGenerator.moveSelectedSegment(t,e)}))}},{key:"end",value:function(t,e){this.state.isOnCanvas?0===t&&0===e?(this.changeMode("modify"),this.trigger("hidePathEditor")):(this.changeMode("segment-move"),this.pathGenerator.selectInBox(this.getSelectBox()),this.renderPath(),this.hideSelectBox()):this.isMode("modify")||(this.isMode("segment-move")?this.changeMode("modify"):this.isMode("path")&&(this.state.isFirstSegment?(this.changeMode("modify"),this.pathGenerator.setConnectedPoint(t,e),this.renderPath(),this.state.current?this.refreshPathLayer():(this.addPathLayer(),this.trigger("hidePathEditor"))):(this.pathGenerator.moveEnd(t,e),this.state.clickCount++,this.renderPath())))}},{key:"scale",get:function(){return this.$editor.scale}},{key:"totalPathLength",get:function(){if(!this.refs.$view)return 0;var t=this.refs.$view.$("path.object");return t?t.totalLength:0}},{key:"isBoxMode",get:function(){return"box"===this.state.box}}]),n}(function(t){pI(n,t);var e=hI(n);function n(){return sI(this,n),e.apply(this,arguments)}return fI(n,[{key:Do("changePathTransform"),value:function(t){this.resetTransformZone();var e=this.state.transformZoneRect,n=e.width,r=e.height;switch(this.pathGenerator.initTransform(this.state.transformZoneRect),t){case"flipX":this.pathGenerator.transform("flipX",n,0);break;case"flipY":this.pathGenerator.transform("flipY",0,r);break;case"flip":this.pathGenerator.transform("flip",n,r)}this.renderPath(),this.refreshPathLayer()}},{key:Gn("$tool .transform-tool-item")+or("moveTransformTool")+ir("moveEndTransformTool"),value:function(t){this.transformMoveType=t.$dt.attr("data-position"),this.resetTransformZone(),this.pathGenerator.initTransform(this.state.transformZoneRect),this.startXY=t.xy}},{key:"moveTransformTool",value:function(t,e){this.pathGenerator.transform(this.transformMoveType,t,e),this.renderPath(),this.refreshPathLayer()}},{key:"moveEndTransformTool",value:function(t,e){this.transformMoveType="none",this.renderTransformTool()}}]),n}(function(t){pI(n,t);var e=hI(n);function n(){return sI(this,n),e.apply(this,arguments)}return fI(n,[{key:"calculatePointOnLine",value:function(t,e){var n=new Ya(t);if("C"===n.segments[1].command){var r=[wI(n.segments[0].values),wI(n.segments[1].values.slice(0,2)),wI(n.segments[1].values.slice(2,4)),wI(n.segments[1].values.slice(4,6))],o=mx.apply(void 0,uI(r).concat([200]))(e.x,e.y);return xx(r,o).first[3]}if("Q"===n.segments[1].command){r=[wI(n.segments[0].values),wI(n.segments[1].values.slice(0,2)),wI(n.segments[1].values.slice(2,4))],o=gx.apply(void 0,uI(r).concat([200]))(e.x,e.y);return Rx(r,o).first[2]}if("L"===n.segments[1].command){r=[wI(n.segments[0].values),wI(n.segments[1].values.slice(0,2))],o=wx.apply(void 0,uI(r).concat([200]))(e.x,e.y);return $x(r,o).first[1]}return e}},{key:jn("$view .split-path"),value:function(t){this.initRect();var e=new Ya(t.$dt.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=[wI(e.segments[0].values),wI(e.segments[1].values.slice(0,2)),wI(e.segments[1].values.slice(2,4)),wI(e.segments[1].values.slice(4,6))],o=mx.apply(void 0,uI(r).concat([200]))(n.x,n.y);this.changeMode("modify"),this.pathGenerator.setPoint(xx(r,o))}else if("Q"===e.segments[1].command){r=[wI(e.segments[0].values),wI(e.segments[1].values.slice(0,2)),wI(e.segments[1].values.slice(2,4))],o=gx.apply(void 0,uI(r).concat([200]))(n.x,n.y);this.changeMode("modify"),this.pathGenerator.setPointQuard(Rx(r,o))}else if("L"===e.segments[1].command){r=[wI(e.segments[0].values),wI(e.segments[1].values.slice(0,2))],o=wx.apply(void 0,uI(r).concat([200]))(n.x,n.y);this.changeMode("modify"),this.pathGenerator.setPointLine($x(r,o))}this.renderPath(),this.refreshPathLayer()}}]),n}(function(t){pI(n,t);var e=hI(n);function n(){return sI(this,n),e.apply(this,arguments)}return fI(n,[{key:Pn("$view [data-segment]"),value:function(t){var e=+t.$dt.attr("data-index");this.pathGenerator.convertToCurve(e),this.renderPath(),this.refreshPathLayer()}}]),n}(Ao))));function SI(t){return(SI="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 jI(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function PI(t){for(var e=1;e"}},{key:ur("$el"),value:function(){if(1!==this.$selection.length)return"
";var t=this.$selection.current;if(t.isInGrid()){var e=t.parent,n=e.screenX,r=e.screenY,o=e.width,i=e.height,a=e.toGridLayoutCSS();return"
\n ").concat(e.layers.map((function(t){var e=t.toLayoutItemCSS();return"
")})).join(""),"\n
")}return"
"}},{key:Do("refreshGridLayoutLine","refreshSelectionTool","refreshSelection"),value:function(){this.refresh()}}])&&$I(e.prototype,n),r&&$I(e,r),i}(Ao);function AI(t){return(AI="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,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function VI(t){for(var e=1;e\n
\n "}},{key:"initRect",value:function(){var t=arguments.length>0&&void 0!==arguments[0]&&arguments[0];this.state.rect&&!t||(this.state.rect=this.parent.refs.$body.rect())}},{key:$n("document")+Zn("isShow")+Qn+Jn+ar+cr,value:function(){this.trigger("hidePathDrawEditor")}},{key:"makePathLayer",value:function(t){var e,n=this,r=this.$selection.currentArtboard;if(r){var o=t.x/this.scale,i=t.y/this.scale,a=t.width/this.scale,c=t.height/this.scale,u=Ia.simply(this.state.points,this.state.tolerance),s=new Ya(Qa.makePathByPoints(u)),l=nI.generatorPathString(s.convertGenerator(),t.x,t.y,this.scale);e=r.add(new YC({width:ln.px(a),height:ln.px(c),d:l,totalLength:this.totalPathLength})),YI.forEach((function(t){n.state[t]&&e.reset(MI({},t,n.state[t]))})),e.setScreenX(o),e.setScreenY(i)}return e}},{key:"addPathLayer",value:function(){var t=this.getPathRect();0!==t.width&&0!==t.height&&this.makePathLayer(t)&&this.emit("refreshAll")}},{key:"changeMode",value:function(t){this.setState(VI(VI({},this.initState()),t),!1)}},{key:"getCurrentObject",value:function(){var t=this.state.current;return t?{current:t,d:t.d,screenX:t.screenX,screenY:t.screenY,screenWidth:t.screenWidth,screenHeight:t.screenHeight}:null}},{key:Do("showPathDrawEditor"),value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};this.changeMode(t),this.$el.show(),this.$el.focus(),this.emit("showDrawManager",{instance:this,fill:this.state.fill,stroke:this.state.stroke,"fill-opacity":this.state["fill-opacity"],"stroke-width":this.state["stroke-width"],"stroke-linecap":this.state["stroke-linecap"],"stroke-linejoin":this.state["stroke-linejoin"]}),this.emit("hidePathEditor"),this.emit("change.mode.view","PathDrawView")}},{key:Do("initPathDrawEditor"),value:function(){this.pathParser.reset(""),this.refs.$view.empty()}},{key:Do("hidePathDrawEditor"),value:function(){this.$el.isShow()&&(this.trigger("initPathDrawEditor"),this.$el.hide(),this.emit("finishPathEdit"),this.emit("hideDrawManager"),this.emit("change.mode.view"))}},{key:"getInnerId",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";return"draw-manager-"+t}},{key:pr("$view"),value:function(){return{innerHTML:'\n \n '.concat(this.toDefString,"\n \n \n ')}}},{key:"renderPath",value:function(){this.bindData("$view")}},{key:Do("resizeEditor"),value:function(){this.initRect(!0)}},{key:"getPathRect",value:function(){this.initRect(!0);var t=this.refs.$view.$("path.object"),e={x:ln.px(0),y:ln.px(0),width:ln.px(0),height:ln.px(0)};return t&&((e=t.rect()).x-=this.state.rect.x,e.y-=this.state.rect.y),e}},{key:Gn("$view")+or()+ir(),value:function(t){this.initRect(),this.state.altKey=!1,this.state.startXY={x:t.xy.x-this.state.rect.x,y:t.xy.y-this.state.rect.y},this.state.points=[this.state.startXY]}},{key:"move",value:function(t,e,n,r){this.state.points.push({x:this.state.startXY.x+t,y:this.state.startXY.y+e,pressure:r}),this.renderPath()}},{key:"end",value:function(t,e){this.addPathLayer(),this.trigger("initPathDrawEditor")}},{key:"scale",get:function(){return this.$editor.scale}},{key:"totalPathLength",get:function(){if(!this.refs.$view)return 0;var t=this.refs.$view.$("path.object");return t?t.totalLength:0}},{key:"toFillSVG",get:function(){return uC.parseImage(this.state.fill||"transparent").toSVGString(this.fillId)}},{key:"toStrokeSVG",get:function(){return uC.parseImage(this.state.stroke||"black").toSVGString(this.strokeId)}},{key:"toDefInnerString",get:function(){return"\n ".concat(this.toFillSVG,"\n ").concat(this.toStrokeSVG,"\n ")}},{key:"toDefString",get:function(){var t=this.toDefInnerString.trim();return"\n \n ".concat(t,"\n \n ")}},{key:"fillId",get:function(){return this.getInnerId("fill")}},{key:"strokeId",get:function(){return this.getInnerId("stroke")}},{key:"toFillValue",get:function(){return uC.parseImage(this.state.fill||"transparent").toFillValue(this.fillId)}},{key:"toStrokeValue",get:function(){return uC.parseImage(this.state.stroke||"black").toFillValue(this.strokeId)}}])&&BI(e.prototype,n),r&&BI(e,r),i}(Ao);function KI(t){return(KI="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){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function WI(t){for(var e=1;e\n
\n "}},{key:"initRect",value:function(){var t=arguments.length>0&&void 0!==arguments[0]&&arguments[0];this.state.rect&&!t||(this.state.rect=this.parent.refs.$body.rect())}},{key:$n("document")+Zn("isShow")+Qn+Jn+ar+cr,value:function(){this.trigger("hideBrushDrawEditor")}},{key:"makeBrushLayer",value:function(t){var e,n=this,r=this.$selection.currentArtboard;if(r){var o=t.x/this.scale,i=t.y/this.scale,a=t.width/this.scale,c=t.height/this.scale,u=Ia.simply(this.state.points,this.state.tolerance),s=new Ya(Qa.makePathByPoints(u)),l=nI.generatorPathString(s.convertGenerator(),o,i,this.scale);e=r.add(new $D({width:ln.px(a),height:ln.px(c),d:l,totalLength:this.totalPathLength})),oV.forEach((function(t){n.state[t]&&e.reset(ZI({},t,n.state[t]))})),e.setScreenX(o),e.setScreenY(i)}return e}},{key:"addBrushLayer",value:function(){var t=this.getPathRect();if(0!==t.width&&0!==t.height){var e=this.makeBrushLayer(t);e&&(this.$selection.select(e),this.emit("refreshAll"),this.emit("refreshSelection"))}}},{key:"changeMode",value:function(t){this.setState(WI(WI({},this.initState()),t),!1),this.emit("change.mode.view","PathDrawView")}},{key:"getCurrentObject",value:function(){var t=this.state.current;return t?{current:t,d:t.d,screenX:t.screenX,screenY:t.screenY,screenWidth:t.screenWidth,screenHeight:t.screenHeight}:null}},{key:Do("showBrushDrawEditor"),value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};this.changeMode(t),this.$el.show(),this.$el.focus(),this.emit("showDrawManager",{fill:this.state.fill,stroke:this.state.stroke,"fill-opacity":this.state["fill-opacity"],"stroke-width":this.state["stroke-width"],"stroke-linecap":this.state["stroke-linecap"],"stroke-linejoin":this.state["stroke-linejoin"]})}},{key:Do("initBrushDrawEditor"),value:function(){this.pathParser.reset(""),this.refs.$view.empty()}},{key:Do("hideBrushDrawEditor"),value:function(){this.trigger("initBrushDrawEditor"),this.$el.hide(),this.emit("finishPathEdit"),this.emit("hideDrawManager"),this.emit("change.mode.view")}},{key:"getInnerId",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";return"draw-manager-"+t}},{key:pr("$view"),value:function(){return{innerHTML:'\n \n '.concat(this.toDefString,"\n \n \n ')}}},{key:"renderPath",value:function(){this.bindData("$view")}},{key:"getPathRect",value:function(){this.initRect(!0);var t=this.refs.$view.$("path.object"),e={x:ln.px(0),y:ln.px(0),width:ln.px(0),height:ln.px(0)};return t&&((e=t.rect()).x-=this.state.rect.x,e.y-=this.state.rect.y),e}},{key:Gn("$view")+or()+ir(),value:function(t){this.initRect(),this.state.altKey=!1,this.state.startXY={x:t.xy.x-this.state.rect.x,y:t.xy.y-this.state.rect.y},this.state.points=[this.state.startXY]}},{key:"move",value:function(t,e,n,r){this.state.points.push({x:this.state.startXY.x+t,y:this.state.startXY.y+e,pressure:r}),this.renderPath()}},{key:"end",value:function(t,e){this.addBrushLayer(),this.trigger("initBrushDrawEditor")}},{key:"scale",get:function(){return this.$editor.scale}},{key:"totalPathLength",get:function(){if(!this.refs.$view)return 0;var t=this.refs.$view.$("path.object");return t?t.totalLength:0}},{key:"toFillSVG",get:function(){return uC.parseImage(this.state.fill||"transparent").toSVGString(this.fillId)}},{key:"toStrokeSVG",get:function(){return uC.parseImage(this.state.stroke||"black").toSVGString(this.strokeId)}},{key:"toDefInnerString",get:function(){return"\n ".concat(this.toFillSVG,"\n ").concat(this.toStrokeSVG,"\n ")}},{key:"toDefString",get:function(){var t=this.toDefInnerString.trim();return"\n \n ".concat(t,"\n \n ")}},{key:"fillId",get:function(){return this.getInnerId("fill")}},{key:"strokeId",get:function(){return this.getInnerId("stroke")}},{key:"toFillValue",get:function(){return uC.parseImage(this.state.fill||"transparent").toFillValue(this.fillId)}},{key:"toStrokeValue",get:function(){return uC.parseImage(this.state.stroke||"black").toFillValue(this.strokeId)}}])&&JI(e.prototype,n),r&&JI(e,r),i}(Ao);function aV(t){return(aV="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 cV(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(t)))return;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)||sV(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function uV(t){return function(t){if(Array.isArray(t))return lV(t)}(t)||function(t){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(t))return Array.from(t)}(t)||sV(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function sV(t,e){if(t){if("string"==typeof t)return lV(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?lV(t,e):void 0}}function lV(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n\n
\n
\n \n \n \n \n \n \n \n "}},{key:"getScrollXY",value:function(){return{width:this.refs.$body.scrollWidth(),height:this.refs.$body.scrollHeight(),left:this.refs.$body.scrollLeft(),top:this.refs.$body.scrollTop()}}},{key:Do("afterChangeMode"),value:function(){this.$el.attr("data-mode",this.$editor.mode)}},{key:Do("refElement"),value:function(t,e){X(e)&&e(this.getElement(t))}},{key:"getElement",value:function(t){return this.refs.$view.$('[data-id="'.concat(t,'"]'))}},{key:"checkEmptyElement",value:function(t){var e=dn.create(t.target);return!!this.$editor.isAddMode()||"selection"===this.state.mode&&!1===e.hasClass("element-item")&&!1===e.hasClass("selection-tool-item")&&!1===e.hasClass("point")&&!1===e.hasClass("handle")&&!1===e.hasClass("perspective-handle")&&!1===e.hasClass("transform-tool-item")&&!1===e.hasClass("transform-tool")&&!1===e.isTag("svg")&&!1===e.isTag("path")&&!1===e.isTag("textPath")&&!1===e.isTag("polygon")&&!1===e.isTag("text")&&!1===e.isTag("img")&&"true"!==e.attr("data-segment")}},{key:Gn("$view")+Zn("checkEmptyElement")+or("movePointer")+ir("moveEndPointer"),value:function(t){if(this.$target=dn.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,this.$editor.isSelectionMode()){var e={left:ln.px(this.dragXY.x),top:ln.px(this.dragXY.y),width:ln.px(0),height:ln.px(0)};this.refs.$dragAreaRect.css(e),this.state.cachedCurrentElement={},this.$el.$$(".selected").forEach((function(t){return t.removeClass("selected")}))}}},{key:"movePointer",value:function(t,e){var n=this,r={left:ln.px(this.dragXY.x+(t<0?t:0)),top:ln.px(this.dragXY.y+(e<0?e:0)),width:ln.px(Math.abs(t)),height:ln.px(Math.abs(e))};if(this.refs.$dragAreaRect.css(r),this.$editor.isSelectionMode()){var o,i=r.left,a=r.top,c=r.width,u=r.height,s={x:ln.px(i.value-this.canvasPosition.x),y:ln.px(a.value-this.canvasPosition.y),width:c,height:u};s.x2=ln.px(s.x.value+s.width.value),s.y2=ln.px(s.y.value+s.height.value);var l,f=this.$selection.currentArtboard,p=this.$selection.items;if(f)Object.keys(s).forEach((function(t){s[t].div(n.$editor.scale)})),p=f.checkInAreaForLayers(s),0===s.width.value&&0===s.height.value&&(p=[]),(l=this.$selection).select.apply(l,uV(p))&&this.selectCurrentForBackgroundView.apply(this,uV(p));(o=this.$selection).select.apply(o,uV(p))&&this.emit("refreshSelection")}}},{key:"moveEndPointer",value:function(t,e){var n=this,r=cV(this.refs.$dragAreaRect.styles("left","top","width","height").map((function(t){return ln.parse(t)})),4),o=r[0],i=r[1],a=r[2],c=r[3],u={x:ln.px(o.value-this.canvasPosition.x),y:ln.px(i.value-this.canvasPosition.y),width:a,height:c};if(u.x2=ln.px(u.x.value+u.width.value),u.y2=ln.px(u.y.value+u.height.value),this.refs.$dragAreaRect.css({left:ln.px(-1e4),top:ln.px(0),width:ln.px(0),height:ln.px(0)}),this.$editor.isSelectionMode()){var s,l=this.$selection.currentArtboard,f=[];l?(Object.keys(u).forEach((function(t){u[t].div(n.$editor.scale)})),f=l.checkInAreaForLayers(u),0===u.width.value&&0===u.height.value&&(f=[l]),0===f.length&&l.checkInArea(u)&&(f=[l]),(s=this.$selection).select.apply(s,uV(f))&&this.selectCurrentForBackgroundView.apply(this,uV(f)),f.length?this.emit("refreshSelection"):(this.$selection.select(),this.emit("emptySelection"))):(this.$selection.select(),this.emit("emptySelection"))}else{var p={x:ln.px(u.x.value/this.$editor.scale).floor(),y:ln.px(u.y.value/this.$editor.scale).floor(),width:ln.px(u.width.value/this.$editor.scale).floor(),height:ln.px(u.height.value/this.$editor.scale).floor()};switch(this.$editor.addComponentType){case"image":this.emit("openImage",p);break;case"video":this.emit("openVideo",p);break;default:this.emit("newComponent",this.$editor.addComponentType,p)}}this.sendHelpMessage(),this.emit("removeGuideLine")}},{key:"sendHelpMessage",value:function(){1===this.$selection.length&&this.$selection.current.is("svg-path","svg-brush","svg-polygon","svg-textpath")&&this.emit("addStatusBarMessage","Please click if you want to edit to path ")}},{key:$n("$view .element-item.text"),value:function(t){var e=t.$dt.html(),n=t.$dt.text().trim(),r=t.$dt.attr("data-id"),o=[];this.$selection.items.filter((function(t){return t.id===r})).forEach((function(t){t.reset({content:e,text:n}),o.push({id:t.id,content:e,text:n})})),this.emit("refreshContent",o)}},{key:"checkEditMode",value:function(){return this.$editor.isSelectionMode()}},{key:Gn("$view .element-item")+Zn("checkEditMode")+or("calculateMovedElement")+ir("calculateEndedElement"),value:function(t){if(this.startXY=t.xy,this.$element=t.$dt,this.$element.hasClass("text")&&this.$element.hasClass("selected"))return!1;var e=this.$element.attr("data-id");this.hasSVG=!1,t.shiftKey?this.$selection.toggleById(e):this.$selection.check({id:e})?this.$selection.current.is("svg-path","svg-brush","svg-textpath","svg-polygon")&&(this.hasSVG=!0):this.$selection.selectById(e),this.selectCurrent.apply(this,uV(this.$selection.items)),this.$selection.setRectCache(),this.emit("refreshSelection"),this.children.$selectionTool.initMoveType()}},{key:"calculateMovedElement",value:function(t,e){this.children.$selectionTool.refreshSelectionToolView(t,e,"move"),this.updateRealPosition()}},{key:"updateRealPositionByItem",value:function(t){var e=t.toBound(),n=e.x,r=e.y,o=e.width,i=e.height,a=this.state.cachedCurrentElement[t.id];a||(this.state.cachedCurrentElement[t.id]=this.getElement(t.id),a=this.state.cachedCurrentElement[t.id]),a&&a.cssText("left: ".concat(n,";top:").concat(r,";width:").concat(o,";height:").concat(i,"; transform: ").concat(t.transform,";"))}},{key:"updateRealPosition",value:function(){var t=this;this.$selection.each((function(e){t.updateRealPositionByItem(e)})),this.emit("refreshRect")}},{key:Do("refreshArtBoardName"),value:function(t,e){this.$el.$("[data-id='".concat(t,"']")).attr("data-title",e)}},{key:"calculateEndedElement",value:function(t,e){if(0===t&&0===e){if(this.hasSVG)return void this.emit("openPathEditor")}else this.$selection.setRectCache(),this.emit("removeGuideLine")}},{key:pr("$body"),value:function(){var t=ln.px(this.$editor.canvasWidth),e=ln.px(this.$editor.canvasHeight);return{"data-mode":this.$editor.mode,style:{position:"relative",width:t,height:e}}}},{key:pr("$view"),value:function(){return{style:{transform:"scale(".concat(this.$editor.scale,")")},innerHTML:this.state.html}}},{key:Do("addElement"),value:function(){var t=(this.$selection.currentArtboard||{html:""}).html;this.setState({html:t},!1),this.refs.$view.updateDiff(t),this.emit("refreshSelectionTool")}},{key:"selectCurrent",value:function(){var t=this;this.state.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;o1&&void 0!==arguments[1])||arguments[1],r=arguments.length>2&&void 0!==arguments[2]&&arguments[2],o=t?[t]:this.$selection.items;o.forEach((function(t){e.updateElement(t,n,r)}))}},{key:"updateElement",value:function(t){var e=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];t&&(t.updateFunction(this.getElement(t.id),e,n),this.updateRealPositionByItem(t))}},{key:"updateTimelineElement",value:function(t){var e=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];t&&(t.updateFunction(this.getElement(t.id),e,n,this,!0),this.updateRealPositionByItem(t))}},{key:Do("playTimeline","moveTimeline"),value:function(){var t=this,e=this.$selection.currentArtboard;e&&e.getSelectedTimeline().animations.map((function(t){return e.searchById(t.id)})).forEach((function(e){t.updateTimelineElement(e,!0,!1)}))}},{key:Do("refreshAllCanvas"),value:function(){var t=!(arguments.length>0&&void 0!==arguments[0])||arguments[0],e=this.$selection.currentArtboard||{html:""},n=e.html;this.setState({html:n},!1),this.refs.$view.updateDiff(n),t&&this.emit("refreshSelectionTool")}},{key:"refresh",value:function(){this.state.html!=this.prevState.html&&this.load()}},{key:Do("refreshAllElementBoundSize"),value:function(){var t=this,e=this.$selection.items.map((function(t){return t.is("artboard")?t:t.parent}));uV(new Set(e)).forEach((function(e){t.trigger("refreshElementBoundSize",e)})),this.$selection.setRectCache()}},{key:Do("refreshElementBoundSize"),value:function(t){var e=this;t&&t.layers.forEach((function(t){if(t.isLayoutItem()){var n=e.getElement(t.id);if(n){var r=n.offsetRect(),o=r.x,i=r.y,a=r.width,c=r.height;t.reset({x:ln.px(o),y:ln.px(i),width:ln.px(a),height:ln.px(c)}),t.is("component")&&e.emit("refreshStyleView",t,!0),e.trigger("refreshSelectionStyleView",t,!0)}}e.trigger("refreshElementBoundSize",t)}))}},{key:Cn("view")+ar,value:function(){}},{key:_n("$view")+ar,value:function(t){var e=dn.create(t.target).attr("data-id");if(e)this.$selection.length?this.emit("drop.asset",{gradient:t.dataTransfer.getData("text/gradient"),color:t.dataTransfer.getData("text/color"),imageUrl:t.dataTransfer.getData("image/info")}):this.emit("drop.asset",{gradient:t.dataTransfer.getData("text/gradient"),color:t.dataTransfer.getData("text/color"),imageUrl:t.dataTransfer.getData("image/info")},e);else{var n=t.dataTransfer.getData("image/info");this.emit("dropImageUrl",n)}}}])&&pV(e.prototype,n),r&&pV(e,r),i}(Ao);function mV(t){return(mV="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,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function wV(t,e){for(var n=0;n"}},{key:ur("$body"),value:function(){var t=this.state,e=t.min,n=t.max,r=t.step,o=t.label,i=t.type,a=t.layout,c=+this.state.value.value.toString();isNaN(c)&&(c=0);var u=o?"has-label":"",s=a,l=(+c).toString();return"\n
\n ").concat(o?""):"","\n
\n
\n \n
\n
\n
\n ')}},{key:"getValue",value:function(){return this.state.value||0}},{key:"setValue",value:function(t){this.setState({value:ln.parse(t)})}},{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:In("$propertyNumber"),value:function(t){var e=+this.getRef("$propertyNumber").value;this.updateData({value:this.state.value.set(e)})}}])&&wV(e.prototype,n),r&&wV(e,r),i}(Ao);function xV(t){return(xV="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 RV(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function $V(t,e){for(var n=0;n\n \n
\n \n
\n \n \n \n\n ")}},{key:Do("changeScaleValue"),value:function(t){t<=0&&(t=.01),t=ft(100*t,100),this.children.$scale.setValue(t),this.emit("updateScale",t/100)}},{key:Do("changeRangeEditor")+nr(1e3),value:function(t,e){this.trigger("changeScaleValue",Math.floor(e/100))}},{key:jn("$plus")+ar+cr,value:function(){this.trigger("changeScaleValue",this.$editor.scale+.25)}},{key:jn("$minus")+ar+cr,value:function(){this.trigger("changeScaleValue",this.$editor.scale-.25)}}])&&$V(e.prototype,n),r&&$V(e,r),i}(Ao);function AV(t){return(AV="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 IV(t){return function(t){if(Array.isArray(t))return VV(t)}(t)||function(t){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(t))return Array.from(t)}(t)||function(t,e){if(!t)return;if("string"==typeof t)return VV(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);"Object"===n&&t.constructor&&(n=t.constructor.name);if("Map"===n||"Set"===n)return Array.from(t);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return VV(t,e)}(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function VV(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n\n
\n \n
\n \n
\n
\n
\n \n ")}},{key:"templateForBlendMode",value:function(t,e){return"\n \n ')}},{key:ur("$fillList"),value:function(){var t=this,e=this.$selection.current||{color:"black"};return this.state.images.map((function(n,r){var o=n.image,i=XV[o.type],a=HV[o.type],c=n.selected?"selected":"";return n.selected&&(t.selectedIndex=r),"\n
\n \n \n
\n
\n
').concat(a,"
\n
\n ").concat(t.templateForBlendMode(r,n.blendMode),"\n
\n
\n \n
\n
\n
\n
\n ")}))}},{key:"modifyBackgroundImage",value:function(){var t=Q(nf.toPropertyCSS(this.state.images));this.parent.trigger(this.props.onchange,this.props.key,t)}},{key:Do("add"),value:function(){this.state.images.push(new nf({image:new _s({angle:90,colorsteps:[new $u({percent:0,color:"white",index:0}),new $u({percent:100,color:"black",index:1})]})})),this.refresh(),this.modifyBackgroundImage()}},{key:jn("$add"),value:function(){this.trigger("add")}},{key:En("$fillList .fill-item"),value:function(t){this.startIndex=+t.$dt.attr("data-index")}},{key:Cn("$fillList .fill-item")+ar,value:function(t){}},{key:"sortItem",value:function(t,e,n){t.splice.apply(t,[n+(e1&&void 0!==arguments[1])||arguments[1];e?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:Do("selectFillPopupTab"),value:function(t,e){var n=XV[t];this.refs["fillIndex".concat(this.selectedIndex)].attr("data-fill-type",n)}},{key:Do("changeRangeEditor"),value:function(t,e,n){this.trigger("changePattern",t,function(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}({},t,e),n)}},{key:Do("changePattern"),value:function(t,e,n){var r=+n;this.state.images[r].reset(e),this.modifyBackgroundImage(),this.refresh()}}])&&LV(e.prototype,n),r&&LV(e,r),i}(Ao);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){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function UV(t,e){for(var n=0;n\n
\n \n
\n ").concat(this.props.title?"":"Add","\n
\n
\n
\n \n ")}},{key:ur("$shadowList"),value:function(){var t=this.state.boxShadows.map((function(t,e){return'\n
\n
\n
\n
\n
\n
').concat(Wb.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
'.concat(this.$i18n("boxshadow.editor.blur"),'
\n
').concat(this.$i18n("boxshadow.editor.spread"),'
\n
\n
\n
\n ')),t.join("")}},{key:Do("refreshSelection"),value:function(){this.refresh()}},{key:"modifyBoxShadow",value:function(){var t=this.state.boxShadows.join(", ");this.parent.trigger(this.props.onchange,t)}},{key:Do("add"),value:function(){this.state.boxShadows.push(new Wx),this.refresh(),this.modifyBoxShadow()}},{key:jn("$add"),value:function(){this.trigger("add")}},{key:jn("$shadowList .remove"),value:function(t){var e=+t.$dt.attr("data-index");this.state.boxShadows.splice(e,1),this.refresh(),this.modifyBoxShadow(),this.emit("hideBoxShadowPropertyPopup")}},{key:jn("$shadowList .shadow-item.real > div:not(.tools)"),value:function(t){var e=+t.$dt.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:Do("changeBoxShadowEditorColor"),value:function(t){this.trigger("changeBoxShadowEditorPopup",{color:t})}},{key:Do("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())}}}])&&UV(e.prototype,n),r&&UV(e,r),i}(Ao);function tM(t){return(tM="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 eM(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(t)))return;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(t,e){if(!t)return;if("string"==typeof t)return nM(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);"Object"===n&&t.constructor&&(n=t.constructor.name);if("Map"===n||"Set"===n)return Array.from(t);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return nM(t,e)}(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function nM(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n\n ").concat(e?'"):"","\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(){this.load()}},{key:pr("$options"),value:function(){return{"data-count":this.state.options.length.toString()}}},{key:ur("$options"),value:function(){var t=this;return this.state.options.map((function(e){var n=e;if((o=e).includes(t.state.keyValueChar)){var r=eM(o.split(t.state.keyValueChar),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:An("$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)}}])&&oM(e.prototype,n),r&&oM(e,r),i}(Ao);function lM(t){return(lM="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 fM(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function pM(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function yM(t,e){for(var n=0;n"}},{key:"refresh",value:function(){this.load()}},{key:ur("$body"),value:function(){var t=this.state,e=t.min,n=t.max,r=t.step,o=t.label,i=t.removable,a=t.layout,c=+this.state.value.value.toString();isNaN(c)&&(c=0);var u=a,s=(+c).toString(),l=this.state.units.split(",").map((function(t){var e=t;return"number"===e&&(e=""),"".concat(t,":").concat(e)})).join(",");return"\n
\n ").concat(o?'"):"","\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:ln.parse(t)})}},{key:Vn("$propertyNumber"),value:function(t){this.refs.$rangeArea.addClass("focused")}},{key:Ln("$propertyNumber"),value:function(t){this.refs.$rangeArea.removeClass("focused")}},{key:jn("$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:"initValue",value:function(){""==this.state.value&&(this.state.value=new ln(0,this.children.$unit.getValue()))}},{key:In("$propertyNumber"),value:function(t){var e=+this.getRef("$propertyNumber").value;this.getRef("$property").val(e),this.initValue(),this.updateData({value:new ln(e,this.children.$unit.getValue())})}},{key:In("$property"),value:function(t){var e=+this.getRef("$property").value;this.refs.$propertyNumber.val(e),this.initValue(),this.updateData({value:new ln(e,this.children.$unit.getValue())})}},{key:Do("changeUnit"),value:function(t,e){this.initValue(),this.updateData({value:this.state.value.toUnit(e)})}}])&&yM(e.prototype,n),r&&yM(e,r),i}(Ao);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 wM(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function OM(t,e){for(var n=0;n"}},{key:Do("changeBorderRadius"),value:function(t,e){var n=this;"border-radius"===t&&RM.forEach((function(t){n.children["$".concat(t)].setValue(e.clone())})),this.setBorderRadius()}},{key:ur("$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