(self.webpackChunkant_design_pro=self.webpackChunkant_design_pro||[]).push([[99680],{90631:function(Ue,wt,Ft){"use strict";Ft.d(wt,{Z:function(){return g}});var tt=Ft(28991),vt=Ft(67294),st={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M505.7 661a8 8 0 0012.6 0l112-141.7c4.1-5.2.4-12.9-6.3-12.9h-74.1V168c0-4.4-3.6-8-8-8h-60c-4.4 0-8 3.6-8 8v338.3H400c-6.7 0-10.4 7.7-6.3 12.9l112 141.8zM878 626h-60c-4.4 0-8 3.6-8 8v154H214V634c0-4.4-3.6-8-8-8h-60c-4.4 0-8 3.6-8 8v198c0 17.7 14.3 32 32 32h684c17.7 0 32-14.3 32-32V634c0-4.4-3.6-8-8-8z"}}]},name:"download",theme:"outlined"},yt=st,_=Ft(27029),z=function(f,c){return vt.createElement(_.Z,(0,tt.Z)((0,tt.Z)({},f),{},{ref:c,icon:yt}))};z.displayName="DownloadOutlined";var g=vt.forwardRef(z)},92104:function(Ue,wt,Ft){"use strict";Ft.d(wt,{Z:function(){return g}});var tt=Ft(28991),vt=Ft(67294),st={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M893.3 293.3L730.7 130.7c-7.5-7.5-16.7-13-26.7-16V112H144c-17.7 0-32 14.3-32 32v736c0 17.7 14.3 32 32 32h736c17.7 0 32-14.3 32-32V338.5c0-17-6.7-33.2-18.7-45.2zM384 184h256v104H384V184zm456 656H184V184h136v136c0 17.7 14.3 32 32 32h320c17.7 0 32-14.3 32-32V205.8l136 136V840zM512 442c-79.5 0-144 64.5-144 144s64.5 144 144 144 144-64.5 144-144-64.5-144-144-144zm0 224c-44.2 0-80-35.8-80-80s35.8-80 80-80 80 35.8 80 80-35.8 80-80 80z"}}]},name:"save",theme:"outlined"},yt=st,_=Ft(27029),z=function(f,c){return vt.createElement(_.Z,(0,tt.Z)((0,tt.Z)({},f),{},{ref:c,icon:yt}))};z.displayName="SaveOutlined";var g=vt.forwardRef(z)},80262:function(Ue,wt,Ft){/*! For license information please see toastui-react-image-editor.js.LICENSE.txt */(function(){var tt={9406:function(_,z,g){_.exports=g(4877)},381:function(_,z,g){_.exports=g(5603)},8005:function(_,z,g){_.exports=g(4741)},7870:function(_,z,g){_.exports=g(4194)},7601:function(_,z,g){_.exports=g(2854)},651:function(_,z,g){_.exports=g(2)},2461:function(_,z,g){_.exports=g(5636)},9146:function(_,z,g){_.exports=g(5279)},6623:function(_,z,g){_.exports=g(9297)},7077:function(_,z,g){_.exports=g(8026)},9856:function(_,z,g){_.exports=g(2044)},4230:function(_,z,g){_.exports=g(2214)},184:function(_,z,g){_.exports=g(9256)},3742:function(_,z,g){_.exports=g(5659)},6135:function(_,z,g){g(9106);var x=g(5607);_.exports=x("Array").concat},3971:function(_,z,g){g(3436);var x=g(5607);_.exports=x("Array").filter},2671:function(_,z,g){g(5818);var x=g(5607);_.exports=x("Array").slice},1484:function(_,z,g){var x=g(6135),f=Array.prototype;_.exports=function(c){var I=c.concat;return c===f||c instanceof Array&&I===f.concat?x:I}},3669:function(_,z,g){var x=g(3971),f=Array.prototype;_.exports=function(c){var I=c.filter;return c===f||c instanceof Array&&I===f.filter?x:I}},7663:function(_,z,g){var x=g(2671),f=Array.prototype;_.exports=function(c){var I=c.slice;return c===f||c instanceof Array&&I===f.slice?x:I}},3213:function(_,z,g){g(3113);var x=g(7545).Object;_.exports=function(f,c){return x.create(f,c)}},3512:function(_,z,g){g(297);var x=g(7545).Object,f=_.exports=function(c,I,M){return x.defineProperty(c,I,M)};x.defineProperty.sham&&(f.sham=!0)},632:function(_,z,g){g(9189);var x=g(7545).Object,f=_.exports=function(c,I){return x.getOwnPropertyDescriptor(c,I)};x.getOwnPropertyDescriptor.sham&&(f.sham=!0)},1056:function(_,z,g){g(2509);var x=g(7545);_.exports=x.Object.getOwnPropertyDescriptors},2921:function(_,z,g){g(6187);var x=g(7545);_.exports=x.Object.getOwnPropertySymbols},8168:function(_,z,g){g(9234);var x=g(7545);_.exports=x.Object.getPrototypeOf},8651:function(_,z,g){g(2647);var x=g(7545);_.exports=x.Object.keys},3083:function(_,z,g){g(3222);var x=g(7545);_.exports=x.Object.setPrototypeOf},6577:function(_,z,g){g(5397);var x=g(7545);_.exports=x.Reflect.construct},5008:function(_,z,g){g(9106),g(6663),g(6187),g(9781),g(492),g(6681),g(9594),g(3665),g(9017),g(1250),g(9786),g(503),g(6565),g(9322),g(3610),g(6886),g(3514),g(8671),g(8556),g(1367);var x=g(7545);_.exports=x.Symbol},994:function(_,z,g){g(8939),g(6663),g(5454),g(3665);var x=g(9207);_.exports=x.f("iterator")},9297:function(_,z,g){var x=g(4963);_.exports=x},8026:function(_,z,g){var x=g(7820);_.exports=x},2044:function(_,z,g){var x=g(8980);_.exports=x},2214:function(_,z,g){var x=g(6672);_.exports=x},9256:function(_,z,g){var x=g(2285);g(177),g(9031),g(6658),g(1875),g(8658),g(4592),g(6680),_.exports=x},5659:function(_,z,g){var x=g(8535);_.exports=x},6235:function(_,z,g){var x=g(6447),f=g(9288);_.exports=function(c){if(x(c))return c;throw TypeError(f(c)+" is not a function")}},1404:function(_,z,g){var x=g(2091),f=g(9288);_.exports=function(c){if(x(c))return c;throw TypeError(f(c)+" is not a constructor")}},7757:function(_,z,g){var x=g(6447);_.exports=function(f){if(typeof f=="object"||x(f))return f;throw TypeError("Can't set "+String(f)+" as a prototype")}},7423:function(_){_.exports=function(){}},1138:function(_,z,g){var x=g(5744);_.exports=function(f){if(x(f))return f;throw TypeError(String(f)+" is not an object")}},8180:function(_,z,g){var x=g(101),f=g(7739),c=g(4104),I=function(M){return function(D,P,j){var p,a=x(D),d=c(a),u=f(j,d);if(M&&P!=P){for(;d>u;)if((p=a[u++])!=p)return!0}else for(;d>u;u++)if((M||u in a)&&a[u]===P)return M||u||0;return!M&&-1}};_.exports={includes:I(!0),indexOf:I(!1)}},454:function(_,z,g){var x=g(8043),f=g(2202),c=g(1795),I=g(4104),M=g(1321),D=[].push,P=function(j){var p=j==1,a=j==2,d=j==3,u=j==4,t=j==6,e=j==7,i=j==5||t;return function(s,m,o,y){for(var C,b,E=c(s),O=f(E),L=x(m,o,3),N=I(O),B=0,Y=y||M,nt=p?Y(s,N):a||e?Y(s,0):void 0;N>B;B++)if((i||B in O)&&(b=L(C=O[B],B,E),j))if(p)nt[B]=b;else if(b)switch(j){case 3:return!0;case 5:return C;case 6:return B;case 2:D.call(nt,C)}else switch(j){case 4:return!1;case 7:D.call(nt,C)}return t?-1:d||u?u:nt}};_.exports={forEach:P(0),map:P(1),filter:P(2),some:P(3),every:P(4),find:P(5),findIndex:P(6),filterReject:P(7)}},242:function(_,z,g){var x=g(6192),f=g(8182),c=g(4218),I=f("species");_.exports=function(M){return c>=51||!x(function(){var D=[];return(D.constructor={})[I]=function(){return{foo:1}},D[M](Boolean).foo!==1})}},3712:function(_,z,g){var x=g(4770),f=g(2091),c=g(5744),I=g(8182)("species");_.exports=function(M){var D;return x(M)&&(D=M.constructor,(f(D)&&(D===Array||x(D.prototype))||c(D)&&(D=D[I])===null)&&(D=void 0)),D===void 0?Array:D}},1321:function(_,z,g){var x=g(3712);_.exports=function(f,c){return new(x(f))(c===0?0:c)}},9272:function(_){var z={}.toString;_.exports=function(g){return z.call(g).slice(8,-1)}},4696:function(_,z,g){var x=g(3471),f=g(6447),c=g(9272),I=g(8182)("toStringTag"),M=c(function(){return arguments}())=="Arguments";_.exports=x?c:function(D){var P,j,p;return D===void 0?"Undefined":D===null?"Null":typeof(j=function(a,d){try{return a[d]}catch(u){}}(P=Object(D),I))=="string"?j:M?c(P):(p=c(P))=="Object"&&f(P.callee)?"Arguments":p}},4635:function(_,z,g){var x=g(6192);_.exports=!x(function(){function f(){}return f.prototype.constructor=null,Object.getPrototypeOf(new f)!==f.prototype})},5148:function(_,z,g){"use strict";var x=g(4413).IteratorPrototype,f=g(2853),c=g(774),I=g(1284),M=g(7771),D=function(){return this};_.exports=function(P,j,p){var a=j+" Iterator";return P.prototype=f(x,{next:c(1,p)}),I(P,a,!1,!0),M[a]=D,P}},8711:function(_,z,g){var x=g(69),f=g(2760),c=g(774);_.exports=x?function(I,M,D){return f.f(I,M,c(1,D))}:function(I,M,D){return I[M]=D,I}},774:function(_){_.exports=function(z,g){return{enumerable:!(1&z),configurable:!(2&z),writable:!(4&z),value:g}}},9361:function(_,z,g){"use strict";var x=g(77),f=g(2760),c=g(774);_.exports=function(I,M,D){var P=x(M);P in I?f.f(I,P,c(0,D)):I[P]=D}},7218:function(_,z,g){"use strict";var x=g(3085),f=g(5546),c=g(2282),I=g(6447),M=g(5148),D=g(9341),P=g(4469),j=g(1284),p=g(8711),a=g(9482),d=g(8182),u=g(7771),t=g(4413),e=c.PROPER,i=c.CONFIGURABLE,s=t.IteratorPrototype,m=t.BUGGY_SAFARI_ITERATORS,o=d("iterator"),y="keys",C="values",b="entries",E=function(){return this};_.exports=function(O,L,N,B,Y,nt,it){M(N,L,B);var Mt,K,It,U=function(G){if(G===Y&&q)return q;if(!m&&G in Nt)return Nt[G];switch(G){case y:case C:case b:return function(){return new N(this,G)}}return function(){return new N(this)}},Lt=L+" Iterator",dt=!1,Nt=O.prototype,V=Nt[o]||Nt["@@iterator"]||Y&&Nt[Y],q=!m&&V||U(Y),Q=L=="Array"&&Nt.entries||V;if(Q&&(Mt=D(Q.call(new O)))!==Object.prototype&&Mt.next&&(f||D(Mt)===s||(P?P(Mt,s):I(Mt[o])||a(Mt,o,E)),j(Mt,Lt,!0,!0),f&&(u[Lt]=E)),e&&Y==C&&V&&V.name!==C&&(!f&&i?p(Nt,"name",C):(dt=!0,q=function(){return V.call(this)})),Y)if(K={values:U(C),keys:nt?q:U(y),entries:U(b)},it)for(It in K)(m||dt||!(It in Nt))&&a(Nt,It,K[It]);else x({target:L,proto:!0,forced:m||dt},K);return f&&!it||Nt[o]===q||a(Nt,o,q,{name:Y}),u[L]=q,K}},1488:function(_,z,g){var x=g(7545),f=g(4500),c=g(9207),I=g(2760).f;_.exports=function(M){var D=x.Symbol||(x.Symbol={});f(D,M)||I(D,M,{value:c.f(M)})}},69:function(_,z,g){var x=g(6192);_.exports=!x(function(){return Object.defineProperty({},1,{get:function(){return 7}})[1]!=7})},7449:function(_,z,g){var x=g(8576),f=g(5744),c=x.document,I=f(c)&&f(c.createElement);_.exports=function(M){return I?c.createElement(M):{}}},7365:function(_){_.exports={CSSRuleList:0,CSSStyleDeclaration:0,CSSValueList:0,ClientRectList:0,DOMRectList:0,DOMStringList:0,DOMTokenList:1,DataTransferItemList:0,FileList:0,HTMLAllCollection:0,HTMLCollection:0,HTMLFormElement:0,HTMLSelectElement:0,MediaList:0,MimeTypeArray:0,NamedNodeMap:0,NodeList:1,PaintRequestList:0,Plugin:0,PluginArray:0,SVGLengthList:0,SVGNumberList:0,SVGPathSegList:0,SVGPointList:0,SVGStringList:0,SVGTransformList:0,SourceBufferList:0,StyleSheetList:0,TextTrackCueList:0,TextTrackList:0,TouchList:0}},8989:function(_,z,g){var x=g(150);_.exports=x("navigator","userAgent")||""},4218:function(_,z,g){var x,f,c=g(8576),I=g(8989),M=c.process,D=c.Deno,P=M&&M.versions||D&&D.version,j=P&&P.v8;j?f=(x=j.split("."))[0]<4?1:x[0]+x[1]:I&&(!(x=I.match(/Edge\/(\d+)/))||x[1]>=74)&&(x=I.match(/Chrome\/(\d+)/))&&(f=x[1]),_.exports=f&&+f},5607:function(_,z,g){var x=g(7545);_.exports=function(f){return x[f+"Prototype"]}},2952:function(_){_.exports=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"]},3085:function(_,z,g){"use strict";var x=g(8576),f=g(6447),c=g(5141).f,I=g(9245),M=g(7545),D=g(8043),P=g(8711),j=g(4500),p=function(a){var d=function(u,t,e){if(this instanceof a){switch(arguments.length){case 0:return new a;case 1:return new a(u);case 2:return new a(u,t)}return new a(u,t,e)}return a.apply(this,arguments)};return d.prototype=a.prototype,d};_.exports=function(a,d){var u,t,e,i,s,m,o,y,C=a.target,b=a.global,E=a.stat,O=a.proto,L=b?x:E?x[C]:(x[C]||{}).prototype,N=b?M:M[C]||P(M,C,{})[C],B=N.prototype;for(e in d)u=!I(b?e:C+(E?".":"#")+e,a.forced)&&L&&j(L,e),s=N[e],u&&(m=a.noTargetGet?(y=c(L,e))&&y.value:L[e]),i=u&&m?m:d[e],u&&typeof s==typeof i||(o=a.bind&&u?D(i,x):a.wrap&&u?p(i):O&&f(i)?D(Function.call,i):i,(a.sham||i&&i.sham||s&&s.sham)&&P(o,"sham",!0),P(N,e,o),O&&(j(M,t=C+"Prototype")||P(M,t,{}),P(M[t],e,i),a.real&&B&&!B[e]&&P(B,e,i)))}},6192:function(_){_.exports=function(z){try{return!!z()}catch(g){return!0}}},8043:function(_,z,g){var x=g(6235);_.exports=function(f,c,I){if(x(f),c===void 0)return f;switch(I){case 0:return function(){return f.call(c)};case 1:return function(M){return f.call(c,M)};case 2:return function(M,D){return f.call(c,M,D)};case 3:return function(M,D,P){return f.call(c,M,D,P)}}return function(){return f.apply(c,arguments)}}},6782:function(_,z,g){"use strict";var x=g(6235),f=g(5744),c=[].slice,I={},M=function(D,P,j){if(!(P in I)){for(var p=[],a=0;a"+t+""},d=function(t){t.write(a("")),t.close();var e=t.parentWindow.Object;return t=null,e},u=function(){try{x=new ActiveXObject("htmlfile")}catch(s){}var t,e;u=typeof document!="undefined"?document.domain&&x?d(x):((e=P("iframe")).style.display="none",D.appendChild(e),e.src=String("javascript:"),(t=e.contentWindow.document).open(),t.write(a("document.F=Object")),t.close(),t.F):d(x);for(var i=I.length;i--;)delete u.prototype[I[i]];return u()};M[j]=!0,_.exports=Object.create||function(t,e){var i;return t!==null?(p.prototype=f(t),i=new p,p.prototype=null,i[j]=t):i=u(),e===void 0?i:c(i,e)}},1187:function(_,z,g){var x=g(69),f=g(2760),c=g(1138),I=g(7653);_.exports=x?Object.defineProperties:function(M,D){c(M);for(var P,j=I(D),p=j.length,a=0;p>a;)f.f(M,P=j[a++],D[P]);return M}},2760:function(_,z,g){var x=g(69),f=g(188),c=g(1138),I=g(77),M=Object.defineProperty;z.f=x?M:function(D,P,j){if(c(D),P=I(P),c(j),f)try{return M(D,P,j)}catch(p){}if("get"in j||"set"in j)throw TypeError("Accessors not supported");return"value"in j&&(D[P]=j.value),D}},5141:function(_,z,g){var x=g(69),f=g(6007),c=g(774),I=g(101),M=g(77),D=g(4500),P=g(188),j=Object.getOwnPropertyDescriptor;z.f=x?j:function(p,a){if(p=I(p),a=M(a),P)try{return j(p,a)}catch(d){}if(D(p,a))return c(!f.f.call(p,a),p[a])}},4052:function(_,z,g){var x=g(101),f=g(2092).f,c={}.toString,I=typeof window=="object"&&window&&Object.getOwnPropertyNames?Object.getOwnPropertyNames(window):[];_.exports.f=function(M){return I&&c.call(M)=="[object Window]"?function(D){try{return f(D)}catch(P){return I.slice()}}(M):f(x(M))}},2092:function(_,z,g){var x=g(7934),f=g(2952).concat("length","prototype");z.f=Object.getOwnPropertyNames||function(c){return x(c,f)}},4750:function(_,z){z.f=Object.getOwnPropertySymbols},9341:function(_,z,g){var x=g(4500),f=g(6447),c=g(1795),I=g(9766),M=g(4635),D=I("IE_PROTO"),P=Object.prototype;_.exports=M?Object.getPrototypeOf:function(j){var p=c(j);if(x(p,D))return p[D];var a=p.constructor;return f(a)&&p instanceof a?a.prototype:p instanceof Object?P:null}},7934:function(_,z,g){var x=g(4500),f=g(101),c=g(8180).indexOf,I=g(4535);_.exports=function(M,D){var P,j=f(M),p=0,a=[];for(P in j)!x(I,P)&&x(j,P)&&a.push(P);for(;D.length>p;)x(j,P=D[p++])&&(~c(a,P)||a.push(P));return a}},7653:function(_,z,g){var x=g(7934),f=g(2952);_.exports=Object.keys||function(c){return x(c,f)}},6007:function(_,z){"use strict";var g={}.propertyIsEnumerable,x=Object.getOwnPropertyDescriptor,f=x&&!g.call({1:2},1);z.f=f?function(c){var I=x(this,c);return!!I&&I.enumerable}:g},4469:function(_,z,g){var x=g(1138),f=g(7757);_.exports=Object.setPrototypeOf||("__proto__"in{}?function(){var c,I=!1,M={};try{(c=Object.getOwnPropertyDescriptor(Object.prototype,"__proto__").set).call(M,[]),I=M instanceof Array}catch(D){}return function(D,P){return x(D),f(P),I?c.call(D,P):D.__proto__=P,D}}():void 0)},158:function(_,z,g){"use strict";var x=g(3471),f=g(4696);_.exports=x?{}.toString:function(){return"[object "+f(this)+"]"}},380:function(_,z,g){var x=g(6447),f=g(5744);_.exports=function(c,I){var M,D;if(I==="string"&&x(M=c.toString)&&!f(D=M.call(c))||x(M=c.valueOf)&&!f(D=M.call(c))||I!=="string"&&x(M=c.toString)&&!f(D=M.call(c)))return D;throw TypeError("Can't convert object to primitive value")}},3011:function(_,z,g){var x=g(150),f=g(2092),c=g(4750),I=g(1138);_.exports=x("Reflect","ownKeys")||function(M){var D=f.f(I(M)),P=c.f;return P?D.concat(P(M)):D}},7545:function(_){_.exports={}},9482:function(_,z,g){var x=g(8711);_.exports=function(f,c,I,M){M&&M.enumerable?f[c]=I:x(f,c,I)}},3209:function(_){_.exports=function(z){if(z==null)throw TypeError("Can't call method on "+z);return z}},7613:function(_,z,g){var x=g(8576);_.exports=function(f,c){try{Object.defineProperty(x,f,{value:c,configurable:!0,writable:!0})}catch(I){x[f]=c}return c}},1284:function(_,z,g){var x=g(3471),f=g(2760).f,c=g(8711),I=g(4500),M=g(158),D=g(8182)("toStringTag");_.exports=function(P,j,p,a){if(P){var d=p?P:P.prototype;I(d,D)||f(d,D,{configurable:!0,value:j}),a&&!x&&c(d,"toString",M)}}},9766:function(_,z,g){var x=g(8717),f=g(2759),c=x("keys");_.exports=function(I){return c[I]||(c[I]=f(I))}},6434:function(_,z,g){var x=g(8576),f=g(7613),c="__core-js_shared__",I=x[c]||f(c,{});_.exports=I},8717:function(_,z,g){var x=g(5546),f=g(6434);(_.exports=function(c,I){return f[c]||(f[c]=I!==void 0?I:{})})("versions",[]).push({version:"3.18.2",mode:x?"pure":"global",copyright:"\xA9 2021 Denis Pushkarev (zloirock.ru)"})},863:function(_,z,g){var x=g(1941),f=g(4845),c=g(3209),I=function(M){return function(D,P){var j,p,a=f(c(D)),d=x(P),u=a.length;return d<0||d>=u?M?"":void 0:(j=a.charCodeAt(d))<55296||j>56319||d+1===u||(p=a.charCodeAt(d+1))<56320||p>57343?M?a.charAt(d):j:M?a.slice(d,d+2):p-56320+(j-55296<<10)+65536}};_.exports={codeAt:I(!1),charAt:I(!0)}},7739:function(_,z,g){var x=g(1941),f=Math.max,c=Math.min;_.exports=function(I,M){var D=x(I);return D<0?f(D+M,0):c(D,M)}},101:function(_,z,g){var x=g(2202),f=g(3209);_.exports=function(c){return x(f(c))}},1941:function(_){var z=Math.ceil,g=Math.floor;_.exports=function(x){var f=+x;return f!=f||f===0?0:(f>0?g:z)(f)}},8445:function(_,z,g){var x=g(1941),f=Math.min;_.exports=function(c){return c>0?f(x(c),9007199254740991):0}},1795:function(_,z,g){var x=g(3209);_.exports=function(f){return Object(x(f))}},7888:function(_,z,g){var x=g(5744),f=g(3236),c=g(5037),I=g(380),M=g(8182)("toPrimitive");_.exports=function(D,P){if(!x(D)||f(D))return D;var j,p=c(D,M);if(p){if(P===void 0&&(P="default"),j=p.call(D,P),!x(j)||f(j))return j;throw TypeError("Can't convert object to primitive value")}return P===void 0&&(P="number"),I(D,P)}},77:function(_,z,g){var x=g(7888),f=g(3236);_.exports=function(c){var I=x(c,"string");return f(I)?I:String(I)}},3471:function(_,z,g){var x={};x[g(8182)("toStringTag")]="z",_.exports=String(x)==="[object z]"},4845:function(_,z,g){var x=g(4696);_.exports=function(f){if(x(f)==="Symbol")throw TypeError("Cannot convert a Symbol value to a string");return String(f)}},9288:function(_){_.exports=function(z){try{return String(z)}catch(g){return"Object"}}},2759:function(_){var z=0,g=Math.random();_.exports=function(x){return"Symbol("+String(x===void 0?"":x)+")_"+(++z+g).toString(36)}},615:function(_,z,g){var x=g(3045);_.exports=x&&!Symbol.sham&&typeof Symbol.iterator=="symbol"},9207:function(_,z,g){var x=g(8182);z.f=x},8182:function(_,z,g){var x=g(8576),f=g(8717),c=g(4500),I=g(2759),M=g(3045),D=g(615),P=f("wks"),j=x.Symbol,p=D?j:j&&j.withoutSetter||I;_.exports=function(a){return c(P,a)&&(M||typeof P[a]=="string")||(M&&c(j,a)?P[a]=j[a]:P[a]=p("Symbol."+a)),P[a]}},9106:function(_,z,g){"use strict";var x=g(3085),f=g(6192),c=g(4770),I=g(5744),M=g(1795),D=g(4104),P=g(9361),j=g(1321),p=g(242),a=g(8182),d=g(4218),u=a("isConcatSpreadable"),t=9007199254740991,e="Maximum allowed index exceeded",i=d>=51||!f(function(){var o=[];return o[u]=!1,o.concat()[0]!==o}),s=p("concat"),m=function(o){if(!I(o))return!1;var y=o[u];return y!==void 0?!!y:c(o)};x({target:"Array",proto:!0,forced:!i||!s},{concat:function(o){var y,C,b,E,O,L=M(this),N=j(L,0),B=0;for(y=-1,b=arguments.length;yt)throw TypeError(e);for(C=0;C=t)throw TypeError(e);P(N,B++,O)}return N.length=B,N}})},3436:function(_,z,g){"use strict";var x=g(3085),f=g(454).filter;x({target:"Array",proto:!0,forced:!g(242)("filter")},{filter:function(c){return f(this,c,arguments.length>1?arguments[1]:void 0)}})},8939:function(_,z,g){"use strict";var x=g(101),f=g(7423),c=g(7771),I=g(3326),M=g(7218),D="Array Iterator",P=I.set,j=I.getterFor(D);_.exports=M(Array,"Array",function(p,a){P(this,{type:D,target:x(p),index:0,kind:a})},function(){var p=j(this),a=p.target,d=p.kind,u=p.index++;return!a||u>=a.length?(p.target=void 0,{value:void 0,done:!0}):d=="keys"?{value:u,done:!1}:d=="values"?{value:a[u],done:!1}:{value:[u,a[u]],done:!1}},"values"),c.Arguments=c.Array,f("keys"),f("values"),f("entries")},5818:function(_,z,g){"use strict";var x=g(3085),f=g(4770),c=g(2091),I=g(5744),M=g(7739),D=g(4104),P=g(101),j=g(9361),p=g(8182),a=g(242)("slice"),d=p("species"),u=[].slice,t=Math.max;x({target:"Array",proto:!0,forced:!a},{slice:function(e,i){var s,m,o,y=P(this),C=D(y),b=M(e,C),E=M(i===void 0?C:i,C);if(f(y)&&(s=y.constructor,(c(s)&&(s===Array||f(s.prototype))||I(s)&&(s=s[d])===null)&&(s=void 0),s===Array||s===void 0))return u.call(y,b,E);for(m=new(s===void 0?Array:s)(t(E-b,0)),o=0;be;)(p=d(a,j=u[e++]))!==void 0&&D(t,j,p);return t}})},9234:function(_,z,g){var x=g(3085),f=g(6192),c=g(1795),I=g(9341),M=g(4635);x({target:"Object",stat:!0,forced:f(function(){I(1)}),sham:!M},{getPrototypeOf:function(D){return I(c(D))}})},2647:function(_,z,g){var x=g(3085),f=g(1795),c=g(7653);x({target:"Object",stat:!0,forced:g(6192)(function(){c(1)})},{keys:function(I){return c(f(I))}})},3222:function(_,z,g){g(3085)({target:"Object",stat:!0},{setPrototypeOf:g(4469)})},6663:function(){},5397:function(_,z,g){var x=g(3085),f=g(150),c=g(1404),I=g(1138),M=g(5744),D=g(2853),P=g(6782),j=g(6192),p=f("Reflect","construct"),a=j(function(){function t(){}return!(p(function(){},[],t)instanceof t)}),d=!j(function(){p(function(){})}),u=a||d;x({target:"Reflect",stat:!0,forced:u,sham:u},{construct:function(t,e){c(t),I(e);var i=arguments.length<3?t:c(arguments[2]);if(d&&!a)return p(t,e,i);if(t==i){switch(e.length){case 0:return new t;case 1:return new t(e[0]);case 2:return new t(e[0],e[1]);case 3:return new t(e[0],e[1],e[2]);case 4:return new t(e[0],e[1],e[2],e[3])}var s=[null];return s.push.apply(s,e),new(P.apply(t,s))}var m=i.prototype,o=D(M(m)?m:Object.prototype),y=Function.apply.call(t,o,e);return M(y)?y:o}})},1367:function(){},5454:function(_,z,g){"use strict";var x=g(863).charAt,f=g(4845),c=g(3326),I=g(7218),M="String Iterator",D=c.set,P=c.getterFor(M);I(String,"String",function(j){D(this,{type:M,string:f(j),index:0})},function(){var j,p=P(this),a=p.string,d=p.index;return d>=a.length?{value:void 0,done:!0}:(j=x(a,d),p.index+=j.length,{value:j,done:!1})})},9781:function(_,z,g){g(1488)("asyncIterator")},492:function(){},6681:function(_,z,g){g(1488)("hasInstance")},9594:function(_,z,g){g(1488)("isConcatSpreadable")},3665:function(_,z,g){g(1488)("iterator")},6187:function(_,z,g){"use strict";var x=g(3085),f=g(8576),c=g(150),I=g(5546),M=g(69),D=g(3045),P=g(6192),j=g(4500),p=g(4770),a=g(6447),d=g(5744),u=g(3236),t=g(1138),e=g(1795),i=g(101),s=g(77),m=g(4845),o=g(774),y=g(2853),C=g(7653),b=g(2092),E=g(4052),O=g(4750),L=g(5141),N=g(2760),B=g(6007),Y=g(9482),nt=g(8717),it=g(9766),Mt=g(4535),K=g(2759),It=g(8182),U=g(9207),Lt=g(1488),dt=g(1284),Nt=g(3326),V=g(454).forEach,q=it("hidden"),Q="Symbol",G=It("toPrimitive"),rt=Nt.set,F=Nt.getterFor(Q),W=Object.prototype,X=f.Symbol,Z=c("JSON","stringify"),gt=L.f,ht=N.f,bt=E.f,Tt=B.f,xt=nt("symbols"),at=nt("op-symbols"),$=nt("string-to-symbol-registry"),et=nt("symbol-to-string-registry"),ct=nt("wks"),ft=f.QObject,Ct=!ft||!ft.prototype||!ft.prototype.findChild,_t=M&&P(function(){return y(ht({},"a",{get:function(){return ht(this,"a",{value:7}).a}})).a!=7})?function(Wt,Gt,$t){var ne=gt(W,Gt);ne&&delete W[Gt],ht(Wt,Gt,$t),ne&&Wt!==W&&ht(W,Gt,ne)}:ht,Zt=function(Wt,Gt){var $t=xt[Wt]=y(X.prototype);return rt($t,{type:Q,tag:Wt,description:Gt}),M||($t.description=Gt),$t},Xt=function(Wt,Gt,$t){Wt===W&&Xt(at,Gt,$t),t(Wt);var ne=s(Gt);return t($t),j(xt,ne)?($t.enumerable?(j(Wt,q)&&Wt[q][ne]&&(Wt[q][ne]=!1),$t=y($t,{enumerable:o(0,!1)})):(j(Wt,q)||ht(Wt,q,o(1,{})),Wt[q][ne]=!0),_t(Wt,ne,$t)):ht(Wt,ne,$t)},St=function(Wt,Gt){t(Wt);var $t=i(Gt),ne=C($t).concat(ve($t));return V(ne,function(ce){M&&!Jt.call($t,ce)||Xt(Wt,ce,$t[ce])}),Wt},Jt=function(Wt){var Gt=s(Wt),$t=Tt.call(this,Gt);return!(this===W&&j(xt,Gt)&&!j(at,Gt))&&(!($t||!j(this,Gt)||!j(xt,Gt)||j(this,q)&&this[q][Gt])||$t)},Kt=function(Wt,Gt){var $t=i(Wt),ne=s(Gt);if($t!==W||!j(xt,ne)||j(at,ne)){var ce=gt($t,ne);return!ce||!j(xt,ne)||j($t,q)&&$t[q][ne]||(ce.enumerable=!0),ce}},ae=function(Wt){var Gt=bt(i(Wt)),$t=[];return V(Gt,function(ne){j(xt,ne)||j(Mt,ne)||$t.push(ne)}),$t},ve=function(Wt){var Gt=Wt===W,$t=bt(Gt?at:i(Wt)),ne=[];return V($t,function(ce){!j(xt,ce)||Gt&&!j(W,ce)||ne.push(xt[ce])}),ne};if(D||(X=function(){if(this instanceof X)throw TypeError("Symbol is not a constructor");var Wt=arguments.length&&arguments[0]!==void 0?m(arguments[0]):void 0,Gt=K(Wt),$t=function(ne){this===W&&$t.call(at,ne),j(this,q)&&j(this[q],Gt)&&(this[q][Gt]=!1),_t(this,Gt,o(1,ne))};return M&&Ct&&_t(W,Gt,{configurable:!0,set:$t}),Zt(Gt,Wt)},Y(X.prototype,"toString",function(){return F(this).tag}),Y(X,"withoutSetter",function(Wt){return Zt(K(Wt),Wt)}),B.f=Jt,N.f=Xt,L.f=Kt,b.f=E.f=ae,O.f=ve,U.f=function(Wt){return Zt(It(Wt),Wt)},M&&(ht(X.prototype,"description",{configurable:!0,get:function(){return F(this).description}}),I||Y(W,"propertyIsEnumerable",Jt,{unsafe:!0}))),x({global:!0,wrap:!0,forced:!D,sham:!D},{Symbol:X}),V(C(ct),function(Wt){Lt(Wt)}),x({target:Q,stat:!0,forced:!D},{for:function(Wt){var Gt=m(Wt);if(j($,Gt))return $[Gt];var $t=X(Gt);return $[Gt]=$t,et[$t]=Gt,$t},keyFor:function(Wt){if(!u(Wt))throw TypeError(Wt+" is not a symbol");if(j(et,Wt))return et[Wt]},useSetter:function(){Ct=!0},useSimple:function(){Ct=!1}}),x({target:"Object",stat:!0,forced:!D,sham:!M},{create:function(Wt,Gt){return Gt===void 0?y(Wt):St(y(Wt),Gt)},defineProperty:Xt,defineProperties:St,getOwnPropertyDescriptor:Kt}),x({target:"Object",stat:!0,forced:!D},{getOwnPropertyNames:ae,getOwnPropertySymbols:ve}),x({target:"Object",stat:!0,forced:P(function(){O.f(1)})},{getOwnPropertySymbols:function(Wt){return O.f(e(Wt))}}),Z&&x({target:"JSON",stat:!0,forced:!D||P(function(){var Wt=X();return Z([Wt])!="[null]"||Z({a:Wt})!="{}"||Z(Object(Wt))!="{}"})},{stringify:function(Wt,Gt,$t){for(var ne,ce=[Wt],Dt=1;arguments.length>Dt;)ce.push(arguments[Dt++]);if(ne=Gt,(d(Gt)||Wt!==void 0)&&!u(Wt))return p(Gt)||(Gt=function(kt,Ut){if(a(ne)&&(Ut=ne.call(this,kt,Ut)),!u(Ut))return Ut}),ce[1]=Gt,Z.apply(null,ce)}}),!X.prototype[G]){var ue=X.prototype.valueOf;Y(X.prototype,G,function(){return ue.apply(this,arguments)})}dt(X,Q),Mt[q]=!0},1250:function(_,z,g){g(1488)("matchAll")},9017:function(_,z,g){g(1488)("match")},9786:function(_,z,g){g(1488)("replace")},503:function(_,z,g){g(1488)("search")},6565:function(_,z,g){g(1488)("species")},9322:function(_,z,g){g(1488)("split")},3610:function(_,z,g){g(1488)("toPrimitive")},6886:function(_,z,g){g(1488)("toStringTag")},3514:function(_,z,g){g(1488)("unscopables")},177:function(_,z,g){g(1488)("asyncDispose")},9031:function(_,z,g){g(1488)("dispose")},6658:function(_,z,g){g(1488)("matcher")},1875:function(_,z,g){g(1488)("metadata")},8658:function(_,z,g){g(1488)("observable")},4592:function(_,z,g){g(1488)("patternMatch")},6680:function(_,z,g){g(1488)("replaceAll")},162:function(_,z,g){g(8939);var x=g(7365),f=g(8576),c=g(4696),I=g(8711),M=g(7771),D=g(8182)("toStringTag");for(var P in x){var j=f[P],p=j&&j.prototype;p&&c(p)!==D&&I(p,D,P),M[P]=M.Array}},4877:function(_,z,g){var x=g(1484);_.exports=x},5603:function(_,z,g){var x=g(3669);_.exports=x},4741:function(_,z,g){var x=g(7663);_.exports=x},4963:function(_,z,g){var x=g(3213);_.exports=x},7820:function(_,z,g){var x=g(3512);_.exports=x},4194:function(_,z,g){var x=g(632);_.exports=x},2854:function(_,z,g){var x=g(1056);_.exports=x},2:function(_,z,g){var x=g(2921);_.exports=x},8980:function(_,z,g){var x=g(8168);_.exports=x},5636:function(_,z,g){var x=g(8651);_.exports=x},6672:function(_,z,g){var x=g(3083);_.exports=x},5279:function(_,z,g){var x=g(6577);_.exports=x},2285:function(_,z,g){var x=g(5008);g(162),_.exports=x},8535:function(_,z,g){var x=g(994);g(162),_.exports=x}},vt={};function st(_){var z=vt[_];if(z!==void 0)return z.exports;var g=vt[_]={exports:{}};return tt[_](g,g.exports,st),g.exports}st.n=function(_){var z=_&&_.__esModule?function(){return _.default}:function(){return _};return st.d(z,{a:z}),z},st.d=function(_,z){for(var g in z)st.o(z,g)&&!st.o(_,g)&&Object.defineProperty(_,g,{enumerable:!0,get:z[g]})},st.g=function(){if(typeof globalThis=="object")return globalThis;try{return this||new Function("return this")()}catch(_){if(typeof window=="object")return window}}(),st.o=function(_,z){return Object.prototype.hasOwnProperty.call(_,z)},st.r=function(_){typeof Symbol!="undefined"&&Symbol.toStringTag&&Object.defineProperty(_,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(_,"__esModule",{value:!0})};var yt={};(function(){"use strict";st.r(yt),st.d(yt,{default:function(){return U}});var _=st(9146),z=st.n(_),g=st(651),x=st.n(g),f=st(7870),c=st.n(f),I=st(7601),M=st.n(I);function D(Lt,dt){if(!(Lt instanceof dt))throw new TypeError("Cannot call a class as a function")}var P=st(7077);function j(Lt,dt){for(var Nt=0;Nt{var L=O.common;return{common:L}}),u(t=class extends M.PureComponent{constructor(){super(...arguments);this.editorRef=M.createRef(),this.state={modelZindex:100,fullScreen:!1,current:1,total:0,target:{},getInfoLoading:!0,viewUrl:"",taskId:(0,a.fW)(),psddom:"",btnLoading:!1},this.getvideoinfo=()=>{var L=this,N=this.props,B=N.dispatch,Y=N.sourceID,nt=N.isyz,it=N.iframeUrl,Mt=it===void 0?"":it,K=N.common,It=N.path,U=It===void 0?"":It,Lt=N.yzViewData,dt=N.f,Nt=N.fileType,V=Nt===void 0?"":Nt,q=K.shareCode,Q=L.state.taskId;B({type:"common/getFilePreview",payload:{busType:"cloud",sourceID:Y,shareCode:q||void 0,view:q?1:void 0,path:U||void 0,f:dt},callback:G=>{var rt=G.data||{},F=rt,W=F.resolution||"",X=W?W.split("*"):[1e3,1e3],Z=parseInt(X[0]),gt=parseInt(X[1]);L.setState({fileInfo:rt,imageEditorOptions:{includeUI:{loadImage:{path:location.origin+F.downloadUrl,name:F.name},locale:e,theme:i,initMenu:"",menuBarPosition:"bottom"},cssMaxWidth:700,cssMaxHeight:600,usageStatistics:!1},getInfoLoading:!1},()=>{})}})},this.handleClickButton=()=>{var L=this,N=L.props.dispatch,B=L.state,Y=B.fileInfo,nt=B.taskID;L.setState({btnLoading:!0},()=>{setTimeout(function(){L.setState({btnLoading:!1})},3e3)});var it=this.editorRef.current.getInstance(),Mt=it.getImageName(),K=it.toDataURL(),It,U,Lt;if(o){It=C(K),U=It.type.split("/")[1],Mt.split(".").pop()!==U&&(Mt+="."+U);var dt=b(It,Mt);window.newVersionId=Y.sourceID,window.filesboxUploader.addFiles(dt),window.filesboxUploadSuccess=Nt=>{g.ZP.success("\u4FDD\u5B58\u6210\u529F")}}else g.ZP.error("\u6D4F\u89C8\u5668\u9700\u8981\u652F\u6301 file-server"),Lt=window.open(),Lt.document.body.innerHTML=''},this.handleClickButtonxx=()=>{var L=this.editorRef.current.getInstance(),N=L.getImageName(),B=L.toDataURL(),Y,nt,it;o?(Y=C(B),nt=Y.type.split("/")[1],N.split(".").pop()!==nt&&(N+="."+nt),saveAs(Y,N)):(g.ZP.error("\u6D4F\u89C8\u5668\u9700\u8981\u652F\u6301 file-server"),it=window.open(),it.document.body.innerHTML='')}}componentDidMount(){var L=this;L.getvideoinfo()}componentWillUnmount(){var L=this,N=this.props,B=N.dispatch,Y=N.sourceID,nt=N.isyz,it=N.iframeUrl,Mt=it===void 0?"":it,K=N.common,It=N.path,U=It===void 0?"":It,Lt=N.yzViewData,dt=K.shareCode}render(){var L=this,N=L.props,B=N.dispatch,Y=N.common,nt=N.open,it=N.setOpenModel,Mt=N.videoOption,K=N.isyz,It=N.iframeUrl,U=N.iframeName,Lt=U===void 0?"":U,dt=N.issmall,Nt=N.path,V=N.name,q=N.fileType,Q=N.isedit,G=N.f,rt=N.sourceID,F=N.showIndex,W=Y.shareCode,X=Y.showmodalList,Z=X===void 0?[]:X,gt=this.state,ht=gt.modelZindex,bt=gt.fileInfo,Tt=bt===void 0?{}:bt,xt=gt.fullScreen,at=gt.getInfoLoading,$=gt.viewUrl,et=gt.taskId,ct=gt.psddom,ft=gt.imageEditorOptions,Ct=gt.btnLoading,_t=Zt=>{L.setState({modelZindex:Zt})};return(0,d.jsx)(d.Fragment,{children:(0,d.jsx)(x.Z,{open:nt,issmall:dt,showIndex:F,modelZindex:ht,setOpenModel:it,setModelZindex:_t,type:"imgEditor",isFull:!!It,title:"\u56FE\u7247\u7F16\u8F91-"+V,children:(0,d.jsx)("div",{className:p().imgeditorBox,children:(0,d.jsxs)(vt.Z,{spinning:at,children:[!at&&(0,d.jsx)(P(),(0,_.Z)({ref:this.editorRef},ft)),(0,d.jsx)(yt.Z,{size:"large",icon:(0,d.jsx)(c.Z,{}),className:"saveBtn",loading:Ct,onClick:this.handleClickButton,children:"\u4FDD\u5B58"}),(0,d.jsx)(yt.Z,{size:"large",icon:(0,d.jsx)(I.Z,{}),type:"primary",className:"download",onClick:this.handleClickButtonxx,children:"\u4E0B\u8F7D"})]})})})})}})||t)},98525:function(Ue){/*! * TOAST UI Color Picker * @version 2.2.8 * @author NHN Cloud FE Development Team * @license MIT */(function(Ft,tt){Ue.exports=tt()})(window,function(){return function(wt){var Ft={};function tt(vt){if(Ft[vt])return Ft[vt].exports;var st=Ft[vt]={i:vt,l:!1,exports:{}};return wt[vt].call(st.exports,st,st.exports,tt),st.l=!0,st.exports}return tt.m=wt,tt.c=Ft,tt.d=function(vt,st,yt){tt.o(vt,st)||Object.defineProperty(vt,st,{enumerable:!0,get:yt})},tt.r=function(vt){typeof Symbol!="undefined"&&Symbol.toStringTag&&Object.defineProperty(vt,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(vt,"__esModule",{value:!0})},tt.t=function(vt,st){if(st&1&&(vt=tt(vt)),st&8||st&4&&typeof vt=="object"&&vt&&vt.__esModule)return vt;var yt=Object.create(null);if(tt.r(yt),Object.defineProperty(yt,"default",{enumerable:!0,value:vt}),st&2&&typeof vt!="string")for(var _ in vt)tt.d(yt,_,function(z){return vt[z]}.bind(null,_));return yt},tt.n=function(vt){var st=vt&&vt.__esModule?function(){return vt.default}:function(){return vt};return tt.d(st,"a",st),st},tt.o=function(vt,st){return Object.prototype.hasOwnProperty.call(vt,st)},tt.p="dist",tt(tt.s=33)}([function(wt,Ft,tt){"use strict";function vt(st,yt){var _=Object.prototype.hasOwnProperty,z,g,x,f;for(x=1,f=arguments.length;x=0&&g-1?M[D][1]+=1:M.push([I,1]))},c.prototype._forgetContext=function(I){var M,D;!st(I)||(M=this._safeContext(),D=this._indexOfContext(I),D>-1&&(M[D][1]-=1,M[D][1]<=0&&M.splice(D,1)))},c.prototype._bindEvent=function(I,M,D){var P=this._safeEvent(I);this._memorizeContext(D),P.push(this._getHandlerItem(M,D))},c.prototype.on=function(I,M,D){var P=this;yt(I)?(I=I.split(f),x(I,function(j){P._bindEvent(j,M,D)})):_(I)&&(D=M,x(I,function(j,p){P.on(p,j,D)}))},c.prototype.once=function(I,M,D){var P=this;if(_(I)){D=M,x(I,function(p,a){P.once(a,p,D)});return}function j(){M.apply(D,arguments),P.off(I,j,D)}this.on(I,j,D)},c.prototype._spliceMatches=function(I,M){var D=0,P;if(!!z(I))for(P=I.length;D0},c.prototype.getListenerLength=function(I){var M=this._safeEvent(I);return M.length},wt.exports=c},function(wt,Ft,tt){"use strict";function vt(st){return typeof st=="string"||st instanceof String}wt.exports=vt},function(wt,Ft,tt){"use strict";var vt=/(^#[0-9A-F]{6}$)|(^#[0-9A-F]{3}$)/i,st={leadingZero:function(yt,_){var z="",g=0;if((yt+"").length>_)return yt+"";for(;g<_-1;g+=1)z+="0";return(z+yt).slice(_*-1)},isValidRGB:function(yt){return vt.test(yt)},hexToRGB:function(yt){var _,z,g;return st.isValidRGB(yt)?(yt=yt.substring(1),_=parseInt(yt.substr(0,2),16),z=parseInt(yt.substr(2,2),16),g=parseInt(yt.substr(4,2),16),[_,z,g]):!1},rgbToHEX:function(yt,_,z){var g="#"+st.leadingZero(yt.toString(16),2)+st.leadingZero(_.toString(16),2)+st.leadingZero(z.toString(16),2);return st.isValidRGB(g)?g:!1},rgbToHSV:function(yt,_,z){var g,x,f,c,I,M;if(yt/=255,_/=255,z/=255,g=Math.max(yt,_,z),x=Math.min(yt,_,z),I=g,M=g-x,c=g===0?0:M/g,g===x)f=0;else{switch(g){case yt:f=(_-z)/M+(_1){vt(c.call(arguments),function(j){this.add(j)},this);return}D=this.getItemID(M),P=this.items,P[D]||(this.length+=1),P[D]=M},I.prototype.remove=function(M){var D=[],P,j;return this.length?arguments.length>1?(D=f.map(c.call(arguments),function(p){return this.remove(p)},this),D):(P=this.items,x(M)&&(M=this.getItemID(M)),P[M]?(this.length-=1,j=P[M],delete P[M],j):D):D},I.prototype.clear=function(){this.items={},this.length=0},I.prototype.has=function(M){var D,P;return this.length?(D=g(M),P=!1,D?this.each(function(j){return M(j)===!0?(P=!0,!1):!0}):(M=x(M)?this.getItemID(M):M,P=z(this.items[M])),P):!1},I.prototype.doWhenHas=function(M,D,P){var j=this.items[M];!z(j)||D.call(P||this,j)},I.prototype.find=function(M){var D=new I;return this.hasOwnProperty("getItemID")&&(D.getItemID=this.getItemID),this.each(function(P){M(P)===!0&&D.add(P)}),D},I.prototype.groupBy=function(M,D){var P={},j=g(M),p=this.getItemID,a,d;if(_(M)){if(vt(M,function(u){P[u+""]=new I(p)}),!D)return P;M=D,j=!0}return this.each(function(u){j?d=M(u):(d=u[M],g(d)&&(d=d.apply(u))),a=P[d],a||(a=P[d]=new I(p)),a.add(u)}),P},I.prototype.single=function(){var M;return this.each(function(D){return M=D,!1},this),M},I.prototype.sort=function(M){var D=[];return this.each(function(P){D.push(P)}),g(M)&&(D=D.sort(M)),D},I.prototype.each=function(M,D){st(this.items,M,D||this)},I.prototype.toArray=function(){return this.length?f.map(this.items,function(M){return M}):[]},wt.exports=I},function(wt,Ft,tt){"use strict";var vt=tt(3),st=tt(36);function yt(_){return!vt(_)&&!st(_)}wt.exports=yt},function(wt,Ft,tt){"use strict";function vt(st){return st===Object(st)}wt.exports=vt},function(wt,Ft,tt){"use strict";var vt={chrome:!1,firefox:!1,safari:!1,msie:!1,edge:!1,others:!1,version:0};typeof window!="undefined"&&window.navigator&&st();function st(){var yt=window.navigator,_=yt.appName.replace(/\s/g,"_"),z=yt.userAgent,g=/MSIE\s([0-9]+[.0-9]*)/,x=/Trident.*rv:11\./,f=/Edge\/(\d+)\./,c={firefox:/Firefox\/(\d+)\./,chrome:/Chrome\/(\d+)\./,safari:/Version\/([\d.]+).*Safari\/(\d+)/},I,M,D={Microsoft_Internet_Explorer:function(){var j=z.match(g);j?(vt.msie=!0,vt.version=parseFloat(j[1])):vt.others=!0},Netscape:function(){var j=!1;if(x.exec(z))vt.msie=!0,vt.version=11,j=!0;else if(f.exec(z))vt.edge=!0,vt.version=z.match(f)[1],j=!0;else for(I in c)if(c.hasOwnProperty(I)&&(M=z.match(c[I]),M&&M.length>1)){vt[I]=j=!0,vt.version=parseFloat(M[1]||0);break}j||(vt.others=!0)}},P=D[_];P&&D[_]()}wt.exports=vt},function(wt,Ft,tt){"use strict";var vt=tt(3);function st(yt){return!yt||!yt.className?"":vt(yt.className.baseVal)?yt.className:yt.className.baseVal}wt.exports=st},function(wt,Ft,tt){"use strict";(function(vt){var st=tt(10),yt=tt(42),_=tt(44),z=tt(47),g=tt(28),x=tt(17),f=tt(14),c=tt(15),I=tt(0);function M(D,P){f(P,"mousedown",this._onMouseDown,this),this.options=I({distance:10},D),this.container=P,this._isMoved=!1,this._distance=0,this._dragStartFired=!1,this._dragStartEventData=null}M.prototype.destroy=function(){x(this.container,"mousedown",this._onMouseDown),this.options=this.container=this._isMoved=this._distance=this._dragStartFired=this._dragStartEventData=null},M.prototype._toggleDragEvent=function(D){var P=this.container;D?(yt(P),f(window,"dragstart",c),f(vt.document,{mousemove:this._onMouseMove,mouseup:this._onMouseUp},this)):(_(P),x(window,"dragstart",c),x(vt.document,{mousemove:this._onMouseMove,mouseup:this._onMouseUp}))},M.prototype._getEventData=function(D){return{target:g(D),originEvent:D}},M.prototype._onMouseDown=function(D){z(D)===0&&(this._distance=0,this._dragStartFired=!1,this._dragStartEventData=this._getEventData(D),this._toggleDragEvent(!0))},M.prototype._onMouseMove=function(D){var P=this.options.distance;if(c(D),this._isMoved=!0,this._distance-1)}wt.exports=yt},function(wt,Ft,tt){"use strict";var vt=tt(10),st=tt(53),yt=tt(54),_=tt(30),z=tt(0),g=tt(18),x=tt(9),f=tt(32),c=tt(12),I=tt(8),M=tt(24),D=tt(57),P=-7,j=112,p=-3,a=115,d=359.99;function u(t,e){e=x.appendHTMLElement("div",e,t.cssPrefix+"slider-container"),e.style.display="none",I.call(this,t,e),this.options=z({color:"#f8f8f8",cssPrefix:"tui-colorpicker-"},t),this._dragDataCache={},this.sliderHandleElement=null,this.huebarHandleElement=null,this.baseColorElement=null,this.drag=new M({distance:0},e),this.colorSliderPosLimitRange=[P,j],this.huebarPosLimitRange=[p,a],this.drag.on({dragStart:this._onDragStart,drag:this._onDrag,dragEnd:this._onDragEnd,click:this._onClick},this)}g(u,I),u.prototype._beforeDestroy=function(){this.drag.off(),this.drag=this.options=this._dragDataCache=this.sliderHandleElement=this.huebarHandleElement=this.baseColorElement=null},u.prototype.toggle=function(t){this.container.style.display=t?"block":"none"},u.prototype.isVisible=function(){return this.container.style.display==="block"},u.prototype.render=function(t){var e=this.container,i=this.options,s=D.layout,m,o;!c.isValidRGB(t)||(s=s.replace(/{{slider}}/,D.slider),s=s.replace(/{{huebar}}/,D.huebar),s=s.replace(/{{cssPrefix}}/g,i.cssPrefix),s=s.replace(/{{id}}/g,i.id),this.container.innerHTML=s,this.sliderSvgElement=e.querySelector("."+i.cssPrefix+"svg-slider"),this.huebarSvgElement=e.querySelector("."+i.cssPrefix+"svg-huebar"),this.sliderHandleElement=e.querySelector("."+i.cssPrefix+"slider-handle"),this.huebarHandleElement=e.querySelector("."+i.cssPrefix+"huebar-handle"),this.baseColorElement=e.querySelector("."+i.cssPrefix+"slider-basecolor"),m=c.hexToRGB(t),o=c.rgbToHSV.apply(null,m),this.moveHue(o[0],!0),this.moveSaturationAndValue(o[1],o[2],!0))},u.prototype._setColorSliderPosMax=function(){var t=this.sliderSvgElement.getClientRects()[0];t&&(this.colorSliderPosLimitRange[1]=t.height-10)},u.prototype._moveColorSliderHandle=function(t,e,i){var s=this.sliderHandleElement,m;e=Math.max(this.colorSliderPosLimitRange[0],e),e=Math.min(this.colorSliderPosLimitRange[1],e),t=Math.max(this.colorSliderPosLimitRange[0],t),t=Math.min(this.colorSliderPosLimitRange[1],t),f.setTranslateXY(s,t,e),m=e>50?"white":"black",f.setStrokeColor(s,m),i||this.fire("_selectColor",{color:c.rgbToHEX.apply(null,this.getRGB())})},u.prototype.moveSaturationAndValue=function(t,e,i){var s,m,o,y;t=t||0,e=e||0,s=Math.abs(this.colorSliderPosLimitRange[0]),m=this.colorSliderPosLimitRange[1],o=t*m/100-s,y=m-e*m/100-s,this._moveColorSliderHandle(o,y,i)},u.prototype._moveColorSliderByPosition=function(t,e){var i=this.colorSliderPosLimitRange[0];this._moveColorSliderHandle(t+i,e+i)},u.prototype.getSaturationAndValue=function(){var t=Math.abs(this.colorSliderPosLimitRange[0]),e=t+this.colorSliderPosLimitRange[1],i=f.getTranslateXY(this.sliderHandleElement),s,m;return s=(i[1]+t)/e*100,m=100-(i[0]+t)/e*100,[s,m]},u.prototype._setHueBarPosMax=function(){var t=this.huebarSvgElement.getClientRects()[0];t&&(this.huebarPosLimitRange[1]=t.height-7)},u.prototype._moveHueHandle=function(t,e){var i=this.huebarHandleElement,s=this.baseColorElement,m,o;t=Math.max(this.huebarPosLimitRange[0],t),t=Math.min(this.huebarPosLimitRange[1],t),f.setTranslateY(i,t),m=c.hsvToRGB(this.getHue(),100,100),o=c.rgbToHEX.apply(null,m),f.setGradientColorStop(s,o),e||this.fire("_selectColor",{color:c.rgbToHEX.apply(null,this.getRGB())})},u.prototype.moveHue=function(t,e){var i=0,s,m;s=Math.abs(this.huebarPosLimitRange[0]),m=s+this.huebarPosLimitRange[1],t=t||0,i=m*t/d-s,this._moveHueHandle(i,e)},u.prototype._moveHueByPosition=function(t){var e=this.huebarPosLimitRange[0];this._moveHueHandle(t+e)},u.prototype.getHue=function(){var t=this.huebarHandleElement,e=f.getTranslateXY(t),i,s;return i=Math.abs(this.huebarPosLimitRange[0]),s=i+this.huebarPosLimitRange[1],(e[0]+i)*d/s},u.prototype.getHSV=function(){var t=this.getSaturationAndValue(),e=this.getHue();return[e].concat(t)},u.prototype.getRGB=function(){return c.hsvToRGB.apply(null,this.getHSV())},u.prototype._prepareColorSliderForMouseEvent=function(t){var e=this.options,i=yt(t.target,"."+e.cssPrefix+"slider-part"),s;return s=this._dragDataCache={isColorSlider:_(i,e.cssPrefix+"slider-left"),parentElement:i},s},u.prototype._onClick=function(t){var e=this._prepareColorSliderForMouseEvent(t),i=st(t.originEvent,e.parentElement);e.isColorSlider?this._moveColorSliderByPosition(i[0],i[1]):this._moveHueByPosition(i[1]),this._dragDataCache=null},u.prototype._onDragStart=function(t){this._setColorSliderPosMax(),this._setHueBarPosMax(),this._prepareColorSliderForMouseEvent(t)},u.prototype._onDrag=function(t){var e=this._dragDataCache,i=st(t.originEvent,e.parentElement);e.isColorSlider?this._moveColorSliderByPosition(i[0],i[1]):this._moveHueByPosition(i[1])},u.prototype._onDragEnd=function(){this._dragDataCache=null},vt.mixin(u),wt.exports=u},function(wt,Ft,tt){"use strict";var vt=tt(4).isOldBrowser,st=/[\.\-0-9]+/g,yt=-6,_={getTranslateXY:function(z){var g;return vt?(g=z.style,[parseFloat(g.top),parseFloat(g.left)]):(g=z.getAttribute("transform"),g?(g=g.match(st),[parseFloat(g[1]),parseFloat(g[0])]):[0,0])},setTranslateXY:function(z,g,x){vt?(z.style.left=g+"px",z.style.top=x+"px"):z.setAttribute("transform","translate("+g+","+x+")")},setTranslateY:function(z,g){vt?z.style.top=g+"px":z.setAttribute("transform","translate("+yt+","+g+")")},setStrokeColor:function(z,g){vt?z.strokecolor=g:z.setAttribute("stroke",g)},setGradientColorStop:function(z,g){vt?z.color=g:z.setAttribute("stop-color",g)}};wt.exports=_},function(wt,Ft,tt){tt(34),wt.exports=tt(35)},function(wt,Ft,tt){},function(wt,Ft,tt){"use strict";var vt=tt(19),st=tt(8),yt=tt(24),_=tt(48),z=tt(29),g=tt(31),x=tt(12),f=tt(32),c={Collection:vt,View:st,Drag:yt,create:_,Palette:z,Slider:g,colorutil:x,svgvml:f};wt.exports=c},function(wt,Ft,tt){"use strict";function vt(st){return st===null}wt.exports=vt},function(wt,Ft,tt){"use strict";var vt=tt(3),st=tt(38),yt=7*24*60*60*1e3;function _(g){var x=new Date().getTime();return x-g>yt}function z(g,x){var f="https://www.google-analytics.com/collect",c=location.hostname,I="event",M="use",D="TOAST UI "+g+" for "+c+": Statistics",P=window.localStorage.getItem(D);!vt(window.tui)&&window.tui.usageStatistics===!1||P&&!_(P)||(window.localStorage.setItem(D,new Date().getTime()),setTimeout(function(){(document.readyState==="interactive"||document.readyState==="complete")&&st(f,{v:1,t:I,tid:x,cid:c,dp:c,dh:g,el:g,ec:M})},1e3))}wt.exports=z},function(wt,Ft,tt){"use strict";var vt=tt(7);function st(yt,_){var z=document.createElement("img"),g="";return vt(_,function(x,f){g+="&"+f+"="+x}),g=g.substring(1),z.src=yt+"?"+g,z.style.display="none",document.body.appendChild(z),document.body.removeChild(z),z}wt.exports=st},function(wt,Ft,tt){"use strict";var vt=tt(2),st=tt(5),yt=tt(23),_=tt(40);function z(g){var x=Array.prototype.slice.call(arguments,1),f=g.classList,c=[],I;if(f){vt(x,function(M){g.classList.add(M)});return}I=yt(g),I&&(x=[].concat(I.split(/\s+/),x)),vt(x,function(M){st(M,c)<0&&c.push(M)}),_(g,c)}wt.exports=z},function(wt,Ft,tt){"use strict";var vt=tt(1),st=tt(3);function yt(_,z){if(z=vt(z)?z.join(" "):z,z=z.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,""),st(_.className.baseVal)){_.className=z;return}_.className.baseVal=z}wt.exports=yt},function(wt,Ft,tt){"use strict";function vt(st){return typeof st=="number"||st instanceof Number}wt.exports=vt},function(wt,Ft,tt){"use strict";var vt=tt(14),st=tt(15),yt=tt(43),_=tt(27),z="onselectstart"in document,g="prevUserSelect",x=_(["userSelect","WebkitUserSelect","OUserSelect","MozUserSelect","msUserSelect"]);function f(c){c||(c=document),z?vt(c,"selectstart",st):(c=c===document?document.documentElement:c,yt(c,g,c.style[x]),c.style[x]="none")}wt.exports=f},function(wt,Ft,tt){"use strict";var vt=tt(16);function st(yt,_,z){if(yt.dataset){yt.dataset[_]=z;return}yt.setAttribute("data-"+vt(_),z)}wt.exports=st},function(wt,Ft,tt){"use strict";var vt=tt(17),st=tt(15),yt=tt(45),_=tt(46),z=tt(27),g="onselectstart"in document,x="prevUserSelect",f=z(["userSelect","WebkitUserSelect","OUserSelect","MozUserSelect","msUserSelect"]);function c(I){I||(I=document),g?vt(I,"selectstart",st):(I=I===document?document.documentElement:I,I.style[f]=yt(I,x)||"auto",_(I,x))}wt.exports=c},function(wt,Ft,tt){"use strict";var vt=tt(16);function st(yt,_){return yt.dataset?yt.dataset[_]:yt.getAttribute("data-"+vt(_))}wt.exports=st},function(wt,Ft,tt){"use strict";var vt=tt(16);function st(yt,_){if(yt.dataset){delete yt.dataset[_];return}yt.removeAttribute("data-"+vt(_))}wt.exports=st},function(wt,Ft,tt){"use strict";var vt=tt(22),st=tt(5),yt=["0","1","3","5","7"],_=["2","6"],z=["4"];function g(f){return vt.msie&&vt.version<=8?x(f):f.button}function x(f){var c=String(f.button);return st(c,yt)>-1?0:st(c,_)>-1?2:st(c,z)>-1?1:null}wt.exports=g},function(wt,Ft,tt){"use strict";var vt=tt(10),st=tt(0),yt=tt(4),_=tt(12),z=tt(49),g=tt(29),x=tt(31),f=0;function c(){return f+=1,f}function I(M){var D;if(!(this instanceof I))return new I(M);if(M=this.options=st({container:null,color:"#f8f8f8",preset:["#181818","#282828","#383838","#585858","#b8b8b8","#d8d8d8","#e8e8e8","#f8f8f8","#ab4642","#dc9656","#f7ca88","#a1b56c","#86c1b9","#7cafc2","#ba8baf","#a16946"],cssPrefix:"tui-colorpicker-",detailTxt:"Detail",id:c(),usageStatistics:!0},M),!M.container)throw new Error("ColorPicker(): need container option.");D=this.layout=new z(M,M.container),this.palette=new g(M,D.container),this.palette.on({_selectColor:this._onSelectColorInPalette,_toggleSlider:this._onToggleSlider},this),this.slider=new x(M,D.container),this.slider.on("_selectColor",this._onSelectColorInSlider,this),D.addChild(this.palette),D.addChild(this.slider),this.render(M.color),M.usageStatistics&&yt.sendHostName()}I.prototype._onSelectColorInPalette=function(M){var D=M.color,P=this.options;if(!_.isValidRGB(D)&&D!==""){this.render();return}this.fire("selectColor",{color:D,origin:"palette"}),P.color!==D&&(P.color=D,this.render(D))},I.prototype._onToggleSlider=function(){this.slider.toggle(!this.slider.isVisible())},I.prototype._onSelectColorInSlider=function(M){var D=M.color,P=this.options;this.fire("selectColor",{color:D,origin:"slider"}),P.color!==D&&(P.color=D,this.palette.render(D))},I.prototype.setColor=function(M){if(!_.isValidRGB(M))throw new Error("ColorPicker#setColor(): need valid hex string color value");this.options.color=M,this.render(M)},I.prototype.getColor=function(){return this.options.color},I.prototype.toggle=function(M){this.layout.container.style.display=M?"block":"none"},I.prototype.render=function(M){this.layout.render(M||this.options.color)},I.prototype.destroy=function(){this.layout.destroy(),this.options.container.innerHTML="",this.layout=this.slider=this.palette=this.options=null},vt.mixin(I),wt.exports=I},function(wt,Ft,tt){"use strict";var vt=tt(0),st=tt(18),yt=tt(9),_=tt(8);function z(g,x){this.options=vt({cssPrefix:"tui-colorpicker-"},g),x=yt.appendHTMLElement("div",x,this.options.cssPrefix+"container"),_.call(this,g,x),this.render()}st(z,_),z.prototype.render=function(g){this.recursive(function(x){x.render(g)},!0)},wt.exports=z},function(wt,Ft,tt){"use strict";function vt(st){function yt(){}return yt.prototype=st,new yt}wt.exports=vt},function(wt,Ft,tt){"use strict";var vt=tt(52);wt.exports=function(st){var yt=['
  • '].join(""),_=['
      ',"{{each preset}}",yt,"{{/each}}","
    ",'
    ','','','{{color}}',"
    "].join(` `);return vt(_,st)}},function(wt,Ft,tt){"use strict";var vt=tt(5),st=tt(2),yt=tt(1),_=tt(11),z=tt(0),g=/{{\s?|\s?}}/g,x=/^[a-zA-Z0-9_@]+\[[a-zA-Z0-9_@"']+\]$/,f=/\[\s?|\s?\]/,c=/^[a-zA-Z_]+\.[a-zA-Z_]+$/,I=/\./,M=/^["']\w+["']$/,D=/"|'/g,P=/^-?\d+\.?\d*$/,j=2,p={if:e,each:i,with:s},a="a".split(/a/).length===3,d=function(){return a?function(O,L){return O.split(L)}:function(O,L){var N=[],B=0,Y,nt;for(L.global||(L=new RegExp(L,"g")),Y=L.exec(O);Y!==null;)nt=Y.index,N.push(O.slice(B,nt)),B=nt+Y[0].length,Y=L.exec(O);return N.push(O.slice(B)),N}}();function u(O,L){var N,B=L[O];return O==="true"?B=!0:O==="false"?B=!1:M.test(O)?B=O.replace(D,""):x.test(O)?(N=O.split(f),B=u(N[0],L)[u(N[1],L)]):c.test(O)?(N=O.split(I),B=u(N[0],L)[N[1]]):P.test(O)&&(B=parseFloat(O)),B}function t(O,L){var N=[O],B=[],Y=0,nt=0;return st(L,function(it,Mt){it.indexOf("if")===0?Y+=1:it==="/if"?Y-=1:!Y&&(it.indexOf("elseif")===0||it==="else")&&(N.push(it==="else"?["true"]:it.split(" ").slice(1)),B.push(L.slice(nt,Mt)),nt=Mt+1)}),B.push(L.slice(nt)),{exps:N,sourcesInsideIf:B}}function e(O,L,N){var B=t(O,L),Y=!1,nt="";return st(B.exps,function(it,Mt){return Y=y(it,N),Y&&(nt=b(B.sourcesInsideIf[Mt],N)),!Y}),nt}function i(O,L,N){var B=y(O,N),Y=yt(B)?"@index":"@key",nt={},it="";return st(B,function(Mt,K){nt[Y]=K,nt["@this"]=Mt,z(N,nt),it+=b(L.slice(),N)}),it}function s(O,L,N){var B=vt("as",O),Y=O[B+1],nt=y(O.slice(0,B),N),it={};return it[Y]=nt,b(L,z(N,it))||""}function m(O,L,N){var B=O.splice(L+1,N-L);return B.pop(),B}function o(O,L,N){for(var B=p[O],Y=1,nt=0,it,Mt=nt+j,K=L[Mt];Y&&_(K);)K.indexOf(O)===0?Y+=1:K.indexOf("/"+O)===0&&(Y-=1,it=Mt),Mt+=j,K=L[Mt];if(Y)throw Error(O+" needs {{/"+O+"}} expression.");return L[nt]=B(L[nt].split(" ").slice(1),m(L,nt,it),N),L}function y(O,L){var N=u(O[0],L);return N instanceof Function?C(N,O.slice(1),L):N}function C(O,L,N){var B=[];return st(L,function(Y){B.push(u(Y,N))}),O.apply(null,B)}function b(O,L){for(var N=1,B=O[N],Y,nt,it;_(B);)Y=B.split(" "),nt=Y[0],p[nt]?(it=o(nt,O.splice(N,O.length-N),L),O=O.concat(it)):O[N]=y(Y,L),N+=j,B=O[N];return O.join("")}function E(O,L){return b(d(O,g),L)}wt.exports=E},function(wt,Ft,tt){"use strict";var vt=tt(1);function st(yt,_){var z=vt(yt),g=z?yt[0]:yt.clientX,x=z?yt[1]:yt.clientY,f;return _?(f=_.getBoundingClientRect(),[g-f.left-_.clientLeft,x-f.top-_.clientTop]):[g,x]}wt.exports=st},function(wt,Ft,tt){"use strict";var vt=tt(55);function st(yt,_){var z=yt.parentNode;if(vt(yt,_))return yt;for(;z&&z!==document;){if(vt(z,_))return z;z=z.parentNode}return null}wt.exports=st},function(wt,Ft,tt){"use strict";var vt=tt(5),st=tt(56),yt=Element.prototype,_=yt.matches||yt.webkitMatchesSelector||yt.mozMatchesSelector||yt.msMatchesSelector||function(g){var x=this.document||this.ownerDocument;return vt(this,st(x.querySelectorAll(g)))>-1};function z(g,x){return _.call(g,x)}wt.exports=z},function(wt,Ft,tt){"use strict";var vt=tt(6);function st(yt){var _;try{_=Array.prototype.slice.call(yt)}catch(z){_=[],vt(yt,function(g){_.push(g)})}return _}wt.exports=st},function(wt,Ft,tt){"use strict";(function(vt){var st=tt(4).isOldBrowser,yt=['
    {{slider}}
    ','
    {{huebar}}
    '].join(` `),_=['',"",'','','',"",'','','',"","",'','','',""].join(` `),z=['
    ','','',"",'','',"",'',"
    "].join(` `),g=['',"",'','','','','','','','',"","",'','',""].join(` `),x=['
    ','','',"",'',"
    "].join(` `);st&&vt.document.namespaces.add("v","urn:schemas-microsoft-com:vml"),wt.exports={layout:yt,slider:st?z:_,huebar:st?x:g}}).call(this,tt(25))}])})},8618:function(Ue,wt,Ft){var tt=Ft(48764).Buffer;/*! * TOAST UI ImageEditor * @version 3.15.3 * @license MIT */(function(st,yt){Ue.exports=yt(Ft(98525))})(self,function(vt){return function(){var st={2777:function(g,x,f){/*! Fabric.js Copyright 2008-2015, Printio (Juriy Zaytsev, Maxim Chernyak) */var c=c||{version:"4.6.0"};if(x.fabric=c,typeof document!="undefined"&&typeof window!="undefined")document instanceof(typeof HTMLDocument!="undefined"?HTMLDocument:Document)?c.document=document:c.document=document.implementation.createHTMLDocument(""),c.window=window;else{var I=f(4960),M=new I.JSDOM(decodeURIComponent("%3C!DOCTYPE%20html%3E%3Chtml%3E%3Chead%3E%3C%2Fhead%3E%3Cbody%3E%3C%2Fbody%3E%3C%2Fhtml%3E"),{features:{FetchExternalResources:["img"]},resources:"usable"}).window;c.document=M.document,c.jsdomImplForWrapper=f(6759).implForWrapper,c.nodeCanvas=f(6272).Canvas,c.window=M,DOMParser=c.window.DOMParser}c.isTouchSupported="ontouchstart"in c.window||"ontouchstart"in c.document||c.window&&c.window.navigator&&c.window.navigator.maxTouchPoints>0,c.isLikelyNode=typeof tt!="undefined"&&typeof window=="undefined",c.SHARED_ATTRIBUTES=["display","transform","fill","fill-opacity","fill-rule","opacity","stroke","stroke-dasharray","stroke-linecap","stroke-dashoffset","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke-width","id","paint-order","vector-effect","instantiated_by_use","clip-path"],c.DPI=96,c.reNum="(?:[-+]?(?:\\d+|\\d*\\.\\d+)(?:[eE][-+]?\\d+)?)",c.commaWsp="(?:\\s+,?\\s*|,\\s*)",c.rePathCommand=/([-+]?((\d+\.\d+)|((\d+)|(\.\d+)))(?:[eE][-+]?\d+)?)/ig,c.reNonWord=/[ \n\.,;!\?\-]/,c.fontPaths={},c.iMatrix=[1,0,0,1,0,0],c.svgNS="http://www.w3.org/2000/svg",c.perfLimitSizeTotal=2097152,c.maxCacheSideLimit=4096,c.minCacheSideLimit=256,c.charWidthsCache={},c.textureSize=2048,c.disableStyleCopyPaste=!1,c.enableGLFiltering=!0,c.devicePixelRatio=c.window.devicePixelRatio||c.window.webkitDevicePixelRatio||c.window.mozDevicePixelRatio||1,c.browserShadowBlurConstant=1,c.arcToSegmentsCache={},c.boundsOfCurveCache={},c.cachesBoundsOfCurve=!0,c.forceGLPutImageData=!1,c.initFilterBackend=function(){if(c.enableGLFiltering&&c.isWebglSupported&&c.isWebglSupported(c.textureSize))return console.log("max texture size: "+c.maxTextureSize),new c.WebglFilterBackend({tileSize:c.textureSize});if(c.Canvas2dFilterBackend)return new c.Canvas2dFilterBackend},typeof document!="undefined"&&typeof window!="undefined"&&(window.fabric=c),function(){function p(i,s){if(!!this.__eventListeners[i]){var m=this.__eventListeners[i];s?m[m.indexOf(s)]=!1:c.util.array.fill(m,!1)}}function a(i,s){if(this.__eventListeners||(this.__eventListeners={}),arguments.length===1)for(var m in i)this.on(m,i[m]);else this.__eventListeners[i]||(this.__eventListeners[i]=[]),this.__eventListeners[i].push(s);return this}function d(i,s){var m=function(){s.apply(this,arguments),this.off(i,m)}.bind(this);this.on(i,m)}function u(i,s){if(arguments.length===1)for(var m in i)d.call(this,m,i[m]);else d.call(this,i,s);return this}function t(i,s){if(!this.__eventListeners)return this;if(arguments.length===0)for(i in this.__eventListeners)p.call(this,i);else if(arguments.length===1&&typeof arguments[0]=="object")for(var m in i)p.call(this,m,i[m]);else p.call(this,i,s);return this}function e(i,s){if(!this.__eventListeners)return this;var m=this.__eventListeners[i];if(!m)return this;for(var o=0,y=m.length;o-1?!0:a?this._objects.some(function(d){return typeof d.contains=="function"&&d.contains(p,!0)}):!1},complexity:function(){return this._objects.reduce(function(p,a){return p+=a.complexity?a.complexity():0,p},0)}},c.CommonMethods={_setOptions:function(p){for(var a in p)this.set(a,p[a])},_initGradient:function(p,a){p&&p.colorStops&&!(p instanceof c.Gradient)&&this.set(a,new c.Gradient(p))},_initPattern:function(p,a,d){p&&p.source&&!(p instanceof c.Pattern)?this.set(a,new c.Pattern(p,d)):d&&d()},_setObject:function(p){for(var a in p)this._set(a,p[a])},set:function(p,a){return typeof p=="object"?this._setObject(p):this._set(p,a),this},_set:function(p,a){this[p]=a},toggle:function(p){var a=this.get(p);return typeof a=="boolean"&&this.set(p,!a),this},get:function(p){return this[p]}},function(p){var a=Math.sqrt,d=Math.atan2,u=Math.pow,t=Math.PI/180,e=Math.PI/2;c.util={cos:function(i){if(i===0)return 1;i<0&&(i=-i);var s=i/e;switch(s){case 1:case 3:return 0;case 2:return-1}return Math.cos(i)},sin:function(i){if(i===0)return 0;var s=i/e,m=1;switch(i<0&&(m=-1),s){case 1:return m;case 2:return 0;case 3:return-m}return Math.sin(i)},removeFromArray:function(i,s){var m=i.indexOf(s);return m!==-1&&i.splice(m,1),i},getRandomInt:function(i,s){return Math.floor(Math.random()*(s-i+1))+i},degreesToRadians:function(i){return i*t},radiansToDegrees:function(i){return i/t},rotatePoint:function(i,s,m){var o=new c.Point(i.x-s.x,i.y-s.y),y=c.util.rotateVector(o,m);return new c.Point(y.x,y.y).addEquals(s)},rotateVector:function(i,s){var m=c.util.sin(s),o=c.util.cos(s),y=i.x*o-i.y*m,C=i.x*m+i.y*o;return{x:y,y:C}},transformPoint:function(i,s,m){return m?new c.Point(s[0]*i.x+s[2]*i.y,s[1]*i.x+s[3]*i.y):new c.Point(s[0]*i.x+s[2]*i.y+s[4],s[1]*i.x+s[3]*i.y+s[5])},makeBoundingBoxFromPoints:function(i,s){if(s)for(var m=0;ms;)s+=C[B++%N],s>O&&(s=O),i[Y?"lineTo":"moveTo"](s,0),Y=!Y;i.restore()},createCanvasElement:function(){return c.document.createElement("canvas")},copyCanvasElement:function(i){var s=c.util.createCanvasElement();return s.width=i.width,s.height=i.height,s.getContext("2d").drawImage(i,0,0),s},toDataURL:function(i,s,m){return i.toDataURL("image/"+s,m)},createImage:function(){return c.document.createElement("img")},multiplyTransformMatrices:function(i,s,m){return[i[0]*s[0]+i[2]*s[1],i[1]*s[0]+i[3]*s[1],i[0]*s[2]+i[2]*s[3],i[1]*s[2]+i[3]*s[3],m?0:i[0]*s[4]+i[2]*s[5]+i[4],m?0:i[1]*s[4]+i[3]*s[5]+i[5]]},qrDecompose:function(i){var s=d(i[1],i[0]),m=u(i[0],2)+u(i[1],2),o=a(m),y=(i[0]*i[3]-i[2]*i[1])/o,C=d(i[0]*i[2]+i[1]*i[3],m);return{angle:s/t,scaleX:o,scaleY:y,skewX:C/t,skewY:0,translateX:i[4],translateY:i[5]}},calcRotateMatrix:function(i){if(!i.angle)return c.iMatrix.concat();var s=c.util.degreesToRadians(i.angle),m=c.util.cos(s),o=c.util.sin(s);return[m,o,-o,m,0,0]},calcDimensionsMatrix:function(i){var s=typeof i.scaleX=="undefined"?1:i.scaleX,m=typeof i.scaleY=="undefined"?1:i.scaleY,o=[i.flipX?-s:s,0,0,i.flipY?-m:m,0,0],y=c.util.multiplyTransformMatrices,C=c.util.degreesToRadians;return i.skewX&&(o=y(o,[1,0,Math.tan(C(i.skewX)),1],!0)),i.skewY&&(o=y(o,[1,Math.tan(C(i.skewY)),0,1],!0)),o},composeMatrix:function(i){var s=[1,0,0,1,i.translateX||0,i.translateY||0],m=c.util.multiplyTransformMatrices;return i.angle&&(s=m(s,c.util.calcRotateMatrix(i))),(i.scaleX!==1||i.scaleY!==1||i.skewX||i.skewY||i.flipX||i.flipY)&&(s=m(s,c.util.calcDimensionsMatrix(i))),s},resetObjectTransform:function(i){i.scaleX=1,i.scaleY=1,i.skewX=0,i.skewY=0,i.flipX=!1,i.flipY=!1,i.rotate(0)},saveObjectTransform:function(i){return{scaleX:i.scaleX,scaleY:i.scaleY,skewX:i.skewX,skewY:i.skewY,angle:i.angle,left:i.left,flipX:i.flipX,flipY:i.flipY,top:i.top}},isTransparent:function(i,s,m,o){o>0&&(s>o?s-=o:s=0,m>o?m-=o:m=0);var y=!0,C,b,E=i.getImageData(s,m,o*2||1,o*2||1),O=E.data.length;for(C=3;C0?Wt-=2*gt:X===1&&Wt<0&&(Wt+=2*gt);for(var Gt=Math.ceil(Math.abs(Wt/gt*2)),$t=[],ne=Wt/Gt,ce=8/3*Math.sin(ne/4)*Math.sin(ne/4)/Math.sin(ne/2),Dt=ue+ne,kt=0;kt=W?X-W:2*Math.PI-(W-X)}function i(Q,G,rt,F,W,X,Z,gt){var ht;if(c.cachesBoundsOfCurve&&(ht=p.call(arguments),c.boundsOfCurveCache[ht]))return c.boundsOfCurveCache[ht];var bt=Math.sqrt,Tt=Math.min,xt=Math.max,at=Math.abs,$=[],et=[[],[]],ct,ft,Ct,_t,Zt,Xt,St,Jt;ft=6*Q-12*rt+6*W,ct=-3*Q+9*rt-9*W+3*Z,Ct=3*rt-3*Q;for(var Kt=0;Kt<2;++Kt){if(Kt>0&&(ft=6*G-12*F+6*X,ct=-3*G+9*F-9*X+3*gt,Ct=3*F-3*G),at(ct)<1e-12){if(at(ft)<1e-12)continue;_t=-Ct/ft,0<_t&&_t<1&&$.push(_t);continue}St=ft*ft-4*Ct*ct,!(St<0)&&(Jt=bt(St),Zt=(-ft+Jt)/(2*ct),01e-4;)Z=W(rt),Tt=rt,gt=o(X.x,X.y,Z.x,Z.y),gt+F>G?(ht/=2,rt-=ht):(X=Z,rt+=ht,F+=gt);return Z.angle=bt(Tt),Z}function It(Q){for(var G=0,rt=Q.length,F,W=0,X=0,Z=0,gt=0,ht=[],bt,Tt,xt,at=0;at0&&FSt)for(var Kt=1,ae=ct.length;Kt2;for(G=G||0,bt&&(gt=Q[2].xQ[F-2].x?1:W.x===Q[F-2].x?0:-1,ht=W.y>Q[F-2].y?1:W.y===Q[F-2].y?0:-1),rt.push(["L",W.x+gt*G,W.y+ht*G]),rt}function Nt(Q,G,rt){return rt&&(G=c.util.multiplyTransformMatrices(G,[1,0,0,1,-rt.x,-rt.y])),Q.map(function(F){for(var W=F.slice(0),X={},Z=1;Z=o})}function u(i,s){return e(i,s,function(m,o){return m/g,">")}function u(e){var i=0,s,m=[];for(i=0,s;i57343)return e.charAt(i);if(55296<=s&&s<=56319){if(e.length<=i+1)throw"High surrogate without following low surrogate";var m=e.charCodeAt(i+1);if(56320>m||m>57343)throw"High surrogate without following low surrogate";return e.charAt(i)+e.charAt(i+1)}if(i===0)throw"Low surrogate without preceding high surrogate";var o=e.charCodeAt(i-1);if(55296>o||o>56319)throw"Low surrogate without preceding high surrogate";return!1}c.util.string={camelize:p,capitalize:a,escapeXml:d,graphemeSplit:u}}(),function(){var p=Array.prototype.slice,a=function(){},d=function(){for(var s in{toString:1})if(s==="toString")return!1;return!0}(),u=function(s,m,o){for(var y in m)y in s.prototype&&typeof s.prototype[y]=="function"&&(m[y]+"").indexOf("callSuper")>-1?s.prototype[y]=function(C){return function(){var b=this.constructor.superclass;this.constructor.superclass=o;var E=m[C].apply(this,arguments);if(this.constructor.superclass=b,C!=="initialize")return E}}(y):s.prototype[y]=m[y],d&&(m.toString!==Object.prototype.toString&&(s.prototype.toString=m.toString),m.valueOf!==Object.prototype.valueOf&&(s.prototype.valueOf=m.valueOf))};function t(){}function e(s){for(var m=null,o=this;o.constructor.superclass;){var y=o.constructor.superclass.prototype[s];if(o[s]!==y){m=y;break}o=o.constructor.superclass.prototype}return m?arguments.length>1?m.apply(this,p.call(arguments,1)):m.call(this):console.log("tried to callSuper "+s+", method not found in prototype chain",this)}function i(){var s=null,m=p.call(arguments,0);typeof m[0]=="function"&&(s=m.shift());function o(){this.initialize.apply(this,arguments)}o.superclass=s,o.subclasses=[],s&&(t.prototype=s.prototype,o.prototype=new t,s.subclasses.push(o));for(var y=0,C=m.length;y-1||u.pointerType==="touch"}}(),function(){function p(i,s){var m=i.style;if(!m)return i;if(typeof s=="string")return i.style.cssText+=";"+s,s.indexOf("opacity")>-1?e(i,s.match(/opacity:\s*(\d?\.?\d*)/)[1]):i;for(var o in s)if(o==="opacity")e(i,s[o]);else{var y=o==="float"||o==="cssFloat"?typeof m.styleFloat=="undefined"?"cssFloat":"styleFloat":o;m[y]=s[o]}return i}var a=c.document.createElement("div"),d=typeof a.style.opacity=="string",u=typeof a.style.filter=="string",t=/alpha\s*\(\s*opacity\s*=\s*([^\)]+)\)/,e=function(i){return i};d?e=function(i,s){return i.style.opacity=s,i}:u&&(e=function(i,s){var m=i.style;return i.currentStyle&&!i.currentStyle.hasLayout&&(m.zoom=1),t.test(m.filter)?(s=s>=.9999?"":"alpha(opacity="+s*100+")",m.filter=m.filter.replace(t,s)):m.filter+=" alpha(opacity="+s*100+")",i}),c.util.setStyle=p}(),function(){var p=Array.prototype.slice;function a(E){return typeof E=="string"?c.document.getElementById(E):E}var d,u=function(E){return p.call(E,0)};try{d=u(c.document.childNodes)instanceof Array}catch(E){}d||(u=function(E){for(var O=new Array(E.length),L=E.length;L--;)O[L]=E[L];return O});function t(E,O){var L=c.document.createElement(E);for(var N in O)N==="class"?L.className=O[N]:N==="for"?L.htmlFor=O[N]:L.setAttribute(N,O[N]);return L}function e(E,O){E&&(" "+E.className+" ").indexOf(" "+O+" ")===-1&&(E.className+=(E.className?" ":"")+O)}function i(E,O,L){return typeof O=="string"&&(O=t(O,L)),E.parentNode&&E.parentNode.replaceChild(O,E),O.appendChild(E),O}function s(E){for(var O=0,L=0,N=c.document.documentElement,B=c.document.body||{scrollLeft:0,scrollTop:0};E&&(E.parentNode||E.host)&&(E=E.parentNode||E.host,E===c.document?(O=B.scrollLeft||N.scrollLeft||0,L=B.scrollTop||N.scrollTop||0):(O+=E.scrollLeft||0,L+=E.scrollTop||0),!(E.nodeType===1&&E.style.position==="fixed")););return{left:O,top:L}}function m(E){var O,L=E&&E.ownerDocument,N={left:0,top:0},B={left:0,top:0},Y,nt={borderLeftWidth:"left",borderTopWidth:"top",paddingLeft:"left",paddingTop:"top"};if(!L)return B;for(var it in nt)B[nt[it]]+=parseInt(o(E,it),10)||0;return O=L.documentElement,typeof E.getBoundingClientRect!="undefined"&&(N=E.getBoundingClientRect()),Y=s(E),{left:N.left+Y.left-(O.clientLeft||0)+B.left,top:N.top+Y.top-(O.clientTop||0)+B.top}}var o;c.document.defaultView&&c.document.defaultView.getComputedStyle?o=function(E,O){var L=c.document.defaultView.getComputedStyle(E,null);return L?L[O]:void 0}:o=function(E,O){var L=E.style[O];return!L&&E.currentStyle&&(L=E.currentStyle[O]),L},function(){var E=c.document.documentElement.style,O="userSelect"in E?"userSelect":"MozUserSelect"in E?"MozUserSelect":"WebkitUserSelect"in E?"WebkitUserSelect":"KhtmlUserSelect"in E?"KhtmlUserSelect":"";function L(B){return typeof B.onselectstart!="undefined"&&(B.onselectstart=c.util.falseFunction),O?B.style[O]="none":typeof B.unselectable=="string"&&(B.unselectable="on"),B}function N(B){return typeof B.onselectstart!="undefined"&&(B.onselectstart=null),O?B.style[O]="":typeof B.unselectable=="string"&&(B.unselectable=""),B}c.util.makeElementUnselectable=L,c.util.makeElementSelectable=N}();function y(E){var O=c.jsdomImplForWrapper(E);return O._canvas||O._image}function C(E){if(!!c.isLikelyNode){var O=c.jsdomImplForWrapper(E);O&&(O._image=null,O._canvas=null,O._currentSrc=null,O._attributes=null,O._classList=null)}}function b(E,O){E.imageSmoothingEnabled=E.imageSmoothingEnabled||E.webkitImageSmoothingEnabled||E.mozImageSmoothingEnabled||E.msImageSmoothingEnabled||E.oImageSmoothingEnabled,E.imageSmoothingEnabled=O}c.util.setImageSmoothing=b,c.util.getById=a,c.util.toArray=u,c.util.addClass=e,c.util.makeElement=t,c.util.wrapElement=i,c.util.getScrollLeftTop=s,c.util.getElementOffset=m,c.util.getNodeCanvas=y,c.util.cleanUpJsdomNode=C}(),function(){function p(u,t){return u+(/\?/.test(u)?"&":"?")+t}function a(){}function d(u,t){t||(t={});var e=t.method?t.method.toUpperCase():"GET",i=t.onComplete||function(){},s=new c.window.XMLHttpRequest,m=t.body||t.parameters;return s.onreadystatechange=function(){s.readyState===4&&(i(s),s.onreadystatechange=a)},e==="GET"&&(m=null,typeof t.parameters=="string"&&(u=p(u,t.parameters))),s.open(e,u,!0),(e==="POST"||e==="PUT")&&s.setRequestHeader("Content-Type","application/x-www-form-urlencoded"),s.send(m),s}c.util.request=d}(),c.log=console.log,c.warn=console.warn,function(){function p(){return!1}function a(s,m,o,y){return-o*Math.cos(s/y*(Math.PI/2))+o+m}function d(s){var m=!1;return e(function(o){s||(s={});var y=o||+new Date,C=s.duration||500,b=y+C,E,O=s.onChange||p,L=s.abort||p,N=s.onComplete||p,B=s.easing||a,Y="startValue"in s?s.startValue:0,nt="endValue"in s?s.endValue:100,it=s.byValue||nt-Y;s.onStart&&s.onStart(),function Mt(K){E=K||+new Date;var It=E>b?C:E-y,U=It/C,Lt=B(It,Y,it,C),dt=Math.abs((Lt-Y)/it);if(!m){if(L(Lt,dt,U)){N(nt,1,1);return}if(E>b){O(nt,1,1),N(nt,1,1);return}else O(Lt,dt,U),e(Mt)}}(y)}),function(){m=!0}}var u=c.window.requestAnimationFrame||c.window.webkitRequestAnimationFrame||c.window.mozRequestAnimationFrame||c.window.oRequestAnimationFrame||c.window.msRequestAnimationFrame||function(s){return c.window.setTimeout(s,1e3/60)},t=c.window.cancelAnimationFrame||c.window.clearTimeout;function e(){return u.apply(c.window,arguments)}function i(){return t.apply(c.window,arguments)}c.util.animate=d,c.util.requestAnimFrame=e,c.util.cancelAnimFrame=i}(),function(){function p(d,u,t){var e="rgba("+parseInt(d[0]+t*(u[0]-d[0]),10)+","+parseInt(d[1]+t*(u[1]-d[1]),10)+","+parseInt(d[2]+t*(u[2]-d[2]),10);return e+=","+(d&&u?parseFloat(d[3]+t*(u[3]-d[3])):1),e+=")",e}function a(d,u,t,e){var i=new c.Color(d).getSource(),s=new c.Color(u).getSource(),m=e.onComplete,o=e.onChange;return e=e||{},c.util.animate(c.util.object.extend(e,{duration:t||500,startValue:i,endValue:s,byValue:s,easing:function(y,C,b,E){var O=e.colorEasing?e.colorEasing(y,E):1-Math.cos(y/E*(Math.PI/2));return p(C,b,O)},onComplete:function(y,C,b){if(m)return m(p(s,s,0),C,b)},onChange:function(y,C,b){if(o){if(Array.isArray(y))return o(p(y,y,0),C,b);o(y,C,b)}}}))}c.util.animateColor=a}(),function(){function p(V,q,Q,G){return V-1&&Tt>-1&&Tt-1)&&(W="stroke")}else{if(F==="href"||F==="xlink:href"||F==="font")return W;if(F==="imageSmoothing")return W==="optimizeQuality";ht=gt?W.map(e):e(W,Z)}}return!gt&&isNaN(ht)?W:ht}function B(F){return new RegExp("^("+F.join("|")+")\\b","i")}function Y(F){for(var W in b)if(!(typeof F[b[W]]=="undefined"||F[W]==="")){if(typeof F[W]=="undefined"){if(!a.Object.prototype[W])continue;F[W]=a.Object.prototype[W]}if(F[W].indexOf("url(")!==0){var X=new a.Color(F[W]);F[W]=X.setAlpha(t(X.getAlpha()*F[b[W]],2)).toRgba()}}return F}function nt(F,W){var X,Z=[],gt,ht,bt;for(ht=0,bt=W.length;ht1;)Kt.shift(),ae=a.util.multiplyTransformMatrices(ae,Kt[0]);return ae}}();function it(F,W){var X,Z;F.replace(/;\s*$/,"").split(";").forEach(function(gt){var ht=gt.split(":");X=ht[0].trim().toLowerCase(),Z=ht[1].trim(),W[X]=Z})}function Mt(F,W){var X,Z;for(var gt in F)typeof F[gt]!="undefined"&&(X=gt.toLowerCase(),Z=F[gt],W[X]=Z)}function K(F,W){var X={};for(var Z in a.cssRules[W])if(It(F,Z.split(" ")))for(var gt in a.cssRules[W][Z])X[gt]=a.cssRules[W][Z][gt];return X}function It(F,W){var X,Z=!0;return X=Lt(F,W.pop()),X&&W.length&&(Z=U(F,W)),X&&Z&&W.length===0}function U(F,W){for(var X,Z=!0;F.parentNode&&F.parentNode.nodeType===1&&W.length;)Z&&(X=W.pop()),F=F.parentNode,Z=Lt(F,X);return W.length===0}function Lt(F,W){var X=F.nodeName,Z=F.getAttribute("class"),gt=F.getAttribute("id"),ht,bt;if(ht=new RegExp("^"+X,"i"),W=W.replace(ht,""),gt&&W.length&&(ht=new RegExp("#"+gt+"(?![a-zA-Z\\-]+)","i"),W=W.replace(ht,"")),Z&&W.length)for(Z=Z.split(" "),bt=Z.length;bt--;)ht=new RegExp("\\."+Z[bt]+"(?![a-zA-Z\\-]+)","i"),W=W.replace(ht,"");return W.length===0}function dt(F,W){var X;if(F.getElementById&&(X=F.getElementById(W)),X)return X;var Z,gt,ht,bt=F.getElementsByTagName("*");for(gt=0,ht=bt.length;gtZ?Z:X),Ct.meetOrSlice==="slice"&&(Z=X=X>Z?X:Z),Kt=St.width-bt*X,ae=St.height-Tt*X,Ct.alignX==="Mid"&&(Kt/=2),Ct.alignY==="Mid"&&(ae/=2),Ct.alignX==="Min"&&(Kt=0),Ct.alignY==="Min"&&(ae=0)),X===1&&Z===1&>===0&&ht===0&&ct===0&&ft===0)return St;if((ct||ft)&&F.parentNode.nodeName!=="#document"&&(Jt=" translate("+e(ct)+" "+e(ft)+") "),xt=Jt+" matrix("+X+" 0 0 "+Z+" "+(gt*X+Kt)+" "+(ht*Z+ae)+") ",F.nodeName==="svg"){for(at=F.ownerDocument.createElementNS(a.svgNS,"g");F.firstChild;)at.appendChild(F.firstChild);F.appendChild(at)}else at=F,at.removeAttribute("x"),at.removeAttribute("y"),xt=at.getAttribute("transform")+xt;return at.setAttribute("transform",xt),St}function Q(F,W){for(;F&&(F=F.parentNode);)if(F.nodeName&&W.test(F.nodeName.replace("svg:",""))&&!F.getAttribute("instantiated_by_use"))return!0;return!1}a.parseSVGDocument=function(F,W,X,Z){if(!!F){Nt(F);var gt=a.Object.__uid++,ht,bt,Tt=q(F),xt=a.util.toArray(F.getElementsByTagName("*"));if(Tt.crossOrigin=Z&&Z.crossOrigin,Tt.svgUid=gt,xt.length===0&&a.isLikelyNode){xt=F.selectNodes('//*[name(.)!="svg"]');var at=[];for(ht=0,bt=xt.length;htu.x&&this.y>u.y},gte:function(u){return this.x>=u.x&&this.y>=u.y},lerp:function(u,t){return typeof t=="undefined"&&(t=.5),t=Math.max(Math.min(1,t),0),new d(this.x+(u.x-this.x)*t,this.y+(u.y-this.y)*t)},distanceFrom:function(u){var t=this.x-u.x,e=this.y-u.y;return Math.sqrt(t*t+e*e)},midPointFrom:function(u){return this.lerp(u)},min:function(u){return new d(Math.min(this.x,u.x),Math.min(this.y,u.y))},max:function(u){return new d(Math.max(this.x,u.x),Math.max(this.y,u.y))},toString:function(){return this.x+","+this.y},setXY:function(u,t){return this.x=u,this.y=t,this},setX:function(u){return this.x=u,this},setY:function(u){return this.y=u,this},setFromPoint:function(u){return this.x=u.x,this.y=u.y,this},swap:function(u){var t=this.x,e=this.y;this.x=u.x,this.y=u.y,u.x=t,u.y=e},clone:function(){return new d(this.x,this.y)}}}(x),function(p){"use strict";var a=p.fabric||(p.fabric={});if(a.Intersection){a.warn("fabric.Intersection is already defined");return}function d(u){this.status=u,this.points=[]}a.Intersection=d,a.Intersection.prototype={constructor:d,appendPoint:function(u){return this.points.push(u),this},appendPoints:function(u){return this.points=this.points.concat(u),this}},a.Intersection.intersectLineLine=function(u,t,e,i){var s,m=(i.x-e.x)*(u.y-e.y)-(i.y-e.y)*(u.x-e.x),o=(t.x-u.x)*(u.y-e.y)-(t.y-u.y)*(u.x-e.x),y=(i.y-e.y)*(t.x-u.x)-(i.x-e.x)*(t.y-u.y);if(y!==0){var C=m/y,b=o/y;0<=C&&C<=1&&0<=b&&b<=1?(s=new d("Intersection"),s.appendPoint(new a.Point(u.x+C*(t.x-u.x),u.y+C*(t.y-u.y)))):s=new d}else m===0||o===0?s=new d("Coincident"):s=new d("Parallel");return s},a.Intersection.intersectLinePolygon=function(u,t,e){var i=new d,s=e.length,m,o,y,C;for(C=0;C0&&(i.status="Intersection"),i},a.Intersection.intersectPolygonPolygon=function(u,t){var e=new d,i=u.length,s;for(s=0;s0&&(e.status="Intersection"),e},a.Intersection.intersectPolygonRectangle=function(u,t,e){var i=t.min(e),s=t.max(e),m=new a.Point(s.x,i.y),o=new a.Point(i.x,s.y),y=d.intersectLinePolygon(i,m,u),C=d.intersectLinePolygon(m,s,u),b=d.intersectLinePolygon(s,o,u),E=d.intersectLinePolygon(o,i,u),O=new d;return O.appendPoints(y.points),O.appendPoints(C.points),O.appendPoints(b.points),O.appendPoints(E.points),O.points.length>0&&(O.status="Intersection"),O}}(x),function(p){"use strict";var a=p.fabric||(p.fabric={});if(a.Color){a.warn("fabric.Color is already defined.");return}function d(t){t?this._tryParsingColor(t):this.setSource([0,0,0,1])}a.Color=d,a.Color.prototype={_tryParsingColor:function(t){var e;t in d.colorNameMap&&(t=d.colorNameMap[t]),t==="transparent"&&(e=[255,255,255,0]),e||(e=d.sourceFromHex(t)),e||(e=d.sourceFromRgb(t)),e||(e=d.sourceFromHsl(t)),e||(e=[0,0,0,1]),e&&this.setSource(e)},_rgbToHsl:function(t,e,i){t/=255,e/=255,i/=255;var s,m,o,y=a.util.array.max([t,e,i]),C=a.util.array.min([t,e,i]);if(o=(y+C)/2,y===C)s=m=0;else{var b=y-C;switch(m=o>.5?b/(2-y-C):b/(y+C),y){case t:s=(e-i)/b+(e1&&(i-=1),i<1/6?t+(e-t)*6*i:i<1/2?e:i<2/3?t+(e-t)*(2/3-i)*6:t}a.Color.fromRgb=function(t){return d.fromSource(d.sourceFromRgb(t))},a.Color.sourceFromRgb=function(t){var e=t.match(d.reRGBa);if(e){var i=parseInt(e[1],10)/(/%$/.test(e[1])?100:1)*(/%$/.test(e[1])?255:1),s=parseInt(e[2],10)/(/%$/.test(e[2])?100:1)*(/%$/.test(e[2])?255:1),m=parseInt(e[3],10)/(/%$/.test(e[3])?100:1)*(/%$/.test(e[3])?255:1);return[parseInt(i,10),parseInt(s,10),parseInt(m,10),e[4]?parseFloat(e[4]):1]}},a.Color.fromRgba=d.fromRgb,a.Color.fromHsl=function(t){return d.fromSource(d.sourceFromHsl(t))},a.Color.sourceFromHsl=function(t){var e=t.match(d.reHSLa);if(!!e){var i=(parseFloat(e[1])%360+360)%360/360,s=parseFloat(e[2])/(/%$/.test(e[2])?100:1),m=parseFloat(e[3])/(/%$/.test(e[3])?100:1),o,y,C;if(s===0)o=y=C=m;else{var b=m<=.5?m*(s+1):m+s-m*s,E=m*2-b;o=u(E,b,i+1/3),y=u(E,b,i),C=u(E,b,i-1/3)}return[Math.round(o*255),Math.round(y*255),Math.round(C*255),e[4]?parseFloat(e[4]):1]}},a.Color.fromHsla=d.fromHsl,a.Color.fromHex=function(t){return d.fromSource(d.sourceFromHex(t))},a.Color.sourceFromHex=function(t){if(t.match(d.reHex)){var e=t.slice(t.indexOf("#")+1),i=e.length===3||e.length===4,s=e.length===8||e.length===4,m=i?e.charAt(0)+e.charAt(0):e.substring(0,2),o=i?e.charAt(1)+e.charAt(1):e.substring(2,4),y=i?e.charAt(2)+e.charAt(2):e.substring(4,6),C=s?i?e.charAt(3)+e.charAt(3):e.substring(6,8):"FF";return[parseInt(m,16),parseInt(o,16),parseInt(y,16),parseFloat((parseInt(C,16)/255).toFixed(2))]}},a.Color.fromSource=function(t){var e=new d;return e.setSource(t),e}}(x),function(p){"use strict";var a=p.fabric||(p.fabric={}),d=["e","se","s","sw","w","nw","n","ne","e"],u=["ns","nesw","ew","nwse"],t={},e="left",i="top",s="right",m="bottom",o="center",y={top:m,bottom:i,left:s,right:e,center:o},C=a.util.radiansToDegrees,b=Math.sign||function(at){return(at>0)-(at<0)||+at};function E(at,$){var et=at.angle+C(Math.atan2($.y,$.x))+360;return Math.round(et%360/45)}function O(at,$){var et=$.transform.target,ct=et.canvas,ft=a.util.object.clone($);ft.target=et,ct&&ct.fire("object:"+at,ft),et.fire(at,$)}function L(at,$){var et=$.canvas,ct=et.uniScaleKey,ft=at[ct];return et.uniformScaling&&!ft||!et.uniformScaling&&ft}function N(at){return at.originX===o&&at.originY===o}function B(at,$,et){var ct=at.lockScalingX,ft=at.lockScalingY;return!!(ct&&ft||!$&&(ct||ft)&&et||ct&&$==="x"||ft&&$==="y")}function Y(at,$,et){var ct="not-allowed",ft=L(at,et),Ct="";if($.x!==0&&$.y===0?Ct="x":$.x===0&&$.y!==0&&(Ct="y"),B(et,Ct,ft))return ct;var _t=E(et,$);return d[_t]+"-resize"}function nt(at,$,et){var ct="not-allowed";if($.x!==0&&et.lockSkewingY||$.y!==0&&et.lockSkewingX)return ct;var ft=E(et,$)%4;return u[ft]+"-resize"}function it(at,$,et){return at[et.canvas.altActionKey]?t.skewCursorStyleHandler(at,$,et):t.scaleCursorStyleHandler(at,$,et)}function Mt(at,$,et){var ct=at[et.canvas.altActionKey];if($.x===0)return ct?"skewX":"scaleY";if($.y===0)return ct?"skewY":"scaleX"}function K(at,$,et){return et.lockRotation?"not-allowed":$.cursorStyle}function It(at,$,et,ct){return{e:at,transform:$,pointer:{x:et,y:ct}}}function U(at){return function($,et,ct,ft){var Ct=et.target,_t=Ct.getCenterPoint(),Zt=Ct.translateToOriginPoint(_t,et.originX,et.originY),Xt=at($,et,ct,ft);return Ct.setPositionByOrigin(Zt,et.originX,et.originY),Xt}}function Lt(at,$){return function(et,ct,ft,Ct){var _t=$(et,ct,ft,Ct);return _t&&O(at,It(et,ct,ft,Ct)),_t}}function dt(at,$,et,ct,ft){var Ct=at.target,_t=Ct.controls[at.corner],Zt=Ct.canvas.getZoom(),Xt=Ct.padding/Zt,St=Ct.toLocalPoint(new a.Point(ct,ft),$,et);return St.x>=Xt&&(St.x-=Xt),St.x<=-Xt&&(St.x+=Xt),St.y>=Xt&&(St.y-=Xt),St.y<=Xt&&(St.y+=Xt),St.x-=_t.offsetX,St.y-=_t.offsetY,St}function Nt(at){return at.flipX!==at.flipY}function V(at,$,et,ct,ft){if(at[$]!==0){var Ct=at._getTransformedDimensions()[ct],_t=ft/Ct*at[et];at.set(et,_t)}}function q(at,$,et,ct){var ft=$.target,Ct=ft._getTransformedDimensions(0,ft.skewY),_t=dt($,$.originX,$.originY,et,ct),Zt=Math.abs(_t.x*2)-Ct.x,Xt=ft.skewX,St;Zt<2?St=0:(St=C(Math.atan2(Zt/ft.scaleX,Ct.y/ft.scaleY)),$.originX===e&&$.originY===m&&(St=-St),$.originX===s&&$.originY===i&&(St=-St),Nt(ft)&&(St=-St));var Jt=Xt!==St;if(Jt){var Kt=ft._getTransformedDimensions().y;ft.set("skewX",St),V(ft,"skewY","scaleY","y",Kt)}return Jt}function Q(at,$,et,ct){var ft=$.target,Ct=ft._getTransformedDimensions(ft.skewX,0),_t=dt($,$.originX,$.originY,et,ct),Zt=Math.abs(_t.y*2)-Ct.y,Xt=ft.skewY,St;Zt<2?St=0:(St=C(Math.atan2(Zt/ft.scaleY,Ct.x/ft.scaleX)),$.originX===e&&$.originY===m&&(St=-St),$.originX===s&&$.originY===i&&(St=-St),Nt(ft)&&(St=-St));var Jt=Xt!==St;if(Jt){var Kt=ft._getTransformedDimensions().x;ft.set("skewY",St),V(ft,"skewX","scaleX","x",Kt)}return Jt}function G(at,$,et,ct){var ft=$.target,Ct=ft.skewX,_t,Zt=$.originY;if(ft.lockSkewingX)return!1;if(Ct===0){var Xt=dt($,o,o,et,ct);Xt.x>0?_t=e:_t=s}else Ct>0&&(_t=Zt===i?e:s),Ct<0&&(_t=Zt===i?s:e),Nt(ft)&&(_t=_t===e?s:e);$.originX=_t;var St=Lt("skewing",U(q));return St(at,$,et,ct)}function rt(at,$,et,ct){var ft=$.target,Ct=ft.skewY,_t,Zt=$.originX;if(ft.lockSkewingY)return!1;if(Ct===0){var Xt=dt($,o,o,et,ct);Xt.y>0?_t=i:_t=m}else Ct>0&&(_t=Zt===e?i:m),Ct<0&&(_t=Zt===e?m:i),Nt(ft)&&(_t=_t===i?m:i);$.originY=_t;var St=Lt("skewing",U(Q));return St(at,$,et,ct)}function F(at,$,et,ct){var ft=$,Ct=ft.target,_t=Ct.translateToOriginPoint(Ct.getCenterPoint(),ft.originX,ft.originY);if(Ct.lockRotation)return!1;var Zt=Math.atan2(ft.ey-_t.y,ft.ex-_t.x),Xt=Math.atan2(ct-_t.y,et-_t.x),St=C(Xt-Zt+ft.theta),Jt=!0;if(Ct.snapAngle>0){var Kt=Ct.snapAngle,ae=Ct.snapThreshold||Kt,ve=Math.ceil(St/Kt)*Kt,ue=Math.floor(St/Kt)*Kt;Math.abs(St-ue)b?(Y=C,i.scale(1,b/C),B=m*C/b):b>C?(Y=b,i.scale(C/b,1),N=s*b/C):Y=C,i.lineWidth=1,i.beginPath(),i.arc(N,B,Y/2,0,2*Math.PI,!1),i[O](),L&&i.stroke(),i.restore()}function e(i,s,m,o,y){o=o||{};var C=this.sizeX||o.cornerSize||y.cornerSize,b=this.sizeY||o.cornerSize||y.cornerSize,E=typeof o.transparentCorners!="undefined"?o.transparentCorners:y.transparentCorners,O=E?"stroke":"fill",L=!E&&(o.cornerStrokeColor||y.cornerStrokeColor),N=C/2,B=b/2;i.save(),i.fillStyle=o.cornerColor||y.cornerColor,i.strokeStyle=o.cornerStrokeColor||y.cornerStrokeColor,i.lineWidth=1,i.translate(s,m),i.rotate(d(y.angle)),i[O+"Rect"](-N,-B,C,b),L&&i.strokeRect(-N,-B,C,b),i.restore()}u.renderCircleControl=t,u.renderSquareControl=e}(x),function(p){"use strict";var a=p.fabric||(p.fabric={});function d(u){for(var t in u)this[t]=u[t]}a.Control=d,a.Control.prototype={visible:!0,actionName:"scale",angle:0,x:0,y:0,offsetX:0,offsetY:0,sizeX:null,sizeY:null,touchSizeX:null,touchSizeY:null,cursorStyle:"crosshair",withConnection:!1,actionHandler:function(){},mouseDownHandler:function(){},mouseUpHandler:function(){},getActionHandler:function(){return this.actionHandler},getMouseDownHandler:function(){return this.mouseDownHandler},getMouseUpHandler:function(){return this.mouseUpHandler},cursorStyleHandler:function(u,t){return t.cursorStyle},getActionName:function(u,t){return t.actionName},getVisibility:function(u,t){var e=u._controlsVisibility;return e&&typeof e[t]!="undefined"?e[t]:this.visible},setVisibility:function(u){this.visible=u},positionHandler:function(u,t){var e=a.util.transformPoint({x:this.x*u.x+this.offsetX,y:this.y*u.y+this.offsetY},t);return e},calcCornerCoords:function(u,t,e,i,s){var m,o,y,C,b=s?this.touchSizeX:this.sizeX,E=s?this.touchSizeY:this.sizeY;if(b&&E&&b!==E){var O=Math.atan2(E,b),L=Math.sqrt(b*b+E*E)/2,N=O-a.util.degreesToRadians(u),B=Math.PI/2-O-a.util.degreesToRadians(u);m=L*a.util.cos(N),o=L*a.util.sin(N),y=L*a.util.cos(B),C=L*a.util.sin(B)}else{var Y=b&&E?b:t;L=Y*.7071067812;var N=a.util.degreesToRadians(45-u);m=y=L*a.util.cos(N),o=C=L*a.util.sin(N)}return{tl:{x:e-C,y:i-y},tr:{x:e+m,y:i-o},bl:{x:e-m,y:i+o},br:{x:e+C,y:i+y}}},render:function(u,t,e,i,s){switch(i=i||{},i.cornerStyle||s.cornerStyle){case"circle":a.controlsUtils.renderCircleControl.call(this,u,t,e,i,s);break;default:a.controlsUtils.renderSquareControl.call(this,u,t,e,i,s)}}}}(x),function(){function p(e,i){var s=e.getAttribute("style"),m=e.getAttribute("offset")||0,o,y,C,b;if(m=parseFloat(m)/(/%$/.test(m)?100:1),m=m<0?0:m>1?1:m,s){var E=s.split(/\s*;\s*/);for(E[E.length-1]===""&&E.pop(),b=E.length;b--;){var O=E[b].split(/\s*:\s*/),L=O[0].trim(),N=O[1].trim();L==="stop-color"?o=N:L==="stop-opacity"&&(C=N)}}return o||(o=e.getAttribute("stop-color")||"rgb(0,0,0)"),C||(C=e.getAttribute("stop-opacity")),o=new c.Color(o),y=o.getAlpha(),C=isNaN(parseFloat(C))?1:parseFloat(C),C*=y*i,{offset:m,color:o.toRgb(),opacity:C}}function a(e){return{x1:e.getAttribute("x1")||0,y1:e.getAttribute("y1")||0,x2:e.getAttribute("x2")||"100%",y2:e.getAttribute("y2")||0}}function d(e){return{x1:e.getAttribute("fx")||e.getAttribute("cx")||"50%",y1:e.getAttribute("fy")||e.getAttribute("cy")||"50%",r1:0,x2:e.getAttribute("cx")||"50%",y2:e.getAttribute("cy")||"50%",r2:e.getAttribute("r")||"50%"}}var u=c.util.object.clone;c.Gradient=c.util.createClass({offsetX:0,offsetY:0,gradientTransform:null,gradientUnits:"pixels",type:"linear",initialize:function(e){e||(e={}),e.coords||(e.coords={});var i,s=this;Object.keys(e).forEach(function(m){s[m]=e[m]}),this.id?this.id+="_"+c.Object.__uid++:this.id=c.Object.__uid++,i={x1:e.coords.x1||0,y1:e.coords.y1||0,x2:e.coords.x2||0,y2:e.coords.y2||0},this.type==="radial"&&(i.r1=e.coords.r1||0,i.r2=e.coords.r2||0),this.coords=i,this.colorStops=e.colorStops.slice()},addColorStop:function(e){for(var i in e){var s=new c.Color(e[i]);this.colorStops.push({offset:parseFloat(i),color:s.toRgb(),opacity:s.getAlpha()})}return this},toObject:function(e){var i={type:this.type,coords:this.coords,colorStops:this.colorStops,offsetX:this.offsetX,offsetY:this.offsetY,gradientUnits:this.gradientUnits,gradientTransform:this.gradientTransform?this.gradientTransform.concat():this.gradientTransform};return c.util.populateWithProperties(this,i,e),i},toSVG:function(e,i){var s=u(this.coords,!0),m,o,i=i||{},y,C,b=u(this.colorStops,!0),E=s.r1>s.r2,O=this.gradientTransform?this.gradientTransform.concat():c.iMatrix.concat(),L=-this.offsetX,N=-this.offsetY,B=!!i.additionalTransform,Y=this.gradientUnits==="pixels"?"userSpaceOnUse":"objectBoundingBox";if(b.sort(function(It,U){return It.offset-U.offset}),Y==="objectBoundingBox"?(L/=e.width,N/=e.height):(L+=e.width/2,N+=e.height/2),e.type==="path"&&this.gradientUnits!=="percentage"&&(L-=e.pathOffset.x,N-=e.pathOffset.y),O[4]-=L,O[5]-=N,C='id="SVGID_'+this.id+'" gradientUnits="'+Y+'"',C+=' gradientTransform="'+(B?i.additionalTransform+" ":"")+c.util.matrixToSVG(O)+'" ',this.type==="linear"?y=[" `]:this.type==="radial"&&(y=[" `]),this.type==="radial"){if(E)for(b=b.concat(),b.reverse(),m=0,o=b.length;m0){var it=Math.max(s.r1,s.r2),Mt=nt/it;for(m=0,o=b.length;m `)}return y.push(this.type==="linear"?` `:` `),y.join("")},toLive:function(e){var i,s=c.util.object.clone(this.coords),m,o;if(!!this.type){for(this.type==="linear"?i=e.createLinearGradient(s.x1,s.y1,s.x2,s.y2):this.type==="radial"&&(i=e.createRadialGradient(s.x1,s.y1,s.r1,s.x2,s.y2,s.r2)),m=0,o=this.colorStops.length;m1?1:o,isNaN(o)&&(o=1);var y=e.getElementsByTagName("stop"),C,b=e.getAttribute("gradientUnits")==="userSpaceOnUse"?"pixels":"percentage",E=e.getAttribute("gradientTransform")||"",O=[],L,N,B=0,Y=0,nt;for(e.nodeName==="linearGradient"||e.nodeName==="LINEARGRADIENT"?(C="linear",L=a(e)):(C="radial",L=d(e)),N=y.length;N--;)O.push(p(y[N],o));nt=c.parseTransformAttribute(E),t(i,L,m,b),b==="pixels"&&(B=-i.left,Y=-i.top);var it=new c.Gradient({id:e.getAttribute("id"),type:C,coords:L,colorStops:O,gradientUnits:b,gradientTransform:nt,offsetX:B,offsetY:Y});return it}});function t(e,i,s,m){var o,y;Object.keys(i).forEach(function(C){o=i[C],o==="Infinity"?y=1:o==="-Infinity"?y=0:(y=parseFloat(i[C],10),typeof o=="string"&&/^(\d+\.\d+)%|(\d+)%$/.test(o)&&(y*=.01,m==="pixels"&&((C==="x1"||C==="x2"||C==="r2")&&(y*=s.viewBoxWidth||s.width),(C==="y1"||C==="y2")&&(y*=s.viewBoxHeight||s.height)))),i[C]=y})}}(),function(){"use strict";var p=c.util.toFixed;c.Pattern=c.util.createClass({repeat:"repeat",offsetX:0,offsetY:0,crossOrigin:"",patternTransform:null,initialize:function(a,d){if(a||(a={}),this.id=c.Object.__uid++,this.setOptions(a),!a.source||a.source&&typeof a.source!="string"){d&&d(this);return}else{var u=this;this.source=c.util.createImage(),c.util.loadImage(a.source,function(t,e){u.source=t,d&&d(u,e)},null,this.crossOrigin)}},toObject:function(a){var d=c.Object.NUM_FRACTION_DIGITS,u,t;return typeof this.source.src=="string"?u=this.source.src:typeof this.source=="object"&&this.source.toDataURL&&(u=this.source.toDataURL()),t={type:"pattern",source:u,repeat:this.repeat,crossOrigin:this.crossOrigin,offsetX:p(this.offsetX,d),offsetY:p(this.offsetY,d),patternTransform:this.patternTransform?this.patternTransform.concat():null},c.util.populateWithProperties(this,t,a),t},toSVG:function(a){var d=typeof this.source=="function"?this.source():this.source,u=d.width/a.width,t=d.height/a.height,e=this.offsetX/a.width,i=this.offsetY/a.height,s="";return(this.repeat==="repeat-x"||this.repeat==="no-repeat")&&(t=1,i&&(t+=Math.abs(i))),(this.repeat==="repeat-y"||this.repeat==="no-repeat")&&(u=1,e&&(u+=Math.abs(e))),d.src?s=d.src:d.toDataURL&&(s=d.toDataURL()),' `},setOptions:function(a){for(var d in a)this[d]=a[d]},toLive:function(a){var d=this.source;return!d||typeof d.src!="undefined"&&(!d.complete||d.naturalWidth===0||d.naturalHeight===0)?"":a.createPattern(d,this.repeat)}})}(),function(p){"use strict";var a=p.fabric||(p.fabric={}),d=a.util.toFixed;if(a.Shadow){a.warn("fabric.Shadow is already defined.");return}a.Shadow=a.util.createClass({color:"rgb(0,0,0)",blur:0,offsetX:0,offsetY:0,affectStroke:!1,includeDefaultValues:!0,nonScaling:!1,initialize:function(u){typeof u=="string"&&(u=this._parseShadow(u));for(var t in u)this[t]=u[t];this.id=a.Object.__uid++},_parseShadow:function(u){var t=u.trim(),e=a.Shadow.reOffsetsAndBlur.exec(t)||[],i=t.replace(a.Shadow.reOffsetsAndBlur,"")||"rgb(0,0,0)";return{color:i.trim(),offsetX:parseFloat(e[1],10)||0,offsetY:parseFloat(e[2],10)||0,blur:parseFloat(e[3],10)||0}},toString:function(){return[this.offsetX,this.offsetY,this.blur,this.color].join("px ")},toSVG:function(u){var t=40,e=40,i=a.Object.NUM_FRACTION_DIGITS,s=a.util.rotateVector({x:this.offsetX,y:this.offsetY},a.util.degreesToRadians(-u.angle)),m=20,o=new a.Color(this.color);return u.width&&u.height&&(t=d((Math.abs(s.x)+this.blur)/u.width,i)*100+m,e=d((Math.abs(s.y)+this.blur)/u.height,i)*100+m),u.flipX&&(s.x*=-1),u.flipY&&(s.y*=-1),' `},toObject:function(){if(this.includeDefaultValues)return{color:this.color,blur:this.blur,offsetX:this.offsetX,offsetY:this.offsetY,affectStroke:this.affectStroke,nonScaling:this.nonScaling};var u={},t=a.Shadow.prototype;return["color","blur","offsetX","offsetY","affectStroke","nonScaling"].forEach(function(e){this[e]!==t[e]&&(u[e]=this[e])},this),u}}),a.Shadow.reOffsetsAndBlur=/(?:\s|^)(-?\d+(?:\.\d*)?(?:px)?(?:\s?|$))?(-?\d+(?:\.\d*)?(?:px)?(?:\s?|$))?(\d+(?:\.\d*)?(?:px)?)?(?:\s?|$)(?:$|\s)/}(x),function(){"use strict";if(c.StaticCanvas){c.warn("fabric.StaticCanvas is already defined.");return}var p=c.util.object.extend,a=c.util.getElementOffset,d=c.util.removeFromArray,u=c.util.toFixed,t=c.util.transformPoint,e=c.util.invertTransform,i=c.util.getNodeCanvas,s=c.util.createCanvasElement,m=new Error("Could not initialize `canvas` element");c.StaticCanvas=c.util.createClass(c.CommonMethods,{initialize:function(o,y){y||(y={}),this.renderAndResetBound=this.renderAndReset.bind(this),this.requestRenderAllBound=this.requestRenderAll.bind(this),this._initStatic(o,y)},backgroundColor:"",backgroundImage:null,overlayColor:"",overlayImage:null,includeDefaultValues:!0,stateful:!1,renderOnAddRemove:!0,controlsAboveOverlay:!1,allowTouchScrolling:!1,imageSmoothingEnabled:!0,viewportTransform:c.iMatrix.concat(),backgroundVpt:!0,overlayVpt:!0,enableRetinaScaling:!0,vptCoords:{},skipOffscreen:!0,clipPath:void 0,_initStatic:function(o,y){var C=this.requestRenderAllBound;this._objects=[],this._createLowerCanvas(o),this._initOptions(y),this.interactive||this._initRetinaScaling(),y.overlayImage&&this.setOverlayImage(y.overlayImage,C),y.backgroundImage&&this.setBackgroundImage(y.backgroundImage,C),y.backgroundColor&&this.setBackgroundColor(y.backgroundColor,C),y.overlayColor&&this.setOverlayColor(y.overlayColor,C),this.calcOffset()},_isRetinaScaling:function(){return c.devicePixelRatio!==1&&this.enableRetinaScaling},getRetinaScaling:function(){return this._isRetinaScaling()?c.devicePixelRatio:1},_initRetinaScaling:function(){if(!!this._isRetinaScaling()){var o=c.devicePixelRatio;this.__initRetinaScaling(o,this.lowerCanvasEl,this.contextContainer),this.upperCanvasEl&&this.__initRetinaScaling(o,this.upperCanvasEl,this.contextTop)}},__initRetinaScaling:function(o,y,C){y.setAttribute("width",this.width*o),y.setAttribute("height",this.height*o),C.scale(o,o)},calcOffset:function(){return this._offset=a(this.lowerCanvasEl),this},setOverlayImage:function(o,y,C){return this.__setBgOverlayImage("overlayImage",o,y,C)},setBackgroundImage:function(o,y,C){return this.__setBgOverlayImage("backgroundImage",o,y,C)},setOverlayColor:function(o,y){return this.__setBgOverlayColor("overlayColor",o,y)},setBackgroundColor:function(o,y){return this.__setBgOverlayColor("backgroundColor",o,y)},__setBgOverlayImage:function(o,y,C,b){return typeof y=="string"?c.util.loadImage(y,function(E,O){if(E){var L=new c.Image(E,b);this[o]=L,L.canvas=this}C&&C(E,O)},this,b&&b.crossOrigin):(b&&y.setOptions(b),this[o]=y,y&&(y.canvas=this),C&&C(y,!1)),this},__setBgOverlayColor:function(o,y,C){return this[o]=y,this._initGradient(y,o),this._initPattern(y,o,C),this},_createCanvasElement:function(){var o=s();if(!o||(o.style||(o.style={}),typeof o.getContext=="undefined"))throw m;return o},_initOptions:function(o){var y=this.lowerCanvasEl;this._setOptions(o),this.width=this.width||parseInt(y.width,10)||0,this.height=this.height||parseInt(y.height,10)||0,!!this.lowerCanvasEl.style&&(y.width=this.width,y.height=this.height,y.style.width=this.width+"px",y.style.height=this.height+"px",this.viewportTransform=this.viewportTransform.slice())},_createLowerCanvas:function(o){o&&o.getContext?this.lowerCanvasEl=o:this.lowerCanvasEl=c.util.getById(o)||this._createCanvasElement(),c.util.addClass(this.lowerCanvasEl,"lower-canvas"),this._originalCanvasStyle=this.lowerCanvasEl.style,this.interactive&&this._applyCanvasStyle(this.lowerCanvasEl),this.contextContainer=this.lowerCanvasEl.getContext("2d")},getWidth:function(){return this.width},getHeight:function(){return this.height},setWidth:function(o,y){return this.setDimensions({width:o},y)},setHeight:function(o,y){return this.setDimensions({height:o},y)},setDimensions:function(o,y){var C;y=y||{};for(var b in o)C=o[b],y.cssOnly||(this._setBackstoreDimension(b,o[b]),C+="px",this.hasLostContext=!0),y.backstoreOnly||this._setCssDimension(b,C);return this._isCurrentlyDrawing&&this.freeDrawingBrush&&this.freeDrawingBrush._setBrushStyles(),this._initRetinaScaling(),this.calcOffset(),y.cssOnly||this.requestRenderAll(),this},_setBackstoreDimension:function(o,y){return this.lowerCanvasEl[o]=y,this.upperCanvasEl&&(this.upperCanvasEl[o]=y),this.cacheCanvasEl&&(this.cacheCanvasEl[o]=y),this[o]=y,this},_setCssDimension:function(o,y){return this.lowerCanvasEl.style[o]=y,this.upperCanvasEl&&(this.upperCanvasEl.style[o]=y),this.wrapperEl&&(this.wrapperEl.style[o]=y),this},getZoom:function(){return this.viewportTransform[0]},setViewportTransform:function(o){var y=this._activeObject,C=this.backgroundImage,b=this.overlayImage,E,O,L;for(this.viewportTransform=o,O=0,L=this._objects.length;O `),this._setSVGBgOverlayColor(C,"background"),this._setSVGBgOverlayImage(C,"backgroundImage",y),this._setSVGObjects(C,y),this.clipPath&&C.push(` `),this._setSVGBgOverlayColor(C,"overlay"),this._setSVGBgOverlayImage(C,"overlayImage",y),C.push(""),C.join("")},_setSVGPreamble:function(o,y){y.suppressPreamble||o.push(' `,' `)},_setSVGHeader:function(o,y){var C=y.width||this.width,b=y.height||this.height,E,O='viewBox="0 0 '+this.width+" "+this.height+'" ',L=c.Object.NUM_FRACTION_DIGITS;y.viewBox?O='viewBox="'+y.viewBox.x+" "+y.viewBox.y+" "+y.viewBox.width+" "+y.viewBox.height+'" ':this.svgViewportTransformation&&(E=this.viewportTransform,O='viewBox="'+u(-E[4]/E[0],L)+" "+u(-E[5]/E[3],L)+" "+u(this.width/E[0],L)+" "+u(this.height/E[3],L)+'" '),o.push(" `,"Created with Fabric.js ",c.version,` `,` `,this.createSVGFontFacesMarkup(),this.createSVGRefElementsMarkup(),this.createSVGClipPathMarkup(y),` `)},createSVGClipPathMarkup:function(o){var y=this.clipPath;return y?(y.clipPathId="CLIPPATH_"+c.Object.__uid++,' `+this.clipPath.toClipPathSVG(o.reviver)+` `):""},createSVGRefElementsMarkup:function(){var o=this,y=["background","overlay"].map(function(C){var b=o[C+"Color"];if(b&&b.toLive){var E=o[C+"Vpt"],O=o.viewportTransform,L={width:o.width/(E?O[0]:1),height:o.height/(E?O[3]:1)};return b.toSVG(L,{additionalTransform:E?c.util.matrixToSVG(O):""})}});return y.join("")},createSVGFontFacesMarkup:function(){var o="",y={},C,b,E,O,L,N,B,Y,nt,it=c.fontPaths,Mt=[];for(this._objects.forEach(function It(U){Mt.push(U),U._objects&&U._objects.forEach(It)}),Y=0,nt=Mt.length;Y',` `,o,"",` `].join("")),o},_setSVGObjects:function(o,y){var C,b,E,O=this._objects;for(b=0,E=O.length;b `)}else o.push(' `)},sendToBack:function(o){if(!o)return this;var y=this._activeObject,C,b,E;if(o===y&&o.type==="activeSelection")for(E=y._objects,C=E.length;C--;)b=E[C],d(this._objects,b),this._objects.unshift(b);else d(this._objects,o),this._objects.unshift(o);return this.renderOnAddRemove&&this.requestRenderAll(),this},bringToFront:function(o){if(!o)return this;var y=this._activeObject,C,b,E;if(o===y&&o.type==="activeSelection")for(E=y._objects,C=0;C0+B&&(L=O-1,d(this._objects,E),this._objects.splice(L,0,E)),B++;else O=this._objects.indexOf(o),O!==0&&(L=this._findNewLowerIndex(o,O,y),d(this._objects,o),this._objects.splice(L,0,o));return this.renderOnAddRemove&&this.requestRenderAll(),this},_findNewLowerIndex:function(o,y,C){var b,E;if(C)for(b=y,E=y-1;E>=0;--E){var O=o.intersectsWithObject(this._objects[E])||o.isContainedWithinObject(this._objects[E])||this._objects[E].isContainedWithinObject(o);if(O){b=E;break}}else b=y-1;return b},bringForward:function(o,y){if(!o)return this;var C=this._activeObject,b,E,O,L,N,B=0;if(o===C&&o.type==="activeSelection")for(N=C._objects,b=N.length;b--;)E=N[b],O=this._objects.indexOf(E),O"}}),p(c.StaticCanvas.prototype,c.Observable),p(c.StaticCanvas.prototype,c.Collection),p(c.StaticCanvas.prototype,c.DataURLExporter),p(c.StaticCanvas,{EMPTY_JSON:'{"objects": [], "background": "white"}',supports:function(o){var y=s();if(!y||!y.getContext)return null;var C=y.getContext("2d");if(!C)return null;switch(o){case"setLineDash":return typeof C.setLineDash!="undefined";default:return null}}}),c.StaticCanvas.prototype.toJSON=c.StaticCanvas.prototype.toObject,c.isLikelyNode&&(c.StaticCanvas.prototype.createPNGStream=function(){var o=i(this.lowerCanvasEl);return o&&o.createPNGStream()},c.StaticCanvas.prototype.createJPEGStream=function(o){var y=i(this.lowerCanvasEl);return y&&y.createJPEGStream(o)})}(),c.BaseBrush=c.util.createClass({color:"rgb(0, 0, 0)",width:1,shadow:null,strokeLineCap:"round",strokeLineJoin:"round",strokeMiterLimit:10,strokeDashArray:null,limitedToCanvasSize:!1,_setBrushStyles:function(){var p=this.canvas.contextTop;p.strokeStyle=this.color,p.lineWidth=this.width,p.lineCap=this.strokeLineCap,p.miterLimit=this.strokeMiterLimit,p.lineJoin=this.strokeLineJoin,p.setLineDash(this.strokeDashArray||[])},_saveAndTransform:function(p){var a=this.canvas.viewportTransform;p.save(),p.transform(a[0],a[1],a[2],a[3],a[4],a[5])},_setShadow:function(){if(!!this.shadow){var p=this.canvas,a=this.shadow,d=p.contextTop,u=p.getZoom();p&&p._isRetinaScaling()&&(u*=c.devicePixelRatio),d.shadowColor=a.color,d.shadowBlur=a.blur*u,d.shadowOffsetX=a.offsetX*u,d.shadowOffsetY=a.offsetY*u}},needsFullRender:function(){var p=new c.Color(this.color);return p.getAlpha()<1||!!this.shadow},_resetShadow:function(){var p=this.canvas.contextTop;p.shadowColor="",p.shadowBlur=p.shadowOffsetX=p.shadowOffsetY=0},_isOutSideCanvas:function(p){return p.x<0||p.x>this.canvas.getWidth()||p.y<0||p.y>this.canvas.getHeight()}}),function(){c.PencilBrush=c.util.createClass(c.BaseBrush,{decimate:.4,initialize:function(p){this.canvas=p,this._points=[]},_drawSegment:function(p,a,d){var u=a.midPointFrom(d);return p.quadraticCurveTo(a.x,a.y,u.x,u.y),u},onMouseDown:function(p,a){!this.canvas._isMainEvent(a.e)||(this._prepareForDrawing(p),this._captureDrawingPath(p),this._render())},onMouseMove:function(p,a){if(!!this.canvas._isMainEvent(a.e)&&!(this.limitedToCanvasSize===!0&&this._isOutSideCanvas(p))&&this._captureDrawingPath(p)&&this._points.length>1)if(this.needsFullRender())this.canvas.clearContext(this.canvas.contextTop),this._render();else{var d=this._points,u=d.length,t=this.canvas.contextTop;this._saveAndTransform(t),this.oldEnd&&(t.beginPath(),t.moveTo(this.oldEnd.x,this.oldEnd.y)),this.oldEnd=this._drawSegment(t,d[u-2],d[u-1],!0),t.stroke(),t.restore()}},onMouseUp:function(p){return this.canvas._isMainEvent(p.e)?(this.oldEnd=void 0,this._finalizeAndAddPath(),!1):!0},_prepareForDrawing:function(p){var a=new c.Point(p.x,p.y);this._reset(),this._addPoint(a),this.canvas.contextTop.moveTo(a.x,a.y)},_addPoint:function(p){return this._points.length>1&&p.eq(this._points[this._points.length-1])?!1:(this._points.push(p),!0)},_reset:function(){this._points=[],this._setBrushStyles(),this._setShadow()},_captureDrawingPath:function(p){var a=new c.Point(p.x,p.y);return this._addPoint(a)},_render:function(){var p=this.canvas.contextTop,a,d,u=this._points[0],t=this._points[1];if(this._saveAndTransform(p),p.beginPath(),this._points.length===2&&u.x===t.x&&u.y===t.y){var e=this.width/1e3;u=new c.Point(u.x,u.y),t=new c.Point(t.x,t.y),u.x-=e,t.x+=e}for(p.moveTo(u.x,u.y),a=1,d=this._points.length;a=u&&(i=p[t],s.push(i));return s.push(p[e]),s},_finalizeAndAddPath:function(){var p=this.canvas.contextTop;p.closePath(),this.decimate&&(this._points=this.decimatePoints(this._points,this.decimate));var a=this.convertPointsToSVGPath(this._points);if(this._isEmptySVGPath(a)){this.canvas.requestRenderAll();return}var d=this.createPath(a);this.canvas.clearContext(this.canvas.contextTop),this.canvas.fire("before:path:created",{path:d}),this.canvas.add(d),this.canvas.requestRenderAll(),d.setCoords(),this._resetShadow(),this.canvas.fire("path:created",{path:d})}})}(),c.CircleBrush=c.util.createClass(c.BaseBrush,{width:10,initialize:function(p){this.canvas=p,this.points=[]},drawDot:function(p){var a=this.addPoint(p),d=this.canvas.contextTop;this._saveAndTransform(d),this.dot(d,a),d.restore()},dot:function(p,a){p.fillStyle=a.fill,p.beginPath(),p.arc(a.x,a.y,a.radius,0,Math.PI*2,!1),p.closePath(),p.fill()},onMouseDown:function(p){this.points.length=0,this.canvas.clearContext(this.canvas.contextTop),this._setShadow(),this.drawDot(p)},_render:function(){var p=this.canvas.contextTop,a,d,u=this.points;for(this._saveAndTransform(p),a=0,d=u.length;a0&&!this.preserveObjectStacking){i=[],s=[];for(var m=0,o=this._objects.length;m1&&(this._activeObject._objects=s),i.push.apply(i,s)}else i=this._objects;return i},renderAll:function(){this.contextTopDirty&&!this._groupSelector&&!this.isDrawingMode&&(this.clearContext(this.contextTop),this.contextTopDirty=!1),this.hasLostContext&&this.renderTopLayer(this.contextTop);var t=this.contextContainer;return this.renderCanvas(t,this._chooseObjectsToRender()),this},renderTopLayer:function(t){t.save(),this.isDrawingMode&&this._isCurrentlyDrawing&&(this.freeDrawingBrush&&this.freeDrawingBrush._render(),this.contextTopDirty=!0),this.selection&&this._groupSelector&&(this._drawSelection(t),this.contextTopDirty=!0),t.restore()},renderTop:function(){var t=this.contextTop;return this.clearContext(t),this.renderTopLayer(t),this.fire("after:render"),this},_normalizePointer:function(t,e){var i=t.calcTransformMatrix(),s=c.util.invertTransform(i),m=this.restorePointerVpt(e);return c.util.transformPoint(m,s)},isTargetTransparent:function(t,e,i){if(t.shouldCache()&&t._cacheCanvas&&t!==this._activeObject){var s=this._normalizePointer(t,{x:e,y:i}),m=Math.max(t.cacheTranslationX+s.x*t.zoomX,0),o=Math.max(t.cacheTranslationY+s.y*t.zoomY,0),E=c.util.isTransparent(t._cacheContext,Math.round(m),Math.round(o),this.targetFindTolerance);return E}var y=this.contextCache,C=t.selectionBackgroundColor,b=this.viewportTransform;t.selectionBackgroundColor="",this.clearContext(y),y.save(),y.transform(b[0],b[1],b[2],b[3],b[4],b[5]),t.render(y),y.restore(),t.selectionBackgroundColor=C;var E=c.util.isTransparent(y,e,i,this.targetFindTolerance);return E},_isSelectionKeyPressed:function(t){var e=!1;return Object.prototype.toString.call(this.selectionKey)==="[object Array]"?e=!!this.selectionKey.find(function(i){return t[i]===!0}):e=t[this.selectionKey],e},_shouldClearSelection:function(t,e){var i=this.getActiveObjects(),s=this._activeObject;return!e||e&&s&&i.length>1&&i.indexOf(e)===-1&&s!==e&&!this._isSelectionKeyPressed(t)||e&&!e.evented||e&&!e.selectable&&s&&s!==e},_shouldCenterTransform:function(t,e,i){if(!!t){var s;return e==="scale"||e==="scaleX"||e==="scaleY"||e==="resizing"?s=this.centeredScaling||t.centeredScaling:e==="rotate"&&(s=this.centeredRotation||t.centeredRotation),s?!i:i}},_getOriginFromCorner:function(t,e){var i={x:t.originX,y:t.originY};return e==="ml"||e==="tl"||e==="bl"?i.x="right":(e==="mr"||e==="tr"||e==="br")&&(i.x="left"),e==="tl"||e==="mt"||e==="tr"?i.y="bottom":(e==="bl"||e==="mb"||e==="br")&&(i.y="top"),i},_getActionFromCorner:function(t,e,i,s){if(!e||!t)return"drag";var m=s.controls[e];return m.getActionName(i,m,s)},_setupCurrentTransform:function(t,e,i){if(!!e){var s=this.getPointer(t),m=e.__corner,o=e.controls[m],y=i&&m?o.getActionHandler(t,e,o):c.controlsUtils.dragHandler,C=this._getActionFromCorner(i,m,t,e),b=this._getOriginFromCorner(e,m),E=t[this.centeredKey],O={target:e,action:C,actionHandler:y,corner:m,scaleX:e.scaleX,scaleY:e.scaleY,skewX:e.skewX,skewY:e.skewY,offsetX:s.x-e.left,offsetY:s.y-e.top,originX:b.x,originY:b.y,ex:s.x,ey:s.y,lastX:s.x,lastY:s.y,theta:a(e.angle),width:e.width*e.scaleX,shiftKey:t.shiftKey,altKey:E,original:c.util.saveObjectTransform(e)};this._shouldCenterTransform(e,C,E)&&(O.originX="center",O.originY="center"),O.original.originX=b.x,O.original.originY=b.y,this._currentTransform=O,this._beforeTransform(t)}},setCursor:function(t){this.upperCanvasEl.style.cursor=t},_drawSelection:function(t){var e=this._groupSelector,i=new c.Point(e.ex,e.ey),s=c.util.transformPoint(i,this.viewportTransform),m=new c.Point(e.ex+e.left,e.ey+e.top),o=c.util.transformPoint(m,this.viewportTransform),y=Math.min(s.x,o.x),C=Math.min(s.y,o.y),b=Math.max(s.x,o.x),E=Math.max(s.y,o.y),O=this.selectionLineWidth/2;this.selectionColor&&(t.fillStyle=this.selectionColor,t.fillRect(y,C,b-y,E-C)),!(!this.selectionLineWidth||!this.selectionBorderColor)&&(t.lineWidth=this.selectionLineWidth,t.strokeStyle=this.selectionBorderColor,y+=O,C+=O,b-=O,E-=O,c.Object.prototype._setLineDash.call(this,t,this.selectionDashArray),t.strokeRect(y,C,b-y,E-C))},findTarget:function(t,e){if(!this.skipTargetFind){var i=!0,s=this.getPointer(t,i),m=this._activeObject,o=this.getActiveObjects(),y,C,b=d(t),E=o.length>1&&!e||o.length===1;if(this.targets=[],E&&m._findTargetCorner(s,b)||o.length>1&&!e&&m===this._searchPossibleTargets([m],s))return m;if(o.length===1&&m===this._searchPossibleTargets([m],s))if(this.preserveObjectStacking)y=m,C=this.targets,this.targets=[];else return m;var O=this._searchPossibleTargets(this._objects,s);return t[this.altSelectionKey]&&O&&y&&O!==y&&(O=y,this.targets=C),O}},_checkTarget:function(t,e,i){if(e&&e.visible&&e.evented&&e.containsPoint(t))if((this.perPixelTargetFind||e.perPixelTargetFind)&&!e.isEditing){var s=this.isTargetTransparent(e,i.x,i.y);if(!s)return!0}else return!0},_searchPossibleTargets:function(t,e){for(var i,s=t.length,m;s--;){var o=t[s],y=o.group?this._normalizePointer(o.group,e):e;if(this._checkTarget(y,o,e)){i=t[s],i.subTargetCheck&&i instanceof c.Group&&(m=this._searchPossibleTargets(i._objects,e),m&&this.targets.push(m));break}}return i},restorePointerVpt:function(t){return c.util.transformPoint(t,c.util.invertTransform(this.viewportTransform))},getPointer:function(t,e){if(this._absolutePointer&&!e)return this._absolutePointer;if(this._pointer&&e)return this._pointer;var i=p(t),s=this.upperCanvasEl,m=s.getBoundingClientRect(),o=m.width||0,y=m.height||0,C;(!o||!y)&&("top"in m&&"bottom"in m&&(y=Math.abs(m.top-m.bottom)),"right"in m&&"left"in m&&(o=Math.abs(m.right-m.left))),this.calcOffset(),i.x=i.x-this._offset.left,i.y=i.y-this._offset.top,e||(i=this.restorePointerVpt(i));var b=this.getRetinaScaling();return b!==1&&(i.x/=b,i.y/=b),o===0||y===0?C={width:1,height:1}:C={width:s.width/o,height:s.height/y},{x:i.x*C.width,y:i.y*C.height}},_createUpperCanvas:function(){var t=this.lowerCanvasEl.className.replace(/\s*lower-canvas\s*/,""),e=this.lowerCanvasEl,i=this.upperCanvasEl;i?i.className="":(i=this._createCanvasElement(),this.upperCanvasEl=i),c.util.addClass(i,"upper-canvas "+t),this.wrapperEl.appendChild(i),this._copyCanvasStyle(e,i),this._applyCanvasStyle(i),this.contextTop=i.getContext("2d")},_createCacheCanvas:function(){this.cacheCanvasEl=this._createCanvasElement(),this.cacheCanvasEl.setAttribute("width",this.width),this.cacheCanvasEl.setAttribute("height",this.height),this.contextCache=this.cacheCanvasEl.getContext("2d")},_initWrapperElement:function(){this.wrapperEl=c.util.wrapElement(this.lowerCanvasEl,"div",{class:this.containerClass}),c.util.setStyle(this.wrapperEl,{width:this.width+"px",height:this.height+"px",position:"relative"}),c.util.makeElementUnselectable(this.wrapperEl)},_applyCanvasStyle:function(t){var e=this.width||t.width,i=this.height||t.height;c.util.setStyle(t,{position:"absolute",width:e+"px",height:i+"px",left:0,top:0,"touch-action":this.allowTouchScrolling?"manipulation":"none","-ms-touch-action":this.allowTouchScrolling?"manipulation":"none"}),t.width=e,t.height=i,c.util.makeElementUnselectable(t)},_copyCanvasStyle:function(t,e){e.style.cssText=t.style.cssText},getSelectionContext:function(){return this.contextTop},getSelectionElement:function(){return this.upperCanvasEl},getActiveObject:function(){return this._activeObject},getActiveObjects:function(){var t=this._activeObject;return t?t.type==="activeSelection"&&t._objects?t._objects.slice(0):[t]:[]},_onObjectRemoved:function(t){t===this._activeObject&&(this.fire("before:selection:cleared",{target:t}),this._discardActiveObject(),this.fire("selection:cleared",{target:t}),t.fire("deselected")),t===this._hoveredTarget&&(this._hoveredTarget=null,this._hoveredTargets=[]),this.callSuper("_onObjectRemoved",t)},_fireSelectionEvents:function(t,e){var i=!1,s=this.getActiveObjects(),m=[],o=[];t.forEach(function(y){s.indexOf(y)===-1&&(i=!0,y.fire("deselected",{e,target:y}),o.push(y))}),s.forEach(function(y){t.indexOf(y)===-1&&(i=!0,y.fire("selected",{e,target:y}),m.push(y))}),t.length>0&&s.length>0?i&&this.fire("selection:updated",{e,selected:m,deselected:o,updated:m[0]||o[0],target:this._activeObject}):s.length>0?this.fire("selection:created",{e,selected:m,target:this._activeObject}):t.length>0&&this.fire("selection:cleared",{e,deselected:o})},setActiveObject:function(t,e){var i=this.getActiveObjects();return this._setActiveObject(t,e),this._fireSelectionEvents(i,e),this},_setActiveObject:function(t,e){return this._activeObject===t||!this._discardActiveObject(e,t)||t.onSelect({e})?!1:(this._activeObject=t,!0)},_discardActiveObject:function(t,e){var i=this._activeObject;if(i){if(i.onDeselect({e:t,object:e}))return!1;this._activeObject=null}return!0},discardActiveObject:function(t){var e=this.getActiveObjects(),i=this.getActiveObject();return e.length&&this.fire("before:selection:cleared",{target:i,e:t}),this._discardActiveObject(t),this._fireSelectionEvents(e,t),this},dispose:function(){var t=this.wrapperEl;return this.removeListeners(),t.removeChild(this.upperCanvasEl),t.removeChild(this.lowerCanvasEl),this.contextCache=null,this.contextTop=null,["upperCanvasEl","cacheCanvasEl"].forEach(function(e){c.util.cleanUpJsdomNode(this[e]),this[e]=void 0}.bind(this)),t.parentNode&&t.parentNode.replaceChild(this.lowerCanvasEl,this.wrapperEl),delete this.wrapperEl,c.StaticCanvas.prototype.dispose.call(this),this},clear:function(){return this.discardActiveObject(),this.clearContext(this.contextTop),this.callSuper("clear")},drawControls:function(t){var e=this._activeObject;e&&e._renderControls(t)},_toObject:function(t,e,i){var s=this._realizeGroupTransformOnObject(t),m=this.callSuper("_toObject",t,e,i);return this._unwindGroupTransformOnObject(t,s),m},_realizeGroupTransformOnObject:function(t){if(t.group&&t.group.type==="activeSelection"&&this._activeObject===t.group){var e=["angle","flipX","flipY","left","scaleX","scaleY","skewX","skewY","top"],i={};return e.forEach(function(s){i[s]=t[s]}),c.util.addTransformToObject(t,this._activeObject.calcOwnMatrix()),i}else return null},_unwindGroupTransformOnObject:function(t,e){e&&t.set(e)},_setSVGObject:function(t,e,i){var s=this._realizeGroupTransformOnObject(e);this.callSuper("_setSVGObject",t,e,i),this._unwindGroupTransformOnObject(e,s)},setViewportTransform:function(t){this.renderOnAddRemove&&this._activeObject&&this._activeObject.isEditing&&this._activeObject.clearContextTop(),c.StaticCanvas.prototype.setViewportTransform.call(this,t)}});for(var u in c.StaticCanvas)u!=="prototype"&&(c.Canvas[u]=c.StaticCanvas[u])}(),function(){var p=c.util.addListener,a=c.util.removeListener,d=3,u=2,t=1,e={passive:!1};function i(s,m){return s.button&&s.button===m-1}c.util.object.extend(c.Canvas.prototype,{mainTouchId:null,_initEventListeners:function(){this.removeListeners(),this._bindEvents(),this.addOrRemove(p,"add")},_getEventPrefix:function(){return this.enablePointerEvents?"pointer":"mouse"},addOrRemove:function(s,m){var o=this.upperCanvasEl,y=this._getEventPrefix();s(c.window,"resize",this._onResize),s(o,y+"down",this._onMouseDown),s(o,y+"move",this._onMouseMove,e),s(o,y+"out",this._onMouseOut),s(o,y+"enter",this._onMouseEnter),s(o,"wheel",this._onMouseWheel),s(o,"contextmenu",this._onContextMenu),s(o,"dblclick",this._onDoubleClick),s(o,"dragover",this._onDragOver),s(o,"dragenter",this._onDragEnter),s(o,"dragleave",this._onDragLeave),s(o,"drop",this._onDrop),this.enablePointerEvents||s(o,"touchstart",this._onTouchStart,e),typeof eventjs!="undefined"&&m in eventjs&&(eventjs[m](o,"gesture",this._onGesture),eventjs[m](o,"drag",this._onDrag),eventjs[m](o,"orientation",this._onOrientationChange),eventjs[m](o,"shake",this._onShake),eventjs[m](o,"longpress",this._onLongPress))},removeListeners:function(){this.addOrRemove(a,"remove");var s=this._getEventPrefix();a(c.document,s+"up",this._onMouseUp),a(c.document,"touchend",this._onTouchEnd,e),a(c.document,s+"move",this._onMouseMove,e),a(c.document,"touchmove",this._onMouseMove,e)},_bindEvents:function(){this.eventsBound||(this._onMouseDown=this._onMouseDown.bind(this),this._onTouchStart=this._onTouchStart.bind(this),this._onMouseMove=this._onMouseMove.bind(this),this._onMouseUp=this._onMouseUp.bind(this),this._onTouchEnd=this._onTouchEnd.bind(this),this._onResize=this._onResize.bind(this),this._onGesture=this._onGesture.bind(this),this._onDrag=this._onDrag.bind(this),this._onShake=this._onShake.bind(this),this._onLongPress=this._onLongPress.bind(this),this._onOrientationChange=this._onOrientationChange.bind(this),this._onMouseWheel=this._onMouseWheel.bind(this),this._onMouseOut=this._onMouseOut.bind(this),this._onMouseEnter=this._onMouseEnter.bind(this),this._onContextMenu=this._onContextMenu.bind(this),this._onDoubleClick=this._onDoubleClick.bind(this),this._onDragOver=this._onDragOver.bind(this),this._onDragEnter=this._simpleEventHandler.bind(this,"dragenter"),this._onDragLeave=this._simpleEventHandler.bind(this,"dragleave"),this._onDrop=this._simpleEventHandler.bind(this,"drop"),this.eventsBound=!0)},_onGesture:function(s,m){this.__onTransformGesture&&this.__onTransformGesture(s,m)},_onDrag:function(s,m){this.__onDrag&&this.__onDrag(s,m)},_onMouseWheel:function(s){this.__onMouseWheel(s)},_onMouseOut:function(s){var m=this._hoveredTarget;this.fire("mouse:out",{target:m,e:s}),this._hoveredTarget=null,m&&m.fire("mouseout",{e:s});var o=this;this._hoveredTargets.forEach(function(y){o.fire("mouse:out",{target:m,e:s}),y&&m.fire("mouseout",{e:s})}),this._hoveredTargets=[],this._iTextInstances&&this._iTextInstances.forEach(function(y){y.isEditing&&y.hiddenTextarea.focus()})},_onMouseEnter:function(s){!this._currentTransform&&!this.findTarget(s)&&(this.fire("mouse:over",{target:null,e:s}),this._hoveredTarget=null,this._hoveredTargets=[])},_onOrientationChange:function(s,m){this.__onOrientationChange&&this.__onOrientationChange(s,m)},_onShake:function(s,m){this.__onShake&&this.__onShake(s,m)},_onLongPress:function(s,m){this.__onLongPress&&this.__onLongPress(s,m)},_onDragOver:function(s){s.preventDefault();var m=this._simpleEventHandler("dragover",s);this._fireEnterLeaveEvents(m,s)},_onContextMenu:function(s){return this.stopContextMenu&&(s.stopPropagation(),s.preventDefault()),!1},_onDoubleClick:function(s){this._cacheTransformEventData(s),this._handleEvent(s,"dblclick"),this._resetTransformEventData(s)},getPointerId:function(s){var m=s.changedTouches;return m?m[0]&&m[0].identifier:this.enablePointerEvents?s.pointerId:-1},_isMainEvent:function(s){return s.isPrimary===!0?!0:s.isPrimary===!1?!1:s.type==="touchend"&&s.touches.length===0?!0:s.changedTouches?s.changedTouches[0].identifier===this.mainTouchId:!0},_onTouchStart:function(s){s.preventDefault(),this.mainTouchId===null&&(this.mainTouchId=this.getPointerId(s)),this.__onMouseDown(s),this._resetTransformEventData();var m=this.upperCanvasEl,o=this._getEventPrefix();p(c.document,"touchend",this._onTouchEnd,e),p(c.document,"touchmove",this._onMouseMove,e),a(m,o+"down",this._onMouseDown)},_onMouseDown:function(s){this.__onMouseDown(s),this._resetTransformEventData();var m=this.upperCanvasEl,o=this._getEventPrefix();a(m,o+"move",this._onMouseMove,e),p(c.document,o+"up",this._onMouseUp),p(c.document,o+"move",this._onMouseMove,e)},_onTouchEnd:function(s){if(!(s.touches.length>0)){this.__onMouseUp(s),this._resetTransformEventData(),this.mainTouchId=null;var m=this._getEventPrefix();a(c.document,"touchend",this._onTouchEnd,e),a(c.document,"touchmove",this._onMouseMove,e);var o=this;this._willAddMouseDown&&clearTimeout(this._willAddMouseDown),this._willAddMouseDown=setTimeout(function(){p(o.upperCanvasEl,m+"down",o._onMouseDown),o._willAddMouseDown=0},400)}},_onMouseUp:function(s){this.__onMouseUp(s),this._resetTransformEventData();var m=this.upperCanvasEl,o=this._getEventPrefix();this._isMainEvent(s)&&(a(c.document,o+"up",this._onMouseUp),a(c.document,o+"move",this._onMouseMove,e),p(m,o+"move",this._onMouseMove,e))},_onMouseMove:function(s){!this.allowTouchScrolling&&s.preventDefault&&s.preventDefault(),this.__onMouseMove(s)},_onResize:function(){this.calcOffset()},_shouldRender:function(s){var m=this._activeObject;return!!m!=!!s||m&&s&&m!==s?!0:(m&&m.isEditing,!1)},__onMouseUp:function(s){var m,o=this._currentTransform,y=this._groupSelector,C=!1,b=!y||y.left===0&&y.top===0;if(this._cacheTransformEventData(s),m=this._target,this._handleEvent(s,"up:before"),i(s,d)){this.fireRightClick&&this._handleEvent(s,"up",d,b);return}if(i(s,u)){this.fireMiddleClick&&this._handleEvent(s,"up",u,b),this._resetTransformEventData();return}if(this.isDrawingMode&&this._isCurrentlyDrawing){this._onMouseUpInDrawingMode(s);return}if(!!this._isMainEvent(s)){if(o&&(this._finalizeCurrentTransform(s),C=o.actionPerformed),!b){var E=m===this._activeObject;this._maybeGroupObjects(s),C||(C=this._shouldRender(m)||!E&&m===this._activeObject)}if(m){if(m.selectable&&m!==this._activeObject&&m.activeOn==="up")this.setActiveObject(m,s),C=!0;else{var O=m._findTargetCorner(this.getPointer(s,!0),c.util.isTouchEvent(s)),L=m.controls[O],N=L&&L.getMouseUpHandler(s,m,L);if(N){var B=this.getPointer(s);N(s,o,B.x,B.y)}}m.isMoving=!1}this._setCursorFromEvent(s,m),this._handleEvent(s,"up",t,b),this._groupSelector=null,this._currentTransform=null,m&&(m.__corner=0),C?this.requestRenderAll():b||this.renderTop()}},_simpleEventHandler:function(s,m){var o=this.findTarget(m),y=this.targets,C={e:m,target:o,subTargets:y};if(this.fire(s,C),o&&o.fire(s,C),!y)return o;for(var b=0;b1&&(t=new c.ActiveSelection(u.reverse(),{canvas:this}),this.setActiveObject(t,d))},_collectObjects:function(d){for(var u=[],t,e=this._groupSelector.ex,i=this._groupSelector.ey,s=e+this._groupSelector.left,m=i+this._groupSelector.top,o=new c.Point(p(e,s),p(i,m)),y=new c.Point(a(e,s),a(i,m)),C=!this.selectionFullyContained,b=e===s&&i===m,E=this._objects.length;E--&&(t=this._objects[E],!(!(!t||!t.selectable||!t.visible)&&(C&&t.intersectsWithRect(o,y,!0)||t.isContainedWithinRect(o,y,!0)||C&&t.containsPoint(o,null,!0)||C&&t.containsPoint(y,null,!0))&&(u.push(t),b))););return u.length>1&&(u=u.filter(function(O){return!O.onSelect({e:d})})),u},_maybeGroupObjects:function(d){this.selection&&this._groupSelector&&this._groupSelectedObjects(d),this.setCursor(this.defaultCursor),this._groupSelector=null}})}(),function(){c.util.object.extend(c.StaticCanvas.prototype,{toDataURL:function(p){p||(p={});var a=p.format||"png",d=p.quality||1,u=(p.multiplier||1)*(p.enableRetinaScaling?this.getRetinaScaling():1),t=this.toCanvasElement(u,p);return c.util.toDataURL(t,a,d)},toCanvasElement:function(p,a){p=p||1,a=a||{};var d=(a.width||this.width)*p,u=(a.height||this.height)*p,t=this.getZoom(),e=this.width,i=this.height,s=t*p,m=this.viewportTransform,o=(m[4]-(a.left||0))*p,y=(m[5]-(a.top||0))*p,C=this.interactive,b=[s,0,0,s,o,y],E=this.enableRetinaScaling,O=c.util.createCanvasElement(),L=this.contextTop;return O.width=d,O.height=u,this.contextTop=null,this.enableRetinaScaling=!1,this.interactive=!1,this.viewportTransform=b,this.width=d,this.height=u,this.calcViewportBoundaries(),this.renderCanvas(O.getContext("2d"),this._objects),this.viewportTransform=m,this.width=e,this.height=i,this.calcViewportBoundaries(),this.interactive=C,this.enableRetinaScaling=E,this.contextTop=L,O}})}(),c.util.object.extend(c.StaticCanvas.prototype,{loadFromJSON:function(p,a,d){if(!!p){var u=typeof p=="string"?JSON.parse(p):c.util.object.clone(p),t=this,e=u.clipPath,i=this.renderOnAddRemove;return this.renderOnAddRemove=!1,delete u.clipPath,this._enlivenObjects(u.objects,function(s){t.clear(),t._setBgOverlay(u,function(){e?t._enlivenObjects([e],function(m){t.clipPath=m[0],t.__setupCanvas.call(t,u,s,i,a)}):t.__setupCanvas.call(t,u,s,i,a)})},d),this}},__setupCanvas:function(p,a,d,u){var t=this;a.forEach(function(e,i){t.insertAt(e,i)}),this.renderOnAddRemove=d,delete p.objects,delete p.backgroundImage,delete p.overlayImage,delete p.background,delete p.overlay,this._setOptions(p),this.renderAll(),u&&u()},_setBgOverlay:function(p,a){var d={backgroundColor:!1,overlayColor:!1,backgroundImage:!1,overlayImage:!1};if(!p.backgroundImage&&!p.overlayImage&&!p.background&&!p.overlay){a&&a();return}var u=function(){d.backgroundImage&&d.overlayImage&&d.backgroundColor&&d.overlayColor&&a&&a()};this.__setBgOverlay("backgroundImage",p.backgroundImage,d,u),this.__setBgOverlay("overlayImage",p.overlayImage,d,u),this.__setBgOverlay("backgroundColor",p.background,d,u),this.__setBgOverlay("overlayColor",p.overlay,d,u)},__setBgOverlay:function(p,a,d,u){var t=this;if(!a){d[p]=!0,u&&u();return}p==="backgroundImage"||p==="overlayImage"?c.util.enlivenObjects([a],function(e){t[p]=e[0],d[p]=!0,u&&u()}):this["set"+c.util.string.capitalize(p,!0)](a,function(){d[p]=!0,u&&u()})},_enlivenObjects:function(p,a,d){if(!p||p.length===0){a&&a([]);return}c.util.enlivenObjects(p,function(u){a&&a(u)},null,d)},_toDataURL:function(p,a){this.clone(function(d){a(d.toDataURL(p))})},_toDataURLWithMultiplier:function(p,a,d){this.clone(function(u){d(u.toDataURLWithMultiplier(p,a))})},clone:function(p,a){var d=JSON.stringify(this.toJSON(a));this.cloneWithoutData(function(u){u.loadFromJSON(d,function(){p&&p(u)})})},cloneWithoutData:function(p){var a=c.util.createCanvasElement();a.width=this.width,a.height=this.height;var d=new c.Canvas(a);this.backgroundImage?(d.setBackgroundImage(this.backgroundImage.src,function(){d.renderAll(),p&&p(d)}),d.backgroundImageOpacity=this.backgroundImageOpacity,d.backgroundImageStretch=this.backgroundImageStretch):p&&p(d)}}),function(p){"use strict";var a=p.fabric||(p.fabric={}),d=a.util.object.extend,u=a.util.object.clone,t=a.util.toFixed,e=a.util.string.capitalize,i=a.util.degreesToRadians,s=!a.isLikelyNode,m=2;a.Object||(a.Object=a.util.createClass(a.CommonMethods,{type:"object",originX:"left",originY:"top",top:0,left:0,width:0,height:0,scaleX:1,scaleY:1,flipX:!1,flipY:!1,opacity:1,angle:0,skewX:0,skewY:0,cornerSize:13,touchCornerSize:24,transparentCorners:!0,hoverCursor:null,moveCursor:null,padding:0,borderColor:"rgb(178,204,255)",borderDashArray:null,cornerColor:"rgb(178,204,255)",cornerStrokeColor:null,cornerStyle:"rect",cornerDashArray:null,centeredScaling:!1,centeredRotation:!0,fill:"rgb(0,0,0)",fillRule:"nonzero",globalCompositeOperation:"source-over",backgroundColor:"",selectionBackgroundColor:"",stroke:null,strokeWidth:1,strokeDashArray:null,strokeDashOffset:0,strokeLineCap:"butt",strokeLineJoin:"miter",strokeMiterLimit:4,shadow:null,borderOpacityWhenMoving:.4,borderScaleFactor:1,minScaleLimit:0,selectable:!0,evented:!0,visible:!0,hasControls:!0,hasBorders:!0,perPixelTargetFind:!1,includeDefaultValues:!0,lockMovementX:!1,lockMovementY:!1,lockRotation:!1,lockScalingX:!1,lockScalingY:!1,lockSkewingX:!1,lockSkewingY:!1,lockScalingFlip:!1,excludeFromExport:!1,objectCaching:s,statefullCache:!1,noScaleCache:!0,strokeUniform:!1,dirty:!0,__corner:0,paintFirst:"fill",activeOn:"down",stateProperties:"top left width height scaleX scaleY flipX flipY originX originY transformMatrix stroke strokeWidth strokeDashArray strokeLineCap strokeDashOffset strokeLineJoin strokeMiterLimit angle opacity fill globalCompositeOperation shadow visible backgroundColor skewX skewY fillRule paintFirst clipPath strokeUniform".split(" "),cacheProperties:"fill stroke strokeWidth strokeDashArray width height paintFirst strokeUniform strokeLineCap strokeDashOffset strokeLineJoin strokeMiterLimit backgroundColor clipPath".split(" "),colorProperties:"fill stroke backgroundColor".split(" "),clipPath:void 0,inverted:!1,absolutePositioned:!1,initialize:function(o){o&&this.setOptions(o)},_createCacheCanvas:function(){this._cacheProperties={},this._cacheCanvas=a.util.createCanvasElement(),this._cacheContext=this._cacheCanvas.getContext("2d"),this._updateCacheCanvas(),this.dirty=!0},_limitCacheSize:function(o){var y=a.perfLimitSizeTotal,C=o.width,b=o.height,E=a.maxCacheSideLimit,O=a.minCacheSideLimit;if(C<=E&&b<=E&&C*b<=y)return CY&&(o.zoomX/=C/Y,o.width=Y,o.capped=!0),b>nt&&(o.zoomY/=b/nt,o.height=nt,o.capped=!0),o},_getCacheCanvasDimensions:function(){var o=this.getTotalObjectScaling(),y=this._getTransformedDimensions(0,0),C=y.x*o.scaleX/this.scaleX,b=y.y*o.scaleY/this.scaleY;return{width:C+m,height:b+m,zoomX:o.scaleX,zoomY:o.scaleY,x:C,y:b}},_updateCacheCanvas:function(){var o=this.canvas;if(this.noScaleCache&&o&&o._currentTransform){var y=o._currentTransform.target,C=o._currentTransform.action;if(this===y&&C.slice&&C.slice(0,5)==="scale")return!1}var b=this._cacheCanvas,E=this._limitCacheSize(this._getCacheCanvasDimensions()),O=a.minCacheSideLimit,L=E.width,N=E.height,B,Y,nt=E.zoomX,it=E.zoomY,Mt=L!==this.cacheWidth||N!==this.cacheHeight,K=this.zoomX!==nt||this.zoomY!==it,It=Mt||K,U=0,Lt=0,dt=!1;if(Mt){var Nt=this._cacheCanvas.width,V=this._cacheCanvas.height,q=L>Nt||N>V,Q=(LO&&V>O;dt=q||Q,q&&!E.capped&&(L>O||N>O)&&(U=L*.1,Lt=N*.1)}return this instanceof a.Text&&this.path&&(It=!0,dt=!0,U+=this.getHeightOfLine(0)*this.zoomX,Lt+=this.getHeightOfLine(0)*this.zoomY),It?(dt?(b.width=Math.ceil(L+U),b.height=Math.ceil(N+Lt)):(this._cacheContext.setTransform(1,0,0,1,0,0),this._cacheContext.clearRect(0,0,b.width,b.height)),B=E.x/2,Y=E.y/2,this.cacheTranslationX=Math.round(b.width/2-B)+B,this.cacheTranslationY=Math.round(b.height/2-Y)+Y,this.cacheWidth=L,this.cacheHeight=N,this._cacheContext.translate(this.cacheTranslationX,this.cacheTranslationY),this._cacheContext.scale(nt,it),this.zoomX=nt,this.zoomY=it,!0):!1},setOptions:function(o){this._setOptions(o),this._initGradient(o.fill,"fill"),this._initGradient(o.stroke,"stroke"),this._initPattern(o.fill,"fill"),this._initPattern(o.stroke,"stroke")},transform:function(o){var y=this.group&&!this.group._transformDone||this.group&&this.canvas&&o===this.canvas.contextTop,C=this.calcTransformMatrix(!y);o.transform(C[0],C[1],C[2],C[3],C[4],C[5])},toObject:function(o){var y=a.Object.NUM_FRACTION_DIGITS,C={type:this.type,version:a.version,originX:this.originX,originY:this.originY,left:t(this.left,y),top:t(this.top,y),width:t(this.width,y),height:t(this.height,y),fill:this.fill&&this.fill.toObject?this.fill.toObject():this.fill,stroke:this.stroke&&this.stroke.toObject?this.stroke.toObject():this.stroke,strokeWidth:t(this.strokeWidth,y),strokeDashArray:this.strokeDashArray?this.strokeDashArray.concat():this.strokeDashArray,strokeLineCap:this.strokeLineCap,strokeDashOffset:this.strokeDashOffset,strokeLineJoin:this.strokeLineJoin,strokeUniform:this.strokeUniform,strokeMiterLimit:t(this.strokeMiterLimit,y),scaleX:t(this.scaleX,y),scaleY:t(this.scaleY,y),angle:t(this.angle,y),flipX:this.flipX,flipY:this.flipY,opacity:t(this.opacity,y),shadow:this.shadow&&this.shadow.toObject?this.shadow.toObject():this.shadow,visible:this.visible,backgroundColor:this.backgroundColor,fillRule:this.fillRule,paintFirst:this.paintFirst,globalCompositeOperation:this.globalCompositeOperation,skewX:t(this.skewX,y),skewY:t(this.skewY,y)};return this.clipPath&&!this.clipPath.excludeFromExport&&(C.clipPath=this.clipPath.toObject(o),C.clipPath.inverted=this.clipPath.inverted,C.clipPath.absolutePositioned=this.clipPath.absolutePositioned),a.util.populateWithProperties(this,C,o),this.includeDefaultValues||(C=this._removeDefaultValues(C)),C},toDatalessObject:function(o){return this.toObject(o)},_removeDefaultValues:function(o){var y=a.util.getKlass(o.type).prototype,C=y.stateProperties;return C.forEach(function(b){if(!(b==="left"||b==="top")){o[b]===y[b]&&delete o[b];var E=Object.prototype.toString.call(o[b])==="[object Array]"&&Object.prototype.toString.call(y[b])==="[object Array]";E&&o[b].length===0&&y[b].length===0&&delete o[b]}}),o},toString:function(){return"#"},getObjectScaling:function(){if(!this.group)return{scaleX:this.scaleX,scaleY:this.scaleY};var o=a.util.qrDecompose(this.calcTransformMatrix());return{scaleX:Math.abs(o.scaleX),scaleY:Math.abs(o.scaleY)}},getTotalObjectScaling:function(){var o=this.getObjectScaling(),y=o.scaleX,C=o.scaleY;if(this.canvas){var b=this.canvas.getZoom(),E=this.canvas.getRetinaScaling();y*=b*E,C*=b*E}return{scaleX:y,scaleY:C}},getObjectOpacity:function(){var o=this.opacity;return this.group&&(o*=this.group.getObjectOpacity()),o},_set:function(o,y){var C=o==="scaleX"||o==="scaleY",b=this[o]!==y,E=!1;return C&&(y=this._constrainScale(y)),o==="scaleX"&&y<0?(this.flipX=!this.flipX,y*=-1):o==="scaleY"&&y<0?(this.flipY=!this.flipY,y*=-1):o==="shadow"&&y&&!(y instanceof a.Shadow)?y=new a.Shadow(y):o==="dirty"&&this.group&&this.group.set("dirty",y),this[o]=y,b&&(E=this.group&&this.group.isOnACache(),this.cacheProperties.indexOf(o)>-1?(this.dirty=!0,E&&this.group.set("dirty",!0)):E&&this.stateProperties.indexOf(o)>-1&&this.group.set("dirty",!0)),this},setOnGroup:function(){},getViewportTransform:function(){return this.canvas&&this.canvas.viewportTransform?this.canvas.viewportTransform:a.iMatrix.concat()},isNotVisible:function(){return this.opacity===0||!this.width&&!this.height&&this.strokeWidth===0||!this.visible},render:function(o){this.isNotVisible()||this.canvas&&this.canvas.skipOffscreen&&!this.group&&!this.isOnScreen()||(o.save(),this._setupCompositeOperation(o),this.drawSelectionBackground(o),this.transform(o),this._setOpacity(o),this._setShadow(o,this),this.shouldCache()?(this.renderCache(),this.drawCacheOnCanvas(o)):(this._removeCacheCanvas(),this.dirty=!1,this.drawObject(o),this.objectCaching&&this.statefullCache&&this.saveState({propertySet:"cacheProperties"})),o.restore())},renderCache:function(o){o=o||{},this._cacheCanvas||this._createCacheCanvas(),this.isCacheDirty()&&(this.statefullCache&&this.saveState({propertySet:"cacheProperties"}),this.drawObject(this._cacheContext,o.forClipping),this.dirty=!1)},_removeCacheCanvas:function(){this._cacheCanvas=null,this.cacheWidth=0,this.cacheHeight=0},hasStroke:function(){return this.stroke&&this.stroke!=="transparent"&&this.strokeWidth!==0},hasFill:function(){return this.fill&&this.fill!=="transparent"},needsItsOwnCache:function(){return!!(this.paintFirst==="stroke"&&this.hasFill()&&this.hasStroke()&&typeof this.shadow=="object"||this.clipPath)},shouldCache:function(){return this.ownCaching=this.needsItsOwnCache()||this.objectCaching&&(!this.group||!this.group.isOnACache()),this.ownCaching},willDrawShadow:function(){return!!this.shadow&&(this.shadow.offsetX!==0||this.shadow.offsetY!==0)},drawClipPathOnCache:function(o){var y=this.clipPath;if(o.save(),y.inverted?o.globalCompositeOperation="destination-out":o.globalCompositeOperation="destination-in",y.absolutePositioned){var C=a.util.invertTransform(this.calcTransformMatrix());o.transform(C[0],C[1],C[2],C[3],C[4],C[5])}y.transform(o),o.scale(1/y.zoomX,1/y.zoomY),o.drawImage(y._cacheCanvas,-y.cacheTranslationX,-y.cacheTranslationY),o.restore()},drawObject:function(o,y){var C=this.fill,b=this.stroke;y?(this.fill="black",this.stroke="",this._setClippingProperties(o)):this._renderBackground(o),this._render(o),this._drawClipPath(o),this.fill=C,this.stroke=b},_drawClipPath:function(o){var y=this.clipPath;!y||(y.canvas=this.canvas,y.shouldCache(),y._transformDone=!0,y.renderCache({forClipping:!0}),this.drawClipPathOnCache(o))},drawCacheOnCanvas:function(o){o.scale(1/this.zoomX,1/this.zoomY),o.drawImage(this._cacheCanvas,-this.cacheTranslationX,-this.cacheTranslationY)},isCacheDirty:function(o){if(this.isNotVisible())return!1;if(this._cacheCanvas&&!o&&this._updateCacheCanvas())return!0;if(this.dirty||this.clipPath&&this.clipPath.absolutePositioned||this.statefullCache&&this.hasStateChanged("cacheProperties")){if(this._cacheCanvas&&!o){var y=this.cacheWidth/this.zoomX,C=this.cacheHeight/this.zoomY;this._cacheContext.clearRect(-y/2,-C/2,y,C)}return!0}return!1},_renderBackground:function(o){if(!!this.backgroundColor){var y=this._getNonTransformedDimensions();o.fillStyle=this.backgroundColor,o.fillRect(-y.x/2,-y.y/2,y.x,y.y),this._removeShadow(o)}},_setOpacity:function(o){this.group&&!this.group._transformDone?o.globalAlpha=this.getObjectOpacity():o.globalAlpha*=this.opacity},_setStrokeStyles:function(o,y){var C=y.stroke;C&&(o.lineWidth=y.strokeWidth,o.lineCap=y.strokeLineCap,o.lineDashOffset=y.strokeDashOffset,o.lineJoin=y.strokeLineJoin,o.miterLimit=y.strokeMiterLimit,C.toLive?C.gradientUnits==="percentage"||C.gradientTransform||C.patternTransform?this._applyPatternForTransformedGradient(o,C):(o.strokeStyle=C.toLive(o,this),this._applyPatternGradientTransform(o,C)):o.strokeStyle=y.stroke)},_setFillStyles:function(o,y){var C=y.fill;C&&(C.toLive?(o.fillStyle=C.toLive(o,this),this._applyPatternGradientTransform(o,y.fill)):o.fillStyle=C)},_setClippingProperties:function(o){o.globalAlpha=1,o.strokeStyle="transparent",o.fillStyle="#000000"},_setLineDash:function(o,y){!y||y.length===0||(1&y.length&&y.push.apply(y,y),o.setLineDash(y))},_renderControls:function(o,y){var C=this.getViewportTransform(),b=this.calcTransformMatrix(),E,O,L;y=y||{},O=typeof y.hasBorders!="undefined"?y.hasBorders:this.hasBorders,L=typeof y.hasControls!="undefined"?y.hasControls:this.hasControls,b=a.util.multiplyTransformMatrices(C,b),E=a.util.qrDecompose(b),o.save(),o.translate(E.translateX,E.translateY),o.lineWidth=1*this.borderScaleFactor,this.group||(o.globalAlpha=this.isMoving?this.borderOpacityWhenMoving:1),o.rotate(i(E.angle)),y.forActiveSelection||this.group?O&&this.drawBordersInGroup(o,E,y):O&&this.drawBorders(o,y),L&&this.drawControls(o,y),o.restore()},_setShadow:function(o){if(!!this.shadow){var y=this.shadow,C=this.canvas,b,E=C&&C.viewportTransform[0]||1,O=C&&C.viewportTransform[3]||1;y.nonScaling?b={scaleX:1,scaleY:1}:b=this.getObjectScaling(),C&&C._isRetinaScaling()&&(E*=a.devicePixelRatio,O*=a.devicePixelRatio),o.shadowColor=y.color,o.shadowBlur=y.blur*a.browserShadowBlurConstant*(E+O)*(b.scaleX+b.scaleY)/4,o.shadowOffsetX=y.offsetX*E*b.scaleX,o.shadowOffsetY=y.offsetY*O*b.scaleY}},_removeShadow:function(o){!this.shadow||(o.shadowColor="",o.shadowBlur=o.shadowOffsetX=o.shadowOffsetY=0)},_applyPatternGradientTransform:function(o,y){if(!y||!y.toLive)return{offsetX:0,offsetY:0};var C=y.gradientTransform||y.patternTransform,b=-this.width/2+y.offsetX||0,E=-this.height/2+y.offsetY||0;return y.gradientUnits==="percentage"?o.transform(this.width,0,0,this.height,b,E):o.transform(1,0,0,1,b,E),C&&o.transform(C[0],C[1],C[2],C[3],C[4],C[5]),{offsetX:b,offsetY:E}},_renderPaintInOrder:function(o){this.paintFirst==="stroke"?(this._renderStroke(o),this._renderFill(o)):(this._renderFill(o),this._renderStroke(o))},_render:function(){},_renderFill:function(o){!this.fill||(o.save(),this._setFillStyles(o,this),this.fillRule==="evenodd"?o.fill("evenodd"):o.fill(),o.restore())},_renderStroke:function(o){if(!(!this.stroke||this.strokeWidth===0)){if(this.shadow&&!this.shadow.affectStroke&&this._removeShadow(o),o.save(),this.strokeUniform&&this.group){var y=this.getObjectScaling();o.scale(1/y.scaleX,1/y.scaleY)}else this.strokeUniform&&o.scale(1/this.scaleX,1/this.scaleY);this._setLineDash(o,this.strokeDashArray),this._setStrokeStyles(o,this),o.stroke(),o.restore()}},_applyPatternForTransformedGradient:function(o,y){var C=this._limitCacheSize(this._getCacheCanvasDimensions()),b=a.util.createCanvasElement(),E,O=this.canvas.getRetinaScaling(),L=C.x/this.scaleX/O,N=C.y/this.scaleY/O;b.width=L,b.height=N,E=b.getContext("2d"),E.beginPath(),E.moveTo(0,0),E.lineTo(L,0),E.lineTo(L,N),E.lineTo(0,N),E.closePath(),E.translate(L/2,N/2),E.scale(C.zoomX/this.scaleX/O,C.zoomY/this.scaleY/O),this._applyPatternGradientTransform(E,y),E.fillStyle=y.toLive(o),E.fill(),o.translate(-this.width/2-this.strokeWidth/2,-this.height/2-this.strokeWidth/2),o.scale(O*this.scaleX/C.zoomX,O*this.scaleY/C.zoomY),o.strokeStyle=E.createPattern(b,"no-repeat")},_findCenterFromElement:function(){return{x:this.left+this.width/2,y:this.top+this.height/2}},_assignTransformMatrixProps:function(){if(this.transformMatrix){var o=a.util.qrDecompose(this.transformMatrix);this.flipX=!1,this.flipY=!1,this.set("scaleX",o.scaleX),this.set("scaleY",o.scaleY),this.angle=o.angle,this.skewX=o.skewX,this.skewY=0}},_removeTransformMatrix:function(o){var y=this._findCenterFromElement();this.transformMatrix&&(this._assignTransformMatrixProps(),y=a.util.transformPoint(y,this.transformMatrix)),this.transformMatrix=null,o&&(this.scaleX*=o.scaleX,this.scaleY*=o.scaleY,this.cropX=o.cropX,this.cropY=o.cropY,y.x+=o.offsetLeft,y.y+=o.offsetTop,this.width=o.width,this.height=o.height),this.setPositionByOrigin(y,"center","center")},clone:function(o,y){var C=this.toObject(y);this.constructor.fromObject?this.constructor.fromObject(C,o):a.Object._fromObject("Object",C,o)},cloneAsImage:function(o,y){var C=this.toCanvasElement(y);return o&&o(new a.Image(C)),this},toCanvasElement:function(o){o||(o={});var y=a.util,C=y.saveObjectTransform(this),b=this.group,E=this.shadow,O=Math.abs,L=(o.multiplier||1)*(o.enableRetinaScaling?a.devicePixelRatio:1);delete this.group,o.withoutTransform&&y.resetObjectTransform(this),o.withoutShadow&&(this.shadow=null);var N=a.util.createCanvasElement(),B=this.getBoundingRect(!0,!0),Y=this.shadow,nt,it={x:0,y:0},Mt,K,It;Y&&(Mt=Y.blur,Y.nonScaling?nt={scaleX:1,scaleY:1}:nt=this.getObjectScaling(),it.x=2*Math.round(O(Y.offsetX)+Mt)*O(nt.scaleX),it.y=2*Math.round(O(Y.offsetY)+Mt)*O(nt.scaleY)),K=B.width+it.x,It=B.height+it.y,N.width=Math.ceil(K),N.height=Math.ceil(It);var U=new a.StaticCanvas(N,{enableRetinaScaling:!1,renderOnAddRemove:!1,skipOffscreen:!1});o.format==="jpeg"&&(U.backgroundColor="#fff"),this.setPositionByOrigin(new a.Point(U.width/2,U.height/2),"center","center");var Lt=this.canvas;U.add(this);var dt=U.toCanvasElement(L||1,o);return this.shadow=E,this.set("canvas",Lt),b&&(this.group=b),this.set(C).setCoords(),U._objects=[],U.dispose(),U=null,dt},toDataURL:function(o){return o||(o={}),a.util.toDataURL(this.toCanvasElement(o),o.format||"png",o.quality||1)},isType:function(o){return this.type===o},complexity:function(){return 1},toJSON:function(o){return this.toObject(o)},rotate:function(o){var y=(this.originX!=="center"||this.originY!=="center")&&this.centeredRotation;return y&&this._setOriginToCenter(),this.set("angle",o),y&&this._resetOrigin(),this},centerH:function(){return this.canvas&&this.canvas.centerObjectH(this),this},viewportCenterH:function(){return this.canvas&&this.canvas.viewportCenterObjectH(this),this},centerV:function(){return this.canvas&&this.canvas.centerObjectV(this),this},viewportCenterV:function(){return this.canvas&&this.canvas.viewportCenterObjectV(this),this},center:function(){return this.canvas&&this.canvas.centerObject(this),this},viewportCenter:function(){return this.canvas&&this.canvas.viewportCenterObject(this),this},getLocalPointer:function(o,y){y=y||this.canvas.getPointer(o);var C=new a.Point(y.x,y.y),b=this._getLeftTopCoords();return this.angle&&(C=a.util.rotatePoint(C,b,i(-this.angle))),{x:C.x-b.x,y:C.y-b.y}},_setupCompositeOperation:function(o){this.globalCompositeOperation&&(o.globalCompositeOperation=this.globalCompositeOperation)}}),a.util.createAccessors&&a.util.createAccessors(a.Object),d(a.Object.prototype,a.Observable),a.Object.NUM_FRACTION_DIGITS=2,a.Object._fromObject=function(o,y,C,b){var E=a[o];y=u(y,!0),a.util.enlivenPatterns([y.fill,y.stroke],function(O){typeof O[0]!="undefined"&&(y.fill=O[0]),typeof O[1]!="undefined"&&(y.stroke=O[1]),a.util.enlivenObjects([y.clipPath],function(L){y.clipPath=L[0];var N=b?new E(y[b],y):new E(y);C&&C(N)})})},a.Object.__uid=0)}(x),function(){var p=c.util.degreesToRadians,a={left:-.5,center:0,right:.5},d={top:-.5,center:0,bottom:.5};c.util.object.extend(c.Object.prototype,{translateToGivenOrigin:function(u,t,e,i,s){var m=u.x,o=u.y,y,C,b;return typeof t=="string"?t=a[t]:t-=.5,typeof i=="string"?i=a[i]:i-=.5,y=i-t,typeof e=="string"?e=d[e]:e-=.5,typeof s=="string"?s=d[s]:s-=.5,C=s-e,(y||C)&&(b=this._getTransformedDimensions(),m=u.x+y*b.x,o=u.y+C*b.y),new c.Point(m,o)},translateToCenterPoint:function(u,t,e){var i=this.translateToGivenOrigin(u,t,e,"center","center");return this.angle?c.util.rotatePoint(i,u,p(this.angle)):i},translateToOriginPoint:function(u,t,e){var i=this.translateToGivenOrigin(u,"center","center",t,e);return this.angle?c.util.rotatePoint(i,u,p(this.angle)):i},getCenterPoint:function(){var u=new c.Point(this.left,this.top);return this.translateToCenterPoint(u,this.originX,this.originY)},getPointByOrigin:function(u,t){var e=this.getCenterPoint();return this.translateToOriginPoint(e,u,t)},toLocalPoint:function(u,t,e){var i=this.getCenterPoint(),s,m;return typeof t!="undefined"&&typeof e!="undefined"?s=this.translateToGivenOrigin(i,"center","center",t,e):s=new c.Point(this.left,this.top),m=new c.Point(u.x,u.y),this.angle&&(m=c.util.rotatePoint(m,i,-p(this.angle))),m.subtractEquals(s)},setPositionByOrigin:function(u,t,e){var i=this.translateToCenterPoint(u,t,e),s=this.translateToOriginPoint(i,this.originX,this.originY);this.set("left",s.x),this.set("top",s.y)},adjustPosition:function(u){var t=p(this.angle),e=this.getScaledWidth(),i=c.util.cos(t)*e,s=c.util.sin(t)*e,m,o;typeof this.originX=="string"?m=a[this.originX]:m=this.originX-.5,typeof u=="string"?o=a[u]:o=u-.5,this.left+=i*(o-m),this.top+=s*(o-m),this.setCoords(),this.originX=u},_setOriginToCenter:function(){this._originalOriginX=this.originX,this._originalOriginY=this.originY;var u=this.getCenterPoint();this.originX="center",this.originY="center",this.left=u.x,this.top=u.y},_resetOrigin:function(){var u=this.translateToOriginPoint(this.getCenterPoint(),this._originalOriginX,this._originalOriginY);this.originX=this._originalOriginX,this.originY=this._originalOriginY,this.left=u.x,this.top=u.y,this._originalOriginX=null,this._originalOriginY=null},_getLeftTopCoords:function(){return this.translateToOriginPoint(this.getCenterPoint(),"left","top")}})}(),function(){function p(e){return[new c.Point(e.tl.x,e.tl.y),new c.Point(e.tr.x,e.tr.y),new c.Point(e.br.x,e.br.y),new c.Point(e.bl.x,e.bl.y)]}var a=c.util,d=a.degreesToRadians,u=a.multiplyTransformMatrices,t=a.transformPoint;a.object.extend(c.Object.prototype,{oCoords:null,aCoords:null,lineCoords:null,ownMatrixCache:null,matrixCache:null,controls:{},_getCoords:function(e,i){return i?e?this.calcACoords():this.calcLineCoords():((!this.aCoords||!this.lineCoords)&&this.setCoords(!0),e?this.aCoords:this.lineCoords)},getCoords:function(e,i){return p(this._getCoords(e,i))},intersectsWithRect:function(e,i,s,m){var o=this.getCoords(s,m),y=c.Intersection.intersectPolygonRectangle(o,e,i);return y.status==="Intersection"},intersectsWithObject:function(e,i,s){var m=c.Intersection.intersectPolygonPolygon(this.getCoords(i,s),e.getCoords(i,s));return m.status==="Intersection"||e.isContainedWithinObject(this,i,s)||this.isContainedWithinObject(e,i,s)},isContainedWithinObject:function(e,i,s){for(var m=this.getCoords(i,s),o=i?e.aCoords:e.lineCoords,y=0,C=e._getImageLines(o);y<4;y++)if(!e.containsPoint(m[y],C))return!1;return!0},isContainedWithinRect:function(e,i,s,m){var o=this.getBoundingRect(s,m);return o.left>=e.x&&o.left+o.width<=i.x&&o.top>=e.y&&o.top+o.height<=i.y},containsPoint:function(e,i,s,m){var o=this._getCoords(s,m),i=i||this._getImageLines(o),y=this._findCrossPoints(e,i);return y!==0&&y%2==1},isOnScreen:function(e){if(!this.canvas)return!1;var i=this.canvas.vptCoords.tl,s=this.canvas.vptCoords.br,m=this.getCoords(!0,e);return m.some(function(o){return o.x<=s.x&&o.x>=i.x&&o.y<=s.y&&o.y>=i.y})||this.intersectsWithRect(i,s,!0,e)?!0:this._containsCenterOfCanvas(i,s,e)},_containsCenterOfCanvas:function(e,i,s){var m={x:(e.x+i.x)/2,y:(e.y+i.y)/2};return!!this.containsPoint(m,null,!0,s)},isPartiallyOnScreen:function(e){if(!this.canvas)return!1;var i=this.canvas.vptCoords.tl,s=this.canvas.vptCoords.br;if(this.intersectsWithRect(i,s,!0,e))return!0;var m=this.getCoords(!0,e).every(function(o){return(o.x>=s.x||o.x<=i.x)&&(o.y>=s.y||o.y<=i.y)});return m&&this._containsCenterOfCanvas(i,s,e)},_getImageLines:function(e){var i={topline:{o:e.tl,d:e.tr},rightline:{o:e.tr,d:e.br},bottomline:{o:e.br,d:e.bl},leftline:{o:e.bl,d:e.tl}};return i},_findCrossPoints:function(e,i){var s,m,o,y,C,b=0,E;for(var O in i)if(E=i[O],!(E.o.y=e.y&&E.d.y>=e.y)&&(E.o.x===E.d.x&&E.o.x>=e.x?C=E.o.x:(s=0,m=(E.d.y-E.o.y)/(E.d.x-E.o.x),o=e.y-s*e.x,y=E.o.y-m*E.o.x,C=-(o-y)/(s-m)),C>=e.x&&(b+=1),b===2))break;return b},getBoundingRect:function(e,i){var s=this.getCoords(e,i);return a.makeBoundingBoxFromPoints(s)},getScaledWidth:function(){return this._getTransformedDimensions().x},getScaledHeight:function(){return this._getTransformedDimensions().y},_constrainScale:function(e){return Math.abs(e) `)}},toSVG:function(d){return this._createBaseSVGMarkup(this._toSVG(d),{reviver:d})},toClipPathSVG:function(d){return" "+this._createBaseClipPathSVGMarkup(this._toSVG(d),{reviver:d})},_createBaseClipPathSVGMarkup:function(d,u){u=u||{};var t=u.reviver,e=u.additionalTransform||"",i=[this.getSvgTransform(!0,e),this.getSvgCommons()].join(""),s=d.indexOf("COMMON_PARTS");return d[s]=i,t?t(d.join("")):d.join("")},_createBaseSVGMarkup:function(d,u){u=u||{};var t=u.noStyle,e=u.reviver,i=t?"":'style="'+this.getSvgStyles()+'" ',s=u.withShadow?'style="'+this.getSvgFilter()+'" ':"",m=this.clipPath,o=this.strokeUniform?'vector-effect="non-scaling-stroke" ':"",y=m&&m.absolutePositioned,C=this.stroke,b=this.fill,E=this.shadow,O,L=[],N,B=d.indexOf("COMMON_PARTS"),Y=u.additionalTransform;return m&&(m.clipPathId="CLIPPATH_"+c.Object.__uid++,N=' `+m.toClipPathSVG(e)+` `),y&&L.push(" `),L.push(" `),O=[i,o,t?"":this.addPaintOrder()," ",Y?'transform="'+Y+'" ':""].join(""),d[B]=O,b&&b.toLive&&L.push(b.toSVG(this)),C&&C.toLive&&L.push(C.toSVG(this)),E&&L.push(E.toSVG(this)),m&&L.push(N),L.push(d.join("")),L.push(` `),y&&L.push(` `),e?e(L.join("")):L.join("")},addPaintOrder:function(){return this.paintFirst!=="fill"?' paint-order="'+this.paintFirst+'" ':""}})}(),function(){var p=c.util.object.extend,a="stateProperties";function d(t,e,i){var s={},m=!0;i.forEach(function(o){s[o]=t[o]}),p(t[e],s,m)}function u(t,e,i){if(t===e)return!0;if(Array.isArray(t)){if(!Array.isArray(e)||t.length!==e.length)return!1;for(var s=0,m=t.length;s=0;m--)if(o=s[m],!!this.isControlVisible(o)&&(i=this._getImageLines(d?this.oCoords[o].touchCorner:this.oCoords[o].corner),e=this._findCrossPoints({x:u,y:t},i),e!==0&&e%2==1))return this.__corner=o,o;return!1},forEachControl:function(a){for(var d in this.controls)a(this.controls[d],d,this)},_setCornerCoords:function(){var a=this.oCoords;for(var d in a){var u=this.controls[d];a[d].corner=u.calcCornerCoords(this.angle,this.cornerSize,a[d].x,a[d].y,!1),a[d].touchCorner=u.calcCornerCoords(this.angle,this.touchCornerSize,a[d].x,a[d].y,!0)}},drawSelectionBackground:function(a){if(!this.selectionBackgroundColor||this.canvas&&!this.canvas.interactive||this.canvas&&this.canvas._activeObject!==this)return this;a.save();var d=this.getCenterPoint(),u=this._calculateCurrentDimensions(),t=this.canvas.viewportTransform;return a.translate(d.x,d.y),a.scale(1/t[0],1/t[3]),a.rotate(p(this.angle)),a.fillStyle=this.selectionBackgroundColor,a.fillRect(-u.x/2,-u.y/2,u.x,u.y),a.restore(),this},drawBorders:function(a,d){d=d||{};var u=this._calculateCurrentDimensions(),t=this.borderScaleFactor,e=u.x+t,i=u.y+t,s=typeof d.hasControls!="undefined"?d.hasControls:this.hasControls,m=!1;return a.save(),a.strokeStyle=d.borderColor||this.borderColor,this._setLineDash(a,d.borderDashArray||this.borderDashArray),a.strokeRect(-e/2,-i/2,e,i),s&&(a.beginPath(),this.forEachControl(function(o,y,C){o.withConnection&&o.getVisibility(C,y)&&(m=!0,a.moveTo(o.x*e,o.y*i),a.lineTo(o.x*e+o.offsetX,o.y*i+o.offsetY))}),m&&a.stroke()),a.restore(),this},drawBordersInGroup:function(a,d,u){u=u||{};var t=c.util.sizeAfterTransform(this.width,this.height,d),e=this.strokeWidth,i=this.strokeUniform,s=this.borderScaleFactor,m=t.x+e*(i?this.canvas.getZoom():d.scaleX)+s,o=t.y+e*(i?this.canvas.getZoom():d.scaleY)+s;return a.save(),this._setLineDash(a,u.borderDashArray||this.borderDashArray),a.strokeStyle=u.borderColor||this.borderColor,a.strokeRect(-m/2,-o/2,m,o),a.restore(),this},drawControls:function(a,d){d=d||{},a.save();var u=this.canvas.getRetinaScaling(),t,e;return a.setTransform(u,0,0,u,0,0),a.strokeStyle=a.fillStyle=d.cornerColor||this.cornerColor,this.transparentCorners||(a.strokeStyle=d.cornerStrokeColor||this.cornerStrokeColor),this._setLineDash(a,d.cornerDashArray||this.cornerDashArray),this.setCoords(),this.group&&(t=this.group.calcTransformMatrix()),this.forEachControl(function(i,s,m){e=m.oCoords[s],i.getVisibility(m,s)&&(t&&(e=c.util.transformPoint(e,t)),i.render(a,e.x,e.y,d,m))}),a.restore(),this},isControlVisible:function(a){return this.controls[a]&&this.controls[a].getVisibility(this,a)},setControlVisible:function(a,d){return this._controlsVisibility||(this._controlsVisibility={}),this._controlsVisibility[a]=d,this},setControlsVisibility:function(a){a||(a={});for(var d in a)this.setControlVisible(d,a[d]);return this},onDeselect:function(){},onSelect:function(){}})}(),c.util.object.extend(c.StaticCanvas.prototype,{FX_DURATION:500,fxCenterObjectH:function(p,a){a=a||{};var d=function(){},u=a.onComplete||d,t=a.onChange||d,e=this;return c.util.animate({startValue:p.left,endValue:this.getCenter().left,duration:this.FX_DURATION,onChange:function(i){p.set("left",i),e.requestRenderAll(),t()},onComplete:function(){p.setCoords(),u()}}),this},fxCenterObjectV:function(p,a){a=a||{};var d=function(){},u=a.onComplete||d,t=a.onChange||d,e=this;return c.util.animate({startValue:p.top,endValue:this.getCenter().top,duration:this.FX_DURATION,onChange:function(i){p.set("top",i),e.requestRenderAll(),t()},onComplete:function(){p.setCoords(),u()}}),this},fxRemove:function(p,a){a=a||{};var d=function(){},u=a.onComplete||d,t=a.onChange||d,e=this;return c.util.animate({startValue:p.opacity,endValue:0,duration:this.FX_DURATION,onChange:function(i){p.set("opacity",i),e.requestRenderAll(),t()},onComplete:function(){e.remove(p),u()}}),this}}),c.util.object.extend(c.Object.prototype,{animate:function(){if(arguments[0]&&typeof arguments[0]=="object"){var p=[],a,d;for(a in arguments[0])p.push(a);for(var u=0,t=p.length;u-1||e&&t.colorProperties.indexOf(e[1])>-1,s=e?this.get(e[0])[e[1]]:this.get(p);"from"in d||(d.from=s),i||(~a.indexOf("=")?a=s+parseFloat(a.replace("=","")):a=parseFloat(a));var m={startValue:d.from,endValue:a,byValue:d.by,easing:d.easing,duration:d.duration,abort:d.abort&&function(o,y,C){return d.abort.call(t,o,y,C)},onChange:function(o,y,C){e?t[e[0]][e[1]]=o:t.set(p,o),!u&&d.onChange&&d.onChange(o,y,C)},onComplete:function(o,y,C){u||(t.setCoords(),d.onComplete&&d.onComplete(o,y,C))}};return i?c.util.animateColor(m.startValue,m.endValue,m.duration,m):c.util.animate(m)}}),function(p){"use strict";var a=p.fabric||(p.fabric={}),d=a.util.object.extend,u=a.util.object.clone,t={x1:1,x2:1,y1:1,y2:1};if(a.Line){a.warn("fabric.Line is already defined");return}a.Line=a.util.createClass(a.Object,{type:"line",x1:0,y1:0,x2:0,y2:0,cacheProperties:a.Object.prototype.cacheProperties.concat("x1","x2","y1","y2"),initialize:function(i,s){i||(i=[0,0,0,0]),this.callSuper("initialize",s),this.set("x1",i[0]),this.set("y1",i[1]),this.set("x2",i[2]),this.set("y2",i[3]),this._setWidthHeight(s)},_setWidthHeight:function(i){i||(i={}),this.width=Math.abs(this.x2-this.x1),this.height=Math.abs(this.y2-this.y1),this.left="left"in i?i.left:this._getLeftToOriginX(),this.top="top"in i?i.top:this._getTopToOriginY()},_set:function(i,s){return this.callSuper("_set",i,s),typeof t[i]!="undefined"&&this._setWidthHeight(),this},_getLeftToOriginX:e({origin:"originX",axis1:"x1",axis2:"x2",dimension:"width"},{nearest:"left",center:"center",farthest:"right"}),_getTopToOriginY:e({origin:"originY",axis1:"y1",axis2:"y2",dimension:"height"},{nearest:"top",center:"center",farthest:"bottom"}),_render:function(i){i.beginPath();var s=this.calcLinePoints();i.moveTo(s.x1,s.y1),i.lineTo(s.x2,s.y2),i.lineWidth=this.strokeWidth;var m=i.strokeStyle;i.strokeStyle=this.stroke||i.fillStyle,this.stroke&&this._renderStroke(i),i.strokeStyle=m},_findCenterFromElement:function(){return{x:(this.x1+this.x2)/2,y:(this.y1+this.y2)/2}},toObject:function(i){return d(this.callSuper("toObject",i),this.calcLinePoints())},_getNonTransformedDimensions:function(){var i=this.callSuper("_getNonTransformedDimensions");return this.strokeLineCap==="butt"&&(this.width===0&&(i.y-=this.strokeWidth),this.height===0&&(i.x-=this.strokeWidth)),i},calcLinePoints:function(){var i=this.x1<=this.x2?-1:1,s=this.y1<=this.y2?-1:1,m=i*this.width*.5,o=s*this.height*.5,y=i*this.width*-.5,C=s*this.height*-.5;return{x1:m,x2:y,y1:o,y2:C}},_toSVG:function(){var i=this.calcLinePoints();return[" `]}}),a.Line.ATTRIBUTE_NAMES=a.SHARED_ATTRIBUTES.concat("x1 y1 x2 y2".split(" ")),a.Line.fromElement=function(i,s,m){m=m||{};var o=a.parseAttributes(i,a.Line.ATTRIBUTE_NAMES),y=[o.x1||0,o.y1||0,o.x2||0,o.y2||0];s(new a.Line(y,d(o,m)))},a.Line.fromObject=function(i,s){function m(y){delete y.points,s&&s(y)}var o=u(i,!0);o.points=[i.x1,i.y1,i.x2,i.y2],a.Object._fromObject("Line",o,m,"points")};function e(i,s){var m=i.origin,o=i.axis1,y=i.axis2,C=i.dimension,b=s.nearest,E=s.center,O=s.farthest;return function(){switch(this.get(m)){case b:return Math.min(this.get(o),this.get(y));case E:return Math.min(this.get(o),this.get(y))+.5*this.get(C);case O:return Math.max(this.get(o),this.get(y))}}}}(x),function(p){"use strict";var a=p.fabric||(p.fabric={}),d=Math.PI;if(a.Circle){a.warn("fabric.Circle is already defined.");return}a.Circle=a.util.createClass(a.Object,{type:"circle",radius:0,startAngle:0,endAngle:d*2,cacheProperties:a.Object.prototype.cacheProperties.concat("radius","startAngle","endAngle"),_set:function(t,e){return this.callSuper("_set",t,e),t==="radius"&&this.setRadius(e),this},toObject:function(t){return this.callSuper("toObject",["radius","startAngle","endAngle"].concat(t))},_toSVG:function(){var t,e=0,i=0,s=(this.endAngle-this.startAngle)%(2*d);if(s===0)t=[" `];else{var m=a.util.cos(this.startAngle)*this.radius,o=a.util.sin(this.startAngle)*this.radius,y=a.util.cos(this.endAngle)*this.radius,C=a.util.sin(this.endAngle)*this.radius,b=s>d?"1":"0";t=[' `]}return t},_render:function(t){t.beginPath(),t.arc(0,0,this.radius,this.startAngle,this.endAngle,!1),this._renderPaintInOrder(t)},getRadiusX:function(){return this.get("radius")*this.get("scaleX")},getRadiusY:function(){return this.get("radius")*this.get("scaleY")},setRadius:function(t){return this.radius=t,this.set("width",t*2).set("height",t*2)}}),a.Circle.ATTRIBUTE_NAMES=a.SHARED_ATTRIBUTES.concat("cx cy r".split(" ")),a.Circle.fromElement=function(t,e){var i=a.parseAttributes(t,a.Circle.ATTRIBUTE_NAMES);if(!u(i))throw new Error("value of `r` attribute is required and can not be negative");i.left=(i.left||0)-i.radius,i.top=(i.top||0)-i.radius,e(new a.Circle(i))};function u(t){return"radius"in t&&t.radius>=0}a.Circle.fromObject=function(t,e){a.Object._fromObject("Circle",t,e)}}(x),function(p){"use strict";var a=p.fabric||(p.fabric={});if(a.Triangle){a.warn("fabric.Triangle is already defined");return}a.Triangle=a.util.createClass(a.Object,{type:"triangle",width:100,height:100,_render:function(d){var u=this.width/2,t=this.height/2;d.beginPath(),d.moveTo(-u,t),d.lineTo(0,-t),d.lineTo(u,t),d.closePath(),this._renderPaintInOrder(d)},_toSVG:function(){var d=this.width/2,u=this.height/2,t=[-d+" "+u,"0 "+-u,d+" "+u].join(",");return["']}}),a.Triangle.fromObject=function(d,u){return a.Object._fromObject("Triangle",d,u)}}(x),function(p){"use strict";var a=p.fabric||(p.fabric={}),d=Math.PI*2;if(a.Ellipse){a.warn("fabric.Ellipse is already defined.");return}a.Ellipse=a.util.createClass(a.Object,{type:"ellipse",rx:0,ry:0,cacheProperties:a.Object.prototype.cacheProperties.concat("rx","ry"),initialize:function(u){this.callSuper("initialize",u),this.set("rx",u&&u.rx||0),this.set("ry",u&&u.ry||0)},_set:function(u,t){switch(this.callSuper("_set",u,t),u){case"rx":this.rx=t,this.set("width",t*2);break;case"ry":this.ry=t,this.set("height",t*2);break}return this},getRx:function(){return this.get("rx")*this.get("scaleX")},getRy:function(){return this.get("ry")*this.get("scaleY")},toObject:function(u){return this.callSuper("toObject",["rx","ry"].concat(u))},_toSVG:function(){return[" `]},_render:function(u){u.beginPath(),u.save(),u.transform(1,0,0,this.ry/this.rx,0,0),u.arc(0,0,this.rx,0,d,!1),u.restore(),this._renderPaintInOrder(u)}}),a.Ellipse.ATTRIBUTE_NAMES=a.SHARED_ATTRIBUTES.concat("cx cy rx ry".split(" ")),a.Ellipse.fromElement=function(u,t){var e=a.parseAttributes(u,a.Ellipse.ATTRIBUTE_NAMES);e.left=(e.left||0)-e.rx,e.top=(e.top||0)-e.ry,t(new a.Ellipse(e))},a.Ellipse.fromObject=function(u,t){a.Object._fromObject("Ellipse",u,t)}}(x),function(p){"use strict";var a=p.fabric||(p.fabric={}),d=a.util.object.extend;if(a.Rect){a.warn("fabric.Rect is already defined");return}a.Rect=a.util.createClass(a.Object,{stateProperties:a.Object.prototype.stateProperties.concat("rx","ry"),type:"rect",rx:0,ry:0,cacheProperties:a.Object.prototype.cacheProperties.concat("rx","ry"),initialize:function(u){this.callSuper("initialize",u),this._initRxRy()},_initRxRy:function(){this.rx&&!this.ry?this.ry=this.rx:this.ry&&!this.rx&&(this.rx=this.ry)},_render:function(u){var t=this.rx?Math.min(this.rx,this.width/2):0,e=this.ry?Math.min(this.ry,this.height/2):0,i=this.width,s=this.height,m=-this.width/2,o=-this.height/2,y=t!==0||e!==0,C=1-.5522847498;u.beginPath(),u.moveTo(m+t,o),u.lineTo(m+i-t,o),y&&u.bezierCurveTo(m+i-C*t,o,m+i,o+C*e,m+i,o+e),u.lineTo(m+i,o+s-e),y&&u.bezierCurveTo(m+i,o+s-C*e,m+i-C*t,o+s,m+i-t,o+s),u.lineTo(m+t,o+s),y&&u.bezierCurveTo(m+C*t,o+s,m,o+s-C*e,m,o+s-e),u.lineTo(m,o+e),y&&u.bezierCurveTo(m,o+C*e,m+C*t,o,m+t,o),u.closePath(),this._renderPaintInOrder(u)},toObject:function(u){return this.callSuper("toObject",["rx","ry"].concat(u))},_toSVG:function(){var u=-this.width/2,t=-this.height/2;return[" `]}}),a.Rect.ATTRIBUTE_NAMES=a.SHARED_ATTRIBUTES.concat("x y rx ry width height".split(" ")),a.Rect.fromElement=function(u,t,e){if(!u)return t(null);e=e||{};var i=a.parseAttributes(u,a.Rect.ATTRIBUTE_NAMES);i.left=i.left||0,i.top=i.top||0,i.height=i.height||0,i.width=i.width||0;var s=new a.Rect(d(e?a.util.object.clone(e):{},i));s.visible=s.visible&&s.width>0&&s.height>0,t(s)},a.Rect.fromObject=function(u,t){return a.Object._fromObject("Rect",u,t)}}(x),function(p){"use strict";var a=p.fabric||(p.fabric={}),d=a.util.object.extend,u=a.util.array.min,t=a.util.array.max,e=a.util.toFixed;if(a.Polyline){a.warn("fabric.Polyline is already defined");return}a.Polyline=a.util.createClass(a.Object,{type:"polyline",points:null,cacheProperties:a.Object.prototype.cacheProperties.concat("points"),initialize:function(i,s){s=s||{},this.points=i||[],this.callSuper("initialize",s),this._setPositionDimensions(s)},_setPositionDimensions:function(i){var s=this._calcDimensions(i),m;this.width=s.width,this.height=s.height,i.fromSVG||(m=this.translateToGivenOrigin({x:s.left-this.strokeWidth/2,y:s.top-this.strokeWidth/2},"left","top",this.originX,this.originY)),typeof i.left=="undefined"&&(this.left=i.fromSVG?s.left:m.x),typeof i.top=="undefined"&&(this.top=i.fromSVG?s.top:m.y),this.pathOffset={x:s.left+this.width/2,y:s.top+this.height/2}},_calcDimensions:function(){var i=this.points,s=u(i,"x")||0,m=u(i,"y")||0,o=t(i,"x")||0,y=t(i,"y")||0,C=o-s,b=y-m;return{left:s,top:m,width:C,height:b}},toObject:function(i){return d(this.callSuper("toObject",i),{points:this.points.concat()})},_toSVG:function(){for(var i=[],s=this.pathOffset.x,m=this.pathOffset.y,o=a.Object.NUM_FRACTION_DIGITS,y=0,C=this.points.length;y `]},commonRender:function(i){var s,m=this.points.length,o=this.pathOffset.x,y=this.pathOffset.y;if(!m||isNaN(this.points[m-1].y))return!1;i.beginPath(),i.moveTo(this.points[0].x-o,this.points[0].y-y);for(var C=0;C"},toObject:function(s){return t(this.callSuper("toObject",s),{path:this.path.map(function(m){return m.slice()})})},toDatalessObject:function(s){var m=this.toObject(["sourcePath"].concat(s));return m.sourcePath&&delete m.path,m},_toSVG:function(){var s=a.util.joinPath(this.path);return[" `]},_getOffsetTransform:function(){var s=a.Object.NUM_FRACTION_DIGITS;return" translate("+i(-this.pathOffset.x,s)+", "+i(-this.pathOffset.y,s)+")"},toClipPathSVG:function(s){var m=this._getOffsetTransform();return" "+this._createBaseClipPathSVGMarkup(this._toSVG(),{reviver:s,additionalTransform:m})},toSVG:function(s){var m=this._getOffsetTransform();return this._createBaseSVGMarkup(this._toSVG(),{reviver:s,additionalTransform:m})},complexity:function(){return this.path.length},_calcDimensions:function(){for(var s=[],m=[],o,y=0,C=0,b=0,E=0,O,L=0,N=this.path.length;L"},addWithUpdate:function(t){var e=!!this.group;return this._restoreObjectsState(),a.util.resetObjectTransform(this),t&&(e&&a.util.removeTransformFromObject(t,this.group.calcTransformMatrix()),this._objects.push(t),t.group=this,t._set("canvas",this.canvas)),this._calcBounds(),this._updateObjectsCoords(),this.dirty=!0,e?this.group.addWithUpdate():this.setCoords(),this},removeWithUpdate:function(t){return this._restoreObjectsState(),a.util.resetObjectTransform(this),this.remove(t),this._calcBounds(),this._updateObjectsCoords(),this.setCoords(),this.dirty=!0,this},_onObjectAdded:function(t){this.dirty=!0,t.group=this,t._set("canvas",this.canvas)},_onObjectRemoved:function(t){this.dirty=!0,delete t.group},_set:function(t,e){var i=this._objects.length;if(this.useSetOnGroup)for(;i--;)this._objects[i].setOnGroup(t,e);if(t==="canvas")for(;i--;)this._objects[i]._set(t,e);a.Object.prototype._set.call(this,t,e)},toObject:function(t){var e=this.includeDefaultValues,i=this._objects.filter(function(m){return!m.excludeFromExport}).map(function(m){var o=m.includeDefaultValues;m.includeDefaultValues=e;var y=m.toObject(t);return m.includeDefaultValues=o,y}),s=a.Object.prototype.toObject.call(this,t);return s.objects=i,s},toDatalessObject:function(t){var e,i=this.sourcePath;if(i)e=i;else{var s=this.includeDefaultValues;e=this._objects.map(function(o){var y=o.includeDefaultValues;o.includeDefaultValues=s;var C=o.toDatalessObject(t);return o.includeDefaultValues=y,C})}var m=a.Object.prototype.toDatalessObject.call(this,t);return m.objects=e,m},render:function(t){this._transformDone=!0,this.callSuper("render",t),this._transformDone=!1},shouldCache:function(){var t=a.Object.prototype.shouldCache.call(this);if(t){for(var e=0,i=this._objects.length;e `],i=0,s=this._objects.length;i `),e},getSvgStyles:function(){var t=typeof this.opacity!="undefined"&&this.opacity!==1?"opacity: "+this.opacity+";":"",e=this.visible?"":" visibility: hidden;";return[t,this.getSvgFilter(),e].join("")},toClipPathSVG:function(t){for(var e=[],i=0,s=this._objects.length;i"},shouldCache:function(){return!1},isOnACache:function(){return!1},_renderControls:function(d,u,t){d.save(),d.globalAlpha=this.isMoving?this.borderOpacityWhenMoving:1,this.callSuper("_renderControls",d,u),t=t||{},typeof t.hasControls=="undefined"&&(t.hasControls=!1),t.forActiveSelection=!0;for(var e=0,i=this._objects.length;e `,' `,` `),m=' clip-path="url(#imageCrop_'+y+')" '}if(this.imageSmoothing||(o='" image-rendering="optimizeSpeed'),u.push(" `),this.stroke||this.strokeDashArray){var C=this.fill;this.fill=null,t=[" `],this.fill=C}return this.paintFirst!=="fill"?d=d.concat(t,u):d=d.concat(u,t),d},getSrc:function(d){var u=d?this._element:this._originalElement;return u?u.toDataURL?u.toDataURL():this.srcFromAttribute?u.getAttribute("src"):u.src:this.src||""},setSrc:function(d,u,t){return c.util.loadImage(d,function(e,i){this.setElement(e,t),this._setWidthHeight(),u&&u(this,i)},this,t&&t.crossOrigin),this},toString:function(){return'#'},applyResizeFilters:function(){var d=this.resizeFilter,u=this.minimumScaleTrigger,t=this.getTotalObjectScaling(),e=t.scaleX,i=t.scaleY,s=this._filteredEl||this._originalElement;if(this.group&&this.set("dirty",!0),!d||e>u&&i>u){this._element=s,this._filterScalingX=1,this._filterScalingY=1,this._lastScaleX=e,this._lastScaleY=i;return}c.filterBackend||(c.filterBackend=c.initFilterBackend());var m=c.util.createCanvasElement(),o=this._filteredEl?this.cacheKey+"_filtered":this.cacheKey,y=s.width,C=s.height;m.width=y,m.height=C,this._element=m,this._lastScaleX=d.scaleX=e,this._lastScaleY=d.scaleY=i,c.filterBackend.applyFilters([d],s,y,C,this._element,o),this._filterScalingX=m.width/this._originalElement.width,this._filterScalingY=m.height/this._originalElement.height},applyFilters:function(d){if(d=d||this.filters||[],d=d.filter(function(s){return s&&!s.isNeutralState()}),this.set("dirty",!0),this.removeTexture(this.cacheKey+"_filtered"),d.length===0)return this._element=this._originalElement,this._filteredEl=null,this._filterScalingX=1,this._filterScalingY=1,this;var u=this._originalElement,t=u.naturalWidth||u.width,e=u.naturalHeight||u.height;if(this._element===this._originalElement){var i=c.util.createCanvasElement();i.width=t,i.height=e,this._element=i,this._filteredEl=i}else this._element=this._filteredEl,this._filteredEl.getContext("2d").clearRect(0,0,t,e),this._lastScaleX=1,this._lastScaleY=1;return c.filterBackend||(c.filterBackend=c.initFilterBackend()),c.filterBackend.applyFilters(d,this._originalElement,t,e,this._element,this.cacheKey),(this._originalElement.width!==this._element.width||this._originalElement.height!==this._element.height)&&(this._filterScalingX=this._element.width/this._originalElement.width,this._filterScalingY=this._element.height/this._originalElement.height),this},_render:function(d){c.util.setImageSmoothing(d,this.imageSmoothing),this.isMoving!==!0&&this.resizeFilter&&this._needsResize()&&this.applyResizeFilters(),this._stroke(d),this._renderPaintInOrder(d)},drawCacheOnCanvas:function(d){c.util.setImageSmoothing(d,this.imageSmoothing),c.Object.prototype.drawCacheOnCanvas.call(this,d)},shouldCache:function(){return this.needsItsOwnCache()},_renderFill:function(d){var u=this._element;if(!!u){var t=this._filterScalingX,e=this._filterScalingY,i=this.width,s=this.height,m=Math.min,o=Math.max,y=o(this.cropX,0),C=o(this.cropY,0),b=u.naturalWidth||u.width,E=u.naturalHeight||u.height,O=y*t,L=C*e,N=m(i*t,b-O),B=m(s*e,E-L),Y=-i/2,nt=-s/2,it=m(i,b/t-y),Mt=m(s,E/e-C);u&&d.drawImage(u,O,L,N,B,Y,nt,it,Mt)}},_needsResize:function(){var d=this.getTotalObjectScaling();return d.scaleX!==this._lastScaleX||d.scaleY!==this._lastScaleY},_resetWidthHeight:function(){this.set(this.getOriginalSize())},_initElement:function(d,u){this.setElement(c.util.getById(d),u),c.util.addClass(this.getElement(),c.Image.CSS_CANVAS)},_initConfig:function(d){d||(d={}),this.setOptions(d),this._setWidthHeight(d)},_initFilters:function(d,u){d&&d.length?c.util.enlivenObjects(d,function(t){u&&u(t)},"fabric.Image.filters"):u&&u()},_setWidthHeight:function(d){d||(d={});var u=this.getElement();this.width=d.width||u.naturalWidth||u.width||0,this.height=d.height||u.naturalHeight||u.height||0},parsePreserveAspectRatioAttribute:function(){var d=c.util.parsePreserveAspectRatioAttribute(this.preserveAspectRatio||""),u=this._element.width,t=this._element.height,e=1,i=1,s=0,m=0,o=0,y=0,C,b=this.width,E=this.height,O={width:b,height:E};return d&&(d.alignX!=="none"||d.alignY!=="none")?(d.meetOrSlice==="meet"&&(e=i=c.util.findScaleToFit(this._element,O),C=(b-u*e)/2,d.alignX==="Min"&&(s=-C),d.alignX==="Max"&&(s=C),C=(E-t*i)/2,d.alignY==="Min"&&(m=-C),d.alignY==="Max"&&(m=C)),d.meetOrSlice==="slice"&&(e=i=c.util.findScaleToCover(this._element,O),C=u-b/e,d.alignX==="Mid"&&(o=C/2),d.alignX==="Max"&&(o=C),C=t-E/i,d.alignY==="Mid"&&(y=C/2),d.alignY==="Max"&&(y=C),u=b/e,t=E/i)):(e=b/u,i=E/t),{width:u,height:t,scaleX:e,scaleY:i,offsetLeft:s,offsetTop:m,cropX:o,cropY:y}}}),c.Image.CSS_CANVAS="canvas-img",c.Image.prototype.getSvgSrc=c.Image.prototype.getSrc,c.Image.fromObject=function(d,u){var t=c.util.object.clone(d);c.util.loadImage(t.src,function(e,i){if(i){u&&u(null,!0);return}c.Image.prototype._initFilters.call(t,t.filters,function(s){t.filters=s||[],c.Image.prototype._initFilters.call(t,[t.resizeFilter],function(m){t.resizeFilter=m[0],c.util.enlivenObjects([t.clipPath],function(o){t.clipPath=o[0];var y=new c.Image(e,t);u(y,!1)})})})},null,t.crossOrigin)},c.Image.fromURL=function(d,u,t){c.util.loadImage(d,function(e,i){u&&u(new c.Image(e,t),i)},null,t&&t.crossOrigin)},c.Image.ATTRIBUTE_NAMES=c.SHARED_ATTRIBUTES.concat("x y width height preserveAspectRatio xlink:href crossOrigin image-rendering".split(" ")),c.Image.fromElement=function(d,u,t){var e=c.parseAttributes(d,c.Image.ATTRIBUTE_NAMES);c.Image.fromURL(e["xlink:href"],u,a(t?c.util.object.clone(t):{},e))}}(x),c.util.object.extend(c.Object.prototype,{_getAngleValueForStraighten:function(){var p=this.angle%360;return p>0?Math.round((p-1)/90)*90:Math.round(p/90)*90},straighten:function(){return this.rotate(this._getAngleValueForStraighten()),this},fxStraighten:function(p){p=p||{};var a=function(){},d=p.onComplete||a,u=p.onChange||a,t=this;return c.util.animate({startValue:this.get("angle"),endValue:this._getAngleValueForStraighten(),duration:this.FX_DURATION,onChange:function(e){t.rotate(e),u()},onComplete:function(){t.setCoords(),d()}}),this}}),c.util.object.extend(c.StaticCanvas.prototype,{straightenObject:function(p){return p.straighten(),this.requestRenderAll(),this},fxStraightenObject:function(p){return p.fxStraighten({onChange:this.requestRenderAllBound}),this}}),function(){"use strict";function p(d,u){var t="precision "+u+` float; void main(){}`,e=d.createShader(d.FRAGMENT_SHADER);return d.shaderSource(e,t),d.compileShader(e),!!d.getShaderParameter(e,d.COMPILE_STATUS)}c.isWebglSupported=function(d){if(c.isLikelyNode)return!1;d=d||c.WebglFilterBackend.prototype.tileSize;var u=document.createElement("canvas"),t=u.getContext("webgl")||u.getContext("experimental-webgl"),e=!1;if(t){c.maxTextureSize=t.getParameter(t.MAX_TEXTURE_SIZE),e=c.maxTextureSize>=d;for(var i=["highp","mediump","lowp"],s=0;s<3;s++)if(p(t,i[s])){c.webGlPrecision=i[s];break}}return this.isSupported=e,e},c.WebglFilterBackend=a;function a(d){d&&d.tileSize&&(this.tileSize=d.tileSize),this.setupGLContext(this.tileSize,this.tileSize),this.captureGPUInfo()}a.prototype={tileSize:2048,resources:{},setupGLContext:function(d,u){this.dispose(),this.createWebGLCanvas(d,u),this.aPosition=new Float32Array([0,0,0,1,1,0,1,1]),this.chooseFastestCopyGLTo2DMethod(d,u)},chooseFastestCopyGLTo2DMethod:function(d,u){var t=typeof window.performance!="undefined",e;try{new ImageData(1,1),e=!0}catch(O){e=!1}var i=typeof ArrayBuffer!="undefined",s=typeof Uint8ClampedArray!="undefined";if(!!(t&&e&&i&&s)){var m=c.util.createCanvasElement(),o=new ArrayBuffer(d*u*4);if(c.forceGLPutImageData){this.imageBuffer=o,this.copyGLTo2D=j;return}var y={imageBuffer:o,destinationWidth:d,destinationHeight:u,targetCanvas:m},C,b,E;m.width=d,m.height=u,C=window.performance.now(),P.call(y,this.gl,y),b=window.performance.now()-C,C=window.performance.now(),j.call(y,this.gl,y),E=window.performance.now()-C,b>E?(this.imageBuffer=o,this.copyGLTo2D=j):this.copyGLTo2D=P}},createWebGLCanvas:function(d,u){var t=c.util.createCanvasElement();t.width=d,t.height=u;var e={alpha:!0,premultipliedAlpha:!1,depth:!1,stencil:!1,antialias:!1},i=t.getContext("webgl",e);i||(i=t.getContext("experimental-webgl",e)),!!i&&(i.clearColor(0,0,0,0),this.canvas=t,this.gl=i)},applyFilters:function(d,u,t,e,i,s){var m=this.gl,o;s&&(o=this.getCachedTexture(s,u));var y={originalWidth:u.width||u.originalWidth,originalHeight:u.height||u.originalHeight,sourceWidth:t,sourceHeight:e,destinationWidth:t,destinationHeight:e,context:m,sourceTexture:this.createTexture(m,t,e,!o&&u),targetTexture:this.createTexture(m,t,e),originalTexture:o||this.createTexture(m,t,e,!o&&u),passes:d.length,webgl:!0,aPosition:this.aPosition,programCache:this.programCache,pass:0,filterBackend:this,targetCanvas:i},C=m.createFramebuffer();return m.bindFramebuffer(m.FRAMEBUFFER,C),d.forEach(function(b){b&&b.applyTo(y)}),D(y),this.copyGLTo2D(m,y),m.bindTexture(m.TEXTURE_2D,null),m.deleteTexture(y.sourceTexture),m.deleteTexture(y.targetTexture),m.deleteFramebuffer(C),i.getContext("2d").setTransform(1,0,0,1,0,0),y},dispose:function(){this.canvas&&(this.canvas=null,this.gl=null),this.clearWebGLCaches()},clearWebGLCaches:function(){this.programCache={},this.textureCache={}},createTexture:function(d,u,t,e){var i=d.createTexture();return d.bindTexture(d.TEXTURE_2D,i),d.texParameteri(d.TEXTURE_2D,d.TEXTURE_MAG_FILTER,d.NEAREST),d.texParameteri(d.TEXTURE_2D,d.TEXTURE_MIN_FILTER,d.NEAREST),d.texParameteri(d.TEXTURE_2D,d.TEXTURE_WRAP_S,d.CLAMP_TO_EDGE),d.texParameteri(d.TEXTURE_2D,d.TEXTURE_WRAP_T,d.CLAMP_TO_EDGE),e?d.texImage2D(d.TEXTURE_2D,0,d.RGBA,d.RGBA,d.UNSIGNED_BYTE,e):d.texImage2D(d.TEXTURE_2D,0,d.RGBA,u,t,0,d.RGBA,d.UNSIGNED_BYTE,null),i},getCachedTexture:function(d,u){if(this.textureCache[d])return this.textureCache[d];var t=this.createTexture(this.gl,u.width,u.height,u);return this.textureCache[d]=t,t},evictCachesForKey:function(d){this.textureCache[d]&&(this.gl.deleteTexture(this.textureCache[d]),delete this.textureCache[d])},copyGLTo2D:P,captureGPUInfo:function(){if(this.gpuInfo)return this.gpuInfo;var d=this.gl,u={renderer:"",vendor:""};if(!d)return u;var t=d.getExtension("WEBGL_debug_renderer_info");if(t){var e=d.getParameter(t.UNMASKED_RENDERER_WEBGL),i=d.getParameter(t.UNMASKED_VENDOR_WEBGL);e&&(u.renderer=e.toLowerCase()),i&&(u.vendor=i.toLowerCase())}return this.gpuInfo=u,u}}}();function D(p){var a=p.targetCanvas,d=a.width,u=a.height,t=p.destinationWidth,e=p.destinationHeight;(d!==t||u!==e)&&(a.width=t,a.height=e)}function P(p,a){var d=p.canvas,u=a.targetCanvas,t=u.getContext("2d");t.translate(0,u.height),t.scale(1,-1);var e=d.height-u.height;t.drawImage(d,0,e,u.width,u.height,0,0,u.width,u.height)}function j(p,a){var d=a.targetCanvas,u=d.getContext("2d"),t=a.destinationWidth,e=a.destinationHeight,i=t*e*4,s=new Uint8Array(this.imageBuffer,0,i),m=new Uint8ClampedArray(this.imageBuffer,0,i);p.readPixels(0,0,t,e,p.RGBA,p.UNSIGNED_BYTE,s);var o=new ImageData(m,t,e);u.putImageData(o,0,0)}(function(){"use strict";var p=function(){};c.Canvas2dFilterBackend=a;function a(){}a.prototype={evictCachesForKey:p,dispose:p,clearWebGLCaches:p,resources:{},applyFilters:function(d,u,t,e,i){var s=i.getContext("2d");s.drawImage(u,0,0,t,e);var m=s.getImageData(0,0,t,e),o=s.getImageData(0,0,t,e),y={sourceWidth:t,sourceHeight:e,imageData:m,originalEl:u,originalImageData:o,canvasEl:i,ctx:s,filterBackend:this};return d.forEach(function(C){C.applyTo(y)}),(y.imageData.width!==t||y.imageData.height!==e)&&(i.width=y.imageData.width,i.height=y.imageData.height),s.putImageData(y.imageData,0,0),y}}})(),c.Image=c.Image||{},c.Image.filters=c.Image.filters||{},c.Image.filters.BaseFilter=c.util.createClass({type:"BaseFilter",vertexSource:`attribute vec2 aPosition; varying vec2 vTexCoord; void main() { vTexCoord = aPosition; gl_Position = vec4(aPosition * 2.0 - 1.0, 0.0, 1.0); }`,fragmentSource:`precision highp float; varying vec2 vTexCoord; uniform sampler2D uTexture; void main() { gl_FragColor = texture2D(uTexture, vTexCoord); }`,initialize:function(p){p&&this.setOptions(p)},setOptions:function(p){for(var a in p)this[a]=p[a]},createProgram:function(p,a,d){a=a||this.fragmentSource,d=d||this.vertexSource,c.webGlPrecision!=="highp"&&(a=a.replace(/precision highp float/g,"precision "+c.webGlPrecision+" float"));var u=p.createShader(p.VERTEX_SHADER);if(p.shaderSource(u,d),p.compileShader(u),!p.getShaderParameter(u,p.COMPILE_STATUS))throw new Error("Vertex shader compile error for "+this.type+": "+p.getShaderInfoLog(u));var t=p.createShader(p.FRAGMENT_SHADER);if(p.shaderSource(t,a),p.compileShader(t),!p.getShaderParameter(t,p.COMPILE_STATUS))throw new Error("Fragment shader compile error for "+this.type+": "+p.getShaderInfoLog(t));var e=p.createProgram();if(p.attachShader(e,u),p.attachShader(e,t),p.linkProgram(e),!p.getProgramParameter(e,p.LINK_STATUS))throw new Error('Shader link error for "${this.type}" '+p.getProgramInfoLog(e));var i=this.getAttributeLocations(p,e),s=this.getUniformLocations(p,e)||{};return s.uStepW=p.getUniformLocation(e,"uStepW"),s.uStepH=p.getUniformLocation(e,"uStepH"),{program:e,attributeLocations:i,uniformLocations:s}},getAttributeLocations:function(p,a){return{aPosition:p.getAttribLocation(a,"aPosition")}},getUniformLocations:function(){return{}},sendAttributeData:function(p,a,d){var u=a.aPosition,t=p.createBuffer();p.bindBuffer(p.ARRAY_BUFFER,t),p.enableVertexAttribArray(u),p.vertexAttribPointer(u,2,p.FLOAT,!1,0,0),p.bufferData(p.ARRAY_BUFFER,d,p.STATIC_DRAW)},_setupFrameBuffer:function(p){var a=p.context,d,u;p.passes>1?(d=p.destinationWidth,u=p.destinationHeight,(p.sourceWidth!==d||p.sourceHeight!==u)&&(a.deleteTexture(p.targetTexture),p.targetTexture=p.filterBackend.createTexture(a,d,u)),a.framebufferTexture2D(a.FRAMEBUFFER,a.COLOR_ATTACHMENT0,a.TEXTURE_2D,p.targetTexture,0)):(a.bindFramebuffer(a.FRAMEBUFFER,null),a.finish())},_swapTextures:function(p){p.passes--,p.pass++;var a=p.targetTexture;p.targetTexture=p.sourceTexture,p.sourceTexture=a},isNeutralState:function(){var p=this.mainParameter,a=c.Image.filters[this.type].prototype;if(p)if(Array.isArray(a[p])){for(var d=a[p].length;d--;)if(this[p][d]!==a[p][d])return!1;return!0}else return a[p]===this[p];else return!1},applyTo:function(p){p.webgl?(this._setupFrameBuffer(p),this.applyToWebGL(p),this._swapTextures(p)):this.applyTo2d(p)},retrieveShader:function(p){return p.programCache.hasOwnProperty(this.type)||(p.programCache[this.type]=this.createProgram(p.context)),p.programCache[this.type]},applyToWebGL:function(p){var a=p.context,d=this.retrieveShader(p);p.pass===0&&p.originalTexture?a.bindTexture(a.TEXTURE_2D,p.originalTexture):a.bindTexture(a.TEXTURE_2D,p.sourceTexture),a.useProgram(d.program),this.sendAttributeData(a,d.attributeLocations,p.aPosition),a.uniform1f(d.uniformLocations.uStepW,1/p.sourceWidth),a.uniform1f(d.uniformLocations.uStepH,1/p.sourceHeight),this.sendUniformData(a,d.uniformLocations),a.viewport(0,0,p.destinationWidth,p.destinationHeight),a.drawArrays(a.TRIANGLE_STRIP,0,4)},bindAdditionalTexture:function(p,a,d){p.activeTexture(d),p.bindTexture(p.TEXTURE_2D,a),p.activeTexture(p.TEXTURE0)},unbindAdditionalTexture:function(p,a){p.activeTexture(a),p.bindTexture(p.TEXTURE_2D,null),p.activeTexture(p.TEXTURE0)},getMainParameter:function(){return this[this.mainParameter]},setMainParameter:function(p){this[this.mainParameter]=p},sendUniformData:function(){},createHelpLayer:function(p){if(!p.helpLayer){var a=document.createElement("canvas");a.width=p.sourceWidth,a.height=p.sourceHeight,p.helpLayer=a}},toObject:function(){var p={type:this.type},a=this.mainParameter;return a&&(p[a]=this[a]),p},toJSON:function(){return this.toObject()}}),c.Image.filters.BaseFilter.fromObject=function(p,a){var d=new c.Image.filters[p.type](p);return a&&a(d),d},function(p){"use strict";var a=p.fabric||(p.fabric={}),d=a.Image.filters,u=a.util.createClass;d.ColorMatrix=u(d.BaseFilter,{type:"ColorMatrix",fragmentSource:`precision highp float; uniform sampler2D uTexture; varying vec2 vTexCoord; uniform mat4 uColorMatrix; uniform vec4 uConstants; void main() { vec4 color = texture2D(uTexture, vTexCoord); color *= uColorMatrix; color += uConstants; gl_FragColor = color; }`,matrix:[1,0,0,0,0,0,1,0,0,0,0,0,1,0,0,0,0,0,1,0],mainParameter:"matrix",colorsOnly:!0,initialize:function(t){this.callSuper("initialize",t),this.matrix=this.matrix.slice(0)},applyTo2d:function(t){var e=t.imageData,i=e.data,s=i.length,m=this.matrix,o,y,C,b,E,O=this.colorsOnly;for(E=0;E=b||Mt<0||Mt>=C)&&(It=(K*C+Mt)*4,U=m[V*o+Nt],N+=s[It]*U,B+=s[It+1]*U,Y+=s[It+2]*U,L||(nt+=s[It+3]*U));O[it]=N,O[it+1]=B,O[it+2]=Y,L?O[it+3]=s[it+3]:O[it+3]=nt}e.imageData=E},getUniformLocations:function(e,i){return{uMatrix:e.getUniformLocation(i,"uMatrix"),uOpaque:e.getUniformLocation(i,"uOpaque"),uHalfSize:e.getUniformLocation(i,"uHalfSize"),uSize:e.getUniformLocation(i,"uSize")}},sendUniformData:function(e,i){e.uniform1fv(i.uMatrix,this.matrix)},toObject:function(){return d(this.callSuper("toObject"),{opaque:this.opaque,matrix:this.matrix})}}),a.Image.filters.Convolute.fromObject=a.Image.filters.BaseFilter.fromObject}(x),function(p){"use strict";var a=p.fabric||(p.fabric={}),d=a.Image.filters,u=a.util.createClass;d.Grayscale=u(d.BaseFilter,{type:"Grayscale",fragmentSource:{average:`precision highp float; uniform sampler2D uTexture; varying vec2 vTexCoord; void main() { vec4 color = texture2D(uTexture, vTexCoord); float average = (color.r + color.b + color.g) / 3.0; gl_FragColor = vec4(average, average, average, color.a); }`,lightness:`precision highp float; uniform sampler2D uTexture; uniform int uMode; varying vec2 vTexCoord; void main() { vec4 col = texture2D(uTexture, vTexCoord); float average = (max(max(col.r, col.g),col.b) + min(min(col.r, col.g),col.b)) / 2.0; gl_FragColor = vec4(average, average, average, col.a); }`,luminosity:`precision highp float; uniform sampler2D uTexture; uniform int uMode; varying vec2 vTexCoord; void main() { vec4 col = texture2D(uTexture, vTexCoord); float average = 0.21 * col.r + 0.72 * col.g + 0.07 * col.b; gl_FragColor = vec4(average, average, average, col.a); }`},mode:"average",mainParameter:"mode",applyTo2d:function(t){var e=t.imageData,i=e.data,s,m=i.length,o,y=this.mode;for(s=0;sO[0]&&C>O[1]&&b>O[2]&&y 0.0) { `+this.fragmentSource[t]+`} }`},retrieveShader:function(t){var e=this.type+"_"+this.mode,i;return t.programCache.hasOwnProperty(e)||(i=this.buildSource(this.mode),t.programCache[e]=this.createProgram(t.context,i)),t.programCache[e]},applyTo2d:function(t){var e=t.imageData,i=e.data,s=i.length,m,o,y,C,b,E,O,L=1-this.alpha;O=new a.Color(this.color).getSource(),m=O[0]*this.alpha,o=O[1]*this.alpha,y=O[2]*this.alpha;for(var N=0;N=C||b<=-C)return 0;if(b<11920929e-14&&b>-11920929e-14)return 1;b*=Math.PI;var E=b/C;return s(b)/b*s(E)/E}},applyTo2d:function(C){var b=C.imageData,E=this.scaleX,O=this.scaleY;this.rcpScaleX=1/E,this.rcpScaleY=1/O;var L=b.width,N=b.height,B=i(L*E),Y=i(N*O),nt;this.resizeType==="sliceHack"?nt=this.sliceByTwo(C,L,N,B,Y):this.resizeType==="hermite"?nt=this.hermiteFastResize(C,L,N,B,Y):this.resizeType==="bilinear"?nt=this.bilinearFiltering(C,L,N,B,Y):this.resizeType==="lanczos"&&(nt=this.lanczosResize(C,L,N,B,Y)),C.imageData=nt},sliceByTwo:function(C,b,E,O,L){var N=C.imageData,B=.5,Y=!1,nt=!1,it=b*B,Mt=E*B,K=a.filterBackend.resources,It,U,Lt=0,dt=0,Nt=b,V=0;for(K.sliceByTwo||(K.sliceByTwo=document.createElement("canvas")),It=K.sliceByTwo,(It.width=b)){Tt=u(1e3*e(rt-V.x)),Nt[Tt]||(Nt[Tt]={});for(var at=q.y-dt;at<=q.y+dt;at++)at<0||at>=E||(xt=u(1e3*e(at-V.y)),Nt[Tt][xt]||(Nt[Tt][xt]=it(t(d(Tt*It,2)+d(xt*U,2))/1e3)),F=Nt[Tt][xt],F>0&&(W=(at*b+rt)*4,X+=F,Z+=F*B[W],gt+=F*B[W+1],ht+=F*B[W+2],bt+=F*B[W+3]))}W=(G*O+Q)*4,nt[W]=Z/X,nt[W+1]=gt/X,nt[W+2]=ht/X,nt[W+3]=bt/X}return++Q1&&xt<-1||(Nt=2*xt*xt*xt-3*xt*xt+1,Nt>0&&(Tt=4*(bt+X*b),F+=Nt*Mt[Tt+3],q+=Nt,Mt[Tt+3]<255&&(Nt=Nt*Mt[Tt+3]/250),Q+=Nt*Mt[Tt],G+=Nt*Mt[Tt+1],rt+=Nt*Mt[Tt+2],V+=Nt))}It[dt]=Q/V,It[dt+1]=G/V,It[dt+2]=rt/V,It[dt+3]=F/q}return K},toObject:function(){return{type:this.type,scaleX:this.scaleX,scaleY:this.scaleY,resizeType:this.resizeType,lanczosLobes:this.lanczosLobes}}}),a.Image.filters.Resize.fromObject=a.Image.filters.BaseFilter.fromObject}(x),function(p){"use strict";var a=p.fabric||(p.fabric={}),d=a.Image.filters,u=a.util.createClass;d.Contrast=u(d.BaseFilter,{type:"Contrast",fragmentSource:`precision highp float; uniform sampler2D uTexture; uniform float uContrast; varying vec2 vTexCoord; void main() { vec4 color = texture2D(uTexture, vTexCoord); float contrastF = 1.015 * (uContrast + 1.0) / (1.0 * (1.015 - uContrast)); color.rgb = contrastF * (color.rgb - 0.5) + 0.5; gl_FragColor = color; }`,contrast:0,mainParameter:"contrast",applyTo2d:function(t){if(this.contrast!==0){var e=t.imageData,i,s,m=e.data,s=m.length,o=Math.floor(this.contrast*255),y=259*(o+255)/(255*(259-o));for(i=0;i1&&(t=1/this.aspectRatio):this.aspectRatio<1&&(t=this.aspectRatio),i=t*this.blur*.12,this.horizontal?e[0]=i:e[1]=i,e}}),d.Blur.fromObject=a.Image.filters.BaseFilter.fromObject}(x),function(p){"use strict";var a=p.fabric||(p.fabric={}),d=a.Image.filters,u=a.util.createClass;d.Gamma=u(d.BaseFilter,{type:"Gamma",fragmentSource:`precision highp float; uniform sampler2D uTexture; uniform vec3 uGamma; varying vec2 vTexCoord; void main() { vec4 color = texture2D(uTexture, vTexCoord); vec3 correction = (1.0 / uGamma); color.r = pow(color.r, correction.r); color.g = pow(color.g, correction.g); color.b = pow(color.b, correction.b); gl_FragColor = color; gl_FragColor.rgb *= color.a; }`,gamma:[1,1,1],mainParameter:"gamma",initialize:function(t){this.gamma=[1,1,1],d.BaseFilter.prototype.initialize.call(this,t)},applyTo2d:function(t){var e=t.imageData,i=e.data,s=this.gamma,m=i.length,o=1/s[0],y=1/s[1],C=1/s[2],b;for(this.rVals||(this.rVals=new Uint8Array(256),this.gVals=new Uint8Array(256),this.bVals=new Uint8Array(256)),b=0,m=256;b'},_getCacheCanvasDimensions:function(){var t=this.callSuper("_getCacheCanvasDimensions"),e=this.fontSize;return t.width+=e*t.zoomX,t.height+=e*t.zoomY,t},_render:function(t){var e=this.path;e&&!e.isNotVisible()&&e._render(t),this._setTextStyles(t),this._renderTextLinesBackground(t),this._renderTextDecoration(t,"underline"),this._renderText(t),this._renderTextDecoration(t,"overline"),this._renderTextDecoration(t,"linethrough")},_renderText:function(t){this.paintFirst==="stroke"?(this._renderTextStroke(t),this._renderTextFill(t)):(this._renderTextFill(t),this._renderTextStroke(t))},_setTextStyles:function(t,e,i){t.textBaseline="alphabetic",t.font=this._getFontDeclaration(e,i)},calcTextWidth:function(){for(var t=this.getLineWidth(0),e=1,i=this._textLines.length;et&&(t=s)}return t},_renderTextLine:function(t,e,i,s,m,o){this._renderChars(t,e,i,s,m,o)},_renderTextLinesBackground:function(t){if(!(!this.textBackgroundColor&&!this.styleHas("textBackgroundColor"))){for(var e,i,s=t.fillStyle,m,o,y=this._getLeftOffset(),C=this._getTopOffset(),b=0,E=0,O,L,N=this.path,B,Y=0,nt=this._textLines.length;Y=0:iL?E%=L:E<0&&(E+=L),this._setGraphemeOnPath(E,y,O),E+=y.kernedWidth}return{width:e,numOfSpaces:C}},_setGraphemeOnPath:function(t,e,i){var s=t+e.kernedWidth/2,m=this.path,o=a.util.getPointOnPath(m.path,s,m.segmentsInfo);e.renderLeft=o.x-i.x,e.renderTop=o.y-i.y,e.angle=o.angle+(this.pathSide==="right"?Math.PI:0)},_getGraphemeBox:function(t,e,i,s,m){var o=this.getCompleteStyleDeclaration(e,i),y=s?this.getCompleteStyleDeclaration(e,i-1):{},C=this._measureChar(t,o,s,y),b=C.kernedWidth,E=C.width,O;this.charSpacing!==0&&(O=this._getWidthOfCharSpacing(),E+=O,b+=O);var L={width:E,left:0,height:o.fontSize,kernedWidth:b,deltaY:o.deltaY};if(i>0&&!m){var N=this.__charBounds[e][i-1];L.left=N.left+N.width+C.kernedWidth-C.width}return L},getHeightOfLine:function(t){if(this.__lineHeights[t])return this.__lineHeights[t];for(var e=this._textLines[t],i=this.getHeightOfChar(t,0),s=1,m=e.length;s0){var G=O+o+B;this.direction==="rtl"&&(G=this.width-G-Y),E&&It&&(t.fillStyle=It,t.fillRect(G,N+dt*s+y,Y,this.fontSize/15)),B=nt.left,Y=nt.width,E=it,It=K,s=m,y=C}else Y+=nt.kernedWidth;var G=O+o+B;this.direction==="rtl"&&(G=this.width-G-Y),t.fillStyle=K,it&&K&&t.fillRect(G,N+dt*s+y,Y-Lt,this.fontSize/15),L+=i}this._removeShadow(t)}},_getFontDeclaration:function(t,e){var i=t||this,s=this.fontFamily,m=a.Text.genericFonts.indexOf(s.toLowerCase())>-1,o=s===void 0||s.indexOf("'")>-1||s.indexOf(",")>-1||s.indexOf('"')>-1||m?i.fontFamily:'"'+i.fontFamily+'"';return[a.isLikelyNode?i.fontWeight:i.fontStyle,a.isLikelyNode?i.fontStyle:i.fontWeight,e?this.CACHE_FONT_SIZE+"px":i.fontSize+"px",o].join(" ")},render:function(t){!this.visible||this.canvas&&this.canvas.skipOffscreen&&!this.group&&!this.isOnScreen()||(this._shouldClearDimensionCache()&&this.initDimensions(),this.callSuper("render",t))},_splitTextIntoLines:function(t){for(var e=t.split(this._reNewline),i=new Array(e.length),s=[` `],m=[],o=0;o-1&&(a.underline=!0),a.textDecoration.indexOf("line-through")>-1&&(a.linethrough=!0),a.textDecoration.indexOf("overline")>-1&&(a.overline=!0),delete a.textDecoration)}c.IText=c.util.createClass(c.Text,c.Observable,{type:"i-text",selectionStart:0,selectionEnd:0,selectionColor:"rgba(17,119,255,0.3)",isEditing:!1,editable:!0,editingBorderColor:"rgba(102,153,255,0.25)",cursorWidth:2,cursorColor:"",cursorDelay:1e3,cursorDuration:600,caching:!0,hiddenTextareaContainer:null,_reSpace:/\s|\n/,_currentCursorOpacity:0,_selectionDirection:null,_abortCursorAnimation:!1,__widthOfSpace:[],inCompositionMode:!1,initialize:function(a,d){this.callSuper("initialize",a,d),this.initBehavior()},setSelectionStart:function(a){a=Math.max(a,0),this._updateAndFire("selectionStart",a)},setSelectionEnd:function(a){a=Math.min(a,this.text.length),this._updateAndFire("selectionEnd",a)},_updateAndFire:function(a,d){this[a]!==d&&(this._fireSelectionChanged(),this[a]=d),this._updateTextarea()},_fireSelectionChanged:function(){this.fire("selection:changed"),this.canvas&&this.canvas.fire("text:selection:changed",{target:this})},initDimensions:function(){this.isEditing&&this.initDelayedCursor(),this.clearContextTop(),this.callSuper("initDimensions")},render:function(a){this.clearContextTop(),this.callSuper("render",a),this.cursorOffsetCache={},this.renderCursorOrSelection()},_render:function(a){this.callSuper("_render",a)},clearContextTop:function(a){if(!(!this.isEditing||!this.canvas||!this.canvas.contextTop)){var d=this.canvas.contextTop,u=this.canvas.viewportTransform;d.save(),d.transform(u[0],u[1],u[2],u[3],u[4],u[5]),this.transform(d),this._clearTextArea(d),a||d.restore()}},renderCursorOrSelection:function(){if(!(!this.isEditing||!this.canvas||!this.canvas.contextTop)){var a=this._getCursorBoundaries(),d=this.canvas.contextTop;this.clearContextTop(!0),this.selectionStart===this.selectionEnd?this.renderCursor(a,d):this.renderSelection(a,d),d.restore()}},_clearTextArea:function(a){var d=this.width+4,u=this.height+4;a.clearRect(-d/2,-u/2,d,u)},_getCursorBoundaries:function(a){typeof a=="undefined"&&(a=this.selectionStart);var d=this._getLeftOffset(),u=this._getTopOffset(),t=this._getCursorBoundariesOffsets(a);return{left:d,top:u,leftOffset:t.left,topOffset:t.top}},_getCursorBoundariesOffsets:function(a){if(this.cursorOffsetCache&&"top"in this.cursorOffsetCache)return this.cursorOffsetCache;var d,u,t,e=0,i=0,s,m=this.get2DCursorLocation(a);t=m.charIndex,u=m.lineIndex;for(var o=0;o0?i:0)},this.direction==="rtl"&&(s.left*=-1),this.cursorOffsetCache=s,this.cursorOffsetCache},renderCursor:function(a,d){var u=this.get2DCursorLocation(),t=u.lineIndex,e=u.charIndex>0?u.charIndex-1:0,i=this.getValueOfPropertyAt(t,e,"fontSize"),s=this.scaleX*this.canvas.getZoom(),m=this.cursorWidth/s,o=a.topOffset,y=this.getValueOfPropertyAt(t,e,"deltaY");o+=(1-this._fontSizeFraction)*this.getHeightOfLine(t)/this.lineHeight-i*(1-this._fontSizeFraction),this.inCompositionMode&&this.renderSelection(a,d),d.fillStyle=this.cursorColor||this.getValueOfPropertyAt(t,e,"fill"),d.globalAlpha=this.__isMousedown?1:this._currentCursorOpacity,d.fillRect(a.left+a.leftOffset-m/2,o+a.top+y,m,i)},renderSelection:function(a,d){for(var u=this.inCompositionMode?this.hiddenTextarea.selectionStart:this.selectionStart,t=this.inCompositionMode?this.hiddenTextarea.selectionEnd:this.selectionEnd,e=this.textAlign.indexOf("justify")!==-1,i=this.get2DCursorLocation(u),s=this.get2DCursorLocation(t),m=i.lineIndex,o=s.lineIndex,y=i.charIndex<0?0:i.charIndex,C=s.charIndex<0?0:s.charIndex,b=m;b<=o;b++){var E=this._getLineLeftOffset(b)||0,O=this.getHeightOfLine(b),L=0,N=0,B=0;if(b===m&&(N=this.__charBounds[m][y].left),b>=m&&b1)&&(O/=this.lineHeight);var nt=a.left+E+N,it=B-N,Mt=O,K=0;this.inCompositionMode?(d.fillStyle=this.compositionColor||"black",Mt=1,K=O):d.fillStyle=this.selectionColor,this.direction==="rtl"&&(nt=this.width-nt-it),d.fillRect(nt,a.top+a.topOffset+K,it,Mt),a.topOffset+=L}},getCurrentCharFontSize:function(){var a=this._getCurrentCharIndex();return this.getValueOfPropertyAt(a.l,a.c,"fontSize")},getCurrentCharColor:function(){var a=this._getCurrentCharIndex();return this.getValueOfPropertyAt(a.l,a.c,"fill")},_getCurrentCharIndex:function(){var a=this.get2DCursorLocation(this.selectionStart,!0),d=a.charIndex>0?a.charIndex-1:0;return{l:a.lineIndex,c:d}}}),c.IText.fromObject=function(a,d){if(p(a),a.styles)for(var u in a.styles)for(var t in a.styles[u])p(a.styles[u][t]);c.Object._fromObject("IText",a,d,"text")}}(),function(){var p=c.util.object.clone;c.util.object.extend(c.IText.prototype,{initBehavior:function(){this.initAddedHandler(),this.initRemovedHandler(),this.initCursorSelectionHandlers(),this.initDoubleClickSimulation(),this.mouseMoveHandler=this.mouseMoveHandler.bind(this)},onDeselect:function(){this.isEditing&&this.exitEditing(),this.selected=!1},initAddedHandler:function(){var a=this;this.on("added",function(){var d=a.canvas;d&&(d._hasITextHandlers||(d._hasITextHandlers=!0,a._initCanvasHandlers(d)),d._iTextInstances=d._iTextInstances||[],d._iTextInstances.push(a))})},initRemovedHandler:function(){var a=this;this.on("removed",function(){var d=a.canvas;d&&(d._iTextInstances=d._iTextInstances||[],c.util.removeFromArray(d._iTextInstances,a),d._iTextInstances.length===0&&(d._hasITextHandlers=!1,a._removeCanvasHandlers(d)))})},_initCanvasHandlers:function(a){a._mouseUpITextHandler=function(){a._iTextInstances&&a._iTextInstances.forEach(function(d){d.__isMousedown=!1})},a.on("mouse:up",a._mouseUpITextHandler)},_removeCanvasHandlers:function(a){a.off("mouse:up",a._mouseUpITextHandler)},_tick:function(){this._currentTickState=this._animateCursor(this,1,this.cursorDuration,"_onTickComplete")},_animateCursor:function(a,d,u,t){var e;return e={isAborted:!1,abort:function(){this.isAborted=!0}},a.animate("_currentCursorOpacity",d,{duration:u,onComplete:function(){e.isAborted||a[t]()},onChange:function(){a.canvas&&a.selectionStart===a.selectionEnd&&a.renderCursorOrSelection()},abort:function(){return e.isAborted}}),e},_onTickComplete:function(){var a=this;this._cursorTimeout1&&clearTimeout(this._cursorTimeout1),this._cursorTimeout1=setTimeout(function(){a._currentTickCompleteState=a._animateCursor(a,0,this.cursorDuration/2,"_tick")},100)},initDelayedCursor:function(a){var d=this,u=a?0:this.cursorDelay;this.abortCursorAnimation(),this._currentCursorOpacity=1,this._cursorTimeout2=setTimeout(function(){d._tick()},u)},abortCursorAnimation:function(){var a=this._currentTickState||this._currentTickCompleteState,d=this.canvas;this._currentTickState&&this._currentTickState.abort(),this._currentTickCompleteState&&this._currentTickCompleteState.abort(),clearTimeout(this._cursorTimeout1),clearTimeout(this._cursorTimeout2),this._currentCursorOpacity=0,a&&d&&d.clearContext(d.contextTop||d.contextContainer)},selectAll:function(){return this.selectionStart=0,this.selectionEnd=this._text.length,this._fireSelectionChanged(),this._updateTextarea(),this},getSelectedText:function(){return this._text.slice(this.selectionStart,this.selectionEnd).join("")},findWordBoundaryLeft:function(a){var d=0,u=a-1;if(this._reSpace.test(this._text[u]))for(;this._reSpace.test(this._text[u]);)d++,u--;for(;/\S/.test(this._text[u])&&u>-1;)d++,u--;return a-d},findWordBoundaryRight:function(a){var d=0,u=a;if(this._reSpace.test(this._text[u]))for(;this._reSpace.test(this._text[u]);)d++,u++;for(;/\S/.test(this._text[u])&&u-1;)d++,u--;return a-d},findLineBoundaryRight:function(a){for(var d=0,u=a;!/\n/.test(this._text[u])&&u0&&tthis.__selectionStartOnMouseDown?(this.selectionStart=this.__selectionStartOnMouseDown,this.selectionEnd=d):(this.selectionStart=d,this.selectionEnd=this.__selectionStartOnMouseDown),(this.selectionStart!==u||this.selectionEnd!==t)&&(this.restartCursorIfNeeded(),this._fireSelectionChanged(),this._updateTextarea(),this.renderCursorOrSelection()))}},_setEditingProps:function(){this.hoverCursor="text",this.canvas&&(this.canvas.defaultCursor=this.canvas.moveCursor="text"),this.borderColor=this.editingBorderColor,this.hasControls=this.selectable=!1,this.lockMovementX=this.lockMovementY=!0},fromStringToGraphemeSelection:function(a,d,u){var t=u.slice(0,a),e=c.util.string.graphemeSplit(t).length;if(a===d)return{selectionStart:e,selectionEnd:e};var i=u.slice(a,d),s=c.util.string.graphemeSplit(i).length;return{selectionStart:e,selectionEnd:e+s}},fromGraphemeToStringSelection:function(a,d,u){var t=u.slice(0,a),e=t.join("").length;if(a===d)return{selectionStart:e,selectionEnd:e};var i=u.slice(a,d),s=i.join("").length;return{selectionStart:e,selectionEnd:e+s}},_updateTextarea:function(){if(this.cursorOffsetCache={},!!this.hiddenTextarea){if(!this.inCompositionMode){var a=this.fromGraphemeToStringSelection(this.selectionStart,this.selectionEnd,this._text);this.hiddenTextarea.selectionStart=a.selectionStart,this.hiddenTextarea.selectionEnd=a.selectionEnd}this.updateTextareaPosition()}},updateFromTextArea:function(){if(!!this.hiddenTextarea){this.cursorOffsetCache={},this.text=this.hiddenTextarea.value,this._shouldClearDimensionCache()&&(this.initDimensions(),this.setCoords());var a=this.fromStringToGraphemeSelection(this.hiddenTextarea.selectionStart,this.hiddenTextarea.selectionEnd,this.hiddenTextarea.value);this.selectionEnd=this.selectionStart=a.selectionEnd,this.inCompositionMode||(this.selectionStart=a.selectionStart),this.updateTextareaPosition()}},updateTextareaPosition:function(){if(this.selectionStart===this.selectionEnd){var a=this._calcTextareaPosition();this.hiddenTextarea.style.left=a.left,this.hiddenTextarea.style.top=a.top}},_calcTextareaPosition:function(){if(!this.canvas)return{x:1,y:1};var a=this.inCompositionMode?this.compositionStart:this.selectionStart,d=this._getCursorBoundaries(a),u=this.get2DCursorLocation(a),t=u.lineIndex,e=u.charIndex,i=this.getValueOfPropertyAt(t,e,"fontSize")*this.lineHeight,s=d.leftOffset,m=this.calcTransformMatrix(),o={x:d.left+s,y:d.top+d.topOffset+i},y=this.canvas.getRetinaScaling(),C=this.canvas.upperCanvasEl,b=C.width/y,E=C.height/y,O=b-i,L=E-i,N=C.clientWidth/b,B=C.clientHeight/E;return o=c.util.transformPoint(o,m),o=c.util.transformPoint(o,this.canvas.viewportTransform),o.x*=N,o.y*=B,o.x<0&&(o.x=0),o.x>O&&(o.x=O),o.y<0&&(o.y=0),o.y>L&&(o.y=L),o.x+=this.canvas._offset.left,o.y+=this.canvas._offset.top,{left:o.x+"px",top:o.y+"px",fontSize:i+"px",charHeight:i}},_saveEditingProps:function(){this._savedProps={hasControls:this.hasControls,borderColor:this.borderColor,lockMovementX:this.lockMovementX,lockMovementY:this.lockMovementY,hoverCursor:this.hoverCursor,selectable:this.selectable,defaultCursor:this.canvas&&this.canvas.defaultCursor,moveCursor:this.canvas&&this.canvas.moveCursor}},_restoreEditingProps:function(){!this._savedProps||(this.hoverCursor=this._savedProps.hoverCursor,this.hasControls=this._savedProps.hasControls,this.borderColor=this._savedProps.borderColor,this.selectable=this._savedProps.selectable,this.lockMovementX=this._savedProps.lockMovementX,this.lockMovementY=this._savedProps.lockMovementY,this.canvas&&(this.canvas.defaultCursor=this._savedProps.defaultCursor,this.canvas.moveCursor=this._savedProps.moveCursor))},exitEditing:function(){var a=this._textBeforeEdit!==this.text,d=this.hiddenTextarea;return this.selected=!1,this.isEditing=!1,this.selectionEnd=this.selectionStart,d&&(d.blur&&d.blur(),d.parentNode&&d.parentNode.removeChild(d)),this.hiddenTextarea=null,this.abortCursorAnimation(),this._restoreEditingProps(),this._currentCursorOpacity=0,this._shouldClearDimensionCache()&&(this.initDimensions(),this.setCoords()),this.fire("editing:exited"),a&&this.fire("modified"),this.canvas&&(this.canvas.off("mouse:move",this.mouseMoveHandler),this.canvas.fire("text:editing:exited",{target:this}),a&&this.canvas.fire("object:modified",{target:this})),this},_removeExtraneousStyles:function(){for(var a in this.styles)this._textLines[a]||delete this.styles[a]},removeStyleFromTo:function(a,d){var u=this.get2DCursorLocation(a,!0),t=this.get2DCursorLocation(d,!0),e=u.lineIndex,i=u.charIndex,s=t.lineIndex,m=t.charIndex,o,y;if(e!==s){if(this.styles[e])for(o=i;o=m&&(y[b-C]=y[E],delete y[E])}},shiftLineStyles:function(a,d){var u=p(this.styles);for(var t in this.styles){var e=parseInt(t,10);e>a&&(this.styles[e+d]=u[e],u[e-d]||delete this.styles[e])}},restartCursorIfNeeded:function(){(!this._currentTickState||this._currentTickState.isAborted||!this._currentTickCompleteState||this._currentTickCompleteState.isAborted)&&this.initDelayedCursor()},insertNewlineStyleObject:function(a,d,u,t){var e,i={},s=!1,m=this._unwrappedTextLines[a].length===d;u||(u=1),this.shiftLineStyles(a,u),this.styles[a]&&(e=this.styles[a][d===0?d:d-1]);for(var o in this.styles[a]){var y=parseInt(o,10);y>=d&&(s=!0,i[y-d]=this.styles[a][o],m&&d===0||delete this.styles[a][o])}var C=!1;for(s&&!m&&(this.styles[a+u]=i,C=!0),C&&u--;u>0;)t&&t[u-1]?this.styles[a+u]={0:p(t[u-1])}:e?this.styles[a+u]={0:p(e)}:delete this.styles[a+u],u--;this._forceClearCache=!0},insertCharStyleObject:function(a,d,u,t){this.styles||(this.styles={});var e=this.styles[a],i=e?p(e):{};u||(u=1);for(var s in i){var m=parseInt(s,10);m>=d&&(e[m+u]=i[m],i[m-u]||delete e[m])}if(this._forceClearCache=!0,t){for(;u--;)!Object.keys(t[u]).length||(this.styles[a]||(this.styles[a]={}),this.styles[a][d+u]=p(t[u]));return}if(!!e)for(var o=e[d?d-1:1];o&&u--;)this.styles[a][d+u]=p(o)},insertNewStyleBlock:function(a,d,u){for(var t=this.get2DCursorLocation(d,!0),e=[0],i=0,s=0;s0&&(this.insertCharStyleObject(t.lineIndex,t.charIndex,e[0],u),u=u&&u.slice(e[0]+1)),i&&this.insertNewlineStyleObject(t.lineIndex,t.charIndex+e[0],i);for(var s=1;s0?this.insertCharStyleObject(t.lineIndex+s,0,e[s],u):u&&(this.styles[t.lineIndex+s][0]=u[0]),u=u&&u.slice(e[s]+1);e[s]>0&&this.insertCharStyleObject(t.lineIndex+s,0,e[s],u)},setSelectionStartEndWithShift:function(a,d,u){u<=a?(d===a?this._selectionDirection="left":this._selectionDirection==="right"&&(this._selectionDirection="left",this.selectionEnd=a),this.selectionStart=u):u>a&&ua?this.selectionStart=a:this.selectionStart<0&&(this.selectionStart=0),this.selectionEnd>a?this.selectionEnd=a:this.selectionEnd<0&&(this.selectionEnd=0)}})}(),c.util.object.extend(c.IText.prototype,{initDoubleClickSimulation:function(){this.__lastClickTime=+new Date,this.__lastLastClickTime=+new Date,this.__lastPointer={},this.on("mousedown",this.onMouseDown)},onMouseDown:function(p){if(!!this.canvas){this.__newClickTime=+new Date;var a=p.pointer;this.isTripleClick(a)&&(this.fire("tripleclick",p),this._stopEvent(p.e)),this.__lastLastClickTime=this.__lastClickTime,this.__lastClickTime=this.__newClickTime,this.__lastPointer=a,this.__lastIsEditing=this.isEditing,this.__lastSelected=this.selected}},isTripleClick:function(p){return this.__newClickTime-this.__lastClickTime<500&&this.__lastClickTime-this.__lastLastClickTime<500&&this.__lastPointer.x===p.x&&this.__lastPointer.y===p.y},_stopEvent:function(p){p.preventDefault&&p.preventDefault(),p.stopPropagation&&p.stopPropagation()},initCursorSelectionHandlers:function(){this.initMousedownHandler(),this.initMouseupHandler(),this.initClicks()},doubleClickHandler:function(p){!this.isEditing||this.selectWord(this.getSelectionStartFromPointer(p.e))},tripleClickHandler:function(p){!this.isEditing||this.selectLine(this.getSelectionStartFromPointer(p.e))},initClicks:function(){this.on("mousedblclick",this.doubleClickHandler),this.on("tripleclick",this.tripleClickHandler)},_mouseDownHandler:function(p){!this.canvas||!this.editable||p.e.button&&p.e.button!==1||(this.__isMousedown=!0,this.selected&&(this.inCompositionMode=!1,this.setCursorByClick(p.e)),this.isEditing&&(this.__selectionStartOnMouseDown=this.selectionStart,this.selectionStart===this.selectionEnd&&this.abortCursorAnimation(),this.renderCursorOrSelection()))},_mouseDownHandlerBefore:function(p){!this.canvas||!this.editable||p.e.button&&p.e.button!==1||(this.selected=this===this.canvas._activeObject)},initMousedownHandler:function(){this.on("mousedown",this._mouseDownHandler),this.on("mousedown:before",this._mouseDownHandlerBefore)},initMouseupHandler:function(){this.on("mouseup",this.mouseUpHandler)},mouseUpHandler:function(p){if(this.__isMousedown=!1,!(!this.editable||this.group||p.transform&&p.transform.actionPerformed||p.e.button&&p.e.button!==1)){if(this.canvas){var a=this.canvas._activeObject;if(a&&a!==this)return}this.__lastSelected&&!this.__corner?(this.selected=!1,this.__lastSelected=!1,this.enterEditing(p.e),this.selectionStart===this.selectionEnd?this.initDelayedCursor(!0):this.renderCursorOrSelection()):this.selected=!0}},setCursorByClick:function(p){var a=this.getSelectionStartFromPointer(p),d=this.selectionStart,u=this.selectionEnd;p.shiftKey?this.setSelectionStartEndWithShift(d,u,a):(this.selectionStart=a,this.selectionEnd=a),this.isEditing&&(this._fireSelectionChanged(),this._updateTextarea())},getSelectionStartFromPointer:function(p){for(var a=this.getLocalPointer(p),d=0,u=0,t=0,e=0,i=0,s,m,o=0,y=this._textLines.length;o0&&(e+=this._textLines[o-1].length+this.missingNewlineOffset(o-1));s=this._getLineLeftOffset(i),u=s*this.scaleX,m=this._textLines[i],this.direction==="rtl"&&(a.x=this.width*this.scaleX-a.x+u);for(var C=0,b=m.length;Ce||i<0?0:1,m=u+s;return this.flipX&&(m=t-m),m>this._text.length&&(m=this._text.length),m}}),c.util.object.extend(c.IText.prototype,{initHiddenTextarea:function(){this.hiddenTextarea=c.document.createElement("textarea"),this.hiddenTextarea.setAttribute("autocapitalize","off"),this.hiddenTextarea.setAttribute("autocorrect","off"),this.hiddenTextarea.setAttribute("autocomplete","off"),this.hiddenTextarea.setAttribute("spellcheck","false"),this.hiddenTextarea.setAttribute("data-fabric-hiddentextarea",""),this.hiddenTextarea.setAttribute("wrap","off");var p=this._calcTextareaPosition();this.hiddenTextarea.style.cssText="position: absolute; top: "+p.top+"; left: "+p.left+"; z-index: -999; opacity: 0; width: 1px; height: 1px; font-size: 1px; padding\uFF70top: "+p.fontSize+";",this.hiddenTextareaContainer?this.hiddenTextareaContainer.appendChild(this.hiddenTextarea):c.document.body.appendChild(this.hiddenTextarea),c.util.addListener(this.hiddenTextarea,"keydown",this.onKeyDown.bind(this)),c.util.addListener(this.hiddenTextarea,"keyup",this.onKeyUp.bind(this)),c.util.addListener(this.hiddenTextarea,"input",this.onInput.bind(this)),c.util.addListener(this.hiddenTextarea,"copy",this.copy.bind(this)),c.util.addListener(this.hiddenTextarea,"cut",this.copy.bind(this)),c.util.addListener(this.hiddenTextarea,"paste",this.paste.bind(this)),c.util.addListener(this.hiddenTextarea,"compositionstart",this.onCompositionStart.bind(this)),c.util.addListener(this.hiddenTextarea,"compositionupdate",this.onCompositionUpdate.bind(this)),c.util.addListener(this.hiddenTextarea,"compositionend",this.onCompositionEnd.bind(this)),!this._clickHandlerInitialized&&this.canvas&&(c.util.addListener(this.canvas.upperCanvasEl,"click",this.onClick.bind(this)),this._clickHandlerInitialized=!0)},keysMap:{9:"exitEditing",27:"exitEditing",33:"moveCursorUp",34:"moveCursorDown",35:"moveCursorRight",36:"moveCursorLeft",37:"moveCursorLeft",38:"moveCursorUp",39:"moveCursorRight",40:"moveCursorDown"},keysMapRtl:{9:"exitEditing",27:"exitEditing",33:"moveCursorUp",34:"moveCursorDown",35:"moveCursorLeft",36:"moveCursorRight",37:"moveCursorRight",38:"moveCursorUp",39:"moveCursorLeft",40:"moveCursorDown"},ctrlKeysMapUp:{67:"copy",88:"cut"},ctrlKeysMapDown:{65:"selectAll"},onClick:function(){this.hiddenTextarea&&this.hiddenTextarea.focus()},onKeyDown:function(p){if(!!this.isEditing){var a=this.direction==="rtl"?this.keysMapRtl:this.keysMap;if(p.keyCode in a)this[a[p.keyCode]](p);else if(p.keyCode in this.ctrlKeysMapDown&&(p.ctrlKey||p.metaKey))this[this.ctrlKeysMapDown[p.keyCode]](p);else return;p.stopImmediatePropagation(),p.preventDefault(),p.keyCode>=33&&p.keyCode<=40?(this.inCompositionMode=!1,this.clearContextTop(),this.renderCursorOrSelection()):this.canvas&&this.canvas.requestRenderAll()}},onKeyUp:function(p){if(!this.isEditing||this._copyDone||this.inCompositionMode){this._copyDone=!1;return}if(p.keyCode in this.ctrlKeysMapUp&&(p.ctrlKey||p.metaKey))this[this.ctrlKeysMapUp[p.keyCode]](p);else return;p.stopImmediatePropagation(),p.preventDefault(),this.canvas&&this.canvas.requestRenderAll()},onInput:function(p){var a=this.fromPaste;if(this.fromPaste=!1,p&&p.stopPropagation(),!!this.isEditing){var d=this._splitTextIntoLines(this.hiddenTextarea.value).graphemeText,u=this._text.length,t=d.length,e,i,s=t-u,m=this.selectionStart,o=this.selectionEnd,y=m!==o,C,b,E;if(this.hiddenTextarea.value===""){this.styles={},this.updateFromTextArea(),this.fire("changed"),this.canvas&&(this.canvas.fire("text:changed",{target:this}),this.canvas.requestRenderAll());return}var O=this.fromStringToGraphemeSelection(this.hiddenTextarea.selectionStart,this.hiddenTextarea.selectionEnd,this.hiddenTextarea.value),L=m>O.selectionStart;y?(e=this._text.slice(m,o),s+=o-m):t0&&(u=this.__charBounds[p][a-1],d+=u.left+u.width),d},getDownCursorOffset:function(p,a){var d=this._getSelectionForOffset(p,a),u=this.get2DCursorLocation(d),t=u.lineIndex;if(t===this._textLines.length-1||p.metaKey||p.keyCode===34)return this._text.length-d;var e=u.charIndex,i=this._getWidthBeforeCursor(t,e),s=this._getIndexOnLine(t+1,i),m=this._textLines[t].slice(e);return m.length+s+1+this.missingNewlineOffset(t)},_getSelectionForOffset:function(p,a){return p.shiftKey&&this.selectionStart!==this.selectionEnd&&a?this.selectionEnd:this.selectionStart},getUpCursorOffset:function(p,a){var d=this._getSelectionForOffset(p,a),u=this.get2DCursorLocation(d),t=u.lineIndex;if(t===0||p.metaKey||p.keyCode===33)return-d;var e=u.charIndex,i=this._getWidthBeforeCursor(t,e),s=this._getIndexOnLine(t-1,i),m=this._textLines[t].slice(0,e),o=this.missingNewlineOffset(t-1);return-this._textLines[t-1].length+s-m.length+(1-o)},_getIndexOnLine:function(p,a){for(var d=this._textLines[p],u=this._getLineLeftOffset(p),t=u,e=0,i,s,m=0,o=d.length;ma){s=!0;var y=t-i,C=t,b=Math.abs(y-a),E=Math.abs(C-a);e=E=this._text.length&&this.selectionEnd>=this._text.length||this._moveCursorUpOrDown("Down",p)},moveCursorUp:function(p){this.selectionStart===0&&this.selectionEnd===0||this._moveCursorUpOrDown("Up",p)},_moveCursorUpOrDown:function(p,a){var d="get"+p+"CursorOffset",u=this[d](a,this._selectionDirection==="right");a.shiftKey?this.moveCursorWithShift(u):this.moveCursorWithoutShift(u),u!==0&&(this.setSelectionInBoundaries(),this.abortCursorAnimation(),this._currentCursorOpacity=1,this.initDelayedCursor(),this._fireSelectionChanged(),this._updateTextarea())},moveCursorWithShift:function(p){var a=this._selectionDirection==="left"?this.selectionStart+p:this.selectionEnd+p;return this.setSelectionStartEndWithShift(this.selectionStart,this.selectionEnd,a),p!==0},moveCursorWithoutShift:function(p){return p<0?(this.selectionStart+=p,this.selectionEnd=this.selectionStart):(this.selectionEnd+=p,this.selectionStart=this.selectionEnd),p!==0},moveCursorLeft:function(p){this.selectionStart===0&&this.selectionEnd===0||this._moveCursorLeftOrRight("Left",p)},_move:function(p,a,d){var u;if(p.altKey)u=this["findWordBoundary"+d](this[a]);else if(p.metaKey||p.keyCode===35||p.keyCode===36)u=this["findLineBoundary"+d](this[a]);else return this[a]+=d==="Left"?-1:1,!0;if(typeof u!==void 0&&this[a]!==u)return this[a]=u,!0},_moveLeft:function(p,a){return this._move(p,a,"Left")},_moveRight:function(p,a){return this._move(p,a,"Right")},moveCursorLeftWithoutShift:function(p){var a=!0;return this._selectionDirection="left",this.selectionEnd===this.selectionStart&&this.selectionStart!==0&&(a=this._moveLeft(p,"selectionStart")),this.selectionEnd=this.selectionStart,a},moveCursorLeftWithShift:function(p){if(this._selectionDirection==="right"&&this.selectionStart!==this.selectionEnd)return this._moveLeft(p,"selectionEnd");if(this.selectionStart!==0)return this._selectionDirection="left",this._moveLeft(p,"selectionStart")},moveCursorRight:function(p){this.selectionStart>=this._text.length&&this.selectionEnd>=this._text.length||this._moveCursorLeftOrRight("Right",p)},_moveCursorLeftOrRight:function(p,a){var d="moveCursor"+p+"With";this._currentCursorOpacity=1,a.shiftKey?d+="Shift":d+="outShift",this[d](a)&&(this.abortCursorAnimation(),this.initDelayedCursor(),this._fireSelectionChanged(),this._updateTextarea())},moveCursorRightWithShift:function(p){if(this._selectionDirection==="left"&&this.selectionStart!==this.selectionEnd)return this._moveRight(p,"selectionStart");if(this.selectionEnd!==this._text.length)return this._selectionDirection="right",this._moveRight(p,"selectionEnd")},moveCursorRightWithoutShift:function(p){var a=!0;return this._selectionDirection="right",this.selectionStart===this.selectionEnd?(a=this._moveRight(p,"selectionStart"),this.selectionEnd=this.selectionStart):this.selectionStart=this.selectionEnd,a},removeChars:function(p,a){typeof a=="undefined"&&(a=p+1),this.removeStyleFromTo(p,a),this._text.splice(p,a-p),this.text=this._text.join(""),this.set("dirty",!0),this._shouldClearDimensionCache()&&(this.initDimensions(),this.setCoords()),this._removeExtraneousStyles()},insertChars:function(p,a,d,u){typeof u=="undefined"&&(u=d),u>d&&this.removeStyleFromTo(d,u);var t=c.util.string.graphemeSplit(p);this.insertNewStyleBlock(t,d,a),this._text=[].concat(this._text.slice(0,d),t,this._text.slice(u)),this.text=this._text.join(""),this.set("dirty",!0),this._shouldClearDimensionCache()&&(this.initDimensions(),this.setCoords()),this._removeExtraneousStyles()}}),function(){var p=c.util.toFixed,a=/ +/g;c.util.object.extend(c.Text.prototype,{_toSVG:function(){var d=this._getSVGLeftTopOffsets(),u=this._getSVGTextAndBg(d.textTop,d.textLeft);return this._wrapSVGTextAndBg(u)},toSVG:function(d){return this._createBaseSVGMarkup(this._toSVG(),{reviver:d,noStyle:!0,withShadow:!0})},_getSVGLeftTopOffsets:function(){return{textLeft:-this.width/2,textTop:-this.height/2,lineTop:this.getHeightOfLine(0)}},_wrapSVGTextAndBg:function(d){var u=!0,t=this.getSvgTextDecoration(this);return[d.textBgRects.join(""),' ",d.textSpans.join(""),` `]},_getSVGTextAndBg:function(d,u){var t=[],e=[],i=d,s;this._setSVGBg(e);for(var m=0,o=this._textLines.length;m",c.util.string.escapeXml(d),""].join("")},_setSVGTextLineText:function(d,u,t,e){var i=this.getHeightOfLine(u),s=this.textAlign.indexOf("justify")!==-1,m,o,y="",C,b,E=0,O=this._textLines[u],L;e+=i*(1-this._fontSizeFraction)/this.lineHeight;for(var N=0,B=O.length-1;N<=B;N++)L=N===B||this.charSpacing,y+=O[N],C=this.__charBounds[u][N],E===0?(t+=C.kernedWidth-C.width,E+=C.width):E+=C.kernedWidth,s&&!L&&this._reSpaceAndTab.test(O[N])&&(L=!0),L||(m=m||this.getCompleteStyleDeclaration(u,N),o=this.getCompleteStyleDeclaration(u,N+1),L=this._hasStyleChangedForSvg(m,o)),L&&(b=this._getStyleDeclaration(u,N)||{},d.push(this._createTextCharSpan(y,b,t,e)),y="",m=o,t+=E,E=0)},_pushTextBgRect:function(d,u,t,e,i,s){var m=c.Object.NUM_FRACTION_DIGITS;d.push(" `)},_setSVGTextLineBg:function(d,u,t,e){for(var i=this._textLines[u],s=this.getHeightOfLine(u)/this.lineHeight,m=0,o=0,y,C,b=this.getValueOfPropertyAt(u,0,"textBackgroundColor"),E=0,O=i.length;Ethis.width&&this._set("width",this.dynamicMinWidth),this.textAlign.indexOf("justify")!==-1&&this.enlargeSpaces(),this.height=this.calcTextHeight(),this.saveState({propertySet:"_dimensionAffectingProps"}))},_generateStyleMap:function(d){for(var u=0,t=0,e=0,i={},s=0;s0?(t=0,e++,u++):!this.splitByGrapheme&&this._reSpaceAndTab.test(d.graphemeText[e])&&s>0&&(t++,e++),i[s]={line:u,offset:t},e+=d.graphemeLines[s].length,t+=d.graphemeLines[s].length;return i},styleHas:function(d,u){if(this._styleMap&&!this.isWrapping){var t=this._styleMap[u];t&&(u=t.line)}return a.Text.prototype.styleHas.call(this,d,u)},isEmptyStyles:function(d){if(!this.styles)return!0;var u=0,t=d+1,e,i,s=!1,m=this._styleMap[d],o=this._styleMap[d+1];m&&(d=m.line,u=m.offset),o&&(t=o.line,s=t===d,e=o.offset),i=typeof d=="undefined"?this.styles:{line:this.styles[d]};for(var y in i)for(var C in i[y])if(C>=u&&(!s||Ct&&!B?(m.push(o),o=[],i=O,B=!0):i+=Y,!B&&!s&&o.push(E),o=o.concat(C),L=s?0:this._measureWord([E],u,b),b++,B=!1,O>N&&(N=O);return nt&&m.push(o),N+e>this.dynamicMinWidth&&(this.dynamicMinWidth=N-Y+e),m},isEndOfWrapping:function(d){return!this._styleMap[d+1]||this._styleMap[d+1].line!==this._styleMap[d].line},missingNewlineOffset:function(d){return this.splitByGrapheme?this.isEndOfWrapping(d)?1:0:1},_splitTextIntoLines:function(d){for(var u=a.Text.prototype._splitTextIntoLines.call(this,d),t=this._wrapText(u.lines,this.width),e=new Array(t.length),i=0;i=0&&j-1?t[e][1]+=1:t.push([u,1]))},d.prototype._forgetContext=function(u){var t,e;!I(u)||(t=this._safeContext(),e=this._indexOfContext(u),e>-1&&(t[e][1]-=1,t[e][1]<=0&&t.splice(e,1)))},d.prototype._bindEvent=function(u,t,e){var i=this._safeEvent(u);this._memorizeContext(e),i.push(this._getHandlerItem(t,e))},d.prototype.on=function(u,t,e){var i=this;M(u)?(u=u.split(a),p(u,function(s){i._bindEvent(s,t,e)})):D(u)&&(e=t,p(u,function(s,m){i.on(m,s,e)}))},d.prototype.once=function(u,t,e){var i=this;if(D(u)){e=t,p(u,function(m,o){i.once(o,m,e)});return}function s(){t.apply(e,arguments),i.off(u,s,e)}this.on(u,s,e)},d.prototype._spliceMatches=function(u,t){var e=0,i;if(!!P(u))for(i=u.length;e0},d.prototype.getListenerLength=function(u){var t=this._safeEvent(u);return t.length},g.exports=d},961:function(g){"use strict";function x(f,c){var I=Object.prototype.hasOwnProperty,M,D,P,j;for(P=1,j=arguments.length;PM}function P(j,p){var a="https://www.google-analytics.com/collect",d=location.hostname,u="event",t="use",e="TOAST UI "+j+" for "+d+": Statistics",i=window.localStorage.getItem(e);!c(window.tui)&&window.tui.usageStatistics===!1||i&&!D(i)||(window.localStorage.setItem(e,new Date().getTime()),setTimeout(function(){(document.readyState==="interactive"||document.readyState==="complete")&&I(a,{v:1,t:u,tid:p,cid:d,dp:d,dh:j,el:j,ec:t})},1e3))}g.exports=P},602:function(g){"use strict";function x(f){return f instanceof Array}g.exports=x},9886:function(g,x,f){"use strict";var c=f(5695),I=f(3778);function M(D){return!c(D)&&!I(D)}g.exports=M},5183:function(g){"use strict";function x(f){return f instanceof Function}g.exports=x},3778:function(g){"use strict";function x(f){return f===null}g.exports=x},5393:function(g){"use strict";function x(f){return f===Object(f)}g.exports=x},2560:function(g){"use strict";function x(f){return typeof f=="string"||f instanceof String}g.exports=x},5695:function(g){"use strict";function x(f){return f===void 0}g.exports=x},4426:function(g,x,f){g.exports=f(4486)},9406:function(g,x,f){g.exports=f(4877)},789:function(g,x,f){g.exports=f(7178)},381:function(g,x,f){g.exports=f(5603)},7636:function(g,x,f){g.exports=f(1206)},1899:function(g,x,f){g.exports=f(6174)},899:function(g,x,f){g.exports=f(57)},8005:function(g,x,f){g.exports=f(4741)},6562:function(g,x,f){g.exports=f(8368)},9131:function(g,x,f){g.exports=f(3739)},4383:function(g,x,f){g.exports=f(172)},6065:function(g,x,f){g.exports=f(4963)},1734:function(g,x,f){g.exports=f(7820)},2461:function(g,x,f){g.exports=f(5636)},5214:function(g,x,f){g.exports=f(5059)},6397:function(g,x,f){g.exports=f(3969)},8189:function(g,x,f){g.exports=f(6618)},9146:function(g,x,f){g.exports=f(5279)},4496:function(g,x,f){g.exports=f(9562)},3972:function(g,x,f){g.exports=f(652)},7172:function(g,x,f){g.exports=f(2813)},1845:function(g,x,f){g.exports=f(8664)},662:function(g,x,f){g.exports=f(1457)},711:function(g,x,f){g.exports=f(2937)},6623:function(g,x,f){g.exports=f(9297)},7077:function(g,x,f){g.exports=f(8026)},9856:function(g,x,f){g.exports=f(2044)},4230:function(g,x,f){g.exports=f(2214)},184:function(g,x,f){g.exports=f(9256)},3742:function(g,x,f){g.exports=f(5659)},1801:function(g){var x={rect:1,circle:2,triangle:1},f={rect:{w:"width",h:"height"},circle:{w:"rx",h:"ry"},triangle:{w:"width",h:"height"}};function c(a){var d=a.originX,u=a.originY,t=d.substring(0,1)+u.substring(0,1);a.startPoint=a.origins[t]}function I(a,d,u){var t=a.x,e=a.y,i=d.x,s=d.y,m=u*Math.PI/180,o=(i-t)*Math.cos(m)-(s-e)*Math.sin(m)+t,y=(i-t)*Math.sin(m)+(s-e)*Math.cos(m)+e;return{originX:t>o?"right":"left",originY:e>y?"bottom":"top"}}function M(a){return a.originX==="center"&&a.originY==="center"}function D(a,d){var u=d.getPointByOrigin("center","center"),t=-d.angle,e=I(u,a,t),i=e.originX,s=e.originY,m=d.getPointByOrigin(i,s),o=d.left-(u.x-m.x),y=d.top-(u.y-m.y);d.set({originX:i,originY:s,left:o,top:y}),d.setCoords()}function P(a,d){var u=d.startPoint,t=-d.angle,e=I(u,a,t),i=e.originX,s=e.originY;d.setPositionByOrigin(u,i,s),d.setCoords()}function j(a){var d=a.type,u=a.scaleX,t=a.scaleY,e=f[d],i=a[e.w]*u,s=a[e.h]*t;if(a.isRegular){var m=Math.max(u,t);i=a[e.w]*m,s=a[e.h]*m}var o={hasControls:!1,hasBorders:!1,scaleX:1,scaleY:1};o[e.w]=i,o[e.h]=s,a.set(o)}function p(a,d){var u=d.type,t=d.strokeWidth,e=d.startPoint,i=x[u],s=f[u],m=d.type==="triangle",o={},y=Math.abs(e.x-a.x)/i,C=Math.abs(e.y-a.y)/i;y>t&&(y-=t/i),C>t&&(C-=t/i),d.isRegular&&(y=C=Math.max(y,C),m&&(C=Math.sqrt(3)/2*y)),o[s.w]=y,o[s.h]=C,d.set(o)}g.exports={setOrigins:function(d){var u=d.getPointByOrigin("left","top"),t=d.getPointByOrigin("right","top"),e=d.getPointByOrigin("right","bottom"),i=d.getPointByOrigin("left","bottom");d.origins={lt:u,rt:t,rb:e,lb:i}},resize:function(d,u,t){M(d)&&(D(u,d),c(d)),t?j(d,u):p(u,d),P(u,d)},adjustOriginToCenter:function(d){var u=d.getPointByOrigin("center","center"),t=d.originX,e=d.originY,i=d.getPointByOrigin(t,e),s=d.left+(u.x-i.x),m=d.top+(u.y-i.y);d.set({hasControls:!0,hasBorders:!0,originX:"center",originY:"center",left:s,top:m}),d.setCoords()}}},2221:function(g,x,f){f(5454),f(9173);var c=f(7545);g.exports=c.Array.from},5078:function(g,x,f){f(8118);var c=f(7545);g.exports=c.Array.isArray},6135:function(g,x,f){f(9106);var c=f(5607);g.exports=c("Array").concat},9510:function(g,x,f){f(1710);var c=f(5607);g.exports=c("Array").fill},3971:function(g,x,f){f(3436);var c=f(5607);g.exports=c("Array").filter},98:function(g,x,f){f(9823);var c=f(5607);g.exports=c("Array").forEach},2089:function(g,x,f){f(2276);var c=f(5607);g.exports=c("Array").indexOf},6209:function(g,x,f){f(3838);var c=f(5607);g.exports=c("Array").map},2671:function(g,x,f){f(5818);var c=f(5607);g.exports=c("Array").slice},1375:function(g,x,f){f(2178);var c=f(5607);g.exports=c("Array").splice},3528:function(g,x,f){f(665);var c=f(5607);g.exports=c("Function").bind},5739:function(g,x,f){f(8939),f(5454);var c=f(8703);g.exports=c},278:function(g,x,f){var c=f(3528),I=Function.prototype;g.exports=function(M){var D=M.bind;return M===I||M instanceof Function&&D===I.bind?c:D}},1484:function(g,x,f){var c=f(6135),I=Array.prototype;g.exports=function(M){var D=M.concat;return M===I||M instanceof Array&&D===I.concat?c:D}},7731:function(g,x,f){var c=f(9510),I=Array.prototype;g.exports=function(M){var D=M.fill;return M===I||M instanceof Array&&D===I.fill?c:D}},3669:function(g,x,f){var c=f(3971),I=Array.prototype;g.exports=function(M){var D=M.filter;return M===I||M instanceof Array&&D===I.filter?c:D}},2604:function(g,x,f){var c=f(2089),I=Array.prototype;g.exports=function(M){var D=M.indexOf;return M===I||M instanceof Array&&D===I.indexOf?c:D}},263:function(g,x,f){var c=f(6209),I=Array.prototype;g.exports=function(M){var D=M.map;return M===I||M instanceof Array&&D===I.map?c:D}},7663:function(g,x,f){var c=f(2671),I=Array.prototype;g.exports=function(M){var D=M.slice;return M===I||M instanceof Array&&D===I.slice?c:D}},5063:function(g,x,f){var c=f(1375),I=Array.prototype;g.exports=function(M){var D=M.splice;return M===I||M instanceof Array&&D===I.splice?c:D}},6813:function(g,x,f){var c=f(3842),I=String.prototype;g.exports=function(M){var D=M.trim;return typeof M=="string"||M===I||M instanceof String&&D===I.trim?c:D}},6285:function(g,x,f){f(2666);var c=f(7545);g.exports=c.Number.parseInt},3213:function(g,x,f){f(3113);var c=f(7545),I=c.Object;g.exports=function(D,P){return I.create(D,P)}},3512:function(g,x,f){f(297);var c=f(7545),I=c.Object,M=g.exports=function(P,j,p){return I.defineProperty(P,j,p)};I.defineProperty.sham&&(M.sham=!0)},8168:function(g,x,f){f(9234);var c=f(7545);g.exports=c.Object.getPrototypeOf},8651:function(g,x,f){f(2647);var c=f(7545);g.exports=c.Object.keys},3083:function(g,x,f){f(3222);var c=f(7545);g.exports=c.Object.setPrototypeOf},2987:function(g,x,f){f(4859);var c=f(7545);g.exports=c.parseFloat},2239:function(g,x,f){f(5706);var c=f(7545);g.exports=c.parseInt},3154:function(g,x,f){f(4242),f(8939),f(6663),f(9021),f(7884),f(8885),f(1868),f(5454);var c=f(7545);g.exports=c.Promise},6577:function(g,x,f){f(5397);var c=f(7545);g.exports=c.Reflect.construct},3842:function(g,x,f){f(957);var c=f(5607);g.exports=c("String").trim},5008:function(g,x,f){f(9106),f(6663),f(6187),f(9781),f(492),f(6681),f(9594),f(3665),f(9017),f(1250),f(9786),f(503),f(6565),f(9322),f(3610),f(6886),f(3514),f(8671),f(8556),f(1367);var c=f(7545);g.exports=c.Symbol},994:function(g,x,f){f(8939),f(6663),f(5454),f(3665);var c=f(9207);g.exports=c.f("iterator")},2813:function(g,x,f){var c=f(3822);g.exports=c},8664:function(g,x,f){var c=f(1434);g.exports=c},1457:function(g,x,f){var c=f(7710);g.exports=c},2937:function(g,x,f){var c=f(4741);g.exports=c},9297:function(g,x,f){var c=f(4963);g.exports=c},8026:function(g,x,f){var c=f(7820);g.exports=c},2044:function(g,x,f){var c=f(8980);g.exports=c},2214:function(g,x,f){var c=f(6672);g.exports=c},9256:function(g,x,f){var c=f(2285);f(177),f(9031),f(6658),f(1875),f(8658),f(4592),f(6680),g.exports=c},5659:function(g,x,f){var c=f(8535);g.exports=c},6235:function(g,x,f){var c=f(6447),I=f(9288);g.exports=function(M){if(c(M))return M;throw TypeError(I(M)+" is not a function")}},1404:function(g,x,f){var c=f(2091),I=f(9288);g.exports=function(M){if(c(M))return M;throw TypeError(I(M)+" is not a constructor")}},7757:function(g,x,f){var c=f(6447);g.exports=function(I){if(typeof I=="object"||c(I))return I;throw TypeError("Can't set "+String(I)+" as a prototype")}},7423:function(g){g.exports=function(){}},6961:function(g){g.exports=function(x,f,c){if(x instanceof f)return x;throw TypeError("Incorrect "+(c?c+" ":"")+"invocation")}},1138:function(g,x,f){var c=f(5744);g.exports=function(I){if(c(I))return I;throw TypeError(String(I)+" is not an object")}},2724:function(g,x,f){"use strict";var c=f(1795),I=f(7739),M=f(4104);g.exports=function(P){for(var j=c(this),p=M(j),a=arguments.length,d=I(a>1?arguments[1]:void 0,p),u=a>2?arguments[2]:void 0,t=u===void 0?p:I(u,p);t>d;)j[d++]=P;return j}},7397:function(g,x,f){"use strict";var c=f(454).forEach,I=f(424),M=I("forEach");g.exports=M?[].forEach:function(P){return c(this,P,arguments.length>1?arguments[1]:void 0)}},841:function(g,x,f){"use strict";var c=f(8043),I=f(1795),M=f(1635),D=f(6109),P=f(2091),j=f(4104),p=f(9361),a=f(1669),d=f(8703);g.exports=function(t){var e=I(t),i=P(this),s=arguments.length,m=s>1?arguments[1]:void 0,o=m!==void 0;o&&(m=c(m,s>2?arguments[2]:void 0,2));var y=d(e),C=0,b,E,O,L,N,B;if(y&&!(this==Array&&D(y)))for(L=a(e,y),N=L.next,E=i?new this:[];!(O=N.call(L)).done;C++)B=o?M(L,m,[O.value,C],!0):O.value,p(E,C,B);else for(b=j(e),E=i?new this(b):Array(b);b>C;C++)B=o?m(e[C],C):e[C],p(E,C,B);return E.length=C,E}},8180:function(g,x,f){var c=f(101),I=f(7739),M=f(4104),D=function(P){return function(j,p,a){var d=c(j),u=M(d),t=I(a,u),e;if(P&&p!=p){for(;u>t;)if(e=d[t++],e!=e)return!0}else for(;u>t;t++)if((P||t in d)&&d[t]===p)return P||t||0;return!P&&-1}};g.exports={includes:D(!0),indexOf:D(!1)}},454:function(g,x,f){var c=f(8043),I=f(2202),M=f(1795),D=f(4104),P=f(1321),j=[].push,p=function(a){var d=a==1,u=a==2,t=a==3,e=a==4,i=a==6,s=a==7,m=a==5||i;return function(o,y,C,b){for(var E=M(o),O=I(E),L=c(y,C,3),N=D(O),B=0,Y=b||P,nt=d?Y(o,N):u||s?Y(o,0):void 0,it,Mt;N>B;B++)if((m||B in O)&&(it=O[B],Mt=L(it,B,E),a))if(d)nt[B]=Mt;else if(Mt)switch(a){case 3:return!0;case 5:return it;case 6:return B;case 2:j.call(nt,it)}else switch(a){case 4:return!1;case 7:j.call(nt,it)}return i?-1:t||e?e:nt}};g.exports={forEach:p(0),map:p(1),filter:p(2),some:p(3),every:p(4),find:p(5),findIndex:p(6),filterReject:p(7)}},242:function(g,x,f){var c=f(6192),I=f(8182),M=f(4218),D=I("species");g.exports=function(P){return M>=51||!c(function(){var j=[],p=j.constructor={};return p[D]=function(){return{foo:1}},j[P](Boolean).foo!==1})}},424:function(g,x,f){"use strict";var c=f(6192);g.exports=function(I,M){var D=[][I];return!!D&&c(function(){D.call(null,M||function(){throw 1},1)})}},3712:function(g,x,f){var c=f(4770),I=f(2091),M=f(5744),D=f(8182),P=D("species");g.exports=function(j){var p;return c(j)&&(p=j.constructor,I(p)&&(p===Array||c(p.prototype))?p=void 0:M(p)&&(p=p[P],p===null&&(p=void 0))),p===void 0?Array:p}},1321:function(g,x,f){var c=f(3712);g.exports=function(I,M){return new(c(I))(M===0?0:M)}},1635:function(g,x,f){var c=f(1138),I=f(6639);g.exports=function(M,D,P,j){try{return j?D(c(P)[0],P[1]):D(P)}catch(p){I(M,"throw",p)}}},9770:function(g,x,f){var c=f(8182),I=c("iterator"),M=!1;try{var D=0,P={next:function(){return{done:!!D++}},return:function(){M=!0}};P[I]=function(){return this},Array.from(P,function(){throw 2})}catch(j){}g.exports=function(j,p){if(!p&&!M)return!1;var a=!1;try{var d={};d[I]=function(){return{next:function(){return{done:a=!0}}}},j(d)}catch(u){}return a}},9272:function(g){var x={}.toString;g.exports=function(f){return x.call(f).slice(8,-1)}},4696:function(g,x,f){var c=f(3471),I=f(6447),M=f(9272),D=f(8182),P=D("toStringTag"),j=M(function(){return arguments}())=="Arguments",p=function(a,d){try{return a[d]}catch(u){}};g.exports=c?M:function(a){var d,u,t;return a===void 0?"Undefined":a===null?"Null":typeof(u=p(d=Object(a),P))=="string"?u:j?M(d):(t=M(d))=="Object"&&I(d.callee)?"Arguments":t}},4635:function(g,x,f){var c=f(6192);g.exports=!c(function(){function I(){}return I.prototype.constructor=null,Object.getPrototypeOf(new I)!==I.prototype})},5148:function(g,x,f){"use strict";var c=f(4413).IteratorPrototype,I=f(2853),M=f(774),D=f(1284),P=f(7771),j=function(){return this};g.exports=function(p,a,d){var u=a+" Iterator";return p.prototype=I(c,{next:M(1,d)}),D(p,u,!1,!0),P[u]=j,p}},8711:function(g,x,f){var c=f(69),I=f(2760),M=f(774);g.exports=c?function(D,P,j){return I.f(D,P,M(1,j))}:function(D,P,j){return D[P]=j,D}},774:function(g){g.exports=function(x,f){return{enumerable:!(x&1),configurable:!(x&2),writable:!(x&4),value:f}}},9361:function(g,x,f){"use strict";var c=f(77),I=f(2760),M=f(774);g.exports=function(D,P,j){var p=c(P);p in D?I.f(D,p,M(0,j)):D[p]=j}},7218:function(g,x,f){"use strict";var c=f(3085),I=f(5546),M=f(2282),D=f(6447),P=f(5148),j=f(9341),p=f(4469),a=f(1284),d=f(8711),u=f(9482),t=f(8182),e=f(7771),i=f(4413),s=M.PROPER,m=M.CONFIGURABLE,o=i.IteratorPrototype,y=i.BUGGY_SAFARI_ITERATORS,C=t("iterator"),b="keys",E="values",O="entries",L=function(){return this};g.exports=function(N,B,Y,nt,it,Mt,K){P(Y,B,nt);var It=function(F){if(F===it&&V)return V;if(!y&&F in dt)return dt[F];switch(F){case b:return function(){return new Y(this,F)};case E:return function(){return new Y(this,F)};case O:return function(){return new Y(this,F)}}return function(){return new Y(this)}},U=B+" Iterator",Lt=!1,dt=N.prototype,Nt=dt[C]||dt["@@iterator"]||it&&dt[it],V=!y&&Nt||It(it),q=B=="Array"&&dt.entries||Nt,Q,G,rt;if(q&&(Q=j(q.call(new N)),Q!==Object.prototype&&Q.next&&(!I&&j(Q)!==o&&(p?p(Q,o):D(Q[C])||u(Q,C,L)),a(Q,U,!0,!0),I&&(e[U]=L))),s&&it==E&&Nt&&Nt.name!==E&&(!I&&m?d(dt,"name",E):(Lt=!0,V=function(){return Nt.call(this)})),it)if(G={values:It(E),keys:Mt?V:It(b),entries:It(O)},K)for(rt in G)(y||Lt||!(rt in dt))&&u(dt,rt,G[rt]);else c({target:B,proto:!0,forced:y||Lt},G);return(!I||K)&&dt[C]!==V&&u(dt,C,V,{name:it}),e[B]=V,G}},1488:function(g,x,f){var c=f(7545),I=f(4500),M=f(9207),D=f(2760).f;g.exports=function(P){var j=c.Symbol||(c.Symbol={});I(j,P)||D(j,P,{value:M.f(P)})}},69:function(g,x,f){var c=f(6192);g.exports=!c(function(){return Object.defineProperty({},1,{get:function(){return 7}})[1]!=7})},7449:function(g,x,f){var c=f(8576),I=f(5744),M=c.document,D=I(M)&&I(M.createElement);g.exports=function(P){return D?M.createElement(P):{}}},7365:function(g){g.exports={CSSRuleList:0,CSSStyleDeclaration:0,CSSValueList:0,ClientRectList:0,DOMRectList:0,DOMStringList:0,DOMTokenList:1,DataTransferItemList:0,FileList:0,HTMLAllCollection:0,HTMLCollection:0,HTMLFormElement:0,HTMLSelectElement:0,MediaList:0,MimeTypeArray:0,NamedNodeMap:0,NodeList:1,PaintRequestList:0,Plugin:0,PluginArray:0,SVGLengthList:0,SVGNumberList:0,SVGPathSegList:0,SVGPointList:0,SVGStringList:0,SVGTransformList:0,SourceBufferList:0,StyleSheetList:0,TextTrackCueList:0,TextTrackList:0,TouchList:0}},2957:function(g){g.exports=typeof window=="object"},9347:function(g,x,f){var c=f(8989),I=f(8576);g.exports=/ipad|iphone|ipod/i.test(c)&&I.Pebble!==void 0},9536:function(g,x,f){var c=f(8989);g.exports=/(?:ipad|iphone|ipod).*applewebkit/i.test(c)},224:function(g,x,f){var c=f(9272),I=f(8576);g.exports=c(I.process)=="process"},5914:function(g,x,f){var c=f(8989);g.exports=/web0s(?!.*chrome)/i.test(c)},8989:function(g,x,f){var c=f(150);g.exports=c("navigator","userAgent")||""},4218:function(g,x,f){var c=f(8576),I=f(8989),M=c.process,D=c.Deno,P=M&&M.versions||D&&D.version,j=P&&P.v8,p,a;j?(p=j.split("."),a=p[0]<4?1:p[0]+p[1]):I&&(p=I.match(/Edge\/(\d+)/),(!p||p[1]>=74)&&(p=I.match(/Chrome\/(\d+)/),p&&(a=p[1]))),g.exports=a&&+a},5607:function(g,x,f){var c=f(7545);g.exports=function(I){return c[I+"Prototype"]}},2952:function(g){g.exports=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"]},3085:function(g,x,f){"use strict";var c=f(8576),I=f(6447),M=f(5141).f,D=f(9245),P=f(7545),j=f(8043),p=f(8711),a=f(4500),d=function(u){var t=function(e,i,s){if(this instanceof u){switch(arguments.length){case 0:return new u;case 1:return new u(e);case 2:return new u(e,i)}return new u(e,i,s)}return u.apply(this,arguments)};return t.prototype=u.prototype,t};g.exports=function(u,t){var e=u.target,i=u.global,s=u.stat,m=u.proto,o=i?c:s?c[e]:(c[e]||{}).prototype,y=i?P:P[e]||p(P,e,{})[e],C=y.prototype,b,E,O,L,N,B,Y,nt,it;for(L in t)b=D(i?L:e+(s?".":"#")+L,u.forced),E=!b&&o&&a(o,L),B=y[L],E&&(u.noTargetGet?(it=M(o,L),Y=it&&it.value):Y=o[L]),N=E&&Y?Y:t[L],!(E&&typeof B==typeof N)&&(u.bind&&E?nt=j(N,c):u.wrap&&E?nt=d(N):m&&I(N)?nt=j(Function.call,N):nt=N,(u.sham||N&&N.sham||B&&B.sham)&&p(nt,"sham",!0),p(y,L,nt),m&&(O=e+"Prototype",a(P,O)||p(P,O,{}),p(P[O],L,N),u.real&&C&&!C[L]&&p(C,L,N)))}},6192:function(g){g.exports=function(x){try{return!!x()}catch(f){return!0}}},8043:function(g,x,f){var c=f(6235);g.exports=function(I,M,D){if(c(I),M===void 0)return I;switch(D){case 0:return function(){return I.call(M)};case 1:return function(P){return I.call(M,P)};case 2:return function(P,j){return I.call(M,P,j)};case 3:return function(P,j,p){return I.call(M,P,j,p)}}return function(){return I.apply(M,arguments)}}},6782:function(g,x,f){"use strict";var c=f(6235),I=f(5744),M=[].slice,D={},P=function(j,p,a){if(!(p in D)){for(var d=[],u=0;ub;b++)if(O=Y(d[b]),O&&O instanceof a)return O;return new a(!1)}y=P(d,C)}for(L=y.next;!(N=L.call(y)).done;){try{O=Y(N.value)}catch(nt){p(y,"throw",nt)}if(typeof O=="object"&&O&&O instanceof a)return O}return new a(!1)}},6639:function(g,x,f){var c=f(1138),I=f(5037);g.exports=function(M,D,P){var j,p;c(M);try{if(j=I(M,"return"),!j){if(D==="throw")throw P;return P}j=j.call(M)}catch(a){p=!0,j=a}if(D==="throw")throw P;if(p)throw j;return c(j),P}},4413:function(g,x,f){"use strict";var c=f(6192),I=f(6447),M=f(2853),D=f(9341),P=f(9482),j=f(8182),p=f(5546),a=j("iterator"),d=!1,u,t,e;[].keys&&(e=[].keys(),"next"in e?(t=D(D(e)),t!==Object.prototype&&(u=t)):d=!0);var i=u==null||c(function(){var s={};return u[a].call(s)!==s});i?u={}:p&&(u=M(u)),I(u[a])||P(u,a,function(){return this}),g.exports={IteratorPrototype:u,BUGGY_SAFARI_ITERATORS:d}},7771:function(g){g.exports={}},4104:function(g,x,f){var c=f(8445);g.exports=function(I){return c(I.length)}},2950:function(g,x,f){var c=f(8576),I=f(5141).f,M=f(7160).set,D=f(9536),P=f(9347),j=f(5914),p=f(224),a=c.MutationObserver||c.WebKitMutationObserver,d=c.document,u=c.process,t=c.Promise,e=I(c,"queueMicrotask"),i=e&&e.value,s,m,o,y,C,b,E,O;i||(s=function(){var L,N;for(p&&(L=u.domain)&&L.exit();m;){N=m.fn,m=m.next;try{N()}catch(B){throw m?y():o=void 0,B}}o=void 0,L&&L.enter()},!D&&!p&&!j&&a&&d?(C=!0,b=d.createTextNode(""),new a(s).observe(b,{characterData:!0}),y=function(){b.data=C=!C}):!P&&t&&t.resolve?(E=t.resolve(void 0),E.constructor=t,O=E.then,y=function(){O.call(E,s)}):p?y=function(){u.nextTick(s)}:y=function(){M.call(c,s)}),g.exports=i||function(L){var N={fn:L,next:void 0};o&&(o.next=N),m||(m=N,y()),o=N}},4471:function(g,x,f){var c=f(8576);g.exports=c.Promise},3045:function(g,x,f){var c=f(4218),I=f(6192);g.exports=!!Object.getOwnPropertySymbols&&!I(function(){var M=Symbol();return!String(M)||!(Object(M)instanceof Symbol)||!Symbol.sham&&c&&c<41})},4551:function(g,x,f){var c=f(6192),I=f(8182),M=f(5546),D=I("iterator");g.exports=!c(function(){var P=new URL("b?a=1&b=2&c=3","http://a"),j=P.searchParams,p="";return P.pathname="c%20d",j.forEach(function(a,d){j.delete("b"),p+=d+a}),M&&!P.toJSON||!j.sort||P.href!=="http://a/c%20d?a=1&c=3"||j.get("c")!=="3"||String(new URLSearchParams("?a=1"))!=="a=1"||!j[D]||new URL("https://a@b").username!=="a"||new URLSearchParams(new URLSearchParams("a=b")).get("a")!=="b"||new URL("http://\u0442\u0435\u0441\u0442").host!=="xn--e1aybc"||new URL("http://a#\u0431").hash!=="#%D0%B1"||p!=="a1c3"||new URL("http://x",void 0).host!=="x"})},8921:function(g,x,f){var c=f(8576),I=f(6447),M=f(9516),D=c.WeakMap;g.exports=I(D)&&/native code/.test(M(D))},9438:function(g,x,f){"use strict";var c=f(6235),I=function(M){var D,P;this.promise=new M(function(j,p){if(D!==void 0||P!==void 0)throw TypeError("Bad Promise constructor");D=j,P=p}),this.resolve=c(D),this.reject=c(P)};g.exports.f=function(M){return new I(M)}},15:function(g,x,f){var c=f(8576),I=f(6192),M=f(4845),D=f(4277).trim,P=f(1450),j=c.parseFloat,p=c.Symbol,a=p&&p.iterator,d=1/j(P+"-0")!=-Infinity||a&&!I(function(){j(Object(a))});g.exports=d?function(t){var e=D(M(t)),i=j(e);return i===0&&e.charAt(0)=="-"?-0:i}:j},2558:function(g,x,f){var c=f(8576),I=f(6192),M=f(4845),D=f(4277).trim,P=f(1450),j=c.parseInt,p=c.Symbol,a=p&&p.iterator,d=/^[+-]?0[Xx]/,u=j(P+"08")!==8||j(P+"0x16")!==22||a&&!I(function(){j(Object(a))});g.exports=u?function(e,i){var s=D(M(e));return j(s,i>>>0||(d.test(s)?16:10))}:j},2503:function(g,x,f){"use strict";var c=f(69),I=f(6192),M=f(7653),D=f(4750),P=f(6007),j=f(1795),p=f(2202),a=Object.assign,d=Object.defineProperty;g.exports=!a||I(function(){if(c&&a({b:1},a(d({},"a",{enumerable:!0,get:function(){d(this,"b",{value:3,enumerable:!1})}}),{b:2})).b!==1)return!0;var u={},t={},e=Symbol(),i="abcdefghijklmnopqrst";return u[e]=7,i.split("").forEach(function(s){t[s]=s}),a({},u)[e]!=7||M(a({},t)).join("")!=i})?function(t,e){for(var i=j(t),s=arguments.length,m=1,o=D.f,y=P.f;s>m;)for(var C=p(arguments[m++]),b=o?M(C).concat(o(C)):M(C),E=b.length,O=0,L;E>O;)L=b[O++],(!c||y.call(C,L))&&(i[L]=C[L]);return i}:a},2853:function(g,x,f){var c=f(1138),I=f(1187),M=f(2952),D=f(4535),P=f(7403),j=f(7449),p=f(9766),a=">",d="<",u="prototype",t="script",e=p("IE_PROTO"),i=function(){},s=function(b){return d+t+a+b+d+"/"+t+a},m=function(b){b.write(s("")),b.close();var E=b.parentWindow.Object;return b=null,E},o=function(){var b=j("iframe"),E="java"+t+":",O;return b.style.display="none",P.appendChild(b),b.src=String(E),O=b.contentWindow.document,O.open(),O.write(s("document.F=Object")),O.close(),O.F},y,C=function(){try{y=new ActiveXObject("htmlfile")}catch(E){}C=typeof document!="undefined"?document.domain&&y?m(y):o():m(y);for(var b=M.length;b--;)delete C[u][M[b]];return C()};D[e]=!0,g.exports=Object.create||function(E,O){var L;return E!==null?(i[u]=c(E),L=new i,i[u]=null,L[e]=E):L=C(),O===void 0?L:I(L,O)}},1187:function(g,x,f){var c=f(69),I=f(2760),M=f(1138),D=f(7653);g.exports=c?Object.defineProperties:function(j,p){M(j);for(var a=D(p),d=a.length,u=0,t;d>u;)I.f(j,t=a[u++],p[t]);return j}},2760:function(g,x,f){var c=f(69),I=f(188),M=f(1138),D=f(77),P=Object.defineProperty;x.f=c?P:function(p,a,d){if(M(p),a=D(a),M(d),I)try{return P(p,a,d)}catch(u){}if("get"in d||"set"in d)throw TypeError("Accessors not supported");return"value"in d&&(p[a]=d.value),p}},5141:function(g,x,f){var c=f(69),I=f(6007),M=f(774),D=f(101),P=f(77),j=f(4500),p=f(188),a=Object.getOwnPropertyDescriptor;x.f=c?a:function(u,t){if(u=D(u),t=P(t),p)try{return a(u,t)}catch(e){}if(j(u,t))return M(!I.f.call(u,t),u[t])}},4052:function(g,x,f){var c=f(101),I=f(2092).f,M={}.toString,D=typeof window=="object"&&window&&Object.getOwnPropertyNames?Object.getOwnPropertyNames(window):[],P=function(j){try{return I(j)}catch(p){return D.slice()}};g.exports.f=function(p){return D&&M.call(p)=="[object Window]"?P(p):I(c(p))}},2092:function(g,x,f){var c=f(7934),I=f(2952),M=I.concat("length","prototype");x.f=Object.getOwnPropertyNames||function(P){return c(P,M)}},4750:function(g,x){x.f=Object.getOwnPropertySymbols},9341:function(g,x,f){var c=f(4500),I=f(6447),M=f(1795),D=f(9766),P=f(4635),j=D("IE_PROTO"),p=Object.prototype;g.exports=P?Object.getPrototypeOf:function(a){var d=M(a);if(c(d,j))return d[j];var u=d.constructor;return I(u)&&d instanceof u?u.prototype:d instanceof Object?p:null}},7934:function(g,x,f){var c=f(4500),I=f(101),M=f(8180).indexOf,D=f(4535);g.exports=function(P,j){var p=I(P),a=0,d=[],u;for(u in p)!c(D,u)&&c(p,u)&&d.push(u);for(;j.length>a;)c(p,u=j[a++])&&(~M(d,u)||d.push(u));return d}},7653:function(g,x,f){var c=f(7934),I=f(2952);g.exports=Object.keys||function(D){return c(D,I)}},6007:function(g,x){"use strict";var f={}.propertyIsEnumerable,c=Object.getOwnPropertyDescriptor,I=c&&!f.call({1:2},1);x.f=I?function(D){var P=c(this,D);return!!P&&P.enumerable}:f},4469:function(g,x,f){var c=f(1138),I=f(7757);g.exports=Object.setPrototypeOf||("__proto__"in{}?function(){var M=!1,D={},P;try{P=Object.getOwnPropertyDescriptor(Object.prototype,"__proto__").set,P.call(D,[]),M=D instanceof Array}catch(j){}return function(p,a){return c(p),I(a),M?P.call(p,a):p.__proto__=a,p}}():void 0)},158:function(g,x,f){"use strict";var c=f(3471),I=f(4696);g.exports=c?{}.toString:function(){return"[object "+I(this)+"]"}},380:function(g,x,f){var c=f(6447),I=f(5744);g.exports=function(M,D){var P,j;if(D==="string"&&c(P=M.toString)&&!I(j=P.call(M))||c(P=M.valueOf)&&!I(j=P.call(M))||D!=="string"&&c(P=M.toString)&&!I(j=P.call(M)))return j;throw TypeError("Can't convert object to primitive value")}},7545:function(g){g.exports={}},892:function(g){g.exports=function(x){try{return{error:!1,value:x()}}catch(f){return{error:!0,value:f}}}},9126:function(g,x,f){var c=f(1138),I=f(5744),M=f(9438);g.exports=function(D,P){if(c(D),I(P)&&P.constructor===D)return P;var j=M.f(D),p=j.resolve;return p(P),j.promise}},533:function(g,x,f){var c=f(9482);g.exports=function(I,M,D){for(var P in M)D&&D.unsafe&&I[P]?I[P]=M[P]:c(I,P,M[P],D);return I}},9482:function(g,x,f){var c=f(8711);g.exports=function(I,M,D,P){P&&P.enumerable?I[M]=D:c(I,M,D)}},3209:function(g){g.exports=function(x){if(x==null)throw TypeError("Can't call method on "+x);return x}},7613:function(g,x,f){var c=f(8576);g.exports=function(I,M){try{Object.defineProperty(c,I,{value:M,configurable:!0,writable:!0})}catch(D){c[I]=M}return M}},3656:function(g,x,f){"use strict";var c=f(150),I=f(2760),M=f(8182),D=f(69),P=M("species");g.exports=function(j){var p=c(j),a=I.f;D&&p&&!p[P]&&a(p,P,{configurable:!0,get:function(){return this}})}},1284:function(g,x,f){var c=f(3471),I=f(2760).f,M=f(8711),D=f(4500),P=f(158),j=f(8182),p=j("toStringTag");g.exports=function(a,d,u,t){if(a){var e=u?a:a.prototype;D(e,p)||I(e,p,{configurable:!0,value:d}),t&&!c&&M(e,"toString",P)}}},9766:function(g,x,f){var c=f(8717),I=f(2759),M=c("keys");g.exports=function(D){return M[D]||(M[D]=I(D))}},6434:function(g,x,f){var c=f(8576),I=f(7613),M="__core-js_shared__",D=c[M]||I(M,{});g.exports=D},8717:function(g,x,f){var c=f(5546),I=f(6434);(g.exports=function(M,D){return I[M]||(I[M]=D!==void 0?D:{})})("versions",[]).push({version:"3.18.2",mode:c?"pure":"global",copyright:"\xA9 2021 Denis Pushkarev (zloirock.ru)"})},4743:function(g,x,f){var c=f(1138),I=f(1404),M=f(8182),D=M("species");g.exports=function(P,j){var p=c(P).constructor,a;return p===void 0||(a=c(p)[D])==null?j:I(a)}},863:function(g,x,f){var c=f(1941),I=f(4845),M=f(3209),D=function(P){return function(j,p){var a=I(M(j)),d=c(p),u=a.length,t,e;return d<0||d>=u?P?"":void 0:(t=a.charCodeAt(d),t<55296||t>56319||d+1===u||(e=a.charCodeAt(d+1))<56320||e>57343?P?a.charAt(d):t:P?a.slice(d,d+2):(t-55296<<10)+(e-56320)+65536)}};g.exports={codeAt:D(!1),charAt:D(!0)}},7977:function(g){"use strict";var x=2147483647,f=36,c=1,I=26,M=38,D=700,P=72,j=128,p="-",a=/[^\0-\u007E]/,d=/[.\u3002\uFF0E\uFF61]/g,u="Overflow: input needs wider integers to process",t=f-c,e=Math.floor,i=String.fromCharCode,s=function(C){for(var b=[],E=0,O=C.length;E=55296&&L<=56319&&E>1,C+=e(C/b);C>t*I>>1;O+=f)C=e(C/t);return e(O+(t+1)*C/(C+M))},y=function(C){var b=[];C=s(C);var E=C.length,O=j,L=0,N=P,B,Y;for(B=0;B=O&&Ye((x-L)/K))throw RangeError(u);for(L+=(Mt-O)*K,O=Mt,B=0;Bx)throw RangeError(u);if(Y==O){for(var It=L,U=f;;U+=f){var Lt=U<=N?c:U>=N+I?I:U-N;if(ItK;)it.push(arguments[K++]);return m[++s]=function(){(I(nt)?nt:Function(nt)).apply(void 0,it)},C(s),s},u=function(nt){delete m[nt]},a?C=function(Y){t.nextTick(L(Y))}:i&&i.now?C=function(Y){i.now(L(Y))}:e&&!p?(b=new e,E=b.port2,b.port1.onmessage=N,C=D(E.postMessage,E,1)):c.addEventListener&&I(c.postMessage)&&!c.importScripts&&y&&y.protocol!=="file:"&&!M(B)?(C=B,c.addEventListener("message",N,!1)):o in j("script")?C=function(Y){P.appendChild(j("script"))[o]=function(){P.removeChild(this),O(Y)}}:C=function(Y){setTimeout(L(Y),0)}),g.exports={set:d,clear:u}},7739:function(g,x,f){var c=f(1941),I=Math.max,M=Math.min;g.exports=function(D,P){var j=c(D);return j<0?I(j+P,0):M(j,P)}},101:function(g,x,f){var c=f(2202),I=f(3209);g.exports=function(M){return c(I(M))}},1941:function(g){var x=Math.ceil,f=Math.floor;g.exports=function(c){var I=+c;return I!==I||I===0?0:(I>0?f:x)(I)}},8445:function(g,x,f){var c=f(1941),I=Math.min;g.exports=function(M){return M>0?I(c(M),9007199254740991):0}},1795:function(g,x,f){var c=f(3209);g.exports=function(I){return Object(c(I))}},7888:function(g,x,f){var c=f(5744),I=f(3236),M=f(5037),D=f(380),P=f(8182),j=P("toPrimitive");g.exports=function(p,a){if(!c(p)||I(p))return p;var d=M(p,j),u;if(d){if(a===void 0&&(a="default"),u=d.call(p,a),!c(u)||I(u))return u;throw TypeError("Can't convert object to primitive value")}return a===void 0&&(a="number"),D(p,a)}},77:function(g,x,f){var c=f(7888),I=f(3236);g.exports=function(M){var D=c(M,"string");return I(D)?D:String(D)}},3471:function(g,x,f){var c=f(8182),I=c("toStringTag"),M={};M[I]="z",g.exports=String(M)==="[object z]"},4845:function(g,x,f){var c=f(4696);g.exports=function(I){if(c(I)==="Symbol")throw TypeError("Cannot convert a Symbol value to a string");return String(I)}},9288:function(g){g.exports=function(x){try{return String(x)}catch(f){return"Object"}}},2759:function(g){var x=0,f=Math.random();g.exports=function(c){return"Symbol("+String(c===void 0?"":c)+")_"+(++x+f).toString(36)}},615:function(g,x,f){var c=f(3045);g.exports=c&&!Symbol.sham&&typeof Symbol.iterator=="symbol"},9207:function(g,x,f){var c=f(8182);x.f=c},8182:function(g,x,f){var c=f(8576),I=f(8717),M=f(4500),D=f(2759),P=f(3045),j=f(615),p=I("wks"),a=c.Symbol,d=j?a:a&&a.withoutSetter||D;g.exports=function(u){return(!M(p,u)||!(P||typeof p[u]=="string"))&&(P&&M(a,u)?p[u]=a[u]:p[u]=d("Symbol."+u)),p[u]}},1450:function(g){g.exports=` \v\f\r \xA0\u1680\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200A\u202F\u205F\u3000\u2028\u2029\uFEFF`},4242:function(g,x,f){"use strict";var c=f(3085),I=f(9341),M=f(4469),D=f(2853),P=f(8711),j=f(774),p=f(273),a=f(3442),d=f(4845),u=function(e,i){var s=this,m=arguments.length>2?arguments[2]:void 0;if(!(s instanceof u))return new u(e,i,m);M&&(s=M(new Error(void 0),I(s))),i!==void 0&&P(s,"message",d(i)),p(s,m);var o=[];return a(e,o.push,{that:o}),P(s,"errors",o),s};u.prototype=D(Error.prototype,{constructor:j(5,u),message:j(5,""),name:j(5,"AggregateError")}),c({global:!0},{AggregateError:u})},9106:function(g,x,f){"use strict";var c=f(3085),I=f(6192),M=f(4770),D=f(5744),P=f(1795),j=f(4104),p=f(9361),a=f(1321),d=f(242),u=f(8182),t=f(4218),e=u("isConcatSpreadable"),i=9007199254740991,s="Maximum allowed index exceeded",m=t>=51||!I(function(){var b=[];return b[e]=!1,b.concat()[0]!==b}),o=d("concat"),y=function(b){if(!D(b))return!1;var E=b[e];return E!==void 0?!!E:M(b)},C=!m||!o;c({target:"Array",proto:!0,forced:C},{concat:function(E){var O=P(this),L=a(O,0),N=0,B,Y,nt,it,Mt;for(B=-1,nt=arguments.length;Bi)throw TypeError(s);for(Y=0;Y=i)throw TypeError(s);p(L,N++,Mt)}return L.length=N,L}})},1710:function(g,x,f){var c=f(3085),I=f(2724),M=f(7423);c({target:"Array",proto:!0},{fill:I}),M("fill")},3436:function(g,x,f){"use strict";var c=f(3085),I=f(454).filter,M=f(242),D=M("filter");c({target:"Array",proto:!0,forced:!D},{filter:function(j){return I(this,j,arguments.length>1?arguments[1]:void 0)}})},9823:function(g,x,f){"use strict";var c=f(3085),I=f(7397);c({target:"Array",proto:!0,forced:[].forEach!=I},{forEach:I})},9173:function(g,x,f){var c=f(3085),I=f(841),M=f(9770),D=!M(function(P){Array.from(P)});c({target:"Array",stat:!0,forced:D},{from:I})},2276:function(g,x,f){"use strict";var c=f(3085),I=f(8180).indexOf,M=f(424),D=[].indexOf,P=!!D&&1/[1].indexOf(1,-0)<0,j=M("indexOf");c({target:"Array",proto:!0,forced:P||!j},{indexOf:function(a){return P?D.apply(this,arguments)||0:I(this,a,arguments.length>1?arguments[1]:void 0)}})},8118:function(g,x,f){var c=f(3085),I=f(4770);c({target:"Array",stat:!0},{isArray:I})},8939:function(g,x,f){"use strict";var c=f(101),I=f(7423),M=f(7771),D=f(3326),P=f(7218),j="Array Iterator",p=D.set,a=D.getterFor(j);g.exports=P(Array,"Array",function(d,u){p(this,{type:j,target:c(d),index:0,kind:u})},function(){var d=a(this),u=d.target,t=d.kind,e=d.index++;return!u||e>=u.length?(d.target=void 0,{value:void 0,done:!0}):t=="keys"?{value:e,done:!1}:t=="values"?{value:u[e],done:!1}:{value:[e,u[e]],done:!1}},"values"),M.Arguments=M.Array,I("keys"),I("values"),I("entries")},3838:function(g,x,f){"use strict";var c=f(3085),I=f(454).map,M=f(242),D=M("map");c({target:"Array",proto:!0,forced:!D},{map:function(j){return I(this,j,arguments.length>1?arguments[1]:void 0)}})},5818:function(g,x,f){"use strict";var c=f(3085),I=f(4770),M=f(2091),D=f(5744),P=f(7739),j=f(4104),p=f(101),a=f(9361),d=f(8182),u=f(242),t=u("slice"),e=d("species"),i=[].slice,s=Math.max;c({target:"Array",proto:!0,forced:!t},{slice:function(o,y){var C=p(this),b=j(C),E=P(o,b),O=P(y===void 0?b:y,b),L,N,B;if(I(C)&&(L=C.constructor,M(L)&&(L===Array||I(L.prototype))?L=void 0:D(L)&&(L=L[e],L===null&&(L=void 0)),L===Array||L===void 0))return i.call(C,E,O);for(N=new(L===void 0?Array:L)(s(O-E,0)),B=0;Ee)throw TypeError(i);for(N=j(y,L),B=0;BC-L+O;B--)delete y[B-1]}else if(O>L)for(B=C-L;B>b;B--)Y=B+L-1,nt=B+O-1,Y in y?y[nt]=y[Y]:delete y[nt];for(B=0;B=51&&/native code/.test(Dt))return!1;var Ut=new Q(function(Bt){Bt(1)}),Vt=function(Bt){Bt(function(){},function(){})},qt=Ut.constructor={};return qt[U]=Vt,ft=Ut.then(function(){})instanceof Vt,ft?!kt&&Mt&&!ht:!0}),Jt=St||!y(function(Dt){Q.all(Dt).catch(function(){})}),Kt=function(Dt){var kt;return i(Dt)&&e(kt=Dt.then)?kt:!1},ae=function(Dt,kt){if(!Dt.notified){Dt.notified=!0;var Ut=Dt.reactions;E(function(){for(var Vt=Dt.value,qt=Dt.state==at,Bt=0;Ut.length>Bt;){var be=Ut[Bt++],Me=qt?be.ok:be.fail,Qt=be.resolve,Et=be.reject,Ce=be.domain,he,de,Ae;try{Me?(qt||(Dt.rejection===ct&&Gt(Dt),Dt.rejection=et),Me===!0?he=Vt:(Ce&&Ce.enter(),he=Me(Vt),Ce&&(Ce.exit(),Ae=!0)),he===be.promise?Et(rt("Promise-chain cycle")):(de=Kt(he))?de.call(he,Qt,Et):Qt(he)):Et(Vt)}catch(Oe){Ce&&!Ae&&Ce.exit(),Et(Oe)}}Dt.reactions=[],Dt.notified=!1,kt&&!Dt.rejection&&ue(Dt)})}},ve=function(Dt,kt,Ut){var Vt,qt;gt?(Vt=F.createEvent("Event"),Vt.promise=kt,Vt.reason=Ut,Vt.initEvent(Dt,!1,!0),M.dispatchEvent(Vt)):Vt={promise:kt,reason:Ut},!ht&&(qt=M["on"+Dt])?qt(Vt):Dt===bt&&L("Unhandled promise rejection",Ut)},ue=function(Dt){b.call(M,function(){var kt=Dt.facade,Ut=Dt.value,Vt=Wt(Dt),qt;if(Vt&&(qt=B(function(){K?W.emit("unhandledRejection",Ut,kt):ve(bt,kt,Ut)}),Dt.rejection=K||Wt(Dt)?ct:et,qt.error))throw qt.value})},Wt=function(Dt){return Dt.rejection!==et&&!Dt.parent},Gt=function(Dt){b.call(M,function(){var kt=Dt.facade;K?W.emit("rejectionHandled",kt):ve(Tt,kt,Dt.value)})},$t=function(Dt,kt,Ut){return function(Vt){Dt(kt,Vt,Ut)}},ne=function(Dt,kt,Ut){Dt.done||(Dt.done=!0,Ut&&(Dt=Ut),Dt.value=kt,Dt.state=$,ae(Dt,!0))},ce=function(Dt,kt,Ut){if(!Dt.done){Dt.done=!0,Ut&&(Dt=Ut);try{if(Dt.facade===kt)throw rt("Promise can't be resolved itself");var Vt=Kt(kt);Vt?E(function(){var qt={done:!1};try{Vt.call(kt,$t(ce,qt,Dt),$t(ne,qt,Dt))}catch(Bt){ne(qt,Bt,Dt)}}):(Dt.value=kt,Dt.state=at,ae(Dt,!1))}catch(qt){ne({done:!1},qt,Dt)}}};if(St&&(Q=function(kt){s(this,Q,Lt),t(kt),Ct.call(this);var Ut=dt(this);try{kt($t(ce,Ut),$t(ne,Ut))}catch(Vt){ne(Ut,Vt)}},G=Q.prototype,Ct=function(kt){Nt(this,{type:Lt,done:!1,notified:!1,parent:!1,reactions:[],rejection:!1,state:xt,value:void 0})},Ct.prototype=p(G,{then:function(kt,Ut){var Vt=V(this),qt=X(C(this,Q));return qt.ok=e(kt)?kt:!0,qt.fail=e(Ut)&&Ut,qt.domain=K?W.domain:void 0,Vt.parent=!0,Vt.reactions.push(qt),Vt.state!=xt&&ae(Vt,!1),qt.promise},catch:function(Dt){return this.then(void 0,Dt)}}),_t=function(){var Dt=new Ct,kt=dt(Dt);this.promise=Dt,this.resolve=$t(ce,kt),this.reject=$t(ne,kt)},N.f=X=function(Dt){return Dt===Q||Dt===Zt?new _t(Dt):Z(Dt)},!I&&e(P)&&q!==Object.prototype)){Xt=q.then,ft||(j(q,"then",function(kt,Ut){var Vt=this;return new Q(function(qt,Bt){Xt.call(Vt,qt,Bt)}).then(kt,Ut)},{unsafe:!0}),j(q,"catch",G.catch,{unsafe:!0}));try{delete q.constructor}catch(Dt){}a&&a(q,G)}c({global:!0,wrap:!0,forced:St},{Promise:Q}),d(Q,Lt,!1,!0),u(Lt),Zt=D(Lt),c({target:Lt,stat:!0,forced:St},{reject:function(kt){var Ut=X(this);return Ut.reject.call(void 0,kt),Ut.promise}}),c({target:Lt,stat:!0,forced:I||St},{resolve:function(kt){return O(I&&this===Zt?Q:this,kt)}}),c({target:Lt,stat:!0,forced:Jt},{all:function(kt){var Ut=this,Vt=X(Ut),qt=Vt.resolve,Bt=Vt.reject,be=B(function(){var Me=t(Ut.resolve),Qt=[],Et=0,Ce=1;o(kt,function(he){var de=Et++,Ae=!1;Qt.push(void 0),Ce++,Me.call(Ut,he).then(function(Oe){Ae||(Ae=!0,Qt[de]=Oe,--Ce||qt(Qt))},Bt)}),--Ce||qt(Qt)});return be.error&&Bt(be.value),Vt.promise},race:function(kt){var Ut=this,Vt=X(Ut),qt=Vt.reject,Bt=B(function(){var be=t(Ut.resolve);o(kt,function(Me){be.call(Ut,Me).then(Vt.resolve,qt)})});return Bt.error&&qt(Bt.value),Vt.promise}})},5397:function(g,x,f){var c=f(3085),I=f(150),M=f(1404),D=f(1138),P=f(5744),j=f(2853),p=f(6782),a=f(6192),d=I("Reflect","construct"),u=a(function(){function i(){}return!(d(function(){},[],i)instanceof i)}),t=!a(function(){d(function(){})}),e=u||t;c({target:"Reflect",stat:!0,forced:e,sham:e},{construct:function(s,m){M(s),D(m);var o=arguments.length<3?s:M(arguments[2]);if(t&&!u)return d(s,m,o);if(s==o){switch(m.length){case 0:return new s;case 1:return new s(m[0]);case 2:return new s(m[0],m[1]);case 3:return new s(m[0],m[1],m[2]);case 4:return new s(m[0],m[1],m[2],m[3])}var y=[null];return y.push.apply(y,m),new(p.apply(s,y))}var C=o.prototype,b=j(P(C)?C:Object.prototype),E=Function.apply.call(s,b,m);return P(E)?E:b}})},1367:function(){},5454:function(g,x,f){"use strict";var c=f(863).charAt,I=f(4845),M=f(3326),D=f(7218),P="String Iterator",j=M.set,p=M.getterFor(P);D(String,"String",function(a){j(this,{type:P,string:I(a),index:0})},function(){var d=p(this),u=d.string,t=d.index,e;return t>=u.length?{value:void 0,done:!0}:(e=c(u,t),d.index+=e.length,{value:e,done:!1})})},957:function(g,x,f){"use strict";var c=f(3085),I=f(4277).trim,M=f(6815);c({target:"String",proto:!0,forced:M("trim")},{trim:function(){return I(this)}})},9781:function(g,x,f){var c=f(1488);c("asyncIterator")},492:function(){},6681:function(g,x,f){var c=f(1488);c("hasInstance")},9594:function(g,x,f){var c=f(1488);c("isConcatSpreadable")},3665:function(g,x,f){var c=f(1488);c("iterator")},6187:function(g,x,f){"use strict";var c=f(3085),I=f(8576),M=f(150),D=f(5546),P=f(69),j=f(3045),p=f(6192),a=f(4500),d=f(4770),u=f(6447),t=f(5744),e=f(3236),i=f(1138),s=f(1795),m=f(101),o=f(77),y=f(4845),C=f(774),b=f(2853),E=f(7653),O=f(2092),L=f(4052),N=f(4750),B=f(5141),Y=f(2760),nt=f(6007),it=f(9482),Mt=f(8717),K=f(9766),It=f(4535),U=f(2759),Lt=f(8182),dt=f(9207),Nt=f(1488),V=f(1284),q=f(3326),Q=f(454).forEach,G=K("hidden"),rt="Symbol",F="prototype",W=Lt("toPrimitive"),X=q.set,Z=q.getterFor(rt),gt=Object[F],ht=I.Symbol,bt=M("JSON","stringify"),Tt=B.f,xt=Y.f,at=L.f,$=nt.f,et=Mt("symbols"),ct=Mt("op-symbols"),ft=Mt("string-to-symbol-registry"),Ct=Mt("symbol-to-string-registry"),_t=Mt("wks"),Zt=I.QObject,Xt=!Zt||!Zt[F]||!Zt[F].findChild,St=P&&p(function(){return b(xt({},"a",{get:function(){return xt(this,"a",{value:7}).a}})).a!=7})?function(Dt,kt,Ut){var Vt=Tt(gt,kt);Vt&&delete gt[kt],xt(Dt,kt,Ut),Vt&&Dt!==gt&&xt(gt,kt,Vt)}:xt,Jt=function(Dt,kt){var Ut=et[Dt]=b(ht[F]);return X(Ut,{type:rt,tag:Dt,description:kt}),P||(Ut.description=kt),Ut},Kt=function(kt,Ut,Vt){kt===gt&&Kt(ct,Ut,Vt),i(kt);var qt=o(Ut);return i(Vt),a(et,qt)?(Vt.enumerable?(a(kt,G)&&kt[G][qt]&&(kt[G][qt]=!1),Vt=b(Vt,{enumerable:C(0,!1)})):(a(kt,G)||xt(kt,G,C(1,{})),kt[G][qt]=!0),St(kt,qt,Vt)):xt(kt,qt,Vt)},ae=function(kt,Ut){i(kt);var Vt=m(Ut),qt=E(Vt).concat($t(Vt));return Q(qt,function(Bt){(!P||ue.call(Vt,Bt))&&Kt(kt,Bt,Vt[Bt])}),kt},ve=function(kt,Ut){return Ut===void 0?b(kt):ae(b(kt),Ut)},ue=function(kt){var Ut=o(kt),Vt=$.call(this,Ut);return this===gt&&a(et,Ut)&&!a(ct,Ut)?!1:Vt||!a(this,Ut)||!a(et,Ut)||a(this,G)&&this[G][Ut]?Vt:!0},Wt=function(kt,Ut){var Vt=m(kt),qt=o(Ut);if(!(Vt===gt&&a(et,qt)&&!a(ct,qt))){var Bt=Tt(Vt,qt);return Bt&&a(et,qt)&&!(a(Vt,G)&&Vt[G][qt])&&(Bt.enumerable=!0),Bt}},Gt=function(kt){var Ut=at(m(kt)),Vt=[];return Q(Ut,function(qt){!a(et,qt)&&!a(It,qt)&&Vt.push(qt)}),Vt},$t=function(kt){var Ut=kt===gt,Vt=at(Ut?ct:m(kt)),qt=[];return Q(Vt,function(Bt){a(et,Bt)&&(!Ut||a(gt,Bt))&&qt.push(et[Bt])}),qt};if(j||(ht=function(){if(this instanceof ht)throw TypeError("Symbol is not a constructor");var kt=!arguments.length||arguments[0]===void 0?void 0:y(arguments[0]),Ut=U(kt),Vt=function(qt){this===gt&&Vt.call(ct,qt),a(this,G)&&a(this[G],Ut)&&(this[G][Ut]=!1),St(this,Ut,C(1,qt))};return P&&Xt&&St(gt,Ut,{configurable:!0,set:Vt}),Jt(Ut,kt)},it(ht[F],"toString",function(){return Z(this).tag}),it(ht,"withoutSetter",function(Dt){return Jt(U(Dt),Dt)}),nt.f=ue,Y.f=Kt,B.f=Wt,O.f=L.f=Gt,N.f=$t,dt.f=function(Dt){return Jt(Lt(Dt),Dt)},P&&(xt(ht[F],"description",{configurable:!0,get:function(){return Z(this).description}}),D||it(gt,"propertyIsEnumerable",ue,{unsafe:!0}))),c({global:!0,wrap:!0,forced:!j,sham:!j},{Symbol:ht}),Q(E(_t),function(Dt){Nt(Dt)}),c({target:rt,stat:!0,forced:!j},{for:function(Dt){var kt=y(Dt);if(a(ft,kt))return ft[kt];var Ut=ht(kt);return ft[kt]=Ut,Ct[Ut]=kt,Ut},keyFor:function(kt){if(!e(kt))throw TypeError(kt+" is not a symbol");if(a(Ct,kt))return Ct[kt]},useSetter:function(){Xt=!0},useSimple:function(){Xt=!1}}),c({target:"Object",stat:!0,forced:!j,sham:!P},{create:ve,defineProperty:Kt,defineProperties:ae,getOwnPropertyDescriptor:Wt}),c({target:"Object",stat:!0,forced:!j},{getOwnPropertyNames:Gt,getOwnPropertySymbols:$t}),c({target:"Object",stat:!0,forced:p(function(){N.f(1)})},{getOwnPropertySymbols:function(kt){return N.f(s(kt))}}),bt){var ne=!j||p(function(){var Dt=ht();return bt([Dt])!="[null]"||bt({a:Dt})!="{}"||bt(Object(Dt))!="{}"});c({target:"JSON",stat:!0,forced:ne},{stringify:function(kt,Ut,Vt){for(var qt=[kt],Bt=1,be;arguments.length>Bt;)qt.push(arguments[Bt++]);if(be=Ut,!(!t(Ut)&&kt===void 0||e(kt)))return d(Ut)||(Ut=function(Me,Qt){if(u(be)&&(Qt=be.call(this,Me,Qt)),!e(Qt))return Qt}),qt[1]=Ut,bt.apply(null,qt)}})}if(!ht[F][W]){var ce=ht[F].valueOf;it(ht[F],W,function(){return ce.apply(this,arguments)})}V(ht,rt),It[G]=!0},1250:function(g,x,f){var c=f(1488);c("matchAll")},9017:function(g,x,f){var c=f(1488);c("match")},9786:function(g,x,f){var c=f(1488);c("replace")},503:function(g,x,f){var c=f(1488);c("search")},6565:function(g,x,f){var c=f(1488);c("species")},9322:function(g,x,f){var c=f(1488);c("split")},3610:function(g,x,f){var c=f(1488);c("toPrimitive")},6886:function(g,x,f){var c=f(1488);c("toStringTag")},3514:function(g,x,f){var c=f(1488);c("unscopables")},177:function(g,x,f){var c=f(1488);c("asyncDispose")},9031:function(g,x,f){var c=f(1488);c("dispose")},6658:function(g,x,f){var c=f(1488);c("matcher")},1875:function(g,x,f){var c=f(1488);c("metadata")},8658:function(g,x,f){var c=f(1488);c("observable")},4592:function(g,x,f){var c=f(1488);c("patternMatch")},6680:function(g,x,f){var c=f(1488);c("replaceAll")},162:function(g,x,f){f(8939);var c=f(7365),I=f(8576),M=f(4696),D=f(8711),P=f(7771),j=f(8182),p=j("toStringTag");for(var a in c){var d=I[a],u=d&&d.prototype;u&&M(u)!==p&&D(u,p,a),P[a]=P.Array}},2906:function(g,x,f){var c=f(3085),I=f(8576),M=f(6447),D=f(8989),P=[].slice,j=/MSIE .\./.test(D),p=function(a){return function(d,u){var t=arguments.length>2,e=t?P.call(arguments,2):void 0;return a(t?function(){(M(d)?d:Function(d)).apply(this,e)}:d,u)}};c({global:!0,bind:!0,forced:j},{setTimeout:p(I.setTimeout),setInterval:p(I.setInterval)})},9336:function(g,x,f){"use strict";f(8939);var c=f(3085),I=f(150),M=f(4551),D=f(9482),P=f(533),j=f(1284),p=f(5148),a=f(3326),d=f(6961),u=f(6447),t=f(4500),e=f(8043),i=f(4696),s=f(1138),m=f(5744),o=f(4845),y=f(2853),C=f(774),b=f(1669),E=f(8703),O=f(8182),L=I("fetch"),N=I("Request"),B=N&&N.prototype,Y=I("Headers"),nt=O("iterator"),it="URLSearchParams",Mt=it+"Iterator",K=a.set,It=a.getterFor(it),U=a.getterFor(Mt),Lt=/\+/g,dt=Array(4),Nt=function(at){return dt[at-1]||(dt[at-1]=RegExp("((?:%[\\da-f]{2}){"+at+"})","gi"))},V=function(at){try{return decodeURIComponent(at)}catch($){return at}},q=function(at){var $=at.replace(Lt," "),et=4;try{return decodeURIComponent($)}catch(ct){for(;et;)$=$.replace(Nt(et--),V);return $}},Q=/[!'()~]|%20/g,G={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+"},rt=function(at){return G[at]},F=function(at){return encodeURIComponent(at).replace(Q,rt)},W=function(at,$){if($)for(var et=$.split("&"),ct=0,ft,Ct;ct0?arguments[0]:void 0,et=this,ct=[],ft,Ct,_t,Zt,Xt,St,Jt,Kt,ae;if(K(et,{type:it,entries:ct,updateURL:function(){},updateSearchParams:X}),$!==void 0)if(m($))if(ft=E($),ft)for(Ct=b($,ft),_t=Ct.next;!(Zt=_t.call(Ct)).done;){if(Xt=b(s(Zt.value)),St=Xt.next,(Jt=St.call(Xt)).done||(Kt=St.call(Xt)).done||!St.call(Xt).done)throw TypeError("Expected sequence with length 2");ct.push({key:o(Jt.value),value:o(Kt.value)})}else for(ae in $)t($,ae)&&ct.push({key:ae,value:o($[ae])});else W(ct,typeof $=="string"?$.charAt(0)==="?"?$.slice(1):$:o($))},bt=ht.prototype;if(P(bt,{append:function($,et){Z(arguments.length,2);var ct=It(this);ct.entries.push({key:o($),value:o(et)}),ct.updateURL()},delete:function(at){Z(arguments.length,1);for(var $=It(this),et=$.entries,ct=o(at),ft=0;ftft.key){et.splice(Ct,0,ft);break}Ct===_t&&et.push(ft)}$.updateURL()},forEach:function($){for(var et=It(this).entries,ct=e($,arguments.length>1?arguments[1]:void 0,3),ft=0,Ct;ft1?Tt(arguments[1]):{})}}),u(N)){var xt=function($){return d(this,xt,"Request"),new N($,arguments.length>1?Tt(arguments[1]):{})};B.constructor=xt,xt.prototype=B,c({global:!0,forced:!0},{Request:xt})}}g.exports={URLSearchParams:ht,getState:It}},4948:function(g,x,f){"use strict";f(5454);var c=f(3085),I=f(69),M=f(4551),D=f(8576),P=f(1187),j=f(9482),p=f(6961),a=f(4500),d=f(2503),u=f(841),t=f(863).codeAt,e=f(7977),i=f(4845),s=f(1284),m=f(9336),o=f(3326),y=D.URL,C=m.URLSearchParams,b=m.getState,E=o.set,O=o.getterFor("URL"),L=Math.floor,N=Math.pow,B="Invalid authority",Y="Invalid scheme",nt="Invalid host",it="Invalid port",Mt=/[A-Za-z]/,K=/[\d+-.A-Za-z]/,It=/\d/,U=/^0x/i,Lt=/^[0-7]+$/,dt=/^\d+$/,Nt=/^[\dA-Fa-f]+$/,V=/[\0\t\n\r #%/:<>?@[\\\]^|]/,q=/[\0\t\n\r #/:<>?@[\\\]^|]/,Q=/^[\u0000-\u0020]+|[\u0000-\u0020]+$/g,G=/[\t\n\r]/g,rt,F=function(J,Pt){var Ot,zt,Yt;if(Pt.charAt(0)=="["){if(Pt.charAt(Pt.length-1)!="]"||(Ot=X(Pt.slice(1,-1)),!Ot))return nt;J.host=Ot}else if(et(J)){if(Pt=e(Pt),V.test(Pt)||(Ot=W(Pt),Ot===null))return nt;J.host=Ot}else{if(q.test(Pt))return nt;for(Ot="",zt=u(Pt),Yt=0;Yt4)return J;for(zt=[],Yt=0;Yt1&&le.charAt(0)=="0"&&(te=U.test(le)?16:8,le=le.slice(te==8?1:2)),le==="")se=0;else{if(!(te==10?dt:te==8?Lt:Nt).test(le))return J;se=parseInt(le,te)}zt.push(se)}for(Yt=0;Yt=N(256,5-Ot))return null}else if(se>255)return null;for(Se=zt.pop(),Yt=0;Yt6))return;for(se=0;we();){if(Se=null,se>0)if(we()=="."&&se<4)Yt++;else return;if(!It.test(we()))return;for(;It.test(we());){if(Ee=parseInt(we(),10),Se===null)Se=Ee;else{if(Se==0)return;Se=Se*10+Ee}if(Se>255)return;Yt++}Pt[Ot]=Pt[Ot]*256+Se,se++,(se==2||se==4)&&Ot++}if(se!=4)return;break}else if(we()==":"){if(Yt++,!we())return}else if(we())return;Pt[Ot++]=le}if(zt!==null)for(_e=Ot-zt,Ot=7;Ot!=0&&_e>0;)Rt=Pt[Ot],Pt[Ot--]=Pt[zt+_e-1],Pt[zt+--_e]=Rt;else if(Ot!=8)return;return Pt},Z=function(J){for(var Pt=null,Ot=1,zt=null,Yt=0,le=0;le<8;le++)J[le]!==0?(Yt>Ot&&(Pt=zt,Ot=Yt),zt=null,Yt=0):(zt===null&&(zt=le),++Yt);return Yt>Ot&&(Pt=zt,Ot=Yt),Pt},gt=function(J){var Pt,Ot,zt,Yt;if(typeof J=="number"){for(Pt=[],Ot=0;Ot<4;Ot++)Pt.unshift(J%256),J=L(J/256);return Pt.join(".")}else if(typeof J=="object"){for(Pt="",zt=Z(J),Ot=0;Ot<8;Ot++)Yt&&J[Ot]===0||(Yt&&(Yt=!1),zt===Ot?(Pt+=Ot?":":"::",Yt=!0):(Pt+=J[Ot].toString(16),Ot<7&&(Pt+=":")));return"["+Pt+"]"}return J},ht={},bt=d({},ht,{" ":1,'"':1,"<":1,">":1,"`":1}),Tt=d({},bt,{"#":1,"?":1,"{":1,"}":1}),xt=d({},Tt,{"/":1,":":1,";":1,"=":1,"@":1,"[":1,"\\":1,"]":1,"^":1,"|":1}),at=function(J,Pt){var Ot=t(J,0);return Ot>32&&Ot<127&&!a(Pt,J)?J:encodeURIComponent(J)},$={ftp:21,file:null,http:80,https:443,ws:80,wss:443},et=function(J){return a($,J.scheme)},ct=function(J){return J.username!=""||J.password!=""},ft=function(J){return!J.host||J.cannotBeABaseURL||J.scheme=="file"},Ct=function(J,Pt){var Ot;return J.length==2&&Mt.test(J.charAt(0))&&((Ot=J.charAt(1))==":"||!Pt&&Ot=="|")},_t=function(J){var Pt;return J.length>1&&Ct(J.slice(0,2))&&(J.length==2||(Pt=J.charAt(2))==="/"||Pt==="\\"||Pt==="?"||Pt==="#")},Zt=function(J){var Pt=J.path,Ot=Pt.length;Ot&&(J.scheme!="file"||Ot!=1||!Ct(Pt[0],!0))&&Pt.pop()},Xt=function(J){return J==="."||J.toLowerCase()==="%2e"},St=function(J){return J=J.toLowerCase(),J===".."||J==="%2e."||J===".%2e"||J==="%2e%2e"},Jt={},Kt={},ae={},ve={},ue={},Wt={},Gt={},$t={},ne={},ce={},Dt={},kt={},Ut={},Vt={},qt={},Bt={},be={},Me={},Qt={},Et={},Ce={},he=function(J,Pt,Ot,zt){var Yt=Ot||Jt,le=0,te="",se=!1,Se=!1,Ee=!1,_e,Rt,we,Pe;for(Ot||(J.scheme="",J.username="",J.password="",J.host=null,J.port=null,J.path=[],J.query=null,J.fragment=null,J.cannotBeABaseURL=!1,Pt=Pt.replace(Q,"")),Pt=Pt.replace(G,""),_e=u(Pt);le<=_e.length;){switch(Rt=_e[le],Yt){case Jt:if(Rt&&Mt.test(Rt))te+=Rt.toLowerCase(),Yt=Kt;else{if(Ot)return Y;Yt=ae;continue}break;case Kt:if(Rt&&(K.test(Rt)||Rt=="+"||Rt=="-"||Rt=="."))te+=Rt.toLowerCase();else if(Rt==":"){if(Ot&&(et(J)!=a($,te)||te=="file"&&(ct(J)||J.port!==null)||J.scheme=="file"&&!J.host))return;if(J.scheme=te,Ot){et(J)&&$[J.scheme]==J.port&&(J.port=null);return}te="",J.scheme=="file"?Yt=Vt:et(J)&&zt&&zt.scheme==J.scheme?Yt=ve:et(J)?Yt=$t:_e[le+1]=="/"?(Yt=ue,le++):(J.cannotBeABaseURL=!0,J.path.push(""),Yt=Qt)}else{if(Ot)return Y;te="",Yt=ae,le=0;continue}break;case ae:if(!zt||zt.cannotBeABaseURL&&Rt!="#")return Y;if(zt.cannotBeABaseURL&&Rt=="#"){J.scheme=zt.scheme,J.path=zt.path.slice(),J.query=zt.query,J.fragment="",J.cannotBeABaseURL=!0,Yt=Ce;break}Yt=zt.scheme=="file"?Vt:Wt;continue;case ve:if(Rt=="/"&&_e[le+1]=="/")Yt=ne,le++;else{Yt=Wt;continue}break;case ue:if(Rt=="/"){Yt=ce;break}else{Yt=Me;continue}case Wt:if(J.scheme=zt.scheme,Rt==rt)J.username=zt.username,J.password=zt.password,J.host=zt.host,J.port=zt.port,J.path=zt.path.slice(),J.query=zt.query;else if(Rt=="/"||Rt=="\\"&&et(J))Yt=Gt;else if(Rt=="?")J.username=zt.username,J.password=zt.password,J.host=zt.host,J.port=zt.port,J.path=zt.path.slice(),J.query="",Yt=Et;else if(Rt=="#")J.username=zt.username,J.password=zt.password,J.host=zt.host,J.port=zt.port,J.path=zt.path.slice(),J.query=zt.query,J.fragment="",Yt=Ce;else{J.username=zt.username,J.password=zt.password,J.host=zt.host,J.port=zt.port,J.path=zt.path.slice(),J.path.pop(),Yt=Me;continue}break;case Gt:if(et(J)&&(Rt=="/"||Rt=="\\"))Yt=ne;else if(Rt=="/")Yt=ce;else{J.username=zt.username,J.password=zt.password,J.host=zt.host,J.port=zt.port,Yt=Me;continue}break;case $t:if(Yt=ne,Rt!="/"||te.charAt(le+1)!="/")continue;le++;break;case ne:if(Rt!="/"&&Rt!="\\"){Yt=ce;continue}break;case ce:if(Rt=="@"){se&&(te="%40"+te),se=!0,we=u(te);for(var ri=0;ri65535)return it;J.port=et(J)&&ai===$[J.scheme]?null:ai,te=""}if(Ot)return;Yt=be;continue}else return it;break;case Vt:if(J.scheme="file",Rt=="/"||Rt=="\\")Yt=qt;else if(zt&&zt.scheme=="file")if(Rt==rt)J.host=zt.host,J.path=zt.path.slice(),J.query=zt.query;else if(Rt=="?")J.host=zt.host,J.path=zt.path.slice(),J.query="",Yt=Et;else if(Rt=="#")J.host=zt.host,J.path=zt.path.slice(),J.query=zt.query,J.fragment="",Yt=Ce;else{_t(_e.slice(le).join(""))||(J.host=zt.host,J.path=zt.path.slice(),Zt(J)),Yt=Me;continue}else{Yt=Me;continue}break;case qt:if(Rt=="/"||Rt=="\\"){Yt=Bt;break}zt&&zt.scheme=="file"&&!_t(_e.slice(le).join(""))&&(Ct(zt.path[0],!0)?J.path.push(zt.path[0]):J.host=zt.host),Yt=Me;continue;case Bt:if(Rt==rt||Rt=="/"||Rt=="\\"||Rt=="?"||Rt=="#"){if(!Ot&&Ct(te))Yt=Me;else if(te==""){if(J.host="",Ot)return;Yt=be}else{if(Pe=F(J,te),Pe)return Pe;if(J.host=="localhost"&&(J.host=""),Ot)return;te="",Yt=be}continue}else te+=Rt;break;case be:if(et(J)){if(Yt=Me,Rt!="/"&&Rt!="\\")continue}else if(!Ot&&Rt=="?")J.query="",Yt=Et;else if(!Ot&&Rt=="#")J.fragment="",Yt=Ce;else if(Rt!=rt&&(Yt=Me,Rt!="/"))continue;break;case Me:if(Rt==rt||Rt=="/"||Rt=="\\"&&et(J)||!Ot&&(Rt=="?"||Rt=="#")){if(St(te)?(Zt(J),Rt!="/"&&!(Rt=="\\"&&et(J))&&J.path.push("")):Xt(te)?Rt!="/"&&!(Rt=="\\"&&et(J))&&J.path.push(""):(J.scheme=="file"&&!J.path.length&&Ct(te)&&(J.host&&(J.host=""),te=te.charAt(0)+":"),J.path.push(te)),te="",J.scheme=="file"&&(Rt==rt||Rt=="?"||Rt=="#"))for(;J.path.length>1&&J.path[0]==="";)J.path.shift();Rt=="?"?(J.query="",Yt=Et):Rt=="#"&&(J.fragment="",Yt=Ce)}else te+=at(Rt,Tt);break;case Qt:Rt=="?"?(J.query="",Yt=Et):Rt=="#"?(J.fragment="",Yt=Ce):Rt!=rt&&(J.path[0]+=at(Rt,ht));break;case Et:!Ot&&Rt=="#"?(J.fragment="",Yt=Ce):Rt!=rt&&(Rt=="'"&&et(J)?J.query+="%27":Rt=="#"?J.query+="%23":J.query+=at(Rt,ht));break;case Ce:Rt!=rt&&(J.fragment+=at(Rt,bt));break}le++}},de=function(Pt){var Ot=p(this,de,"URL"),zt=arguments.length>1?arguments[1]:void 0,Yt=i(Pt),le=E(Ot,{type:"URL"}),te,se;if(zt!==void 0){if(zt instanceof de)te=O(zt);else if(se=he(te={},i(zt)),se)throw TypeError(se)}if(se=he(le,Yt,null,te),se)throw TypeError(se);var Se=le.searchParams=new C,Ee=b(Se);Ee.updateSearchParams(le.query),Ee.updateURL=function(){le.query=String(Se)||null},I||(Ot.href=Oe.call(Ot),Ot.origin=xe.call(Ot),Ot.protocol=Be.call(Ot),Ot.username=pe.call(Ot),Ot.password=hi.call(Ot),Ot.host=fi.call(Ot),Ot.hostname=di.call(Ot),Ot.port=ii.call(Ot),Ot.pathname=gi.call(Ot),Ot.search=Ye.call(Ot),Ot.searchParams=qe.call(Ot),Ot.hash=Xe.call(Ot))},Ae=de.prototype,Oe=function(){var J=O(this),Pt=J.scheme,Ot=J.username,zt=J.password,Yt=J.host,le=J.port,te=J.path,se=J.query,Se=J.fragment,Ee=Pt+":";return Yt!==null?(Ee+="//",ct(J)&&(Ee+=Ot+(zt?":"+zt:"")+"@"),Ee+=gt(Yt),le!==null&&(Ee+=":"+le)):Pt=="file"&&(Ee+="//"),Ee+=J.cannotBeABaseURL?te[0]:te.length?"/"+te.join("/"):"",se!==null&&(Ee+="?"+se),Se!==null&&(Ee+="#"+Se),Ee},xe=function(){var J=O(this),Pt=J.scheme,Ot=J.port;if(Pt=="blob")try{return new de(Pt.path[0]).origin}catch(zt){return"null"}return Pt=="file"||!et(J)?"null":Pt+"://"+gt(J.host)+(Ot!==null?":"+Ot:"")},Be=function(){return O(this).scheme+":"},pe=function(){return O(this).username},hi=function(){return O(this).password},fi=function(){var J=O(this),Pt=J.host,Ot=J.port;return Pt===null?"":Ot===null?gt(Pt):gt(Pt)+":"+Ot},di=function(){var J=O(this).host;return J===null?"":gt(J)},ii=function(){var J=O(this).port;return J===null?"":String(J)},gi=function(){var J=O(this),Pt=J.path;return J.cannotBeABaseURL?Pt[0]:Pt.length?"/"+Pt.join("/"):""},Ye=function(){var J=O(this).query;return J?"?"+J:""},qe=function(){return O(this).searchParams},Xe=function(){var J=O(this).fragment;return J?"#"+J:""},ke=function(J,Pt){return{get:J,set:Pt,configurable:!0,enumerable:!0}};if(I&&P(Ae,{href:ke(Oe,function(J){var Pt=O(this),Ot=i(J),zt=he(Pt,Ot);if(zt)throw TypeError(zt);b(Pt.searchParams).updateSearchParams(Pt.query)}),origin:ke(xe),protocol:ke(Be,function(J){var Pt=O(this);he(Pt,i(J)+":",Jt)}),username:ke(pe,function(J){var Pt=O(this),Ot=u(i(J));if(!ft(Pt)){Pt.username="";for(var zt=0;ztw.length)&&(v=w.length);for(var r=0,l=new Array(v);rr){var l=[r,v];v=l[0],r=l[1]}return J(v,vi(w,r))}function Se(){for(var w={},v=arguments.length,r=new Array(v),l=0;l0&&arguments[0]!==void 0?arguments[0]:"",r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"";if(v.charAt(0)==="."){var l;return U()(l=".".concat(ni).concat(r)).call(l,p()(v).call(v,1))}return U()(w="".concat(ni).concat(r)).call(w,v)}function Dr(w,v){var r=v.originX,l=v.originY,n=w.getPointByOrigin(r,l),h=n.x,S=n.y;w.set({left:h,top:S,originX:r,originY:l}),w.setCoords()}function Or(w){var v,r={};return Zt()(v=xt()(w)).call(v,function(l){r[w[l]]=l}),r}function Xi(w,v){w.customProps=w.customProps||{},G()(w.customProps,v)}function oi(w,v){var r={};return bt()(v)&&(v=[v]),X()(v,function(l){r[l]=w.customProps[l]}),r}function Ar(w){return w.charAt(0).toUpperCase()+p()(w).call(w,1)}function Ci(w,v){return c()(w).call(w,v)>=0}function on(){var w=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};return ve()(w,"type")||kt.COLOR}function Zi(w){var v=St()(w),r=v===void 0?{}:v;return r.source?kt.FILTER:kt.COLOR}function sn(w){return Wt()(w.get("type"),Ut)>=0}function Vi(w){if(Ci(Ut,w))return"Shape";switch(w){case"i-text":return"Text";case"path":case"line":return"Draw";case"activeSelection":return"Group";default:return ln(w)}}function _r(w){var v=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},r=v.useAlpha,l=r===void 0?!0:r,n=v.mode,h=qt.VINTAGE,S=qt.REMOVE_COLOR,T=qt.BLEND_COLOR,k=qt.SEPIA2,A=qt.COLOR_FILTER,R=qt.REMOVE_WHITE,H=qt.BLEND,ot;switch(w){case h:ot=k;break;case S:ot=l?A:R;break;case T:ot=n==="add"?H:n;break;default:ot=w}return ln(ot)}function kr(w){var v=Qt.LOAD_IMAGE;return typeof w=="string"?v===w:v===w.name}function Pr(w){var v,r,l=Qt.FLIP_IMAGE,n=Qt.ROTATE_IMAGE,h=Qt.ADD_TEXT,S=Qt.APPLY_FILTER,T=Qt.REMOVE_FILTER,k=Qt.CHANGE_SHAPE,A=Qt.CHANGE_ICON_COLOR,R=Qt.CHANGE_TEXT_STYLE,H=Qt.CLEAR_OBJECTS,ot=Qt.ADD_IMAGE_OBJECT,lt=Qt.REMOVE_OBJECT,mt=Qt.RESIZE_IMAGE,ut=w.name,pt=w.args,jt;switch(ut){case l:jt={name:ut,detail:pt[1]==="reset"?pt[1]:p()(v=pt[1]).call(v,4)};break;case n:jt={name:ut,detail:pt[2]};break;case S:jt={name:he.APPLY_FILTER,detail:_r(pt[1],pt[2])};break;case T:jt={name:he.REMOVE_FILTER,detail:"Remove"};break;case k:jt={name:he.CHANGE_SHAPE,detail:"Change"};break;case A:jt={name:he.CHANGE_ICON_COLOR,detail:"Change"};break;case R:jt={name:he.CHANGE_TEXT_STYLE,detail:"Change"};break;case lt:jt={name:he.REMOVE_OBJECT,detail:pt[2]};break;case H:jt={name:he.CLEAR_OBJECTS,detail:"All"};break;case ot:jt={name:he.ADD_IMAGE_OBJECT,detail:"Add"};break;case h:jt={name:he.ADD_TEXT};break;case mt:jt={name:he.RESIZE,detail:U()(r="".concat(~~pt[1].width,"x")).call(r,~~pt[1].height)};break;default:jt={name:ut};break}return pt[1]==="mask"&&(jt={name:he.LOAD_MASK_IMAGE,detail:"Apply"}),jt}function Lr(w){return w==="top"?"bottom":w==="left"?"right":w==="right"?"left":"top"}function ln(w){return w.replace(/[a-z]/,function(v){return v.toUpperCase()})}function jr(w){var v=w.left,r=w.top,l=w.width,n=w.height,h=qe.LEFT,S=qe.TOP,T=qe.WIDTH,k=qe.HEIGHT;return v===h&&r===S&&l===T&&n===k}var Nr=Se("UN_IMPLEMENTATION","NO_COMPONENT_NAME"),cn={UN_IMPLEMENTATION:"Should implement a method: ",NO_COMPONENT_NAME:"Should set a component name"},Rr={UN_IMPLEMENTATION:function(v){return cn.UN_IMPLEMENTATION+v},NO_COMPONENT_NAME:function(){return cn.NO_COMPONENT_NAME}},Si={types:G()({},Nr),create:function(v){v=v.toLowerCase();for(var r=Rr[v],l=arguments.length,n=new Array(l>1?l-1:0),h=1;h0}},{key:"setUndoData",value:function(r,l,n){return l&&(r=l),n?l||(l=r):(G()(this.undoData,r),l=null),l}},{key:"setExecuteCallback",value:function(r){return this.executeCallback=r,this}},{key:"setUndoCallback",value:function(r){return this.undoCallback=r,this}}]),w}(),Br=zr,fn={};function Fr(w){var v=fn[w];if(v){for(var r=arguments.length,l=new Array(r>1?r-1:0),n=1;n1&&arguments[1]!==void 0?arguments[1]:!1;this.lock();var h=r.args;return h||(h=[]),r.execute.apply(r,L(h)).then(function(S){return l._isSilent||(l.pushUndoStack(r),l.fire(n?Et.AFTER_REDO:Et.EXECUTE_COMMAND,r)),l.unlock(),te(r.executeCallback)&&r.executeCallback(S),S}).catch(function(S){return l.unlock(),dt().reject(S)})}},{key:"_invokeUndo",value:function(r){var l=this;this.lock();var n=r.args;return n||(n=[]),r.undo.apply(r,L(n)).then(function(h){return l.pushRedoStack(r),l.fire(Et.AFTER_UNDO,r),l.unlock(),te(r.undoCallback)&&r.undoCallback(h),h}).catch(function(h){return l.unlock(),dt().reject(h)})}},{key:"_fireRedoStackChanged",value:function(){this.fire(Et.REDO_STACK_CHANGED,this._redoStack.length)}},{key:"_fireUndoStackChanged",value:function(){this.fire(Et.UNDO_STACK_CHANGED,this._undoStack.length)}},{key:"lock",value:function(){this._isLocked=!0}},{key:"unlock",value:function(){this._isLocked=!1}},{key:"executeSilent",value:function(){var r=this;this._isSilent=!0;for(var l=arguments.length,n=new Array(l),h=0;h
    `)).call(n,k.localize("Load"),`
    `)},Gr=function(w){var v,r,l,n,h,S=w.locale,T=w.biImage,k=w.loadButtonStyle,A=w.downloadButtonStyle,R=w.menuBarPosition;return U()(v=U()(r=U()(l=U()(n=U()(h=`
        `)).call(l,S.localize("Load"),`
        `)},Xr=_(899),We=_.n(Xr),Zr=function(w){var v,r,l,n,h,S,T,k,A,R,H,ot,lt,mt,ut,pt,jt,ie,re,oe,Ht,ge,De,je,Fe,Te,Ke,$e,Le,Di=w.subMenuLabelActive,Oi=w.subMenuLabelNormal,Ai=w.subMenuRangeTitle,_i=w.submenuPartitionVertical,ki=w.submenuPartitionHorizontal,Pi=w.submenuCheckbox,Li=w.submenuRangePointer,ji=w.submenuRangeValue,Ni=w.submenuColorpickerTitle,Ri=w.submenuColorpickerButton,zi=w.submenuRangeBar,Bi=w.submenuRangeSubbar,Fi=w.submenuDisabledRangePointer,Hi=w.submenuDisabledRangeBar,Ui=w.submenuDisabledRangeSubbar,Yi=w.submenuIconSize,Wi=w.menuIconSize,Gi=w.biSize,He=w.menuIconStyle,ti=w.submenuIconStyle;return U()(v=U()(r=U()(l=U()(n=U()(h=U()(S=U()(T=U()(k=U()(A=U()(R=U()(H=U()(ot=U()(lt=U()(mt=U()(ut=U()(pt=U()(jt=U()(ie=U()(re=U()(oe=U()(Ht=U()(ge=U()(De=U()(je=U()(Fe=U()(Te=U()(Ke=U()($e=U()(Le=` .tie-icon-add-button.icon-bubble .tui-image-editor-button[data-icontype="icon-bubble"] label, .tie-icon-add-button.icon-heart .tui-image-editor-button[data-icontype="icon-heart"] label, .tie-icon-add-button.icon-location .tui-image-editor-button[data-icontype="icon-location"] label, .tie-icon-add-button.icon-polygon .tui-image-editor-button[data-icontype="icon-polygon"] label, .tie-icon-add-button.icon-star .tui-image-editor-button[data-icontype="icon-star"] label, .tie-icon-add-button.icon-star-2 .tui-image-editor-button[data-icontype="icon-star-2"] label, .tie-icon-add-button.icon-arrow-3 .tui-image-editor-button[data-icontype="icon-arrow-3"] label, .tie-icon-add-button.icon-arrow-2 .tui-image-editor-button[data-icontype="icon-arrow-2"] label, .tie-icon-add-button.icon-arrow .tui-image-editor-button[data-icontype="icon-arrow"] label, .tie-icon-add-button.icon-bubble .tui-image-editor-button[data-icontype="icon-bubble"] label, .tie-draw-line-select-button.line .tui-image-editor-button.line label, .tie-draw-line-select-button.free .tui-image-editor-button.free label, .tie-flip-button.flipX .tui-image-editor-button.flipX label, .tie-flip-button.flipY .tui-image-editor-button.flipY label, .tie-flip-button.resetFlip .tui-image-editor-button.resetFlip label, .tie-crop-button .tui-image-editor-button.apply.active label, .tie-crop-preset-button .tui-image-editor-button.preset.active label, .tie-resize-button .tui-image-editor-button.apply.active label, .tie-resize-preset-button .tui-image-editor-button.preset.active label, .tie-shape-button.rect .tui-image-editor-button.rect label, .tie-shape-button.circle .tui-image-editor-button.circle label, .tie-shape-button.triangle .tui-image-editor-button.triangle label, .tie-text-effect-button .tui-image-editor-button.active label, .tie-text-align-button.tie-text-align-left .tui-image-editor-button.left label, .tie-text-align-button.tie-text-align-center .tui-image-editor-button.center label, .tie-text-align-button.tie-text-align-right .tui-image-editor-button.right label, .tie-mask-apply.apply.active .tui-image-editor-button.apply label, .tui-image-editor-container .tui-image-editor-submenu .tui-image-editor-button:hover > label, .tui-image-editor-container .tui-image-editor-checkbox label > span { `.concat(Di,` } .tui-image-editor-container .tui-image-editor-submenu .tui-image-editor-button > label, .tui-image-editor-container .tui-image-editor-range-wrap.tui-image-editor-newline.short label, .tui-image-editor-container .tui-image-editor-range-wrap.tui-image-editor-newline.short label > span { `)).call(Le,Oi,` } .tui-image-editor-container .tui-image-editor-range-wrap label > span { `)).call($e,Ai,` } .tui-image-editor-container .tui-image-editor-partition > div { `)).call(Ke,_i,` } .tui-image-editor-container.left .tui-image-editor-submenu .tui-image-editor-partition > div, .tui-image-editor-container.right .tui-image-editor-submenu .tui-image-editor-partition > div { `)).call(Te,ki,` } .tui-image-editor-container .tui-image-editor-checkbox label > span:before { `)).call(Fe,Pi,` } .tui-image-editor-container .tui-image-editor-checkbox label > input:checked + span:before { border: 0; } .tui-image-editor-container .tui-image-editor-virtual-range-pointer { `)).call(je,Li,` } .tui-image-editor-container .tui-image-editor-virtual-range-bar { `)).call(De,zi,` } .tui-image-editor-container .tui-image-editor-virtual-range-subbar { `)).call(ge,Bi,` } .tui-image-editor-container .tui-image-editor-disabled .tui-image-editor-virtual-range-pointer { `)).call(Ht,Fi,` } .tui-image-editor-container .tui-image-editor-disabled .tui-image-editor-virtual-range-subbar { `)).call(oe,Ui,` } .tui-image-editor-container .tui-image-editor-disabled .tui-image-editor-virtual-range-bar { `)).call(re,Hi,` } .tui-image-editor-container .tui-image-editor-range-value { `)).call(ie,ji,` } .tui-image-editor-container .tui-image-editor-submenu .tui-image-editor-button .color-picker-value + label { `)).call(jt,Ni,` } .tui-image-editor-container .tui-image-editor-submenu .tui-image-editor-button .color-picker-value { `)).call(pt,Ri,` } .tui-image-editor-container .svg_ic-menu { `)).call(ut,Wi,` } .tui-image-editor-container .svg_ic-submenu { `)).call(mt,Yi,` } .tui-image-editor-container .tui-image-editor-controls-logo > img, .tui-image-editor-container .tui-image-editor-header-logo > img { `)).call(lt,Gi,` } .tui-image-editor-menu use.normal.use-default, .tui-image-editor-help-menu use.normal.use-default { fill-rule: evenodd; fill: `)).call(ot,He.normal.color,`; stroke: `)).call(H,He.normal.color,`; } .tui-image-editor-menu use.active.use-default, .tui-image-editor-help-menu use.active.use-default { fill-rule: evenodd; fill: `)).call(R,He.active.color,`; stroke: `)).call(A,He.active.color,`; } .tui-image-editor-menu use.hover.use-default, .tui-image-editor-help-menu use.hover.use-default { fill-rule: evenodd; fill: `)).call(k,He.hover.color,`; stroke: `)).call(T,He.hover.color,`; } .tui-image-editor-menu use.disabled.use-default, .tui-image-editor-help-menu use.disabled.use-default { fill-rule: evenodd; fill: `)).call(S,He.disabled.color,`; stroke: `)).call(h,He.disabled.color,`; } .tui-image-editor-submenu use.normal.use-default { fill-rule: evenodd; fill: `)).call(n,ti.normal.color,`; stroke: `)).call(l,ti.normal.color,`; } .tui-image-editor-submenu use.active.use-default { fill-rule: evenodd; fill: `)).call(r,ti.active.color,`; stroke: `)).call(v,ti.active.color,`; } `)},Vr={"common.bi.image":"https://uicdn.toast.com/toastui/img/tui-image-editor-bi.png","common.bisize.width":"251px","common.bisize.height":"21px","common.backgroundImage":"none","common.backgroundColor":"#1e1e1e","common.border":"0px","header.backgroundImage":"none","header.backgroundColor":"transparent","header.border":"0px","loadButton.backgroundColor":"#fff","loadButton.border":"1px solid #ddd","loadButton.color":"#222","loadButton.fontFamily":"'Noto Sans', sans-serif","loadButton.fontSize":"12px","downloadButton.backgroundColor":"#fdba3b","downloadButton.border":"1px solid #fdba3b","downloadButton.color":"#fff","downloadButton.fontFamily":"'Noto Sans', sans-serif","downloadButton.fontSize":"12px","menu.normalIcon.color":"#8a8a8a","menu.activeIcon.color":"#555555","menu.disabledIcon.color":"#434343","menu.hoverIcon.color":"#e9e9e9","submenu.normalIcon.color":"#8a8a8a","submenu.activeIcon.color":"#e9e9e9","menu.iconSize.width":"24px","menu.iconSize.height":"24px","submenu.iconSize.width":"32px","submenu.iconSize.height":"32px","submenu.backgroundColor":"#1e1e1e","submenu.partition.color":"#3c3c3c","submenu.normalLabel.color":"#8a8a8a","submenu.normalLabel.fontWeight":"lighter","submenu.activeLabel.color":"#fff","submenu.activeLabel.fontWeight":"lighter","checkbox.border":"0px","checkbox.backgroundColor":"#fff","range.pointer.color":"#fff","range.bar.color":"#666","range.subbar.color":"#d1d1d1","range.disabledPointer.color":"#414141","range.disabledBar.color":"#282828","range.disabledSubbar.color":"#414141","range.value.color":"#fff","range.value.fontWeight":"lighter","range.value.fontSize":"11px","range.value.border":"1px solid #353535","range.value.backgroundColor":"#151515","range.title.color":"#fff","range.title.fontWeight":"lighter","colorpicker.button.border":"1px solid #1e1e1e","colorpicker.title.color":"#fff"},Jr=_(2534),Qr=function(){function w(v){Y(this,w),this.styles=this._changeToObject(G()({},Vr,v)),mi(this._styleMaker()),this._loadDefaultSvgIcon()}return it(w,[{key:"getStyle",value:function(r){var l=null,n=r.replace(/\..+$/,""),h=this.styles[r];switch(r){case"common.bi":l=this.styles[r].image;break;case"menu.icon":l={active:this.styles["".concat(n,".activeIcon")],normal:this.styles["".concat(n,".normalIcon")],hover:this.styles["".concat(n,".hoverIcon")],disabled:this.styles["".concat(n,".disabledIcon")]};break;case"submenu.icon":l={active:this.styles["".concat(n,".activeIcon")],normal:this.styles["".concat(n,".normalIcon")]};break;case"submenu.label":l={active:this._makeCssText(this.styles["".concat(n,".activeLabel")]),normal:this._makeCssText(this.styles["".concat(n,".normalLabel")])};break;case"submenu.partition":l={vertical:this._makeCssText(G()({},h,{borderLeft:"1px solid ".concat(h.color)})),horizontal:this._makeCssText(G()({},h,{borderBottom:"1px solid ".concat(h.color)}))};break;case"range.disabledPointer":case"range.disabledBar":case"range.disabledSubbar":case"range.pointer":case"range.bar":case"range.subbar":h.backgroundColor=h.color,l=this._makeCssText(h);break;default:l=this._makeCssText(h);break}return l}},{key:"_styleMaker",value:function(){var r=this.getStyle("submenu.label"),l=this.getStyle("submenu.partition");return Zr({subMenuLabelActive:r.active,subMenuLabelNormal:r.normal,submenuPartitionVertical:l.vertical,submenuPartitionHorizontal:l.horizontal,biSize:this.getStyle("common.bisize"),subMenuRangeTitle:this.getStyle("range.title"),submenuRangePointer:this.getStyle("range.pointer"),submenuRangeBar:this.getStyle("range.bar"),submenuRangeSubbar:this.getStyle("range.subbar"),submenuDisabledRangePointer:this.getStyle("range.disabledPointer"),submenuDisabledRangeBar:this.getStyle("range.disabledBar"),submenuDisabledRangeSubbar:this.getStyle("range.disabledSubbar"),submenuRangeValue:this.getStyle("range.value"),submenuColorpickerTitle:this.getStyle("colorpicker.title"),submenuColorpickerButton:this.getStyle("colorpicker.button"),submenuCheckbox:this.getStyle("checkbox"),menuIconSize:this.getStyle("menu.iconSize"),submenuIconSize:this.getStyle("submenu.iconSize"),menuIconStyle:this.getStyle("menu.icon"),submenuIconStyle:this.getStyle("submenu.icon")})}},{key:"_changeToObject",value:function(r){var l={};return X()(r,function(n,h){var S=h.match(/^(.+)\.([a-z]+)$/i),T=ct(S,3),k=T[1],A=T[2];l[k]||(l[k]={}),l[k][A]=n}),l}},{key:"_makeCssText",value:function(r){var l=this,n=[];return X()(r,function(h,S){var T,k;c()(T=["backgroundImage"]).call(T,S)>-1&&h!=="none"&&(h="url(".concat(h,")")),n.push(U()(k="".concat(l._toUnderScore(S),": ")).call(k,h))}),n.join(";")}},{key:"_toUnderScore",value:function(r){return r.replace(/([A-Z])/g,function(l,n){return"-".concat(n.toLowerCase())})}},{key:"_loadDefaultSvgIcon",value:function(){if(!document.getElementById("tui-image-editor-svg-default-icons")){var r=new DOMParser,l=Jr.replace(/data:image\/svg\+xml;base64,/,""),n=r.parseFromString(atob(l),"text/xml");document.body.appendChild(n.documentElement)}}},{key:"_makeIconClassName",value:function(r,l){var n=l?this.getStyle("submenu.icon"):this.getStyle("menu.icon"),h=n[r],S=h.path,T=h.name;return S&&T?r:"".concat(r," use-default")}},{key:"_makeSvgIconPrefix",value:function(r,l){var n,h=l?this.getStyle("submenu.icon"):this.getStyle("menu.icon"),S=h[r],T=S.path,k=S.name;return T&&k?U()(n="".concat(T,"#")).call(n,k,"-"):"#"}},{key:"_makeSvgItem",value:function(r,l,n){var h=this;return We()(r).call(r,function(S){var T,k,A=h._makeSvgIconPrefix(S,n),R=h._toUnderScore(l),H=h._makeIconClassName(S,n);return U()(T=U()(k='')}).join("")}},{key:"makeMenSvgIconSet",value:function(r,l){var n,h=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1;return U()(n='')).call(n,this._makeSvgItem(r,l,h),"")}}]),w}(),Kr=Qr,$r=_(9146),At=_.n($r),qr=_(6623),gn=_(4230);function Ji(w,v){return Ji=gn||function(l,n){return l.__proto__=n,l},Ji(w,v)}function me(w,v){if(typeof v!="function"&&v!==null)throw new TypeError("Super expression must either be null or a function");w.prototype=qr(v&&v.prototype,{constructor:{value:w,writable:!0,configurable:!0}}),v&&Ji(w,v)}var ta=_(3742);function xi(w){return typeof m=="function"&&typeof ta=="symbol"?xi=function(r){return typeof r}:xi=function(r){return r&&typeof m=="function"&&r.constructor===m&&r!==m.prototype?"symbol":typeof r},xi(w)}function fe(w){if(w===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return w}function ye(w,v){if(v&&(xi(v)==="object"||typeof v=="function"))return v;if(v!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return fe(w)}var vn=_(9856);function ee(w){return ee=gn?vn:function(r){return r.__proto__||vn(r)},ee(w)}var ea=_(6092),si=_.n(ea),ia=_(4858),na=_.n(ia),ra=["#000000","#2a2a2a","#545454","#7e7e7e","#a8a8a8","#d2d2d2","#ffffff","","#ff4040","#ff6518","#ffbb3b","#03bd9e","#00a9ff","#515ce6","#9e5fff","#ff5583"],pn=function(){function w(v,r){var l=r.defaultColor,n=l===void 0?"#7e7e7e":l,h=r.toggleDirection,S=h===void 0?"up":h,T=r.usageStatistics;Y(this,w),this.colorpickerElement=v,this.usageStatistics=T,this._show=!1,this._colorpickerElement=v,this._toggleDirection=S,this._makePickerButtonElement(n),this._makePickerLayerElement(v,v.getAttribute("title")),this._color=n,this.picker=na().create({container:this.pickerElement,preset:ra,color:n,usageStatistics:this.usageStatistics}),this._addEvent()}return it(w,[{key:"destroy",value:function(){var r=this;this._removeEvent(),this.picker.destroy(),this.colorpickerElement.innerHTML="",X()(this,function(l,n){r[n]=null})}},{key:"color",get:function(){return this._color},set:function(r){this._color=r,this._changeColorElement(r)}},{key:"_changeColorElement",value:function(r){r?(this.colorElement.classList.remove("transparent"),this.colorElement.style.backgroundColor=r):(this.colorElement.style.backgroundColor="#fff",this.colorElement.classList.add("transparent"))}},{key:"_makePickerButtonElement",value:function(r){this.colorpickerElement.classList.add("tui-image-editor-button"),this.colorElement=document.createElement("div"),this.colorElement.className="color-picker-value",r?this.colorElement.style.backgroundColor=r:this.colorElement.classList.add("transparent")}},{key:"_makePickerLayerElement",value:function(r,l){var n=document.createElement("label"),h=document.createElement("div");this.pickerControl=document.createElement("div"),this.pickerControl.className="color-picker-control",this.pickerElement=document.createElement("div"),this.pickerElement.className="color-picker",n.innerHTML=l,h.className="triangle",this.pickerControl.appendChild(this.pickerElement),this.pickerControl.appendChild(h),r.appendChild(this.pickerControl),r.appendChild(this.colorElement),r.appendChild(n)}},{key:"_addEvent",value:function(){var r=this,l;this.picker.on("selectColor",function(n){r._changeColorElement(n.color),r._color=n.color,r.fire("change",n.color)}),this.eventHandler={pickerToggle:K()(l=this._pickerToggleEventHandler).call(l,this),pickerHide:function(){return r.hide()}},this.colorpickerElement.addEventListener("click",this.eventHandler.pickerToggle),document.body.addEventListener("click",this.eventHandler.pickerHide)}},{key:"_removeEvent",value:function(){this.colorpickerElement.removeEventListener("click",this.eventHandler.pickerToggle),document.body.removeEventListener("click",this.eventHandler.pickerHide),this.picker.off()}},{key:"_pickerToggleEventHandler",value:function(r){var l=r.target,n=l&&this._isElementInColorPickerControl(l);(!n||n&&this._isPaletteButton(l))&&(this._show=!this._show,this.pickerControl.style.display=this._show?"block":"none",this._setPickerControlPosition(),this.fire("changeShow",this)),r.stopPropagation()}},{key:"_isPaletteButton",value:function(r){return r.className==="tui-colorpicker-palette-button"}},{key:"_isElementInColorPickerControl",value:function(r){for(var l=r;l!==document.body&&l;){if(l===this.pickerControl)return!0;l=l.parentNode}return!1}},{key:"hide",value:function(){this._show=!1,this.pickerControl.style.display="none"}},{key:"_setPickerControlPosition",value:function(){var r=this.pickerControl.style,l=this._colorpickerElement.clientWidth/2+2,n=this.pickerControl.offsetWidth/2-l,h=(this.pickerControl.offsetHeight+10)*-1;this._toggleDirection==="down"&&(h=30),r.top="".concat(h,"px"),r.left="-".concat(n,"px")}}]),w}();gt().mixin(pn);var Je=pn,aa=/(-?)([0-9]*)[^0-9]*([0-9]*)/g,mn=function(){function w(v){var r,l,n,h,S,T,k,A=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};Y(this,w),this._value=A.value||0,this.rangeElement=v.slider,this.rangeInputElement=v.input,this._drawRangeElement(),this.rangeWidth=this._getRangeWidth(),this._min=A.min||0,this._max=A.max||100,this._useDecimal=A.useDecimal,this._absMax=this._min*-1+this._max,this.realTimeEvent=A.realTimeEvent||!1,this._userInputTimer=null,this.eventHandler={startChangingSlide:K()(r=this._startChangingSlide).call(r,this),stopChangingSlide:K()(l=this._stopChangingSlide).call(l,this),changeSlide:K()(n=this._changeSlide).call(n,this),changeSlideFinally:K()(h=this._changeSlideFinally).call(h,this),changeInput:K()(S=this._changeInput).call(S,this),changeInputFinally:K()(T=this._changeValueWithInput).call(T,this,!0),changeInputWithArrow:K()(k=this._changeValueWithInputKeyEvent).call(k,this)},this._addClickEvent(),this._addDragEvent(),this._addInputEvent(),this.value=A.value,this.trigger("change")}return it(w,[{key:"destroy",value:function(){var r=this;this._removeClickEvent(),this._removeDragEvent(),this._removeInputEvent(),this.rangeElement.innerHTML="",X()(this,function(l,n){r[n]=null})}},{key:"max",get:function(){return this._max},set:function(r){this._max=r,this._absMax=this._min*-1+this._max,this.value=this._value}},{key:"min",get:function(){return this._min},set:function(r){this._min=r,this.max=this._max}},{key:"value",get:function(){return this._value},set:function(r){r=this._useDecimal?r:Rt(r);var l=r-this._min,n=l*this.rangeWidth/this._absMax;this.rangeWidththis._max;if(!T){var k=se(S,this._min,this.max);this.value=k,this.fire("change",k,!1)}}}},{key:"_valueUpDownForKeyEvent",value:function(r,l){var n=this._useDecimal?.1:1;return l===xe.ARROW_UP?r+=n:l===xe.ARROW_DOWN&&(r-=n),r}},{key:"_changeInput",value:function(r){var l=this;clearTimeout(this._userInputTimer);var n=r.keyCode;if(nxe.DIGIT_9){r.preventDefault();return}this._userInputTimer=t()(function(){l._inputSetValue(r.target.value)},350)}},{key:"_inputSetValue",value:function(r){var l=this._useDecimal?Number(r):Rt(r);l=se(l,this._min,this.max),this.value=l,this.fire("change",l,!0)}},{key:"_changeValueWithInput",value:function(r,l){var n,h=l.keyCode,S=l.target;if(!(c()(n=[xe.ARROW_UP,xe.ARROW_DOWN]).call(n,h)>=0)){var T=this._filterForInputText(S.value),k=!T||isNaN(T);S.value=T,k||this._inputSetValue(T)}}},{key:"_addClickEvent",value:function(){this.rangeElement.addEventListener("click",this.eventHandler.changeSlideFinally)}},{key:"_removeClickEvent",value:function(){this.rangeElement.removeEventListener("click",this.eventHandler.changeSlideFinally)}},{key:"_addDragEvent",value:function(){this.pointer.addEventListener("mousedown",this.eventHandler.startChangingSlide)}},{key:"_removeDragEvent",value:function(){this.pointer.removeEventListener("mousedown",this.eventHandler.startChangingSlide)}},{key:"_changeSlide",value:function(r){var l=r.screenX,n=l-this.firstPosition,h=this.firstLeft+n;h=h>this.rangeWidth?this.rangeWidth:h,h=h<0?0:h,this.pointer.style.left="".concat(h,"px"),this.subbar.style.right="".concat(this.rangeWidth-h,"px");var S=h/this.rangeWidth,T=this._absMax*S+this._min,k=this._useDecimal?T:Rt(T),A=this.value!==k;A&&(this.value=k,this.realTimeEvent&&this.fire("change",this._value,!1))}},{key:"_changeSlideFinally",value:function(r){if(r.stopPropagation(),r.target.className==="tui-image-editor-range"){var l=r.offsetX,n=l/this.rangeWidth,h=this._absMax*n+this._min;this.pointer.style.left="".concat(n*this.rangeWidth,"px"),this.subbar.style.right="".concat((1-n)*this.rangeWidth,"px"),this.value=h,this.fire("change",h,!0)}}},{key:"_startChangingSlide",value:function(r){this.firstPosition=r.screenX,this.firstLeft=Rt(this.pointer.style.left)||0,document.addEventListener("mousemove",this.eventHandler.changeSlide),document.addEventListener("mouseup",this.eventHandler.stopChangingSlide)}},{key:"_stopChangingSlide",value:function(){this.fire("change",this._value,!0),document.removeEventListener("mousemove",this.eventHandler.changeSlide),document.removeEventListener("mouseup",this.eventHandler.stopChangingSlide)}},{key:"_filterForInputText",value:function(r){return r.replace(aa,"$1$2$3")}}]),w}();gt().mixin(mn);var Re=mn,yn=function(){function w(v,r){var l=r.locale,n=r.name,h=r.makeSvgIcon,S=r.menuBarPosition,T=r.templateHtml,k=r.usageStatistics;Y(this,w),this.subMenuElement=v,this.menuBarPosition=S,this.toggleDirection=S==="top"?"down":"up",this.colorPickerControls=[],this.usageStatistics=k,this.eventHandler={},this._makeSubMenuElement({locale:l,name:n,makeSvgIcon:h,templateHtml:T})}return it(w,[{key:"selector",value:function(r){return this.subMenuElement.querySelector(r)}},{key:"colorPickerChangeShow",value:function(r){var l;Zt()(l=this.colorPickerControls).call(l,function(n){r!==n&&n.hide()})}},{key:"getButtonType",value:function(r,l){return r.className.match(RegExp("(".concat(l.join("|"),")")))[0]}},{key:"changeClass",value:function(r,l,n){r.classList.remove(l),r.classList.add(n)}},{key:"changeStandbyMode",value:function(){}},{key:"changeStartMode",value:function(){}},{key:"_makeSubMenuElement",value:function(r){var l=r.locale,n=r.name,h=r.iconStyle,S=r.makeSvgIcon,T=r.templateHtml,k=document.createElement("div");k.className="tui-image-editor-menu-".concat(n),k.innerHTML=T({locale:l,iconStyle:h,makeSvgIcon:S}),this.subMenuElement.appendChild(k)}},{key:"_onStartEditingInputBox",value:function(){this.fire(Et.INPUT_BOX_EDITING_STARTED)}},{key:"_onStopEditingInputBox",value:function(){this.fire(Et.INPUT_BOX_EDITING_STOPPED)}}]),w}();gt().mixin(yn);var Ge=yn,oa=function(w){var v,r,l,n,h,S,T,k,A=w.locale,R=w.makeSvgIcon;return U()(v=U()(r=U()(l=U()(n=U()(h=U()(S=U()(T=U()(k=`
        • `.concat(R(["normal","active"],"shape-rectangle",!0),`
          `)).call(T,R(["normal","active"],"shape-circle",!0),`
          `)).call(h,R(["normal","active"],"shape-triangle",!0),`
        `)};function sa(w){var v=la();return function(){var l=ee(w),n;if(v){var h=ee(this).constructor;n=At()(l,arguments,h)}else n=l.apply(this,arguments);return ye(this,n)}}function la(){if(typeof Reflect=="undefined"||!At()||At().sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(At()(Boolean,[],function(){})),!0}catch(w){return!1}}var ca={stroke:"#ffbb3b",fill:"",strokeWidth:3},ua=function(w){me(r,w);var v=sa(r);function r(l,n){var h,S=n.locale,T=n.makeSvgIcon,k=n.menuBarPosition,A=n.usageStatistics;return Y(this,r),h=v.call(this,l,{locale:S,name:"shape",makeSvgIcon:T,menuBarPosition:k,templateHtml:oa,usageStatistics:A}),h.type=null,h.options=ca,h._els={shapeSelectButton:h.selector(".tie-shape-button"),shapeColorButton:h.selector(".tie-shape-color-button"),strokeRange:new Re({slider:h.selector(".tie-stroke-range"),input:h.selector(".tie-stroke-range-value")},ii),fillColorpicker:new Je(h.selector(".tie-color-fill"),{defaultColor:"",toggleDirection:h.toggleDirection,usageStatistics:h.usageStatistics}),strokeColorpicker:new Je(h.selector(".tie-color-stroke"),{defaultColor:"#ffbb3b",toggleDirection:h.toggleDirection,usageStatistics:h.usageStatistics})},h.colorPickerControls.push(h._els.fillColorpicker),h.colorPickerControls.push(h._els.strokeColorpicker),h.colorPickerInputBoxes=[],h.colorPickerInputBoxes.push(h._els.fillColorpicker.colorpickerElement.querySelector(Ce.COLOR_PICKER_INPUT_BOX)),h.colorPickerInputBoxes.push(h._els.strokeColorpicker.colorpickerElement.querySelector(Ce.COLOR_PICKER_INPUT_BOX)),h}return it(r,[{key:"destroy",value:function(){this._removeEvent(),this._els.strokeRange.destroy(),this._els.fillColorpicker.destroy(),this._els.strokeColorpicker.destroy(),Ne(this)}},{key:"addEvent",value:function(n){var h,S,T,k,A,R,H=this;this.eventHandler.shapeTypeSelected=K()(h=this._changeShapeHandler).call(h,this),this.actions=n,this._els.shapeSelectButton.addEventListener("click",this.eventHandler.shapeTypeSelected),this._els.strokeRange.on("change",K()(S=this._changeStrokeRangeHandler).call(S,this)),this._els.fillColorpicker.on("change",K()(T=this._changeFillColorHandler).call(T,this)),this._els.strokeColorpicker.on("change",K()(k=this._changeStrokeColorHandler).call(k,this)),this._els.fillColorpicker.on("changeShow",K()(A=this.colorPickerChangeShow).call(A,this)),this._els.strokeColorpicker.on("changeShow",K()(R=this.colorPickerChangeShow).call(R,this)),si()(this.colorPickerInputBoxes,function(ot){var lt,mt;ot.addEventListener(Et.FOCUS,K()(lt=H._onStartEditingInputBox).call(lt,H)),ot.addEventListener(Et.BLUR,K()(mt=H._onStopEditingInputBox).call(mt,H))},this)}},{key:"_removeEvent",value:function(){var n=this;this._els.shapeSelectButton.removeEventListener("click",this.eventHandler.shapeTypeSelected),this._els.strokeRange.off(),this._els.fillColorpicker.off(),this._els.strokeColorpicker.off(),si()(this.colorPickerInputBoxes,function(h){var S,T;h.removeEventListener(Et.FOCUS,K()(S=n._onStartEditingInputBox).call(S,n)),h.removeEventListener(Et.BLUR,K()(T=n._onStopEditingInputBox).call(T,n))},this)}},{key:"setShapeStatus",value:function(n){var h=n.strokeWidth,S=n.strokeColor,T=n.fillColor;this._els.strokeRange.value=h,this._els.strokeColorpicker.color=S,this._els.fillColorpicker.color=T,this.options.stroke=S,this.options.fill=T,this.options.strokeWidth=h,this.actions.setDrawingShape(this.type,{strokeWidth:h})}},{key:"changeStartMode",value:function(){this.actions.stopDrawingMode()}},{key:"changeStandbyMode",value:function(){this.type=null,this.actions.changeSelectableAll(!0),this._els.shapeSelectButton.classList.remove("circle"),this._els.shapeSelectButton.classList.remove("triangle"),this._els.shapeSelectButton.classList.remove("rect")}},{key:"setMaxStrokeValue",value:function(n){var h=n;h<=0&&(h=ii.max),this._els.strokeRange.max=h}},{key:"setStrokeValue",value:function(n){this._els.strokeRange.value=n,this._els.strokeRange.trigger("change")}},{key:"getStrokeValue",value:function(){return this._els.strokeRange.value}},{key:"_changeShapeHandler",value:function(n){var h=n.target.closest(".tui-image-editor-button");if(h){this.actions.stopDrawingMode(),this.actions.discardSelection();var S=this.getButtonType(h,["circle","triangle","rect"]);if(this.type===S){this.changeStandbyMode();return}this.changeStandbyMode(),this.type=S,n.currentTarget.classList.add(S),this.actions.changeSelectableAll(!1),this.actions.modeChange("shape")}}},{key:"_changeStrokeRangeHandler",value:function(n,h){this.options.strokeWidth=Rt(n),this.actions.changeShape({strokeWidth:n},!h),this.actions.setDrawingShape(this.type,this.options)}},{key:"_changeFillColorHandler",value:function(n){n=n||"transparent",this.options.fill=n,this.actions.changeShape({fill:n})}},{key:"_changeStrokeColorHandler",value:function(n){n=n||"transparent",this.options.stroke=n,this.actions.changeShape({stroke:n})}}]),r}(Ge),ha=ua,fa=function(w){var v,r,l,n,h,S,T,k,A,R,H,ot,lt,mt,ut,pt,jt,ie=w.locale,re=w.makeSvgIcon;return U()(v=U()(r=U()(l=U()(n=U()(h=U()(S=U()(T=U()(k=U()(A=U()(R=U()(H=U()(ot=U()(lt=U()(mt=U()(ut=U()(pt=U()(jt=`
        • `.concat(re(["normal","active"],"shape-rectangle",!0),`
          `)).call(pt,re(["normal","active"],"crop",!0),`
          `)).call(mt,re(["normal","active"],"crop",!0),`
          `)).call(ot,re(["normal","active"],"crop",!0),`
          `)).call(R,re(["normal","active"],"crop",!0),`
          `)).call(k,re(["normal","active"],"crop",!0),`
          `)).call(S,re(["normal","active"],"crop",!0),`
        • `)).call(n,re(["normal","active"],"apply"),`
          `)).call(r,re(["normal","active"],"cancel"),`
        `)};function da(w){var v=ga();return function(){var l=ee(w),n;if(v){var h=ee(this).constructor;n=At()(l,arguments,h)}else n=l.apply(this,arguments);return ye(this,n)}}function ga(){if(typeof Reflect=="undefined"||!At()||At().sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(At()(Boolean,[],function(){})),!0}catch(w){return!1}}var va=function(w){me(r,w);var v=da(r);function r(l,n){var h,S=n.locale,T=n.makeSvgIcon,k=n.menuBarPosition,A=n.usageStatistics;return Y(this,r),h=v.call(this,l,{locale:S,name:"crop",makeSvgIcon:T,menuBarPosition:k,templateHtml:fa,usageStatistics:A}),h.status="active",h._els={apply:h.selector(".tie-crop-button .apply"),cancel:h.selector(".tie-crop-button .cancel"),preset:h.selector(".tie-crop-preset-button")},h.defaultPresetButton=h._els.preset.querySelector(".preset-none"),h}return it(r,[{key:"destroy",value:function(){this._removeEvent(),Ne(this)}},{key:"addEvent",value:function(n){var h,S,T,k=K()(h=this._applyEventHandler).call(h,this),A=K()(S=this._cancelEventHandler).call(S,this),R=K()(T=this._cropzonePresetEventHandler).call(T,this);this.eventHandler={apply:k,cancel:A,cropzonePreset:R},this.actions=n,this._els.apply.addEventListener("click",k),this._els.cancel.addEventListener("click",A),this._els.preset.addEventListener("click",R)}},{key:"_removeEvent",value:function(){this._els.apply.removeEventListener("click",this.eventHandler.apply),this._els.cancel.removeEventListener("click",this.eventHandler.cancel),this._els.preset.removeEventListener("click",this.eventHandler.cropzonePreset)}},{key:"_applyEventHandler",value:function(){this.actions.crop(),this._els.apply.classList.remove("active")}},{key:"_cancelEventHandler",value:function(){this.actions.cancel(),this._els.apply.classList.remove("active")}},{key:"_cropzonePresetEventHandler",value:function(n){var h=n.target.closest(".tui-image-editor-button.preset");if(h){var S=h.className.match(/preset-[^\s]+/),T=ct(S,1),k=T[0];this._setPresetButtonActive(h),this.actions.preset(k)}}},{key:"changeStartMode",value:function(){this.actions.modeChange("crop")}},{key:"changeStandbyMode",value:function(){this.actions.stopDrawingMode(),this._setPresetButtonActive()}},{key:"changeApplyButtonStatus",value:function(n){n?this._els.apply.classList.add("active"):this._els.apply.classList.remove("active")}},{key:"_setPresetButtonActive",value:function(){var n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:this.defaultPresetButton;X()(this._els.preset.querySelectorAll(".preset"),function(h){h.classList.remove("active")}),n&&n.classList.add("active")}}]),r}(Ge),pa=va,ma=function(w){var v,r,l,n,h,S,T=w.locale,k=w.makeSvgIcon;return U()(v=U()(r=U()(l=U()(n=U()(h=U()(S=`
        • `)).call(n,k(["normal","active"],"apply"),`
          `)).call(r,k(["normal","active"],"cancel"),`
        `)};function ya(w){var v=Ca();return function(){var l=ee(w),n;if(v){var h=ee(this).constructor;n=At()(l,arguments,h)}else n=l.apply(this,arguments);return ye(this,n)}}function Ca(){if(typeof Reflect=="undefined"||!At()||At().sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(At()(Boolean,[],function(){})),!0}catch(w){return!1}}var Sa=function(w){me(r,w);var v=ya(r);function r(l,n){var h,S=n.locale,T=n.makeSvgIcon,k=n.menuBarPosition,A=n.usageStatistics;return Y(this,r),h=v.call(this,l,{locale:S,name:"resize",makeSvgIcon:T,menuBarPosition:k,templateHtml:ma,usageStatistics:A}),h.status="active",h._lockState=!1,h._originalDimensions=null,h._els={widthRange:new Re({slider:h.selector(".tie-width-range"),input:h.selector(".tie-width-range-value")},Xe),heightRange:new Re({slider:h.selector(".tie-height-range"),input:h.selector(".tie-height-range-value")},Xe),lockAspectRatio:h.selector(".tie-lock-aspect-ratio"),apply:h.selector(".tie-resize-button .apply"),cancel:h.selector(".tie-resize-button .cancel")},h}return it(r,[{key:"changeStartMode",value:function(){this.actions.modeChange("resize");var n=this.actions.getCurrentDimensions();this._originalDimensions=n,this.setWidthValue(n.width),this.setHeightValue(n.height)}},{key:"changeStandbyMode",value:function(){this.actions.stopDrawingMode(),this.actions.reset(!0)}},{key:"setLimit",value:function(n){this._els.widthRange.min=this.calcMinValue(n.minWidth),this._els.heightRange.min=this.calcMinValue(n.minHeight),this._els.widthRange.max=this.calcMaxValue(n.maxWidth),this._els.heightRange.max=this.calcMaxValue(n.maxHeight)}},{key:"calcMaxValue",value:function(n){return n<=0&&(n=Xe.max),n}},{key:"calcMinValue",value:function(n){return n<=0&&(n=Xe.min),n}},{key:"setWidthValue",value:function(n){var h=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;this._els.widthRange.value=n,h&&this._els.widthRange.trigger("change")}},{key:"setHeightValue",value:function(n){var h=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;this._els.heightRange.value=n,h&&this._els.heightRange.trigger("change")}},{key:"destroy",value:function(){this._removeEvent(),Ne(this)}},{key:"addEvent",value:function(n){var h,S,T,k,A;this._els.widthRange.on("change",K()(h=this._changeWidthRangeHandler).call(h,this)),this._els.heightRange.on("change",K()(S=this._changeHeightRangeHandler).call(S,this)),this._els.lockAspectRatio.addEventListener("change",K()(T=this._changeLockAspectRatio).call(T,this));var R=K()(k=this._applyEventHandler).call(k,this),H=K()(A=this._cancelEventHandler).call(A,this);this.eventHandler={apply:R,cancel:H},this.actions=n,this._els.apply.addEventListener("click",R),this._els.cancel.addEventListener("click",H)}},{key:"_changeWidthRangeHandler",value:function(n){this.actions.preview("width",Rt(n),this._lockState)}},{key:"_changeHeightRangeHandler",value:function(n){this.actions.preview("height",Rt(n),this._lockState)}},{key:"_changeLockAspectRatio",value:function(n){this._lockState=n.target.checked,this.actions.lockAspectRatio(this._lockState,Xe.min,Xe.max)}},{key:"_removeEvent",value:function(){this._els.apply.removeEventListener("click",this.eventHandler.apply),this._els.cancel.removeEventListener("click",this.eventHandler.cancel)}},{key:"_applyEventHandler",value:function(){this.actions.resize(),this._els.apply.classList.remove("active")}},{key:"_cancelEventHandler",value:function(){this.actions.reset(),this._els.cancel.classList.remove("active")}},{key:"changeApplyButtonStatus",value:function(n){n?this._els.apply.classList.add("active"):this._els.apply.classList.remove("active")}}]),r}(Ge),xa=Sa,Ia=function(w){var v,r,l,n,h,S=w.locale,T=w.makeSvgIcon;return U()(v=U()(r=U()(l=U()(n=U()(h=`
        • `.concat(T(["normal","active"],"flip-x",!0),`
          `)).call(n,T(["normal","active"],"flip-y",!0),`
        • `)).call(r,T(["normal","active"],"flip-reset",!0),`
        `)};function ba(w){var v=Ma();return function(){var l=ee(w),n;if(v){var h=ee(this).constructor;n=At()(l,arguments,h)}else n=l.apply(this,arguments);return ye(this,n)}}function Ma(){if(typeof Reflect=="undefined"||!At()||At().sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(At()(Boolean,[],function(){})),!0}catch(w){return!1}}var Ta=function(w){me(r,w);var v=ba(r);function r(l,n){var h,S=n.locale,T=n.makeSvgIcon,k=n.menuBarPosition,A=n.usageStatistics;return Y(this,r),h=v.call(this,l,{locale:S,name:"flip",makeSvgIcon:T,menuBarPosition:k,templateHtml:Ia,usageStatistics:A}),h.flipStatus=!1,h._els={flipButton:h.selector(".tie-flip-button")},h}return it(r,[{key:"destroy",value:function(){this._removeEvent(),Ne(this)}},{key:"addEvent",value:function(n){var h;this.eventHandler.changeFlip=K()(h=this._changeFlip).call(h,this),this._actions=n,this._els.flipButton.addEventListener("click",this.eventHandler.changeFlip)}},{key:"_removeEvent",value:function(){this._els.flipButton.removeEventListener("click",this.eventHandler.changeFlip)}},{key:"_changeFlip",value:function(n){var h=this,S=n.target.closest(".tui-image-editor-button");if(S){var T=this.getButtonType(S,["flipX","flipY","resetFlip"]);if(!this.flipStatus&&T==="resetFlip")return;this._actions.flip(T).then(function(k){var A=h._els.flipButton.classList;h.flipStatus=!1,A.remove("resetFlip"),X()(["flipX","flipY"],function(R){A.remove(R),k[R]&&(A.add(R),A.add("resetFlip"),h.flipStatus=!0)})})}}}]),r}(Ge),Ea=Ta,wa=function(w){var v,r,l=w.locale,n=w.makeSvgIcon;return U()(v=U()(r=`
        • `.concat(n(["normal","active"],"rotate-clockwise",!0),`
          `)).call(r,n(["normal","active"],"rotate-counterclockwise",!0),`
        `)};function Da(w){var v=Oa();return function(){var l=ee(w),n;if(v){var h=ee(this).constructor;n=At()(l,arguments,h)}else n=l.apply(this,arguments);return ye(this,n)}}function Oa(){if(typeof Reflect=="undefined"||!At()||At().sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(At()(Boolean,[],function(){})),!0}catch(w){return!1}}var Aa=30,_a=-30,ka=function(w){me(r,w);var v=Da(r);function r(l,n){var h,S=n.locale,T=n.makeSvgIcon,k=n.menuBarPosition,A=n.usageStatistics;return Y(this,r),h=v.call(this,l,{locale:S,name:"rotate",makeSvgIcon:T,menuBarPosition:k,templateHtml:wa,usageStatistics:A}),h._value=0,h._els={rotateButton:h.selector(".tie-rotate-button"),rotateRange:new Re({slider:h.selector(".tie-rotate-range"),input:h.selector(".tie-rotate-range-value")},fi)},h}return it(r,[{key:"destroy",value:function(){this._removeEvent(),this._els.rotateRange.destroy(),Ne(this)}},{key:"setRangeBarAngle",value:function(n,h){var S=h;n==="rotate"&&(S=Ct()(this._els.rotateRange.value,10)+h),this._setRangeBarRatio(S)}},{key:"_setRangeBarRatio",value:function(n){this._els.rotateRange.value=n}},{key:"addEvent",value:function(n){var h,S;this.eventHandler.rotationAngleChanged=K()(h=this._changeRotateForButton).call(h,this),this.actions=n,this._els.rotateButton.addEventListener("click",this.eventHandler.rotationAngleChanged),this._els.rotateRange.on("change",K()(S=this._changeRotateForRange).call(S,this))}},{key:"_removeEvent",value:function(){this._els.rotateButton.removeEventListener("click",this.eventHandler.rotationAngleChanged),this._els.rotateRange.off()}},{key:"_changeRotateForRange",value:function(n,h){var S=Rt(n);this.actions.setAngle(S,!h),this._value=S}},{key:"_changeRotateForButton",value:function(n){var h=n.target.closest(".tui-image-editor-button"),S=this._els.rotateRange.value;if(h){var T=this.getButtonType(h,["counterclockwise","clockwise"]),k={clockwise:Aa,counterclockwise:_a}[T],A=Ct()(S,10)+k,R=A>=-360&&A<=360;R&&this.actions.rotate(k)}}}]),r}(Ge),Pa=ka,La=function(w){var v,r,l,n,h,S,T,k,A,R,H,ot,lt,mt=w.locale,ut=w.makeSvgIcon;return U()(v=U()(r=U()(l=U()(n=U()(h=U()(S=U()(T=U()(k=U()(A=U()(R=U()(H=U()(ot=U()(lt=`
        • `.concat(ut(["normal","active"],"text-bold",!0),`
          `)).call(ot,ut(["normal","active"],"text-italic",!0),`
          `)).call(R,ut(["normal","active"],"text-underline",!0),`
        • `)).call(k,ut(["normal","active"],"text-align-left",!0),`
          `)).call(S,ut(["normal","active"],"text-align-center",!0),`
          `)).call(n,ut(["normal","active"],"text-align-right",!0),`
        `)};function ja(w){var v=Na();return function(){var l=ee(w),n;if(v){var h=ee(this).constructor;n=At()(l,arguments,h)}else n=l.apply(this,arguments);return ye(this,n)}}function Na(){if(typeof Reflect=="undefined"||!At()||At().sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(At()(Boolean,[],function(){})),!0}catch(w){return!1}}var Ra=function(w){me(r,w);var v=ja(r);function r(l,n){var h,S=n.locale,T=n.makeSvgIcon,k=n.menuBarPosition,A=n.usageStatistics;return Y(this,r),h=v.call(this,l,{locale:S,name:"text",makeSvgIcon:T,menuBarPosition:k,templateHtml:La,usageStatistics:A}),h.effect={bold:!1,italic:!1,underline:!1},h.align="tie-text-align-left",h._els={textEffectButton:h.selector(".tie-text-effect-button"),textAlignButton:h.selector(".tie-text-align-button"),textColorpicker:new Je(h.selector(".tie-text-color"),{defaultColor:"#ffbb3b",toggleDirection:h.toggleDirection,usageStatistics:h.usageStatistics}),textRange:new Re({slider:h.selector(".tie-text-range"),input:h.selector(".tie-text-range-value")},gi)},h.colorPickerInputBox=h._els.textColorpicker.colorpickerElement.querySelector(Ce.COLOR_PICKER_INPUT_BOX),h}return it(r,[{key:"destroy",value:function(){this._removeEvent(),this._els.textColorpicker.destroy(),this._els.textRange.destroy(),Ne(this)}},{key:"addEvent",value:function(n){var h,S,T,k,A,R,H=K()(h=this._setTextEffectHandler).call(h,this),ot=K()(S=this._setTextAlignHandler).call(S,this);this.eventHandler={setTextEffect:H,setTextAlign:ot},this.actions=n,this._els.textEffectButton.addEventListener("click",H),this._els.textAlignButton.addEventListener("click",ot),this._els.textRange.on("change",K()(T=this._changeTextRnageHandler).call(T,this)),this._els.textColorpicker.on("change",K()(k=this._changeColorHandler).call(k,this)),this.colorPickerInputBox.addEventListener(Et.FOCUS,K()(A=this._onStartEditingInputBox).call(A,this)),this.colorPickerInputBox.addEventListener(Et.BLUR,K()(R=this._onStopEditingInputBox).call(R,this))}},{key:"_removeEvent",value:function(){var n,h,S=this.eventHandler,T=S.setTextEffect,k=S.setTextAlign;this._els.textEffectButton.removeEventListener("click",T),this._els.textAlignButton.removeEventListener("click",k),this._els.textRange.off(),this._els.textColorpicker.off(),this.colorPickerInputBox.removeEventListener(Et.FOCUS,K()(n=this._onStartEditingInputBox).call(n,this)),this.colorPickerInputBox.removeEventListener(Et.BLUR,K()(h=this._onStopEditingInputBox).call(h,this))}},{key:"changeStandbyMode",value:function(){this.actions.stopDrawingMode()}},{key:"changeStartMode",value:function(){this.actions.modeChange("text")}},{key:"textColor",get:function(){return this._els.textColorpicker.color},set:function(n){this._els.textColorpicker.color=n}},{key:"fontSize",get:function(){return this._els.textRange.value},set:function(n){this._els.textRange.value=n}},{key:"fontStyle",get:function(){return this.effect.italic?"italic":"normal"}},{key:"fontWeight",get:function(){return this.effect.bold?"bold":"normal"}},{key:"underline",get:function(){return this.effect.underline}},{key:"setTextStyleStateOnAction",value:function(){var n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},h=St()(n),S=n.fontSize,T=n.fontStyle,k=n.fontWeight,A=n.textDecoration,R=n.textAlign;this.textColor=h,this.fontSize=S,this.setEffectState("italic",T),this.setEffectState("bold",k),this.setEffectState("underline",A),this.setAlignState("tie-text-align-".concat(R))}},{key:"setEffectState",value:function(n,h){var S=h==="italic"||h==="bold"||h==="underline",T=this._els.textEffectButton.querySelector(".tui-image-editor-button.".concat(n));this.effect[n]=S,T.classList[S?"add":"remove"]("active")}},{key:"setAlignState",value:function(n){var h=this._els.textAlignButton;h.classList.remove(this.align),h.classList.add(n),this.align=n}},{key:"_setTextEffectHandler",value:function(n){var h=n.target.closest(".tui-image-editor-button");if(h){var S=h.className.match(/(bold|italic|underline)/),T=ct(S,1),k=T[0],A={bold:{fontWeight:"bold"},italic:{fontStyle:"italic"},underline:{textDecoration:"underline"}}[k];this.effect[k]=!this.effect[k],h.classList.toggle("active"),this.actions.changeTextStyle(A)}}},{key:"_setTextAlignHandler",value:function(n){var h=n.target.closest(".tui-image-editor-button");if(h){var S=this.getButtonType(h,["left","center","right"]),T="tie-text-align-".concat(S);n.currentTarget.classList.remove(this.align),this.align!==T&&n.currentTarget.classList.add(T),this.actions.changeTextStyle({textAlign:S}),this.align=T}}},{key:"_changeTextRnageHandler",value:function(n,h){this.actions.changeTextStyle({fontSize:n},!h)}},{key:"_changeColorHandler",value:function(n){n=n||"transparent",this.actions.changeTextStyle({fill:n})}}]),r}(Ge),za=Ra,Ba=function(w){var v,r,l,n=w.locale,h=w.makeSvgIcon;return U()(v=U()(r=U()(l=`
        • `.concat(h(["normal","active"],"mask-load",!0),`
        • `)).call(r,h(["normal","active"],"apply"),`
        `)};function Fa(w){var v=Ha();return function(){var l=ee(w),n;if(v){var h=ee(this).constructor;n=At()(l,arguments,h)}else n=l.apply(this,arguments);return ye(this,n)}}function Ha(){if(typeof Reflect=="undefined"||!At()||At().sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(At()(Boolean,[],function(){})),!0}catch(w){return!1}}var Ua=function(w){me(r,w);var v=Fa(r);function r(l,n){var h,S=n.locale,T=n.makeSvgIcon,k=n.menuBarPosition,A=n.usageStatistics;return Y(this,r),h=v.call(this,l,{locale:S,name:"mask",makeSvgIcon:T,menuBarPosition:k,templateHtml:Ba,usageStatistics:A}),h._els={applyButton:h.selector(".tie-mask-apply"),maskImageButton:h.selector(".tie-mask-image-file")},h}return it(r,[{key:"destroy",value:function(){this._removeEvent(),Ne(this)}},{key:"addEvent",value:function(n){var h,S,T=K()(h=this._loadMaskFile).call(h,this),k=K()(S=this._applyMask).call(S,this);this.eventHandler={loadMaskFile:T,applyMask:k},this.actions=n,this._els.maskImageButton.addEventListener("change",T),this._els.applyButton.addEventListener("click",k)}},{key:"_removeEvent",value:function(){this._els.maskImageButton.removeEventListener("change",this.eventHandler.loadMaskFile),this._els.applyButton.removeEventListener("click",this.eventHandler.applyMask)}},{key:"_applyMask",value:function(){this.actions.applyFilter(),this._els.applyButton.classList.remove("active")}},{key:"_loadMaskFile",value:function(n){var h;Pe()||alert("This browser does not support file-api");var S=ct(n.target.files,1),T=S[0];T&&(h=V().createObjectURL(T),this.actions.loadImageFromURL(h,T),this._els.applyButton.classList.add("active"))}}]),r}(Ge),Ya=Ua,Wa=function(w){var v,r,l,n,h,S,T,k,A,R,H,ot,lt,mt,ut,pt,jt,ie,re,oe,Ht=w.locale,ge=w.makeSvgIcon;return U()(v=U()(r=U()(l=U()(n=U()(h=U()(S=U()(T=U()(k=U()(A=U()(R=U()(H=U()(ot=U()(lt=U()(mt=U()(ut=U()(pt=U()(jt=U()(ie=U()(re=U()(oe=`
        • `.concat(ge(["normal","active"],"icon-arrow",!0),`
          `)).call(re,ge(["normal","active"],"icon-arrow-2",!0),`
          `)).call(jt,ge(["normal","active"],"icon-arrow-3",!0),`
          `)).call(ut,ge(["normal","active"],"icon-star",!0),`
          `)).call(lt,ge(["normal","active"],"icon-star-2",!0),`
          `)).call(H,ge(["normal","active"],"icon-polygon",!0),`
          `)).call(A,ge(["normal","active"],"icon-location",!0),`
          `)).call(T,ge(["normal","active"],"icon-heart",!0),`
          `)).call(h,ge(["normal","active"],"icon-bubble",!0),`
        • `)).call(l,ge(["normal","active"],"icon-load",!0),`
        `)};function Ga(w){var v=Xa();return function(){var l=ee(w),n;if(v){var h=ee(this).constructor;n=At()(l,arguments,h)}else n=l.apply(this,arguments);return ye(this,n)}}function Xa(){if(typeof Reflect=="undefined"||!At()||At().sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(At()(Boolean,[],function(){})),!0}catch(w){return!1}}var Za=function(w){me(r,w);var v=Ga(r);function r(l,n){var h,S=n.locale,T=n.makeSvgIcon,k=n.menuBarPosition,A=n.usageStatistics;return Y(this,r),h=v.call(this,l,{locale:S,name:"icon",makeSvgIcon:T,menuBarPosition:k,templateHtml:Wa,usageStatistics:A}),h.iconType=null,h._iconMap={},h._els={registerIconButton:h.selector(".tie-icon-image-file"),addIconButton:h.selector(".tie-icon-add-button"),iconColorpicker:new Je(h.selector(".tie-icon-color"),{defaultColor:"#ffbb3b",toggleDirection:h.toggleDirection,usageStatistics:h.usageStatistics})},h.colorPickerInputBox=h._els.iconColorpicker.colorpickerElement.querySelector(Ce.COLOR_PICKER_INPUT_BOX),h}return it(r,[{key:"destroy",value:function(){this._removeEvent(),this._els.iconColorpicker.destroy(),Ne(this)}},{key:"addEvent",value:function(n){var h,S,T,k,A,R=K()(h=this._registerIconHandler).call(h,this),H=K()(S=this._addIconHandler).call(S,this);this.eventHandler={registerIcon:R,addIcon:H},this.actions=n,this._els.iconColorpicker.on("change",K()(T=this._changeColorHandler).call(T,this)),this._els.registerIconButton.addEventListener("change",R),this._els.addIconButton.addEventListener("click",H),this.colorPickerInputBox.addEventListener(Et.FOCUS,K()(k=this._onStartEditingInputBox).call(k,this)),this.colorPickerInputBox.addEventListener(Et.BLUR,K()(A=this._onStopEditingInputBox).call(A,this))}},{key:"_removeEvent",value:function(){var n,h;this._els.iconColorpicker.off(),this._els.registerIconButton.removeEventListener("change",this.eventHandler.registerIcon),this._els.addIconButton.removeEventListener("click",this.eventHandler.addIcon),this.colorPickerInputBox.removeEventListener(Et.FOCUS,K()(n=this._onStartEditingInputBox).call(n,this)),this.colorPickerInputBox.removeEventListener(Et.BLUR,K()(h=this._onStopEditingInputBox).call(h,this))}},{key:"clearIconType",value:function(){this._els.addIconButton.classList.remove(this.iconType),this.iconType=null}},{key:"registerDefaultIcon",value:function(){var n=this;X()(hi,function(h,S){n.actions.registerDefaultIcons(S,h)})}},{key:"setIconPickerColor",value:function(n){this._els.iconColorpicker.color=n}},{key:"changeStandbyMode",value:function(){this.clearIconType(),this.actions.cancelAddIcon()}},{key:"_changeColorHandler",value:function(n){n=n||"transparent",this.actions.changeColor(n)}},{key:"_addIconHandler",value:function(n){var h=n.target.closest(".tui-image-editor-button");if(h){var S=h.getAttribute("data-icontype"),T=this._els.iconColorpicker.color;this.actions.discardSelection(),this.actions.changeSelectableAll(!1),this._els.addIconButton.classList.remove(this.iconType),this._els.addIconButton.classList.add(S),this.iconType===S?this.changeStandbyMode():(this.actions.addIcon(S,T),this.iconType=S)}}},{key:"_registerIconHandler",value:function(n){var h;Pe||alert("This browser does not support file-api");var S=ct(n.target.files,1),T=S[0];T&&(h=V().createObjectURL(T),this.actions.registerCustomIcon(h,T))}}]),r}(Ge),Va=Za,Ja=function(w){var v,r,l,n,h,S=w.locale,T=w.makeSvgIcon;return U()(v=U()(r=U()(l=U()(n=U()(h=`
        • `.concat(T(["normal","active"],"draw-free",!0),`
          `)).call(n,T(["normal","active"],"draw-line",!0),`
        `)};function Qa(w){var v=Ka();return function(){var l=ee(w),n;if(v){var h=ee(this).constructor;n=At()(l,arguments,h)}else n=l.apply(this,arguments);return ye(this,n)}}function Ka(){if(typeof Reflect=="undefined"||!At()||At().sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(At()(Boolean,[],function(){})),!0}catch(w){return!1}}var $a=.7,qa=function(w){me(r,w);var v=Qa(r);function r(l,n){var h,S=n.locale,T=n.makeSvgIcon,k=n.menuBarPosition,A=n.usageStatistics;return Y(this,r),h=v.call(this,l,{locale:S,name:"draw",makeSvgIcon:T,menuBarPosition:k,templateHtml:Ja,usageStatistics:A}),h._els={lineSelectButton:h.selector(".tie-draw-line-select-button"),drawColorPicker:new Je(h.selector(".tie-draw-color"),{defaultColor:"#00a9ff",toggleDirection:h.toggleDirection,usageStatistics:h.usageStatistics}),drawRange:new Re({slider:h.selector(".tie-draw-range"),input:h.selector(".tie-draw-range-value")},di)},h.type=null,h.color=h._els.drawColorPicker.color,h.width=h._els.drawRange.value,h.colorPickerInputBox=h._els.drawColorPicker.colorpickerElement.querySelector(Ce.COLOR_PICKER_INPUT_BOX),h}return it(r,[{key:"destroy",value:function(){this._removeEvent(),this._els.drawColorPicker.destroy(),this._els.drawRange.destroy(),Ne(this)}},{key:"addEvent",value:function(n){var h,S,T,k,A;this.eventHandler.changeDrawType=K()(h=this._changeDrawType).call(h,this),this.actions=n,this._els.lineSelectButton.addEventListener("click",this.eventHandler.changeDrawType),this._els.drawColorPicker.on("change",K()(S=this._changeDrawColor).call(S,this)),this._els.drawRange.on("change",K()(T=this._changeDrawRange).call(T,this)),this.colorPickerInputBox.addEventListener(Et.FOCUS,K()(k=this._onStartEditingInputBox).call(k,this)),this.colorPickerInputBox.addEventListener(Et.BLUR,K()(A=this._onStopEditingInputBox).call(A,this))}},{key:"_removeEvent",value:function(){var n,h;this._els.lineSelectButton.removeEventListener("click",this.eventHandler.changeDrawType),this._els.drawColorPicker.off(),this._els.drawRange.off(),this.colorPickerInputBox.removeEventListener(Et.FOCUS,K()(n=this._onStartEditingInputBox).call(n,this)),this.colorPickerInputBox.removeEventListener(Et.BLUR,K()(h=this._onStopEditingInputBox).call(h,this))}},{key:"setDrawMode",value:function(){this.actions.setDrawMode(this.type,{width:this.width,color:ri(this.color,$a)})}},{key:"changeStandbyMode",value:function(){this.type=null,this.actions.stopDrawingMode(),this.actions.changeSelectableAll(!0),this._els.lineSelectButton.classList.remove("free"),this._els.lineSelectButton.classList.remove("line")}},{key:"changeStartMode",value:function(){this.type="free",this._els.lineSelectButton.classList.add("free"),this.setDrawMode()}},{key:"_changeDrawType",value:function(n){var h=n.target.closest(".tui-image-editor-button");if(h){var S=this.getButtonType(h,["free","line"]);if(this.actions.discardSelection(),this.type===S){this.changeStandbyMode();return}this.changeStandbyMode(),this.type=S,this._els.lineSelectButton.classList.add(S),this.setDrawMode()}}},{key:"_changeDrawColor",value:function(n){this.color=n||"transparent",this.type?this.setDrawMode():this.changeStartMode()}},{key:"_changeDrawRange",value:function(n){this.width=n,this.type?this.setDrawMode():this.changeStartMode()}}]),r}(Ge),to=qa,eo=_(9886),Cn=_.n(eo),io=function(w){var v,r,l,n,h,S,T,k,A,R,H,ot,lt,mt,ut,pt,jt=w.locale;return U()(v=U()(r=U()(l=U()(n=U()(h=U()(S=U()(T=U()(k=U()(A=U()(R=U()(H=U()(ot=U()(lt=U()(mt=U()(ut=U()(pt=`
        `)};function no(w){var v=ro();return function(){var l=ee(w),n;if(v){var h=ee(this).constructor;n=At()(l,arguments,h)}else n=l.apply(this,arguments);return ye(this,n)}}function ro(){if(typeof Reflect=="undefined"||!At()||At().sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(At()(Boolean,[],function(){})),!0}catch(w){return!1}}var Sn="130px",ao=["add","diff","subtract","multiply","screen","lighten","darken"],xn=["grayscale","invert","sepia","vintage","blur","sharpen","emboss","remove-white","brightness","noise","pixelate","color-filter","tint","multiply","blend"],oo={grayscale:"grayscale",invert:"invert",sepia:"sepia",blur:"blur",sharpen:"sharpen",emboss:"emboss",removeWhite:"removeColor",brightness:"brightness",contrast:"contrast",saturation:"saturation",vintage:"vintage",polaroid:"polaroid",noise:"noise",pixelate:"pixelate",colorFilter:"removeColor",tint:"blendColor",multiply:"blendColor",blend:"blendColor",hue:"hue",gamma:"gamma"},In=["removewhiteDistanceRange","colorfilterThresholdRange","pixelateRange","noiseRange","brightnessRange","tintOpacity"],bn=["filterBlendColor","filterMultiplyColor","filterTintColor"],so=function(w){me(r,w);var v=no(r);function r(l,n){var h,S=n.locale,T=n.menuBarPosition,k=n.usageStatistics;return Y(this,r),h=v.call(this,l,{locale:S,name:"filter",menuBarPosition:T,templateHtml:io,usageStatistics:k}),h.selectBoxShow=!1,h.checkedMap={},h._makeControlElement(),h}return it(r,[{key:"destroy",value:function(){this._removeEvent(),this._destroyToolInstance(),Ne(this)}},{key:"_removeEvent",value:function(){var n=this,h;X()(xn,function(S){var T=n.selector(".tie-".concat(S)),k=we(S);T.removeEventListener("change",n.eventHandler[k])}),X()(U()(h=[]).call(h,In,bn),function(S){n._els[S].off()}),this._els.blendType.removeEventListener("change",this.eventHandler.changeBlendFilter),this._els.blendType.removeEventListener("click",this.eventHandler.changeBlendFilter),si()(this.colorPickerInputBoxes,function(S){var T,k;S.removeEventListener(Et.FOCUS,K()(T=n._onStartEditingInputBox).call(T,n)),S.removeEventListener(Et.BLUR,K()(k=n._onStopEditingInputBox).call(k,n))},this)}},{key:"_destroyToolInstance",value:function(){var n,h=this;X()(U()(n=[]).call(n,In,bn),function(S){h._els[S].destroy()})}},{key:"addEvent",value:function(n){var h=this,S,T,k,A=n.applyFilter,R=function(lt){var mt;return K()(mt=h._changeFilterState).call(mt,h,A,lt)},H=function(lt){return function(mt,ut){return h._changeFilterState(A,lt,ut)}};this.eventHandler={changeBlendFilter:R("blend"),blandTypeClick:function(lt){return lt.stopPropagation()}},X()(xn,function(ot){var lt=h.selector(".tie-".concat(ot)),mt=we(ot);h.checkedMap[mt]=lt,h.eventHandler[mt]=R(mt),lt.addEventListener("change",h.eventHandler[mt])}),this._els.removewhiteDistanceRange.on("change",H("removeWhite")),this._els.colorfilterThresholdRange.on("change",H("colorFilter")),this._els.pixelateRange.on("change",H("pixelate")),this._els.noiseRange.on("change",H("noise")),this._els.brightnessRange.on("change",H("brightness")),this._els.filterBlendColor.on("change",this.eventHandler.changeBlendFilter),this._els.filterMultiplyColor.on("change",R("multiply")),this._els.filterTintColor.on("change",R("tint")),this._els.tintOpacity.on("change",H("tint")),this._els.filterMultiplyColor.on("changeShow",K()(S=this.colorPickerChangeShow).call(S,this)),this._els.filterTintColor.on("changeShow",K()(T=this.colorPickerChangeShow).call(T,this)),this._els.filterBlendColor.on("changeShow",K()(k=this.colorPickerChangeShow).call(k,this)),this._els.blendType.addEventListener("change",this.eventHandler.changeBlendFilter),this._els.blendType.addEventListener("click",this.eventHandler.blandTypeClick),si()(this.colorPickerInputBoxes,function(ot){var lt,mt;ot.addEventListener(Et.FOCUS,K()(lt=h._onStartEditingInputBox).call(lt,h)),ot.addEventListener(Et.BLUR,K()(mt=h._onStopEditingInputBox).call(mt,h))},this)}},{key:"setFilterState",value:function(n){var h=n.type,S=n.options,T=n.action,k=this._getFilterNameFromOptions(h,S),A=T==="remove";A||this._setFilterState(k,S),this.checkedMap[k].checked=!A}},{key:"initFilterCheckBoxState",value:function(){X()(this.checkedMap,function(n){n.checked=!1},this)}},{key:"_setFilterState",value:function(n,h){n==="colorFilter"?this._els.colorfilterThresholdRange.value=h.distance:n==="removeWhite"?this._els.removewhiteDistanceRange.value=h.distance:n==="pixelate"?this._els.pixelateRange.value=h.blocksize:n==="brightness"?this._els.brightnessRange.value=h.brightness:n==="noise"?this._els.noiseRange.value=h.noise:n==="tint"?(this._els.tintOpacity.value=h.alpha,this._els.filterTintColor.color=h.color):n==="blend"?this._els.filterBlendColor.color=h.color:n==="multiply"&&(this._els.filterMultiplyColor.color=h.color)}},{key:"_getFilterNameFromOptions",value:function(n,h){var S=n;return n==="removeColor"?S=Cn()(h.useAlpha)?"removeWhite":"colorFilter":n==="blendColor"&&(S={add:"blend",multiply:"multiply",tint:"tint"}[h.mode]),S}},{key:"_changeFilterState",value:function(n,h){var S=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0,T=this.checkedMap[h].checked,k=oo[h],A=this.checkedMap[h].closest(".tui-image-editor-checkbox-group");A&&(T?A.classList.remove("tui-image-editor-disabled"):A.classList.add("tui-image-editor-disabled")),n(T,k,this._getFilterOption(h),!S)}},{key:"_getFilterOption",value:function(n){var h={};switch(n){case"removeWhite":h.color="#FFFFFF",h.useAlpha=!1,h.distance=Ve()(this._els.removewhiteDistanceRange.value);break;case"colorFilter":h.color="#FFFFFF",h.distance=Ve()(this._els.colorfilterThresholdRange.value);break;case"pixelate":h.blocksize=Rt(this._els.pixelateRange.value);break;case"noise":h.noise=Rt(this._els.noiseRange.value);break;case"brightness":h.brightness=Ve()(this._els.brightnessRange.value);break;case"blend":h.mode="add",h.color=this._els.filterBlendColor.color,h.mode=this._els.blendType.value;break;case"multiply":h.mode="multiply",h.color=this._els.filterMultiplyColor.color;break;case"tint":h.mode="tint",h.color=this._els.filterTintColor.color,h.alpha=this._els.tintOpacity.value;break;case"blur":h.blur=this._els.blurRange.value;break;default:break}return h}},{key:"_makeControlElement",value:function(){this._els={removewhiteDistanceRange:new Re({slider:this.selector(".tie-removewhite-distance-range")},Ye.removewhiteDistanceRange),brightnessRange:new Re({slider:this.selector(".tie-brightness-range")},Ye.brightnessRange),noiseRange:new Re({slider:this.selector(".tie-noise-range")},Ye.noiseRange),pixelateRange:new Re({slider:this.selector(".tie-pixelate-range")},Ye.pixelateRange),colorfilterThresholdRange:new Re({slider:this.selector(".tie-colorfilter-threshold-range")},Ye.colorfilterThresholdRange),filterTintColor:new Je(this.selector(".tie-filter-tint-color"),{defaultColor:"#03bd9e",toggleDirection:this.toggleDirection,usageStatistics:this.usageStatistics}),filterMultiplyColor:new Je(this.selector(".tie-filter-multiply-color"),{defaultColor:"#515ce6",toggleDirection:this.toggleDirection,usageStatistics:this.usageStatistics}),filterBlendColor:new Je(this.selector(".tie-filter-blend-color"),{defaultColor:"#ffbb3b",toggleDirection:this.toggleDirection,usageStatistics:this.usageStatistics}),blurRange:Ye.blurFilterRange},this._els.tintOpacity=this._pickerWithRange(this._els.filterTintColor.pickerControl),this._els.blendType=this._pickerWithSelectbox(this._els.filterBlendColor.pickerControl),this.colorPickerControls.push(this._els.filterTintColor),this.colorPickerControls.push(this._els.filterMultiplyColor),this.colorPickerControls.push(this._els.filterBlendColor),this.colorPickerInputBoxes=[],this.colorPickerInputBoxes.push(this._els.filterTintColor.colorpickerElement.querySelector(Ce.COLOR_PICKER_INPUT_BOX)),this.colorPickerInputBoxes.push(this._els.filterMultiplyColor.colorpickerElement.querySelector(Ce.COLOR_PICKER_INPUT_BOX)),this.colorPickerInputBoxes.push(this._els.filterBlendColor.colorpickerElement.querySelector(Ce.COLOR_PICKER_INPUT_BOX))}},{key:"_pickerWithRange",value:function(n){var h=document.createElement("div"),S=document.createElement("label"),T=document.createElement("div");return T.id="tie-filter-tint-opacity",S.innerHTML="Opacity",h.appendChild(S),h.appendChild(T),n.appendChild(h),n.style.height=Sn,new Re({slider:T},Ye.tintOpacityRange)}},{key:"_pickerWithSelectbox",value:function(n){var h=document.createElement("div"),S=document.createElement("select"),T=document.createElement("ul");return h.className="tui-image-editor-selectlist-wrap",T.className="tui-image-editor-selectlist",h.appendChild(S),h.appendChild(T),this._makeSelectOptionList(S),n.appendChild(h),n.style.height=Sn,this._drawSelectOptionList(S,T),this._pickerWithSelectboxForAddEvent(S,T),S}},{key:"_drawSelectOptionList",value:function(n,h){var S=n.querySelectorAll("option");X()(S,function(T){var k=document.createElement("li");k.innerHTML=T.innerHTML,k.setAttribute("data-item",T.value),h.appendChild(k)})}},{key:"_pickerWithSelectboxForAddEvent",value:function(n,h){var S=this;h.addEventListener("click",function(T){var k=T.target.getAttribute("data-item"),A=document.createEvent("HTMLEvents");n.querySelector('[value="'.concat(k,'"]')).selected=!0,A.initEvent("change",!0,!0),n.dispatchEvent(A),S.selectBoxShow=!1,h.style.display="none"}),n.addEventListener("mousedown",function(T){T.preventDefault(),S.selectBoxShow=!S.selectBoxShow,h.style.display=S.selectBoxShow?"block":"none",h.setAttribute("data-selectitem",n.value),h.querySelector("[data-item='".concat(n.value,"']")).classList.add("active")})}},{key:"_makeSelectOptionList",value:function(n){X()(ao,function(h){var S=document.createElement("option");S.setAttribute("value",h),S.innerHTML=h.replace(/^[a-z]/,function(T){return T.toUpperCase()}),n.appendChild(S)})}}]),r}(Ge),lo=so,co=_(4383),uo=_.n(co),ho=function(){function w(v,r){var l=r.name;Y(this,w),this.name=l,this.items=[],this.panelElement=this._makePanelElement(),this.listElement=this._makeListElement(),this.panelElement.appendChild(this.listElement),v.appendChild(this.panelElement)}return it(w,[{key:"_makePanelElement",value:function(){var r=document.createElement("div");return r.className="tie-panel-".concat(this.name),r}},{key:"_makeListElement",value:function(){var r=document.createElement("ol");return r.className="".concat(this.name,"-list"),r}},{key:"makeListItemElement",value:function(r){var l=document.createElement("li");return l.innerHTML=r,l.className="".concat(this.name,"-item"),l.setAttribute("data-index",this.items.length),l}},{key:"pushListItemElement",value:function(r){this.listElement.appendChild(r),this.listElement.scrollTop+=r.offsetHeight,this.items.push(r)}},{key:"deleteListItemElement",value:function(r,l){for(var n=this.items,h=r;h
        `.concat(h(["normal","active"],"history-".concat(S.toLowerCase()),!0),`
        `)).call(l,n.localize(S),` `)).call(r,T?"(".concat(n.localize(T),")"):"",`
        `)).call(v,h(["normal"],"history-check",!0),`
        `)};function vo(w){var v=po();return function(){var l=ee(w),n;if(v){var h=ee(this).constructor;n=At()(l,arguments,h)}else n=l.apply(this,arguments);return ye(this,n)}}function po(){if(typeof Reflect=="undefined"||!At()||At().sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(At()(Boolean,[],function(){})),!0}catch(w){return!1}}var mo="history-item",Mn="selected-item",Tn="disabled-item",yo=function(w){me(r,w);var v=vo(r);function r(l,n){var h,S=n.locale,T=n.makeSvgIcon;return Y(this,r),h=v.call(this,l,{name:"history"}),l.classList.add("enabled"),h.locale=S,h.makeSvgIcon=T,h._eventHandler={},h._historyIndex=h.getListLength(),h}return it(r,[{key:"add",value:function(n){var h=n.name,S=n.detail;this._hasDisabledItem()&&this.deleteListItemElement(this._historyIndex+1,this.getListLength());var T=go({locale:this.locale,makeSvgIcon:this.makeSvgIcon,name:h,detail:S}),k=this.makeListItemElement(T);this.pushListItemElement(k),this._historyIndex=this.getListLength()-1,this._selectItem(this._historyIndex)}},{key:"init",value:function(){this.deleteListItemElement(1,this.getListLength()),this._historyIndex=0,this._selectItem(this._historyIndex)}},{key:"clear",value:function(){this.deleteListItemElement(0,this.getListLength()),this._historyIndex=-1}},{key:"prev",value:function(){this._historyIndex-=1,this._selectItem(this._historyIndex)}},{key:"next",value:function(){this._historyIndex+=1,this._selectItem(this._historyIndex)}},{key:"_hasDisabledItem",value:function(){return this.getListLength()-1>this._historyIndex}},{key:"_addHistoryEventListener",value:function(){var n=this;this._eventHandler.history=function(h){return n._clickHistoryItem(h)},this.listElement.addEventListener("click",this._eventHandler.history)}},{key:"_removeHistoryEventListener",value:function(){this.listElement.removeEventListener("click",this._eventHandler.history)}},{key:"_clickHistoryItem",value:function(n){var h=n.target,S=h.closest(".".concat(mo));if(!!S){var T=uo()(S.getAttribute("data-index"),10);if(T!==this._historyIndex){var k=Math.abs(T-this._historyIndex);Tn&&this.addClass(h,Tn);this.addClass(n,Mn)}},{key:"destroy",value:function(){this.removeEvent(),Ne(this)}},{key:"addEvent",value:function(n){this._actions=n,this._addHistoryEventListener()}},{key:"removeEvent",value:function(){this._removeHistoryEventListener()}}]),r}(fo),Co=yo,So=function(){function w(v){Y(this,w),this._locale=v}return it(w,[{key:"localize",value:function(r){return this._locale[r]||r}}]),w}(),xo=So,Io={Shape:ha,Crop:pa,Resize:xa,Flip:Ea,Rotate:Pa,Text:za,Mask:Ya,Icon:Va,Draw:to,Filter:lo},bo="1300",En="history",Mo="tie-panel-history",li="on",ci={ZOOM_IN:"zoomIn",HAND:"hand"},wn=function(){function w(v,r,l){Y(this,w),this.options=this._initializeOption(r),this._actions=l,this.submenu=!1,this.imageSize={},this.uiSize={},this._locale=new xo(this.options.locale),this.theme=new Kr(this.options.theme),this.eventHandler={},this._submenuChangeTransection=!1,this._selectedElement=null,this._mainElement=null,this._editorElementWrap=null,this._editorElement=null,this._menuBarElement=null,this._subMenuElement=null,this._makeUiElement(v),this._setUiSize(),this._initMenuEvent=!1,this._makeSubMenu(),this._attachHistoryEvent(),this._attachZoomEvent()}return it(w,[{key:"destroy",value:function(){this._removeUiEvent(),this._destroyAllMenu(),this._selectedElement.innerHTML="",Ne(this)}},{key:"setUiDefaultSelectionStyle",value:function(r){return G()({applyCropSelectionStyle:!0,applyGroupSelectionStyle:!0,selectionStyle:{cornerStyle:"circle",cornerSize:16,cornerColor:"#fff",cornerStrokeColor:"#fff",transparentCorners:!1,lineWidth:2,borderColor:"#fff"}},r)}},{key:"resizeEditor",value:function(){var r=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},l=r.uiSize,n=r.imageSize,h=n===void 0?this.imageSize:n;h!==this.imageSize&&(this.imageSize=h),l&&this._setUiSize(l);var S=this._getCanvasMaxDimension(),T=S.width,k=S.height,A=this._editorElement.style,R=this.options.menuBarPosition;A.height="".concat(k,"px"),A.width="".concat(T,"px"),this._setEditorPosition(R),this._editorElementWrap.style.bottom="0px",this._editorElementWrap.style.top="0px",this._editorElementWrap.style.left="0px",this._editorElementWrap.style.width="100%";var H=this._selectedElement.classList;R==="top"&&this._selectedElement.offsetWidth0&&arguments[0]!==void 0?arguments[0]:this.options.uiSize,l=this._selectedElement.style;l.width=r.width,l.height=r.height}},{key:"_makeSubMenu",value:function(){var r=this;X()(this.options.menu,function(l){var n,h=Io[l.replace(/^[a-z]/,function(S){return S.toUpperCase()})];r._makeMenuElement(l),r._buttonElements[l]=r._menuBarElement.querySelector(".tie-btn-".concat(l)),r[l]=new h(r._subMenuElement,{locale:r._locale,makeSvgIcon:K()(n=r.theme.makeMenSvgIconSet).call(n,r.theme),menuBarPosition:r.options.menuBarPosition,usageStatistics:r.options.usageStatistics})})}},{key:"_attachHistoryEvent",value:function(){var r,l,n;this.on(Et.EXECUTE_COMMAND,K()(r=this._addHistory).call(r,this)),this.on(Et.AFTER_UNDO,K()(l=this._selectPrevHistory).call(l,this)),this.on(Et.AFTER_REDO,K()(n=this._selectNextHistory).call(n,this))}},{key:"_attachZoomEvent",value:function(){var r=this;this.on(Et.HAND_STARTED,function(){r.offZoomInButtonStatus(),r.changeHandButtonStatus(!0)}),this.on(Et.HAND_STOPPED,function(){return r.changeHandButtonStatus(!1)})}},{key:"_makeUiElement",value:function(r){var l,n;r.nodeType?n=r:n=document.querySelector(r);var h=ai(n);n.classList.add("tui-image-editor-container"),n.innerHTML=Gr({locale:this._locale,biImage:this.theme.getStyle("common.bi"),loadButtonStyle:this.theme.getStyle("loadButton"),downloadButtonStyle:this.theme.getStyle("downloadButton"),menuBarPosition:this.options.menuBarPosition})+Wr({locale:this._locale,biImage:this.theme.getStyle("common.bi"),commonStyle:this.theme.getStyle("common"),headerStyle:this.theme.getStyle("header"),loadButtonStyle:this.theme.getStyle("loadButton"),downloadButtonStyle:this.theme.getStyle("downloadButton"),submenuStyle:this.theme.getStyle("submenu")}),this._selectedElement=n,this._selectedElement.classList.add(this.options.menuBarPosition),this._mainElement=h(".tui-image-editor-main"),this._editorElementWrap=h(".tui-image-editor-wrap"),this._editorElement=h(".tui-image-editor"),this._helpMenuBarElement=h(".tui-image-editor-help-menu"),this._menuBarElement=h(".tui-image-editor-menu"),this._subMenuElement=h(".tui-image-editor-submenu"),this._buttonElements={download:this._selectedElement.querySelectorAll(".tui-image-editor-download-btn"),load:this._selectedElement.querySelectorAll(".tui-image-editor-load-btn")},this._addHelpMenus(),this._historyMenu=new Co(this._buttonElements[En],{locale:this._locale,makeSvgIcon:K()(l=this.theme.makeMenSvgIconSet).call(l,this.theme)}),this._activateZoomMenus()}},{key:"_activateZoomMenus",value:function(){var r=this;X()($t,function(l){r.changeHelpButtonEnabled(l,!0)})}},{key:"_makeHelpMenuWithPartition",value:function(){var r;return U()(r=[]).call(r,L($t),[""],L(ne),[""],L(ce))}},{key:"_addHelpMenus",value:function(){var r=this,l=this._makeHelpMenuWithPartition();X()(l,function(n){n?(r._makeMenuElement(n,["normal","disabled","hover"],"help"),r._buttonElements[n]=r._helpMenuBarElement.querySelector(".tie-btn-".concat(n))):r._makeMenuPartitionElement()})}},{key:"_makeMenuPartitionElement",value:function(){var r=document.createElement("li"),l=document.createElement("div");r.className=yi("item"),l.className=yi("icpartition"),r.appendChild(l),this._helpMenuBarElement.appendChild(r)}},{key:"_makeMenuElement",value:function(r){var l,n,h=arguments.length>1&&arguments[1]!==void 0?arguments[1]:["normal","active","hover"],S=arguments.length>2&&arguments[2]!==void 0?arguments[2]:"normal",T=document.createElement("li"),k=this.theme.makeMenSvgIconSet(h,r);this._addTooltipAttribute(T,r),T.className=U()(l=U()(n="tie-btn-".concat(r," ")).call(n,yi("item")," ")).call(l,S),T.innerHTML=k,S==="normal"?this._menuBarElement.appendChild(T):this._helpMenuBarElement.appendChild(T)}},{key:"_addHelpActionEvent",value:function(){var r=this;X()(Dt,function(l){r.eventHandler[l]=function(n){return r._actions.main[l](n)},r._buttonElements[l].addEventListener("click",r.eventHandler[l])})}},{key:"_removeHelpActionEvent",value:function(){var r=this;X()(Dt,function(l){r._buttonElements[l].removeEventListener("click",r.eventHandler[l])})}},{key:"_addHistory",value:function(r){if(!kr(r)){var l=typeof r=="string"?{name:r}:Pr(r);this._historyMenu.add(l)}}},{key:"initHistory",value:function(){this._historyMenu.init()}},{key:"clearHistory",value:function(){this._historyMenu.clear()}},{key:"_selectPrevHistory",value:function(){this._historyMenu.prev()}},{key:"_selectNextHistory",value:function(){this._historyMenu.next()}},{key:"toggleHistoryMenu",value:function(r){var l=r.target,n=l.closest(".".concat(Mo));if(!n){var h=this._buttonElements[En].classList;h.toggle("opened")}}},{key:"_addTooltipAttribute",value:function(r,l){r.setAttribute("tooltip-content",this._locale.localize(l.replace(/^[a-z]/g,function(n){return n.toUpperCase()})))}},{key:"_addDownloadEvent",value:function(){var r=this;this.eventHandler.download=function(){return r._actions.main.download()},X()(this._buttonElements.download,function(l){l.addEventListener("click",r.eventHandler.download)})}},{key:"_removeDownloadEvent",value:function(){var r=this;X()(this._buttonElements.download,function(l){l.removeEventListener("click",r.eventHandler.download)})}},{key:"_addLoadEvent",value:function(){var r=this;this.eventHandler.loadImage=function(l){return r._actions.main.load(l.target.files[0])},X()(this._buttonElements.load,function(l){l.addEventListener("change",r.eventHandler.loadImage)})}},{key:"_removeLoadEvent",value:function(){var r=this;X()(this._buttonElements.load,function(l){l.removeEventListener("change",r.eventHandler.loadImage)})}},{key:"_addMainMenuEvent",value:function(r){var l=this;this.eventHandler[r]=function(){return l.changeMenu(r)},this._buttonElements[r].addEventListener("click",this.eventHandler[r])}},{key:"_addSubMenuEvent",value:function(r){var l=this;this[r].addEvent(this._actions[r]),this[r].on(Et.INPUT_BOX_EDITING_STARTED,function(){return l.fire(Et.INPUT_BOX_EDITING_STARTED)}),this[r].on(Et.INPUT_BOX_EDITING_STOPPED,function(){return l.fire(Et.INPUT_BOX_EDITING_STOPPED)})}},{key:"_addMenuEvent",value:function(){var r=this;X()(this.options.menu,function(l){r._addMainMenuEvent(l),r._addSubMenuEvent(l)})}},{key:"_removeMainMenuEvent",value:function(){var r=this;X()(this.options.menu,function(l){r._buttonElements[l].removeEventListener("click",r.eventHandler[l]),r[l].off(Et.INPUT_BOX_EDITING_STARTED),r[l].off(Et.INPUT_BOX_EDITING_STOPPED)})}},{key:"getEditorArea",value:function(){return this._editorElement}},{key:"activeMenuEvent",value:function(){this._initMenuEvent||(this._addHelpActionEvent(),this._addDownloadEvent(),this._addMenuEvent(),this._initMenu(),this._historyMenu.addEvent(this._actions.history),this._initMenuEvent=!0)}},{key:"_removeUiEvent",value:function(){this._removeHelpActionEvent(),this._removeDownloadEvent(),this._removeLoadEvent(),this._removeMainMenuEvent(),this._historyMenu.removeEvent()}},{key:"_destroyAllMenu",value:function(){var r=this;X()(this.options.menu,function(l){r[l].destroy()}),this._historyMenu.destroy()}},{key:"initCanvas",value:function(){var r=this,l=this._getLoadImage();l.path&&this._actions.main.initLoadImage(l.path,l.name).then(function(){r.activeMenuEvent()}),this._addLoadEvent();var n=document.createElement("div");n.className=yi("grid-visual");var h=`
        `;n.innerHTML=h,this._editorContainerElement=this._editorElement.querySelector(".tui-image-editor-canvas-container"),this._editorContainerElement.appendChild(n)}},{key:"_getLoadImage",value:function(){return this.options.loadImage}},{key:"changeMenu",value:function(r){var l=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0,n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0;this._submenuChangeTransection||(this._submenuChangeTransection=!0,this._changeMenu(r,l,n),this._submenuChangeTransection=!1)}},{key:"_changeMenu",value:function(r,l,n){this.submenu&&(this._buttonElements[this.submenu].classList.remove("active"),this._mainElement.classList.remove("tui-image-editor-menu-".concat(this.submenu)),n&&this._actions.main.discardSelection(),this._actions.main.changeSelectableAll(!0),this[this.submenu].changeStandbyMode()),this.submenu===r&&l?this.submenu=null:(this._buttonElements[r].classList.add("active"),this._mainElement.classList.add("tui-image-editor-menu-".concat(r)),this.submenu=r,this[this.submenu].changeStartMode()),this.resizeEditor()}},{key:"_initMenu",value:function(){if(this.options.initMenu){var r=document.createEvent("MouseEvents");r.initEvent("click",!0,!1),this._buttonElements[this.options.initMenu].dispatchEvent(r)}this.icon&&this.icon.registerDefaultIcon()}},{key:"_getCanvasMaxDimension",value:function(){var r=this._editorContainerElement.style,l=r.maxWidth,n=r.maxHeight,h=Ve()(l),S=Ve()(n);return{width:h,height:S}}},{key:"_setEditorPosition",value:function(r){var l=this._getCanvasMaxDimension(),n=l.width,h=l.height,S=this._editorElement.style,T=0,k=0;this.submenu&&(r==="bottom"?h>this._editorElementWrap.scrollHeight-150?T=(h-this._editorElementWrap.scrollHeight)/2:T=150/2*-1:r==="top"?h>this._editorElementWrap.offsetHeight-150?T=150/2-(h-(this._editorElementWrap.offsetHeight-150))/2:T=150/2:r==="left"?n>this._editorElementWrap.offsetWidth-248?k=248/2-(n-(this._editorElementWrap.offsetWidth-248))/2:k=248/2:r==="right"&&(n>this._editorElementWrap.scrollWidth-248?k=(n-this._editorElementWrap.scrollWidth)/2:k=248/2*-1)),S.top="".concat(T,"px"),S.left="".concat(k,"px")}}]),w}();gt().mixin(wn);var To=wn,Eo=_(381),ei=_.n(Eo),Dn=function(){function w(){Y(this,w),this.versionnumber="1.2.4",this.optionpresets={default:{corsenabled:!1,ltres:1,qtres:1,pathomit:8,rightangleenhance:!0,colorsampling:2,numberofcolors:16,mincolorratio:0,colorquantcycles:3,layering:0,strokewidth:1,linefilter:!1,scale:1,roundcoords:1,viewbox:!1,desc:!1,lcpr:0,qcpr:0,blurradius:0,blurdelta:20},posterized1:{colorsampling:0,numberofcolors:2},posterized2:{numberofcolors:4,blurradius:5},curvy:{ltres:.01,linefilter:!0,rightangleenhance:!1},sharp:{qtres:.01,linefilter:!1},detailed:{pathomit:0,roundcoords:2,ltres:.5,qtres:.5,numberofcolors:64},smoothed:{blurradius:5,blurdelta:64},grayscale:{colorsampling:0,colorquantcycles:1,numberofcolors:7},fixedpalette:{colorsampling:0,colorquantcycles:1,numberofcolors:27},randomsampling1:{colorsampling:1,numberofcolors:8},randomsampling2:{colorsampling:1,numberofcolors:64},artistic1:{colorsampling:0,colorquantcycles:1,pathomit:0,blurradius:5,blurdelta:64,ltres:.01,linefilter:!0,numberofcolors:16,strokewidth:2},artistic2:{qtres:.01,colorsampling:0,colorquantcycles:1,numberofcolors:4,strokewidth:0},artistic3:{qtres:10,ltres:10,numberofcolors:8},artistic4:{qtres:10,ltres:10,numberofcolors:64,blurradius:5,blurdelta:256,strokewidth:2},posterized3:{ltres:1,qtres:1,pathomit:20,rightangleenhance:!0,colorsampling:0,numberofcolors:3,mincolorratio:0,colorquantcycles:3,blurradius:3,blurdelta:20,strokewidth:0,linefilter:!1,roundcoords:1,pal:[{r:0,g:0,b:100,a:255},{r:255,g:255,b:255,a:255}]}},this.pathscan_combined_lookup=[[[-1,-1,-1,-1],[-1,-1,-1,-1],[-1,-1,-1,-1],[-1,-1,-1,-1]],[[0,1,0,-1],[-1,-1,-1,-1],[-1,-1,-1,-1],[0,2,-1,0]],[[-1,-1,-1,-1],[-1,-1,-1,-1],[0,1,0,-1],[0,0,1,0]],[[0,0,1,0],[-1,-1,-1,-1],[0,2,-1,0],[-1,-1,-1,-1]],[[-1,-1,-1,-1],[0,0,1,0],[0,3,0,1],[-1,-1,-1,-1]],[[13,3,0,1],[13,2,-1,0],[7,1,0,-1],[7,0,1,0]],[[-1,-1,-1,-1],[0,1,0,-1],[-1,-1,-1,-1],[0,3,0,1]],[[0,3,0,1],[0,2,-1,0],[-1,-1,-1,-1],[-1,-1,-1,-1]],[[0,3,0,1],[0,2,-1,0],[-1,-1,-1,-1],[-1,-1,-1,-1]],[[-1,-1,-1,-1],[0,1,0,-1],[-1,-1,-1,-1],[0,3,0,1]],[[11,1,0,-1],[14,0,1,0],[14,3,0,1],[11,2,-1,0]],[[-1,-1,-1,-1],[0,0,1,0],[0,3,0,1],[-1,-1,-1,-1]],[[0,0,1,0],[-1,-1,-1,-1],[0,2,-1,0],[-1,-1,-1,-1]],[[-1,-1,-1,-1],[-1,-1,-1,-1],[0,1,0,-1],[0,0,1,0]],[[0,1,0,-1],[-1,-1,-1,-1],[-1,-1,-1,-1],[0,2,-1,0]],[[-1,-1,-1,-1],[-1,-1,-1,-1],[-1,-1,-1,-1],[-1,-1,-1,-1]]],this.gks=[[.27901,.44198,.27901],[.135336,.228569,.272192,.228569,.135336],[.086776,.136394,.178908,.195843,.178908,.136394,.086776],[.063327,.093095,.122589,.144599,.152781,.144599,.122589,.093095,.063327],[.049692,.069304,.089767,.107988,.120651,.125194,.120651,.107988,.089767,.069304,.049692]],this.specpalette=[{r:0,g:0,b:0,a:255},{r:128,g:128,b:128,a:255},{r:0,g:0,b:128,a:255},{r:64,g:64,b:128,a:255},{r:192,g:192,b:192,a:255},{r:255,g:255,b:255,a:255},{r:128,g:128,b:192,a:255},{r:0,g:0,b:192,a:255},{r:128,g:0,b:0,a:255},{r:128,g:64,b:64,a:255},{r:128,g:0,b:128,a:255},{r:168,g:168,b:168,a:255},{r:192,g:128,b:128,a:255},{r:192,g:0,b:0,a:255},{r:255,g:255,b:255,a:255},{r:0,g:128,b:0,a:255}]}return it(w,[{key:"imageToSVG",value:function(r,l,n){var h=this;n=this.checkoptions(n),this.loadImage(r,function(S){l(h.imagedataToSVG(h.getImgdata(S),n))},n)}},{key:"imagedataToSVG",value:function(r,l){l=this.checkoptions(l);var n=this.imagedataToTracedata(r,l);return this.getsvgstring(n,l)}},{key:"imageToTracedata",value:function(r,l,n){var h=this;n=this.checkoptions(n),this.loadImage(r,function(S){l(h.imagedataToTracedata(h.getImgdata(S),n))},n)}},{key:"imagedataToTracedata",value:function(r,l){l=this.checkoptions(l);var n=this.colorquantization(r,l),h;if(l.layering===0){h={layers:[],palette:n.palette,width:n.array[0].length-2,height:n.array.length-2};for(var S=0;S0&&(r=this.blur(r,l.blurradius,l.blurdelta)),mt=0;mt0)for(lt=0;lt0&&(ut[lt]={r:Math.floor(A[lt].r/A[lt].n),g:Math.floor(A[lt].g/A[lt].n),b:Math.floor(A[lt].b/A[lt].n),a:Math.floor(A[lt].a/A[lt].n)}),A[lt].n/Rn[h].boundingbox[2]&&(n[h].boundingbox[2]=T-1),k-1n[h].boundingbox[3]&&(n[h].boundingbox[3]=k-1),mt=this.pathscan_combined_lookup[r[k][T]][H],r[k][T]=mt[0],H=mt[1],T+=mt[2],k+=mt[3],T-1===n[h].points[0].x&&k-1===n[h].points[0].y)if(ot=!0,n[h].points.lengthl[2]&&r[3]>l[3]}},{key:"batchpathscan",value:function(r,l){var n=[];for(var h in r)!r.hasOwnProperty(h)||(n[h]=this.pathscan(r[h],l));return n}},{key:"internodes",value:function(r,l){var n=[],h=0,S=0,T=0,k=0,A=0,R,H;for(R=0;R0&&(n[R].points[n[R].points.length-1].linesegment=this.getdirection(n[R].points[n[R].points.length-1].x,n[R].points[n[R].points.length-1].y,r[R].points[H].x,r[R].points[H].y)),n[R].points.push({x:r[R].points[H].x,y:r[R].points[H].y,linesegment:this.getdirection(r[R].points[H].x,r[R].points[H].y,(r[R].points[H].x+r[R].points[S].x)/2,(r[R].points[H].y+r[R].points[S].y)/2)})),n[R].points.push({x:(r[R].points[H].x+r[R].points[S].x)/2,y:(r[R].points[H].y+r[R].points[S].y)/2,linesegment:this.getdirection((r[R].points[H].x+r[R].points[S].x)/2,(r[R].points[H].y+r[R].points[S].y)/2,(r[R].points[S].x+r[R].points[T].x)/2,(r[R].points[S].y+r[R].points[T].y)/2)});return n}},{key:"testrightangle",value:function(r,l,n,h,S,T){return r.points[h].x===r.points[l].x&&r.points[h].x===r.points[n].x&&r.points[h].y===r.points[S].y&&r.points[h].y===r.points[T].y||r.points[h].y===r.points[l].y&&r.points[h].y===r.points[n].y&&r.points[h].x===r.points[S].x&&r.points[h].x===r.points[T].x}},{key:"getdirection",value:function(r,l,n,h){var S=8;return rh?S=7:S=0:r>n?lh?S=5:S=4:lh?S=6:S=8,S}},{key:"batchinternodes",value:function(r,l){var n=[];for(var h in r)!r.hasOwnProperty(h)||(n[h]=this.internodes(r[h],l));return n}},{key:"tracepath",value:function(r,l,n){var h=0,S,T,k,A={};for(A.segments=[],A.boundingbox=r.boundingbox,A.holechildren=r.holechildren,A.isholepath=r.isholepath;h0?h=k:h=r.points.length}return A}},{key:"fitseq",value:function(r,l,n,h,S){var T;if(S>r.points.length||S<0)return[];var k=h,A=0,R=!0,H,ot,lt,mt=S-h;mt<0&&(mt+=r.points.length);for(var ut=(r.points[S].x-r.points[h].x)/mt,pt=(r.points[S].y-r.points[h].y)/mt,jt=(h+1)%r.points.length,ie;jt!=S;)ie=jt-h,ie<0&&(ie+=r.points.length),H=r.points[h].x+ut*ie,ot=r.points[h].y+pt*ie,lt=(r.points[jt].x-H)*(r.points[jt].x-H)+(r.points[jt].y-ot)*(r.points[jt].y-ot),lt>l&&(R=!1),lt>A&&(k=jt,A=lt),jt=(jt+1)%r.points.length;if(R)return[{type:"L",x1:r.points[h].x,y1:r.points[h].y,x2:r.points[S].x,y2:r.points[S].y}];var re=k;R=!0,A=0;var oe=(re-h)/mt,Ht=(1-oe)*(1-oe),ge=2*(1-oe)*oe,De=oe*oe,je=(Ht*r.points[h].x+De*r.points[S].x-r.points[re].x)/-ge,Fe=(Ht*r.points[h].y+De*r.points[S].y-r.points[re].y)/-ge;for(jt=h+1;jt!=S;)oe=(jt-h)/mt,Ht=(1-oe)*(1-oe),ge=2*(1-oe)*oe,De=oe*oe,H=Ht*r.points[h].x+ge*je+De*r.points[S].x,ot=Ht*r.points[h].y+ge*Fe+De*r.points[S].y,lt=(r.points[jt].x-H)*(r.points[jt].x-H)+(r.points[jt].y-ot)*(r.points[jt].y-ot),lt>n&&(R=!1),lt>A&&(k=jt,A=lt),jt=(jt+1)%r.points.length;if(R)return[{type:"Q",x1:r.points[h].x,y1:r.points[h].y,x2:je,y2:Fe,x3:r.points[S].x,y3:r.points[S].y}];var Te=re;return U()(T=this.fitseq(r,l,n,h,Te)).call(T,this.fitseq(r,l,n,Te,S))}},{key:"batchtracepaths",value:function(r,l,n){var h=[];for(var S in r)!r.hasOwnProperty(S)||h.push(this.tracepath(r[S],l,n));return h}},{key:"batchtracelayers",value:function(r,l,n){var h=[];for(var S in r)!r.hasOwnProperty(S)||(h[S]=this.batchtracepaths(r[S],l,n));return h}},{key:"roundtodec",value:function(r,l){return Number(r.toFixed(l))}},{key:"svgpathstring",value:function(r,l,n,h){var S,T,k=r.layers[l],A=k[n],R="",H;if(h.linefilter&&A.segments.length<3)return R;if(R=U()(S="=0;H--){var je;if(R+="".concat(Ht.segments[H].type," "),Ht.segments[H].hasOwnProperty("x3")){var Fe;R+=U()(Fe="".concat(Ht.segments[H].x2*h.scale," ")).call(Fe,Ht.segments[H].y2*h.scale," ")}R+=U()(je="".concat(Ht.segments[H].x1*h.scale," ")).call(je,Ht.segments[H].y1*h.scale," ")}}else{if(Ht.segments[Ht.segments.length-1].hasOwnProperty("x3")){var Te;R+=U()(Te="M ".concat(this.roundtodec(Ht.segments[Ht.segments.length-1].x3*h.scale)," ")).call(Te,this.roundtodec(Ht.segments[Ht.segments.length-1].y3*h.scale)," ")}else{var Ke;R+=U()(Ke="M ".concat(this.roundtodec(Ht.segments[Ht.segments.length-1].x2*h.scale)," ")).call(Ke,this.roundtodec(Ht.segments[Ht.segments.length-1].y2*h.scale)," ")}for(H=Ht.segments.length-1;H>=0;H--){var $e;if(R+="".concat(Ht.segments[H].type," "),Ht.segments[H].hasOwnProperty("x3")){var Le;R+=U()(Le="".concat(this.roundtodec(Ht.segments[H].x2*h.scale)," ")).call(Le,this.roundtodec(Ht.segments[H].y2*h.scale)," ")}R+=U()($e="".concat(this.roundtodec(Ht.segments[H].x1*h.scale)," ")).call($e,this.roundtodec(Ht.segments[H].y1*h.scale)," ")}}R+="Z "}if(R+='" />',h.lcpr||h.qcpr){for(H=0;H'),R+=U()(_i=U()(ki=U()(Pi=''),R+=U()(Li=U()(ji=U()(Ni=U()(Ri=''),R+=U()(zi=U()(Bi=U()(Fi=U()(Hi='')}if(!A.segments[H].hasOwnProperty("x3")&&h.lcpr){var Ui,Yi,Wi;R+=U()(Ui=U()(Yi=U()(Wi='')}}for(var oe=0;oe'),R+=U()(fr=U()(dr=U()(gr=''),R+=U()(vr=U()(pr=U()(mr=U()(yr=''),R+=U()(Cr=U()(Sr=U()(xr=U()(Ir='')}if(!Ht.segments[H].hasOwnProperty("x3")&&h.lcpr){var br,Mr,Tr;R+=U()(br=U()(Mr=U()(Tr='')}}}}return R}},{key:"getsvgstring",value:function(r,l){var n,h,S;l=this.checkoptions(l);for(var T=r.width*l.scale,k=r.height*l.scale,A=U()(n="'),R=0;R5&&(l=5),n=Math.abs(n),n>1024&&(n=1024);var pt=this.gks[l-1];for(S=0;S0&&h+T0&&S+Tn&&(ut.data[A]=r.data[A],ut.data[A+1]=r.data[A+1],ut.data[A+2]=r.data[A+2],ut.data[A+3]=r.data[A+3]);return ut}},{key:"loadImage",value:function(r,l,n){var h=new Image;n&&n.corsenabled&&(h.crossOrigin="Anonymous"),h.src=r,h.onload=function(){var S=document.createElement("canvas");S.width=h.width,S.height=h.height;var T=S.getContext("2d");T.drawImage(h,0,0),l(S)}}},{key:"getImgdata",value:function(r){var l=r.getContext("2d");return l.getImageData(0,0,r.width,r.height)}},{key:"drawLayers",value:function(r,l,n,h){n=n||1;var S,T,k,A,R,H;h?(H=document.getElementById(h),H||(H=document.createElement("div"),H.id=h,document.body.appendChild(H))):(H=document.createElement("div"),document.body.appendChild(H));for(R in r)if(!!r.hasOwnProperty(R)){S=r[R][0].length,T=r[R].length;var ot=document.createElement("canvas");ot.width=S*n,ot.height=T*n;var lt=ot.getContext("2d");for(A=0;A"))},history:function(R){v.ui.toggleHistoryMenu(R)},zoomIn:function(){v.ui.toggleZoomButtonStatus("zoomIn"),v.deactivateAll(),S()},zoomOut:function(){v._graphics.zoomOut()},hand:function(){v.ui.offZoomInButtonStatus(),v.ui.toggleZoomButtonStatus("hand"),v.deactivateAll(),T()}},this._commonAction())},_iconAction:function(){var v=this;return G()({changeColor:function(l){v.activeObjectId&&v.changeIconColor(v.activeObjectId,l)},addIcon:function(l,n){v.startDrawingMode("ICON"),v.setDrawingIcon(l,n)},cancelAddIcon:function(){v.ui.icon.clearIconType(),v.changeSelectableAll(!0),v.changeCursor("default"),v.stopDrawingMode()},registerDefaultIcons:function(l,n){var h={};h[l]=n,v.registerIcons(h)},registerCustomIcon:function(l,n){var h=new Dn;h.imageToSVG(l,function(S){var T=S.match(/path[^>]*d="([^"]*)"/),k=ct(T,2),A=k[1],R={};R[n.name]=A,v.registerIcons(R),v.addIcon(n.name,{left:100,top:100})},Dn.tracerDefaultOption())}},this._commonAction())},_drawAction:function(){var v=this;return G()({setDrawMode:function(l,n){v.stopDrawingMode(),l==="free"?v.startDrawingMode("FREE_DRAWING",n):v.startDrawingMode("LINE_DRAWING",n)},setColor:function(l){v.setBrush({color:l})}},this._commonAction())},_maskAction:function(){var v=this;return G()({loadImageFromURL:function(l,n){return v.loadImageFromURL(v.toDataURL(),"FilterImage").then(function(){v.addImageObject(l).then(function(){V().revokeObjectURL(n)}),v._invoker.fire(Et.EXECUTE_COMMAND,he.LOAD_MASK_IMAGE)})},applyFilter:function(){v.applyFilter("mask",{maskObjId:v.activeObjectId})}},this._commonAction())},_textAction:function(){var v=this;return G()({changeTextStyle:function(l,n){v.activeObjectId&&v.changeTextStyle(v.activeObjectId,l,n)}},this._commonAction())},_rotateAction:function(){var v=this;return G()({rotate:function(l,n){v.rotate(l,n),v.ui.resizeEditor(),v.ui.rotate.setRangeBarAngle("rotate",l)},setAngle:function(l,n){v.setAngle(l,n),v.ui.resizeEditor(),v.ui.rotate.setRangeBarAngle("setAngle",l)}},this._commonAction())},_shapeAction:function(){var v=this;return G()({changeShape:function(l,n){v.activeObjectId&&v.changeShape(v.activeObjectId,l,n)},setDrawingShape:function(l){v.setDrawingShape(l)}},this._commonAction())},_cropAction:function(){var v=this;return G()({crop:function(){var l=v.getCropzoneRect();l&&!jr(l)&&v.crop(l).then(function(){v.stopDrawingMode(),v.ui.resizeEditor(),v.ui.changeMenu("crop"),v._invoker.fire(Et.EXECUTE_COMMAND,he.CROP)}).catch(function(n){return dt().reject(n)})},cancel:function(){v.stopDrawingMode(),v.ui.changeMenu("crop")},preset:function(l){switch(l){case"preset-square":v.setCropzoneRect(1/1);break;case"preset-3-2":v.setCropzoneRect(3/2);break;case"preset-4-3":v.setCropzoneRect(4/3);break;case"preset-5-4":v.setCropzoneRect(5/4);break;case"preset-7-5":v.setCropzoneRect(7/5);break;case"preset-16-9":v.setCropzoneRect(16/9);break;default:v.setCropzoneRect(),v.ui.crop.changeApplyButtonStatus(!1);break}}},this._commonAction())},_resizeAction:function(){var v=this;return G()({getCurrentDimensions:function(){return v._graphics.getCurrentDimensions()},preview:function(l,n,h){var S=v._graphics.getCurrentDimensions(),T=function(){return S.width/S.height},k={};switch(l){case"width":k.width=n,h?k.height=n/T():k.height=S.height;break;case"height":k.height=n,h?k.width=n*T():k.width=S.width;break;default:k=S}v._graphics.resize(k).then(function(){v.ui.resizeEditor()}),h&&(v.ui.resize.setWidthValue(k.width),v.ui.resize.setHeightValue(k.height))},lockAspectRatio:function(l,n,h){var S=v._graphics.getCurrentDimensions(),T=S.width,k=S.height,A=T/k;if(l)if(T>k){var R=h/A,H=n*A;v.ui.resize.setLimit({minWidth:H>n?H:n,minHeight:n,maxWidth:h,maxHeight:Rn?lt:n,maxWidth:ot0&&arguments[0]!==void 0?arguments[0]:null;l||(l=v._graphics.getCurrentDimensions()),v.resize(l).then(function(){v._graphics.setOriginalDimensions(l),v.stopDrawingMode(),v.ui.resizeEditor(),v.ui.changeMenu("resize")}).catch(function(n){return dt().reject(n)})},reset:function(){var l=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1,n=v._graphics.getOriginalDimensions();v.ui.resize.setWidthValue(n.width,!0),v.ui.resize.setHeightValue(n.height,!0),v._graphics.resize(n).then(function(){l||(v.stopDrawingMode(),v.ui.resizeEditor(),v.ui.changeMenu("resize"))})}},this._commonAction())},_flipAction:function(){var v=this;return G()({flip:function(l){return v[l]()}},this._commonAction())},_filterAction:function(){var v=this;return G()({applyFilter:function(l,n,h,S){l?v.applyFilter(n,h,S):v.hasFilter(n)&&v.removeFilter(n)}},this._commonAction())},setReAction:function(){var v=this;this.on({undoStackChanged:function(l){l?(v.ui.changeHelpButtonEnabled("undo",!0),v.ui.changeHelpButtonEnabled("reset",!0)):(v.ui.changeHelpButtonEnabled("undo",!1),v.ui.changeHelpButtonEnabled("reset",!1)),v.ui.resizeEditor()},redoStackChanged:function(l){l?v.ui.changeHelpButtonEnabled("redo",!0):v.ui.changeHelpButtonEnabled("redo",!1),v.ui.resizeEditor()},objectActivated:function(l){var n,h;v.activeObjectId=l.id,v.ui.changeHelpButtonEnabled("delete",!0),v.ui.changeHelpButtonEnabled("deleteAll",!0),l.type==="cropzone"?v.ui.crop.changeApplyButtonStatus(!0):c()(n=["rect","circle","triangle"]).call(n,l.type)>-1?(v.stopDrawingMode(),v.ui.submenu!=="shape"&&v.ui.changeMenu("shape",!1,!1),v.ui.shape.setShapeStatus({strokeColor:l.stroke,strokeWidth:l.strokeWidth,fillColor:St()(l)}),v.ui.shape.setMaxStrokeValue(Math.min(l.width,l.height))):l.type==="path"||l.type==="line"?v.ui.submenu!=="draw"&&(v.ui.changeMenu("draw",!1,!1),v.ui.draw.changeStandbyMode()):c()(h=["i-text","text"]).call(h,l.type)>-1?(v.ui.submenu!=="text"&&v.ui.changeMenu("text",!1,!1),v.ui.text.setTextStyleStateOnAction(l)):l.type==="icon"&&(v.stopDrawingMode(),v.ui.submenu!=="icon"&&v.ui.changeMenu("icon",!1,!1),v.ui.icon.setIconPickerColor(St()(l)))},addText:function(l){var n=v.ui.text,h=n.textColor,S=n.fontSize,T=n.fontStyle,k=n.fontWeight,A=n.underline,R="Noto Sans";v.addText("Double Click",{position:l.originPosition,styles:{fill:h,fontSize:S,fontFamily:R,fontStyle:T,fontWeight:k,underline:A}}).then(function(){v.changeCursor("default")})},addObjectAfter:function(l){var n;l.type==="icon"?v.ui.icon.changeStandbyMode():c()(n=["rect","circle","triangle"]).call(n,l.type)>-1&&(v.ui.shape.setMaxStrokeValue(Math.min(l.width,l.height)),v.ui.shape.changeStandbyMode())},objectScaled:function(l){var n,h;if(c()(n=["i-text","text"]).call(n,l.type)>-1)v.ui.text.fontSize=Rt(l.fontSize);else if(c()(h=["rect","circle","triangle"]).call(h,l.type)>=0){var S=l.width,T=l.height,k=v.ui.shape.getStrokeValue();S=0}function bi(w,v){return w>v?"width":"height"}var Go=q.fabric.util.createClass(q.fabric.Rect,{initialize:function(v,r,l){r=G()(r,l),r.type="cropzone",this.callSuper("initialize",r),this._addEventHandler(),this.canvas=v,this.options=r},canvasEventDelegation:function(v){var r,l="unregistered",n=this.canvasEventTrigger[v]!==Qi;return n?l="registered":c()(r=[Et.OBJECT_MOVED,Et.OBJECT_SCALED]).call(r,v)<0&&(l="none"),l},canvasEventRegister:function(v,r){this.canvasEventTrigger[v]=r},_addEventHandler:function(){var v,r,l,n,h;this.canvasEventTrigger=(v={},B(v,Et.OBJECT_MOVED,Qi),B(v,Et.OBJECT_SCALED,Qi),v),this.on({moving:K()(r=this._onMoving).call(r,this),scaling:K()(l=this._onScaling).call(l,this)}),q.fabric.util.addListener(document,"keydown",K()(n=this._onKeyDown).call(n,this)),q.fabric.util.addListener(document,"keyup",K()(h=this._onKeyUp).call(h,this))},_renderCropzone:function(v){var r=7,l=7,n=this.flipX?-1:1,h=this.flipY?-1:1,S=n/this.scaleX,T=h/this.scaleY;v.scale(S,T),this._fillOuterRect(v,"rgba(0, 0, 0, 0.5)"),this.options.lineWidth?(this._fillInnerRect(v),this._strokeBorder(v,"rgb(255, 255, 255)",{lineWidth:this.options.lineWidth})):(this._strokeBorder(v,"rgb(0, 0, 0)",{lineDashWidth:r}),this._strokeBorder(v,"rgb(255, 255, 255)",{lineDashWidth:r,lineDashOffset:l})),v.scale(1/S,1/T)},_render:function(v){this.callSuper("_render",v),this._renderCropzone(v)},_fillOuterRect:function(v,r){var l=this._getCoordinates(),n=l.x,h=l.y;v.save(),v.fillStyle=r,v.beginPath(),v.moveTo(n[0]-1,h[0]-1),v.lineTo(n[3]+1,h[0]-1),v.lineTo(n[3]+1,h[3]+1),v.lineTo(n[0]-1,h[3]+1),v.lineTo(n[0]-1,h[0]-1),v.closePath(),v.moveTo(n[1],h[1]),v.lineTo(n[1],h[2]),v.lineTo(n[2],h[2]),v.lineTo(n[2],h[1]),v.lineTo(n[1],h[1]),v.closePath(),St()(v).call(v),v.restore()},_fillInnerRect:function(v){var r=this._getCoordinates(),l=r.x,n=r.y,h=this._caculateInnerPosition(l,(l[2]-l[1])/3),S=this._caculateInnerPosition(n,(n[2]-n[1])/3);v.save(),v.strokeStyle="rgba(255, 255, 255, 0.7)",v.lineWidth=this.options.lineWidth,v.beginPath(),v.moveTo(h[0],S[1]),v.lineTo(h[3],S[1]),v.moveTo(h[0],S[2]),v.lineTo(h[3],S[2]),v.moveTo(h[1],S[0]),v.lineTo(h[1],S[3]),v.moveTo(h[2],S[0]),v.lineTo(h[2],S[3]),v.stroke(),v.closePath(),v.restore()},_caculateInnerPosition:function(v,r){var l=[];return l[0]=v[1],l[1]=v[1]+r,l[2]=v[1]+r*2,l[3]=v[2],l},_getCoordinates:function(){var v,r,l=this.canvas,n=this.width,h=this.height,S=this.left,T=this.top,k=n/2,A=h/2,R=l.getHeight(),H=l.getWidth();return{x:We()(v=[-(k+S),-k,k,k+(H-S-n)]).call(v,Math.ceil),y:We()(r=[-(A+T),-A,A,A+(R-T-h)]).call(r,Math.ceil)}},_strokeBorder:function(v,r,l){var n=l.lineDashWidth,h=l.lineDashOffset,S=l.lineWidth,T=this.width/2,k=this.height/2;v.save(),v.strokeStyle=r,v.setLineDash&&v.setLineDash([n,n]),h&&(v.lineDashOffset=h),S&&(v.lineWidth=S),v.beginPath(),v.moveTo(-T,-k),v.lineTo(T,-k),v.lineTo(T,k),v.lineTo(-T,k),v.lineTo(-T,-k),v.stroke(),v.restore()},_onMoving:function(){var v=this.height,r=this.width,l=this.left,n=this.top,h=this.canvas.getWidth()-r,S=this.canvas.getHeight()-v;this.left=se(l,0,h),this.top=se(n,0,S),this.canvasEventTrigger[Et.OBJECT_MOVED](this)},_onScaling:function(v){var r=v.transform.corner,l=this.canvas.getPointer(v.e),n=this._calcScalingSizeFromPointer(l,r);this.scale(1).set(n),this.canvasEventTrigger[Et.OBJECT_SCALED](this)},_calcScalingSizeFromPointer:function(v,r){var l=Wo(r);return l&&this._resizeCropZone(v,r)},adjustRatioCropzoneSize:function(v){var r=v.width,l=v.height,n=v.leftMaker,h=v.topMaker,S=v.maxWidth,T=v.maxHeight,k=v.scaleTo;if(r=S?se(r,1,S):r,l=T?se(l,1,T):l,!this.presetRatio)return this._withShiftKey&&(r>l?l=r:l>r&&(r=l)),{width:r,height:l,left:n(r),top:h(l)};k==="width"?l=r/this.presetRatio:r=l*this.presetRatio;var A=Math.min(S/r,T/l);if(A<=1){var R,H=We()(R=[r,l]).call(R,function(lt){return lt*A}),ot=ct(H,2);r=ot[0],l=ot[1]}return{width:r,height:l,left:n(r),top:h(l)}},_getCropzoneRectInfo:function(){var v=this.canvas,r=v.width,l=v.height,n=this.getBoundingRect(!1,!0),h=n.top,S=n.left,T=n.width,k=n.height;return{rectTop:h,rectLeft:S,rectWidth:T,rectHeight:k,rectRight:S+T,rectBottom:h+k,canvasWidth:r,canvasHeight:l}},_resizeCropZone:function(v,r){var l=v.x,n=v.y,h=this._getCropzoneRectInfo(),S=h.rectWidth,T=h.rectHeight,k=h.rectTop,A=h.rectLeft,R=h.rectBottom,H=h.rectRight,ot=h.canvasWidth,lt=h.canvasHeight,mt={tl:{width:H-l,height:R-n,leftMaker:function(pt){return H-pt},topMaker:function(pt){return R-pt},maxWidth:H,maxHeight:R,scaleTo:bi(A-l,k-n)},tr:{width:l-A,height:R-n,leftMaker:function(){return A},topMaker:function(pt){return R-pt},maxWidth:ot-A,maxHeight:R,scaleTo:bi(l-H,k-n)},mt:{width:S,height:R-n,leftMaker:function(){return A},topMaker:function(pt){return R-pt},maxWidth:ot-A,maxHeight:R,scaleTo:"height"},ml:{width:H-l,height:T,leftMaker:function(pt){return H-pt},topMaker:function(){return k},maxWidth:H,maxHeight:lt-k,scaleTo:"width"},mr:{width:l-A,height:T,leftMaker:function(){return A},topMaker:function(){return k},maxWidth:ot-A,maxHeight:lt-k,scaleTo:"width"},mb:{width:S,height:n-k,leftMaker:function(){return A},topMaker:function(){return k},maxWidth:ot-A,maxHeight:lt-k,scaleTo:"height"},bl:{width:H-l,height:n-k,leftMaker:function(pt){return H-pt},topMaker:function(){return k},maxWidth:H,maxHeight:lt-k,scaleTo:bi(A-l,n-R)},br:{width:l-A,height:n-k,leftMaker:function(){return A},topMaker:function(){return k},maxWidth:ot-A,maxHeight:lt-k,scaleTo:bi(l-H,n-R)}};return this.adjustRatioCropzoneSize(mt[r])},isValid:function(){return this.left>=0&&this.top>=0&&this.width>0&&this.height>0},_onKeyDown:function(v){var r=v.keyCode;r===xe.SHIFT&&(this._withShiftKey=!0)},_onKeyUp:function(v){var r=v.keyCode;r===xe.SHIFT&&(this._withShiftKey=!1)}}),Xo=Go;function Zo(w){var v=Vo();return function(){var l=ee(w),n;if(v){var h=ee(this).constructor;n=At()(l,arguments,h)}else n=l.apply(this,arguments);return ye(this,n)}}function Vo(){if(typeof Reflect=="undefined"||!At()||At().sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(At()(Boolean,[],function(){})),!0}catch(w){return!1}}var Jo=10,Qo={presetRatio:null,top:-10,left:-10,height:1,width:1},Ko=function(w){me(r,w);var v=Zo(r);function r(l){var n,h,S,T,k,A;return Y(this,r),A=v.call(this,Bt.CROPPER,l),A._cropzone=null,A._startX=null,A._startY=null,A._withShiftKey=!1,A._listeners={keydown:K()(n=A._onKeyDown).call(n,fe(A)),keyup:K()(h=A._onKeyUp).call(h,fe(A)),mousedown:K()(S=A._onFabricMouseDown).call(S,fe(A)),mousemove:K()(T=A._onFabricMouseMove).call(T,fe(A)),mouseup:K()(k=A._onFabricMouseUp).call(k,fe(A))},A}return it(r,[{key:"start",value:function(){if(!this._cropzone){var n=this.getCanvas();n.forEachObject(function(h){h.evented=!1}),this._cropzone=new Xo(n,G()({left:0,top:0,width:.5,height:.5,strokeWidth:0,cornerSize:10,cornerColor:"black",fill:"transparent"},Me,this.graphics.cropSelectionStyle)),n.discardActiveObject(),n.add(this._cropzone),n.on("mouse:down",this._listeners.mousedown),n.selection=!1,n.defaultCursor="crosshair",q.fabric.util.addListener(document,"keydown",this._listeners.keydown),q.fabric.util.addListener(document,"keyup",this._listeners.keyup)}}},{key:"end",value:function(){var n=this.getCanvas(),h=this._cropzone;!h||(n.remove(h),n.selection=!0,n.defaultCursor="default",n.off("mouse:down",this._listeners.mousedown),n.forEachObject(function(S){S.evented=!0}),this._cropzone=null,q.fabric.util.removeListener(document,"keydown",this._listeners.keydown),q.fabric.util.removeListener(document,"keyup",this._listeners.keyup))}},{key:"changeVisibility",value:function(n){this._cropzone&&this._cropzone.set({visible:n})}},{key:"_onFabricMouseDown",value:function(n){var h=this.getCanvas();if(!n.target){h.selection=!1;var S=h.getPointer(n.e);this._startX=S.x,this._startY=S.y,h.on({"mouse:move":this._listeners.mousemove,"mouse:up":this._listeners.mouseup})}}},{key:"_onFabricMouseMove",value:function(n){var h=this.getCanvas(),S=h.getPointer(n.e),T=S.x,k=S.y,A=this._cropzone;Math.abs(T-this._startX)+Math.abs(k-this._startY)>Jo&&(h.remove(A),A.set(this._calcRectDimensionFromPoint(T,k,A.presetRatio)),h.add(A),h.setActiveObject(A))}},{key:"_calcRectDimensionFromPoint",value:function(n,h){var S=arguments.length>2&&arguments[2]!==void 0?arguments[2]:null,T=this.getCanvas(),k=T.getWidth(),A=T.getHeight(),R=this._startX,H=this._startY,ot=se(n,0,R),lt=se(h,0,H),mt=se(n,R,k)-ot,ut=se(h,H,A)-lt;return this._withShiftKey&&!S?(mt>ut?ut=mt:ut>mt&&(mt=ut),R>=n&&(ot=R-mt),H>=h&&(lt=H-ut)):S&&(ut=mt/S,R>=n&&(ot=se(R-mt,0,k)),H>=h&&(lt=se(H-ut,0,A)),lt+ut>A&&(ut=A-lt,mt=ut*S,R>=n&&(ot=se(R-mt,0,k)),H>=h&&(lt=se(H-ut,0,A)))),{left:ot,top:lt,width:mt,height:ut}}},{key:"_onFabricMouseUp",value:function(){var n=this._cropzone,h=this._listeners,S=this.getCanvas();S.setActiveObject(n),S.off({"mouse:move":h.mousemove,"mouse:up":h.mouseup})}},{key:"getCroppedImageData",value:function(n){var h=this.getCanvas(),S=h.contains(this._cropzone);if(!n)return null;S&&h.remove(this._cropzone);var T={imageName:this.getImageName(),url:h.toDataURL(n)};return S&&h.add(this._cropzone),T}},{key:"getCropzoneRect",value:function(){var n=this._cropzone;return n.isValid()?{left:n.left,top:n.top,width:n.width,height:n.height}:null}},{key:"setCropzoneRect",value:function(n){var h=this.getCanvas(),S=this._cropzone;h.discardActiveObject(),h.selection=!1,h.remove(S),S.set(n?this._getPresetPropertiesForCropSize(n):Qo),h.add(S),h.selection=!0,n&&h.setActiveObject(S)}},{key:"_getPresetPropertiesForCropSize",value:function(n){var h,S,T=this.getCanvas(),k=T.getWidth(),A=T.getHeight(),R=k>=A?k:A,H=function(Ht,ge){return Ht>ge?ge/Ht:1},ot=R*n,lt=R,mt=H(ot,k),ut=We()(h=[ot,lt]).call(h,function(oe){return oe*mt}),pt=ct(ut,2);ot=pt[0],lt=pt[1];var jt=H(lt,A),ie=We()(S=[ot,lt]).call(S,function(oe){return wr(oe*jt)}),re=ct(ie,2);return ot=re[0],lt=re[1],{presetRatio:n,top:(A-lt)/2,left:(k-ot)/2,width:ot,height:lt}}},{key:"_onKeyDown",value:function(n){n.keyCode===xe.SHIFT&&(this._withShiftKey=!0)}},{key:"_onKeyUp",value:function(n){n.keyCode===xe.SHIFT&&(this._withShiftKey=!1)}}]),r}(ze),$o=Ko;function qo(w){var v=ts();return function(){var l=ee(w),n;if(v){var h=ee(this).constructor;n=At()(l,arguments,h)}else n=l.apply(this,arguments);return ye(this,n)}}function ts(){if(typeof Reflect=="undefined"||!At()||At().sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(At()(Boolean,[],function(){})),!0}catch(w){return!1}}var es=function(w){me(r,w);var v=qo(r);function r(l){return Y(this,r),v.call(this,Bt.FLIP,l)}return it(r,[{key:"getCurrentSetting",value:function(){var n=this.getCanvasImage();return{flipX:n.flipX,flipY:n.flipY}}},{key:"set",value:function(n){var h=this.getCurrentSetting(),S=h.flipX!==n.flipX,T=h.flipY!==n.flipY;return!S&&!T?dt().reject(pe.flip):(G()(h,n),this.setImageProperties(h,!0),this._invertAngle(S,T),this._flipObjects(S,T),dt().resolve({flipX:h.flipX,flipY:h.flipY,angle:this.getCanvasImage().angle}))}},{key:"_invertAngle",value:function(n,h){var S=this.getCanvasImage(),T=S.angle;n&&(T*=-1),h&&(T*=-1),S.rotate(Ve()(T)).setCoords()}},{key:"_flipObjects",value:function(n,h){var S=this.getCanvas();n&&S.forEachObject(function(T){T.set({angle:Ve()(T.angle*-1),flipX:!T.flipX,left:S.width-T.left}).setCoords()}),h&&S.forEachObject(function(T){T.set({angle:Ve()(T.angle*-1),flipY:!T.flipY,top:S.height-T.top}).setCoords()}),S.renderAll()}},{key:"reset",value:function(){return this.set({flipX:!1,flipY:!1})}},{key:"flipX",value:function(){var n=this.getCurrentSetting();return this.set({flipX:!n.flipX,flipY:n.flipY})}},{key:"flipY",value:function(){var n=this.getCurrentSetting();return this.set({flipX:n.flipX,flipY:!n.flipY})}}]),r}(ze),is=es;function ns(w){var v=rs();return function(){var l=ee(w),n;if(v){var h=ee(this).constructor;n=At()(l,arguments,h)}else n=l.apply(this,arguments);return ye(this,n)}}function rs(){if(typeof Reflect=="undefined"||!At()||At().sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(At()(Boolean,[],function(){})),!0}catch(w){return!1}}var as=function(w){me(r,w);var v=ns(r);function r(l){return Y(this,r),v.call(this,Bt.ROTATION,l)}return it(r,[{key:"getCurrentAngle",value:function(){return this.getCanvasImage().angle}},{key:"setAngle",value:function(n){var h=this.getCurrentAngle()%360;n%=360;var S=this.getCanvasImage(),T=S.getCenterPoint();S.set({angle:n}).setCoords(),this.adjustCanvasDimension();var k=S.getCenterPoint();return this._rotateForEachObject(T,k,n-h),dt().resolve(n)}},{key:"_rotateForEachObject",value:function(n,h,S){var T=this.getCanvas(),k={x:n.x-h.x,y:n.y-h.y};T.forEachObject(function(A){var R=A.getCenterPoint(),H=q.fabric.util.degreesToRadians(S),ot=q.fabric.util.rotatePoint(R,n,H);A.set({left:ot.x-k.x,top:ot.y-k.y,angle:(A.angle+S)%360}),A.setCoords()}),T.renderAll()}},{key:"rotate",value:function(n){var h=this.getCurrentAngle();return this.setAngle(h+n)}}]),r}(ze),os=as;function ss(w){var v=ls();return function(){var l=ee(w),n;if(v){var h=ee(this).constructor;n=At()(l,arguments,h)}else n=l.apply(this,arguments);return ye(this,n)}}function ls(){if(typeof Reflect=="undefined"||!At()||At().sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(At()(Boolean,[],function(){})),!0}catch(w){return!1}}var cs=function(w){me(r,w);var v=ss(r);function r(l){var n;return Y(this,r),n=v.call(this,Bt.FREE_DRAWING,l),n.width=12,n.oColor=new q.fabric.Color("rgba(0, 0, 0, 0.5)"),n}return it(r,[{key:"start",value:function(n){var h=this.getCanvas();h.isDrawingMode=!0,this.setBrush(n)}},{key:"setBrush",value:function(n){var h=this.getCanvas().freeDrawingBrush;n=n||{},this.width=n.width||this.width,n.color&&(this.oColor=new q.fabric.Color(n.color)),h.width=this.width,h.color=this.oColor.toRgba()}},{key:"end",value:function(){var n=this.getCanvas();n.isDrawingMode=!1}}]),r}(ze),us=cs,_n=30,hs=2.7,fs=1.7,kn=180,ds=q.fabric.util.createClass(q.fabric.Line,{type:"line",initialize:function(v){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};this.callSuper("initialize",v,r),this.arrowType=r.arrowType},_render:function(v){var r=this.calcLinePoints(),l=r.x1,n=r.y1,h=r.x2,S=r.y2,T={fromX:l,fromY:n,toX:h,toY:S};this.ctx=v,v.lineWidth=this.strokeWidth,this._renderBasicLinePath(T),this._drawDecoratorPath(T),this._renderStroke(v)},_renderBasicLinePath:function(v){var r=v.fromX,l=v.fromY,n=v.toX,h=v.toY;this.ctx.beginPath(),this.ctx.moveTo(r,l),this.ctx.lineTo(n,h)},_drawDecoratorPath:function(v){this._drawDecoratorPathType("head",v),this._drawDecoratorPathType("tail",v)},_drawDecoratorPathType:function(v,r){switch(this.arrowType[v]){case"triangle":this._drawTrianglePath(v,r);break;case"chevron":this._drawChevronPath(v,r);break;default:break}},_drawTrianglePath:function(v,r){var l=this.ctx.lineWidth*fs;this._drawChevronPath(v,r,l),this.ctx.closePath()},_drawChevronPath:function(v,r,l){var n=this,h=r.fromX,S=r.fromY,T=r.toX,k=r.toY,A=this.ctx;l||(l=this.ctx.lineWidth*hs);var R=v==="head"?[h,S]:[T,k],H=ct(R,2),ot=H[0],lt=H[1],mt=v==="head"?[T,k]:[h,S],ut=ct(mt,2),pt=ut[0],jt=ut[1],ie=Math.atan2(jt-lt,pt-ot)*kn/Math.PI,re=function(Ht){return n.getRotatePosition(l,Ht,{x:ot,y:lt})};A.moveTo.apply(A,L(re(ie+_n))),A.lineTo(ot,lt),A.lineTo.apply(A,L(re(ie-_n)))},getRotatePosition:function(v,r,l){var n=r*Math.PI/kn,h=l.x,S=l.y;return[v*Math.cos(n)+h,v*Math.sin(n)+S]}}),gs=ds;function vs(w){var v=ps();return function(){var l=ee(w),n;if(v){var h=ee(this).constructor;n=At()(l,arguments,h)}else n=l.apply(this,arguments);return ye(this,n)}}function ps(){if(typeof Reflect=="undefined"||!At()||At().sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(At()(Boolean,[],function(){})),!0}catch(w){return!1}}var ms=function(w){me(r,w);var v=vs(r);function r(l){var n,h,S,T;return Y(this,r),T=v.call(this,Bt.LINE,l),T._width=12,T._oColor=new q.fabric.Color("rgba(0, 0, 0, 0.5)"),T._listeners={mousedown:K()(n=T._onFabricMouseDown).call(n,fe(T)),mousemove:K()(h=T._onFabricMouseMove).call(h,fe(T)),mouseup:K()(S=T._onFabricMouseUp).call(S,fe(T))},T}return it(r,[{key:"setHeadOption",value:function(n){var h=n.arrowType,S=h===void 0?{head:null,tail:null}:h;this._arrowType=S}},{key:"start",value:function(){var n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},h=this.getCanvas();h.defaultCursor="crosshair",h.selection=!1,this.setHeadOption(n),this.setBrush(n),h.forEachObject(function(S){S.set({evented:!1})}),h.on({"mouse:down":this._listeners.mousedown})}},{key:"setBrush",value:function(n){var h=this.getCanvas().freeDrawingBrush;n=n||{},this._width=n.width||this._width,n.color&&(this._oColor=new q.fabric.Color(n.color)),h.width=this._width,h.color=this._oColor.toRgba()}},{key:"end",value:function(){var n=this.getCanvas();n.defaultCursor="default",n.selection=!0,n.forEachObject(function(h){h.set({evented:!0})}),n.off("mouse:down",this._listeners.mousedown)}},{key:"_onFabricMouseDown",value:function(n){var h=this.getCanvas(),S=h.getPointer(n.e),T=S.x,k=S.y,A=[T,k,T,k];this._line=new gs(A,{stroke:this._oColor.toRgba(),strokeWidth:this._width,arrowType:this._arrowType,evented:!1}),this._line.set(Be.SELECTION_STYLE),h.add(this._line),h.on({"mouse:move":this._listeners.mousemove,"mouse:up":this._listeners.mouseup}),this.fire(Et.ADD_OBJECT,this._createLineEventObjectProperties())}},{key:"_onFabricMouseMove",value:function(n){var h=this.getCanvas(),S=h.getPointer(n.e);this._line.set({x2:S.x,y2:S.y}),this._line.setCoords(),h.renderAll()}},{key:"_onFabricMouseUp",value:function(){var n=this.getCanvas();this.fire(Et.OBJECT_ADDED,this._createLineEventObjectProperties()),this._line=null,n.off({"mouse:move":this._listeners.mousemove,"mouse:up":this._listeners.mouseup})}},{key:"_createLineEventObjectProperties",value:function(){var n=this.graphics.createObjectProperties(this._line),h=this._line,S=h.x1,T=h.x2,k=h.y1,A=h.y2;return G()({},n,{startPosition:{x:S,y:k},endPosition:{x:T,y:A}})}}]),r}(ze),ys=ms;function Cs(w){var v=Ss();return function(){var l=ee(w),n;if(v){var h=ee(this).constructor;n=At()(l,arguments,h)}else n=l.apply(this,arguments);return ye(this,n)}}function Ss(){if(typeof Reflect=="undefined"||!At()||At().sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(At()(Boolean,[],function(){})),!0}catch(w){return!1}}var xs={fill:"#000000",left:0,top:0},Is={fill:"#000000",fontStyle:"normal",fontWeight:"normal",textAlign:"tie-text-align-left",underline:!1},bs=500,Ms=function(w){me(r,w);var v=Cs(r);function r(l){var n,h,S,T,k,A;return Y(this,r),A=v.call(this,Bt.TEXT,l),A._defaultStyles=xs,A._isSelected=!1,A._selectedObj={},A._editingObj={},A._listeners={mousedown:K()(n=A._onFabricMouseDown).call(n,fe(A)),select:K()(h=A._onFabricSelect).call(h,fe(A)),selectClear:K()(S=A._onFabricSelectClear).call(S,fe(A)),scaling:K()(T=A._onFabricScaling).call(T,fe(A)),textChanged:K()(k=A._onFabricTextChanged).call(k,fe(A))},A._textarea=null,A._ratio=1,A._lastClickTime=new Date().getTime(),A._editingObjInfos={},A.isPrevEditing=!1,A}return it(r,[{key:"start",value:function(){var n=this,h=this.getCanvas();h.selection=!1,h.defaultCursor="text",h.on({"mouse:down":this._listeners.mousedown,"selection:created":this._listeners.select,"selection:updated":this._listeners.select,"before:selection:cleared":this._listeners.selectClear,"object:scaling":this._listeners.scaling,"text:changed":this._listeners.textChanged}),h.forEachObject(function(S){S.type==="i-text"&&n.adjustOriginPosition(S,"start")}),this.setCanvasRatio()}},{key:"end",value:function(){var n=this,h=this.getCanvas();h.selection=!0,h.defaultCursor="default",h.forEachObject(function(S){S.type==="i-text"&&(S.text===""?h.remove(S):n.adjustOriginPosition(S,"end"))}),h.off({"mouse:down":this._listeners.mousedown,"selection:created":this._listeners.select,"selection:updated":this._listeners.select,"before:selection:cleared":this._listeners.selectClear,"object:selected":this._listeners.select,"object:scaling":this._listeners.scaling,"text:changed":this._listeners.textChanged})}},{key:"adjustOriginPosition",value:function(n,h){var S="center",T="center";h==="start"&&(S="left",T="top");var k=n.getPointByOrigin(S,T),A=k.x,R=k.y;n.set({left:A,top:R,originX:S,originY:T}),n.setCoords()}},{key:"add",value:function(n,h){var S=this;return new(dt())(function(T){var k,A=S.getCanvas(),R=null,H=Be.SELECTION_STYLE,ot=S._defaultStyles;S._setInitPos(h.position),h.styles&&(ot=G()(ot,h.styles)),Cn()(h.autofocus)||(h.autofocus=!0),R=new q.fabric.IText(n,ot),H=G()({},H,{originX:"left",originY:"top"}),R.set(H),R.on({mouseup:K()(k=S._onFabricMouseUp).call(k,S)}),A.add(R),h.autofocus&&(R.enterEditing(),R.selectAll()),A.getActiveObject()||A.setActiveObject(R),S.isPrevEditing=!0,T(S.graphics.createObjectProperties(R))})}},{key:"change",value:function(n,h){var S=this;return new(dt())(function(T){n.set("text",h),S.getCanvas().renderAll(),T()})}},{key:"setStyle",value:function(n,h){var S=this;return new(dt())(function(T){X()(h,function(k,A){n[A]===k&&A!=="fontSize"&&(h[A]=Is[A]||"")},S),"textDecoration"in h&&G()(h,S._getTextDecorationAdaptObject(h.textDecoration)),n.set(h),S.getCanvas().renderAll(),T()})}},{key:"getText",value:function(n){return n.text}},{key:"setSelectedInfo",value:function(n,h){this._selectedObj=n,this._isSelected=h}},{key:"isSelected",value:function(){return this._isSelected}},{key:"getSelectedObj",value:function(){return this._selectedObj}},{key:"setCanvasRatio",value:function(){var n=this.getCanvasElement(),h=Ct()(n.style.maxWidth,10),S=n.width;this._ratio=S/h}},{key:"getCanvasRatio",value:function(){return this._ratio}},{key:"_getTextDecorationAdaptObject",value:function(n){return{underline:n==="underline",linethrough:n==="line-through",overline:n==="overline"}}},{key:"_setInitPos",value:function(n){n=n||this.getCanvasImage().getCenterPoint(),this._defaultStyles.left=n.x,this._defaultStyles.top=n.y}},{key:"_onInput",value:function(){var n=this.getCanvasRatio(),h=this._editingObj,S=this._textarea.style;S.width="".concat(Math.ceil(h.width/n),"px"),S.height="".concat(Math.ceil(h.height/n),"px")}},{key:"_onKeyDown",value:function(){var n=this,h=this.getCanvasRatio(),S=this._editingObj,T=this._textarea.style;t()(function(){S.text(n._textarea.value),T.width="".concat(Math.ceil(S.width/h),"px"),T.height="".concat(Math.ceil(S.height/h),"px")},0)}},{key:"_onBlur",value:function(){var n=this.getCanvasRatio(),h=this._editingObj,S=this._editingObjInfos,T=this._textarea.value,k=h.width/n-S.width/n,A=h.height/n-S.height/n;if(n===1&&(k/=2,A/=2),this._textarea.style.display="none",h.set({left:S.left+k,top:S.top+A}),T.length){this.getCanvas().add(h);var R={id:zt(h),type:h.type,text:T};this.fire(Et.TEXT_CHANGED,R)}}},{key:"_onScroll",value:function(){this._textarea.scrollLeft=0,this._textarea.scrollTop=0}},{key:"_onFabricScaling",value:function(n){var h=n.target;h.fontSize=h.fontSize*h.scaleY,h.scaleX=1,h.scaleY=1}},{key:"_onFabricTextChanged",value:function(n){this.fire(Et.TEXT_CHANGED,n.target)}},{key:"_onFabricSelectClear",value:function(n){var h=this.getSelectedObj();this.isPrevEditing=!0,this.setSelectedInfo(n.target,!1),h&&h.text===""&&this.getCanvas().remove(h)}},{key:"_onFabricSelect",value:function(n){this.isPrevEditing=!0,this.setSelectedInfo(n.target,!0)}},{key:"_onFabricMouseDown",value:function(n){var h=n.target;if(!(h&&!h.isType("text"))){if(this.isPrevEditing){this.isPrevEditing=!1;return}this._fireAddText(n)}}},{key:"_fireAddText",value:function(n){var h=n.target,S=n.e||{},T=this.getCanvas().getPointer(S);h||this.fire(Et.ADD_TEXT,{originPosition:{x:T.x,y:T.y},clientPosition:{x:S.clientX||0,y:S.clientY||0}})}},{key:"_onFabricMouseUp",value:function(n){var h=n.target,S=new Date().getTime();this._isDoubleClick(S)&&!h.isEditing&&h.enterEditing(),h.isEditing&&this.fire(Et.TEXT_EDITING),this._lastClickTime=S}},{key:"_isDoubleClick",value:function(n){return n-this._lastClickTimel},_getColor:function(v,r,l){var n=[0,0,0,0],h=v.data,S=v.width,T=4,k=(S*l+r)*T;return n[0]=h[k],n[1]=h[k+1],n[2]=h[k+2],n[3]=h[k+3],n}}),zs=Rs;function Bs(w){var v=Fs();return function(){var l=ee(w),n;if(v){var h=ee(this).constructor;n=At()(l,arguments,h)}else n=l.apply(this,arguments);return ye(this,n)}}function Fs(){if(typeof Reflect=="undefined"||!At()||At().sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(At()(Boolean,[],function(){})),!0}catch(w){return!1}}var Mi=q.fabric.Image.filters;Mi.Mask=ks,Mi.Sharpen=Ls,Mi.Emboss=Ns,Mi.ColorFilter=zs;var Hs=function(w){me(r,w);var v=Bs(r);function r(l){return Y(this,r),v.call(this,Bt.FILTER,l)}return it(r,[{key:"add",value:function(n,h){var S=this;return new(dt())(function(T,k){var A=S._getSourceImage(),R=S.getCanvas(),H=S._getFilter(A,n);H||(H=S._createFilter(A,n,h)),H||k(pe.invalidParameters),S._changeFilterValues(H,h),S._apply(A,function(){R.renderAll(),T({type:n,action:"add",options:h})})})}},{key:"remove",value:function(n){var h=this;return new(dt())(function(S,T){var k=h._getSourceImage(),A=h.getCanvas(),R=h.getOptions(n);k.filters.length||T(pe.unsupportedOperation),h._removeFilter(k,n),h._apply(k,function(){A.renderAll(),S({type:n,action:"remove",options:R})})})}},{key:"hasFilter",value:function(n){return!!this._getFilter(this._getSourceImage(),n)}},{key:"getOptions",value:function(n){var h=this._getSourceImage(),S=this._getFilter(h,n);return S?G()({},S.options):null}},{key:"_changeFilterValues",value:function(n,h){X()(h,function(S,T){F()(n[T])||(n[T]=S)}),X()(n.options,function(S,T){F()(h[T])||(n.options[T]=h[T])})}},{key:"_apply",value:function(n,h){n.filters.push();var S=n.applyFilters();S&&h()}},{key:"_getSourceImage",value:function(){return this.getCanvasImage()}},{key:"_createFilter",value:function(n,h,S){var T,k=this._getFabricFilterType(h),A=q.fabric.Image.filters[k];return A&&(T=new A(S),T.options=S,n.filters.push(T)),T}},{key:"_getFilter",value:function(n,h){var S=null;if(n){var T=this._getFabricFilterType(h),k=n.filters.length,A,R;for(R=0;Rut&&k>0&&(ot=R-Math.abs(S-ut)),T>pt&&A>0&&(lt=H-Math.abs(T-pt));var jt={x:(n-ot)/2,y:(h-lt)/2};return X()(["x","y"],function(ie){var re=jt[ie];if(re>0){var oe=w(ie,re,r,l),Ht=ct(oe,2);r=Ht[0],l=Ht[1]}}),[r,l,ot,lt]}function Vs(w,v){var r=v.left,l=v.top,n=v.width,h=v.height,S=v.cropX,T=v.cropY,k={width:n,height:h};return X()(["x","y"],function(A){var R=A==="x"?S:T,H=k[Ki[A]],ot=ui[Ki[A]];if(H>ot){var lt=(H-ot)/2;k[Ki[A]]=ot;var mt=w(A,lt,r,l),ut=ct(mt,2);r=ut[0],l=ut[1]}if(R<0){var pt=w(A,R,r,l),jt=ct(pt,2);r=jt[0],l=jt[1]}}),[r,l,k.width,k.height]}function Ln(w,v,r){var l=jn(w),n=Rn(l,w.angle,v);r.add(n);var h={fill:new q.fabric.Pattern({source:r.getElement(),repeat:"no-repeat"})};return Xi(h,{patternSourceCanvas:r}),h}function Js(w){var v=w.getObjects(),r=ct(v,1),l=r[0],n=oi(l,"fillImageMaxSize"),h=n.fillImageMaxSize;h=Math.max(1,h),w.setDimensions({width:h,height:h}),w.renderAll()}function Qs(w,v){var r=oi(w,"patternSourceCanvas"),l=r.patternSourceCanvas,n=l.getObjects(),h=ct(n,1),S=h[0],T=$i(S);l.remove(S);var k=jn(v,!0),A=Rn(k,v.angle,T);l.add(A)}function jn(w){var v=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;return(!ui||v)&&(ui=w.toCanvasElement()),ui}function Ks(w){var v=w.type,r=w.shapeObj,l=w.outDistance,n=w.left,h=w.top,S=w.flipX,T=w.flipY,k=Nn(r),A=[[1,2],[0,3],[0,3],[1,2]],R=qs(v,k,A),H=tl(v,k,R),ot=R.startPointIndex,lt=$s({outDistance:l,startPointIndex:ot,flipX:S,flipY:T,reatAngles:H});return[n+lt.left,h+lt.top]}function $s(w){var v=w.outDistance,r=w.startPointIndex,l=w.flipX,n=w.flipY,h=w.reatAngles,S=v*Math.cos(h[0]*Math.PI/180),T=v*Math.cos(h[1]*Math.PI/180),k=r===2||r===3,A={top:k?S:T,left:k?T:S};return el(r,l,n)&&(A.left=A.left*-1),il(r,l,n)&&(A.top=A.top*-1),A}function qs(w,v,r){var l=0,n=0;X()(v,function(k,A){k[w]qi&&(S.remove(R),R.set(this._calcRectDimensionFromPoint(k,A)),S.add(R))}},{key:"_calcRectDimensionFromPoint",value:function(n,h){var S=this.getCanvas(),T=S.getWidth(),k=S.getHeight(),A=this._startPoint,R=A.x,H=A.y,ot=Math.min,lt=ot(R,n),mt=ot(H,h),ut=se(n,R,T)-lt,pt=se(h,H,k)-mt;return{left:lt,top:mt,width:ut,height:pt}}},{key:"_onMouseUpWithZoomMode",value:function(){var n=this.zoomLevel,h=this.zoomArea,S=this._listeners,T=S.moveZoom,k=S.stopZoom,A=this.getCanvas(),R=this._getCenterPoint(),H=R.x,ot=R.y;this._isMaxZoomLevel()||(this._centerPoints.push({x:H,y:ot,prevZoomLevel:n,zoomLevel:n+1}),n+=1,A.zoomToPoint({x:H,y:ot},n),this._fireZoomChanged(A,n),this.zoomLevel=n),A.off({"mouse:move":T,"mouse:up":k}),A.remove(h),this._startPoint=null}},{key:"_getCenterPoint",value:function(){var n=this.zoomArea,h=n.left,S=n.top,T=n.width,k=n.height,A=this._startPoint,R=A.x,H=A.y,ot=this.aspectRatio;return Tk?{x:h+ot*k/2,y:S+k/2}:{x:h+T/2,y:S+T/ot/2}}},{key:"zoom",value:function(n){for(var h=n.x,S=n.y,T=arguments.length>1&&arguments[1]!==void 0?arguments[1]:this.zoomLevel,k=this.getCanvas(),A=this._centerPoints,R=A.length-1;R>=0&&!(A[R].zoomLevel=5}},{key:"_movePointOfZoom",value:function(n){var h=n.x,S=n.y,T=this._centerPoints;if(!!T.length){var k=this.getCanvas(),A=this.zoomLevel,R=T.pop(),H=R.x,ot=R.y,lt=R.prevZoomLevel,mt=H-h,ut=ot-S;k.zoomToPoint({x:H,y:ot},lt),k.zoomToPoint({x:mt,y:ut},A),T.push({x:mt,y:ut,prevZoomLevel:lt,zoomLevel:A}),this._fireZoomChanged(k,A)}}},{key:"_onMouseDownWithHandMode",value:function(n){var h=n.target,S=n.e;if(!h){var T=this.getCanvas();if(!(this.zoomLevel<=Ei)){T.selection=!1,this._startHandPoint=T.getPointer(S);var k=this._listeners,A=k.moveHand,R=k.stopHand;T.on({"mouse:move":A,"mouse:up":R})}}}},{key:"_onMouseMoveWithHandMode",value:function(n){var h=n.e,S=this.getCanvas(),T=S.getPointer(h),k=T.x,A=T.y,R=k-this._startHandPoint.x,H=A-this._startHandPoint.y;this._movePointOfZoom({x:R,y:H})}},{key:"_onMouseUpWithHandMode",value:function(){var n=this.getCanvas(),h=this._listeners,S=h.moveHand,T=h.stopHand;n.off({"mouse:move":S,"mouse:up":T}),this._startHandPoint=null}},{key:"_changeScrollState",value:function(n){var h=n.viewport,S=n.zoomLevel,T=this.getCanvas();if(T.remove(this._verticalScroll),T.remove(this._horizontalScroll),!this._isDefaultZoomLevel(S)){var k=T.width,A=T.height,R=h.tl,H=h.tr,ot=h.bl,lt=H.x-R.x,mt=ot.y-R.y,ut=lt*lt/k,pt=mt*en.SIZE,jt=se(R.x+R.x/k*lt,R.x,H.x-ut),ie=mt*en.MARGIN,re=mt*en.BORDER_RADIUS;this._horizontalScroll.set({left:jt,top:ot.y-pt-ie,width:ut,height:pt,rx:re,ry:re});var oe=lt*tn.SIZE,Ht=mt*mt/A,ge=se(R.y+R.y/A*mt,H.y,ot.y-Ht),De=lt*tn.MARGIN,je=lt*tn.BORDER_RADIUS;this._verticalScroll.set({left:H.x-oe-De,top:ge,width:oe,height:Ht,rx:je,ry:je}),this._addScrollBar()}}},{key:"_changeObjectsEventedState",value:function(){var n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!0,h=this.getCanvas();h.forEachObject(function(S){S.evented=n})}},{key:"_addScrollBar",value:function(){var n=this,h=this.getCanvas();h.add(this._horizontalScroll),h.add(this._verticalScroll),this.scrollBarTid&&clearTimeout(this.scrollBarTid),this.scrollBarTid=t()(function(){h.remove(n._horizontalScroll),h.remove(n._verticalScroll)},3e3)}},{key:"_isDefaultZoomLevel",value:function(n){return n===Ei}},{key:"_fireZoomChanged",value:function(n,h){n.fire(Hn,{viewport:n.calcViewportBoundaries(),zoomLevel:h})}},{key:"mode",get:function(){return this.zoomMode}}]),r}(ze),yl=ml,Wn=Si.create,Gn=Si.types,Cl=function(){function w(v){Y(this,w),this.name=v}return it(w,[{key:"getName",value:function(){return this.name}},{key:"start",value:function(){throw new Error(Wn(Gn.UN_IMPLEMENTATION,"start"))}},{key:"end",value:function(){throw new Error(Wn(Gn.UN_IMPLEMENTATION,"stop"))}}]),w}(),Qe=Cl;function Sl(w){var v=xl();return function(){var l=ee(w),n;if(v){var h=ee(this).constructor;n=At()(l,arguments,h)}else n=l.apply(this,arguments);return ye(this,n)}}function xl(){if(typeof Reflect=="undefined"||!At()||At().sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(At()(Boolean,[],function(){})),!0}catch(w){return!1}}var Il=function(w){me(r,w);var v=Sl(r);function r(){return Y(this,r),v.call(this,de.CROPPER)}return it(r,[{key:"start",value:function(n){var h=n.getComponent(Bt.CROPPER);h.start()}},{key:"end",value:function(n){var h=n.getComponent(Bt.CROPPER);h.end()}}]),r}(Qe),bl=Il;function Ml(w){var v=Tl();return function(){var l=ee(w),n;if(v){var h=ee(this).constructor;n=At()(l,arguments,h)}else n=l.apply(this,arguments);return ye(this,n)}}function Tl(){if(typeof Reflect=="undefined"||!At()||At().sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(At()(Boolean,[],function(){})),!0}catch(w){return!1}}var El=function(w){me(r,w);var v=Ml(r);function r(){return Y(this,r),v.call(this,de.FREE_DRAWING)}return it(r,[{key:"start",value:function(n,h){var S=n.getComponent(Bt.FREE_DRAWING);S.start(h)}},{key:"end",value:function(n){var h=n.getComponent(Bt.FREE_DRAWING);h.end()}}]),r}(Qe),wl=El;function Dl(w){var v=Ol();return function(){var l=ee(w),n;if(v){var h=ee(this).constructor;n=At()(l,arguments,h)}else n=l.apply(this,arguments);return ye(this,n)}}function Ol(){if(typeof Reflect=="undefined"||!At()||At().sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(At()(Boolean,[],function(){})),!0}catch(w){return!1}}var Al=function(w){me(r,w);var v=Dl(r);function r(){return Y(this,r),v.call(this,de.LINE_DRAWING)}return it(r,[{key:"start",value:function(n,h){var S=n.getComponent(Bt.LINE);S.start(h)}},{key:"end",value:function(n){var h=n.getComponent(Bt.LINE);h.end()}}]),r}(Qe),_l=Al;function kl(w){var v=Pl();return function(){var l=ee(w),n;if(v){var h=ee(this).constructor;n=At()(l,arguments,h)}else n=l.apply(this,arguments);return ye(this,n)}}function Pl(){if(typeof Reflect=="undefined"||!At()||At().sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(At()(Boolean,[],function(){})),!0}catch(w){return!1}}var Ll=function(w){me(r,w);var v=kl(r);function r(){return Y(this,r),v.call(this,de.SHAPE)}return it(r,[{key:"start",value:function(n){var h=n.getComponent(Bt.SHAPE);h.start()}},{key:"end",value:function(n){var h=n.getComponent(Bt.SHAPE);h.end()}}]),r}(Qe),jl=Ll;function Nl(w){var v=Rl();return function(){var l=ee(w),n;if(v){var h=ee(this).constructor;n=At()(l,arguments,h)}else n=l.apply(this,arguments);return ye(this,n)}}function Rl(){if(typeof Reflect=="undefined"||!At()||At().sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(At()(Boolean,[],function(){})),!0}catch(w){return!1}}var zl=function(w){me(r,w);var v=Nl(r);function r(){return Y(this,r),v.call(this,de.TEXT)}return it(r,[{key:"start",value:function(n){var h=n.getComponent(Bt.TEXT);h.start()}},{key:"end",value:function(n){var h=n.getComponent(Bt.TEXT);h.end()}}]),r}(Qe),Bl=zl;function Fl(w){var v=Hl();return function(){var l=ee(w),n;if(v){var h=ee(this).constructor;n=At()(l,arguments,h)}else n=l.apply(this,arguments);return ye(this,n)}}function Hl(){if(typeof Reflect=="undefined"||!At()||At().sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(At()(Boolean,[],function(){})),!0}catch(w){return!1}}var Ul=function(w){me(r,w);var v=Fl(r);function r(){return Y(this,r),v.call(this,de.ICON)}return it(r,[{key:"start",value:function(n){var h=n.getComponent(Bt.ICON);h.start()}},{key:"end",value:function(n){var h=n.getComponent(Bt.ICON);h.end()}}]),r}(Qe),Yl=Ul;function Wl(w){var v=Gl();return function(){var l=ee(w),n;if(v){var h=ee(this).constructor;n=At()(l,arguments,h)}else n=l.apply(this,arguments);return ye(this,n)}}function Gl(){if(typeof Reflect=="undefined"||!At()||At().sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(At()(Boolean,[],function(){})),!0}catch(w){return!1}}var Xl=function(w){me(r,w);var v=Wl(r);function r(){return Y(this,r),v.call(this,de.ZOOM)}return it(r,[{key:"start",value:function(n){var h=n.getComponent(Bt.ZOOM);h.start()}},{key:"end",value:function(n){var h=n.getComponent(Bt.ZOOM);h.end()}}]),r}(Qe),Zl=Xl,Xn=null;function Zn(w){Xn=w}function Vl(){return Xn}function nn(w,v){var r;if(w.type==="activeSelection"){var l;r=We()(l=w.getObjects()).call(l,function(n){var h=n.angle,S=n.left,T=n.top,k=n.scaleX,A=n.scaleY,R=n.width,H=n.height;q.fabric.util.addTransformToObject(n,w.calcTransformMatrix());var ot=v(n);return n.set({angle:h,left:S,top:T,width:R,height:H,scaleX:k,scaleY:A}),ot})}else r=[v(w)];return r}function rn(w,v,r){return r?{id:w,width:v.width,height:v.height,top:v.top,left:v.left,angle:v.angle,scaleX:v.scaleX,scaleY:v.scaleY}:G()({id:w},v)}function Jl(w){var v=Ql();return function(){var l=ee(w),n;if(v){var h=ee(this).constructor;n=At()(l,arguments,h)}else n=l.apply(this,arguments);return ye(this,n)}}function Ql(){if(typeof Reflect=="undefined"||!At()||At().sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(At()(Boolean,[],function(){})),!0}catch(w){return!1}}var Kl=function(w){me(r,w);var v=Jl(r);function r(l){var n;return Y(this,r),n=v.call(this,Bt.RESIZE,l),n._dimensions=null,n._originalDimensions=null,n}return it(r,[{key:"getCurrentDimensions",value:function(){var n=this.getCanvasImage();if(!this._dimensions&&n){var h=n.width,S=n.height;this._dimensions={width:h,height:S}}return this._dimensions}},{key:"getOriginalDimensions",value:function(){return this._originalDimensions}},{key:"setOriginalDimensions",value:function(n){this._originalDimensions=n}},{key:"resize",value:function(n){var h=this.getCanvasImage(),S=h.width,T=h.height,k=h.scaleX,A=h.scaleY,R=n.width,H=n.height,ot={scaleX:R?R/S:k,scaleY:H?H/T:A};return(k!==ot.scaleX||A!==ot.scaleY)&&(h.set(ot).setCoords(),this._dimensions={width:h.width*h.scaleX,height:h.height*h.scaleY}),this.adjustCanvasDimensionBase(),dt().resolve()}},{key:"start",value:function(){var n=this.getCurrentDimensions();this.setOriginalDimensions(n)}},{key:"end",value:function(){}}]),r}(ze),$l=Kl;function ql(w){var v=tc();return function(){var l=ee(w),n;if(v){var h=ee(this).constructor;n=At()(l,arguments,h)}else n=l.apply(this,arguments);return ye(this,n)}}function tc(){if(typeof Reflect=="undefined"||!At()||At().sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(At()(Boolean,[],function(){})),!0}catch(w){return!1}}var ec=function(w){me(r,w);var v=ql(r);function r(){return Y(this,r),v.call(this,de.RESIZE)}return it(r,[{key:"start",value:function(n){var h=n.getComponent(Bt.RESIZE);h.start()}},{key:"end",value:function(n){var h=n.getComponent(Bt.RESIZE);h.end()}}]),r}(Qe),ic=ec,nc=1e3,rc=800,wi=10,ac={cssOnly:!0},oc={backstoreOnly:!0},Vn=function(){function w(v){var r,l,n,h,S,T,k,A,R,H,ot,lt=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},mt=lt.cssMaxWidth,ut=lt.cssMaxHeight;Y(this,w),this.canvasImage=null,this.cssMaxWidth=mt||nc,this.cssMaxHeight=ut||rc,this.cropSelectionStyle={},this.targetObjectForCopyPaste=null,this.imageName="",this._objects={},this._canvas=null,this._drawingMode=de.NORMAL,this._drawingModeMap={},this._componentMap={},this._handler={onMouseDown:K()(r=this._onMouseDown).call(r,this),onObjectAdded:K()(l=this._onObjectAdded).call(l,this),onObjectRemoved:K()(n=this._onObjectRemoved).call(n,this),onObjectMoved:K()(h=this._onObjectMoved).call(h,this),onObjectScaled:K()(S=this._onObjectScaled).call(S,this),onObjectModified:K()(T=this._onObjectModified).call(T,this),onObjectRotated:K()(k=this._onObjectRotated).call(k,this),onObjectSelected:K()(A=this._onObjectSelected).call(A,this),onPathCreated:K()(R=this._onPathCreated).call(R,this),onSelectionCleared:K()(H=this._onSelectionCleared).call(H,this),onSelectionCreated:K()(ot=this._onSelectionCreated).call(ot,this)},this._setObjectCachingToFalse(),this._setCanvasElement(v),this._createDrawingModeInstances(),this._createComponents(),this._attachCanvasEvents(),this._attachZoomEvents()}return it(w,[{key:"destroy",value:function(){var r=this._canvas.wrapperEl;this._canvas.clear(),r.parentNode.removeChild(r),this._detachZoomEvents()}},{key:"_attachZoomEvents",value:function(){var r=this.getComponent(Bt.ZOOM);r.attachKeyboardZoomEvents()}},{key:"_detachZoomEvents",value:function(){var r=this.getComponent(Bt.ZOOM);r.detachKeyboardZoomEvents()}},{key:"deactivateAll",value:function(){return this._canvas.discardActiveObject(),this}},{key:"renderAll",value:function(){return this._canvas.renderAll(),this}},{key:"add",value:function(r){var l,n=[];On()(r)?n=r:n.push(r),(l=this._canvas).add.apply(l,L(n))}},{key:"contains",value:function(r){return this._canvas.contains(r)}},{key:"getObjects",value:function(){var r;return p()(r=this._canvas.getObjects()).call(r)}},{key:"getObject",value:function(r){return this._objects[r]}},{key:"remove",value:function(r){this._canvas.remove(r)}},{key:"removeAll",value:function(r){var l,n=this._canvas,h=p()(l=n.getObjects()).call(l);return n.remove.apply(n,L(this._canvas.getObjects())),r&&n.clear(),h}},{key:"removeObjectById",value:function(r){var l=[],n=this._canvas,h=this.getObject(r),S=h&&h.isType("group")&&!h.isEmpty();return S?(n.discardActiveObject(),h.forEachObject(function(T){l.push(T),n.remove(T)})):n.contains(h)&&(l.push(h),n.remove(h)),l}},{key:"getObjectId",value:function(r){var l=null;for(l in this._objects)if(this._objects.hasOwnProperty(l)&&r===this._objects[l])return l;return null}},{key:"getActiveObject",value:function(){return this._canvas._activeObject}},{key:"getActiveObjectIdForRemove",value:function(){var r=this.getActiveObject(),l=r.type,n=r.left,h=r.top,S=l==="activeSelection";if(S){var T=new q.fabric.Group(L(r.getObjects()),{left:n,top:h});return this._addFabricObject(T)}return this.getObjectId(r)}},{key:"isReadyRemoveObject",value:function(){var r=this.getActiveObject();return r&&!r.isEditing}},{key:"getActiveObjects",value:function(){var r=this._canvas._activeObject;return r&&r.type==="activeSelection"?r:null}},{key:"getActiveSelectionFromObjects",value:function(r){var l=this.getCanvas();return new q.fabric.ActiveSelection(r,{canvas:l})}},{key:"setActiveObject",value:function(r){this._canvas.setActiveObject(r)}},{key:"setCropSelectionStyle",value:function(r){this.cropSelectionStyle=r}},{key:"getComponent",value:function(r){return this._componentMap[r]}},{key:"getDrawingMode",value:function(){return this._drawingMode}},{key:"startDrawingMode",value:function(r,l){if(this._isSameDrawingMode(r))return!0;this.stopDrawingMode();var n=this._getDrawingModeInstance(r);return n&&n.start&&(n.start(this,l),this._drawingMode=r),!!n}},{key:"stopDrawingMode",value:function(){if(!this._isSameDrawingMode(de.NORMAL)){var r=this._getDrawingModeInstance(this.getDrawingMode());r&&r.end&&r.end(this),this._drawingMode=de.NORMAL}}},{key:"zoom",value:function(r,l){var n=r.x,h=r.y,S=this.getComponent(Bt.ZOOM);S.zoom({x:n,y:h},l)}},{key:"getZoomMode",value:function(){var r=this.getComponent(Bt.ZOOM);return r.mode}},{key:"startZoomInMode",value:function(){var r=this.getComponent(Bt.ZOOM);r.startZoomInMode()}},{key:"endZoomInMode",value:function(){var r=this.getComponent(Bt.ZOOM);r.endZoomInMode()}},{key:"zoomOut",value:function(){var r=this.getComponent(Bt.ZOOM);r.zoomOut()}},{key:"startHandMode",value:function(){var r=this.getComponent(Bt.ZOOM);r.startHandMode()}},{key:"endHandMode",value:function(){var r=this.getComponent(Bt.ZOOM);r.endHandMode()}},{key:"resetZoom",value:function(){var r=this.getComponent(Bt.ZOOM);r.resetZoom()}},{key:"toDataURL",value:function(r){var l=this.getComponent(Bt.CROPPER);l.changeVisibility(!1);var n=this._canvas&&this._canvas.toDataURL(r);return l.changeVisibility(!0),n}},{key:"setCanvasImage",value:function(r,l){l&&zt(l),this.imageName=r,this.canvasImage=l}},{key:"setCssMaxDimension",value:function(r){this.cssMaxWidth=r.width||this.cssMaxWidth,this.cssMaxHeight=r.height||this.cssMaxHeight}},{key:"adjustCanvasDimension",value:function(){this.adjustCanvasDimensionBase(this.canvasImage.scale(1))}},{key:"adjustCanvasDimensionBase",value:function(){var r=arguments.length>0&&arguments[0]!==void 0?arguments[0]:null;r||(r=this.canvasImage);var l=r.getBoundingRect(),n=l.width,h=l.height,S=this._calcMaxDimension(n,h);this.setCanvasCssDimension({width:"100%",height:"100%","max-width":"".concat(S.width,"px"),"max-height":"".concat(S.height,"px")}),this.setCanvasBackstoreDimension({width:n,height:h}),this._canvas.centerObject(r)}},{key:"setCanvasCssDimension",value:function(r){this._canvas.setDimensions(r,ac)}},{key:"setCanvasBackstoreDimension",value:function(r){this._canvas.setDimensions(r,oc)}},{key:"setImageProperties",value:function(r,l){var n=this.canvasImage;!n||(n.set(r).setCoords(),l&&this._canvas.renderAll())}},{key:"getCanvasElement",value:function(){return this._canvas.getElement()}},{key:"getCanvas",value:function(){return this._canvas}},{key:"getCanvasImage",value:function(){return this.canvasImage}},{key:"getImageName",value:function(){return this.imageName}},{key:"addImageObject",value:function(r){var l,n=this,h=K()(l=this._callbackAfterLoadingImageObject).call(l,this);return new(dt())(function(S){q.fabric.Image.fromURL(r,function(T){h(T),S(n.createObjectProperties(T))},{crossOrigin:"Anonymous"})})}},{key:"getCenter",value:function(){return this._canvas.getCenter()}},{key:"getCropzoneRect",value:function(){return this.getComponent(Bt.CROPPER).getCropzoneRect()}},{key:"setCropzoneRect",value:function(r){this.getComponent(Bt.CROPPER).setCropzoneRect(r)}},{key:"getCroppedImageData",value:function(r){return this.getComponent(Bt.CROPPER).getCroppedImageData(r)}},{key:"setBrush",value:function(r){var l=this._drawingMode,n=Bt.FREE_DRAWING;l===de.LINE_DRAWING&&(n=Bt.LINE),this.getComponent(n).setBrush(r)}},{key:"setDrawingShape",value:function(r,l){this.getComponent(Bt.SHAPE).setStates(r,l)}},{key:"setIconStyle",value:function(r,l){this.getComponent(Bt.ICON).setStates(r,l)}},{key:"registerPaths",value:function(r){this.getComponent(Bt.ICON).registerPaths(r)}},{key:"changeCursor",value:function(r){var l=this.getCanvas();l.defaultCursor=r,l.renderAll()}},{key:"hasFilter",value:function(r){return this.getComponent(Bt.FILTER).hasFilter(r)}},{key:"setSelectionStyle",value:function(r){G()(Be.SELECTION_STYLE,r)}},{key:"setObjectProperties",value:function(r,l){var n=this.getObject(r),h=G()({},l);return n.set(h),n.setCoords(),this.getCanvas().renderAll(),h}},{key:"getObjectProperties",value:function(r,l){var n=this.getObject(r),h={};return bt()(l)?h[l]=n[l]:On()(l)?si()(l,function(S){h[S]=n[S]}):Ii()(l,function(S,T){h[T]=n[T]}),h}},{key:"getObjectPosition",value:function(r,l,n){var h=this.getObject(r);return h?h.getPointByOrigin(l,n):null}},{key:"setObjectPosition",value:function(r,l){var n=this.getObject(r),h=l.x,S=l.y,T=l.originX,k=l.originY;if(!n)return!1;var A=n.getPointByOrigin(T,k),R=n.getPointByOrigin("center","center"),H=R.x-A.x,ot=R.y-A.y;return n.set({left:h+H,top:S+ot}),n.setCoords(),!0}},{key:"getCanvasSize",value:function(){var r=this.getCanvasImage();return{width:r?r.width:0,height:r?r.height:0}}},{key:"createStaticCanvas",value:function(){var r=new q.fabric.StaticCanvas;return r.set({enableRetinaScaling:!1}),r}},{key:"_getDrawingModeInstance",value:function(r){return this._drawingModeMap[r]}},{key:"_setObjectCachingToFalse",value:function(){q.fabric.Object.prototype.objectCaching=!1}},{key:"_setCanvasElement",value:function(r){var l,n;r.nodeType?l=r:l=document.querySelector(r),l.nodeName.toUpperCase()!=="CANVAS"&&(n=document.createElement("canvas"),l.appendChild(n)),this._canvas=new q.fabric.Canvas(n,{containerClass:"tui-image-editor-canvas-container",enableRetinaScaling:!1})}},{key:"_createDrawingModeInstances",value:function(){this._register(this._drawingModeMap,new bl),this._register(this._drawingModeMap,new wl),this._register(this._drawingModeMap,new _l),this._register(this._drawingModeMap,new jl),this._register(this._drawingModeMap,new Bl),this._register(this._drawingModeMap,new Yl),this._register(this._drawingModeMap,new Zl),this._register(this._drawingModeMap,new ic)}},{key:"_createComponents",value:function(){this._register(this._componentMap,new jo(this)),this._register(this._componentMap,new $o(this)),this._register(this._componentMap,new is(this)),this._register(this._componentMap,new os(this)),this._register(this._componentMap,new us(this)),this._register(this._componentMap,new ys(this)),this._register(this._componentMap,new Ts(this)),this._register(this._componentMap,new As(this)),this._register(this._componentMap,new Us(this)),this._register(this._componentMap,new cl(this)),this._register(this._componentMap,new yl(this)),this._register(this._componentMap,new $l(this))}},{key:"_register",value:function(r,l){r[l.getName()]=l}},{key:"_isSameDrawingMode",value:function(r){return this.getDrawingMode()===r}},{key:"_calcMaxDimension",value:function(r,l){var n=this.cssMaxWidth/r,h=this.cssMaxHeight/l,S=Math.min(r,this.cssMaxWidth),T=Math.min(l,this.cssMaxHeight);return n<1&&n1)S=r.getActiveSelectionFromObjects(T);else{var k=ct(T,1);S=k[0]}r.targetObjectForCopyPaste=S,r.setActiveObject(S)})}},{key:"_cloneObject",value:function(r){var l=this,n=We()(r).call(r,function(h){return l._cloneObjectItem(h)});return dt().all(n)}},{key:"_cloneObjectItem",value:function(r){var l=this;return this._copyFabricObjectForPaste(r).then(function(n){var h=l.createObjectProperties(n);return l.add(n),l.fire(Et.ADD_OBJECT,h),n})}},{key:"_copyFabricObjectForPaste",value:function(r){var l=this,n=function(S,T){return T?S-wi:S+wi};return this._copyFabricObject(r).then(function(h){var S=h.left,T=h.top,k=h.width,A=h.height,R=l.getCanvasSize(),H=R.width,ot=R.height,lt=S+k/2,mt=T+A/2;return h.set(G()({left:n(S,lt+wi>H),top:n(T,mt+wi>ot)},Be.SELECTION_STYLE)),h})}},{key:"_copyFabricObject",value:function(r){var l=this;return new(dt())(function(n){r.clone(function(h){var S=l.getComponent(Bt.SHAPE);sn(h)&&S.processForCopiedObject(h,r),n(h)})})}},{key:"getCurrentDimensions",value:function(){var r=this.getComponent(Bt.RESIZE);return r.getCurrentDimensions()}},{key:"getOriginalDimensions",value:function(){var r=this.getComponent(Bt.RESIZE);return r.getOriginalDimensions()}},{key:"setOriginalDimensions",value:function(r){var l=this.getComponent(Bt.RESIZE);l.setOriginalDimensions(r)}},{key:"resize",value:function(r){var l=this.getComponent(Bt.RESIZE);return l.resize(r)}}]),w}();gt().mixin(Vn);var sc=Vn,lc=Et.MOUSE_DOWN,cc=Et.OBJECT_MOVED,uc=Et.OBJECT_SCALED,hc=Et.OBJECT_ACTIVATED,fc=Et.OBJECT_ROTATED,Jn=Et.OBJECT_ADDED,dc=Et.OBJECT_MODIFIED,gc=Et.ADD_TEXT,vc=Et.ADD_OBJECT,pc=Et.TEXT_EDITING,mc=Et.TEXT_CHANGED,yc=Et.ICON_CREATE_RESIZE,Cc=Et.ICON_CREATE_END,Qn=Et.SELECTION_CLEARED,Kn=Et.SELECTION_CREATED,Sc=Et.ADD_OBJECT_AFTER,an=function(){function w(v,r){var l,n,h,S,T,k,A,R,H,ot,lt,mt,ut,pt,jt,ie;if(Y(this,w),r=G()({includeUI:!1,usageStatistics:!0},r),this.mode=null,this.activeObjectId=null,r.includeUI){var re=r.includeUI;re.usageStatistics=r.usageStatistics,this.ui=new To(v,re,this.getActions()),r=this.ui.setUiDefaultSelectionStyle(r)}this._invoker=new Ur,this._graphics=new sc(this.ui?this.ui.getEditorArea():v,{cssMaxWidth:r.cssMaxWidth,cssMaxHeight:r.cssMaxHeight}),this._handlers={keydown:K()(l=this._onKeyDown).call(l,this),mousedown:K()(n=this._onMouseDown).call(n,this),objectActivated:K()(h=this._onObjectActivated).call(h,this),objectMoved:K()(S=this._onObjectMoved).call(S,this),objectScaled:K()(T=this._onObjectScaled).call(T,this),objectRotated:K()(k=this._onObjectRotated).call(k,this),objectAdded:K()(A=this._onObjectAdded).call(A,this),objectModified:K()(R=this._onObjectModified).call(R,this),createdPath:this._onCreatedPath,addText:K()(H=this._onAddText).call(H,this),addObject:K()(ot=this._onAddObject).call(ot,this),textEditing:K()(lt=this._onTextEditing).call(lt,this),textChanged:K()(mt=this._onTextChanged).call(mt,this),iconCreateResize:K()(ut=this._onIconCreateResize).call(ut,this),iconCreateEnd:K()(pt=this._onIconCreateEnd).call(pt,this),selectionCleared:K()(jt=this._selectionCleared).call(jt,this),selectionCreated:K()(ie=this._selectionCreated).call(ie,this)},this._attachInvokerEvents(),this._attachGraphicsEvents(),this._attachDomEvents(),this._setSelectionStyle(r.selectionStyle,{applyCropSelectionStyle:r.applyCropSelectionStyle,applyGroupSelectionStyle:r.applyGroupSelectionStyle}),r.usageStatistics&&pi(),this.ui&&(this.ui.initCanvas(),this.setReAction(),this._attachColorPickerInputBoxEvents()),q.fabric.enableGLFiltering=!1}return it(w,[{key:"_attachColorPickerInputBoxEvents",value:function(){var r=this;this.ui.on(Et.INPUT_BOX_EDITING_STARTED,function(){r.isColorPickerInputBoxEditing=!0}),this.ui.on(Et.INPUT_BOX_EDITING_STOPPED,function(){r.isColorPickerInputBoxEditing=!1})}},{key:"_detachColorPickerInputBoxEvents",value:function(){this.ui.off(Et.INPUT_BOX_EDITING_STARTED),this.ui.off(Et.INPUT_BOX_EDITING_STOPPED)}},{key:"_setSelectionStyle",value:function(r,l){var n=l.applyCropSelectionStyle,h=l.applyGroupSelectionStyle;r&&this._graphics.setSelectionStyle(r),n&&this._graphics.setCropSelectionStyle(r),h&&this.on("selectionCreated",function(S){S.type==="activeSelection"&&S.set(r)})}},{key:"_attachInvokerEvents",value:function(){var r,l,n=this,h=Et.UNDO_STACK_CHANGED,S=Et.REDO_STACK_CHANGED,T=Et.EXECUTE_COMMAND,k=Et.AFTER_UNDO,A=Et.AFTER_REDO,R=Et.HAND_STARTED,H=Et.HAND_STOPPED;if(this._invoker.on(h,K()(r=this.fire).call(r,this,h)),this._invoker.on(S,K()(l=this.fire).call(l,this,S)),this.ui){var ot=this._graphics.getCanvas();this._invoker.on(T,function(lt){return n.ui.fire(T,lt)}),this._invoker.on(k,function(lt){return n.ui.fire(k,lt)}),this._invoker.on(A,function(lt){return n.ui.fire(A,lt)}),ot.on(R,function(){return n.ui.fire(R)}),ot.on(H,function(){return n.ui.fire(H)})}}},{key:"_attachGraphicsEvents",value:function(){var r;this._graphics.on((r={},B(r,lc,this._handlers.mousedown),B(r,cc,this._handlers.objectMoved),B(r,uc,this._handlers.objectScaled),B(r,fc,this._handlers.objectRotated),B(r,hc,this._handlers.objectActivated),B(r,Jn,this._handlers.objectAdded),B(r,dc,this._handlers.objectModified),B(r,gc,this._handlers.addText),B(r,vc,this._handlers.addObject),B(r,pc,this._handlers.textEditing),B(r,mc,this._handlers.textChanged),B(r,yc,this._handlers.iconCreateResize),B(r,Cc,this._handlers.iconCreateEnd),B(r,Qn,this._handlers.selectionCleared),B(r,Kn,this._handlers.selectionCreated),r))}},{key:"_attachDomEvents",value:function(){document.addEventListener("keydown",this._handlers.keydown)}},{key:"_detachDomEvents",value:function(){document.removeEventListener("keydown",this._handlers.keydown)}},{key:"_onKeyDown",value:function(r){var l=r.ctrlKey,n=r.keyCode,h=r.metaKey,S=l||h;S&&(n===xe.C?this._graphics.resetTargetObjectForCopyPaste():n===xe.V?(this._graphics.pasteObject(),this.clearRedoStack()):n===xe.Z?this.undo().catch(function(){}):n===xe.Y&&this.redo().catch(function(){}));var T=n===xe.BACKSPACE||n===xe.DEL,k=this._graphics.isReadyRemoveObject();!this.isColorPickerInputBoxEditing&&k&&T&&(r.preventDefault(),this.removeActiveObject())}},{key:"removeActiveObject",value:function(){var r=this._graphics.getActiveObjectIdForRemove();this.removeObject(r)}},{key:"_onMouseDown",value:function(r,l){this.fire(Et.MOUSE_DOWN,r,l)}},{key:"_pushAddObjectCommand",value:function(r){var l=Ie.create(Qt.ADD_OBJECT,this._graphics,r);this._invoker.pushUndoStack(l)}},{key:"_pushModifyObjectCommand",value:function(r){var l=this,n=r.type,h=nn(r,function(T){return rn(l._graphics.getObjectId(T),T,n==="activeSelection")}),S=Ie.create(Qt.CHANGE_SELECTION,this._graphics,h);S.execute(this._graphics,h),this._invoker.pushUndoStack(S)}},{key:"_onObjectActivated",value:function(r){this.fire(Et.OBJECT_ACTIVATED,r)}},{key:"_onObjectMoved",value:function(r){this.fire(Et.OBJECT_MOVED,r)}},{key:"_onObjectScaled",value:function(r){this.fire(Et.OBJECT_SCALED,r)}},{key:"_onObjectRotated",value:function(r){this.fire(Et.OBJECT_ROTATED,r)}},{key:"getDrawingMode",value:function(){return this._graphics.getDrawingMode()}},{key:"clearObjects",value:function(){return this.execute(Qt.CLEAR_OBJECTS)}},{key:"deactivateAll",value:function(){this._graphics.deactivateAll(),this._graphics.renderAll()}},{key:"discardSelection",value:function(){this._graphics.discardSelection()}},{key:"changeSelectableAll",value:function(r){this._graphics.changeSelectableAll(r)}},{key:"_initHistory",value:function(){this.ui&&this.ui.initHistory()}},{key:"_clearHistory",value:function(){this.ui&&this.ui.clearHistory()}},{key:"execute",value:function(r){for(var l,n,h,S=arguments.length,T=new Array(S>1?S-1:0),k=1;k1?S-1:0),k=1;k0&&arguments[0]!==void 0?arguments[0]:1,n=dt().resolve(),h=0;h0&&arguments[0]!==void 0?arguments[0]:1,n=dt().resolve(),h=0;h