From 8d91e4d8bef9dd668e9295b5582ecf397e2b5812 Mon Sep 17 00:00:00 2001 From: Eliot Ragueneau Date: Wed, 14 Aug 2024 13:21:10 +0100 Subject: [PATCH] :rocket: Make complexviewer esbuild compatible for Point2D and intersectionjs --- dist/complexviewer.js | 2 +- src/js/viz/interactor/complex.js | 4 ++-- src/js/viz/link/binary-link.js | 4 ++-- src/js/viz/link/feature-link.js | 3 --- 4 files changed, 5 insertions(+), 8 deletions(-) diff --git a/dist/complexviewer.js b/dist/complexviewer.js index 9a29b5d..4bab5fd 100644 --- a/dist/complexviewer.js +++ b/dist/complexviewer.js @@ -1,2 +1,2 @@ /*! For license information please see complexviewer.js.LICENSE.txt */ -!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define([],e):"object"==typeof exports?exports.complexviewer=e():t.complexviewer=e()}(self,(()=>(()=>{var t={296:(t,e)=>{var n,r,i,o;function a(t){return a="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},a(t)}o=function(){return function t(e,n,r){function i(a,s){if(!n[a]){if(!e[a]){if(o)return o(a,!0);var u=new Error("Cannot find module '"+a+"'");throw u.code="MODULE_NOT_FOUND",u}var c=n[a]={exports:{}};e[a][0].call(c.exports,(function(t){return i(e[a][1][t]||t)}),c,c.exports,t,e,n,r)}return n[a].exports}for(var o=void 0,a=0;as;){var u=e[s][a];u>0&&u1e-9)break;var p=this.offsetDir();for(r=0;r1&&d>y||!isFinite(y))for(r=0;r1&&(v=1);var g=y*y,x=2*v*(d-y)/(g*d),m=f*d,b=2*-v/(g*m);for(isFinite(x)||console.log(x),r=0;r0?M-(P+1)*w:M-(P-1)*w;-_0;)for(var i=e;i-- >0;)n(r,i)},t.prototype.matrixApply=function(e){t.mApply(this.k,this.n,e)},t.prototype.computeNextPosition=function(t,e){var n=this;this.computeDerivatives(t);var r=this.computeStepSize(this.g);if(this.stepAndProject(t,e,this.g,r),this.project){this.matrixApply((function(r,i){return n.e[r][i]=t[r][i]-e[r][i]}));var i=this.computeStepSize(this.e);i=Math.max(.2,Math.min(i,1)),this.stepAndProject(t,e,this.e,i)}},t.prototype.run=function(t){for(var e=Number.MAX_VALUE,n=!1;!n&&t-- >0;){var r=this.rungeKutta();n=Math.abs(e/r-1)>16)/this.range},t.prototype.getNextBetween=function(t,e){return t+this.getNext()*(e-t)},t}();n.PseudoRandom=o},{}],8:[function(t,e,n){"use strict";var r,i=this&&this.__extends||(r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])},r(t,e)},function(t,e){function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});Object.defineProperty(n,"__esModule",{value:!0});var o=t("./rectangle"),a=function(){};n.Point=a;var s=function(t,e,n,r){this.x1=t,this.y1=e,this.x2=n,this.y2=r};n.LineSegment=s;var u=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i(e,t),e}(a);function c(t,e,n){return(e.x-t.x)*(n.y-t.y)-(n.x-t.x)*(e.y-t.y)}function l(t,e,n){return c(t,e,n)>0}function f(t,e,n){return c(t,e,n)<0}function h(t,e){var n,r,i,o,a=e.length-1;if(f(t,e[1],e[0])&&!l(t,e[a-1],e[0]))return 0;for(n=0,r=a;;){if(r-n==1)return l(t,e[n],e[r])?n:r;if((o=f(t,e[(i=Math.floor((n+r)/2))+1],e[i]))&&!l(t,e[i-1],e[i]))return i;l(t,e[n+1],e[n])?o||l(t,e[n],e[i])?r=i:n=i:o&&f(t,e[n],e[i])?r=i:n=i}}function p(t,e){var n,r,i,o,a=e.length-1;if(l(t,e[a-1],e[0])&&!f(t,e[1],e[0]))return 0;for(n=0,r=a;;){if(r-n==1)return f(t,e[n],e[r])?n:r;if(o=f(t,e[(i=Math.floor((n+r)/2))+1],e[i]),l(t,e[i-1],e[i])&&!o)return i;f(t,e[n+1],e[n])?o?f(t,e[n],e[i])?r=i:n=i:r=i:o?n=i:l(t,e[n],e[i])?r=i:n=i}}function d(t,e,n,r,i,o){var a,s;s=r(t[a=n(e[0],t)],e);for(var u=!1;!u;){for(u=!0;a===t.length-1&&(a=0),!i(e[s],t[a],t[a+1]);)++a;for(;0===s&&(s=e.length-1),!o(t[a],e[s],e[s-1]);)--s,u=!1}return{t1:a,t2:s}}function y(t,e){return d(t,e,h,p,l,f)}n.PolyPoint=u,n.isLeft=c,n.ConvexHull=function(t){var e,n=t.slice(0).sort((function(t,e){return t.x!==e.x?e.x-t.x:e.y-t.y})),r=t.length,i=n[0].x;for(e=1;e=0&&n[e].x===l;e--);for(s=e+1,e=o;++e<=s;)if(!(c(n[0],n[s],n[e])>=0&&e1&&!(c(a[a.length-2],a[a.length-1],n[e])>0);)a.length-=1;0!=e&&a.push(n[e])}u!=s&&a.push(n[u]);var f=a.length;for(e=s;--e>=o;)if(!(c(n[u],n[o],n[e])>=0&&e>o)){for(;a.length>f&&!(c(a[a.length-2],a[a.length-1],n[e])>0);)a.length-=1;0!=e&&a.push(n[e])}}return a},n.clockwiseRadialSweep=function(t,e,n){e.slice(0).sort((function(e,n){return Math.atan2(e.y-t.y,e.x-t.x)-Math.atan2(n.y-t.y,n.x-t.x)})).forEach(n)},n.tangent_PolyPolyC=d,n.LRtangent_PolyPolyC=function(t,e){var n=y(e,t);return{t1:n.t2,t2:n.t1}},n.RLtangent_PolyPolyC=y,n.LLtangent_PolyPolyC=function(t,e){return d(t,e,p,p,f,f)},n.RRtangent_PolyPolyC=function(t,e){return d(t,e,h,h,l,l)};var v=function(t,e){this.t1=t,this.t2=e};n.BiTangent=v;var g=function(){};n.BiTangents=g;var x=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i(e,t),e}(a);n.TVGPoint=x;var m=function(t,e,n,r){this.id=t,this.polyid=e,this.polyvertid=n,this.p=r,r.vv=this};n.VisibilityVertex=m;var b=function(){function t(t,e){this.source=t,this.target=e}return t.prototype.length=function(){var t=this.source.p.x-this.target.p.x,e=this.source.p.y-this.target.p.y;return Math.sqrt(t*t+e*e)},t}();n.VisibilityEdge=b;var _=function(){function t(t,e){if(this.P=t,this.V=[],this.E=[],e)this.V=e.V.slice(0),this.E=e.E.slice(0);else{for(var n=t.length,r=0;r0&&this.E.push(new b(i[o-1].vv,s))}i.length>1&&this.E.push(new b(i[0].vv,i[i.length-1].vv))}for(r=0;r0)return!0;return!1},t}();function w(t,e){for(var n=[],r=1,i=e.length;r=0&&y>=0&&x<0&&m>=0&&b>=0&&_<0?i.ll=new v(o,a):d<=0&&y<=0&&x>0&&m<=0&&b<=0&&_>0?i.rr=new v(o,a):d<=0&&y>0&&x<=0&&m>=0&&b<0&&_>=0?i.rl=new v(o,a):d>=0&&y<0&&x>=0&&m<=0&&b>0&&_<=0&&(i.lr=new v(o,a))}return i}function S(t,e){return!t.every((function(t){return!function(t,e){for(var n=1,r=e.length;n0)return!0}return!1}},{"./rectangle":17}],9:[function(t,e,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0});var r=t("./rectangle"),i=t("./vpsc"),o=t("./shortestpaths"),a=function(t,e,n){this.id=t,this.rect=e,this.children=n,this.leaf=void 0===n||0===n.length};n.NodeWrapper=a;var s=function(t,e,n,r,i){void 0===r&&(r=null),void 0===i&&(i=null),this.id=t,this.x=e,this.y=n,this.node=r,this.line=i};n.Vert=s;var u=function(){function t(e,n){this.s=e,this.t=n;var r=t.findMatch(e,n),i=n.slice(0).reverse(),o=t.findMatch(e,i);r.length>=o.length?(this.length=r.length,this.si=r.si,this.ti=r.ti,this.reversed=!1):(this.length=o.length,this.si=o.si,this.ti=n.length-o.ti-o.length,this.reversed=!0)}return t.findMatch=function(t,e){for(var n=t.length,r=e.length,i={length:0,si:-1,ti:-1},o=new Array(n),a=0;ai.length&&(i.length=u,i.si=a-u+1,i.ti=s-u+1)}else o[a][s]=0}return i},t.prototype.getSequence=function(){return this.length>=0?this.s.slice(this.si,this.si+this.length):[]},t}();n.LongestCommonSubsequence=u;var c=function(){function t(t,e,n){var i=this;void 0===n&&(n=12),this.originalnodes=t,this.groupPadding=n,this.leaves=null,this.nodes=t.map((function(t,n){return new a(n,e.getBounds(t),e.getChildren(t))})),this.leaves=this.nodes.filter((function(t){return t.leaf})),this.groups=this.nodes.filter((function(t){return!t.leaf})),this.cols=this.getGridLines("x"),this.rows=this.getGridLines("y"),this.groups.forEach((function(t){return t.children.forEach((function(e){return i.nodes[e].parent=t}))})),this.root={children:[]},this.nodes.forEach((function(t){void 0===t.parent&&(t.parent=i.root,i.root.children.push(t.id)),t.ports=[]})),this.backToFront=this.nodes.slice(0),this.backToFront.sort((function(t,e){return i.getDepth(t)-i.getDepth(e)})),this.backToFront.slice(0).reverse().filter((function(t){return!t.leaf})).forEach((function(t){var e=r.Rectangle.empty();t.children.forEach((function(t){return e=e.union(i.nodes[t].rect)})),t.rect=e.inflate(i.groupPadding)}));var o=this.midPoints(this.cols.map((function(t){return t.pos}))),u=this.midPoints(this.rows.map((function(t){return t.pos}))),c=o[0],l=o[o.length-1],f=u[0],h=u[u.length-1],p=this.rows.map((function(t){return{x1:c,x2:l,y1:t.pos,y2:t.pos}})).concat(u.map((function(t){return{x1:c,x2:l,y1:t,y2:t}}))),d=this.cols.map((function(t){return{x1:t.pos,x2:t.pos,y1:f,y2:h}})).concat(o.map((function(t){return{x1:t,x2:t,y1:f,y2:h}}))),y=p.concat(d);y.forEach((function(t){return t.verts=[]})),this.verts=[],this.edges=[],p.forEach((function(t){return d.forEach((function(e){var n=new s(i.verts.length,e.x1,t.y1);t.verts.push(n),e.verts.push(n),i.verts.push(n);for(var r=i.backToFront.length;r-- >0;){var o=i.backToFront[r],a=o.rect,u=Math.abs(n.x-a.cx()),c=Math.abs(n.y-a.cy());if(u0;){var r=n.filter((function(e){return e.rect["overlap"+t.toUpperCase()](n[0].rect)})),i={nodes:r,pos:this.avg(r.map((function(e){return e.rect["c"+t]()})))};e.push(i),i.nodes.forEach((function(t){return n.splice(n.indexOf(t),1)}))}return e.sort((function(t,e){return t.pos-e.pos})),e},t.prototype.getDepth=function(t){for(var e=0;t.parent!==this.root;)e++,t=t.parent;return e},t.prototype.midPoints=function(t){for(var e=t[1]-t[0],n=[t[0]-e/2],r=1;r.1)&&(c={pos:f[0][e],segments:[]},u.push(c)),c.segments.push(f)}return u},t.nudgeSegs=function(t,e,n,r,o,a){var s=r.length;if(!(s<=1)){for(var u=r.map((function(e){return new i.Variable(e[0][t])})),c=[],l=0;l=0&&c.push(new i.Constraint(u[v],u[g],a))}new i.Solver(u,c).solve(),u.forEach((function(e,i){var o=r[i],a=e.position();o[0][t]=o[1][t]=a;var s=n[o.edgeid];o.i>0&&(s[o.i-1][1][t]=a),o.iMath.PI||i<-Math.PI)&&(i=r-n),i},t.isLeft=function(t,e,n){return(e.x-t.x)*(n.y-t.y)-(e.y-t.y)*(n.x-t.x)<=0},t.getOrder=function(t){for(var e={},n=0;n=c.length||f.ti+f.length>=l.length)?n.push({l:r,r:i}):(f.si+f.length>=c.length||f.ti+f.length>=l.length?(o=c[f.si+1],s=c[f.si-1],a=l[f.ti-1]):(o=c[f.si+f.length-2],a=c[f.si+f.length],s=l[f.ti+f.length]),t.isLeft(o,a,s)?n.push({l:i,r}):n.push({l:r,r:i})))}return t.getOrder(n)},t.makeSegments=function(t){function e(t){return{x:t.x,y:t.y}}for(var n=function(t,e,n){return Math.abs((e.x-t.x)*(n.y-t.y)-(e.y-t.y)*(n.x-t.x))<.001},r=[],i=e(t[0]),o=1;o1&&l>1?1e3:0})),f=l.reverse().map((function(t){return n.verts[t]}));return f.push(this.nodes[i.id].ports[0]),f.filter((function(t,e){return!(e0&&t.node===i&&f[e-1].node===i)}))},t.getRoutePath=function(e,n,r,i){var o,a,s,u={routepath:"M "+e[0][0].x+" "+e[0][0].y+" ",arrowpath:""};if(e.length>1)for(var c=0;c0?l-=h/Math.abs(h)*n:f-=p/Math.abs(p)*n,u.routepath+="L "+l+" "+f+" ";var d=e[c+1],y=d[0].x,v=d[0].y;h=d[1].x-y,p=d[1].y-v;var g,x,m=t.angleBetween2Lines(o,d)<0?1:0;Math.abs(h)>0?(g=y+h/Math.abs(h)*n,x=v):(g=y,x=v+p/Math.abs(p)*n);var b=Math.abs(g-l),_=Math.abs(x-f);u.routepath+="A "+b+" "+_+" 0 0 "+m+" "+g+" "+x+" "}else{var w=[l,f];Math.abs(h)>0?(a=[l-=h/Math.abs(h)*i,f+r],s=[l,f-r]):(a=[l+r,f-=p/Math.abs(p)*i],s=[l-r,f]),u.routepath+="L "+l+" "+f+" ",i>0&&(u.arrowpath="M "+w[0]+" "+w[1]+" L "+a[0]+" "+a[1]+" L "+s[0]+" "+s[1])}}else l=(o=e[0])[1].x,f=o[1].y,h=l-o[0].x,p=f-o[0].y,w=[l,f],Math.abs(h)>0?(a=[l-=h/Math.abs(h)*i,f+r],s=[l,f-r]):(a=[l+r,f-=p/Math.abs(p)*i],s=[l-r,f]),u.routepath+="L "+l+" "+f+" ",i>0&&(u.arrowpath="M "+w[0]+" "+w[1]+" L "+a[0]+" "+a[1]+" L "+s[0]+" "+s[1]);return u},t}();n.GridRouter=c},{"./rectangle":17,"./shortestpaths":18,"./vpsc":19}],10:[function(t,e,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0});var r=10,i=(1+Math.sqrt(5))/2,o=1e-4;n.applyPacking=function(t,e,n,a,s,u){void 0===s&&(s=1),void 0===u&&(u=!0);var c=0,l=0,f=e,h=n,p=(s=void 0!==s?s:1,a=void 0!==a?a:0,0),d=0,y=0,v=0,g=[];function x(t,e){g=[],p=0,d=0,v=l;for(var n=0;n=t.height&&g[i].x+g[i].width+t.width+r-e<=o){n=g[i];break}g.push(t),void 0!==n?(t.x=n.x+n.width+r,t.y=n.bottom,t.space_left=t.height,t.bottom=t.y,n.space_left-=t.height+r,n.bottom+=t.height+r):(t.y=v,v+=t.height+r,t.x=c,t.bottom=t.y,t.space_left=t.height),t.y+t.height-d>-1e-4&&(d=t.y+t.height-l),t.x+t.width-p>-1e-4&&(p=t.x+t.width-c)}0!=t.length&&(function(t){t.forEach((function(t){var e,n,r,i,o;e=t,n=Number.MAX_VALUE,r=Number.MAX_VALUE,i=0,o=0,e.array.forEach((function(t){var e=void 0!==t.width?t.width:a,s=void 0!==t.height?t.height:a;e/=2,s/=2,i=Math.max(t.x+e,i),n=Math.min(t.x-e,n),o=Math.max(t.y+s,o),r=Math.min(t.y-s,r)})),e.width=i-n,e.height=o-r}))}(t),function(t){var e=Number.POSITIVE_INFINITY,n=0;t.sort((function(t,e){return e.height-t.height}));for(var a=d=y=t.reduce((function(t,e){return t.widthy||p>o;){if(1!=f){var d=s-(s-a)/i;c=x(t,d)}if(0!=f){var v=a+(s-a)/i;l=x(t,v)}if(h=Math.abs(d-v),p=Math.abs(c-l),cl?(a=d,d=v,c=l,f=1):(s=v,v=d,l=c,f=0),u++>100)break}x(t,n)}(t),u&&function(t){t.forEach((function(t){var e={x:0,y:0};t.array.forEach((function(t){e.x+=t.x,e.y+=t.y})),e.x/=t.array.length,e.y/=t.array.length;var n=e.x-t.width/2,r=e.y-t.height/2,i=t.x-n+f/2-p/2,o=t.y-r+h/2-d/2;t.array.forEach((function(t){t.x+=i,t.y+=o}))}))}(t))},n.separateGraphs=function(t,e){for(var n={},r={},i=[],o=0,a=0;a0){var e=0;this._links.forEach((function(t){e=Math.max(e,t.source,t.target)})),this._nodes=new Array(++e);for(var n=0;n0?t:0:t>0&&(this._running||(this._running=!0,this.trigger({type:r.start,alpha:this._alpha=t}),this.kick())),this):this._alpha},t.prototype.getLinkLength=function(t){return"function"==typeof this._linkDistance?+this._linkDistance(t):this._linkDistance},t.setLinkLength=function(t,e){t.length=e},t.prototype.getLinkType=function(t){return"function"==typeof this._linkType?this._linkType(t):0},t.prototype.symmetricDiffLinkLengths=function(t,e){var n=this;return void 0===e&&(e=1),this.linkDistance((function(e){return t*e.length})),this._linkLengthCalculator=function(){return o.symmetricDiffLinkLengths(n._links,n.linkAccessor,e)},this},t.prototype.jaccardLinkLengths=function(t,e){var n=this;return void 0===e&&(e=1),this.linkDistance((function(e){return t*e.length})),this._linkLengthCalculator=function(){return o.jaccardLinkLengths(n._links,n.linkAccessor,e)},this},t.prototype.start=function(e,n,r,i,c,l){var f=this;void 0===e&&(e=0),void 0===n&&(n=0),void 0===r&&(r=0),void 0===i&&(i=0),void 0===c&&(c=!0),void 0===l&&(l=!0);var h,p=this.nodes().length,d=p+2*this._groups.length,y=(this._links.length,this._canvasSize[0]),v=this._canvasSize[1],g=new Array(d),x=new Array(d),m=null,b=this._avoidOverlaps;this._nodes.forEach((function(t,e){t.index=e,void 0===t.x&&(t.x=y/2,t.y=v/2),g[e]=t.x,x[e]=t.y})),this._linkLengthCalculator&&this._linkLengthCalculator(),this._distanceMatrix?h=this._distanceMatrix:(h=new u.Calculator(d,this._links,t.getSourceIndex,t.getTargetIndex,(function(t){return f.getLinkLength(t)})).DistanceMatrix(),m=a.Descent.createSquareMatrix(d,(function(){return 2})),this._links.forEach((function(t){"number"==typeof t.source&&(t.source=f._nodes[t.source]),"number"==typeof t.target&&(t.target=f._nodes[t.target])})),this._links.forEach((function(e){var n=t.getSourceIndex(e),r=t.getTargetIndex(e);m[n][r]=m[r][n]=e.weight||1})));var _=a.Descent.createSquareMatrix(d,(function(t,e){return h[t][e]}));if(this._rootGroup&&void 0!==this._rootGroup.groups){var w=p;this._groups.forEach((function(t){!function(t,e,n){m[t][e]=m[e][t]=n,_[t][e]=_[e][t]=.1}(w,w+1,f._groupCompactness),void 0===t.bounds?(g[w]=y/2,x[w++]=v/2,g[w]=y/2,x[w++]=v/2):(g[w]=t.bounds.x,x[w++]=t.bounds.y,g[w]=t.bounds.X,x[w++]=t.bounds.Y)}))}else this._rootGroup={leaves:this._nodes,groups:[]};var k=this._constraints||[];for(this._directedLinkConstraints&&(this.linkAccessor.getMinSeparation=this._directedLinkConstraints.getMinSeparation,k=k.concat(o.generateDirectedEdgeConstraints(p,this._links,this._directedLinkConstraints.axis,this.linkAccessor))),this.avoidOverlaps(!1),this._descent=new a.Descent([g,x],_),this._descent.locks.clear(),w=0;w0&&(this._descent.project=new s.Projection(this._nodes,this._groups,this._rootGroup,k).projectFunctions()),this._descent.run(n),this.separateOverlappingComponents(y,v,l),this.avoidOverlaps(b),b&&(this._nodes.forEach((function(t,e){t.x=g[e],t.y=x[e]})),this._descent.project=new s.Projection(this._nodes,this._groups,this._rootGroup,k,!0).projectFunctions(),this._nodes.forEach((function(t,e){g[e]=t.x,x[e]=t.y}))),this._descent.G=m,this._descent.run(r),i){this._descent.snapStrength=1e3,this._descent.snapGridSize=this._nodes[0].width,this._descent.numGridSnapNodes=p,this._descent.scaleSnapByMaxH=p!=d;var M=a.Descent.createSquareMatrix(d,(function(t,e){return t>=p||e>=p?m[t][e]:0}));this._descent.G=M,this._descent.run(i)}return this.updateNodePositions(),this.separateOverlappingComponents(y,v,l),c?this.resume():this},t.prototype.initialLayout=function(e,n,r){if(this._groups.length>0&&e>0){var i=this._nodes.length,o=this._links.map((function(t){return{source:t.source.index,target:t.target.index}})),a=this._nodes.map((function(t){return{index:t.index}}));this._groups.forEach((function(t,e){a.push({index:t.index=i+e})})),this._groups.forEach((function(t,e){void 0!==t.leaves&&t.leaves.forEach((function(e){return o.push({source:t.index,target:e.index})})),void 0!==t.groups&&t.groups.forEach((function(e){return o.push({source:t.index,target:e.index})}))})),(new t).size(this.size()).nodes(a).links(o).avoidOverlaps(!1).linkDistance(this.linkDistance()).symmetricDiffLinkLengths(5).convergenceThreshold(1e-4).start(e,0,0,0,!1),this._nodes.forEach((function(t){n[t.index]=a[t.index].x,r[t.index]=a[t.index].y}))}else this._descent.run(e)},t.prototype.separateOverlappingComponents=function(t,e,n){var r=this;if(void 0===n&&(n=!0),!this._distanceMatrix&&this._handleDisconnected){var i=this._descent.x[0],o=this._descent.x[1];this._nodes.forEach((function(t,e){t.x=i[e],t.y=o[e]}));var a=l.separateGraphs(this._nodes,this._links);l.applyPacking(a,t,e,this._defaultNodeSize,e/t,n),this._nodes.forEach((function(t,e){r._descent.x[0][e]=t.x,r._descent.x[1][e]=t.y,t.bounds&&(t.bounds.setXCentre(t.x),t.bounds.setYCentre(t.y))}))}},t.prototype.resume=function(){return this.alpha(.1)},t.prototype.stop=function(){return this.alpha(0)},t.prototype.prepareEdgeRouting=function(t){void 0===t&&(t=0),this._visibilityGraph=new c.TangentVisibilityGraph(this._nodes.map((function(e){return e.bounds.inflate(-t).vertices()})))},t.prototype.routeEdge=function(t,e,n){void 0===e&&(e=5);var r=[],i=new c.TangentVisibilityGraph(this._visibilityGraph.P,{V:this._visibilityGraph.V,E:this._visibilityGraph.E}),o={x:t.source.x,y:t.source.y},a={x:t.target.x,y:t.target.y},l=i.addPoint(o,t.source.index),f=i.addPoint(a,t.target.index);i.addEdgeIfVisible(o,a,t.source.index,t.target.index),void 0!==n&&n(i);var h=new u.Calculator(i.V.length,i.E,(function(t){return t.source.id}),(function(t){return t.target.id}),(function(t){return t.length()})).PathFromNodeToNode(l.id,f.id);if(1===h.length||h.length===i.V.length){var p=s.makeEdgeBetween(t.source.innerBounds,t.target.innerBounds,e);r=[p.sourceIntersection,p.arrowStart]}else{for(var d=h.length-2,y=i.V[h[d]].p,v=i.V[h[0]].p,g=(r=[t.source.innerBounds.rayIntersection(y.x,y.y)],d);g>=0;--g)r.push(i.V[h[g]].p);r.push(s.makeEdgeTo(v,t.target.innerBounds,e))}return r},t.getSourceIndex=function(t){return"number"==typeof t.source?t.source:t.source.index},t.getTargetIndex=function(t){return"number"==typeof t.target?t.target:t.target.index},t.linkId=function(e){return t.getSourceIndex(e)+"-"+t.getTargetIndex(e)},t.dragStart=function(e){f(e)?t.storeOffset(e,t.dragOrigin(e)):(t.stopNode(e),e.fixed|=2)},t.stopNode=function(t){t.px=t.x,t.py=t.y},t.storeOffset=function(e,n){void 0!==e.leaves&&e.leaves.forEach((function(e){e.fixed|=2,t.stopNode(e),e._dragGroupOffsetX=e.x-n.x,e._dragGroupOffsetY=e.y-n.y})),void 0!==e.groups&&e.groups.forEach((function(e){return t.storeOffset(e,n)}))},t.dragOrigin=function(t){return f(t)?{x:t.bounds.cx(),y:t.bounds.cy()}:t},t.drag=function(e,n){f(e)?(void 0!==e.leaves&&e.leaves.forEach((function(t){e.bounds.setXCentre(n.x),e.bounds.setYCentre(n.y),t.px=t._dragGroupOffsetX+n.x,t.py=t._dragGroupOffsetY+n.y})),void 0!==e.groups&&e.groups.forEach((function(e){return t.drag(e,n)}))):(e.px=n.x,e.py=n.y)},t.dragEnd=function(e){f(e)?(void 0!==e.leaves&&e.leaves.forEach((function(e){t.dragEnd(e),delete e._dragGroupOffsetX,delete e._dragGroupOffsetY})),void 0!==e.groups&&e.groups.forEach(t.dragEnd)):e.fixed&=-7},t.mouseOver=function(t){t.fixed|=4,t.px=t.x,t.py=t.y},t.mouseOut=function(t){t.fixed&=-5},t}();n.Layout=h},{"./descent":7,"./geom":8,"./handledisconnected":10,"./linklengths":13,"./powergraph":14,"./rectangle":17,"./shortestpaths":18}],12:[function(t,e,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0});var r=t("./shortestpaths"),i=t("./descent"),o=t("./rectangle"),a=t("./linklengths"),s=function(){function t(t,e){this.source=t,this.target=e}return t.prototype.actualLength=function(t){var e=this;return Math.sqrt(t.reduce((function(t,n){var r=n[e.target]-n[e.source];return t+r*r}),0))},t}();n.Link3D=s;n.Node3D=function(t,e,n){void 0===t&&(t=0),void 0===e&&(e=0),void 0===n&&(n=0),this.x=t,this.y=e,this.z=n};var u=function(){function t(e,n,r){var i=this;void 0===r&&(r=1),this.nodes=e,this.links=n,this.idealLinkLength=r,this.constraints=null,this.useJaccardLinkLengths=!0,this.result=new Array(t.k);for(var o=0;o=this.R))return this.merge(e.a,e.b,t),!0}},t.prototype.nEdges=function(t,e){var n=t.incoming.intersection(e.incoming),r=t.outgoing.intersection(e.outgoing);return this.R-n.count()-r.count()},t.prototype.getGroupHierarchy=function(t){var e=this,n=[];return o(this.roots[0],{},n),this.allEdges().forEach((function(i){var o=e.modules[i.source],a=e.modules[i.target];t.push(new r(void 0===o.gid?i.source:n[o.gid],void 0===a.gid?i.target:n[a.gid],i.type))})),n},t.prototype.allEdges=function(){var e=[];return t.getEdges(this.roots[0],e),e},t.getEdges=function(e,n){e.forAll((function(e){e.getEdges(n),t.getEdges(e.children,n)}))},t}();function o(t,e,n){t.forAll((function(t){if(t.isLeaf())e.leaves||(e.leaves=[]),e.leaves.push(t.id);else{var r=e;if(t.gid=n.length,!t.isIsland()||t.isPredefined()){if(r={id:t.gid},t.isPredefined())for(var i in t.definition)r[i]=t.definition[i];e.groups||(e.groups=[]),e.groups.push(t.gid),n.push(r)}o(t.children,r,n)}}))}n.Configuration=i;var a=function(){function t(t,e,n,r,i){void 0===e&&(e=new u),void 0===n&&(n=new u),void 0===r&&(r=new s),this.id=t,this.outgoing=e,this.incoming=n,this.children=r,this.definition=i}return t.prototype.getEdges=function(t){var e=this;this.outgoing.forAll((function(n,i){n.forAll((function(n){t.push(new r(e.id,n.id,i))}))}))},t.prototype.isLeaf=function(){return 0===this.children.count()},t.prototype.isIsland=function(){return 0===this.outgoing.count()&&0===this.incoming.count()},t.prototype.isPredefined=function(){return void 0!==this.definition},t}();n.Module=a;var s=function(){function t(){this.table={}}return t.prototype.count=function(){return Object.keys(this.table).length},t.prototype.intersection=function(e){var n=new t;return n.table=function(t,e){var n={};for(var r in t)r in e&&(n[r]=t[r]);return n}(this.table,e.table),n},t.prototype.intersectionCount=function(t){return this.intersection(t).count()},t.prototype.contains=function(t){return t in this.table},t.prototype.add=function(t){this.table[t.id]=t},t.prototype.remove=function(t){delete this.table[t.id]},t.prototype.forAll=function(t){for(var e in this.table)t(this.table[e])},t.prototype.modules=function(){var t=[];return this.forAll((function(e){e.isPredefined()||t.push(e)})),t},t}();n.ModuleSet=s;var u=function(){function t(){this.sets={},this.n=0}return t.prototype.count=function(){return this.n},t.prototype.contains=function(t){var e=!1;return this.forAllModules((function(n){e||n.id!=t||(e=!0)})),e},t.prototype.add=function(t,e){(t in this.sets?this.sets[t]:this.sets[t]=new s).add(e),++this.n},t.prototype.remove=function(t,e){var n=this.sets[t];n.remove(e),0===n.count()&&delete this.sets[t],--this.n},t.prototype.forAll=function(t){for(var e in this.sets)t(this.sets[e],Number(e))},t.prototype.forAllModules=function(t){this.forAll((function(e,n){return e.forAll(t)}))},t.prototype.intersection=function(e){var n=new t;return this.forAll((function(t,r){if(r in e.sets){var i=t.intersection(e.sets[r]),o=i.count();o>0&&(n.sets[r]=i,n.n+=o)}})),n},t}();n.LinkSets=u,n.getGroups=function(t,e,n,r){for(var o=t.length,a=new i(o,e,n,r);a.greedyMerge(););var s=[],u=a.getGroupHierarchy(s);return s.forEach((function(e){var n=function(n){var r=e[n];"number"==typeof r&&(e[n]=t[r])};n("source"),n("target")})),{groups:u,powerEdges:s}}},{}],15:[function(t,e,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0});var r=function(){function t(t){this.elem=t,this.subheaps=[]}return t.prototype.toString=function(t){for(var e="",n=!1,r=0;r0)}return null}}return t.prototype.clear=function(){this._root=null,this.size=0},t.prototype.find=function(t){for(var e=this._root;null!==e;){var n=this._comparator(t,e.data);if(0===n)return e.data;e=e.get_child(n>0)}return null},t.prototype.lowerBound=function(t){return this._bound(t,this._comparator)},t.prototype.upperBound=function(t){var e=this._comparator;return this._bound(t,(function(t,n){return e(n,t)}))},t.prototype.min=function(){var t=this._root;if(null===t)return null;for(;null!==t.left;)t=t.left;return t.data},t.prototype.max=function(){var t=this._root;if(null===t)return null;for(;null!==t.right;)t=t.right;return t.data},t.prototype.iterator=function(){return new a(this)},t.prototype.each=function(t){for(var e,n=this.iterator();null!==(e=n.next());)t(e)},t.prototype.reach=function(t){for(var e,n=this.iterator();null!==(e=n.prev());)t(e)},t.prototype._bound=function(t,e){for(var n=this._root,r=this.iterator();null!==n;){var i=this._comparator(t,n.data);if(0===i)return r._cursor=n,r;r._ancestors.push(n),n=n.get_child(i>0)}for(var o=r._ancestors.length-1;o>=0;--o)if(e(t,(n=r._ancestors[o]).data)>0)return r._cursor=n,r._ancestors.length=o,r;return r._ancestors.length=0,r},t}();n.TreeBase=o;var a=function(){function t(t){this._tree=t,this._ancestors=[],this._cursor=null}return t.prototype.data=function(){return null!==this._cursor?this._cursor.data:null},t.prototype.next=function(){if(null===this._cursor){var t=this._tree._root;null!==t&&this._minNode(t)}else{var e;if(null===this._cursor.right)do{if(e=this._cursor,!this._ancestors.length){this._cursor=null;break}this._cursor=this._ancestors.pop()}while(this._cursor.right===e);else this._ancestors.push(this._cursor),this._minNode(this._cursor.right)}return null!==this._cursor?this._cursor.data:null},t.prototype.prev=function(){if(null===this._cursor){var t=this._tree._root;null!==t&&this._maxNode(t)}else{var e;if(null===this._cursor.left)do{if(e=this._cursor,!this._ancestors.length){this._cursor=null;break}this._cursor=this._ancestors.pop()}while(this._cursor.left===e);else this._ancestors.push(this._cursor),this._maxNode(this._cursor.left)}return null!==this._cursor?this._cursor.data:null},t.prototype._minNode=function(t){for(;null!==t.left;)this._ancestors.push(t),t=t.left;this._cursor=t},t.prototype._maxNode=function(t){for(;null!==t.right;)this._ancestors.push(t),t=t.right;this._cursor=t},t}();n.Iterator=a;var s=function(){function t(t){this.data=t,this.left=null,this.right=null,this.red=!0}return t.prototype.get_child=function(t){return t?this.right:this.left},t.prototype.set_child=function(t,e){t?this.right=e:this.left=e},t}(),u=function(t){function e(e){var n=t.call(this)||this;return n._root=null,n._comparator=e,n.size=0,n}return i(e,t),e.prototype.insert=function(t){var n=!1;if(null===this._root)this._root=new s(t),n=!0,this.size++;else{var r=new s(void 0),i=!1,o=!1,a=null,u=r,c=null,l=this._root;for(u.right=this._root;;){if(null===l?(l=new s(t),c.set_child(i,l),n=!0,this.size++):e.is_red(l.left)&&e.is_red(l.right)&&(l.red=!0,l.left.red=!1,l.right.red=!1),e.is_red(l)&&e.is_red(c)){var f=u.right===a;l===c.get_child(o)?u.set_child(f,e.single_rotate(a,!o)):u.set_child(f,e.double_rotate(a,!o))}var h=this._comparator(l.data,t);if(0===h)break;o=i,i=h<0,null!==a&&(u=a),a=c,c=l,l=l.get_child(i)}this._root=r.right}return this._root.red=!1,n},e.prototype.remove=function(t){if(null===this._root)return!1;var n=new s(void 0),r=n;r.right=this._root;for(var i=null,o=null,a=null,u=!0;null!==r.get_child(u);){var c=u;o=i,i=r,r=r.get_child(u);var l=this._comparator(t,r.data);if(u=l>0,0===l&&(a=r),!e.is_red(r)&&!e.is_red(r.get_child(u)))if(e.is_red(r.get_child(!u))){var f=e.single_rotate(r,u);i.set_child(c,f),i=f}else if(!e.is_red(r.get_child(!u))){var h=i.get_child(!c);if(null!==h)if(e.is_red(h.get_child(!c))||e.is_red(h.get_child(c))){var p=o.right===i;e.is_red(h.get_child(c))?o.set_child(p,e.double_rotate(i,c)):e.is_red(h.get_child(!c))&&o.set_child(p,e.single_rotate(i,c));var d=o.get_child(p);d.red=!0,r.red=!0,d.left.red=!1,d.right.red=!1}else i.red=!1,h.red=!0,r.red=!0}}return null!==a&&(a.data=r.data,i.set_child(i.right===r,r.get_child(null===r.left)),this.size--),this._root=n.right,null!==this._root&&(this._root.red=!1),null!==a},e.is_red=function(t){return null!==t&&t.red},e.single_rotate=function(t,e){var n=t.get_child(!e);return t.set_child(!e,n.get_child(e)),n.set_child(e,t),t.red=!0,n.red=!1,n},e.double_rotate=function(t,n){return t.set_child(!n,e.single_rotate(t.get_child(!n),!n)),e.single_rotate(t,n)},e}(o);n.RBTree=u},{}],17:[function(t,e,n){"use strict";var r,i=this&&this.__extends||(r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])},r(t,e)},function(t,e){function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});Object.defineProperty(n,"__esModule",{value:!0});var o=t("./vpsc"),a=t("./rbtree");function s(t){return t.bounds=void 0!==t.leaves?t.leaves.reduce((function(t,e){return e.bounds.union(t)}),u.empty()):u.empty(),void 0!==t.groups&&(t.bounds=t.groups.reduce((function(t,e){return s(e).union(t)}),t.bounds)),t.bounds=t.bounds.inflate(t.padding),t.bounds}n.computeGroupBounds=s;var u=function(){function t(t,e,n,r){this.x=t,this.X=e,this.y=n,this.Y=r}return t.empty=function(){return new t(Number.POSITIVE_INFINITY,Number.NEGATIVE_INFINITY,Number.POSITIVE_INFINITY,Number.NEGATIVE_INFINITY)},t.prototype.cx=function(){return(this.x+this.X)/2},t.prototype.cy=function(){return(this.y+this.Y)/2},t.prototype.overlapX=function(t){var e=this.cx(),n=t.cx();return e<=n&&t.x0?n[0]:null},t.prototype.vertices=function(){return[{x:this.x,y:this.y},{x:this.X,y:this.y},{x:this.X,y:this.Y},{x:this.x,y:this.Y}]},t.lineIntersection=function(t,e,n,r,i,o,a,s){var u=n-t,c=a-i,l=r-e,f=s-o,h=f*u-c*l;if(0==h)return null;var p=t-i,d=e-o,y=(c*d-f*p)/h,v=(u*d-l*p)/h;return y>=0&&y<=1&&v>=0&&v<=1?{x:t+y*u,y:e+y*l}:null},t.prototype.inflate=function(e){return new t(this.x-e,this.X+e,this.y-e,this.Y+e)},t}();n.Rectangle=u,n.makeEdgeBetween=function(t,e,n){var r=t.rayIntersection(e.cx(),e.cy())||{x:t.cx(),y:t.cy()},i=e.rayIntersection(t.cx(),t.cy())||{x:e.cx(),y:e.cy()},o=i.x-r.x,a=i.y-r.y,s=Math.sqrt(o*o+a*a),u=s-n;return{sourceIntersection:r,targetIntersection:i,arrowStart:{x:r.x+u*o/s,y:r.y+u*a/s}}},n.makeEdgeTo=function(t,e,n){var r=e.rayIntersection(t.x,t.y);r||(r={x:e.cx(),y:e.cy()});var i=r.x-t.x,o=r.y-t.y,a=Math.sqrt(i*i+o*o);return{x:r.x-n*i/a,y:r.y-n*o/a}};var c=function(t,e,n){this.v=t,this.r=e,this.pos=n,this.prev=h(),this.next=h()},l=function(t,e,n){this.isOpen=t,this.v=e,this.pos=n};function f(t,e){return t.pos>e.pos?1:t.pos0&&(t[n].insert(i),i[r].insert(t))};n("next","prev"),n("prev","next")}};function y(t,e,n,r){void 0===r&&(r=!1);var i=t.padding,o=void 0!==t.groups?t.groups.length:0,a=void 0!==t.leaves?t.leaves.length:0,s=o?t.groups.reduce((function(t,r){return t.concat(y(r,e,n,!0))}),[]):[],u=(r?2:0)+a+o,c=new Array(u),l=new Array(u),f=0,h=function(t,e){l[f]=t,c[f++]=e};if(r){var p=t.bounds,d=e.getCentre(p),g=e.getSize(p)/2,x=e.getOpen(p),m=e.getClose(p),b=d-g+i/2,_=d+g-i/2;t.minVar.desiredPosition=b,h(e.makeRect(x,m,b,i),t.minVar),t.maxVar.desiredPosition=_,h(e.makeRect(x,m,_,i),t.maxVar)}a&&t.leaves.forEach((function(t){return h(t.bounds,t.variable)})),o&&t.groups.forEach((function(t){var n=t.bounds;h(e.makeRect(e.getOpen(n),e.getClose(n),e.getCentre(n),e.getSize(n)),t.minVar)}));var w=v(l,c,e,n);return o&&(c.forEach((function(t){t.cOut=[],t.cIn=[]})),w.forEach((function(t){t.left.cOut.push(t),t.right.cIn.push(t)})),t.groups.forEach((function(t){var n=(t.padding-e.getSize(t.bounds))/2;t.minVar.cIn.forEach((function(t){return t.gap+=n})),t.minVar.cOut.forEach((function(e){e.left=t.maxVar,e.gap+=n}))}))),s.concat(w)}function v(t,e,n,r){var i,a=t.length,s=2*a;console.assert(e.length>=a);var u=new Array(s);for(i=0;it[n]&&(t[n]=e)}o=t}))}},t.prototype.createAlignment=function(t){var e=this,n=this.nodes[t.offsets[0].node].variable;this.makeFeasible(t);var r="x"===t.axis?this.xConstraints:this.yConstraints;t.offsets.slice(1).forEach((function(t){var i=e.nodes[t.node].variable;r.push(new o.Constraint(n,i,t.offset,!0))}))},t.prototype.createConstraints=function(t){var e=this,n=function(t){return void 0===t.type||"separation"===t.type};this.xConstraints=t.filter((function(t){return"x"===t.axis&&n(t)})).map((function(t){return e.createSeparation(t)})),this.yConstraints=t.filter((function(t){return"y"===t.axis&&n(t)})).map((function(t){return e.createSeparation(t)})),t.filter((function(t){return"alignment"===t.type})).forEach((function(t){return e.createAlignment(t)}))},t.prototype.setupVariablesAndBounds=function(t,e,n,r){this.nodes.forEach((function(i,o){i.fixed?(i.variable.weight=i.fixedWeight?i.fixedWeight:1e3,n[o]=r(i)):i.variable.weight=1;var a=(i.width||0)/2,s=(i.height||0)/2,c=t[o],l=e[o];i.bounds=new u(c-a,c+a,l-s,l+s)}))},t.prototype.xProject=function(t,e,n){(this.rootGroup||this.avoidOverlaps||this.xConstraints)&&this.project(t,e,t,n,(function(t){return t.px}),this.xConstraints,m,(function(t){return t.bounds.setXCentre(n[t.variable.index]=t.variable.position())}),(function(t){var e=n[t.minVar.index]=t.minVar.position(),r=n[t.maxVar.index]=t.maxVar.position(),i=t.padding/2;t.bounds.x=e-i,t.bounds.X=r+i}))},t.prototype.yProject=function(t,e,n){(this.rootGroup||this.yConstraints)&&this.project(t,e,e,n,(function(t){return t.py}),this.yConstraints,b,(function(t){return t.bounds.setYCentre(n[t.variable.index]=t.variable.position())}),(function(t){var e=n[t.minVar.index]=t.minVar.position(),r=n[t.maxVar.index]=t.maxVar.position(),i=t.padding/2;t.bounds.y=e-i,t.bounds.Y=r+i}))},t.prototype.projectFunctions=function(){var t=this;return[function(e,n,r){return t.xProject(e,n,r)},function(e,n,r){return t.yProject(e,n,r)}]},t.prototype.project=function(t,e,n,r,i,o,a,u,c){this.setupVariablesAndBounds(t,e,r,i),this.rootGroup&&this.avoidOverlaps&&(s(this.rootGroup),o=o.concat(a(this.rootGroup))),this.solve(this.variables,o,n,r),this.nodes.forEach(u),this.rootGroup&&this.avoidOverlaps&&(this.groups.forEach(c),s(this.rootGroup))},t.prototype.solve=function(t,e,n,r){var i=new o.Solver(t,e);i.setStartingPositions(n),i.setDesiredPositions(r),i.solve()},t}();n.Projection=w},{"./rbtree":16,"./vpsc":19}],18:[function(t,e,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0});var r=t("./pqueue"),i=function(t,e){this.id=t,this.distance=e},o=function(t){this.id=t,this.neighbours=[]},a=function(t,e,n){this.node=t,this.prev=e,this.d=n},s=function(){function t(t,e,n,r,a){this.n=t,this.es=e,this.neighbours=new Array(this.n);for(var s=this.n;s--;)this.neighbours[s]=new o(s);for(s=this.es.length;s--;){var u=this.es[s],c=n(u),l=r(u),f=a(u);this.neighbours[c].neighbours.push(new i(l,f)),this.neighbours[l].neighbours.push(new i(c,f))}}return t.prototype.DistanceMatrix=function(){for(var t=new Array(this.n),e=0;ef&&(c.d=f,c.prev=s,n.reduceKey(c.q,c,(function(t,e){return t.q=e})))}}return o},t}();n.Calculator=s},{"./pqueue":15}],19:[function(t,e,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0});var r=function(){function t(t){this.scale=t,this.AB=0,this.AD=0,this.A2=0}return t.prototype.addVariable=function(t){var e=this.scale/t.scale,n=t.offset/t.scale,r=t.weight;this.AB+=r*e*n,this.AD+=r*e*t.desiredPosition,this.A2+=r*e*e},t.prototype.getPosn=function(){return(this.AD-this.AB)/this.A2},t}();n.PositionStats=r;var i=function(){function t(t,e,n,r){void 0===r&&(r=!1),this.left=t,this.right=e,this.gap=n,this.equality=r,this.active=!1,this.unsatisfiable=!1,this.left=t,this.right=e,this.gap=n,this.equality=r}return t.prototype.slack=function(){return this.unsatisfiable?Number.MAX_VALUE:this.right.scale*this.right.position()-this.gap-this.left.scale*this.left.position()},t}();n.Constraint=i;var o=function(){function t(t,e,n){void 0===e&&(e=1),void 0===n&&(n=1),this.desiredPosition=t,this.weight=e,this.scale=n,this.offset=0}return t.prototype.dfdv=function(){return 2*this.weight*(this.position()-this.desiredPosition)},t.prototype.position=function(){return(this.block.ps.scale*this.block.posn+this.offset)/this.scale},t.prototype.visitNeighbours=function(t,e){var n=function(n,r){return n.active&&t!==r&&e(n,r)};this.cOut.forEach((function(t){return n(t,t.right)})),this.cIn.forEach((function(t){return n(t,t.left)}))},t}();n.Variable=o;var a=function(){function t(t){this.vars=[],t.offset=0,this.ps=new r(t.scale),this.addVariable(t)}return t.prototype.addVariable=function(t){t.block=this,this.vars.push(t),this.ps.addVariable(t),this.posn=this.ps.getPosn()},t.prototype.updateWeightedPosition=function(){this.ps.AB=this.ps.AD=this.ps.A2=0;for(var t=0,e=this.vars.length;t=0?this.inactive.push(e):this.bs.merge(e)}}},t.prototype.solve=function(){this.satisfy();for(var t=Number.MAX_VALUE,e=this.bs.cost();Math.abs(t-e)>1e-4;)this.satisfy(),t=e,e=this.bs.cost();return e},t.LAGRANGIAN_TOLERANCE=-1e-4,t.ZERO_UPPERBOUND=-1e-10,t}();n.Solver=u,n.removeOverlapInOneDimension=function(t,e,n){for(var r=t.map((function(t){return new o(t.desiredCenter)})),a=[],s=t.length,c=0;c{"use strict";n.r(e),n.d(e,{default:()=>o});var r=n(314),i=n.n(r)()((function(t){return t[1]}));i.push([t.id,"/*you need this to stop horrible looking flickering of text as you drag*/\nsvg {\n -webkit-user-select: none;\n -moz-user-select: none;\n user-select: none;\n}\n\n.highlight {\n stroke: #ffff99;\n}\n\n.link {\n stroke-linecap: round;\n stroke: black;\n fill: none;\n}\n\n.certain-link {\n opacity: 0.6;\n stroke-opacity: 0.6;\n}\n\n.uncertain-link {\n opacity: 0.2;\n stroke-opacity: 0.6;\n}\n\n.link-line {\n stroke-width: 1;\n}\n\n.link-highlight {\n stroke-width: 10;\n stroke-opacity: 0;\n}\n\n.complex-outline {\n stroke: white;\n stroke-linejoin: round;\n stroke-width: 7;\n}\n\n.linked-complex {\n stroke: black;\n stroke-linejoin: round;\n stroke-width: 1;\n}\n\n.feature-link {\n fill: black;\n}\n\n.protein {\n cursor: crosshair;\n}\n\n/*todo - seperate out outline*/\n.label {\n font-size: 10pt;\n /*font-weight: bold;*/\n\n /*color: #fff;*/\n /*text-shadow: white 0px 0px 1px;*/\n -webkit-font-smoothing: antialiased;\n\n /*text-shadow: #fff 0px 0px 1px, #fff 0px 0px 1px, #fff 0px 0px 1px,*/\n /*#fff 0px 0px 1px, #fff 0px 0px 1px, #fff 0px 0px 1px;*/\n\n text-shadow: -1px -1px 0 white,\n 1px -1px 0 white,\n -1px 1px 0 white,\n 1px 1px 0 white;\n /*-2px -1px 0 white,*/\n /* 2px -1px 0 white,*/\n /* -2px 1px 0 white,*/\n /* 2px 1px 0 white;*/\n fill: black;\n text-anchor: end;\n}\n\n.scale-label {\n text-anchor: middle;\n pointer-events: none;\n}\n\n.tooltip {\n text-anchor: start;\n}\n\n.outline {\n stroke: black;\n stroke-width: 1;\n stroke-opacity: 1;\n fill: white;\n fill-opacity: 1;\n}\n\n.participant-highlight {\n stroke-width: 5;\n fill: none;\n}\n\n/*for protein bar scale*/\n.tick {\n stroke: black;\n pointer-events: none;\n}\n\n.sequence {\n font-family: 'Courier New', monospace;\n font-size: 10px;\n text-anchor: middle;\n pointer-events: none;\n\n /*text-shadow: -2px -2px 0 white,*/\n /*2px -2px 0 white,*/\n /*-2px 2px 0 white,*/\n /*2px 2px 0 white;*/\n\n}\n\n\n.sequence-outline {\n font-family: 'Courier New', monospace;\n font-size: 10px;\n text-anchor: middle;\n pointer-events: none;\n\n stroke-width:4px;\n stroke:white;\n stroke-linecap:round;\n stroke-linejoin: round;\n /*text-shadow: -2px -2px 0 white,*/\n /*2px -2px 0 white,*/\n /*-2px 2px 0 white,*/\n /*2px 2px 0 white;*/\n\n}\n\n.custom-menu-margin {\n padding: 20px;\n display: none;\n z-index: 10000;\n position: absolute;\n}\n\n.custom-menu {\n overflow: hidden;\n border: 1px solid #CCC;\n white-space: nowrap;\n background: #FFF;\n color: #333;\n list-style: none;\n padding: 0;\n margin: 0;\n pointer-events: all;\n}\n\n.custom-menu li {\n padding: 8px 12px;\n cursor: pointer;\n -webkit-user-select: none;\n -moz-user-select: none;\n user-select: none;\n}\n\n.custom-menu li:hover {\n background-color: #DEF;\n}\n\n.bar-scale {\n display: inline;\n padding-left: 10px;\n}\n\n.tooltip-background {\n fill-opacity: 0.6;\n stroke-opacity: 1;\n stroke-width: 1;\n}\n\n.tooltip-sub-background {\n fill: white;\n stroke: white;\n opacity: 1;\n stroke-width: 1;\n}\n\n@media only screen and (max-width: 1140px) {\n .label {\n text-shadow: none;\n }\n}\n",""]);const o=i},314:t=>{"use strict";t.exports=function(t){var e=[];return e.toString=function(){return this.map((function(e){var n=t(e);return e[2]?"@media ".concat(e[2]," {").concat(n,"}"):n})).join("")},e.i=function(t,n,r){"string"==typeof t&&(t=[[null,t,""]]);var i={};if(r)for(var o=0;o{var r=n(747);function i(t){arguments.length>0&&this.init(t)}i.prototype.init=function(t){this.status=t,this.points=new Array},i.prototype.appendPoint=function(t){this.points.push(t)},i.prototype.appendPoints=function(t){this.points=this.points.concat(t)},i.intersectShapes=function(t,e){var n,r=t.getIntersectionParams(),o=e.getIntersectionParams();if(null!=r&&null!=o)if("Path"==r.name)n=i.intersectPathShape(t,e);else if("Path"==o.name)n=i.intersectPathShape(e,t);else{var a,s;if(r.name0&&P.length>0)t:for(var C=0;C0&&(g.status="Intersection"),g},i.intersectBezier2Bezier3=function(t,e,n,o,a,s,u){var c,l,f,h,p,d,y,v,g,x,m,b=new i("No Intersection");c=e.multiply(-2),p=t.add(c.add(n)),c=t.multiply(-2),l=e.multiply(2),d=c.add(l),y=new r(t.x,t.y),c=o.multiply(-1),l=a.multiply(3),f=s.multiply(-3),h=c.add(l.add(f.add(u))),v=new Vector2D(h.x,h.y),c=o.multiply(3),l=a.multiply(-6),f=s.multiply(3),h=c.add(l.add(f)),g=new Vector2D(h.x,h.y),c=o.multiply(-3),l=a.multiply(3),f=c.add(l),x=new Vector2D(f.x,f.y),m=new Vector2D(o.x,o.y);for(var _=y.x*y.x,w=y.y*y.y,k=d.x*d.x,S=d.y*d.y,E=p.x*p.x,M=p.y*p.y,A=m.x*m.x,T=m.y*m.y,P=x.x*x.x,C=x.y*x.y,N=g.x*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E+A*M+E*T).getRootsInInterval(0,1),I=0;I0&&q.length>0)t:for(var B=0;B0&&(b.status="Intersection"),b},i.intersectBezier2Circle=function(t,e,n,r,o){return i.intersectBezier2Ellipse(t,e,n,r,o,o)},i.intersectBezier2Ellipse=function(t,e,n,o,a,s){var u,c,l,f,h,p=new i("No Intersection");u=e.multiply(-2),l=t.add(u.add(n)),u=t.multiply(-2),c=e.multiply(2),f=u.add(c),h=new r(t.x,t.y);for(var d=a*a,y=s*s,v=new Polynomial(y*l.x*l.x+d*l.y*l.y,2*(y*l.x*f.x+d*l.y*f.y),y*(2*l.x*h.x+f.x*f.x)+d*(2*l.y*h.y+f.y*f.y)-2*(y*o.x*l.x+d*o.y*l.y),2*(y*f.x*(h.x-o.x)+d*f.y*(h.y-o.y)),y*(h.x*h.x+o.x*o.x)+d*(h.y*h.y+o.y*o.y)-2*(y*o.x*h.x+d*o.y*h.y)-d*y).getRoots(),g=0;g0&&(p.status="Intersection"),p},i.intersectBezier2Line=function(t,e,n,o,a){var s,u,c,l,f,h,p,d=o.min(a),y=o.max(a),v=new i("No Intersection");s=e.multiply(-2),c=t.add(s.add(n)),s=t.multiply(-2),u=e.multiply(2),l=s.add(u),f=new r(t.x,t.y),p=new Vector2D(o.y-a.y,a.x-o.x),h=o.x*a.y-a.x*o.y,roots=new Polynomial(p.dot(c),p.dot(l),p.dot(f)+h).getRoots();for(var g=0;g0&&(o.status="Intersection"),o},i.intersectBezier2Rectangle=function(t,e,n,o,a){var s=o.min(a),u=o.max(a),c=new r(u.x,s.y),l=new r(s.x,u.y),f=i.intersectBezier2Line(t,e,n,s,c),h=i.intersectBezier2Line(t,e,n,c,u),p=i.intersectBezier2Line(t,e,n,u,l),d=i.intersectBezier2Line(t,e,n,l,s),y=new i("No Intersection");return y.appendPoints(f.points),y.appendPoints(h.points),y.appendPoints(p.points),y.appendPoints(d.points),y.points.length>0&&(y.status="Intersection"),y},i.intersectBezier3Bezier3=function(t,e,n,r,o,a,s,u){var c,l,f,h,p,d,y,v,g,x,m,b,_=new i("No Intersection");c=t.multiply(-1),l=e.multiply(3),f=n.multiply(-3),h=c.add(l.add(f.add(r))),p=new Vector2D(h.x,h.y),c=t.multiply(3),l=e.multiply(-6),f=n.multiply(3),h=c.add(l.add(f)),d=new Vector2D(h.x,h.y),c=t.multiply(-3),l=e.multiply(3),f=c.add(l),y=new Vector2D(f.x,f.y),v=new Vector2D(t.x,t.y),c=o.multiply(-1),l=a.multiply(3),f=s.multiply(-3),h=c.add(l.add(f.add(u))),g=new Vector2D(h.x,h.y),c=o.multiply(3),l=a.multiply(-6),f=s.multiply(3),h=c.add(l.add(f)),x=new Vector2D(h.x,h.y),c=o.multiply(-3),l=a.multiply(3),f=c.add(l),m=new Vector2D(f.x,f.y),b=new Vector2D(o.x,o.y);for(var w=v.x*v.x,k=v.x*v.x*v.x,S=v.y*v.y,E=v.y*v.y*v.y,M=y.x*y.x,A=y.x*y.x*y.x,T=y.y*y.y,P=y.y*y.y*y.y,C=d.x*d.x,N=d.x*d.x*d.x,L=d.y*d.y,O=d.y*d.y*d.y,j=p.x*p.x,D=p.x*p.x*p.x,I=p.y*p.y,R=p.y*p.y*p.y,z=b.x*b.x,q=b.x*b.x*b.x,B=b.y*b.y,F=b.y*b.y*b.y,H=m.x*m.x,G=m.x*m.x*m.x,V=m.y*m.y,U=x.x*x.x,$=x.x*x.x*x.x,Y=x.y*x.y,X=g.x*g.x,W=g.x*g.x*g.x,Z=g.y*g.y,K=g.y*g.y*g.y,Q=new Polynomial(-D*K+R*W-3*p.x*I*X*g.y+3*j*p.y*g.x*Z,-6*p.x*x.x*I*g.x*g.y+6*j*p.y*x.y*g.x*g.y+3*x.x*R*X-3*D*x.y*Z-3*p.x*I*x.y*X+3*j*x.x*p.y*Z,-6*m.x*p.x*I*g.x*g.y-6*p.x*x.x*I*x.y*g.x+6*j*x.x*p.y*x.y*g.y+3*m.x*R*X+3*U*R*g.x+3*m.x*j*p.y*Z-3*p.x*m.y*I*X-3*p.x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0&&nt.length>0)t:for(var rt=0;rt0&&(_.status="Intersection"),_},i.intersectBezier3Circle=function(t,e,n,r,o,a){return i.intersectBezier3Ellipse(t,e,n,r,o,a,a)},i.intersectBezier3Ellipse=function(t,e,n,r,o,a,s){var u,c,l,f,h,p,d,y,v=new i("No Intersection");u=t.multiply(-1),c=e.multiply(3),l=n.multiply(-3),f=u.add(c.add(l.add(r))),h=new Vector2D(f.x,f.y),u=t.multiply(3),c=e.multiply(-6),l=n.multiply(3),f=u.add(c.add(l)),p=new Vector2D(f.x,f.y),u=t.multiply(-3),c=e.multiply(3),l=u.add(c),d=new Vector2D(l.x,l.y),y=new Vector2D(t.x,t.y);for(var g=a*a,x=s*s,m=new Polynomial(h.x*h.x*x+h.y*h.y*g,2*(h.x*p.x*x+h.y*p.y*g),2*(h.x*d.x*x+h.y*d.y*g)+p.x*p.x*x+p.y*p.y*g,2*h.x*x*(y.x-o.x)+2*h.y*g*(y.y-o.y)+2*(p.x*d.x*x+p.y*d.y*g),2*p.x*x*(y.x-o.x)+2*p.y*g*(y.y-o.y)+d.x*d.x*x+d.y*d.y*g,2*d.x*x*(y.x-o.x)+2*d.y*g*(y.y-o.y),y.x*y.x*x-2*y.y*o.y*g-2*y.x*o.x*x+y.y*y.y*g+o.x*o.x*x+o.y*o.y*g-g*x).getRootsInInterval(0,1),b=0;b0&&(v.status="Intersection"),v},i.intersectBezier3Line=function(t,e,n,r,o,a){var s,u,c,l,f,h,p,d,y,v,g=o.min(a),x=o.max(a),m=new i("No Intersection");s=t.multiply(-1),u=e.multiply(3),c=n.multiply(-3),l=s.add(u.add(c.add(r))),f=new Vector2D(l.x,l.y),s=t.multiply(3),u=e.multiply(-6),c=n.multiply(3),l=s.add(u.add(c)),h=new Vector2D(l.x,l.y),s=t.multiply(-3),u=e.multiply(3),c=s.add(u),p=new Vector2D(c.x,c.y),d=new Vector2D(t.x,t.y),v=new Vector2D(o.y-a.y,a.x-o.x),y=o.x*a.y-a.x*o.y,roots=new Polynomial(v.dot(f),v.dot(h),v.dot(p),v.dot(d)+y).getRoots();for(var b=0;b0&&(a.status="Intersection"),a},i.intersectBezier3Rectangle=function(t,e,n,o,a,s){var u=a.min(s),c=a.max(s),l=new r(c.x,u.y),f=new r(u.x,c.y),h=i.intersectBezier3Line(t,e,n,o,u,l),p=i.intersectBezier3Line(t,e,n,o,l,c),d=i.intersectBezier3Line(t,e,n,o,c,f),y=i.intersectBezier3Line(t,e,n,o,f,u),v=new i("No Intersection");return v.appendPoints(h.points),v.appendPoints(p.points),v.appendPoints(d.points),v.appendPoints(y.points),v.points.length>0&&(v.status="Intersection"),v},i.intersectCircleCircle=function(t,e,n,o){var a,s=e+o,u=Math.abs(e-o),c=t.distanceFrom(n);if(c>s)a=new i("Outside");else if(c1)&&(f<0||f>1)?o=new i(l<0&&f<0||l>1&&f>1?"Outside":"Inside"):(o=new i("Intersection"),0<=l&&l<=1&&o.points.push(n.lerp(r,l)),0<=f&&f<=1&&o.points.push(n.lerp(r,f)))}return o},i.intersectCirclePolygon=function(t,e,n){for(var r,o=new i("No Intersection"),a=n.length,s=0;s0?o.status="Intersection":o.status=r.status,o},i.intersectCircleRectangle=function(t,e,n,o){var a=n.min(o),s=n.max(o),u=new r(s.x,a.y),c=new r(a.x,s.y),l=i.intersectCircleLine(t,e,a,u),f=i.intersectCircleLine(t,e,u,s),h=i.intersectCircleLine(t,e,s,c),p=i.intersectCircleLine(t,e,c,a),d=new i("No Intersection");return d.appendPoints(l.points),d.appendPoints(f.points),d.appendPoints(h.points),d.appendPoints(p.points),d.points.length>0?d.status="Intersection":d.status=l.status,d},i.intersectEllipseEllipse=function(t,e,n,o,a,s){for(var u=[n*n,0,e*e,-2*n*n*t.x,-2*e*e*t.y,n*n*t.x*t.x+e*e*t.y*t.y-e*e*n*n],c=[s*s,0,a*a,-2*s*s*o.x,-2*a*a*o.y,s*s*o.x*o.x+a*a*o.y*o.y-a*a*s*s],l=i.bezout(u,c).getRoots(),f=.001*(u[0]*u[0]+2*u[1]*u[1]+u[2]*u[2]),h=.001*(c[0]*c[0]+2*c[1]*c[1]+c[2]*c[2]),p=new i("No Intersection"),d=0;d0&&(p.status="Intersection"),p},i.intersectEllipseLine=function(t,e,n,r,o){var a,s=new Vector2D(r.x,r.y),u=Vector2D.fromPoints(r,o),c=new Vector2D(t.x,t.y),l=s.subtract(c),f=new Vector2D(u.x/(e*e),u.y/(n*n)),h=new Vector2D(l.x/(e*e),l.y/(n*n)),p=u.dot(f),d=u.dot(h),y=d*d-p*(t=l.dot(h)-1);if(y<0)a=new i("Outside");else if(y>0){var v=Math.sqrt(y),g=(-d-v)/p,x=(-d+v)/p;(g<0||11&&x>1?"Outside":"Inside"):(a=new i("Intersection"),0<=g&&g<=1&&a.appendPoint(r.lerp(o,g)),0<=x&&x<=1&&a.appendPoint(r.lerp(o,x)))}else{var m=-d/p;0<=m&&m<=1?(a=new i("Intersection")).appendPoint(r.lerp(o,m)):a=new i("Outside")}return a},i.intersectEllipsePolygon=function(t,e,n,r){for(var o=new i("No Intersection"),a=r.length,s=0;s0&&(o.status="Intersection"),o},i.intersectEllipseRectangle=function(t,e,n,o,a){var s=o.min(a),u=o.max(a),c=new r(u.x,s.y),l=new r(s.x,u.y),f=i.intersectEllipseLine(t,e,n,s,c),h=i.intersectEllipseLine(t,e,n,c,u),p=i.intersectEllipseLine(t,e,n,u,l),d=i.intersectEllipseLine(t,e,n,l,s),y=new i("No Intersection");return y.appendPoints(f.points),y.appendPoints(h.points),y.appendPoints(p.points),y.appendPoints(d.points),y.points.length>0&&(y.status="Intersection"),y},i.intersectLineLine=function(t,e,n,o){var a,s=(o.x-n.x)*(t.y-n.y)-(o.y-n.y)*(t.x-n.x),u=(e.x-t.x)*(t.y-n.y)-(e.y-t.y)*(t.x-n.x),c=(o.y-n.y)*(e.x-t.x)-(o.x-n.x)*(e.y-t.y);if(0!=c){var l=s/c,f=u/c;0<=l&&l<=1&&0<=f&&f<=1?(a=new i("Intersection")).points.push(new r(t.x+l*(e.x-t.x),t.y+l*(e.y-t.y))):a=new i("No Intersection")}else a=new i(0==s||0==u?"Coincident":"Parallel");return a},i.intersectLinePolygon=function(t,e,n){for(var r=new i("No Intersection"),o=n.length,a=0;a0&&(r.status="Intersection"),r},i.intersectLineRectangle=function(t,e,n,o){var a=n.min(o),s=n.max(o),u=new r(s.x,a.y),c=new r(a.x,s.y),l=i.intersectLineLine(a,u,t,e),f=i.intersectLineLine(u,s,t,e),h=i.intersectLineLine(s,c,t,e),p=i.intersectLineLine(c,a,t,e),d=new i("No Intersection");return d.appendPoints(l.points),d.appendPoints(f.points),d.appendPoints(h.points),d.appendPoints(p.points),d.points.length>0&&(d.status="Intersection"),d},i.intersectPolygonPolygon=function(t,e){for(var n=new i("No Intersection"),r=t.length,o=0;o0&&(n.status="Intersection"),n},i.intersectPolygonRectangle=function(t,e,n){var o=e.min(n),a=e.max(n),s=new r(a.x,o.y),u=new r(o.x,a.y),c=i.intersectLinePolygon(o,s,t),l=i.intersectLinePolygon(s,a,t),f=i.intersectLinePolygon(a,u,t),h=i.intersectLinePolygon(u,o,t),p=new i("No Intersection");return p.appendPoints(c.points),p.appendPoints(l.points),p.appendPoints(f.points),p.appendPoints(h.points),p.points.length>0&&(p.status="Intersection"),p},i.intersectRayRay=function(t,e,n,o){var a,s=(o.x-n.x)*(t.y-n.y)-(o.y-n.y)*(t.x-n.x),u=(e.x-t.x)*(t.y-n.y)-(e.y-t.y)*(t.x-n.x),c=(o.y-n.y)*(e.x-t.x)-(o.x-n.x)*(e.y-t.y);if(0!=c){var l=s/c;(a=new i("Intersection")).points.push(new r(t.x+l*(e.x-t.x),t.y+l*(e.y-t.y)))}else a=new i(0==s||0==u?"Coincident":"Parallel");return a},i.intersectRectangleRectangle=function(t,e,n,o){var a=t.min(e),s=t.max(e),u=new r(s.x,a.y),c=new r(a.x,s.y),l=i.intersectLineRectangle(a,u,n,o),f=i.intersectLineRectangle(u,s,n,o),h=i.intersectLineRectangle(s,c,n,o),p=i.intersectLineRectangle(c,a,n,o),d=new i("No Intersection");return d.appendPoints(l.points),d.appendPoints(f.points),d.appendPoints(h.points),d.appendPoints(p.points),d.points.length>0&&(d.status="Intersection"),d},i.bezout=function(t,e){var n=t[0]*e[1]-e[0]*t[1],r=t[0]*e[2]-e[0]*t[2],i=t[0]*e[3]-e[0]*t[3],o=t[0]*e[4]-e[0]*t[4],a=t[0]*e[5]-e[0]*t[5],s=t[1]*e[2]-e[1]*t[2],u=t[1]*e[4]-e[1]*t[4],c=t[1]*e[5]-e[1]*t[5],l=t[2]*e[3]-e[2]*t[3],f=t[3]*e[4]-e[3]*t[4],h=t[3]*e[5]-e[3]*t[5],p=c+f,d=u-l;return new Polynomial(n*s-r*r,n*d+i*s-2*r*o,n*p+i*d-o*o-2*r*a,n*h+i*p-2*o*a,i*h-a*a)},t.exports=i},692:function(t,e){var n;!function(e,n){"use strict";"object"==typeof t.exports?t.exports=e.document?n(e,!0):function(t){if(!t.document)throw new Error("jQuery requires a window with a document");return n(t)}:n(e)}("undefined"!=typeof window?window:this,(function(r,i){"use strict";var o=[],a=Object.getPrototypeOf,s=o.slice,u=o.flat?function(t){return o.flat.call(t)}:function(t){return o.concat.apply([],t)},c=o.push,l=o.indexOf,f={},h=f.toString,p=f.hasOwnProperty,d=p.toString,y=d.call(Object),v={},g=function(t){return"function"==typeof t&&"number"!=typeof t.nodeType&&"function"!=typeof t.item},x=function(t){return null!=t&&t===t.window},m=r.document,b={type:!0,src:!0,nonce:!0,noModule:!0};function _(t,e,n){var r,i,o=(n=n||m).createElement("script");if(o.text=t,e)for(r in b)(i=e[r]||e.getAttribute&&e.getAttribute(r))&&o.setAttribute(r,i);n.head.appendChild(o).parentNode.removeChild(o)}function w(t){return null==t?t+"":"object"==typeof t||"function"==typeof t?f[h.call(t)]||"object":typeof t}var k="3.7.1",S=/HTML$/i,E=function(t,e){return new E.fn.init(t,e)};function M(t){var e=!!t&&"length"in t&&t.length,n=w(t);return!g(t)&&!x(t)&&("array"===n||0===e||"number"==typeof e&&e>0&&e-1 in t)}function A(t,e){return t.nodeName&&t.nodeName.toLowerCase()===e.toLowerCase()}E.fn=E.prototype={jquery:k,constructor:E,length:0,toArray:function(){return s.call(this)},get:function(t){return null==t?s.call(this):t<0?this[t+this.length]:this[t]},pushStack:function(t){var e=E.merge(this.constructor(),t);return e.prevObject=this,e},each:function(t){return E.each(this,t)},map:function(t){return this.pushStack(E.map(this,(function(e,n){return t.call(e,n,e)})))},slice:function(){return this.pushStack(s.apply(this,arguments))},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},even:function(){return this.pushStack(E.grep(this,(function(t,e){return(e+1)%2})))},odd:function(){return this.pushStack(E.grep(this,(function(t,e){return e%2})))},eq:function(t){var e=this.length,n=+t+(t<0?e:0);return this.pushStack(n>=0&&n+~]|"+N+")"+N+"*"),F=new RegExp(N+"|>"),H=new RegExp(R),G=new RegExp("^"+O+"$"),V={ID:new RegExp("^#("+O+")"),CLASS:new RegExp("^\\.("+O+")"),TAG:new RegExp("^("+O+"|[*])"),ATTR:new RegExp("^"+j),PSEUDO:new RegExp("^"+R),CHILD:new RegExp("^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\("+N+"*(even|odd|(([+-]|)(\\d*)n|)"+N+"*(?:([+-]|)"+N+"*(\\d+)|))"+N+"*\\)|)","i"),bool:new RegExp("^(?:"+M+")$","i"),needsContext:new RegExp("^"+N+"*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\("+N+"*((?:-\\d)?\\d*)"+N+"*\\)|)(?=[^-]|$)","i")},U=/^(?:input|select|textarea|button)$/i,$=/^h\d$/i,Y=/^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/,X=/[+~]/,W=new RegExp("\\\\[\\da-fA-F]{1,6}"+N+"?|\\\\([^\\r\\n\\f])","g"),Z=function(t,e){var n="0x"+t.slice(1)-65536;return e||(n<0?String.fromCharCode(n+65536):String.fromCharCode(n>>10|55296,1023&n|56320))},K=function(){ut()},Q=ht((function(t){return!0===t.disabled&&A(t,"fieldset")}),{dir:"parentNode",next:"legend"});try{y.apply(o=s.call(D.childNodes),D.childNodes),o[D.childNodes.length].nodeType}catch(t){y={apply:function(t,e){I.apply(t,s.call(e))},call:function(t){I.apply(t,s.call(arguments,1))}}}function J(t,e,n,r){var i,o,a,s,c,l,p,d=e&&e.ownerDocument,x=e?e.nodeType:9;if(n=n||[],"string"!=typeof t||!t||1!==x&&9!==x&&11!==x)return n;if(!r&&(ut(e),e=e||u,f)){if(11!==x&&(c=Y.exec(t)))if(i=c[1]){if(9===x){if(!(a=e.getElementById(i)))return n;if(a.id===i)return y.call(n,a),n}else if(d&&(a=d.getElementById(i))&&J.contains(e,a)&&a.id===i)return y.call(n,a),n}else{if(c[2])return y.apply(n,e.getElementsByTagName(t)),n;if((i=c[3])&&e.getElementsByClassName)return y.apply(n,e.getElementsByClassName(i)),n}if(!(k[t+" "]||h&&h.test(t))){if(p=t,d=e,1===x&&(F.test(t)||B.test(t))){for((d=X.test(t)&&st(e.parentNode)||e)==e&&v.scope||((s=e.getAttribute("id"))?s=E.escapeSelector(s):e.setAttribute("id",s=g)),o=(l=lt(t)).length;o--;)l[o]=(s?"#"+s:":scope")+" "+ft(l[o]);p=l.join(",")}try{return y.apply(n,d.querySelectorAll(p)),n}catch(e){k(t,!0)}finally{s===g&&e.removeAttribute("id")}}}return xt(t.replace(L,"$1"),e,n,r)}function tt(){var t=[];return function n(r,i){return t.push(r+" ")>e.cacheLength&&delete n[t.shift()],n[r+" "]=i}}function et(t){return t[g]=!0,t}function nt(t){var e=u.createElement("fieldset");try{return!!t(e)}catch(t){return!1}finally{e.parentNode&&e.parentNode.removeChild(e),e=null}}function rt(t){return function(e){return A(e,"input")&&e.type===t}}function it(t){return function(e){return(A(e,"input")||A(e,"button"))&&e.type===t}}function ot(t){return function(e){return"form"in e?e.parentNode&&!1===e.disabled?"label"in e?"label"in e.parentNode?e.parentNode.disabled===t:e.disabled===t:e.isDisabled===t||e.isDisabled!==!t&&Q(e)===t:e.disabled===t:"label"in e&&e.disabled===t}}function at(t){return et((function(e){return e=+e,et((function(n,r){for(var i,o=t([],n.length,e),a=o.length;a--;)n[i=o[a]]&&(n[i]=!(r[i]=n[i]))}))}))}function st(t){return t&&void 0!==t.getElementsByTagName&&t}function ut(t){var n,r=t?t.ownerDocument||t:D;return r!=u&&9===r.nodeType&&r.documentElement?(c=(u=r).documentElement,f=!E.isXMLDoc(u),d=c.matches||c.webkitMatchesSelector||c.msMatchesSelector,c.msMatchesSelector&&D!=u&&(n=u.defaultView)&&n.top!==n&&n.addEventListener("unload",K),v.getById=nt((function(t){return c.appendChild(t).id=E.expando,!u.getElementsByName||!u.getElementsByName(E.expando).length})),v.disconnectedMatch=nt((function(t){return d.call(t,"*")})),v.scope=nt((function(){return u.querySelectorAll(":scope")})),v.cssHas=nt((function(){try{return u.querySelector(":has(*,:jqfake)"),!1}catch(t){return!0}})),v.getById?(e.filter.ID=function(t){var e=t.replace(W,Z);return function(t){return t.getAttribute("id")===e}},e.find.ID=function(t,e){if(void 0!==e.getElementById&&f){var n=e.getElementById(t);return n?[n]:[]}}):(e.filter.ID=function(t){var e=t.replace(W,Z);return function(t){var n=void 0!==t.getAttributeNode&&t.getAttributeNode("id");return n&&n.value===e}},e.find.ID=function(t,e){if(void 0!==e.getElementById&&f){var n,r,i,o=e.getElementById(t);if(o){if((n=o.getAttributeNode("id"))&&n.value===t)return[o];for(i=e.getElementsByName(t),r=0;o=i[r++];)if((n=o.getAttributeNode("id"))&&n.value===t)return[o]}return[]}}),e.find.TAG=function(t,e){return void 0!==e.getElementsByTagName?e.getElementsByTagName(t):e.querySelectorAll(t)},e.find.CLASS=function(t,e){if(void 0!==e.getElementsByClassName&&f)return e.getElementsByClassName(t)},h=[],nt((function(t){var e;c.appendChild(t).innerHTML="",t.querySelectorAll("[selected]").length||h.push("\\["+N+"*(?:value|"+M+")"),t.querySelectorAll("[id~="+g+"-]").length||h.push("~="),t.querySelectorAll("a#"+g+"+*").length||h.push(".#.+[+~]"),t.querySelectorAll(":checked").length||h.push(":checked"),(e=u.createElement("input")).setAttribute("type","hidden"),t.appendChild(e).setAttribute("name","D"),c.appendChild(t).disabled=!0,2!==t.querySelectorAll(":disabled").length&&h.push(":enabled",":disabled"),(e=u.createElement("input")).setAttribute("name",""),t.appendChild(e),t.querySelectorAll("[name='']").length||h.push("\\["+N+"*name"+N+"*="+N+"*(?:''|\"\")")})),v.cssHas||h.push(":has"),h=h.length&&new RegExp(h.join("|")),S=function(t,e){if(t===e)return a=!0,0;var n=!t.compareDocumentPosition-!e.compareDocumentPosition;return n||(1&(n=(t.ownerDocument||t)==(e.ownerDocument||e)?t.compareDocumentPosition(e):1)||!v.sortDetached&&e.compareDocumentPosition(t)===n?t===u||t.ownerDocument==D&&J.contains(D,t)?-1:e===u||e.ownerDocument==D&&J.contains(D,e)?1:i?l.call(i,t)-l.call(i,e):0:4&n?-1:1)},u):u}for(t in J.matches=function(t,e){return J(t,null,null,e)},J.matchesSelector=function(t,e){if(ut(t),f&&!k[e+" "]&&(!h||!h.test(e)))try{var n=d.call(t,e);if(n||v.disconnectedMatch||t.document&&11!==t.document.nodeType)return n}catch(t){k(e,!0)}return J(e,u,null,[t]).length>0},J.contains=function(t,e){return(t.ownerDocument||t)!=u&&ut(t),E.contains(t,e)},J.attr=function(t,n){(t.ownerDocument||t)!=u&&ut(t);var r=e.attrHandle[n.toLowerCase()],i=r&&p.call(e.attrHandle,n.toLowerCase())?r(t,n,!f):void 0;return void 0!==i?i:t.getAttribute(n)},J.error=function(t){throw new Error("Syntax error, unrecognized expression: "+t)},E.uniqueSort=function(t){var e,n=[],r=0,o=0;if(a=!v.sortStable,i=!v.sortStable&&s.call(t,0),P.call(t,S),a){for(;e=t[o++];)e===t[o]&&(r=n.push(o));for(;r--;)C.call(t,n[r],1)}return i=null,t},E.fn.uniqueSort=function(){return this.pushStack(E.uniqueSort(s.apply(this)))},e=E.expr={cacheLength:50,createPseudo:et,match:V,attrHandle:{},find:{},relative:{">":{dir:"parentNode",first:!0}," ":{dir:"parentNode"},"+":{dir:"previousSibling",first:!0},"~":{dir:"previousSibling"}},preFilter:{ATTR:function(t){return t[1]=t[1].replace(W,Z),t[3]=(t[3]||t[4]||t[5]||"").replace(W,Z),"~="===t[2]&&(t[3]=" "+t[3]+" "),t.slice(0,4)},CHILD:function(t){return t[1]=t[1].toLowerCase(),"nth"===t[1].slice(0,3)?(t[3]||J.error(t[0]),t[4]=+(t[4]?t[5]+(t[6]||1):2*("even"===t[3]||"odd"===t[3])),t[5]=+(t[7]+t[8]||"odd"===t[3])):t[3]&&J.error(t[0]),t},PSEUDO:function(t){var e,n=!t[6]&&t[2];return V.CHILD.test(t[0])?null:(t[3]?t[2]=t[4]||t[5]||"":n&&H.test(n)&&(e=lt(n,!0))&&(e=n.indexOf(")",n.length-e)-n.length)&&(t[0]=t[0].slice(0,e),t[2]=n.slice(0,e)),t.slice(0,3))}},filter:{TAG:function(t){var e=t.replace(W,Z).toLowerCase();return"*"===t?function(){return!0}:function(t){return A(t,e)}},CLASS:function(t){var e=b[t+" "];return e||(e=new RegExp("(^|"+N+")"+t+"("+N+"|$)"))&&b(t,(function(t){return e.test("string"==typeof t.className&&t.className||void 0!==t.getAttribute&&t.getAttribute("class")||"")}))},ATTR:function(t,e,n){return function(r){var i=J.attr(r,t);return null==i?"!="===e:!e||(i+="","="===e?i===n:"!="===e?i!==n:"^="===e?n&&0===i.indexOf(n):"*="===e?n&&i.indexOf(n)>-1:"$="===e?n&&i.slice(-n.length)===n:"~="===e?(" "+i.replace(z," ")+" ").indexOf(n)>-1:"|="===e&&(i===n||i.slice(0,n.length+1)===n+"-"))}},CHILD:function(t,e,n,r,i){var o="nth"!==t.slice(0,3),a="last"!==t.slice(-4),s="of-type"===e;return 1===r&&0===i?function(t){return!!t.parentNode}:function(e,n,u){var c,l,f,h,p,d=o!==a?"nextSibling":"previousSibling",y=e.parentNode,v=s&&e.nodeName.toLowerCase(),m=!u&&!s,b=!1;if(y){if(o){for(;d;){for(f=e;f=f[d];)if(s?A(f,v):1===f.nodeType)return!1;p=d="only"===t&&!p&&"nextSibling"}return!0}if(p=[a?y.firstChild:y.lastChild],a&&m){for(b=(h=(c=(l=y[g]||(y[g]={}))[t]||[])[0]===x&&c[1])&&c[2],f=h&&y.childNodes[h];f=++h&&f&&f[d]||(b=h=0)||p.pop();)if(1===f.nodeType&&++b&&f===e){l[t]=[x,h,b];break}}else if(m&&(b=h=(c=(l=e[g]||(e[g]={}))[t]||[])[0]===x&&c[1]),!1===b)for(;(f=++h&&f&&f[d]||(b=h=0)||p.pop())&&(!(s?A(f,v):1===f.nodeType)||!++b||(m&&((l=f[g]||(f[g]={}))[t]=[x,b]),f!==e)););return(b-=i)===r||b%r==0&&b/r>=0}}},PSEUDO:function(t,n){var r,i=e.pseudos[t]||e.setFilters[t.toLowerCase()]||J.error("unsupported pseudo: "+t);return i[g]?i(n):i.length>1?(r=[t,t,"",n],e.setFilters.hasOwnProperty(t.toLowerCase())?et((function(t,e){for(var r,o=i(t,n),a=o.length;a--;)t[r=l.call(t,o[a])]=!(e[r]=o[a])})):function(t){return i(t,0,r)}):i}},pseudos:{not:et((function(t){var e=[],n=[],r=gt(t.replace(L,"$1"));return r[g]?et((function(t,e,n,i){for(var o,a=r(t,null,i,[]),s=t.length;s--;)(o=a[s])&&(t[s]=!(e[s]=o))})):function(t,i,o){return e[0]=t,r(e,null,o,n),e[0]=null,!n.pop()}})),has:et((function(t){return function(e){return J(t,e).length>0}})),contains:et((function(t){return t=t.replace(W,Z),function(e){return(e.textContent||E.text(e)).indexOf(t)>-1}})),lang:et((function(t){return G.test(t||"")||J.error("unsupported lang: "+t),t=t.replace(W,Z).toLowerCase(),function(e){var n;do{if(n=f?e.lang:e.getAttribute("xml:lang")||e.getAttribute("lang"))return(n=n.toLowerCase())===t||0===n.indexOf(t+"-")}while((e=e.parentNode)&&1===e.nodeType);return!1}})),target:function(t){var e=r.location&&r.location.hash;return e&&e.slice(1)===t.id},root:function(t){return t===c},focus:function(t){return t===function(){try{return u.activeElement}catch(t){}}()&&u.hasFocus()&&!!(t.type||t.href||~t.tabIndex)},enabled:ot(!1),disabled:ot(!0),checked:function(t){return A(t,"input")&&!!t.checked||A(t,"option")&&!!t.selected},selected:function(t){return t.parentNode&&t.parentNode.selectedIndex,!0===t.selected},empty:function(t){for(t=t.firstChild;t;t=t.nextSibling)if(t.nodeType<6)return!1;return!0},parent:function(t){return!e.pseudos.empty(t)},header:function(t){return $.test(t.nodeName)},input:function(t){return U.test(t.nodeName)},button:function(t){return A(t,"input")&&"button"===t.type||A(t,"button")},text:function(t){var e;return A(t,"input")&&"text"===t.type&&(null==(e=t.getAttribute("type"))||"text"===e.toLowerCase())},first:at((function(){return[0]})),last:at((function(t,e){return[e-1]})),eq:at((function(t,e,n){return[n<0?n+e:n]})),even:at((function(t,e){for(var n=0;ne?e:n;--r>=0;)t.push(r);return t})),gt:at((function(t,e,n){for(var r=n<0?n+e:n;++r1?function(e,n,r){for(var i=t.length;i--;)if(!t[i](e,n,r))return!1;return!0}:t[0]}function dt(t,e,n,r,i){for(var o,a=[],s=0,u=t.length,c=null!=e;s-1&&(o[c]=!(a[c]=h))}}else p=dt(p===a?p.splice(g,p.length):p),i?i(null,a,p,u):y.apply(a,p)}))}function vt(t){for(var r,i,o,a=t.length,s=e.relative[t[0].type],u=s||e.relative[" "],c=s?1:0,f=ht((function(t){return t===r}),u,!0),h=ht((function(t){return l.call(r,t)>-1}),u,!0),p=[function(t,e,i){var o=!s&&(i||e!=n)||((r=e).nodeType?f(t,e,i):h(t,e,i));return r=null,o}];c1&&pt(p),c>1&&ft(t.slice(0,c-1).concat({value:" "===t[c-2].type?"*":""})).replace(L,"$1"),i,c0,o=t.length>0,a=function(a,s,c,l,h){var p,d,v,g=0,m="0",b=a&&[],_=[],w=n,k=a||o&&e.find.TAG("*",h),S=x+=null==w?1:Math.random()||.1,M=k.length;for(h&&(n=s==u||s||h);m!==M&&null!=(p=k[m]);m++){if(o&&p){for(d=0,s||p.ownerDocument==u||(ut(p),c=!f);v=t[d++];)if(v(p,s||u,c)){y.call(l,p);break}h&&(x=S)}i&&((p=!v&&p)&&g--,a&&b.push(p))}if(g+=m,i&&m!==g){for(d=0;v=r[d++];)v(b,_,s,c);if(a){if(g>0)for(;m--;)b[m]||_[m]||(_[m]=T.call(l));_=dt(_)}y.apply(l,_),h&&!a&&_.length>0&&g+r.length>1&&E.uniqueSort(l)}return h&&(x=S,n=w),b};return i?et(a):a}(a,o)),s.selector=t}return s}function xt(t,n,r,i){var o,a,s,u,c,l="function"==typeof t&&t,h=!i&<(t=l.selector||t);if(r=r||[],1===h.length){if((a=h[0]=h[0].slice(0)).length>2&&"ID"===(s=a[0]).type&&9===n.nodeType&&f&&e.relative[a[1].type]){if(!(n=(e.find.ID(s.matches[0].replace(W,Z),n)||[])[0]))return r;l&&(n=n.parentNode),t=t.slice(a.shift().value.length)}for(o=V.needsContext.test(t)?0:a.length;o--&&(s=a[o],!e.relative[u=s.type]);)if((c=e.find[u])&&(i=c(s.matches[0].replace(W,Z),X.test(a[0].type)&&st(n.parentNode)||n))){if(a.splice(o,1),!(t=i.length&&ft(a)))return y.apply(r,i),r;break}}return(l||gt(t,h))(i,n,!f,r,!n||X.test(t)&&st(n.parentNode)||n),r}ct.prototype=e.filters=e.pseudos,e.setFilters=new ct,v.sortStable=g.split("").sort(S).join("")===g,ut(),v.sortDetached=nt((function(t){return 1&t.compareDocumentPosition(u.createElement("fieldset"))})),E.find=J,E.expr[":"]=E.expr.pseudos,E.unique=E.uniqueSort,J.compile=gt,J.select=xt,J.setDocument=ut,J.tokenize=lt,J.escape=E.escapeSelector,J.getText=E.text,J.isXML=E.isXMLDoc,J.selectors=E.expr,J.support=E.support,J.uniqueSort=E.uniqueSort}();var R=function(t,e,n){for(var r=[],i=void 0!==n;(t=t[e])&&9!==t.nodeType;)if(1===t.nodeType){if(i&&E(t).is(n))break;r.push(t)}return r},z=function(t,e){for(var n=[];t;t=t.nextSibling)1===t.nodeType&&t!==e&&n.push(t);return n},q=E.expr.match.needsContext,B=/^<([a-z][^\/\0>:\x20\t\r\n\f]*)[\x20\t\r\n\f]*\/?>(?:<\/\1>|)$/i;function F(t,e,n){return g(e)?E.grep(t,(function(t,r){return!!e.call(t,r,t)!==n})):e.nodeType?E.grep(t,(function(t){return t===e!==n})):"string"!=typeof e?E.grep(t,(function(t){return l.call(e,t)>-1!==n})):E.filter(e,t,n)}E.filter=function(t,e,n){var r=e[0];return n&&(t=":not("+t+")"),1===e.length&&1===r.nodeType?E.find.matchesSelector(r,t)?[r]:[]:E.find.matches(t,E.grep(e,(function(t){return 1===t.nodeType})))},E.fn.extend({find:function(t){var e,n,r=this.length,i=this;if("string"!=typeof t)return this.pushStack(E(t).filter((function(){for(e=0;e1?E.uniqueSort(n):n},filter:function(t){return this.pushStack(F(this,t||[],!1))},not:function(t){return this.pushStack(F(this,t||[],!0))},is:function(t){return!!F(this,"string"==typeof t&&q.test(t)?E(t):t||[],!1).length}});var H,G=/^(?:\s*(<[\w\W]+>)[^>]*|#([\w-]+))$/;(E.fn.init=function(t,e,n){var r,i;if(!t)return this;if(n=n||H,"string"==typeof t){if(!(r="<"===t[0]&&">"===t[t.length-1]&&t.length>=3?[null,t,null]:G.exec(t))||!r[1]&&e)return!e||e.jquery?(e||n).find(t):this.constructor(e).find(t);if(r[1]){if(e=e instanceof E?e[0]:e,E.merge(this,E.parseHTML(r[1],e&&e.nodeType?e.ownerDocument||e:m,!0)),B.test(r[1])&&E.isPlainObject(e))for(r in e)g(this[r])?this[r](e[r]):this.attr(r,e[r]);return this}return(i=m.getElementById(r[2]))&&(this[0]=i,this.length=1),this}return t.nodeType?(this[0]=t,this.length=1,this):g(t)?void 0!==n.ready?n.ready(t):t(E):E.makeArray(t,this)}).prototype=E.fn,H=E(m);var V=/^(?:parents|prev(?:Until|All))/,U={children:!0,contents:!0,next:!0,prev:!0};function $(t,e){for(;(t=t[e])&&1!==t.nodeType;);return t}E.fn.extend({has:function(t){var e=E(t,this),n=e.length;return this.filter((function(){for(var t=0;t-1:1===n.nodeType&&E.find.matchesSelector(n,t))){o.push(n);break}return this.pushStack(o.length>1?E.uniqueSort(o):o)},index:function(t){return t?"string"==typeof t?l.call(E(t),this[0]):l.call(this,t.jquery?t[0]:t):this[0]&&this[0].parentNode?this.first().prevAll().length:-1},add:function(t,e){return this.pushStack(E.uniqueSort(E.merge(this.get(),E(t,e))))},addBack:function(t){return this.add(null==t?this.prevObject:this.prevObject.filter(t))}}),E.each({parent:function(t){var e=t.parentNode;return e&&11!==e.nodeType?e:null},parents:function(t){return R(t,"parentNode")},parentsUntil:function(t,e,n){return R(t,"parentNode",n)},next:function(t){return $(t,"nextSibling")},prev:function(t){return $(t,"previousSibling")},nextAll:function(t){return R(t,"nextSibling")},prevAll:function(t){return R(t,"previousSibling")},nextUntil:function(t,e,n){return R(t,"nextSibling",n)},prevUntil:function(t,e,n){return R(t,"previousSibling",n)},siblings:function(t){return z((t.parentNode||{}).firstChild,t)},children:function(t){return z(t.firstChild)},contents:function(t){return null!=t.contentDocument&&a(t.contentDocument)?t.contentDocument:(A(t,"template")&&(t=t.content||t),E.merge([],t.childNodes))}},(function(t,e){E.fn[t]=function(n,r){var i=E.map(this,e,n);return"Until"!==t.slice(-5)&&(r=n),r&&"string"==typeof r&&(i=E.filter(r,i)),this.length>1&&(U[t]||E.uniqueSort(i),V.test(t)&&i.reverse()),this.pushStack(i)}}));var Y=/[^\x20\t\r\n\f]+/g;function X(t){return t}function W(t){throw t}function Z(t,e,n,r){var i;try{t&&g(i=t.promise)?i.call(t).done(e).fail(n):t&&g(i=t.then)?i.call(t,e,n):e.apply(void 0,[t].slice(r))}catch(t){n.apply(void 0,[t])}}E.Callbacks=function(t){t="string"==typeof t?function(t){var e={};return E.each(t.match(Y)||[],(function(t,n){e[n]=!0})),e}(t):E.extend({},t);var e,n,r,i,o=[],a=[],s=-1,u=function(){for(i=i||t.once,r=e=!0;a.length;s=-1)for(n=a.shift();++s-1;)o.splice(n,1),n<=s&&s--})),this},has:function(t){return t?E.inArray(t,o)>-1:o.length>0},empty:function(){return o&&(o=[]),this},disable:function(){return i=a=[],o=n="",this},disabled:function(){return!o},lock:function(){return i=a=[],n||e||(o=n=""),this},locked:function(){return!!i},fireWith:function(t,n){return i||(n=[t,(n=n||[]).slice?n.slice():n],a.push(n),e||u()),this},fire:function(){return c.fireWith(this,arguments),this},fired:function(){return!!r}};return c},E.extend({Deferred:function(t){var e=[["notify","progress",E.Callbacks("memory"),E.Callbacks("memory"),2],["resolve","done",E.Callbacks("once memory"),E.Callbacks("once memory"),0,"resolved"],["reject","fail",E.Callbacks("once memory"),E.Callbacks("once memory"),1,"rejected"]],n="pending",i={state:function(){return n},always:function(){return o.done(arguments).fail(arguments),this},catch:function(t){return i.then(null,t)},pipe:function(){var t=arguments;return E.Deferred((function(n){E.each(e,(function(e,r){var i=g(t[r[4]])&&t[r[4]];o[r[1]]((function(){var t=i&&i.apply(this,arguments);t&&g(t.promise)?t.promise().progress(n.notify).done(n.resolve).fail(n.reject):n[r[0]+"With"](this,i?[t]:arguments)}))})),t=null})).promise()},then:function(t,n,i){var o=0;function a(t,e,n,i){return function(){var s=this,u=arguments,c=function(){var r,c;if(!(t=o&&(n!==W&&(s=void 0,u=[r]),e.rejectWith(s,u))}};t?l():(E.Deferred.getErrorHook?l.error=E.Deferred.getErrorHook():E.Deferred.getStackHook&&(l.error=E.Deferred.getStackHook()),r.setTimeout(l))}}return E.Deferred((function(r){e[0][3].add(a(0,r,g(i)?i:X,r.notifyWith)),e[1][3].add(a(0,r,g(t)?t:X)),e[2][3].add(a(0,r,g(n)?n:W))})).promise()},promise:function(t){return null!=t?E.extend(t,i):i}},o={};return E.each(e,(function(t,r){var a=r[2],s=r[5];i[r[1]]=a.add,s&&a.add((function(){n=s}),e[3-t][2].disable,e[3-t][3].disable,e[0][2].lock,e[0][3].lock),a.add(r[3].fire),o[r[0]]=function(){return o[r[0]+"With"](this===o?void 0:this,arguments),this},o[r[0]+"With"]=a.fireWith})),i.promise(o),t&&t.call(o,o),o},when:function(t){var e=arguments.length,n=e,r=Array(n),i=s.call(arguments),o=E.Deferred(),a=function(t){return function(n){r[t]=this,i[t]=arguments.length>1?s.call(arguments):n,--e||o.resolveWith(r,i)}};if(e<=1&&(Z(t,o.done(a(n)).resolve,o.reject,!e),"pending"===o.state()||g(i[n]&&i[n].then)))return o.then();for(;n--;)Z(i[n],a(n),o.reject);return o.promise()}});var K=/^(Eval|Internal|Range|Reference|Syntax|Type|URI)Error$/;E.Deferred.exceptionHook=function(t,e){r.console&&r.console.warn&&t&&K.test(t.name)&&r.console.warn("jQuery.Deferred exception: "+t.message,t.stack,e)},E.readyException=function(t){r.setTimeout((function(){throw t}))};var Q=E.Deferred();function J(){m.removeEventListener("DOMContentLoaded",J),r.removeEventListener("load",J),E.ready()}E.fn.ready=function(t){return Q.then(t).catch((function(t){E.readyException(t)})),this},E.extend({isReady:!1,readyWait:1,ready:function(t){(!0===t?--E.readyWait:E.isReady)||(E.isReady=!0,!0!==t&&--E.readyWait>0||Q.resolveWith(m,[E]))}}),E.ready.then=Q.then,"complete"===m.readyState||"loading"!==m.readyState&&!m.documentElement.doScroll?r.setTimeout(E.ready):(m.addEventListener("DOMContentLoaded",J),r.addEventListener("load",J));var tt=function(t,e,n,r,i,o,a){var s=0,u=t.length,c=null==n;if("object"===w(n))for(s in i=!0,n)tt(t,e,s,n[s],!0,o,a);else if(void 0!==r&&(i=!0,g(r)||(a=!0),c&&(a?(e.call(t,r),e=null):(c=e,e=function(t,e,n){return c.call(E(t),n)})),e))for(;s1,null,!0)},removeData:function(t){return this.each((function(){ut.remove(this,t)}))}}),E.extend({queue:function(t,e,n){var r;if(t)return e=(e||"fx")+"queue",r=st.get(t,e),n&&(!r||Array.isArray(n)?r=st.access(t,e,E.makeArray(n)):r.push(n)),r||[]},dequeue:function(t,e){e=e||"fx";var n=E.queue(t,e),r=n.length,i=n.shift(),o=E._queueHooks(t,e);"inprogress"===i&&(i=n.shift(),r--),i&&("fx"===e&&n.unshift("inprogress"),delete o.stop,i.call(t,(function(){E.dequeue(t,e)}),o)),!r&&o&&o.empty.fire()},_queueHooks:function(t,e){var n=e+"queueHooks";return st.get(t,n)||st.access(t,n,{empty:E.Callbacks("once memory").add((function(){st.remove(t,[e+"queue",n])}))})}}),E.fn.extend({queue:function(t,e){var n=2;return"string"!=typeof t&&(e=t,t="fx",n--),arguments.length\x20\t\r\n\f]*)/i,At=/^$|^module$|\/(?:java|ecma)script/i;kt=m.createDocumentFragment().appendChild(m.createElement("div")),(St=m.createElement("input")).setAttribute("type","radio"),St.setAttribute("checked","checked"),St.setAttribute("name","t"),kt.appendChild(St),v.checkClone=kt.cloneNode(!0).cloneNode(!0).lastChild.checked,kt.innerHTML="",v.noCloneChecked=!!kt.cloneNode(!0).lastChild.defaultValue,kt.innerHTML="",v.option=!!kt.lastChild;var Tt={thead:[1,"","
"],col:[2,"","
"],tr:[2,"","
"],td:[3,"","
"],_default:[0,"",""]};function Pt(t,e){var n;return n=void 0!==t.getElementsByTagName?t.getElementsByTagName(e||"*"):void 0!==t.querySelectorAll?t.querySelectorAll(e||"*"):[],void 0===e||e&&A(t,e)?E.merge([t],n):n}function Ct(t,e){for(var n=0,r=t.length;n",""]);var Nt=/<|&#?\w+;/;function Lt(t,e,n,r,i){for(var o,a,s,u,c,l,f=e.createDocumentFragment(),h=[],p=0,d=t.length;p-1)i&&i.push(o);else if(c=vt(o),a=Pt(f.appendChild(o),"script"),c&&Ct(a),n)for(l=0;o=a[l++];)At.test(o.type||"")&&n.push(o);return f}var Ot=/^([^.]*)(?:\.(.+)|)/;function jt(){return!0}function Dt(){return!1}function It(t,e,n,r,i,o){var a,s;if("object"==typeof e){for(s in"string"!=typeof n&&(r=r||n,n=void 0),e)It(t,s,n,r,e[s],o);return t}if(null==r&&null==i?(i=n,r=n=void 0):null==i&&("string"==typeof n?(i=r,r=void 0):(i=r,r=n,n=void 0)),!1===i)i=Dt;else if(!i)return t;return 1===o&&(a=i,i=function(t){return E().off(t),a.apply(this,arguments)},i.guid=a.guid||(a.guid=E.guid++)),t.each((function(){E.event.add(this,e,i,r,n)}))}function Rt(t,e,n){n?(st.set(t,e,!1),E.event.add(t,e,{namespace:!1,handler:function(t){var n,r=st.get(this,e);if(1&t.isTrigger&&this[e]){if(r)(E.event.special[e]||{}).delegateType&&t.stopPropagation();else if(r=s.call(arguments),st.set(this,e,r),this[e](),n=st.get(this,e),st.set(this,e,!1),r!==n)return t.stopImmediatePropagation(),t.preventDefault(),n}else r&&(st.set(this,e,E.event.trigger(r[0],r.slice(1),this)),t.stopPropagation(),t.isImmediatePropagationStopped=jt)}})):void 0===st.get(t,e)&&E.event.add(t,e,jt)}E.event={global:{},add:function(t,e,n,r,i){var o,a,s,u,c,l,f,h,p,d,y,v=st.get(t);if(ot(t))for(n.handler&&(n=(o=n).handler,i=o.selector),i&&E.find.matchesSelector(yt,i),n.guid||(n.guid=E.guid++),(u=v.events)||(u=v.events=Object.create(null)),(a=v.handle)||(a=v.handle=function(e){return void 0!==E&&E.event.triggered!==e.type?E.event.dispatch.apply(t,arguments):void 0}),c=(e=(e||"").match(Y)||[""]).length;c--;)p=y=(s=Ot.exec(e[c])||[])[1],d=(s[2]||"").split(".").sort(),p&&(f=E.event.special[p]||{},p=(i?f.delegateType:f.bindType)||p,f=E.event.special[p]||{},l=E.extend({type:p,origType:y,data:r,handler:n,guid:n.guid,selector:i,needsContext:i&&E.expr.match.needsContext.test(i),namespace:d.join(".")},o),(h=u[p])||((h=u[p]=[]).delegateCount=0,f.setup&&!1!==f.setup.call(t,r,d,a)||t.addEventListener&&t.addEventListener(p,a)),f.add&&(f.add.call(t,l),l.handler.guid||(l.handler.guid=n.guid)),i?h.splice(h.delegateCount++,0,l):h.push(l),E.event.global[p]=!0)},remove:function(t,e,n,r,i){var o,a,s,u,c,l,f,h,p,d,y,v=st.hasData(t)&&st.get(t);if(v&&(u=v.events)){for(c=(e=(e||"").match(Y)||[""]).length;c--;)if(p=y=(s=Ot.exec(e[c])||[])[1],d=(s[2]||"").split(".").sort(),p){for(f=E.event.special[p]||{},h=u[p=(r?f.delegateType:f.bindType)||p]||[],s=s[2]&&new RegExp("(^|\\.)"+d.join("\\.(?:.*\\.|)")+"(\\.|$)"),a=o=h.length;o--;)l=h[o],!i&&y!==l.origType||n&&n.guid!==l.guid||s&&!s.test(l.namespace)||r&&r!==l.selector&&("**"!==r||!l.selector)||(h.splice(o,1),l.selector&&h.delegateCount--,f.remove&&f.remove.call(t,l));a&&!h.length&&(f.teardown&&!1!==f.teardown.call(t,d,v.handle)||E.removeEvent(t,p,v.handle),delete u[p])}else for(p in u)E.event.remove(t,p+e[c],n,r,!0);E.isEmptyObject(u)&&st.remove(t,"handle events")}},dispatch:function(t){var e,n,r,i,o,a,s=new Array(arguments.length),u=E.event.fix(t),c=(st.get(this,"events")||Object.create(null))[u.type]||[],l=E.event.special[u.type]||{};for(s[0]=u,e=1;e=1))for(;c!==this;c=c.parentNode||this)if(1===c.nodeType&&("click"!==t.type||!0!==c.disabled)){for(o=[],a={},n=0;n-1:E.find(i,this,null,[c]).length),a[i]&&o.push(r);o.length&&s.push({elem:c,handlers:o})}return c=this,u\s*$/g;function Ft(t,e){return A(t,"table")&&A(11!==e.nodeType?e:e.firstChild,"tr")&&E(t).children("tbody")[0]||t}function Ht(t){return t.type=(null!==t.getAttribute("type"))+"/"+t.type,t}function Gt(t){return"true/"===(t.type||"").slice(0,5)?t.type=t.type.slice(5):t.removeAttribute("type"),t}function Vt(t,e){var n,r,i,o,a,s;if(1===e.nodeType){if(st.hasData(t)&&(s=st.get(t).events))for(i in st.remove(e,"handle events"),s)for(n=0,r=s[i].length;n1&&"string"==typeof d&&!v.checkClone&&qt.test(d))return t.each((function(i){var o=t.eq(i);y&&(e[0]=d.call(this,i,o.html())),$t(o,e,n,r)}));if(h&&(o=(i=Lt(e,t[0].ownerDocument,!1,t,r)).firstChild,1===i.childNodes.length&&(i=o),o||r)){for(s=(a=E.map(Pt(i,"script"),Ht)).length;f0&&Ct(a,!u&&Pt(t,"script")),s},cleanData:function(t){for(var e,n,r,i=E.event.special,o=0;void 0!==(n=t[o]);o++)if(ot(n)){if(e=n[st.expando]){if(e.events)for(r in e.events)i[r]?E.event.remove(n,r):E.removeEvent(n,r,e.handle);n[st.expando]=void 0}n[ut.expando]&&(n[ut.expando]=void 0)}}}),E.fn.extend({detach:function(t){return Yt(this,t,!0)},remove:function(t){return Yt(this,t)},text:function(t){return tt(this,(function(t){return void 0===t?E.text(this):this.empty().each((function(){1!==this.nodeType&&11!==this.nodeType&&9!==this.nodeType||(this.textContent=t)}))}),null,t,arguments.length)},append:function(){return $t(this,arguments,(function(t){1!==this.nodeType&&11!==this.nodeType&&9!==this.nodeType||Ft(this,t).appendChild(t)}))},prepend:function(){return $t(this,arguments,(function(t){if(1===this.nodeType||11===this.nodeType||9===this.nodeType){var e=Ft(this,t);e.insertBefore(t,e.firstChild)}}))},before:function(){return $t(this,arguments,(function(t){this.parentNode&&this.parentNode.insertBefore(t,this)}))},after:function(){return $t(this,arguments,(function(t){this.parentNode&&this.parentNode.insertBefore(t,this.nextSibling)}))},empty:function(){for(var t,e=0;null!=(t=this[e]);e++)1===t.nodeType&&(E.cleanData(Pt(t,!1)),t.textContent="");return this},clone:function(t,e){return t=null!=t&&t,e=null==e?t:e,this.map((function(){return E.clone(this,t,e)}))},html:function(t){return tt(this,(function(t){var e=this[0]||{},n=0,r=this.length;if(void 0===t&&1===e.nodeType)return e.innerHTML;if("string"==typeof t&&!zt.test(t)&&!Tt[(Mt.exec(t)||["",""])[1].toLowerCase()]){t=E.htmlPrefilter(t);try{for(;n=0&&(u+=Math.max(0,Math.ceil(t["offset"+e[0].toUpperCase()+e.slice(1)]-o-u-s-.5))||0),u+c}function le(t,e,n){var r=Zt(t),i=(!v.boxSizingReliable()||n)&&"border-box"===E.css(t,"boxSizing",!1,r),o=i,a=Jt(t,e,r),s="offset"+e[0].toUpperCase()+e.slice(1);if(Xt.test(a)){if(!n)return a;a="auto"}return(!v.boxSizingReliable()&&i||!v.reliableTrDimensions()&&A(t,"tr")||"auto"===a||!parseFloat(a)&&"inline"===E.css(t,"display",!1,r))&&t.getClientRects().length&&(i="border-box"===E.css(t,"boxSizing",!1,r),(o=s in t)&&(a=t[s])),(a=parseFloat(a)||0)+ce(t,e,n||(i?"border":"content"),o,r,a)+"px"}function fe(t,e,n,r,i){return new fe.prototype.init(t,e,n,r,i)}E.extend({cssHooks:{opacity:{get:function(t,e){if(e){var n=Jt(t,"opacity");return""===n?"1":n}}}},cssNumber:{animationIterationCount:!0,aspectRatio:!0,borderImageSlice:!0,columnCount:!0,flexGrow:!0,flexShrink:!0,fontWeight:!0,gridArea:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnStart:!0,gridRow:!0,gridRowEnd:!0,gridRowStart:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,scale:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeMiterlimit:!0,strokeOpacity:!0},cssProps:{},style:function(t,e,n,r){if(t&&3!==t.nodeType&&8!==t.nodeType&&t.style){var i,o,a,s=it(e),u=Wt.test(e),c=t.style;if(u||(e=ie(s)),a=E.cssHooks[e]||E.cssHooks[s],void 0===n)return a&&"get"in a&&void 0!==(i=a.get(t,!1,r))?i:c[e];"string"==(o=typeof n)&&(i=pt.exec(n))&&i[1]&&(n=mt(t,e,i),o="number"),null!=n&&n==n&&("number"!==o||u||(n+=i&&i[3]||(E.cssNumber[s]?"":"px")),v.clearCloneStyle||""!==n||0!==e.indexOf("background")||(c[e]="inherit"),a&&"set"in a&&void 0===(n=a.set(t,n,r))||(u?c.setProperty(e,n):c[e]=n))}},css:function(t,e,n,r){var i,o,a,s=it(e);return Wt.test(e)||(e=ie(s)),(a=E.cssHooks[e]||E.cssHooks[s])&&"get"in a&&(i=a.get(t,!0,n)),void 0===i&&(i=Jt(t,e,r)),"normal"===i&&e in se&&(i=se[e]),""===n||n?(o=parseFloat(i),!0===n||isFinite(o)?o||0:i):i}}),E.each(["height","width"],(function(t,e){E.cssHooks[e]={get:function(t,n,r){if(n)return!oe.test(E.css(t,"display"))||t.getClientRects().length&&t.getBoundingClientRect().width?le(t,e,r):Kt(t,ae,(function(){return le(t,e,r)}))},set:function(t,n,r){var i,o=Zt(t),a=!v.scrollboxSize()&&"absolute"===o.position,s=(a||r)&&"border-box"===E.css(t,"boxSizing",!1,o),u=r?ce(t,e,r,s,o):0;return s&&a&&(u-=Math.ceil(t["offset"+e[0].toUpperCase()+e.slice(1)]-parseFloat(o[e])-ce(t,e,"border",!1,o)-.5)),u&&(i=pt.exec(n))&&"px"!==(i[3]||"px")&&(t.style[e]=n,n=E.css(t,e)),ue(0,n,u)}}})),E.cssHooks.marginLeft=te(v.reliableMarginLeft,(function(t,e){if(e)return(parseFloat(Jt(t,"marginLeft"))||t.getBoundingClientRect().left-Kt(t,{marginLeft:0},(function(){return t.getBoundingClientRect().left})))+"px"})),E.each({margin:"",padding:"",border:"Width"},(function(t,e){E.cssHooks[t+e]={expand:function(n){for(var r=0,i={},o="string"==typeof n?n.split(" "):[n];r<4;r++)i[t+dt[r]+e]=o[r]||o[r-2]||o[0];return i}},"margin"!==t&&(E.cssHooks[t+e].set=ue)})),E.fn.extend({css:function(t,e){return tt(this,(function(t,e,n){var r,i,o={},a=0;if(Array.isArray(e)){for(r=Zt(t),i=e.length;a1)}}),E.Tween=fe,fe.prototype={constructor:fe,init:function(t,e,n,r,i,o){this.elem=t,this.prop=n,this.easing=i||E.easing._default,this.options=e,this.start=this.now=this.cur(),this.end=r,this.unit=o||(E.cssNumber[n]?"":"px")},cur:function(){var t=fe.propHooks[this.prop];return t&&t.get?t.get(this):fe.propHooks._default.get(this)},run:function(t){var e,n=fe.propHooks[this.prop];return this.options.duration?this.pos=e=E.easing[this.easing](t,this.options.duration*t,0,1,this.options.duration):this.pos=e=t,this.now=(this.end-this.start)*e+this.start,this.options.step&&this.options.step.call(this.elem,this.now,this),n&&n.set?n.set(this):fe.propHooks._default.set(this),this}},fe.prototype.init.prototype=fe.prototype,fe.propHooks={_default:{get:function(t){var e;return 1!==t.elem.nodeType||null!=t.elem[t.prop]&&null==t.elem.style[t.prop]?t.elem[t.prop]:(e=E.css(t.elem,t.prop,""))&&"auto"!==e?e:0},set:function(t){E.fx.step[t.prop]?E.fx.step[t.prop](t):1!==t.elem.nodeType||!E.cssHooks[t.prop]&&null==t.elem.style[ie(t.prop)]?t.elem[t.prop]=t.now:E.style(t.elem,t.prop,t.now+t.unit)}}},fe.propHooks.scrollTop=fe.propHooks.scrollLeft={set:function(t){t.elem.nodeType&&t.elem.parentNode&&(t.elem[t.prop]=t.now)}},E.easing={linear:function(t){return t},swing:function(t){return.5-Math.cos(t*Math.PI)/2},_default:"swing"},E.fx=fe.prototype.init,E.fx.step={};var he,pe,de=/^(?:toggle|show|hide)$/,ye=/queueHooks$/;function ve(){pe&&(!1===m.hidden&&r.requestAnimationFrame?r.requestAnimationFrame(ve):r.setTimeout(ve,E.fx.interval),E.fx.tick())}function ge(){return r.setTimeout((function(){he=void 0})),he=Date.now()}function xe(t,e){var n,r=0,i={height:t};for(e=e?1:0;r<4;r+=2-e)i["margin"+(n=dt[r])]=i["padding"+n]=t;return e&&(i.opacity=i.width=t),i}function me(t,e,n){for(var r,i=(be.tweeners[e]||[]).concat(be.tweeners["*"]),o=0,a=i.length;o1)},removeAttr:function(t){return this.each((function(){E.removeAttr(this,t)}))}}),E.extend({attr:function(t,e,n){var r,i,o=t.nodeType;if(3!==o&&8!==o&&2!==o)return void 0===t.getAttribute?E.prop(t,e,n):(1===o&&E.isXMLDoc(t)||(i=E.attrHooks[e.toLowerCase()]||(E.expr.match.bool.test(e)?_e:void 0)),void 0!==n?null===n?void E.removeAttr(t,e):i&&"set"in i&&void 0!==(r=i.set(t,n,e))?r:(t.setAttribute(e,n+""),n):i&&"get"in i&&null!==(r=i.get(t,e))?r:null==(r=E.find.attr(t,e))?void 0:r)},attrHooks:{type:{set:function(t,e){if(!v.radioValue&&"radio"===e&&A(t,"input")){var n=t.value;return t.setAttribute("type",e),n&&(t.value=n),e}}}},removeAttr:function(t,e){var n,r=0,i=e&&e.match(Y);if(i&&1===t.nodeType)for(;n=i[r++];)t.removeAttribute(n)}}),_e={set:function(t,e,n){return!1===e?E.removeAttr(t,n):t.setAttribute(n,n),n}},E.each(E.expr.match.bool.source.match(/\w+/g),(function(t,e){var n=we[e]||E.find.attr;we[e]=function(t,e,r){var i,o,a=e.toLowerCase();return r||(o=we[a],we[a]=i,i=null!=n(t,e,r)?a:null,we[a]=o),i}}));var ke=/^(?:input|select|textarea|button)$/i,Se=/^(?:a|area)$/i;function Ee(t){return(t.match(Y)||[]).join(" ")}function Me(t){return t.getAttribute&&t.getAttribute("class")||""}function Ae(t){return Array.isArray(t)?t:"string"==typeof t&&t.match(Y)||[]}E.fn.extend({prop:function(t,e){return tt(this,E.prop,t,e,arguments.length>1)},removeProp:function(t){return this.each((function(){delete this[E.propFix[t]||t]}))}}),E.extend({prop:function(t,e,n){var r,i,o=t.nodeType;if(3!==o&&8!==o&&2!==o)return 1===o&&E.isXMLDoc(t)||(e=E.propFix[e]||e,i=E.propHooks[e]),void 0!==n?i&&"set"in i&&void 0!==(r=i.set(t,n,e))?r:t[e]=n:i&&"get"in i&&null!==(r=i.get(t,e))?r:t[e]},propHooks:{tabIndex:{get:function(t){var e=E.find.attr(t,"tabindex");return e?parseInt(e,10):ke.test(t.nodeName)||Se.test(t.nodeName)&&t.href?0:-1}}},propFix:{for:"htmlFor",class:"className"}}),v.optSelected||(E.propHooks.selected={get:function(t){var e=t.parentNode;return e&&e.parentNode&&e.parentNode.selectedIndex,null},set:function(t){var e=t.parentNode;e&&(e.selectedIndex,e.parentNode&&e.parentNode.selectedIndex)}}),E.each(["tabIndex","readOnly","maxLength","cellSpacing","cellPadding","rowSpan","colSpan","useMap","frameBorder","contentEditable"],(function(){E.propFix[this.toLowerCase()]=this})),E.fn.extend({addClass:function(t){var e,n,r,i,o,a;return g(t)?this.each((function(e){E(this).addClass(t.call(this,e,Me(this)))})):(e=Ae(t)).length?this.each((function(){if(r=Me(this),n=1===this.nodeType&&" "+Ee(r)+" "){for(o=0;o-1;)n=n.replace(" "+i+" "," ");a=Ee(n),r!==a&&this.setAttribute("class",a)}})):this:this.attr("class","")},toggleClass:function(t,e){var n,r,i,o,a=typeof t,s="string"===a||Array.isArray(t);return g(t)?this.each((function(n){E(this).toggleClass(t.call(this,n,Me(this),e),e)})):"boolean"==typeof e&&s?e?this.addClass(t):this.removeClass(t):(n=Ae(t),this.each((function(){if(s)for(o=E(this),i=0;i-1)return!0;return!1}});var Te=/\r/g;E.fn.extend({val:function(t){var e,n,r,i=this[0];return arguments.length?(r=g(t),this.each((function(n){var i;1===this.nodeType&&(null==(i=r?t.call(this,n,E(this).val()):t)?i="":"number"==typeof i?i+="":Array.isArray(i)&&(i=E.map(i,(function(t){return null==t?"":t+""}))),(e=E.valHooks[this.type]||E.valHooks[this.nodeName.toLowerCase()])&&"set"in e&&void 0!==e.set(this,i,"value")||(this.value=i))}))):i?(e=E.valHooks[i.type]||E.valHooks[i.nodeName.toLowerCase()])&&"get"in e&&void 0!==(n=e.get(i,"value"))?n:"string"==typeof(n=i.value)?n.replace(Te,""):null==n?"":n:void 0}}),E.extend({valHooks:{option:{get:function(t){var e=E.find.attr(t,"value");return null!=e?e:Ee(E.text(t))}},select:{get:function(t){var e,n,r,i=t.options,o=t.selectedIndex,a="select-one"===t.type,s=a?null:[],u=a?o+1:i.length;for(r=o<0?u:a?o:0;r-1)&&(n=!0);return n||(t.selectedIndex=-1),o}}}}),E.each(["radio","checkbox"],(function(){E.valHooks[this]={set:function(t,e){if(Array.isArray(e))return t.checked=E.inArray(E(t).val(),e)>-1}},v.checkOn||(E.valHooks[this].get=function(t){return null===t.getAttribute("value")?"on":t.value})}));var Pe=r.location,Ce={guid:Date.now()},Ne=/\?/;E.parseXML=function(t){var e,n;if(!t||"string"!=typeof t)return null;try{e=(new r.DOMParser).parseFromString(t,"text/xml")}catch(t){}return n=e&&e.getElementsByTagName("parsererror")[0],e&&!n||E.error("Invalid XML: "+(n?E.map(n.childNodes,(function(t){return t.textContent})).join("\n"):t)),e};var Le=/^(?:focusinfocus|focusoutblur)$/,Oe=function(t){t.stopPropagation()};E.extend(E.event,{trigger:function(t,e,n,i){var o,a,s,u,c,l,f,h,d=[n||m],y=p.call(t,"type")?t.type:t,v=p.call(t,"namespace")?t.namespace.split("."):[];if(a=h=s=n=n||m,3!==n.nodeType&&8!==n.nodeType&&!Le.test(y+E.event.triggered)&&(y.indexOf(".")>-1&&(v=y.split("."),y=v.shift(),v.sort()),c=y.indexOf(":")<0&&"on"+y,(t=t[E.expando]?t:new E.Event(y,"object"==typeof t&&t)).isTrigger=i?2:3,t.namespace=v.join("."),t.rnamespace=t.namespace?new RegExp("(^|\\.)"+v.join("\\.(?:.*\\.|)")+"(\\.|$)"):null,t.result=void 0,t.target||(t.target=n),e=null==e?[t]:E.makeArray(e,[t]),f=E.event.special[y]||{},i||!f.trigger||!1!==f.trigger.apply(n,e))){if(!i&&!f.noBubble&&!x(n)){for(u=f.delegateType||y,Le.test(u+y)||(a=a.parentNode);a;a=a.parentNode)d.push(a),s=a;s===(n.ownerDocument||m)&&d.push(s.defaultView||s.parentWindow||r)}for(o=0;(a=d[o++])&&!t.isPropagationStopped();)h=a,t.type=o>1?u:f.bindType||y,(l=(st.get(a,"events")||Object.create(null))[t.type]&&st.get(a,"handle"))&&l.apply(a,e),(l=c&&a[c])&&l.apply&&ot(a)&&(t.result=l.apply(a,e),!1===t.result&&t.preventDefault());return t.type=y,i||t.isDefaultPrevented()||f._default&&!1!==f._default.apply(d.pop(),e)||!ot(n)||c&&g(n[y])&&!x(n)&&((s=n[c])&&(n[c]=null),E.event.triggered=y,t.isPropagationStopped()&&h.addEventListener(y,Oe),n[y](),t.isPropagationStopped()&&h.removeEventListener(y,Oe),E.event.triggered=void 0,s&&(n[c]=s)),t.result}},simulate:function(t,e,n){var r=E.extend(new E.Event,n,{type:t,isSimulated:!0});E.event.trigger(r,null,e)}}),E.fn.extend({trigger:function(t,e){return this.each((function(){E.event.trigger(t,e,this)}))},triggerHandler:function(t,e){var n=this[0];if(n)return E.event.trigger(t,e,n,!0)}});var je=/\[\]$/,De=/\r?\n/g,Ie=/^(?:submit|button|image|reset|file)$/i,Re=/^(?:input|select|textarea|keygen)/i;function ze(t,e,n,r){var i;if(Array.isArray(e))E.each(e,(function(e,i){n||je.test(t)?r(t,i):ze(t+"["+("object"==typeof i&&null!=i?e:"")+"]",i,n,r)}));else if(n||"object"!==w(e))r(t,e);else for(i in e)ze(t+"["+i+"]",e[i],n,r)}E.param=function(t,e){var n,r=[],i=function(t,e){var n=g(e)?e():e;r[r.length]=encodeURIComponent(t)+"="+encodeURIComponent(null==n?"":n)};if(null==t)return"";if(Array.isArray(t)||t.jquery&&!E.isPlainObject(t))E.each(t,(function(){i(this.name,this.value)}));else for(n in t)ze(n,t[n],e,i);return r.join("&")},E.fn.extend({serialize:function(){return E.param(this.serializeArray())},serializeArray:function(){return this.map((function(){var t=E.prop(this,"elements");return t?E.makeArray(t):this})).filter((function(){var t=this.type;return this.name&&!E(this).is(":disabled")&&Re.test(this.nodeName)&&!Ie.test(t)&&(this.checked||!Et.test(t))})).map((function(t,e){var n=E(this).val();return null==n?null:Array.isArray(n)?E.map(n,(function(t){return{name:e.name,value:t.replace(De,"\r\n")}})):{name:e.name,value:n.replace(De,"\r\n")}})).get()}});var qe=/%20/g,Be=/#.*$/,Fe=/([?&])_=[^&]*/,He=/^(.*?):[ \t]*([^\r\n]*)$/gm,Ge=/^(?:GET|HEAD)$/,Ve=/^\/\//,Ue={},$e={},Ye="*/".concat("*"),Xe=m.createElement("a");function We(t){return function(e,n){"string"!=typeof e&&(n=e,e="*");var r,i=0,o=e.toLowerCase().match(Y)||[];if(g(n))for(;r=o[i++];)"+"===r[0]?(r=r.slice(1)||"*",(t[r]=t[r]||[]).unshift(n)):(t[r]=t[r]||[]).push(n)}}function Ze(t,e,n,r){var i={},o=t===$e;function a(s){var u;return i[s]=!0,E.each(t[s]||[],(function(t,s){var c=s(e,n,r);return"string"!=typeof c||o||i[c]?o?!(u=c):void 0:(e.dataTypes.unshift(c),a(c),!1)})),u}return a(e.dataTypes[0])||!i["*"]&&a("*")}function Ke(t,e){var n,r,i=E.ajaxSettings.flatOptions||{};for(n in e)void 0!==e[n]&&((i[n]?t:r||(r={}))[n]=e[n]);return r&&E.extend(!0,t,r),t}Xe.href=Pe.href,E.extend({active:0,lastModified:{},etag:{},ajaxSettings:{url:Pe.href,type:"GET",isLocal:/^(?:about|app|app-storage|.+-extension|file|res|widget):$/.test(Pe.protocol),global:!0,processData:!0,async:!0,contentType:"application/x-www-form-urlencoded; charset=UTF-8",accepts:{"*":Ye,text:"text/plain",html:"text/html",xml:"application/xml, text/xml",json:"application/json, text/javascript"},contents:{xml:/\bxml\b/,html:/\bhtml/,json:/\bjson\b/},responseFields:{xml:"responseXML",text:"responseText",json:"responseJSON"},converters:{"* text":String,"text html":!0,"text json":JSON.parse,"text xml":E.parseXML},flatOptions:{url:!0,context:!0}},ajaxSetup:function(t,e){return e?Ke(Ke(t,E.ajaxSettings),e):Ke(E.ajaxSettings,t)},ajaxPrefilter:We(Ue),ajaxTransport:We($e),ajax:function(t,e){"object"==typeof t&&(e=t,t=void 0),e=e||{};var n,i,o,a,s,u,c,l,f,h,p=E.ajaxSetup({},e),d=p.context||p,y=p.context&&(d.nodeType||d.jquery)?E(d):E.event,v=E.Deferred(),g=E.Callbacks("once memory"),x=p.statusCode||{},b={},_={},w="canceled",k={readyState:0,getResponseHeader:function(t){var e;if(c){if(!a)for(a={};e=He.exec(o);)a[e[1].toLowerCase()+" "]=(a[e[1].toLowerCase()+" "]||[]).concat(e[2]);e=a[t.toLowerCase()+" "]}return null==e?null:e.join(", ")},getAllResponseHeaders:function(){return c?o:null},setRequestHeader:function(t,e){return null==c&&(t=_[t.toLowerCase()]=_[t.toLowerCase()]||t,b[t]=e),this},overrideMimeType:function(t){return null==c&&(p.mimeType=t),this},statusCode:function(t){var e;if(t)if(c)k.always(t[k.status]);else for(e in t)x[e]=[x[e],t[e]];return this},abort:function(t){var e=t||w;return n&&n.abort(e),S(0,e),this}};if(v.promise(k),p.url=((t||p.url||Pe.href)+"").replace(Ve,Pe.protocol+"//"),p.type=e.method||e.type||p.method||p.type,p.dataTypes=(p.dataType||"*").toLowerCase().match(Y)||[""],null==p.crossDomain){u=m.createElement("a");try{u.href=p.url,u.href=u.href,p.crossDomain=Xe.protocol+"//"+Xe.host!=u.protocol+"//"+u.host}catch(t){p.crossDomain=!0}}if(p.data&&p.processData&&"string"!=typeof p.data&&(p.data=E.param(p.data,p.traditional)),Ze(Ue,p,e,k),c)return k;for(f in(l=E.event&&p.global)&&0==E.active++&&E.event.trigger("ajaxStart"),p.type=p.type.toUpperCase(),p.hasContent=!Ge.test(p.type),i=p.url.replace(Be,""),p.hasContent?p.data&&p.processData&&0===(p.contentType||"").indexOf("application/x-www-form-urlencoded")&&(p.data=p.data.replace(qe,"+")):(h=p.url.slice(i.length),p.data&&(p.processData||"string"==typeof p.data)&&(i+=(Ne.test(i)?"&":"?")+p.data,delete p.data),!1===p.cache&&(i=i.replace(Fe,"$1"),h=(Ne.test(i)?"&":"?")+"_="+Ce.guid+++h),p.url=i+h),p.ifModified&&(E.lastModified[i]&&k.setRequestHeader("If-Modified-Since",E.lastModified[i]),E.etag[i]&&k.setRequestHeader("If-None-Match",E.etag[i])),(p.data&&p.hasContent&&!1!==p.contentType||e.contentType)&&k.setRequestHeader("Content-Type",p.contentType),k.setRequestHeader("Accept",p.dataTypes[0]&&p.accepts[p.dataTypes[0]]?p.accepts[p.dataTypes[0]]+("*"!==p.dataTypes[0]?", "+Ye+"; q=0.01":""):p.accepts["*"]),p.headers)k.setRequestHeader(f,p.headers[f]);if(p.beforeSend&&(!1===p.beforeSend.call(d,k,p)||c))return k.abort();if(w="abort",g.add(p.complete),k.done(p.success),k.fail(p.error),n=Ze($e,p,e,k)){if(k.readyState=1,l&&y.trigger("ajaxSend",[k,p]),c)return k;p.async&&p.timeout>0&&(s=r.setTimeout((function(){k.abort("timeout")}),p.timeout));try{c=!1,n.send(b,S)}catch(t){if(c)throw t;S(-1,t)}}else S(-1,"No Transport");function S(t,e,a,u){var f,h,m,b,_,w=e;c||(c=!0,s&&r.clearTimeout(s),n=void 0,o=u||"",k.readyState=t>0?4:0,f=t>=200&&t<300||304===t,a&&(b=function(t,e,n){for(var r,i,o,a,s=t.contents,u=t.dataTypes;"*"===u[0];)u.shift(),void 0===r&&(r=t.mimeType||e.getResponseHeader("Content-Type"));if(r)for(i in s)if(s[i]&&s[i].test(r)){u.unshift(i);break}if(u[0]in n)o=u[0];else{for(i in n){if(!u[0]||t.converters[i+" "+u[0]]){o=i;break}a||(a=i)}o=o||a}if(o)return o!==u[0]&&u.unshift(o),n[o]}(p,k,a)),!f&&E.inArray("script",p.dataTypes)>-1&&E.inArray("json",p.dataTypes)<0&&(p.converters["text script"]=function(){}),b=function(t,e,n,r){var i,o,a,s,u,c={},l=t.dataTypes.slice();if(l[1])for(a in t.converters)c[a.toLowerCase()]=t.converters[a];for(o=l.shift();o;)if(t.responseFields[o]&&(n[t.responseFields[o]]=e),!u&&r&&t.dataFilter&&(e=t.dataFilter(e,t.dataType)),u=o,o=l.shift())if("*"===o)o=u;else if("*"!==u&&u!==o){if(!(a=c[u+" "+o]||c["* "+o]))for(i in c)if((s=i.split(" "))[1]===o&&(a=c[u+" "+s[0]]||c["* "+s[0]])){!0===a?a=c[i]:!0!==c[i]&&(o=s[0],l.unshift(s[1]));break}if(!0!==a)if(a&&t.throws)e=a(e);else try{e=a(e)}catch(t){return{state:"parsererror",error:a?t:"No conversion from "+u+" to "+o}}}return{state:"success",data:e}}(p,b,k,f),f?(p.ifModified&&((_=k.getResponseHeader("Last-Modified"))&&(E.lastModified[i]=_),(_=k.getResponseHeader("etag"))&&(E.etag[i]=_)),204===t||"HEAD"===p.type?w="nocontent":304===t?w="notmodified":(w=b.state,h=b.data,f=!(m=b.error))):(m=w,!t&&w||(w="error",t<0&&(t=0))),k.status=t,k.statusText=(e||w)+"",f?v.resolveWith(d,[h,w,k]):v.rejectWith(d,[k,w,m]),k.statusCode(x),x=void 0,l&&y.trigger(f?"ajaxSuccess":"ajaxError",[k,p,f?h:m]),g.fireWith(d,[k,w]),l&&(y.trigger("ajaxComplete",[k,p]),--E.active||E.event.trigger("ajaxStop")))}return k},getJSON:function(t,e,n){return E.get(t,e,n,"json")},getScript:function(t,e){return E.get(t,void 0,e,"script")}}),E.each(["get","post"],(function(t,e){E[e]=function(t,n,r,i){return g(n)&&(i=i||r,r=n,n=void 0),E.ajax(E.extend({url:t,type:e,dataType:i,data:n,success:r},E.isPlainObject(t)&&t))}})),E.ajaxPrefilter((function(t){var e;for(e in t.headers)"content-type"===e.toLowerCase()&&(t.contentType=t.headers[e]||"")})),E._evalUrl=function(t,e,n){return E.ajax({url:t,type:"GET",dataType:"script",cache:!0,async:!1,global:!1,converters:{"text script":function(){}},dataFilter:function(t){E.globalEval(t,e,n)}})},E.fn.extend({wrapAll:function(t){var e;return this[0]&&(g(t)&&(t=t.call(this[0])),e=E(t,this[0].ownerDocument).eq(0).clone(!0),this[0].parentNode&&e.insertBefore(this[0]),e.map((function(){for(var t=this;t.firstElementChild;)t=t.firstElementChild;return t})).append(this)),this},wrapInner:function(t){return g(t)?this.each((function(e){E(this).wrapInner(t.call(this,e))})):this.each((function(){var e=E(this),n=e.contents();n.length?n.wrapAll(t):e.append(t)}))},wrap:function(t){var e=g(t);return this.each((function(n){E(this).wrapAll(e?t.call(this,n):t)}))},unwrap:function(t){return this.parent(t).not("body").each((function(){E(this).replaceWith(this.childNodes)})),this}}),E.expr.pseudos.hidden=function(t){return!E.expr.pseudos.visible(t)},E.expr.pseudos.visible=function(t){return!!(t.offsetWidth||t.offsetHeight||t.getClientRects().length)},E.ajaxSettings.xhr=function(){try{return new r.XMLHttpRequest}catch(t){}};var Qe={0:200,1223:204},Je=E.ajaxSettings.xhr();v.cors=!!Je&&"withCredentials"in Je,v.ajax=Je=!!Je,E.ajaxTransport((function(t){var e,n;if(v.cors||Je&&!t.crossDomain)return{send:function(i,o){var a,s=t.xhr();if(s.open(t.type,t.url,t.async,t.username,t.password),t.xhrFields)for(a in t.xhrFields)s[a]=t.xhrFields[a];for(a in t.mimeType&&s.overrideMimeType&&s.overrideMimeType(t.mimeType),t.crossDomain||i["X-Requested-With"]||(i["X-Requested-With"]="XMLHttpRequest"),i)s.setRequestHeader(a,i[a]);e=function(t){return function(){e&&(e=n=s.onload=s.onerror=s.onabort=s.ontimeout=s.onreadystatechange=null,"abort"===t?s.abort():"error"===t?"number"!=typeof s.status?o(0,"error"):o(s.status,s.statusText):o(Qe[s.status]||s.status,s.statusText,"text"!==(s.responseType||"text")||"string"!=typeof s.responseText?{binary:s.response}:{text:s.responseText},s.getAllResponseHeaders()))}},s.onload=e(),n=s.onerror=s.ontimeout=e("error"),void 0!==s.onabort?s.onabort=n:s.onreadystatechange=function(){4===s.readyState&&r.setTimeout((function(){e&&n()}))},e=e("abort");try{s.send(t.hasContent&&t.data||null)}catch(t){if(e)throw t}},abort:function(){e&&e()}}})),E.ajaxPrefilter((function(t){t.crossDomain&&(t.contents.script=!1)})),E.ajaxSetup({accepts:{script:"text/javascript, application/javascript, application/ecmascript, application/x-ecmascript"},contents:{script:/\b(?:java|ecma)script\b/},converters:{"text script":function(t){return E.globalEval(t),t}}}),E.ajaxPrefilter("script",(function(t){void 0===t.cache&&(t.cache=!1),t.crossDomain&&(t.type="GET")})),E.ajaxTransport("script",(function(t){var e,n;if(t.crossDomain||t.scriptAttrs)return{send:function(r,i){e=E("