0&&(d=f.removeMin(),h=c[d],h.distance!==Number.POSITIVE_INFINITY);)o(d).forEach(l);return c}return di}var hi,Hc;function l_(){if(Hc)return hi;Hc=1;var e=rl(),r=$();hi=n;function n(t,a,i){return r.transform(t.nodes(),function(u,s){u[s]=e(t,s,a,i)},{})}return hi}var li,Wc;function nl(){if(Wc)return li;Wc=1;var e=$();li=r;function r(n){var t=0,a=[],i={},u=[];function s(o){var c=i[o]={onStack:!0,lowlink:t,index:t++};if(a.push(o),n.successors(o).forEach(function(h){e.has(i,h)?i[h].onStack&&(c.lowlink=Math.min(c.lowlink,i[h].index)):(s(h),c.lowlink=Math.min(c.lowlink,i[h].lowlink))}),c.lowlink===c.index){var f=[],d;do d=a.pop(),i[d].onStack=!1,f.push(d);while(o!==d);u.push(f)}}return n.nodes().forEach(function(o){e.has(i,o)||s(o)}),u}return li}var vi,Yc;function v_(){if(Yc)return vi;Yc=1;var e=$(),r=nl();vi=n;function n(t){return e.filter(r(t),function(a){return a.length>1||a.length===1&&t.hasEdge(a[0],a[0])})}return vi}var pi,Xc;function p_(){if(Xc)return pi;Xc=1;var e=$();pi=n;var r=e.constant(1);function n(a,i,u){return t(a,i||r,u||function(s){return a.outEdges(s)})}function t(a,i,u){var s={},o=a.nodes();return o.forEach(function(c){s[c]={},s[c][c]={distance:0},o.forEach(function(f){c!==f&&(s[c][f]={distance:Number.POSITIVE_INFINITY})}),u(c).forEach(function(f){var d=f.v===c?f.w:f.v,h=i(f);s[c][d]={distance:h,predecessor:c}})}),o.forEach(function(c){var f=s[c];o.forEach(function(d){var h=s[d];o.forEach(function(l){var p=h[c],v=f[l],_=h[l],g=p.distance+v.distance;g<_.distance&&(_.distance=g,_.predecessor=v.predecessor)})})}),s}return pi}var _i,Zc;function tl(){if(Zc)return _i;Zc=1;var e=$();_i=r,r.CycleException=n;function r(t){var a={},i={},u=[];function s(o){if(e.has(i,o))throw new n;e.has(a,o)||(i[o]=!0,a[o]=!0,e.each(t.predecessors(o),s),delete i[o],u.push(o))}if(e.each(t.sinks(),s),e.size(a)!==t.nodeCount())throw new n;return u}function n(){}return n.prototype=new Error,_i}var gi,Jc;function __(){if(Jc)return gi;Jc=1;var e=tl();gi=r;function r(n){try{e(n)}catch(t){if(t instanceof e.CycleException)return!1;throw t}return!0}return gi}var bi,Qc;function al(){if(Qc)return bi;Qc=1;var e=$();bi=r;function r(t,a,i){e.isArray(a)||(a=[a]);var u=(t.isDirected()?t.successors:t.neighbors).bind(t),s=[],o={};return e.each(a,function(c){if(!t.hasNode(c))throw new Error("Graph does not have node: "+c);n(t,c,i==="post",o,u,s)}),s}function n(t,a,i,u,s,o){e.has(u,a)||(u[a]=!0,i||o.push(a),e.each(s(a),function(c){n(t,c,i,u,s,o)}),i&&o.push(a))}return bi}var yi,ed;function g_(){if(ed)return yi;ed=1;var e=al();yi=r;function r(n,t){return e(n,t,"post")}return yi}var mi,rd;function b_(){if(rd)return mi;rd=1;var e=al();mi=r;function r(n,t){return e(n,t,"pre")}return mi}var qi,nd;function y_(){if(nd)return qi;nd=1;var e=$(),r=Uu(),n=el();qi=t;function t(a,i){var u=new r,s={},o=new n,c;function f(h){var l=h.v===c?h.w:h.v,p=o.priority(l);if(p!==void 0){var v=i(h);v0;){if(c=o.removeMin(),e.has(s,c))u.setEdge(c,s[c]);else{if(d)throw new Error("Input graph is not connected: "+a);d=!0}a.nodeEdges(c).forEach(f)}return u}return qi}var wi,td;function m_(){return td||(td=1,wi={components:h_(),dijkstra:rl(),dijkstraAll:l_(),findCycles:v_(),floydWarshall:p_(),isAcyclic:__(),postorder:g_(),preorder:b_(),prim:y_(),tarjan:nl(),topsort:tl()}),wi}var Ri,ad;function q_(){if(ad)return Ri;ad=1;var e=c_();return Ri={Graph:e.Graph,json:d_(),alg:m_(),version:e.version},Ri}var er;if(typeof Au=="function")try{er=q_()}catch(e){}er||(er=window.graphlib);var V=er,Ei,id;function w_(){if(id)return Ei;id=1;var e=Sh(),r=1,n=4;function t(a){return e(a,r|n)}return Ei=t,Ei}var Ii,ud;function qr(){if(ud)return Ii;ud=1;var e=Ae(),r=ae(),n=hr(),t=B();function a(i,u,s){if(!t(s))return!1;var o=typeof u;return(o=="number"?r(s)&&n(u,s.length):o=="string"&&u in s)?e(s[u],i):!1}return Ii=a,Ii}var Ti,sd;function R_(){if(sd)return Ti;sd=1;var e=mr(),r=Ae(),n=qr(),t=ye(),a=Object.prototype,i=a.hasOwnProperty,u=e(function(s,o){s=Object(s);var c=-1,f=o.length,d=f>2?o[2]:void 0;for(d&&n(o[0],o[1],d)&&(f=1);++c-1?o[c?i[f]:f]:void 0}}return Ai=t,Ai}var Ci,fd;function I_(){if(fd)return Ci;fd=1;var e=/\s/;function r(n){for(var t=n.length;t--&&e.test(n.charAt(t)););return t}return Ci=r,Ci}var Si,cd;function T_(){if(cd)return Si;cd=1;var e=I_(),r=/^\s+/;function n(t){return t&&t.slice(0,e(t)+1).replace(r,"")}return Si=n,Si}var Oi,dd;function A_(){if(dd)return Oi;dd=1;var e=T_(),r=B(),n=xe(),t=NaN,a=/^[-+]0x[0-9a-f]+$/i,i=/^0b[01]+$/i,u=/^0o[0-7]+$/i,s=parseInt;function o(c){if(typeof c=="number")return c;if(n(c))return t;if(r(c)){var f=typeof c.valueOf=="function"?c.valueOf():c;c=r(f)?f+"":f}if(typeof c!="string")return c===0?c:+c;c=e(c);var d=i.test(c);return d||u.test(c)?s(c.slice(2),d?2:8):a.test(c)?t:+c}return Oi=o,Oi}var xi,hd;function il(){if(hd)return xi;hd=1;var e=A_(),r=1/0,n=17976931348623157e292;function t(a){if(!a)return a===0?a:0;if(a=e(a),a===r||a===-r){var i=a<0?-1:1;return i*n}return a===a?a:0}return xi=t,xi}var Pi,ld;function C_(){if(ld)return Pi;ld=1;var e=il();function r(n){var t=e(n),a=t%1;return t===t?a?t-a:t:0}return Pi=r,Pi}var Mi,vd;function S_(){if(vd)return Mi;vd=1;var e=Zh(),r=ie(),n=C_(),t=Math.max;function a(i,u,s){var o=i==null?0:i.length;if(!o)return-1;var c=s==null?0:n(s);return c<0&&(c=t(o+c,0)),e(i,r(u,3),c)}return Mi=a,Mi}var Li,pd;function O_(){if(pd)return Li;pd=1;var e=E_(),r=S_(),n=e(r);return Li=n,Li}var ki,_d;function ul(){if(_d)return ki;_d=1;var e=$u();function r(n){var t=n==null?0:n.length;return t?e(n,1):[]}return ki=r,ki}var Ni,gd;function x_(){if(gd)return Ni;gd=1;var e=ju(),r=Oh(),n=ye();function t(a,i){return a==null?a:e(a,r(i),n)}return Ni=t,Ni}var Fi,bd;function P_(){if(bd)return Fi;bd=1;function e(r){var n=r==null?0:r.length;return n?r[n-1]:void 0}return Fi=e,Fi}var ji,yd;function M_(){if(yd)return ji;yd=1;var e=cr(),r=Du(),n=ie();function t(a,i){var u={};return i=n(i,3),r(a,function(s,o,c){e(u,o,i(s,o,c))}),u}return ji=t,ji}var Di,md;function zu(){if(md)return Di;md=1;var e=xe();function r(n,t,a){for(var i=-1,u=n.length;++in}return Gi=e,Gi}var Bi,wd;function k_(){if(wd)return Bi;wd=1;var e=zu(),r=L_(),n=me();function t(a){return a&&a.length?e(a,n,r):void 0}return Bi=t,Bi}var $i,Rd;function sl(){if(Rd)return $i;Rd=1;var e=cr(),r=Ae();function n(t,a,i){(i!==void 0&&!r(t[a],i)||i===void 0&&!(a in t))&&e(t,a,i)}return $i=n,$i}var Ui,Ed;function N_(){if(Ed)return Ui;Ed=1;var e=ge(),r=pr(),n=Z(),t="[object Object]",a=Function.prototype,i=Object.prototype,u=a.toString,s=i.hasOwnProperty,o=u.call(Object);function c(f){if(!n(f)||e(f)!=t)return!1;var d=r(f);if(d===null)return!0;var h=s.call(d,"constructor")&&d.constructor;return typeof h=="function"&&h instanceof h&&u.call(h)==o}return Ui=c,Ui}var zi,Id;function ol(){if(Id)return zi;Id=1;function e(r,n){if(!(n==="constructor"&&typeof r[n]=="function")&&n!="__proto__")return r[n]}return zi=e,zi}var Ki,Td;function F_(){if(Td)return Ki;Td=1;var e=Be(),r=ye();function n(t){return e(t,r(t))}return Ki=n,Ki}var Vi,Ad;function j_(){if(Ad)return Vi;Ad=1;var e=sl(),r=gh(),n=Th(),t=bh(),a=Ch(),i=$e(),u=k(),s=Jh(),o=Se(),c=Ge(),f=B(),d=N_(),h=Ue(),l=ol(),p=F_();function v(_,g,b,m,w,A,q){var y=l(_,b),T=l(g,b),S=q.get(T);if(S){e(_,b,S);return}var x=A?A(y,T,b+"",_,g,q):void 0,E=x===void 0;if(E){var L=u(T),N=!L&&o(T),J=!L&&!N&&h(T);x=T,L||N||J?u(y)?x=y:s(y)?x=t(y):N?(E=!1,x=r(T,!0)):J?(E=!1,x=n(T,!0)):x=[]:d(T)||i(T)?(x=y,i(y)?x=p(y):(!f(y)||c(y))&&(x=a(T))):E=!1}E&&(q.set(T,x),w(x,T,m,A,q),q.delete(T)),e(_,b,x)}return Vi=v,Vi}var Hi,Cd;function D_(){if(Cd)return Hi;Cd=1;var e=fr(),r=sl(),n=ju(),t=j_(),a=B(),i=ye(),u=ol();function s(o,c,f,d,h){o!==c&&n(c,function(l,p){if(h||(h=new e),a(l))t(o,c,p,f,s,d,h);else{var v=d?d(u(o,p),l,p+"",o,c,h):void 0;v===void 0&&(v=l),r(o,p,v)}},i)}return Hi=s,Hi}var Wi,Sd;function G_(){if(Sd)return Wi;Sd=1;var e=mr(),r=qr();function n(t){return e(function(a,i){var u=-1,s=i.length,o=s>1?i[s-1]:void 0,c=s>2?i[2]:void 0;for(o=t.length>3&&typeof o=="function"?(s--,o):void 0,c&&r(i[0],i[1],c)&&(o=s<3?void 0:o,s=1),a=Object(a);++ut||s&&o&&f&&!c&&!d||i&&o&&f||!a&&f||!u)return 1;if(!i&&!s&&!d&&n=c)return f;var d=a[i];return f*(d=="desc"?-1:1)}}return n.index-t.index}return cu=r,cu}var du,Vd;function ng(){if(Vd)return du;Vd=1;var e=gr(),r=yr(),n=ie(),t=Vh(),a=Q_(),i=lr(),u=rg(),s=me(),o=k();function c(f,d,h){d.length?d=e(d,function(v){return o(v)?function(_){return r(_,v.length===1?v[0]:v)}:v}):d=[s];var l=-1;d=e(d,i(n));var p=t(f,function(v,_,g){var b=e(d,function(m){return m(v)});return{criteria:b,index:++l,value:v}});return a(p,function(v,_){return u(v,_,h)})}return du=c,du}var hu,Hd;function tg(){if(Hd)return hu;Hd=1;var e=$u(),r=ng(),n=mr(),t=qr(),a=n(function(i,u){if(i==null)return[];var s=u.length;return s>1&&t(i,u[0],u[1])?u=[]:s>2&&t(u[0],u[1],u[2])&&(u=[u[0]]),r(i,e(u,1),[])});return hu=a,hu}var lu,Wd;function ag(){if(Wd)return lu;Wd=1;var e=Dh(),r=0;function n(t){var a=++r;return e(t)+a}return lu=n,lu}var vu,Yd;function ig(){if(Yd)return vu;Yd=1;function e(r,n,t){for(var a=-1,i=r.length,u=n.length,s={};++a0;--s)if(u=r[s].dequeue(),u){t=t.concat(_u(e,r,n,u,!0));break}}}return t}function _u(e,r,n,t,a){var i=a?[]:void 0;return re.forEach(e.inEdges(t.v),function(u){var s=e.edge(u),o=e.node(u.v);a&&i.push({v:u.v,w:u.w}),o.out-=s,Eu(r,n,o)}),re.forEach(e.outEdges(t.v),function(u){var s=e.edge(u),o=u.w,c=e.node(o);c.in-=s,Eu(r,n,c)}),e.removeNode(t.v),i}function pg(e,r){var n=new fg,t=0,a=0;re.forEach(e.nodes(),function(s){n.setNode(s,{v:s,in:0,out:0})}),re.forEach(e.edges(),function(s){var o=n.edge(s.v,s.w)||0,c=r(s),f=o+c;n.setEdge(s.v,s.w,f),a=Math.max(a,n.node(s.v).out+=c),t=Math.max(t,n.node(s.w).in+=c)});var i=re.range(a+t+3).map(function(){return new cg}),u=t+1;return re.forEach(n.nodes(),function(s){Eu(i,u,n.node(s))}),{graph:n,buckets:i,zeroIdx:u}}function Eu(e,r,n){n.out?n.in?e[n.out-n.in+r].enqueue(n):e[e.length-1].enqueue(n):e[0].enqueue(n)}var _e=M,_g=dg,gg={run:bg,undo:mg};function bg(e){var r=e.graph().acyclicer==="greedy"?_g(e,n(e)):yg(e);_e.forEach(r,function(t){var a=e.edge(t);e.removeEdge(t),a.forwardName=t.name,a.reversed=!0,e.setEdge(t.w,t.v,a,_e.uniqueId("rev"))});function n(t){return function(a){return t.edge(a).weight}}}function yg(e){var r=[],n={},t={};function a(i){_e.has(t,i)||(t[i]=!0,n[i]=!0,_e.forEach(e.outEdges(i),function(u){_e.has(n,u.w)?r.push(u):a(u.w)}),delete n[i])}return _e.forEach(e.nodes(),a),r}function mg(e){_e.forEach(e.edges(),function(r){var n=e.edge(r);if(n.reversed){e.removeEdge(r);var t=n.forwardName;delete n.reversed,delete n.forwardName,e.setEdge(r.w,r.v,n,t)}})}var C=M,dl=V.Graph,j={addDummyNode:hl,simplify:qg,asNonCompoundGraph:wg,successorWeights:Rg,predecessorWeights:Eg,intersectRect:Ig,buildLayerMatrix:Tg,normalizeRanks:Ag,removeEmptyRanks:Cg,addBorderNode:Sg,maxRank:ll,partition:Og,time:xg,notime:Pg};function hl(e,r,n,t){var a;do a=C.uniqueId(t);while(e.hasNode(a));return n.dummy=r,e.setNode(a,n),a}function qg(e){var r=new dl().setGraph(e.graph());return C.forEach(e.nodes(),function(n){r.setNode(n,e.node(n))}),C.forEach(e.edges(),function(n){var t=r.edge(n.v,n.w)||{weight:0,minlen:1},a=e.edge(n);r.setEdge(n.v,n.w,{weight:t.weight+a.weight,minlen:Math.max(t.minlen,a.minlen)})}),r}function wg(e){var r=new dl({multigraph:e.isMultigraph()}).setGraph(e.graph());return C.forEach(e.nodes(),function(n){e.children(n).length||r.setNode(n,e.node(n))}),C.forEach(e.edges(),function(n){r.setEdge(n,e.edge(n))}),r}function Rg(e){var r=C.map(e.nodes(),function(n){var t={};return C.forEach(e.outEdges(n),function(a){t[a.w]=(t[a.w]||0)+e.edge(a).weight}),t});return C.zipObject(e.nodes(),r)}function Eg(e){var r=C.map(e.nodes(),function(n){var t={};return C.forEach(e.inEdges(n),function(a){t[a.v]=(t[a.v]||0)+e.edge(a).weight}),t});return C.zipObject(e.nodes(),r)}function Ig(e,r){var n=e.x,t=e.y,a=r.x-n,i=r.y-t,u=e.width/2,s=e.height/2;if(!a&&!i)throw new Error("Not possible to find intersection inside of the rectangle");var o,c;return Math.abs(i)*u>Math.abs(a)*s?(i<0&&(s=-s),o=s*a/i,c=s):(a<0&&(u=-u),o=u,c=u*i/a),{x:n+o,y:t+c}}function Tg(e){var r=C.map(C.range(ll(e)+1),function(){return[]});return C.forEach(e.nodes(),function(n){var t=e.node(n),a=t.rank;C.isUndefined(a)||(r[a][t.order]=n)}),r}function Ag(e){var r=C.min(C.map(e.nodes(),function(n){return e.node(n).rank}));C.forEach(e.nodes(),function(n){var t=e.node(n);C.has(t,"rank")&&(t.rank-=r)})}function Cg(e){var r=C.min(C.map(e.nodes(),function(i){return e.node(i).rank})),n=[];C.forEach(e.nodes(),function(i){var u=e.node(i).rank-r;n[u]||(n[u]=[]),n[u].push(i)});var t=0,a=e.graph().nodeRankFactor;C.forEach(n,function(i,u){C.isUndefined(i)&&u%a!==0?--t:t&&C.forEach(i,function(s){e.node(s).rank+=t})})}function Sg(e,r,n,t){var a={width:0,height:0};return arguments.length>=4&&(a.rank=n,a.order=t),hl(e,"border",a,r)}function ll(e){return C.max(C.map(e.nodes(),function(r){var n=e.node(r).rank;if(!C.isUndefined(n))return n}))}function Og(e,r){var n={lhs:[],rhs:[]};return C.forEach(e,function(t){r(t)?n.lhs.push(t):n.rhs.push(t)}),n}function xg(e,r){var n=C.now();try{return r()}finally{console.log(e+" time: "+(C.now()-n)+"ms")}}function Pg(e,r){return r()}var vl=M,Mg=j,Lg={run:kg,undo:Fg};function kg(e){e.graph().dummyChains=[],vl.forEach(e.edges(),function(r){Ng(e,r)})}function Ng(e,r){var n=r.v,t=e.node(n).rank,a=r.w,i=e.node(a).rank,u=r.name,s=e.edge(r),o=s.labelRank;if(i!==t+1){e.removeEdge(r);var c,f,d;for(d=0,++t;tu.lim&&(s=u,o=!0);var c=te.filter(r.edges(),function(f){return o===Zd(e,e.node(f.v),s)&&o!==Zd(e,e.node(f.w),s)});return te.minBy(c,function(f){return Vg(r,f)})}function ml(e,r,n,t){var a=n.v,i=n.w;e.removeEdge(a,i),e.setEdge(t.v,t.w,{}),Vu(e),Ku(e,r),Qg(e,r)}function Qg(e,r){var n=te.find(e.nodes(),function(a){return!r.node(a).parent}),t=Wg(e,n);t=t.slice(1),te.forEach(t,function(a){var i=e.node(a).parent,u=r.edge(a,i),s=!1;u||(u=r.edge(i,a),s=!0),r.node(a).rank=r.node(i).rank+(s?u.minlen:-u.minlen)})}function eb(e,r,n){return e.hasEdge(r,n)}function Zd(e,r,n){return n.low<=r.lim&&r.lim<=n.lim}var rb=Rr,ql=rb.longestPath,nb=pl,tb=Zg,ab=ib;function ib(e){switch(e.graph().ranker){case"network-simplex":Jd(e);break;case"tight-tree":sb(e);break;case"longest-path":ub(e);break;default:Jd(e)}}var ub=ql;function sb(e){ql(e),nb(e)}function Jd(e){tb(e)}var Iu=M,ob=fb;function fb(e){var r=db(e);Iu.forEach(e.graph().dummyChains,function(n){for(var t=e.node(n),a=t.edgeObj,i=cb(e,r,a.v,a.w),u=i.path,s=i.lca,o=0,c=u[o],f=!0;n!==a.w;){if(t=e.node(n),f){for(;(c=u[o])!==s&&e.node(c).maxRanku||s>r[o].lim));for(c=o,o=t;(o=e.parent(o))!==c;)i.push(o);return{path:a.concat(i.reverse()),lca:c}}function db(e){var r={},n=0;function t(a){var i=n;Iu.forEach(e.children(a),t),r[a]={low:i,lim:n++}}return Iu.forEach(e.children(),t),r}var ne=M,Tu=j,hb={run:lb,cleanup:_b};function lb(e){var r=Tu.addDummyNode(e,"root",{},"_root"),n=vb(e),t=ne.max(ne.values(n))-1,a=2*t+1;e.graph().nestingRoot=r,ne.forEach(e.edges(),function(u){e.edge(u).minlen*=a});var i=pb(e)+1;ne.forEach(e.children(),function(u){wl(e,r,a,i,t,n,u)}),e.graph().nodeRankFactor=a}function wl(e,r,n,t,a,i,u){var s=e.children(u);if(!s.length){u!==r&&e.setEdge(r,u,{weight:0,minlen:n});return}var o=Tu.addBorderNode(e,"_bt"),c=Tu.addBorderNode(e,"_bb"),f=e.node(u);e.setParent(o,u),f.borderTop=o,e.setParent(c,u),f.borderBottom=c,ne.forEach(s,function(d){wl(e,r,n,t,a,i,d);var h=e.node(d),l=h.borderTop?h.borderTop:d,p=h.borderBottom?h.borderBottom:d,v=h.borderTop?t:2*t,_=l!==p?1:a-i[u]+1;e.setEdge(o,l,{weight:v,minlen:_,nestingEdge:!0}),e.setEdge(p,c,{weight:v,minlen:_,nestingEdge:!0})}),e.parent(u)||e.setEdge(r,o,{weight:0,minlen:a+i[u]})}function vb(e){var r={};function n(t,a){var i=e.children(t);i&&i.length&&ne.forEach(i,function(u){n(u,a+1)}),r[t]=a}return ne.forEach(e.children(),function(t){n(t,1)}),r}function pb(e){return ne.reduce(e.edges(),function(r,n){return r+e.edge(n).weight},0)}function _b(e){var r=e.graph();e.removeNode(r.nestingRoot),delete r.nestingRoot,ne.forEach(e.edges(),function(n){var t=e.edge(n);t.nestingEdge&&e.removeEdge(n)})}var gu=M,gb=j,bb=yb;function yb(e){function r(n){var t=e.children(n),a=e.node(n);if(t.length&&gu.forEach(t,r),gu.has(a,"minRank")){a.borderLeft=[],a.borderRight=[];for(var i=a.minRank,u=a.maxRank+1;i0;)f%2&&(d+=s[f+1]),f=f-1>>1,s[f]+=c.weight;o+=c.weight*d})),o}var rh=M,Ob=xb;function xb(e,r){return rh.map(r,function(n){var t=e.inEdges(n);if(t.length){var a=rh.reduce(t,function(i,u){var s=e.edge(u),o=e.node(u.v);return{sum:i.sum+s.weight*o.order,weight:i.weight+s.weight}},{sum:0,weight:0});return{v:n,barycenter:a.sum/a.weight,weight:a.weight}}else return{v:n}})}var G=M,Pb=Mb;function Mb(e,r){var n={};G.forEach(e,function(a,i){var u=n[a.v]={indegree:0,in:[],out:[],vs:[a.v],i};G.isUndefined(a.barycenter)||(u.barycenter=a.barycenter,u.weight=a.weight)}),G.forEach(r.edges(),function(a){var i=n[a.v],u=n[a.w];!G.isUndefined(i)&&!G.isUndefined(u)&&(u.indegree++,i.out.push(n[a.w]))});var t=G.filter(n,function(a){return!a.indegree});return Lb(t)}function Lb(e){var r=[];function n(i){return function(u){u.merged||(G.isUndefined(u.barycenter)||G.isUndefined(i.barycenter)||u.barycenter>=i.barycenter)&&kb(i,u)}}function t(i){return function(u){u.in.push(i),--u.indegree===0&&e.push(u)}}for(;e.length;){var a=e.pop();r.push(a),G.forEach(a.in.reverse(),n(a)),G.forEach(a.out,t(a))}return G.map(G.filter(r,function(i){return!i.merged}),function(i){return G.pick(i,["vs","i","barycenter","weight"])})}function kb(e,r){var n=0,t=0;e.weight&&(n+=e.barycenter*e.weight,t+=e.weight),r.weight&&(n+=r.barycenter*r.weight,t+=r.weight),e.vs=r.vs.concat(e.vs),e.barycenter=n/t,e.weight=t,e.i=Math.min(r.i,e.i),r.merged=!0}var Ne=M,Nb=j,Fb=jb;function jb(e,r){var n=Nb.partition(e,function(f){return Ne.has(f,"barycenter")}),t=n.lhs,a=Ne.sortBy(n.rhs,function(f){return-f.i}),i=[],u=0,s=0,o=0;t.sort(Db(!!r)),o=nh(i,a,o),Ne.forEach(t,function(f){o+=f.vs.length,i.push(f.vs),u+=f.barycenter*f.weight,s+=f.weight,o=nh(i,a,o)});var c={vs:Ne.flatten(i,!0)};return s&&(c.barycenter=u/s,c.weight=s),c}function nh(e,r,n){for(var t;r.length&&(t=Ne.last(r)).i<=n;)r.pop(),e.push(t.vs),n++;return n}function Db(e){return function(r,n){return r.barycentern.barycenter?1:e?n.i-r.i:r.i-n.i}}var fe=M,Gb=Ob,Bb=Pb,$b=Fb,Ub=El;function El(e,r,n,t){var a=e.children(r),i=e.node(r),u=i?i.borderLeft:void 0,s=i?i.borderRight:void 0,o={};u&&(a=fe.filter(a,function(p){return p!==u&&p!==s}));var c=Gb(e,a);fe.forEach(c,function(p){if(e.children(p.v).length){var v=El(e,p.v,n,t);o[p.v]=v,fe.has(v,"barycenter")&&Kb(p,v)}});var f=Bb(c,n);zb(f,o);var d=$b(f,t);if(u&&(d.vs=fe.flatten([u,d.vs,s],!0),e.predecessors(u).length)){var h=e.node(e.predecessors(u)[0]),l=e.node(e.predecessors(s)[0]);fe.has(d,"barycenter")||(d.barycenter=0,d.weight=0),d.barycenter=(d.barycenter*d.weight+h.order+l.order)/(d.weight+2),d.weight+=2}return d}function zb(e,r){fe.forEach(e,function(n){n.vs=fe.flatten(n.vs.map(function(t){return r[t]?r[t].vs:t}),!0)})}function Kb(e,r){fe.isUndefined(e.barycenter)?(e.barycenter=r.barycenter,e.weight=r.weight):(e.barycenter=(e.barycenter*e.weight+r.barycenter*r.weight)/(e.weight+r.weight),e.weight+=r.weight)}var Fe=M,Vb=V.Graph,Hb=Wb;function Wb(e,r,n){var t=Yb(e),a=new Vb({compound:!0}).setGraph({root:t}).setDefaultNodeLabel(function(i){return e.node(i)});return Fe.forEach(e.nodes(),function(i){var u=e.node(i),s=e.parent(i);(u.rank===r||u.minRank<=r&&r<=u.maxRank)&&(a.setNode(i),a.setParent(i,s||t),Fe.forEach(e[n](i),function(o){var c=o.v===i?o.w:o.v,f=a.edge(c,i),d=Fe.isUndefined(f)?0:f.weight;a.setEdge(c,i,{weight:e.edge(o).weight+d})}),Fe.has(u,"minRank")&&a.setNode(i,{borderLeft:u.borderLeft[r],borderRight:u.borderRight[r]}))}),a}function Yb(e){for(var r;e.hasNode(r=Fe.uniqueId("_root")););return r}var Xb=M,Zb=Jb;function Jb(e,r,n){var t={},a;Xb.forEach(n,function(i){for(var u=e.parent(i),s,o;u;){if(s=e.parent(u),s?(o=t[s],t[s]=u):(o=a,a=u),o&&o!==u){r.setEdge(o,u);return}u=s}})}var de=M,Qb=Ib,ey=Ab,ry=Ub,ny=Hb,ty=Zb,ay=V.Graph,th=j,iy=uy;function uy(e){var r=th.maxRank(e),n=ah(e,de.range(1,r+1),"inEdges"),t=ah(e,de.range(r-1,-1,-1),"outEdges"),a=Qb(e);ih(e,a);for(var i=Number.POSITIVE_INFINITY,u,s=0,o=0;o<4;++s,++o){sy(s%2?n:t,s%4>=2),a=th.buildLayerMatrix(e);var c=ey(e,a);cc)&&Hu(n,h,f)})})}function a(i,u){var s=-1,o,c=0;return R.forEach(u,function(f,d){if(e.node(f).dummy==="border"){var h=e.predecessors(f);h.length&&(o=e.node(h[0]).order,t(u,c,d,s,o),c=d,s=o)}t(u,c,u.length,o,i.length)}),u}return R.reduce(r,a),n}function dy(e,r){if(e.node(r).dummy)return R.find(e.predecessors(r),function(n){return e.node(n).dummy})}function Hu(e,r,n){if(r>n){var t=r;r=n,n=t}var a=e[r];a||(e[r]=a={}),a[n]=!0}function Al(e,r,n){if(r>n){var t=r;r=n,n=t}return R.has(e[r],n)}function Cl(e,r,n,t){var a={},i={},u={};return R.forEach(r,function(s){R.forEach(s,function(o,c){a[o]=o,i[o]=o,u[o]=c})}),R.forEach(r,function(s){var o=-1;R.forEach(s,function(c){var f=t(c);if(f.length){f=R.sortBy(f,function(v){return u[v]});for(var d=(f.length-1)/2,h=Math.floor(d),l=Math.ceil(d);h<=l;++h){var p=f[h];i[c]===c&&o({}));const o=u==="LR";s.setGraph({rankdir:u}),n.value=u;for(const c of a){const f=e(c.id);s.setNode(c.id,{width:f.dimensions.width||150,height:f.dimensions.height||50})}for(const c of i)s.setEdge(c.source,c.target);return wu.layout(s),a.map(c=>{const f=s.node(c.id);return Tr(Ir({},c),{targetPosition:o?Ze.Left:Ze.Top,sourcePosition:o?Ze.Right:Ze.Bottom,position:{x:f.x,y:f.y}})})}return{graph:r,layout:t,previousDirection:n}}function um(e){for(let r=e.length-1;r>0;r--){const n=Math.floor(Math.random()*(r+1));[e[r],e[n]]=[e[n],e[r]]}}function sm(e){const r=[];for(const n of e)for(const t of e)if(n.id!==t.id){const a=`e${n.id}-${t.id}`;r.push({id:a,source:n.id,target:t.id,type:"animation",animated:!0})}return r}function om(){return e=>{const r=sm(e);um(r);const n=new Set,t=[];for(const a of r)!n.has(a.target)&&(n.size===0||n.has(a.source))&&(t.push(a),n.add(a.source),n.add(a.target));return t}}function fm({graph:e,cancelOnError:r=!0}){const{updateNodeData:n,getConnectedEdges:t}=ar(),a=Ru(()=>rs(e)),i=Te(!1),u=new Set,s=new Map,o=new Set;function c(v,_=!1){return Q(this,null,function*(){if(u.has(v.id))return;o.add(v.id);const g=t(v.id).filter(m=>m.target===v.id);if(yield Promise.all(g.map(m=>cm(()=>!m.data.isAnimating))),o.clear(),!i.value)return;u.add(v.id),n(v.id,{isRunning:!0,isFinished:!1,hasError:!1,isCancelled:!1});const b=Math.floor(Math.random()*2e3)+1e3;return new Promise(m=>{const w=setTimeout(()=>Q(this,null,function*(){const A=a.value.successors(v.id),q=Math.random()<.15;if(!_&&q&&(n(v.id,{isRunning:!1,hasError:!0}),rs(r))){yield h(v.id),s.delete(v.id),m();return}n(v.id,{isRunning:!1,isFinished:!0}),s.delete(v.id),A.length>0&&(yield Promise.all(A.map(y=>c({id:y})))),m()}),_?0:b);s.set(v.id,w)})})}function f(v){return Q(this,null,function*(){if(i.value)return;d(v),i.value=!0;const _=v.filter(g=>{var b;return((b=a.value.predecessors(g.id))==null?void 0:b.length)===0});yield Promise.all(_.map(g=>c(g,!0))),p()})}function d(v){p();for(const _ of v)n(_.id,{isRunning:!1,isFinished:!1,hasError:!1,isSkipped:!1,isCancelled:!1})}function h(v){return Q(this,null,function*(){const _=a.value.successors(v);for(const g of _)n(g,{isRunning:!1,isSkipped:!0}),yield h(g)})}function l(){return Q(this,null,function*(){i.value=!1;for(const v of o)clearTimeout(s.get(v)),s.delete(v),n(v,{isRunning:!1,isFinished:!1,hasError:!1,isSkipped:!1,isCancelled:!0}),yield h(v);for(const[v,_]of s)clearTimeout(_),s.delete(v),n(v,{isRunning:!1,isFinished:!1,hasError:!1,isSkipped:!1,isCancelled:!0}),yield h(v);u.clear(),o.clear()})}function p(){i.value=!1,u.clear(),s.clear()}return{run:f,stop:l,reset:d,isRunning:i}}function cm(e){return Q(this,null,function*(){return new Promise(r=>{const n=setInterval(()=>{e()&&(clearInterval(n),r())},100)})})}var Y=(e=>(e.Lines="lines",e.Dots="dots",e))(Y||{});const Ll=function({dimensions:e,size:r,color:n}){return dh("path",{stroke:n,"stroke-width":r,d:`M${e[0]/2} 0 V${e[1]} M0 ${e[1]/2} H${e[0]}`})},kl=function({radius:e,color:r}){return dh("circle",{cx:e,cy:e,r:e,fill:r})};Y.Lines+"",Y.Dots+"";const dm={[Y.Dots]:"#81818a",[Y.Lines]:"#eee"},hm=["id","x","y","width","height","patternTransform"],lm={key:2,height:"100",width:"100"},vm=["fill"],pm=["x","y","fill"],_m={name:"Background",compatConfig:{MODE:3}},gm=ch(Tr(Ir({},_m),{props:{id:{},variant:{default:()=>Y.Dots},gap:{default:20},size:{default:1},lineWidth:{default:1},patternColor:{},color:{},bgColor:{},height:{default:100},width:{default:100},x:{default:0},y:{default:0},offset:{default:2}},setup(e){const{id:r,viewport:n}=ar(),t=ov(()=>{const[u,s]=Array.isArray(e.gap)?e.gap:[e.gap,e.gap],o=[u*n.value.zoom||1,s*n.value.zoom||1],c=e.size*n.value.zoom,f=e.variant===Y.Dots?[c/e.offset,c/e.offset]:[o[0]/e.offset,o[1]/e.offset];return{scaledGap:o,offset:f,size:c}}),a=Ru(()=>`pattern-${r}${e.id?`-${e.id}`:""}`),i=Ru(()=>e.color||e.patternColor||dm[e.variant||Y.Dots]);return(u,s)=>(pe(),De("svg",{class:"vue-flow__background vue-flow__container",style:fv({height:`${u.height>100?100:u.height}%`,width:`${u.width>100?100:u.width}%`})},[Ar(u.$slots,"pattern-container",{id:a.value},()=>[ce("pattern",{id:a.value,x:D(n).x%t.value.scaledGap[0],y:D(n).y%t.value.scaledGap[1],width:t.value.scaledGap[0],height:t.value.scaledGap[1],patternTransform:`translate(-${t.value.offset[0]},-${t.value.offset[1]})`,patternUnits:"userSpaceOnUse"},[Ar(u.$slots,"pattern",{},()=>[u.variant===D(Y).Lines?(pe(),ns(D(Ll),{key:0,size:u.lineWidth,color:i.value,dimensions:t.value.scaledGap},null,8,["size","color","dimensions"])):u.variant===D(Y).Dots?(pe(),ns(D(kl),{key:1,color:i.value,radius:t.value.size/u.offset},null,8,["color","radius"])):ts("",!0),u.bgColor?(pe(),De("svg",lm,[ce("rect",{width:"100%",height:"100%",fill:u.bgColor},null,8,vm)])):ts("",!0)])],8,hm)]),ce("rect",{x:u.x,y:u.y,width:"100%",height:"100%",fill:`url(#${a.value})`},null,8,pm),Ar(u.$slots,"default",{id:a.value})],4))}})),U={x:0,y:0},z="process",W="animation",bm=[{id:"1",position:U,type:z},{id:"2",position:U,type:z},{id:"2a",position:U,type:z},{id:"2b",position:U,type:z},{id:"2c",position:U,type:z},{id:"2d",position:U,type:z},{id:"3",position:U,type:z},{id:"4",position:U,type:z},{id:"5",position:U,type:z},{id:"6",position:U,type:z},{id:"7",position:U,type:z}],ym=[{id:"e1-2",source:"1",target:"2",type:W,animated:!0},{id:"e1-3",source:"1",target:"3",type:W,animated:!0},{id:"e2-2a",source:"2",target:"2a",type:W,animated:!0},{id:"e2-2b",source:"2",target:"2b",type:W,animated:!0},{id:"e2-2c",source:"2",target:"2c",type:W,animated:!0},{id:"e2c-2d",source:"2c",target:"2d",type:W,animated:!0},{id:"e3-7",source:"3",target:"4",type:W,animated:!0},{id:"e4-5",source:"4",target:"5",type:W,animated:!0},{id:"e5-6",source:"5",target:"6",type:W,animated:!0},{id:"e5-7",source:"5",target:"7",type:W,animated:!0}],mm=e=>(cv("data-v-6094ddc5"),e=e(),dv(),e),qm={class:"layout-flow"},wm={class:"layout-panel"},Rm=mm(()=>ce("span",{class:"spinner"},null,-1)),Em=ch({__name:"index",setup(e){const r=Te(bm),n=Te(ym),t=Te(!0),a=om(),{graph:i,layout:u,previousDirection:s}=im(),{run:o,stop:c,reset:f,isRunning:d}=fm({graph:i,cancelOnError:t}),{fitView:h}=ar();function l(){return Q(this,null,function*(){yield c(),f(r.value),n.value=a(r.value),as(()=>{p(s.value)})})}function p(v){return Q(this,null,function*(){yield c(),f(r.value),r.value=u(r.value,n.value,v),as(()=>{h(),o(r.value)})})}return(v,_)=>(pe(),De("div",qm,[H(D(vv),{nodes:r.value,edges:n.value,onNodesInitialized:_[4]||(_[4]=g=>p("LR"))},{"node-process":Xe(g=>[H(pv,{data:g.data,"source-position":g.sourcePosition,"target-position":g.targetPosition},null,8,["data","source-position","target-position"])]),"edge-animation":Xe(g=>[H(_v,{id:g.id,source:g.source,target:g.target,"source-x":g.sourceX,"source-y":g.sourceY,targetX:g.targetX,targetY:g.targetY,"source-position":g.sourcePosition,"target-position":g.targetPosition},null,8,["id","source","target","source-x","source-y","targetX","targetY","source-position","target-position"])]),default:Xe(()=>[H(D(gm)),H(D(lv),{class:"process-panel",position:"top-left"},{default:Xe(()=>[ce("div",wm,[D(d)?(pe(),De("button",{key:0,class:"stop-btn",title:"stop",onClick:_[0]||(_[0]=(...g)=>D(c)&&D(c)(...g))},[H(Pe,{name:"stop"}),Rm])):(pe(),De("button",{key:1,title:"start",onClick:_[1]||(_[1]=g=>D(o)(r.value))},[H(Pe,{name:"play"})])),ce("button",{title:"set horizontal layout",onClick:_[2]||(_[2]=g=>p("LR"))},[H(Pe,{name:"horizontal"})]),ce("button",{title:"set vertical layout",onClick:_[3]||(_[3]=g=>p("TB"))},[H(Pe,{name:"vertical"})]),ce("button",{title:"shuffle graph",onClick:l},[H(Pe,{name:"shuffle"})])])]),_:1})]),_:1},8,["nodes","edges"])]))}}),Pm=hv(Em,[["__scopeId","data-v-6094ddc5"]]);export{Pm as default};
diff --git a/dist/static/js/index-BFy3Dy6B.js b/dist/static/js/index-BFy3Dy6B.js
new file mode 100644
index 000000000..35c0ff874
--- /dev/null
+++ b/dist/static/js/index-BFy3Dy6B.js
@@ -0,0 +1 @@
+import{_ as v}from"./base.vue_vue_type_script_setup_true_lang-DQND8o9G.js";import{_ as x}from"./multi.vue_vue_type_script_setup_true_lang-DEEPnO8m.js";import{_ as k}from"./picUpload.vue_vue_type_script_setup_true_lang-DEWSKbAP.js";import{d as h,r as V,f as o,j as e,k as s,e as n,g as m,l as d,m as a,u as _,K as c,_ as w}from"./index-Bp-Azfsb.js";import"./index.esm-XGMxYbo3.js";import"./index-9JYGKM11.js";const g=v,N=x,y=k,B={class:"card-header"},C={class:"font-medium"},$=h({name:"Editor",__name:"index",setup(b){const t=V("1");return(U,r)=>{const i=s("el-link"),l=s("el-collapse-item"),p=s("el-collapse"),f=s("el-card");return n(),o(f,{shadow:"never"},{header:e(()=>[m("div",B,[m("span",C,[d(" 编辑器组件,采用开源的 "),a(i,{href:"https://www.wangeditor.com",target:"_blank",style:{margin:"0 4px 5px","font-size":"16px"}},{default:e(()=>[d(" Wangeditor ")]),_:1})])])]),default:e(()=>[a(p,{modelValue:t.value,"onUpdate:modelValue":r[0]||(r[0]=u=>t.value=u),accordion:""},{default:e(()=>[a(l,{title:"基础用法",name:"1"},{default:e(()=>[t.value==="1"?(n(),o(_(g),{key:0})):c("",!0)]),_:1}),a(l,{title:"多个富文本",name:"2"},{default:e(()=>[t.value==="2"?(n(),o(_(N),{key:0})):c("",!0)]),_:1}),a(l,{title:"自定义图片上传",name:"3"},{default:e(()=>[t.value==="3"?(n(),o(_(y),{key:0})):c("",!0)]),_:1})]),_:1},8,["modelValue"])]),_:1})}}}),P=w($,[["__scopeId","data-v-370db8ff"]]);export{P as default};
diff --git a/dist/static/js/index-Dc69Ip74.js b/dist/static/js/index-BGHr10Rh.js
similarity index 95%
rename from dist/static/js/index-Dc69Ip74.js
rename to dist/static/js/index-BGHr10Rh.js
index 68f661485..ee3afc1e3 100644
--- a/dist/static/js/index-Dc69Ip74.js
+++ b/dist/static/js/index-BGHr10Rh.js
@@ -1,4 +1,4 @@
-var Ne=Object.defineProperty,Se=Object.defineProperties;var Ae=Object.getOwnPropertyDescriptors;var Ut=Object.getOwnPropertySymbols;var Le=Object.prototype.hasOwnProperty,Be=Object.prototype.propertyIsEnumerable;var jt=(a,t,i)=>t in a?Ne(a,t,{enumerable:!0,configurable:!0,writable:!0,value:i}):a[t]=i,ht=(a,t)=>{for(var i in t||(t={}))Le.call(t,i)&&jt(a,i,t[i]);if(Ut)for(var i of Ut(t))Be.call(t,i)&&jt(a,i,t[i]);return a},Gt=(a,t)=>Se(a,Ae(t));var qt=(a,t,i)=>new Promise((e,o)=>{var r=d=>{try{s(i.next(d))}catch(l){o(l)}},n=d=>{try{s(i.throw(d))}catch(l){o(l)}},s=d=>d.done?e(d.value):Promise.resolve(d.value).then(r,n);s((i=i.apply(a,t)).next())});import{f as X,k as W,g as z,aM as Ie,d as Ft,r as F,L as mt,o as ke,$ as He,aN as ze,u as Pe,aO as $e,i as L,m as H,Y as Ye,aP as Xe,aQ as We,aR as Ve,aS as Ue,aT as je,aU as Ge,j as S,s as qe,a1 as Fe,S as Qe}from"./index-BQLilEpU.js";/*!
+var Ne=Object.defineProperty,Se=Object.defineProperties;var Ae=Object.getOwnPropertyDescriptors;var Ut=Object.getOwnPropertySymbols;var Le=Object.prototype.hasOwnProperty,Be=Object.prototype.propertyIsEnumerable;var jt=(a,t,i)=>t in a?Ne(a,t,{enumerable:!0,configurable:!0,writable:!0,value:i}):a[t]=i,ht=(a,t)=>{for(var i in t||(t={}))Le.call(t,i)&&jt(a,i,t[i]);if(Ut)for(var i of Ut(t))Be.call(t,i)&&jt(a,i,t[i]);return a},Gt=(a,t)=>Se(a,Ae(t));var qt=(a,t,i)=>new Promise((e,o)=>{var r=d=>{try{s(i.next(d))}catch(l){o(l)}},n=d=>{try{s(i.throw(d))}catch(l){o(l)}},s=d=>d.done?e(d.value):Promise.resolve(d.value).then(r,n);s((i=i.apply(a,t)).next())});import{e as Y,x as W,g as z,aM as Ie,d as Ft,r as F,c as mt,o as ke,a as He,aN as ze,u as Pe,aO as $e,m as L,z as H,Y as Xe,aP as Ye,aQ as We,aR as Ve,aS as Ue,aT as je,aU as Ge,v as S,D as qe,a3 as Fe,X as Qe}from"./index-Bp-Azfsb.js";/*!
* Cropper.js v1.6.1
* https://fengyuanchen.github.io/cropperjs
*
@@ -7,4 +7,4 @@ var Ne=Object.defineProperty,Se=Object.defineProperties;var Ae=Object.getOwnProp
*
* Date: 2023-09-17T03:44:19.860Z
*/function Qt(a,t){var i=Object.keys(a);if(Object.getOwnPropertySymbols){var e=Object.getOwnPropertySymbols(a);t&&(e=e.filter(function(o){return Object.getOwnPropertyDescriptor(a,o).enumerable})),i.push.apply(i,e)}return i}function ue(a){for(var t=1;ta.length)&&(t=a.length);for(var i=0,e=new Array(t);i
',fi=Number.isNaN||q.isNaN;function m(a){return typeof a=="number"&&!fi(a)}var ce=function(t){return t>0&&t<1/0};function _t(a){return typeof a=="undefined"}function it(a){return Et(a)==="object"&&a!==null}var gi=Object.prototype.hasOwnProperty;function rt(a){if(!it(a))return!1;try{var t=a.constructor,i=t.prototype;return t&&i&&gi.call(i,"isPrototypeOf")}catch(e){return!1}}function $(a){return typeof a=="function"}var vi=Array.prototype.slice;function De(a){return Array.from?Array.from(a):vi.call(a)}function A(a,t){return a&&$(t)&&(Array.isArray(a)||m(a.length)?De(a).forEach(function(i,e){t.call(a,i,e,a)}):it(a)&&Object.keys(a).forEach(function(i){t.call(a,a[i],i,a)})),a}var T=Object.assign||function(t){for(var i=arguments.length,e=new Array(i>1?i-1:0),o=1;o0&&e.forEach(function(r){it(r)&&Object.keys(r).forEach(function(n){t[n]=r[n]})}),t},mi=/\.\d*(?:0|9){12}\d*$/;function ot(a){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1e11;return mi.test(a)?Math.round(a*t)/t:a}var wi=/^width|height|left|top|marginLeft|marginTop$/;function K(a,t){var i=a.style;A(t,function(e,o){wi.test(o)&&m(e)&&(e="".concat(e,"px")),i[o]=e})}function bi(a,t){return a.classList?a.classList.contains(t):a.className.indexOf(t)>-1}function B(a,t){if(t){if(m(a.length)){A(a,function(e){B(e,t)});return}if(a.classList){a.classList.add(t);return}var i=a.className.trim();i?i.indexOf(t)<0&&(a.className="".concat(i," ").concat(t)):a.className=t}}function G(a,t){if(t){if(m(a.length)){A(a,function(i){G(i,t)});return}if(a.classList){a.classList.remove(t);return}a.className.indexOf(t)>=0&&(a.className=a.className.replace(t,""))}}function nt(a,t,i){if(t){if(m(a.length)){A(a,function(e){nt(e,t,i)});return}i?B(a,t):G(a,t)}}var yi=/([a-z\d])([A-Z])/g;function $t(a){return a.replace(yi,"$1-$2").toLowerCase()}function It(a,t){return it(a[t])?a[t]:a.dataset?a.dataset[t]:a.getAttribute("data-".concat($t(t)))}function gt(a,t,i){it(i)?a[t]=i:a.dataset?a.dataset[t]=i:a.setAttribute("data-".concat($t(t)),i)}function xi(a,t){if(it(a[t]))try{delete a[t]}catch(i){a[t]=void 0}else if(a.dataset)try{delete a.dataset[t]}catch(i){a.dataset[t]=void 0}else a.removeAttribute("data-".concat($t(t)))}var Me=/\s\s*/,_e=function(){var a=!1;if(xt){var t=!1,i=function(){},e=Object.defineProperty({},"once",{get:function(){return a=!0,t},set:function(r){t=r}});q.addEventListener("test",i,e),q.removeEventListener("test",i,e)}return a}();function j(a,t,i){var e=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{},o=i;t.trim().split(Me).forEach(function(r){if(!_e){var n=a.listeners;n&&n[r]&&n[r][i]&&(o=n[r][i],delete n[r][i],Object.keys(n[r]).length===0&&delete n[r],Object.keys(n).length===0&&delete a.listeners)}a.removeEventListener(r,o,e)})}function U(a,t,i){var e=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{},o=i;t.trim().split(Me).forEach(function(r){if(e.once&&!_e){var n=a.listeners,s=n===void 0?{}:n;o=function(){delete s[r][i],a.removeEventListener(r,o,e);for(var l=arguments.length,h=new Array(l),c=0;cMath.abs(i)&&(i=u)})}),i}function bt(a,t){var i=a.pageX,e=a.pageY,o={endX:i,endY:e};return t?o:ue({startX:i,startY:e},o)}function _i(a){var t=0,i=0,e=0;return A(a,function(o){var r=o.startX,n=o.startY;t+=r,i+=n,e+=1}),t/=e,i/=e,{pageX:t,pageY:i}}function Z(a){var t=a.aspectRatio,i=a.height,e=a.width,o=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"contain",r=ce(e),n=ce(i);if(r&&n){var s=i*t;o==="contain"&&s>e||o==="cover"&&s90?{width:d,height:s}:{width:s,height:d}}function Ei(a,t,i,e){var o=t.aspectRatio,r=t.naturalWidth,n=t.naturalHeight,s=t.rotate,d=s===void 0?0:s,l=t.scaleX,h=l===void 0?1:l,c=t.scaleY,u=c===void 0?1:c,g=i.aspectRatio,v=i.naturalWidth,D=i.naturalHeight,f=e.fillColor,O=f===void 0?"transparent":f,R=e.imageSmoothingEnabled,C=R===void 0?!0:R,V=e.imageSmoothingQuality,k=V===void 0?"low":V,p=e.maxWidth,b=p===void 0?1/0:p,N=e.maxHeight,P=N===void 0?1/0:N,w=e.minWidth,y=w===void 0?0:w,x=e.minHeight,_=x===void 0?0:x,M=document.createElement("canvas"),I=M.getContext("2d"),J=Z({aspectRatio:g,width:b,height:P}),vt=Z({aspectRatio:g,width:y,height:_},"cover"),Dt=Math.min(J.width,Math.max(vt.width,v)),Mt=Math.min(J.height,Math.max(vt.height,D)),Yt=Z({aspectRatio:o,width:b,height:P}),Xt=Z({aspectRatio:o,width:y,height:_},"cover"),Wt=Math.min(Yt.width,Math.max(Xt.width,r)),Vt=Math.min(Yt.height,Math.max(Xt.height,n)),Oe=[-Wt/2,-Vt/2,Wt,Vt];return M.width=ot(Dt),M.height=ot(Mt),I.fillStyle=O,I.fillRect(0,0,Dt,Mt),I.save(),I.translate(Dt/2,Mt/2),I.rotate(d*Math.PI/180),I.scale(h,u),I.imageSmoothingEnabled=C,I.imageSmoothingQuality=k,I.drawImage.apply(I,[a].concat(pe(Oe.map(function(Re){return Math.floor(ot(Re))})))),I.restore(),M}var Ee=String.fromCharCode;function Ti(a,t,i){var e="";i+=t;for(var o=t;o0;)i.push(Ee.apply(null,De(o.subarray(0,e)))),o=o.subarray(e);return"data:".concat(t,";base64,").concat(btoa(i.join("")))}function Si(a){var t=new DataView(a),i;try{var e,o,r;if(t.getUint8(0)===255&&t.getUint8(1)===216)for(var n=t.byteLength,s=2;s+1=8&&(r=l+c)}}}if(r){var u=t.getUint16(r,e),g,v;for(v=0;v=0?r:ye),height:Math.max(e.offsetHeight,n>=0?n:xe)};this.containerData=s,K(o,{width:s.width,height:s.height}),B(t,Y),G(o,Y)},initCanvas:function(){var t=this.containerData,i=this.imageData,e=this.options.viewMode,o=Math.abs(i.rotate)%180===90,r=o?i.naturalHeight:i.naturalWidth,n=o?i.naturalWidth:i.naturalHeight,s=r/n,d=t.width,l=t.height;t.height*s>t.width?e===3?d=t.height*s:l=t.width/s:e===3?l=t.width/s:d=t.height*s;var h={aspectRatio:s,naturalWidth:r,naturalHeight:n,width:d,height:l};this.canvasData=h,this.limited=e===1||e===2,this.limitCanvas(!0,!0),h.width=Math.min(Math.max(h.width,h.minWidth),h.maxWidth),h.height=Math.min(Math.max(h.height,h.minHeight),h.maxHeight),h.left=(t.width-h.width)/2,h.top=(t.height-h.height)/2,h.oldLeft=h.left,h.oldTop=h.top,this.initialCanvasData=T({},h)},limitCanvas:function(t,i){var e=this.options,o=this.containerData,r=this.canvasData,n=this.cropBoxData,s=e.viewMode,d=r.aspectRatio,l=this.cropped&&n;if(t){var h=Number(e.minCanvasWidth)||0,c=Number(e.minCanvasHeight)||0;s>1?(h=Math.max(h,o.width),c=Math.max(c,o.height),s===3&&(c*d>h?h=c*d:c=h/d)):s>0&&(h?h=Math.max(h,l?n.width:0):c?c=Math.max(c,l?n.height:0):l&&(h=n.width,c=n.height,c*d>h?h=c*d:c=h/d));var u=Z({aspectRatio:d,width:h,height:c});h=u.width,c=u.height,r.minWidth=h,r.minHeight=c,r.maxWidth=1/0,r.maxHeight=1/0}if(i)if(s>(l?0:1)){var g=o.width-r.width,v=o.height-r.height;r.minLeft=Math.min(0,g),r.minTop=Math.min(0,v),r.maxLeft=Math.max(0,g),r.maxTop=Math.max(0,v),l&&this.limited&&(r.minLeft=Math.min(n.left,n.left+(n.width-r.width)),r.minTop=Math.min(n.top,n.top+(n.height-r.height)),r.maxLeft=n.left,r.maxTop=n.top,s===2&&(r.width>=o.width&&(r.minLeft=Math.min(0,g),r.maxLeft=Math.max(0,g)),r.height>=o.height&&(r.minTop=Math.min(0,v),r.maxTop=Math.max(0,v))))}else r.minLeft=-r.width,r.minTop=-r.height,r.maxLeft=o.width,r.maxTop=o.height},renderCanvas:function(t,i){var e=this.canvasData,o=this.imageData;if(i){var r=Ci({width:o.naturalWidth*Math.abs(o.scaleX||1),height:o.naturalHeight*Math.abs(o.scaleY||1),degree:o.rotate||0}),n=r.width,s=r.height,d=e.width*(n/e.naturalWidth),l=e.height*(s/e.naturalHeight);e.left-=(d-e.width)/2,e.top-=(l-e.height)/2,e.width=d,e.height=l,e.aspectRatio=n/s,e.naturalWidth=n,e.naturalHeight=s,this.limitCanvas(!0,!1)}(e.width>e.maxWidth||e.widthe.maxHeight||e.heighti.width?r.height=r.width/e:r.width=r.height*e),this.cropBoxData=r,this.limitCropBox(!0,!0),r.width=Math.min(Math.max(r.width,r.minWidth),r.maxWidth),r.height=Math.min(Math.max(r.height,r.minHeight),r.maxHeight),r.width=Math.max(r.minWidth,r.width*o),r.height=Math.max(r.minHeight,r.height*o),r.left=i.left+(i.width-r.width)/2,r.top=i.top+(i.height-r.height)/2,r.oldLeft=r.left,r.oldTop=r.top,this.initialCropBoxData=T({},r)},limitCropBox:function(t,i){var e=this.options,o=this.containerData,r=this.canvasData,n=this.cropBoxData,s=this.limited,d=e.aspectRatio;if(t){var l=Number(e.minCropBoxWidth)||0,h=Number(e.minCropBoxHeight)||0,c=s?Math.min(o.width,r.width,r.width+r.left,o.width-r.left):o.width,u=s?Math.min(o.height,r.height,r.height+r.top,o.height-r.top):o.height;l=Math.min(l,o.width),h=Math.min(h,o.height),d&&(l&&h?h*d>l?h=l/d:l=h*d:l?h=l/d:h&&(l=h*d),u*d>c?u=c/d:c=u*d),n.minWidth=Math.min(l,c),n.minHeight=Math.min(h,u),n.maxWidth=c,n.maxHeight=u}i&&(s?(n.minLeft=Math.max(0,r.left),n.minTop=Math.max(0,r.top),n.maxLeft=Math.min(o.width,r.left+r.width)-n.width,n.maxTop=Math.min(o.height,r.top+r.height)-n.height):(n.minLeft=0,n.minTop=0,n.maxLeft=o.width-n.width,n.maxTop=o.height-n.height))},renderCropBox:function(){var t=this.options,i=this.containerData,e=this.cropBoxData;(e.width>e.maxWidth||e.widthe.maxHeight||e.height=i.width&&e.height>=i.height?ve:zt),K(this.cropBox,T({width:e.width,height:e.height},pt({translateX:e.left,translateY:e.top}))),this.cropped&&this.limited&&this.limitCanvas(!0,!0),this.disabled||this.output()},output:function(){this.preview(),st(this.element,Nt,this.getData())}},Bi={initPreview:function(){var t=this.element,i=this.crossOrigin,e=this.options.preview,o=i?this.crossOriginUrl:this.url,r=t.alt||"The image to preview",n=document.createElement("img");if(i&&(n.crossOrigin=i),n.src=o,n.alt=r,this.viewBox.appendChild(n),this.viewBoxImage=n,!!e){var s=e;typeof e=="string"?s=t.ownerDocument.querySelectorAll(e):e.querySelector&&(s=[e]),this.previews=s,A(s,function(d){var l=document.createElement("img");gt(d,wt,{width:d.offsetWidth,height:d.offsetHeight,html:d.innerHTML}),i&&(l.crossOrigin=i),l.src=o,l.alt=r,l.style.cssText='display:block;width:100%;height:auto;min-width:0!important;min-height:0!important;max-width:none!important;max-height:none!important;image-orientation:0deg!important;"',d.innerHTML="",d.appendChild(l)})}},resetPreview:function(){A(this.previews,function(t){var i=It(t,wt);K(t,{width:i.width,height:i.height}),t.innerHTML=i.html,xi(t,wt)})},preview:function(){var t=this.imageData,i=this.canvasData,e=this.cropBoxData,o=e.width,r=e.height,n=t.width,s=t.height,d=e.left-i.left-t.left,l=e.top-i.top-t.top;!this.cropped||this.disabled||(K(this.viewBoxImage,T({width:n,height:s},pt(T({translateX:-d,translateY:-l},t)))),A(this.previews,function(h){var c=It(h,wt),u=c.width,g=c.height,v=u,D=g,f=1;o&&(f=u/o,D=r*f),r&&D>g&&(f=g/r,v=o*f,D=g),K(h,{width:v,height:D}),K(h.getElementsByTagName("img")[0],T({width:n*f,height:s*f},pt(T({translateX:-d*f,translateY:-l*f},t))))}))}},Ii={bind:function(){var t=this.element,i=this.options,e=this.cropper;$(i.cropstart)&&U(t,Lt,i.cropstart),$(i.cropmove)&&U(t,At,i.cropmove),$(i.cropend)&&U(t,St,i.cropend),$(i.crop)&&U(t,Nt,i.crop),$(i.zoom)&&U(t,Bt,i.zoom),U(e,ee,this.onCropStart=this.cropStart.bind(this)),i.zoomable&&i.zoomOnWheel&&U(e,oe,this.onWheel=this.wheel.bind(this),{passive:!1,capture:!0}),i.toggleDragModeOnDblclick&&U(e,te,this.onDblclick=this.dblclick.bind(this)),U(t.ownerDocument,ie,this.onCropMove=this.cropMove.bind(this)),U(t.ownerDocument,ae,this.onCropEnd=this.cropEnd.bind(this)),i.responsive&&U(window,ne,this.onResize=this.resize.bind(this))},unbind:function(){var t=this.element,i=this.options,e=this.cropper;$(i.cropstart)&&j(t,Lt,i.cropstart),$(i.cropmove)&&j(t,At,i.cropmove),$(i.cropend)&&j(t,St,i.cropend),$(i.crop)&&j(t,Nt,i.crop),$(i.zoom)&&j(t,Bt,i.zoom),j(e,ee,this.onCropStart),i.zoomable&&i.zoomOnWheel&&j(e,oe,this.onWheel,{passive:!1,capture:!0}),i.toggleDragModeOnDblclick&&j(e,te,this.onDblclick),j(t.ownerDocument,ie,this.onCropMove),j(t.ownerDocument,ae,this.onCropEnd),i.responsive&&j(window,ne,this.onResize)}},ki={resize:function(){if(!this.disabled){var t=this.options,i=this.container,e=this.containerData,o=i.offsetWidth/e.width,r=i.offsetHeight/e.height,n=Math.abs(o-1)>Math.abs(r-1)?o:r;if(n!==1){var s,d;t.restore&&(s=this.getCanvasData(),d=this.getCropBoxData()),this.render(),t.restore&&(this.setCanvasData(A(s,function(l,h){s[h]=l*n})),this.setCropBoxData(A(d,function(l,h){d[h]=l*n})))}}},dblclick:function(){this.disabled||this.options.dragMode===be||this.setDragMode(bi(this.dragBox,Ot)?we:Pt)},wheel:function(t){var i=this,e=Number(this.options.wheelZoomRatio)||.1,o=1;this.disabled||(t.preventDefault(),!this.wheeling&&(this.wheeling=!0,setTimeout(function(){i.wheeling=!1},50),t.deltaY?o=t.deltaY>0?1:-1:t.wheelDelta?o=-t.wheelDelta/120:t.detail&&(o=t.detail>0?1:-1),this.zoom(-o*e,t)))},cropStart:function(t){var i=t.buttons,e=t.button;if(!(this.disabled||(t.type==="mousedown"||t.type==="pointerdown"&&t.pointerType==="mouse")&&(m(i)&&i!==1||m(e)&&e!==0||t.ctrlKey))){var o=this.options,r=this.pointers,n;t.changedTouches?A(t.changedTouches,function(s){r[s.identifier]=bt(s)}):r[t.pointerId||0]=bt(t),Object.keys(r).length>1&&o.zoomable&&o.zoomOnTouch?n=me:n=It(t.target,ft),ci.test(n)&&st(this.element,Lt,{originalEvent:t,action:n})!==!1&&(t.preventDefault(),this.action=n,this.cropping=!1,n===ge&&(this.cropping=!0,B(this.dragBox,yt)))}},cropMove:function(t){var i=this.action;if(!(this.disabled||!i)){var e=this.pointers;t.preventDefault(),st(this.element,At,{originalEvent:t,action:i})!==!1&&(t.changedTouches?A(t.changedTouches,function(o){T(e[o.identifier]||{},bt(o,!0))}):T(e[t.pointerId||0]||{},bt(t,!0)),this.change(t))}},cropEnd:function(t){if(!this.disabled){var i=this.action,e=this.pointers;t.changedTouches?A(t.changedTouches,function(o){delete e[o.identifier]}):delete e[t.pointerId||0],i&&(t.preventDefault(),Object.keys(e).length||(this.action=""),this.cropping&&(this.cropping=!1,nt(this.dragBox,yt,this.cropped&&this.options.modal)),st(this.element,St,{originalEvent:t,action:i}))}}},Hi={change:function(t){var i=this.options,e=this.canvasData,o=this.containerData,r=this.cropBoxData,n=this.pointers,s=this.action,d=i.aspectRatio,l=r.left,h=r.top,c=r.width,u=r.height,g=l+c,v=h+u,D=0,f=0,O=o.width,R=o.height,C=!0,V;!d&&t.shiftKey&&(d=c&&u?c/u:1),this.limited&&(D=r.minLeft,f=r.minTop,O=D+Math.min(o.width,e.width,e.left+e.width),R=f+Math.min(o.height,e.height,e.top+e.height));var k=n[Object.keys(n)[0]],p={x:k.endX-k.startX,y:k.endY-k.startY},b=function(P){switch(P){case tt:g+p.x>O&&(p.x=O-g);break;case et:l+p.xR&&(p.y=R-v);break}};switch(s){case zt:l+=p.x,h+=p.y;break;case tt:if(p.x>=0&&(g>=O||d&&(h<=f||v>=R))){C=!1;break}b(tt),c+=p.x,c<0&&(s=et,c=-c,l-=c),d&&(u=c/d,h+=(r.height-u)/2);break;case Q:if(p.y<=0&&(h<=f||d&&(l<=D||g>=O))){C=!1;break}b(Q),u-=p.y,h+=p.y,u<0&&(s=at,u=-u,h-=u),d&&(c=u*d,l+=(r.width-c)/2);break;case et:if(p.x<=0&&(l<=D||d&&(h<=f||v>=R))){C=!1;break}b(et),c-=p.x,l+=p.x,c<0&&(s=tt,c=-c,l-=c),d&&(u=c/d,h+=(r.height-u)/2);break;case at:if(p.y>=0&&(v>=R||d&&(l<=D||g>=O))){C=!1;break}b(at),u+=p.y,u<0&&(s=Q,u=-u,h-=u),d&&(c=u*d,l+=(r.width-c)/2);break;case ct:if(d){if(p.y<=0&&(h<=f||g>=O)){C=!1;break}b(Q),u-=p.y,h+=p.y,c=u*d}else b(Q),b(tt),p.x>=0?gf&&(u-=p.y,h+=p.y):(u-=p.y,h+=p.y);c<0&&u<0?(s=ut,u=-u,c=-c,h-=u,l-=c):c<0?(s=lt,c=-c,l-=c):u<0&&(s=dt,u=-u,h-=u);break;case lt:if(d){if(p.y<=0&&(h<=f||l<=D)){C=!1;break}b(Q),u-=p.y,h+=p.y,c=u*d,l+=r.width-c}else b(Q),b(et),p.x<=0?l>D?(c-=p.x,l+=p.x):p.y<=0&&h<=f&&(C=!1):(c-=p.x,l+=p.x),p.y<=0?h>f&&(u-=p.y,h+=p.y):(u-=p.y,h+=p.y);c<0&&u<0?(s=dt,u=-u,c=-c,h-=u,l-=c):c<0?(s=ct,c=-c,l-=c):u<0&&(s=ut,u=-u,h-=u);break;case ut:if(d){if(p.x<=0&&(l<=D||v>=R)){C=!1;break}b(et),c-=p.x,l+=p.x,u=c/d}else b(at),b(et),p.x<=0?l>D?(c-=p.x,l+=p.x):p.y>=0&&v>=R&&(C=!1):(c-=p.x,l+=p.x),p.y>=0?v=0&&(g>=O||v>=R)){C=!1;break}b(tt),c+=p.x,u=c/d}else b(at),b(tt),p.x>=0?g=0&&v>=R&&(C=!1):c+=p.x,p.y>=0?v0?s=p.y>0?dt:ct:p.x<0&&(l-=c,s=p.y>0?ut:lt),p.y<0&&(h-=u),this.cropped||(G(this.cropBox,Y),this.cropped=!0,this.limited&&this.limitCropBox(!0,!0));break}C&&(r.width=c,r.height=u,r.left=l,r.top=h,this.action=s,this.renderCropBox()),A(n,function(N){N.startX=N.endX,N.startY=N.endY})}},zi={crop:function(){return this.ready&&!this.cropped&&!this.disabled&&(this.cropped=!0,this.limitCropBox(!0,!0),this.options.modal&&B(this.dragBox,yt),G(this.cropBox,Y),this.setCropBoxData(this.initialCropBoxData)),this},reset:function(){return this.ready&&!this.disabled&&(this.imageData=T({},this.initialImageData),this.canvasData=T({},this.initialCanvasData),this.cropBoxData=T({},this.initialCropBoxData),this.renderCanvas(),this.cropped&&this.renderCropBox()),this},clear:function(){return this.cropped&&!this.disabled&&(T(this.cropBoxData,{left:0,top:0,width:0,height:0}),this.cropped=!1,this.renderCropBox(),this.limitCanvas(!0,!0),this.renderCanvas(),G(this.dragBox,yt),B(this.cropBox,Y)),this},replace:function(t){var i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;return!this.disabled&&t&&(this.isImg&&(this.element.src=t),i?(this.url=t,this.image.src=t,this.ready&&(this.viewBoxImage.src=t,A(this.previews,function(e){e.getElementsByTagName("img")[0].src=t}))):(this.isImg&&(this.replaced=!0),this.options.data=null,this.uncreate(),this.load(t))),this},enable:function(){return this.ready&&this.disabled&&(this.disabled=!1,G(this.cropper,Zt)),this},disable:function(){return this.ready&&!this.disabled&&(this.disabled=!0,B(this.cropper,Zt)),this},destroy:function(){var t=this.element;return t[E]?(t[E]=void 0,this.isImg&&this.replaced&&(t.src=this.originalUrl),this.uncreate(),this):this},move:function(t){var i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:t,e=this.canvasData,o=e.left,r=e.top;return this.moveTo(_t(t)?t:o+Number(t),_t(i)?i:r+Number(i))},moveTo:function(t){var i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:t,e=this.canvasData,o=!1;return t=Number(t),i=Number(i),this.ready&&!this.disabled&&this.options.movable&&(m(t)&&(e.left=t,o=!0),m(i)&&(e.top=i,o=!0),o&&this.renderCanvas(!0)),this},zoom:function(t,i){var e=this.canvasData;return t=Number(t),t<0?t=1/(1-t):t=1+t,this.zoomTo(e.width*t/e.naturalWidth,null,i)},zoomTo:function(t,i,e){var o=this.options,r=this.canvasData,n=r.width,s=r.height,d=r.naturalWidth,l=r.naturalHeight;if(t=Number(t),t>=0&&this.ready&&!this.disabled&&o.zoomable){var h=d*t,c=l*t;if(st(this.element,Bt,{ratio:t,oldRatio:n/d,originalEvent:e})===!1)return this;if(e){var u=this.pointers,g=Ce(this.cropper),v=u&&Object.keys(u).length?_i(u):{pageX:e.pageX,pageY:e.pageY};r.left-=(h-n)*((v.pageX-g.left-r.left)/n),r.top-=(c-s)*((v.pageY-g.top-r.top)/s)}else rt(i)&&m(i.x)&&m(i.y)?(r.left-=(h-n)*((i.x-r.left)/n),r.top-=(c-s)*((i.y-r.top)/s)):(r.left-=(h-n)/2,r.top-=(c-s)/2);r.width=h,r.height=c,this.renderCanvas(!0)}return this},rotate:function(t){return this.rotateTo((this.imageData.rotate||0)+Number(t))},rotateTo:function(t){return t=Number(t),m(t)&&this.ready&&!this.disabled&&this.options.rotatable&&(this.imageData.rotate=t%360,this.renderCanvas(!0,!0)),this},scaleX:function(t){var i=this.imageData.scaleY;return this.scale(t,m(i)?i:1)},scaleY:function(t){var i=this.imageData.scaleX;return this.scale(m(i)?i:1,t)},scale:function(t){var i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:t,e=this.imageData,o=!1;return t=Number(t),i=Number(i),this.ready&&!this.disabled&&this.options.scalable&&(m(t)&&(e.scaleX=t,o=!0),m(i)&&(e.scaleY=i,o=!0),o&&this.renderCanvas(!0,!0)),this},getData:function(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1,i=this.options,e=this.imageData,o=this.canvasData,r=this.cropBoxData,n;if(this.ready&&this.cropped){n={x:r.left-o.left,y:r.top-o.top,width:r.width,height:r.height};var s=e.width/e.naturalWidth;if(A(n,function(h,c){n[c]=h/s}),t){var d=Math.round(n.y+n.height),l=Math.round(n.x+n.width);n.x=Math.round(n.x),n.y=Math.round(n.y),n.width=l-n.x,n.height=d-n.y}}else n={x:0,y:0,width:0,height:0};return i.rotatable&&(n.rotate=e.rotate||0),i.scalable&&(n.scaleX=e.scaleX||1,n.scaleY=e.scaleY||1),n},setData:function(t){var i=this.options,e=this.imageData,o=this.canvasData,r={};if(this.ready&&!this.disabled&&rt(t)){var n=!1;i.rotatable&&m(t.rotate)&&t.rotate!==e.rotate&&(e.rotate=t.rotate,n=!0),i.scalable&&(m(t.scaleX)&&t.scaleX!==e.scaleX&&(e.scaleX=t.scaleX,n=!0),m(t.scaleY)&&t.scaleY!==e.scaleY&&(e.scaleY=t.scaleY,n=!0)),n&&this.renderCanvas(!0,!0);var s=e.width/e.naturalWidth;m(t.x)&&(r.left=t.x*s+o.left),m(t.y)&&(r.top=t.y*s+o.top),m(t.width)&&(r.width=t.width*s),m(t.height)&&(r.height=t.height*s),this.setCropBoxData(r)}return this},getContainerData:function(){return this.ready?T({},this.containerData):{}},getImageData:function(){return this.sized?T({},this.imageData):{}},getCanvasData:function(){var t=this.canvasData,i={};return this.ready&&A(["left","top","width","height","naturalWidth","naturalHeight"],function(e){i[e]=t[e]}),i},setCanvasData:function(t){var i=this.canvasData,e=i.aspectRatio;return this.ready&&!this.disabled&&rt(t)&&(m(t.left)&&(i.left=t.left),m(t.top)&&(i.top=t.top),m(t.width)?(i.width=t.width,i.height=t.width/e):m(t.height)&&(i.height=t.height,i.width=t.height*e),this.renderCanvas(!0)),this},getCropBoxData:function(){var t=this.cropBoxData,i;return this.ready&&this.cropped&&(i={left:t.left,top:t.top,width:t.width,height:t.height}),i||{}},setCropBoxData:function(t){var i=this.cropBoxData,e=this.options.aspectRatio,o,r;return this.ready&&this.cropped&&!this.disabled&&rt(t)&&(m(t.left)&&(i.left=t.left),m(t.top)&&(i.top=t.top),m(t.width)&&t.width!==i.width&&(o=!0,i.width=t.width),m(t.height)&&t.height!==i.height&&(r=!0,i.height=t.height),e&&(o?i.height=i.width/e:r&&(i.width=i.height*e)),this.renderCropBox()),this},getCroppedCanvas:function(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(!this.ready||!window.HTMLCanvasElement)return null;var i=this.canvasData,e=Ei(this.image,this.imageData,i,t);if(!this.cropped)return e;var o=this.getData(t.rounded),r=o.x,n=o.y,s=o.width,d=o.height,l=e.width/Math.floor(i.naturalWidth);l!==1&&(r*=l,n*=l,s*=l,d*=l);var h=s/d,c=Z({aspectRatio:h,width:t.maxWidth||1/0,height:t.maxHeight||1/0}),u=Z({aspectRatio:h,width:t.minWidth||0,height:t.minHeight||0},"cover"),g=Z({aspectRatio:h,width:t.width||(l!==1?e.width:s),height:t.height||(l!==1?e.height:d)}),v=g.width,D=g.height;v=Math.min(c.width,Math.max(u.width,v)),D=Math.min(c.height,Math.max(u.height,D));var f=document.createElement("canvas"),O=f.getContext("2d");f.width=ot(v),f.height=ot(D),O.fillStyle=t.fillColor||"transparent",O.fillRect(0,0,v,D);var R=t.imageSmoothingEnabled,C=R===void 0?!0:R,V=t.imageSmoothingQuality;O.imageSmoothingEnabled=C,V&&(O.imageSmoothingQuality=V);var k=e.width,p=e.height,b=r,N=n,P,w,y,x,_,M;b<=-s||b>k?(b=0,P=0,y=0,_=0):b<=0?(y=-b,b=0,P=Math.min(k,s+b),_=P):b<=k&&(y=0,P=Math.min(s,k-b),_=P),P<=0||N<=-d||N>p?(N=0,w=0,x=0,M=0):N<=0?(x=-N,N=0,w=Math.min(p,d+N),M=w):N<=p&&(x=0,w=Math.min(d,p-N),M=w);var I=[b,N,P,w];if(_>0&&M>0){var J=v/s;I.push(y*J,x*J,_*J,M*J)}return O.drawImage.apply(O,[e].concat(pe(I.map(function(vt){return Math.floor(ot(vt))})))),f},setAspectRatio:function(t){var i=this.options;return!this.disabled&&!_t(t)&&(i.aspectRatio=Math.max(0,t)||NaN,this.ready&&(this.initCropBox(),this.cropped&&this.renderCropBox())),this},setDragMode:function(t){var i=this.options,e=this.dragBox,o=this.face;if(this.ready&&!this.disabled){var r=t===Pt,n=i.movable&&t===we;t=r||n?t:be,i.dragMode=t,gt(e,ft,t),nt(e,Ot,r),nt(e,Rt,n),i.cropBoxMovable||(gt(o,ft,t),nt(o,Ot,r),nt(o,Rt,n))}return this}},Pi=q.Cropper,Te=function(){function a(t){var i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(Ke(this,a),!t||!ui.test(t.tagName))throw new Error("The first argument is required and must be an
or